{"_id":"@ridedott/firestore-extensions","_rev":"2269-ba34fae57ce3a1d7dc1e1c8ab6060957","name":"@ridedott/firestore-extensions","dist-tags":{"dev":"6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0","latest":"6.19.4"},"versions":{"0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0","gitHead":"f8f87daff42ae5c0d0cc2c2330550415367249a1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-nU/zlJoFl7SgruAUboYMKBYzthxxVobAT/cqcHTvUKUwT4Pj0pMBG0NxNRpiDVDnvBCHRuYcBwiwpJitB8FeFg==","shasum":"dff1af20834b0640a9cd2b412dfafa5ccdbbaab8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0.tgz","fileCount":27,"unpackedSize":49864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXQGSCRA9TVsSAnZWagAA0EUP/jPIucOc9BFTFMhKt23U\nW2jlHwtznN7njIME4ELgd166kB5mlBXpSy8gEpTwN2tQ4gf9Dee6erMWLliB\npLPhIgF4i210G3xOYGBNUL2W3HSYqIPFcDw5LP4NbX4GH76CuWwAgl1PdvtE\n0OICeAuKbDc+L0jO0YFr4dX/XlVugM/bNS+oBpvxT/7SbqsP7KtOqb/rRlJL\nGcRTedU0j6jCRodP3KANGPRU6xdCGNq7ul1y2lV45IYw9ZJj0xU483hpHSXI\nyS8sLEPcxRiQo5rP+/8uL0hsA2up6hql/kwBRr75byWd38Z/83NpABoQ7i3Y\nqahkfMDBKP5nkwDajrIJnf9vCdS8te+a87nYuMiJrFEzs4cqfJsLkp6qiPXc\nFVwM7oIoNxQ8SozCi28Au99BLNFfyUriDAW9U64lniZOZqcCTixsLx8Anni9\nrkbIiwqsxpiHFzqZ9huRNjb2CbyVJFdlCm9JHZDB+mUZk4s7Xh/b5Sk4fKJf\njISoH9q7LcbaDpTHgS3aDKVBY+RueE4FobcsfG1NP/8dHQNRr+W4RjLo4cVN\nJ540DZBbWXQoJqfqyfcf1VLun1BELXRTDoodb8QewQgP0lhf9xMwHDvhy0FL\nZV5wcku7859wY7Dbk8xTuXtuaesbuei4eUV+TK4Sz0QFb1vMZbTv6TcKm0mP\nvNas\r\n=WQd5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwGjlfr5PF8sMug19gP5jLQAQ/o8ymrql4N3bl/nevsAiAznD+/d7nMT2Cqtw95b9dNKcLMHqndePp64aNlVPkS3g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0_1583153553953_0.1827736367141286"},"_hasShrinkwrap":false},"0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0","gitHead":"2e8c4f9b9983e9c8b24701f30369d5f11c669175","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-LSI3HZGB2bHqoCGEg2NWAOYfLgMKxMpGrfP1RcH5H7l1yqBJcbvo0CZTQpwWd+OJsGUvWEcAhY4X3RnKIYyHhQ==","shasum":"55b34baea9422a8961020bc658d0c95dc88605eb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0.tgz","fileCount":27,"unpackedSize":49864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXQJVCRA9TVsSAnZWagAAdJQP/j+djBpX012/D0v4eJKd\nLPfYVqUDiQrfGVO6f9gR4b7u49qUXbqJ4ONQTvfX1lA99Iqxr/8x2mxo+lHD\nMeQfOE+SvsmXEG4ehPOewj6K4mziG0H5sVSHIHxHiqS25Reac18BU59+UVn3\n+54S2UTSFunmFO2CrxMDU84SVRXFw+mPeH5v7HaTFvIqJPP294wGRrx12fY9\nQObSFb4KzhyZIYJMAzI0YzbsctO6ucU4VjZirlcq8oQJKQCG97R6t5TAZevK\nRle9BbSF3KUo5q7Cn1JY8ZEyEIO6SFHEntTJavANGGkyqd9rq4MOaA7uKMJY\ni4gyCBaLzvBmF9rlonCSwtJwT7Ml/VhIQ3xr6N2ItZyWFhlH/n4HHh+68VlW\nb33//saqekplkDqiPiQYAmY/BoSxH06uyI4AcFUQqel/prlClcFUPDIg4FOF\neiT04K0eZ8pQlHvVhrPzghNmLdQ4pQK6T97FgR8web7GxBFs1Gf3p2ohjLKH\nBbViwUHn1UAEC4zF9Jy/Y8xY5Nd2nvsOgvxCa0gVyM6bRZNNsdPEPQbKmVx3\n2b3szVQ17I4qeuIDco42U4UtU1T1KyuzCxHSx3OwNW+Mgmt1ud9OWZwxSqXd\nLxNZLhHZyqJMTbA/AYE4kgzNovUdIidslBYOt4V5xqQngNloGPAayYOsFlJq\nGuSx\r\n=jVo8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsSBd0Y9IUrBPKTKOQsYt57W8tlEIcgzSsgHe3TxMsVAiEA+qMXlAXpSmNVs+s7nErgN1XSyv6yefMELPU63H2ypY4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0_1583153748835_0.05245877108299646"},"_hasShrinkwrap":false},"0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0","gitHead":"f1a2d87189daeab370ff6940b49a340d2baad014","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-OHp2Cq2pgFVpwaMMUD/gAbP6NcHaDw+fEIo5dpR3Bb9sWXCMHAFR3fc+e6W5vjpHtSfTGtxSV3315QWapRmZJA==","shasum":"524223c741f027f1641c47c0b4a875245f564f4e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0.tgz","fileCount":27,"unpackedSize":49689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXQKUCRA9TVsSAnZWagAAz1MQAJa8ywDaqmmYLh5KmzRZ\nCg32K8Xrql0UcOrp/JVJ8l9elxs3bquO+V+fDdhQfUsjIbdJFXcOSlrT2Hhf\n7EpMz8ibLH7+kB/+DWbcIAPfnUchwUBB2sC1zKlAip6P48OQw6Hdcx886lBq\nsB28pR7Ezkkv7dQUc9dx2IB338jxsk1I2yppLqbut2wj/8XAaIioh7I6WBj+\nuFZg2CDqbGk96uQSjpQHiMm+RFcUJvc6rfkJvWU3pkHZv3GHrrnmIMW3dN9j\nVQ2ECbQQOwpDgXl0FZgyap0aDLeotaTqV3brbgi0d16QvW8HPgN0PFwf36Ko\njEFRjOeWeT82R+KXKT/pFstIhM/wXnKR7pvAWbl7jNwqWtNUoUmBTYkW/Ov4\nqIBz42ujVcCKjhHF38UDMDcW51N0oUidlnX5GqSkt6baoTwxhxIffnWGH5Yw\nfkwrfCWaOz5OoaG79qQ4lpgg64IyV+4BOw3dpnhCV3pyP6Gli+W+n0WlwTRy\ngS5zxJU8waCYwBkU4ntUbeUDi/Vz5Zullu2gem5NdprIXNZ7WQSthCs223Vf\nFRterIr66uiifc38xpSEnAXf2CXLYg6MC4eAopKLvfOvNsfO2EbjHMWQBENj\nuHKqTg2OVjDgbw7AnEi9td8tibixskd4xqmUx80lcxOj8N/j1EM+hBpw40cD\ni+Nm\r\n=s+sQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGE81kOWAIVDc72wvNEt/QtC3tZkHMgOWUciEVyueccbAiAMYcJGKXKynpURkhZJ6QgRLNVC2siwooJ1cqDrY+OvJA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0_1583153812071_0.41131005685824196"},"_hasShrinkwrap":false},"0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0","gitHead":"9c41de9f46832062dfa8c2ad85ecd37d69405b5a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-+IaVGEnc941u5RoIzyN4LAy1UZCUG0k6FC7NvT4UhN9vRbUmSL3QVCA1XkMEGeoQJ6d63+C+3hQ6+16oGAFm5g==","shasum":"ea6c994c49890d99fc56229dcd645bdf215678b9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0.tgz","fileCount":27,"unpackedSize":49689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXQfCCRA9TVsSAnZWagAANc4P/ArPAshi2Ii2XcLlwm3u\nz2TnMA8Mg9P4fe6o1jsm9xnhV9gWkCn0+sfCZvvyGXXMJ7dYOrXtbdJiVrFE\npWSchBqbrGZKEt/2aH8PmXEW3bUnHEdhGklhIi8sergVmwDOIsc6E/F8o9pa\nfLF7K8civaKXKGrxWH9TSfTG9RbUNgWkrOuOXibWwqPwxPFx/+RG2AsSy9T+\nU05AJ7l6l6upBAcVvOyv2F3tx7MonnqjD0mf/wEWFRwR8uKXLPG7kg89Zy6I\nP5gtHT6HsTuuubjCvRHRrwcZFWlUHucqPuitcMNDc7kOoigqg1U9ggMD6H2S\n8bziIXSTtIkTmaostz7HTSVNFvYz4TKNWk+ifxMPJquf0L7RlReg3QyF0EtU\nL5rnM8I58DWjOHTWMJL3L1Zk+XX5fR0udkTqCdexhrKu+Kxu4v1YwJ1i6IBP\nX03URyXmxPCJLud/m0/srNYVGgoORcqGj66GDBQTjvaO2nprkQWAAZMmRtBJ\n/HNpShgjcetiQ6HSS6uVihhPGlIcG9qDDjjBzAhJhzfA1vfpItPd3kxUB0uP\n8B63X6Ahug/h4GVjCwKO78EC0ZyQtH6Qrnzu37dDSw3owXf3lcbbSNj8Zrga\ndCq9FPaq4kRS0ZrR4+KRmp8LDAs2lWcuwGdl+wgIT3C5XYkY43sTmfZ8v8GM\n7jbP\r\n=QEGZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCorTGKNh+8VWm1XiZkcDIkdhGM82FG4wqaYeElb2s/2gIgOBTdcXwOXhU3kflq4SeOt365tDO2QtUrd4rl7qi5rDI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0_1583155137871_0.3062722416979773"},"_hasShrinkwrap":false},"0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0","gitHead":"5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-QLLO9/2n3iWGf57UYgWVYFoyTgcrUZu+tEMM1ftIZN0jce2ya7Tfx0BCYE73AeCL1bY0SNjgKIJ6fWkVqHb2yg==","shasum":"01cd611e5d4eb01ba7a44b9d480a7f548cf27ef1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0.tgz","fileCount":27,"unpackedSize":49719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXitxCRA9TVsSAnZWagAAhRQP/3TrecalPkKQ/UsFqe+M\n6PYH0KHuhftud9KA9FmklKath0viAb9TiFCqQCFNgFy3FcqkbNIh/Vwb1PVF\nT6xw8mS/XcyKwdmVx2s8HJ8u4NhROpAeHtMC3yy1Ce3VgOTpLtKfW7JoPjPW\nLT4oDTXK1kjXBXMgv0kP5NVKX0K3hxKycFEjlBmS4g4HPXpxtv5sueKvMmrE\nYz1Z0tHeBS6zQ5RACi2eOCymVprG5aNkP5CJxBsm3ANLkSYE9QyrQXBOkAy8\n/EkzNYJCYO9t7eJ90MJfuBA+CJfWaL2tHVIepctTyqY7YriDxc6+GXOcJGOG\n6xdP7NbXK//Fqk16oO3ei/eIieRJOI9TOuGa9Poxnz3eNXtBqaI05mET/P8w\niT22kSCHHfMT/WH7n/drScmqej16N6p1wfyAwM3HcTMOhLFQeCZ0eVLyfjkI\nb/B9xO6IYbbsmKz5RKZvvPGh3ewKi8NoSxfbC5cGsGLxwtNkYjdmkAgSWf56\nVdW6bqTw/Ft5Y+DLHlQXts1BiBcJ5lO22PZxHkHhBT4gtwSha2zyTBNeyRUq\nouN9TAn61/1SuOa3/RszEdv7qNuimFcO9QD/q0Gb2n5OqntpkvWUS+PvUAF/\nHPbuaDfdPzPOxj9LlLWi1/et100u0GQlrM2sH8NBzR1FZa7fVOn2tdW8+BpJ\nrxU6\r\n=TIkq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOXikVDFOHAJ+Lj1lVoNbbqdyslXVL3/nMAofPYuQ4owIhAMW25UGNivE+0gtM4z1R1lO11M/CF5u9OUusCk84M8XM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0_1583229809057_0.5111191515857052"},"_hasShrinkwrap":false},"0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0","gitHead":"bb27e1f9375130a459674e87ccf8ddd479a2225a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ecwg771e8rqPD5+vsxT52dKyNq7Y9rMEeRD1Zi2/SSwkheuwOPoXrQf5NUpPf0IBitHwjuCaSZct4NZpYeT1Hw==","shasum":"976214235bb4e1150c81bc9c05edab316c78fe8c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0.tgz","fileCount":23,"unpackedSize":66295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXlxICRA9TVsSAnZWagAAYCIP/j2NBL5ggAwgnh9GY1SB\nb8CPfebolNbAfhh3BSjtRytlpxZHuk0IoePNi/f5H1Au5/HMqlx3LpZW4kT2\nn0M+Wc71L0uCcA0oj2xu6xEDL4VqviCfHx421AvTxjso3Pjgmnv5Ovmb7REW\nupx4RR6NuVWOtmrZ6GOd/qnE6oYGH06J1TKzE5h0KTqiONPbHeEGxwvtCd/n\nqfq7G/mQfppclUe0Uo1nlOrSEjmM0Mc1+MEi0s4vh1DN2GFFpmg45/JAVs0n\n6CfYWCBeMW/0vKrLqo9gC9n4RH5UfIf3QT5nz9SZzHyHJ2OjDvzemsIqh0uP\nj6I+ufmrqaBAe7cm5C+L28GGpekaXksmDXm7EhrV+g8DI2DrmRTXlNhoAP3m\njtyVfhBP2u6IoZuQXA1DvfT0CINuQ76qPKlVh72ZMH8oi/eEm6HxJqJTiNDi\n5Yx8Fqx1Ayx51nND9fH95WffT8OtbyGa2S+HDFoO6zyx8IHteBupqE+EC4Bj\nbuY4C1F3cVSpdGbfUhwxf17OyZqd9DLR7HGfe1RlL3CePBgM+0+J5zx85HHX\nxvt9cLuG56keZeGbJS1nqyOxK+eG1yDlKnanj4zl1XuYYmOrvSl/R/J5C/4P\nceftWEh8vC0LlnzXfVrAlDiArWQ5qyknm2ftGfMwbnb2KlJEqH67Js6xGZZL\nX9cx\r\n=Qbed\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFe/qyazMUbFsQhEN1/ea0+uNJ8ddOm6BrPDlJCRRhUJAiEA0+QRurUdGEipjVYkvj3kh2GK+d9c2FFrmcRELGc3rhw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0_1583242312082_0.28323555640556"},"_hasShrinkwrap":false},"0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0","gitHead":"4e1d27a5abc49caacfbca448af47f0f98b851207","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-h0tVlBJU5Tf3oBKrQ8JJSG4XFdSpadupSQFSZ6P5CTNEbJn4Y5G/3ufzDavN5yITTDTcib7kpqQY1y/6yP2CbQ==","shasum":"b1614ef46a34c215535f3b1d91c14af173576bf5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0.tgz","fileCount":23,"unpackedSize":72111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX2GeCRA9TVsSAnZWagAAp48P+wSKydeUWY50dQeksFxP\nuksa5IA6hgG9mUimeZmTpj0OPx/MkV7+K2pcTVdHCNi+8EmIxEpN7/5vn4XO\nXJoCWrnHkZZC7DI6AYfkdnAHP4VXVwkwHqttcwFx53AUOCKOk3LWmE15j0dr\nFJuNMTeVjCG8rwCk/yb19R4htm+FTo68JXlQoci4xjcGa0VmRUVQV8uQO+yA\n+8JGmeWEjBzRF87JTOR/dU37XfxH9bNEYvCknGYQ1AxdRqR4tEcae02sN70Y\ntI1/MC9zVXEFp1zWExW7O24y9+cODFiRoe2CJ0E8mZMW2FAEMtUhFKiR/I7b\nkWd6q8K0swzirDikzgN/xcOSWA6/bLj1xTLUYLyDU7CwsY5dtXgldJF7O+NQ\n0lyeHF3Wh6LR68nxMZJ1qrpQJNJwIkbxJJtOyXYA9aGbq/4PsbsofMEpUQbt\nsm+m52k4nswWGDIefeAjs6Us+vsy+UsPuqo4+SL43gLvKy16iI6j6oD38EBt\nBACg3oE923TV4RtaVPpquvv48/snwElaGtnBYgTMmq2nfRZX/TvfgQjm+KD3\ndVTjiy5bETQf7mtXu6FTNpZRJh05Nxe1sIaPTNCfJuveGODw00uYS64fWeQw\nKE7vzOG7YPdsA3N/f4dcEWHoditSxgFOrYDUgfiG2IYTUn48NvzXsgkS92Zq\ngbXN\r\n=roe4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhWPeOukogTnHOaaJ/BOAJR38xxvzur8n4U4ImE81lNAiArCzvuDDNxe+o2JaWtcm+XQ+DSdka/O1bLgba2tMGewg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0_1583309214011_0.46136564729731044"},"_hasShrinkwrap":false},"0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0","gitHead":"8ce1f25c619fd154de0cc779de7dc8e7149f4767","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-c1Hznq3YVvux1U0mayYZWK66yYrwNFMZqmuwHHpjzLu9vxcFcpXetvuK3YWRAdSozmnuMs0e2IJEJwoN3Lh9lw==","shasum":"c8fb9327ab0841289cabac6827ce9876972ce1e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0.tgz","fileCount":23,"unpackedSize":79512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX67eCRA9TVsSAnZWagAAef0P/1JNklYklLBnSpAmnifh\npRNEaDZU9aBhLHArYjAMTBI3Gt1JvoS0yvxyAPmTQSRYfelZc9qxyWKidGHY\nCqq1bdI/vAY4DeLflsViUGgmwzjgaBFPFKjEWWnLBZF8DClyo4rjpBWfRVan\neN+x0En2eB+C/nllhgNjZDcf/WhYN8aIQ6xYP7iSgKcoqpRHY7OSpUDmUAUZ\nRhx6jRTmYe3j/umQF/0iTsOee3L66Jz6UyjowaK3WWKPxSIcyrKZI8RZQfqb\npz6WG/cj2c2xnsY9pkWjPRBm/Ry7S9QaeJWTTFSqI0p0W4ZXRBM51QtYmB4z\n862GCryrk9j/AgJUgqEaNvCvVvlPKFxJQKgrWPoFi4SD7whbCGEFIOafYhp3\nustIYwBhg9Lfao1Cwiem13Ey9ODBMZLURH0CxmYFD+clgSDxRlXkvkwGfTt1\nm1FOuODOY1CjYaHp5u6M5gkbo56mfZDffXuSNz0LUvdvg7UPus0DqPll5ipf\nGKVkLzkOjAHOcc2N5X41jwher5sAWSVk0SYH/xm4Lp4V1VNR7tKub1iQih+F\n2as2PhRKxvElVtAyjHifyJ+dysEUbcvuLfJ+YCyU5D3ug2Y5tFa+LidlBsyO\n610xALWin9a9uYem2AW3ILSj2de40Y3YLYdqJdBrcpjPtsrGD8xzMvRhVv/z\n5ON3\r\n=6eSm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNNvUIQr4dAVetdKWqoJ5RNqFWMO3mxK/KJxza+yTNxwIgYBFjX0PvA5u1wu2YOqL3BF+tJrWzOZak1IBQywORRZw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0_1583328990270_0.15306471493805995"},"_hasShrinkwrap":false},"0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0","gitHead":"8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-CkzfqiH1JozCM5iaxOWJJJHIFNy7BgAKl3a5gjoR+eVPrk2C6qC8ZZ5AQyop090SR8xRc7U8mHQHjtvwzzOpEg==","shasum":"5aefc3a5257d233de2050f29ebaf89aeddfdd506","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0.tgz","fileCount":21,"unpackedSize":83996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYQL0CRA9TVsSAnZWagAA+9IP/37D8lRDgF1f9yMRGK3Z\n0OhltqEedmru6laQ6Te4quS+/pL9tvjT+X1g+u7pqkPBvv04FtVrPmLdEwNb\nlH4spkt6FPp7gN5KQYREJxumG85iDzKDV3aee9/BBanpQFJ/O0R+36huDpyB\nU6alpMxdxGKV9dUgXl5hfHvJAvFVK6zxvEibNVeYyHLZ8iKHTdRXEGbvBeDt\nlr3SEiieZBUBucH7+2XZHPJZTRVg4sEVxbwLC5mOAkiUEH2Ze79TlrE9iETt\nHK8kxVe82C9OhoNmwRla16/PhDGBUMm8ykiw1bckGRglzEbc3VVLpmwmifUd\nAxqflJzZaJz9wnkwmCVGt9WTGJQXA9L43337WwYM92RDI8w/zRWoDge9tqWI\nCwGbKczRCrwTrBv/kzl+rP5ROabFb1NE1CfWj0nfgr8eAR2yzUlbSrFL6YvH\nAMc2gjpL0V+WbIWzf+J9DnANKtD2iJK/NqsCXwLZYktfhWKa18vPX93S/BBr\n+Vl2l040N+iTPtGWF7OjY5/pbi/Ia8PzvClptW+irswB2UPxuOWk0RVACalb\nlbY1TadaYX+vReqoTV8BLIcOXNB+f0+h+OJACOKueyMsbcqbHg78bfnNzK3T\nijrykINf7jHVk6W1r34AISS66RubXp2dLVY0xYkjMzdN3HJEHBxJVumtqCxo\nA7Pz\r\n=lS/c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM3F4yyV0Hr5DsSIKIMAVGua0UjpVJAFusPQU7GWDpBgIhAPT/rb8YGAmS8UC8gGIKnKwUq9kaxAoYovi4FlwtgXAR"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0_1583416052024_0.8996242834489172"},"_hasShrinkwrap":false},"0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fcda419fa97ec3b068aa5e129389143d69a156e3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Xz3pkD7XxVuRcM6E4IwyaJc2gHDjlPUqc3BEnOCXNtC7K5sqCbIu6qszxhZeT6RBX8kyR8rzPGjaK8F5mu1Wbw==","shasum":"0fcd209a7ed5196f903ec31795a766ff5dbe27a0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0.tgz","fileCount":27,"unpackedSize":49719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYRIlCRA9TVsSAnZWagAAKJEP/3QEDE9n9u6H/AJ3AB+9\nDA67Ao7VAnnmI4h9uP8Vdf2tFMHlZoZDeBlZTcPJhh37cZbmkHn/2OcbI4OB\nlTL71NnWSRwIpnTdOSYsHZxlUex1uQRTWBKr+Ltrjcsenz/PuhuMm8nYf25k\nvHX+r1h/Wke3Tfmf9Wao3CrUAwW3xXYd48RIHkJA+l0POlVSsOK0x1Y8Jjvu\nuH3pVhipuV5VLvyeto2ITmxKP+ga2G8yYOtfRA1TzV4yncpLNAoOFdVxSjMM\nZ95n1fuRTZ84HFEOT2G9NuUieOsPFbCQAIobXTWkkVW5uY3VuJaryFzGUoYC\nXPoZBU0CJZl8gfs04hWCkITCbAlAx2BBkeINKNsCDwDyQ5i65VzeDx7Xdxpj\nSZ0bLvzxgQPF6w0jB8e4pvFnuzecOhIBzl+Ky89hY64tl4bkbIxkavVoFsg2\nuuVSZBK7m0Yj3DnBcwQsQqvod/vXrretdkZ7dn6hVzFXYY16TOWgedjWex6j\n4t9qHh01LvkcJ+dz3c691mO8EykSaBQ9sBhKTxbqc1LTq/SJdULKQ8H8KTuS\ng0hHH63DFIkuEd2B1iHyG9xiX5Oq0bI3DSqFty/Ze1bgPU8yw92qO8eHTyld\nq1FxdbObGVNIzL25QIHkDJwjeFbGmVMe4fZb2+syHwgWGeN2QdOgqLt0SQZM\nPpEY\r\n=RM4S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICct7gt/waJ3OS9eHupiYVchNxv3M2GyTEl2DRMmrbK1AiA8bDZt5Zj8/FgBvTQo/wNEmnHnP7Qg7acWa1mzXiFv2Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0_1583419940480_0.25814906908243374"},"_hasShrinkwrap":false},"0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"29f4820a87316d93d395c09efba21ac27abc990e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-uIX8FCETB4a4aRS01vH54h0yh808e1eRibTUfH1f80sGofV9xa+rXS4D/be0sjiTZxs6Nf53INUxj2Xj82+wpA==","shasum":"2f7a529493c38de9aa5328b7ac99e0655d4d1cae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0.tgz","fileCount":27,"unpackedSize":49719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYRQtCRA9TVsSAnZWagAAKLkP/RrhOTkzjOCkzHoZbY8r\nWmHpz1Zxg/HJZUFj98N4uJZmp0nwlAYkfzYSz9BgO4xuNYly7TukzwZFHoqp\nv55aicmx3CJgCIpjb7ZjTXG3L4Nr3wyc5TuY/vBkSRr0MvYDm3DhTiPr5rjX\nYNYZsqdu9kT0rdMg60/iL1cKBUMiD/kgU1ZVlCQfDrIhBo+aSvOtS+TLxC3/\n0pEEpsPjCZ87zDkYsvHRxQXjrpm4Ry7hGU7keaMqXnl/8Zel6tW/okk7YppY\nMCGBDZk4b78HwDt4De4tG30aVR1gGh9IGcJ1+wjY9IB14rGRDg71tK05v8JK\np2DVuBwSx7voSm+yL/AkE1u8dRdv/wNNBZ1cfrB/gERHKWXOwbe7Owqz8J3h\nUyb2swncsyV85UHDD3WmY7StFvMJN8NSd++htZ+UuLG/TjzMt38Y6LndiJKr\nq0gghxpz9nZWfCfnNYNyaR3VzfR9aLPt3sLuAiWkd3rVjkw04aHSMmgDdEiZ\nXHvxWy0jayWzK1qpGaBAOKC1POOX4GnPH6s4N+LHaStKLi5CcSbIcqxkQuq2\n/e71JSzrN2E5SIhXH35Byd3uC5EtRsrVJgaPm4F7CTKAi9Ru/YN5Zz4XZTQn\nNhieym9Jpq+BrEZIxMpBKy08EpYZXVK4H0UcwmPdkxaKhVkaOCU9Mqhd3Ytl\n4Z8j\r\n=OU8N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWe9aNuhgI9NoAuxhIXEE6n0dfRngnNs7oaAG6cAOlXAIhAP9C1VNosDs8ZWtHlyJ/090EhI6gZx8/APyKhdB9S3Xd"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0_1583420460672_0.576401994123876"},"_hasShrinkwrap":false},"1.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.0","gitHead":"1e2ae29765a81a619621ab15daacea36679c578a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ASHI4eI8c7RU1sDj3OadvLR2xgXqgaGnaxJH7FX27WGa9IhWqCi/IRQVFtz4zI7g9ad44xwrmXRPo+s76Ziq+A==","shasum":"caddb4e3573f47dccfd944ebdd23fb4a5893d8e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.0.tgz","fileCount":27,"unpackedSize":51111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYRRDCRA9TVsSAnZWagAAHWMP/1HKbw0oF0fCiOa7s3AA\n2QNxKJdCmQHpiBYeWoTkQPczVHFqhAnFnTiHX/TCuXKagQdJ/1ITTY1tOHaA\n4oX5LovD8Zxnfzg1crkD5v4FMxbEUaVfL6jkVjssqEUDu7gCR5PgRy7ivVE+\nCJwAZnFsVg5qoOqZsRSO3qFYWb1LcbO2wRcSAbEKX1lbFNaDQ0Yoas2/ZHcU\nU1ZW1bEWzFd/f5YDb8yagtWbpB0t8zfSnb7pzrzbMzEIZNhSRHBoKdcr94gh\nK9ffAYVQDtvTEDwXugpdv33+3Xh/SKJWbibxMI8D7hBaHOATiv+ErzeS8068\nSq+oDgkXCTKjgOOZdjz28Cf94IuJdqQkrTH4USO04t0iggHAZ1xWIesRSGzF\nNYoNchS3yRhKt/+8L9oarUNDXIEmVT6T51tZC5G8NG2nahSzzrvss3Tu7hw1\ndVWGjHNTHZsRL6kF9MsBb8ZTkQX9vBMYAxcpv7bo13ZicjG9hhU3Hc+pwCZV\nwSSe98gSCncZvgtGSo9QbXR3+WYY9gG00ddNB+adjQlIXBm903t1eiw3GsyB\nbj1Jb6S/KUx/XCkYQrRn6SBIgGCWqhsVVucvqgSDrobgJgXnrBspqkgO2ujd\nk/UVnxZHYfCfveVqzEDP/KqjeacXHfb3gVL3lDvq17iTOnkGO19T8W6hHI0v\nLDfk\r\n=V0ND\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtVUZiqi5hY4kW/WxzZKiiiejUn0StXVVyzsMxXuY8bQIhAKypo0i1jdPqvbzCoy8W+luxTHkpGHfE+ng/6tF7Lu1q"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.0_1583420482931_0.06110046658761137"},"_hasShrinkwrap":false},"1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1e2ae29765a81a619621ab15daacea36679c578a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-F2TjiHQxa/5Smtk7HdOrjGNetMBeqVh78QLNKaFnk+74JxjMXW0SlRVfEdV7olgVuTRrK6kx8FqvgSUrpGdzqA==","shasum":"6a5cc2431dd13242aa22d6c754fae37b192b634e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0.tgz","fileCount":27,"unpackedSize":51154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYRRxCRA9TVsSAnZWagAApVkP/2etR0EbpwFTjPs8jBYh\nlp+ib2FawvOhx1SSf2LDPa2sLM0mnVYoz7mcRXg/rziKAZvXOY0YgLtTYghC\niEqiT4SWwz4qzXtxqt4T5kOOI0NS20B2bs5bHJ2AaI3/stfHKIOZ67xMhW77\nM48PuaTZeb4mNjLFH9zm/aZe5yE1lD//2d1qBUu6SIWp+s2dySJB2rSFAeT2\ncmB0Ho3UeP1P8reO8um3/sLE7bckLbWeaAIc1gv+ovjH9RBjuTX2JNIM46pJ\npONFeRBFHOOKKpkhEZLT36lNVZAYKXMIrKR3HFYS6gLrJlgLIcXZRf7lxo5k\n7BAlkKcRNcb8Yw4ZH1PM2eLkItg8phD9sPm5fX64rvR0NuTojzWZMaX4sMhV\ngm6etkL64U3aUeMQYngrI8rFxXr/nhPAIuFUOcZQjnXhhXkcVeFqX1P4f/8M\njuPV8aHFokhx6IyFatJZdsudRCUpdrcQow6dxYDkOyKBua/Jz1jUxdXs0pKm\nPGsFRv3SsGjA8TLavAaoHWZNQzeA4ntFwQs/vrkeqWWwAKdmGpwyKV3CJNuw\ne/GexQ1mIBnBvJ8O9uOkubR6SlKIwVW5OIh4Sd68JbfCtksaCg2iox++E4/+\nsnNg0ifZFeNY1W6VyTH8jsq9SjHSd4C301eQAlkcx3q3YB8FXYt3j/D1aHIB\nBYTL\r\n=h5iB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqUP8mOpfOZ78wNq+EbQyIkp+Wzv00Ng+FjZzNiR8TrgIhAKPKdi4S2F1vmhHTFdtXzacggvW8zCot7Q4aryvgfTM2"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0_1583420528772_0.13087489722161894"},"_hasShrinkwrap":false},"1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0","gitHead":"f05b656496b9e4d9972c9f689d95bea00177099a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-zRCK9JaytAJs77d4A8ju58qA1OoHE8D9xJlymXbT6zKmq2MjpwL5dnGoWm5qi49X2vpAflHFgxUJAK+B5AiF1w==","shasum":"29162a73d8c23c655bddfe6a8d71000de821b6ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0.tgz","fileCount":23,"unpackedSize":86683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYRUsCRA9TVsSAnZWagAAFSgQAIwfOkmqeN47e2dpnEPP\nPmtV3jkC2z9GCmqsLetnGK985mkhAEU4sit720ht5G6I0mBr03OshP21fGp0\ncFV2b7a+f4L5AXiaTg/F2PBEUUdZ0ij4zxUZ2ue7D06jA9uUvguMi/VhoOBM\nW31JWkozBRUMbwrRrrA+/bB+OUPQJsmYzyiUxtm7sNCx7fbpQypmTvLjRXML\nheehSVZQ3+zlh82UaA7uWJa9+skUjgGj8J4zmqbliPJnOYs2tlsxuRp9QRL0\nXCTAngSmiwPvpkPlIyO9kCxrUxk+raaQ/ZKwJ/E8DUnag55hqjv4vG5rN2i+\ndVOdwVuYGTguMcJ5zN+E0FM5h7UiF60koeRnWaIxVs79Ujt4lBmRBoi31/9B\nytzU0KH7Dml2+2k8iLnGSAtsiomaoPmVuDaB3QDJ+qCPXQhfFJZ99Jkl8vgg\nxFZ+c35Q6qXc6l2+U8m6l+WbMk/EHKB6vcKv1TYHgkNRyW0/FkRpxGjoUMvN\nRzBGmWdWL9iPZj0xyJyfH5jLHRD2Dm0ccJjcJGZv3dZBVd0HO3k8Fx99jZob\ncUEsX0+hfhnwhBgMs11H0Cg3E+m3XsSY/oElO8Uxe+sKIo/4MZf27MFRq14e\nfa4NNNcG4L1Pe0+iExMFO512NQwoQzYyOxHVqs9vzN/HcoUf4ePtEL1F/Yl8\nWLhH\r\n=n7Nf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCc7kbyb5qeikY7q+r/y2Hi7HLgXCPCMzZpxFmi8o3eAiBabvbRdOyKDD7aunCjqXD7u7o7O9HkdurX2P87Qlw63g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0_1583420716031_0.7461915117262954"},"_hasShrinkwrap":false},"1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0","gitHead":"c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-AFH0MPfA/Q7kM87592x18MTkdsnDpVRMX0u8lOwR/CmrBKZza51WTmnArwp4GeL8h1NpXGx8UrJ5rYp/MhsQyQ==","shasum":"45c91f537b608e87d3c06e310cf62e8d3ff9658c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0.tgz","fileCount":23,"unpackedSize":86828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYSwFCRA9TVsSAnZWagAAJ34P/jSp7W2vb/8jUBSjiK+x\nw4EvX8M7KjXYQso6nxMbngLJiSf6F2UYOV4otUS54fMa1eqNag5ahx3WTOru\n8+1cUuNwS+LYXRh9ZifUn6c9IgliKzEIT8IPRf9NJX6FDHaxUChUT0QEsUmj\nSiMUnCgBuz6AjwhS5Kc/BMxY64GGyAIfxxx/Yg7byUeqCNAKtFbINCgUFHe1\n4UIILzd6VEHYu/XIM9Gg9q8GkJ9JvdXnsYZH6cb2qhDOf9aSEwrRdsYCBInt\na8uXmbXPiwVuQx2LD24IN3Lyo+w7vgY/73s83kkEF2cFfJmgomRnIU64XV+/\nHTQSIG45/I7BVtg14cFherM8jnF5iz7PkSXSV7J25TKAZeKs9E68pcnnUT9h\nsQ7P53uJVMdfciZHpSLPFciUEkAkf+axa3NP7tk6auGArsvSRF8FtxgD76TS\n+mD7zRTINGYBmV2NGHT5ARTV89O9nG2detRR8WT39mAJRKbALoOKTxdcT1w3\nNUv8PRfNU3swNyLLM19YZFjX1cnb5kwK/wQXKrWK5oeOC5ktilqgcDG5WFFW\nTtjJ8+rsE08q2lWRoOAg4DvpA/UTXsJQ3eLRwMypiyovfg70bWJtA4OGj1m0\nBAmvRC4NRyjj6vD1wkPMevocTorC9vgSQgk4LSyCpkF+0U6S+prj30T+jDjL\nkKXR\r\n=ffkh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWDdfTUULnWNA0FXHTPsxEDA330H6wg5NhSbaxWFPlAQIgBwGkh9VrUANhNA/sKVCF1Z1YHQJ4M2ahsYCtoguCDJc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0_1583426565289_0.4009628971889949"},"_hasShrinkwrap":false},"1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0","gitHead":"f9f2cc2484311e00379fc2211b68afa52eef46f0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-/nbHjzryQeMFdkTRFL2IQHheUJSOUPdJNv2X/saTVGTtgXWWeAl6MWp62EnpPdLr4BAbalXrLNIpEKqD3BOXkw==","shasum":"e3b2b474ce785f8a9192a676cab1f33cc672e5bd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0.tgz","fileCount":22,"unpackedSize":87839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYTG7CRA9TVsSAnZWagAAxwQP/2V9yB4c8YI5BEGD/TBy\ngCyftwSTEdztxmcd3OSff5ACLBGKhmpGjVHWn/J03xEk0N+uXLZTQnaxq41y\nNkx15eHBTTQvTg6rWdk29VMJhMgMBafvfdTpS4d/jwdU4RepPkwA6s5ODreB\nHILhKW8AmnIaFVu7lVZEtu89kwaqtST6JDQld7bJUSvioPzO5/xZJxsk1KO7\nIM6MPnMCodiHEVmuRxQfZAcP0nOFS2f9Fk4MbIwh6TiB/oaRBgMHP6v6nejH\n8CuVkMbrm31yzvzO0Qt9V5rfRjyKhJeHwOQkbF0baVO++CXkiw3QN2hvL0Lu\nInh5LmzehQoLSt/CtmvTLNL+vRrX5gedpeSCubgaLO/bxZ53bEfmWBrP7qnZ\nZP5MSg6GpJGUROtHqIYQR1lkqwqURNO5EqEiifh3KKeYV9zb/L6IYa3Sm1/U\nfSW3bephw1co0CRMy09O8lEmajBUeKhiH5Dq0uMilEOvBSJ9wIQOjgSYqt8U\nrzPCJCaVHuA3pEfZG0rjs6SRHLndRqeBJhE8jiGRuDjMhayFi0qAEZF1zaHo\n0kZya0J2jJm+xmUpzKTeL/weA9ol4IN56KlgDPwPZX83NGUT9YotoQzAjD6l\n3YzyEq4VuRrgx0uSlz1mDuTZA5IVYKj+tIn9N+phfr+LEDRDZPnF69D2xqC0\ndq6j\r\n=jWRt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzG20ZBxbkdUpc3nVEIfPpXpFmFsUqZArTPMtYAJ0F2AiEAu4cD8x8fB8mGOiNP75hhwiL5iD85EmlbaoczA8vVP/g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0_1583428026808_0.9592107677836972"},"_hasShrinkwrap":false},"1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0","gitHead":"dd17bb9232d46aaac266dc5dae08ae8d67dd66f3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Uk/DoTwdMohabNnMoxAcxSz8W3mXaOZvlI6Ih2eiLB/F3lBOUzzgUhOCLSbzrSDeFj3n6VoCZlDCmzOBdmiI5Q==","shasum":"461ea6a168ada7929b04864bae594e1c1937b6d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0.tgz","fileCount":22,"unpackedSize":87839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYTK8CRA9TVsSAnZWagAAKGMQAJQjpmNT4bgO/z+qUCTD\nKq28RIDkNw9Rq95OuohdFCYtYv+BLjF86hfKCZNC9rH9MzmgB1G8Dk9N/ifN\n9KXTgoWoedLjrny0dRjao06ge86aa38obM9NnIeFb90Ng4gaxuRCgBL9VCgB\nzddujj1qW0DArWPcypcV7W9k1fn0IZ6iMenVqOlrlwDbnr5iectN5gh0kJU8\npH9syCYRaktd4gFgCVUegJnwT1dtqn2I8s3nDf3mc7a6cjO1e4h2Viz8ZrXC\ntRRcvXUaXLpYBmu3cLU9Elu9FwyC/3HLEIWtJRbIRdwSi34DcYqXYeU1zhEI\nR25BiB0KCGg4eom0FUk/LptYOs83PMd2/yr5QW9Zhxo8NXGZ8r7Z8UR63mpf\nufeAg3VSEFyaAV6e0dzK5lm75ClHtgwjFJt5zCrlaGERUI0RGTNQgmxOvSGP\njFs7piQ3qnbzwRua47zz9/upDt+X563uqze1sL8b2YIPMxPzWm6Da7GqcrOm\nWDB5FlVT35/NAx8HPCN1y9FfRYTNkADp089B5nqXA6NrAhPzd2sH1Ngtcvs3\nZ0S8xQBXBTi4whzQK5LxmhAKQFdMdF4uqHS5cLro/yce1dER0X4HkAEusSVS\nZkG1OnOFF+39X1daT9coad7O61IZZGMoFSgkYshqQoMyvST5QHXKBq5UGWQ6\nKfN9\r\n=AGVK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC9VvXD5JGSHZTPYztPLMCPnV2MDgl1tuHzjGvAmg+dyAiAytc3hoVms7WvN7Plyt5PilZf3S4y9vajAJ5tAPrUS2A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0_1583428283755_0.36428819262870293"},"_hasShrinkwrap":false},"1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0","gitHead":"2d2a7bf80d08415b980080a52282a3bb990b9129","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-MlcWxwQJQno11xVSczKjk8Z2zB7AQdaw79i4UGRRC1kJ8pS4Y6HfSUPKVr4cds+pGYWkPwLa2YOp2BYUUXZesQ==","shasum":"3dd8f3c1a9c854325014b70a72aeb71afdbea4f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0.tgz","fileCount":22,"unpackedSize":87317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYTXaCRA9TVsSAnZWagAAwzkP/2Sfxx/Q9lDvr861KmkC\nYnmZghEGCTKgJlkW++JtyLgo1sxUAmQ9q3gY9PIaS54QkOqVmGixqfyeR1tg\nNCVr4s+g/Rrvy36SibPS5WyLLUctDXtLwBla4i4OSL9hWCRQgKE6ZvDB5XGk\nFrKCEqa1T8cieih/XlCH2oJ+ecUDWNvd9DCIkiONIcLdFpbnd0TUAJUMTyhb\n7XyICdwuz+8oUCh6kjqi/KR+rEw6mdAGiUGSi8g3fky+sloqk7KMxEfKXQi6\nlNE+kRS5IRIQHVqP0JAXCP52EBWdVhUkfP12mjdwM7OYI7Ca39u7vKLNx5Dg\nA+2Ygh+wMITi5ExD6hzaxR8Iy4NsGzrVz0Wr/v+aTKsQ0WBJDGU62pPUClGh\nXeHnGYRc9YRHpPYahvo5SrX3WIXWJlRvZXzZx0bA0LB3MRB1PeJzPRvD2z+2\nMaWmHKWdowvQ5haGGR9tI6W0L6UCSTwyQvo56ukU8IUsiyAqQBTTHEig33Tn\nKNm10j2qRA0+dj/jpplafWP+0NtEmnKOzZCBVjwM1FmWc0fh6RsjlBmK4ToP\nJ8jTlm+6XfEjG5XDFpsEWErQxM52jvAtu6aP4XHLKBF55IsgVZ+/Gp/MNxuw\n7gvHYWcfYLPd4/vhPswNH2wk+zU8lX87zZZ869sZMLo6EGC2Do34diOXzeyh\n9N1i\r\n=uyS2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9+4Qc+zQ0P2IEq/bvGYCwDgobkm3wI4SQT1BcibZsGAiEA4ikX7abQUwxCScySyoGwGrARMUNFP8a8mhw+hYuO7IA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0_1583429082142_0.936395657890047"},"_hasShrinkwrap":false},"1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0","gitHead":"8663445932c9fa30f2d9c034d7c572e32a9e7715","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YH8qpNOrkFs8LbjJ3JUCyDTipD3nKtUgvH1OW53DQJEoko3k0dJRvGCBZvYMzR7YUe3/03316+3UB8YBA8A13A==","shasum":"03c354a8d54e6a2db4789f74ebee8c4091359cc1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0.tgz","fileCount":22,"unpackedSize":87206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYTiVCRA9TVsSAnZWagAAzVIP/3EwgVZD3ym/Z5BgIlMf\nTZh5a3dyWCZi6xl14zOaEzKG/kUkf0IRgq/IFbHLbZjIvtg3dfwJsEUVpSiX\nTmiqbXgft4SHaKBRLZbhxCHe6XjmrJXOXE3lf5QW5NNmGNs2AEdg8EObBmBh\nT6cW+7i+QBBNJ5MMMapkHdHRWPT8RMU8EHU9TkNA7uRE3c6IMQhDHvjt19sQ\nZyOA773EUcP37mlG8p5lhxeRuX9Gb25Q/Y2kbMN/c7RCrcUWrQn84KuerE3x\nO+xK8ptetA7LLowdWiRUmiwm6nhYayYGM+RpEj+kM7yqSzJLls/jfnUdsTTa\ntRZoRShsYKpBDt5+EPPBqyfIRQ4gM2Bd/S4Tmn4IeqHvs5yx7oIMeYwk/rhE\n3omoY4YqXR86is+yD+Ui7CIYRZ2Y4apkmOy1F4wURUJVn0hfsbtVYddV9aSR\n5Ke367Alqr+yiT4JAnXGFM+ZQG/ezozwuSbhEkJ22TII695WMiYRnLWI8ju1\nLvNyiJGCGNcYwLwamLDJGq38kSw5C7k143Ug9oyFWji2XWy9EnseNJGVKJoH\nj4zXw0422Ut+ttJh5cSdPWAG4uwB2g8J8jRyDtseHiidI9gBUR+h0maPkwky\n6Tz1RzbRCVY58rJ8WAtcKqHFJ+lDAmng0uY61by9RfK7K2U2cGlkZxFSHVmg\n7Vvv\r\n=MvWu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHK0Eu83ha9Z4UqRg7u9Gy/UmV5wvS2fssteHJI3kI4QAiEAtZNl/yTKCa1CkhzW5kZpMmjEgWia+Xm1J8euZs+G2vY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0_1583429781102_0.37391357422370497"},"_hasShrinkwrap":false},"1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0","gitHead":"b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ek9PbiQdVvnJuve2q+z/VJXzWEfyOZzpxM4DYxLOtE+Bg7nTFHKIguuPAikNJL689mHsekIlNPOvrHYCM11TOg==","shasum":"d1be67482325f1c3466685c4f618b01817cfe6cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0.tgz","fileCount":22,"unpackedSize":88712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYT8cCRA9TVsSAnZWagAA+QQP/07itHDsZX5vgVKKm19m\nz6O+oShW/dv+KxDboCxtjGzAx9QxB55J3HOJxrqOCJdmgUkyHNBSQk9L2i4A\n0hMhBNlaRiOKp5hc4llf8CCWpBs9QAT0jIeDvDqpM/GUPEDGYwpTKOAuDU7i\nJ7gyBfbDwVxWXkPot1YcQ6GEnoCVJIbkgXzHnnF6AabzdW5JkWw3IjPE6VwS\n4rhdq4tLASKORLdSxnBr9qS/Ow02iucEKAgIrt/4EDitVW/UIrZHoBn0E8/3\n+k1g9gZZqS863RH0XvSX08JAjpuK2c7k6flMoPsQWt/Oifd4LiSdKYkqxniW\n0bNRw0YtOvuIwooidQzGEakcnNKVniww+pqCYwWIrmTTnYCLqY6skYiMc7I9\nA9fGYvD0/sn1qtBvAxBKCbVQ9mnbYhEmu0RF2gm2RBLzm0PDEMPBEyMtzUVq\nIwnjR1YURrwm4vJUpODJNCELC2wY3gfhv/7EcjrG38hjbSFa9fSFMl+EwaUV\nf5B9Rs0XYV0XDVK57cnsLv8F/eC/ds4GZqti3BBzAPJ3pGohgDzd/riL/uaU\ncJnE++73/mZ7h3gSzIOgW8ekA2PuK0Yng/WQ13saVDYNMX+YPZASNevuk8aT\n3zhkoaiZ+enfsG5yjTuAShZwTPYeivy388ctT1Na6vZgMbXsdG3WnoyOX74n\nbBQ1\r\n=Q6Kb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN3mjnW3WW0Pw7Z6l6fdLcXgDdhdF9eg6n2z52XaZmhQIhAOHfKFhdnhzwwBoNOJmlJnFvCjZOL+g9zPrXWbRZjq7w"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0_1583431451758_0.27283339546858354"},"_hasShrinkwrap":false},"1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0","gitHead":"aa4ad2d751a9926628a390d051e7f5571a04152b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-+bqb/BkQ8CfZJmDhXKQGLDLOVmJH5jLo13oCgt/995wiVjd1oEWKFvR5PVfy4+6HBNtfY2PZOJ0fBLrd95Th1A==","shasum":"76e74ce72006e97a27c75944a059b5f17953d70d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0.tgz","fileCount":22,"unpackedSize":95077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYYNzCRA9TVsSAnZWagAA27wP/0PFV2pLEOrnggxFk6gg\n7THaA1OEOdqJ9K70ey5eL374Zl0HwWO2TuURqGOWHMGPbki6ycsS9cKdI4lK\nWVxbjq+b3VTrZWEDwBPdBFC+R+80+Ha9qHXu+P3LBCfeAZGcDGJU720ItGae\ntR8klsE8Y/ThdghksHKry8+j+jQX3TTjan5foKq9qW/swKC2JYzO3ZVlxTeU\nrqMX+Ymd6vR5QSxdSYMtyrwVe1yc1djMOF+7h7/hhTMc+9LrTGqWV0Bnh+QZ\nqe/xo3d6qL+lxrFzWtlurDNsBcPGxOZVvjvOy2X3Om2P8KZS0E0jpa24h68I\ntDGy4lLbEmbz6ndFU0/sql69O+5vCAK75SWIsYq5iWUoDd0OZzy1xuPgYkdT\n9c4K25y6/YOSIcoY2pVqgmHaIxwXw3KKA74P1AKLjyPD0r1tx2erteCWMtO0\njfCh8RsO7lA+hkytbKB/fNfe5mpxkQx3vndsIoBSLOXMdLWuvk6QS1KvGZJt\nmydW8UjMSsXsOg11KOXItv5MAizvBfbHClhP3V3UbizugZab8JIsOLqmZiY+\neEe0Dj5o0wbZrmt6aNijpzWu0XKD0+gl8ZOTXIMUXMqxmrLTyU18vZDSvCli\nVc6NFS4IYKIdEQZFEFPt+M+UY7Eem/VGMZhj9cE+sd7cDIdd6QZQ7n+i39dq\nXTWy\r\n=92F7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHedSVsC+LB3VqLTtqrIyEzXKKY82161FZNnBAQiOYPqAiB0n1DVljH4ND9SI7T0a9feCHdub8WEwH8OHQdP2IakQA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0_1583448946604_0.3614674095067383"},"_hasShrinkwrap":false},"1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.7.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0","gitHead":"d0bde224eb49c5403783df2be3a552d5d147f93e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-J6iUgsSEwImyzXL911EOBi2FgKC7RYEe2dJ1xGpjznSSJkT4SkJdgTGzogsOLn6VUl4W/AElJJ8X9TYZdwuAiw==","shasum":"85da6de455fe1cbc6390b569a736c28c54203e49","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0.tgz","fileCount":22,"unpackedSize":95134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYjWlCRA9TVsSAnZWagAAP1oQAIu2NCkT9+O+9sUZWwtx\n0Xk9IAo4wIWVzmkeqBmmm18S4VET6cFi6HKN+Lajkzbm8WAGIO4p8Hb0ts1y\nmMhUpTmyiVgxNK8tbHqIshAP1UfqYtPxcTUr4f3Oklw1XVLGLqfKjTTETi0P\nkAPD3ryctY5JHJ3M+WWfk2a3UDylNTzFMrdt0DSEryk7OR1zOz3CC/5AhcVu\nWlY6sdMMbSFK1vdVMoo8nUxqcKI7WQk/LKVj9Zar4cIk1NfcxYJARh6PyQJy\nnJi6wdCpeTrMSKCaQ9x36ixwJb7t+83fPKlBv0ujmBQuVUYI/pfQ6D6njsUE\nsXg2ZEM3cYJhZTyCAnGecTFi2R8v+k+86Ty+b7zrYcPBTQUyS9Q014PTndx2\n3HnCgj7Vlv3cjzlkoc6cSHKu9WcovXdiJ0TcdRFo6u8t8o4NecMc2iFaLzR2\nyRC1U51XZIkEtUFsXBjpwxO1mxe4GxWhMab1v0hztcZL40e0fFLdjDXqgq2Z\nmt9eurDg+Zw8J5a9hPK6FsOEQOnuBtlyiXz4SAmEW+q272c1rBnPGGGb9OOx\n0TK/oE+FHVS53cGz0/nCLM87p9HX8avPFljDlCBrHkHdR76b1978cVtNalmG\nimEKD9WSreXD0LvlbM0KifVDtpOp8HewDGsCBYhs0rI8mn3HbnquyLNwHfx3\n0LXL\r\n=borG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7nsHOYt127LAOTLBfc4qo+yhdQjjYqgbiDdwXP0b1NAiBBrvCnaxQ3DRxAV98Aa/ubuEh45AXaOSgdn8Me1Hy83w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0_1583494564825_0.4622085006321295"},"_hasShrinkwrap":false},"1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0","gitHead":"d2b4c79cb596dba52854c8557ac1d08ddca92804","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-eidHMinCBG6qcru/ZQdCezg/TpzHxzL4blLHc1uDShsfEXg3UYaQjoBMGSiQYeMQXpKzrXQWyXuGn+lgdM9pyg==","shasum":"07cb4d67453998ee657a20eba6baf41c13e2e0f7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0.tgz","fileCount":27,"unpackedSize":51154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYp4LCRA9TVsSAnZWagAAW4kP/1DyQml2HYaTn5G4n0zN\nj2qaqNxcWjHo0kQ7Pmeagm12rw+hfa1jYw2MKaI/0KIVWWOLnS6wbUyhkmUL\niTHODBPUF8AIkf5kcrs9rhKsO7lCc6zhabPn+GaN2LoijT9G6JaMu+kDybLU\nxmrCaR1ZddI8gyYmLA6Fc60T2HGLhgalqL5YMY07AjXPZb0dBhBJEXoNp55o\ns0TAG3uacBwu5D0cdodhgIfYVxOLd0w9LnzzFhCQLWP/nRaDZ/ltQxX3XUjP\n1Ph6TvOClpD5PclH8CftOcW6q5lb1yk7bdpSfri3aA3qvGhSFcnmdwxkjAAu\nAqhs/zcn69Rs7TrZuDYPRwmMSaTd2iLk/7/jSCV5Q3voiEr2u8ALnFNutAvd\nQ6Z61s1nkqgzRC95/EJtqkpkNKzOe/RrMAf/xzn/3RVvS0mMKRBbw9ReZi+X\nn8jH3dIA9oA0mQnvkw7Q4RILB0Yot6ZwrKL0piYxIjkfyVsMRWODDknsXT6/\niI73AoicLAGOgBLvSIsKP6tlnJUmj4CEuw7yv7ALD+xpp+RySj37HcnmbfiQ\niX7HBuflclTQoeM71F3yZ3HKDXjVJI7pLSCKiFuvBzlFGS9kF1LNKZhdAXTS\nt+/4DqmLlHR2LRijU/bUlC4vZmglqiTwzoqa3e+klv3h3PNHUdlPDfUUFpfF\nXSWP\r\n=oH9Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFqp5DELGnc7DIuPNc7Arvc6AoxQ/KAuGtY1pOAeTHhAiEA33jEM4QD/1AUY3UoV3sEHH9lxY1imrrW3vIdQcnzyFY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0_1583521290446_0.5626694483705805"},"_hasShrinkwrap":false},"1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a3780c4f676fa62c22abb14deb1ad769767e8de6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-TXNtX32RaGRiINXgIHsbyFoBjp7juHlqHWdL0Q6R1IxQIAAxJGE2Kfo8iPcVehvPkzPjAapwUfwVuBNFS6Ke6g==","shasum":"9bce4fde1ceeb9cf747a9c2ae78f2d0837725b4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0.tgz","fileCount":27,"unpackedSize":51154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYp5mCRA9TVsSAnZWagAA/zMP/3u0Yrdx2OBjG0b2FZO2\njUFn+VlqSYQ/GcKEiuODY0qh+oaBHlXmcx11c4ir6vRxUPxJdjtADfcQH4G6\nJojAjlxCQkenbp2+z6vWOZ3XYI8+KEVsA91laXF2PpUO3xZX24/RU2MDDh56\nvH5NiMdS/qRHCTXXWB5RtDY4N7VLrl2rBzRbcDmRudidMWAQmpe89VvsghIj\nbpHfG44uchBSf9UOYiUS2xoacDiKGsT0RxUhG0gxxfOPeStr2phu+hAHDCXR\nSPjdb9NZ2I+CjMP+cAy3LR0dO34CY4vP4Jd9WY43XDWdskpyQ7jPVOhaukjO\nWGYF8HqDbB2eOBKwzJdT23Lsx+SFHYQYbAqxKhxjnn2YJs2tb4EwChr35OuO\nNetFfFv8k97qi4n4ZqhSTQD4+fB7vE95PWIWL/yit18Y1T3DsZ0mL5r7xAkP\ncOVeveMmmF0WR/IrVivDy0Yk0WisMtTtVF3vy/RFDqyzNwRxi7Afbj22WPN3\nLhYFbdnqMFPxZS34j/lIOepUc9JRsBeqDjPyGSMjHl3R0eoo4Tp24ZX2iCVH\n0nd52mfRb1/pmq6fsE1u8FjpbUnqhIALvvoJIzCdR6Kkr7bucIHvmOZbq99v\nQ7RULFYOyOOA1b7Qzoju4vNUdQvmorxyYi7RQDtfVu/J0qqGrERA8VguX8pR\niLlR\r\n=HN2y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9yHGF9EhO9Njr26wqlZCtb9Bc9Q9z/VoZ9MXN9mpZZwIgFJblUWLeucuHLhpk3Xgmb6AMoYvckG1b+IBFZNq0szs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0_1583521381498_0.2275603266633528"},"_hasShrinkwrap":false},"1.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.1","gitHead":"073a2fefb7b8cd4f8aee52a160667e0512f4ebe0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-wPSv4Aad55rQsF9F9eSNb5S2uuC1+JG8MBwHqRQ4W9Z1SA/W/HusuN3OzajY2NjU9jX8aCKuWvOe6udOUqZ1sg==","shasum":"01f67238614ac25a66cf29d37687a88cb9383ddd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.1.tgz","fileCount":27,"unpackedSize":51390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYp51CRA9TVsSAnZWagAAGiUP+gMOiYZxVMIAiy4qKi1/\n/yaywh42Lctp55B+IYPuGzDLjYqr4cgphMoJNUAD6GVJbblompk8g4s0i/H8\nQjy3DFSzsSPuwf5ekGOplrkBnHEh6/HGPYOXanuBNQKFF6oIKzmii703ngFO\n73zfbItdml6El6EicSh++P7lc8gtyUiOgX3/3kd9OH6fJxG7nq5rSI0RRH+1\nNmPKs4zhOQFn47mTezEnBjNM0gqtyFFuMoiuzZdAKiYUegFnRWjc3NOpmxHf\nYxzl9gih4GPFwmQWuGzdY594EHz431dfb1JJdb4bq04NhBgZe191xEeRpjIv\n/4q3++UUNb5+eheOGnkwrcIarVKSsLzMXBJynnU+Oy9cgwCv7OJKomhUM9XM\nqQtEdHRtein9sapYnfbeDuDkFi3ioSzuzdvRLZK6uwDmRHf/Scl7+B1cw1TA\nvR3HfBCBU1bjDdO7o/JmStBxm1JgdV1k1oyGjVPpMzS2TMj+oUF/W0sh5Ic5\ntBNM6hJlvdM7V1CCMrg4qTL4xiw1gyYpJgUvtYkcaZb34WOdrViiekHXTb9f\nYxfnqLgeupfB+bCskx1RqfLSAHToN0dQ92Dl71ELQRl3ZUfUHK8QI7tGFS/d\nzmFpEQgGMX8Xsp2sxGXkrSHTjok9dgxqCDDEisjXNr7lvoMbQN3d715lNB6A\nk69S\r\n=qqzx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbAnOdcrT3GyLWkarCbNrsNj+/0etBteasjjuWXPRm4gIhAP3EgXjnNahBonSJ0YY+tJKZXvhpSEqhEsCh5qysddCn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.1_1583521397400_0.9914593589429312"},"_hasShrinkwrap":false},"1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.3","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"073a2fefb7b8cd4f8aee52a160667e0512f4ebe0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-bikjoyBCojSNBLVLXmrhsuY25zxrZN4D3Ce03+to8cYH/K3Q4bf4fCJfABmBXFY+cwN6iaALEDDcqDUVW6OUrg==","shasum":"5fc8335528a7d2e371cf2eda814bc8f02b824f8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0.tgz","fileCount":27,"unpackedSize":51433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYp6WCRA9TVsSAnZWagAANPoP/i6nKbm4ZGskQu5N4y5U\n0FwZBf2VeC4YB54U9pPtCYGQvGF9/CV5Iio5XL6Ck1xnKX2zkCTQwySGtgSw\nLeQxqQ6JaSbDGT5BEcp9Q/QHlyhCnSZGCj+FsrRjYYH6VWUOdVDv81N+kGrI\nfEalbhMobv0ZVyEMUDwGHJ6ecL4dwgKkRPwN0JEagrs6hxRNPckH9T8m4Pxt\nUjpQggkY96uKiMa+WNW7w+HNYZrADdl3SBYZIslWGALYNiCVmUWBgjmd5FQu\nrK9wZ9qFGnUSow0Ehbk2tl1nPcqw1PLwbrYVeoixJNIDyyTaRmKNPrn/XV2f\nGmV3AR1sN4/jPFE3Qno1WTl1kYqVYj6hb+09MyLeV3GRTsYuGLqmVIR5hyLZ\nI7BBNKUz3A7KZj+JABqqUbgHh5ZmaAEMqlW2Ru+CsUnHggnbWp3i/MPOEIWQ\nlMjZosug0BwC09ms3hvdexzMdkHqWkFnyLfcHgUl6V9Ta5ZygH5o7TEclueT\naVjxXFlf8x4D/Rwj7fANf8v1MGsbZtM+Q4crtdO8iCCc1fDMbTupAx/H8gSG\nBz8lNXaEfwnFoQp3iAuY+SorQ41nK1XpprcgSlFztJj3VXhDnTEe1jYYTIap\n07UrOGyLSbvzxcjUh/5/8yZEUMw4yyOJOWTWZSB8Wsv/sbElFETRdBsqu+0O\n6q5m\r\n=sgOI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBt7OojxTKSwvDU9YIZO01TJgTwQHqkJqUR6E3+lVP4QAiBhXiKnbDf8nP7FmxMOZhubpzG3TH69/GwM/qCK8sFEHQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0_1583521430069_0.9317667004554508"},"_hasShrinkwrap":false},"1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0","gitHead":"e1dcb09479984f9f1bc2fcecc65ab644cc706fef","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-wIWIu2W9O/xX+XKqnRI2Aeh/d1T0/7pBh7sFIGXAOEImY5vRahw3UYzVhcJGIE0iAQt+aryJ3zZEAqLTl5rwpg==","shasum":"7c2e50356674fd6ea71f2260882358e5685aa60e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0.tgz","fileCount":27,"unpackedSize":51433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYwAtCRA9TVsSAnZWagAAKxoP/A4GFTkdf8SVz+h/EsjQ\nIvnfNhnOfsAdejpczBjiD1ZSX2RBdFLyjBrsudCBKqZzKicoj9YFFMz11is5\nFoOGSpsmspNySeyhA4v01GSiZei7iv6PkjmcWrPhrTaf62eQnSNVV7Gr37V3\nD88ISOHKa5xL8/yKzjpWHpexZfOCE1A/W3MXmPvOwR2d7W58Cc0PUWYDyESN\neiQ+EaP7xT/NyXMStJso4NM/lx0dYk/loBq6SijQsbsfSf6pZpjebrYwAZSb\n1Vf6lX6k5fG+pYieI3g4/ddlwLMuwXith1F1nVIpMZHe2vkf/Uk+JVgQ3ayM\nFMQ+uvAdas391WlabHorjt83XAJqJaRomjIi9PCnr9Pf2thpQjQJPCdTqaxE\nZn6HLxb3M9dptrqZXSGGgKkBbt4Kj5hZSaK7LdClAZ0GE6v838zct1Ywomg9\nbGx2KRNVb03FPiJCNQvfMc2pZBsOAXT/G1QV0si08uu8drIcaG33H4dDXqEx\n04aEYuMpMWEZDMhXxAwq9s1PXLGvoqJJeiwoYkxF0DzQXpiu7bn5itdDDSpU\nP0lWpNKtOIfYfmt+x9qCsny+9VBdm+eH1WQIblPHbD+6Fo11G4QjgA+KQSff\ncXptl7B7JXkHKd7+252JImHlGsb5FmZF75j1HdRWxYV/KtRAPWjxRGNgpkZ5\nR+fe\r\n=GSOS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgxuPrcESNw9cmrPHvvmfihfE7fxFROCAI2asPcpbBfAIhAMPxN3UiKDJYTNHi6tPsFNn7LSjJ2XWTepwfDjy78qTS"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0_1583546412818_0.6841201548208538"},"_hasShrinkwrap":false},"1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f76a471d431151f839109cda6994690a5d2af42e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-SZqW9yL9S/sRPRq6DeFrMqOpw5X+KUi7NbGFLKgiEOAaz8X3oJ4nhjA6pfq5e48cGwpN3ENqzmu3HaCF86emXw==","shasum":"6de1fe1ff09abe72351dc761eaba3d9e29a76994","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0.tgz","fileCount":27,"unpackedSize":51433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYwCGCRA9TVsSAnZWagAA/s0P/2jIw8/ytPZa21exuR/l\no0gZqecGpeI5sXacKRo7SFQrtNOvkwyAgIZhZ5kqv3bSpwrhxQ9h8qLe8c1+\nPHdK0YMFy6FnS9ff9/utTJHnqLD/fecwEy7c8AA24dwyW0fGYrxHFtm0JcgA\nxqVjISXeI6rtmgYJ8rzTaMoUSZ6Uf0km+FpXnRyB0VUMSHYgSMfc0wKYPYtv\n7GRcae89g8n/Qg9TxA7/xadeLIK5diu4Y3vyC2/Kuxrs9e2AlMQBnAvlSse+\nFMECX2oC9H1m62ljqE0afjT0MRvtcn5/Fi8hCyXJKhLiHzbj4ujv51bGE/Ba\n8Ccfwm7hFD1Wqc17IQqHlN6XpmBfxB2qjldu3YIZkeEHd2LaFwXCKbB9YjSZ\nnPYJr+VyIqoyDCwVJjmnHiqC7knKoefGm8e1v4Jrp3+itlpe47lrW0eOLISI\nNOnDLt5jtArO5uCjsMvIV20TV9/4n8M2VfQrozMZjlzoITqK3gJxsyu1J7A5\nGQ4Z7naiXaNTNeYyZD+F1DxXikPQXs+yBbNVBVCCLkkPDQbmCBZOXj2ejLO2\nIj9G9EwC8avMQ0MGa6mFiOvdqY7nbBdjo1U3zmmL5/j+AY3CUDXHAL2hRMSy\nG3b+VZhaFt75CJkndYFGS/eG6lqRJlExpCzMcBUOH0AxyY9uBjw9rk7x6YYU\n3XVz\r\n=UXww\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9i9mjIWxguTAq0GRn6UumhdacZVMqf182XJQqkVVdygIgFewVytBRKOVoziQrek0Am2GR0Rsy//nqxg+PZpMnGfM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0_1583546501593_0.5780720671763571"},"_hasShrinkwrap":false},"1.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.2","gitHead":"f4591b3a4d6197a98104a5274a048cb3c950909a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-gAoSSbrGT20BuDiJzQzFiB9rjx6QG4sCfYSdFA4h0/EBI7ovu0jUUyMt6hSNHjTvQZcxjeMRAwHuhRC42M73PQ==","shasum":"afac517cfcc99e4023429dcd5fe8ad2c2a0057e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.2.tgz","fileCount":27,"unpackedSize":51669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYwCSCRA9TVsSAnZWagAAiyYQAJ4vU0zzCO6S5iwhC1J/\nj8WejUNyiOIYvSKFfcIW64HztLseXBbXupAFcTTPpmg9T5n9z+tNuOd8D682\nPI4EnkJmwkQRhpn+9b0l6/rG1o8T0FfLPdVi7ExzOLMwlu3pzjtEJQMYGyJh\n7tmVvcwunyjaeby/8N7bv2X4mmGnj8P3Ewg/mjVLjp6pLXMmqowROzKQD/2h\noam8FHFu5LdstYUu6o1UQptgCfr3wgWOhnicI3dS/cu5FgFYKnzm68dIQj4C\nDgn+Qj26nw1PeTHyoUvR7lZMMc7j5jjgep0NtHkDYlcnsssB8d28lGg3Vpbj\noyA5WffQz37ODNZPo3lmTOzClcZFTr8czKnxACUj/uj6zxCTco7TnLZ/lgIz\nMPLAZblFl50YXfHqJ+g+yDzTbZKr/Ao9llTXmHNKkan3efRVy603WaUgJSMB\ntShJU60JpHYxqVrIbBq69W+TrxLfnZDJ6MP4KpqYTQh6kBOIQi4OT8obeQwR\nkzXn/nZ6NIt2gBEZVYVH0s5QX+jmdZj01EyAZcpe/mqOVtRAPQEmiJ/yrNzU\nKvfkpZbtrrspeeWlGJ5A+a0mCxOVhVrfOjlaj3yR7OZ60YOGIgppkMWmFVjY\nhyTIjbrFWdhAOtd0WR7urVCwh/kVvOTO1F3i3NuHYw/sx455ky8K0WLnStIO\n7vqZ\r\n=yA/r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN00YBIshN8fCC996yDP65/9YG1DhLNy8MMuEmFp6SggIhAJXtBndB+18ku4RVvjSJnTtzgjtLwMGyw/gCPLc4HwwO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.2_1583546513532_0.07974337695493694"},"_hasShrinkwrap":false},"1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f4591b3a4d6197a98104a5274a048cb3c950909a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ok6vW0mHhtn0ty9KlPp+ZO96Ah3e4bP+0KtCyWU4sC9e3kSRGTf7ZcTbSTYsJvmt8KUYiemkGq16FleqKqyI/Q==","shasum":"fb9d395463144b4be3ed5af062e559431678b27e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0.tgz","fileCount":27,"unpackedSize":51712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYwC6CRA9TVsSAnZWagAAXUsP/R1xpm8unxqBTLtvtIWN\nKohtPsv8TatPh/9B3DDtkkeXBl+agZQvcofILvefAp4JQkJxje7JrcsGHWgB\n9t4xPu7prWykn12CyNq3mtqzKCawRR2ZqPSVHGohVyMr2HBq9E9Pd3QH0Fxj\nUdcEY+oEGZB92kWcD5r8qL1RI6Ay1Ej7GYXPDGjlokxdR8EDRF5epv6q2Baq\nXqxY4gtva1zVhZf1rlEuoOpkJ0manqyJsa8mIQFd8n0l+UpJjj6TYYaXuYeB\nVRvsZWIIbP+GpIY0sgF7EwhQSta7JeqI1Or5rOyV7T5i5vg5lLoTp/HghMG6\nrJC+vaL1MmxNMf+rUB7ltt2x/Zy3/swYGPP8M/RiIZzzgveX/wTs31dcnVYi\nholyENZuc8NjgQUTLwdX9rUaz+JVsGip4sWm98t/3rjaqN9k4ZXgnDGdWG+j\nmxwwKgYxnd7MDkTq1V0eopw6Ii6ZDqoCNGrUsOVEs8NWQkl976GhbHJ0hcaL\nugFZy2Q5aD7X2nu8j8aWabcm5XqBK1rJoZMYwQOtQP5wbWXQ2ebyvKXKNABc\nNVpLdoBYoLpVI7KX4YsOdKOxBLUlTh2x/97h36VbNy9PDXm76BJdpe4bWnb0\nQTDfl671LhdC/OEwwGUqnBjXGIsQS4TA5qeQYXMrXTAIeSyIVPZDLECcxaoo\nAL3+\r\n=ZILk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDVVBGefk8VhoEnclZ1tyE2LiX3ZtYeMnqvsyrPmz2R0AiEA7Z54BmKA9ChJMyj5x2+EUw6XPiE7JObm+4jHkR1im50="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0_1583546553654_0.616878503771846"},"_hasShrinkwrap":false},"1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0","gitHead":"a578a28f6b4a68e300439b65730e779faf2907aa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-OiRsQwIvMb9Y2RcHt58mCcm6YcNCl6FIxPNK/vhmrgusG6oTg64rgp+5vL6sYnNTRhAuicDhatr3oqrfv0gUag==","shasum":"b127103940fcdda78468c9c19605be591f2785fd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0.tgz","fileCount":22,"unpackedSize":95692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZi2hCRA9TVsSAnZWagAAzLcP/2IlyGF0Tr0vSizq9MVX\nHcp6cvn+a0/shjSxkHErjF+JV7nc1NPCIaT/A99x/Kd+pP3Zgfx2nMaQNCv6\nXsO84ofR1r+cwXK0zYek2JAhafByeLuSSEQ4NoXn9+l1APIOhWLTZ2NQ15bM\n0E7fq8Sgvo8zWUooEkgdhsz8Hcj7f91hlHDZyS5RhOWhcYY6ovtvNyowY1bP\nFpY7TgkRSxGZoEmXbp5gqOO+m+MImTT0q+wfon73oy0jkcOAZvWzYY0xvww3\ndRvixhIgXVben5bkMF9H3SO/TQeoB9WqyHirtqncKtdbAGDfJJ2xKxN6JJSn\n+A0UfJ1/KH3mAulACpThXbOh5k+aUJ2+sUQlLBJHO1u3S6r/CN9WlFaRQYKk\nVH03OoCDH/zSazqWUyw4MpHyFiQykPILnL6nlezhdksy6+AtPwySaGPK7PMK\nXHtIwK8Ey8J3JQrJNSmdXN9EPB7ithD5ikWBXaWtMEwRNPHoQLlJ7xTJySxV\nrcsgoLRCbVZahId1JlVRx8/L5O8vraR7DbpuFYOG8O4ln96/Z9VbNQg0TtgH\n43756jYNbQoWdofoeHHGWy7Qymx0KN9LkGjLoVZ80Wr1s/AMWfPKJTjnG8w3\nUpygQWlO6iXVDdhN8UNtRKa7Vvx91vM8s3x4rRZJXXlrwNHM5XC7W62c50pE\n7ZyU\r\n=OeNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2sT27f9iKkWLsxHfK3vZkkgYqVpaZDwOVtezlNoZ1zwIhAOia4smAXQCLCgDAwx8zBlK+7ay6h7PSNcowzuUJ41FB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0_1583754657090_0.6662405700692688"},"_hasShrinkwrap":false},"1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0","gitHead":"dcfc6c2591b3cbcc22f0c5ec82421559c1420036","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-O09Kx6qpZXkFPYi0sQdqksH4HlGwGstOess851XMvkwe8lV/npKs5HQSXSvlCkBlaBiln4NOaVxHaiEY4pUtnQ==","shasum":"f0b6e70282517c09e64163e6335a006176baaa29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0.tgz","fileCount":22,"unpackedSize":95693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZi2rCRA9TVsSAnZWagAAOJUP/1ADRzfOA1qDZCWF7o09\nLY5BKS7kDOmmCVebxyI7cryptZQEdBxeym2zpUNrPhnjIMpqKrUYzt+qT7uv\n4EOMknQldflaHU6Wga82xZZuoa39sV4wPqui4k1+ZlZLpYwiHCBS1HyzyHSi\nlxCIT2Ujuy3ySZJkygqK9BY1MC4YmB/ZyXq8nKDYhNlqHb2pL7ZZFIOxBBgG\n5V5UJQk4dXnqKrtTNOS8WiKEyql6A1eAoKIFmw4aGn3kQPwiQJsK1SCQyUZJ\nwdfjk8UGSeTNLq77O4M+vJ6ABZhNh6UNgG5wfq7F20ihdSMm/tZ40JsBSt/2\nqShem5ZYgwQxAc8sLnC7Lut+zdbQw0k/shtDZmtOcEgdYiLs3RP4ODtU10G3\n+uebS10+6Kt/olAzKos9vxJH23VM9G7XfGdIypoAgPJR50SZQYm98ic8q4tN\nXQYWo7xEcmkkZQ7IgbmcQraMfpLQnu1r5PnVZDy+IJgnsIMeGCm1X2nw5Y/N\nOcYk/KjlxaBip6xoKiSprBX0Hl78toNBw/gIym1l35tK0tX/9OxAPXvWGXhM\nWrWBjuqyNBNM/kBAIC4ZBrtH7zAktXrLtr84rk6ey5F3rHiFEA8H7eXDxooN\nnZkzwNksI1MUIWPqYTgsFIDwhVR1g1H1JhLEUoljkUdbRMx2qseflM8CLbpt\nEo/n\r\n=Y/kh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0SL8VXimwJ8jJisptjvpZy/93/6Xktk0/ydBk/MalXQIhAKt0PlnkizAfuyDlfn0/1xS2A1RKwtfaBepgmQhJivnM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0_1583754666677_0.687925467986306"},"_hasShrinkwrap":false},"1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0","gitHead":"12ec8be63f1fed239425cb656f63e3b7897abd65","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-F7hhBfP2Oj6JOV3mt2TbUvf3t75jlpQ8txAGbKZjM4V68BIyqU4i21iW4IXLB/L0F+GfxOCQhDNzBoRFnOXjAg==","shasum":"99f8d0aa87b22e711544c436b2007a3ea31a8f16","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0.tgz","fileCount":22,"unpackedSize":95693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZi22CRA9TVsSAnZWagAAWwgP+wbWSnFhLKNqmN4ota6J\nfNdVoQnb7qB7S1aNxqYCwm4hr4RYIsG+OvKowAq1GLJckoVLnS4PvjJCNVtM\nHL9oQpNQ+G2VxeYH5JKXNDdKdTq57+gt9XcM06M3XTLcgcGjdpXPlZaK5aNg\nK5KmetIdKCBn9Eu5rXA6mISJeoSl08z/b5Hwh9k5kh0Wj2auj2YVS68q2Tc0\nxY6Z6fAAq/mxOrXBu1/itZeQxHIoGVArYe5oVsbWDuKDz92gsukkH4UaQ8td\niFYBOQNt14E46qtyoEP6vZxprVPgDzMJeRrEmedOCPdnaWrHI5ytk3FQaJrF\nyS+/bLJDZba1yOUUiFmjkEyiORtTkCW6+MFs+wHZX3nlSm6V7cP6GuIKMH0C\nMWRZ1AXsJlyyOPSk3Wqu+BW53T9gH7XChBraBcg/LbDue0IH7fPt8iFUHOIf\n/cGQv6iUYHQwzP/ofCdCDzGkHR93fm450ghT2vQqpz4knpYGqL1yWkNKMEeD\nJ8qqcSD9AcHErJgbh6Gsg5wNrRXoleOXA0GWDSWBfCiRoe00dpQRoPXJMf28\npc0f94VnHcXE/jlbsgKWFmKeZtkDSFXwcuE3lmXUQ7Er/vP18JqnCBRgKqHK\nU+je8udsKKbJCi7UuU9Uf9LTDwnT6YfxM8sGnwOucP9ZYLA/LQ4BdJxcsXqR\n+JcM\r\n=nfDK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHK8ssldTSfyTYXfwegmIIZ75G82y4iKVHFjI8Q6I1vSAiEAu24HKkcMlz2wepQszGIE9t7qga7GnM9Xl8sKmF9vM04="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0_1583754677671_0.09437384139712379"},"_hasShrinkwrap":false},"1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0","gitHead":"791f2ab3fa316eaab11cfa684fcbe160dc12dcb0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8cr9mpOmVRpnZQ/jXzwwX2x+/Ju3X3Eqh7BJW8aFyz60C0Cp/bxMBCsxmLODbNdEwfPD1J+PM1GFuBX2RMcuSA==","shasum":"bcd89c4c56cb5898ddd619c9c5509001723c6dc5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0.tgz","fileCount":22,"unpackedSize":95956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZjJDCRA9TVsSAnZWagAAckkP/1dwvX4E0nrhd/l32Crc\nSXTQCRw6IAiAiEx/7ZXyLhAdbjihicAAXL+bhUt8EpVkfS8HBX1YZe3SZc/I\n9goRF1JQ8qtk2sxpNY2z/bz4ylVP74MU04VvAQilJD8U2kcWdZScW9eThSRE\nhF5Vyin+fsh4ApfVWBIOzHkrtCCrR/fpozT40wusAsuDodfu69zLn0NJQZAJ\np/C3i00E901ghxhLJOvP3ejdnrahx+eSx5svLbXdJCIv+ZZfKSim+VhUUFB0\nqQVhosb4tb1t1ZlvzqsPaKTZn9bjZDnekhWTwykbTsXCTuHTghAdEZTKMQGN\nCIQ+4/2N9ZF4/ap7rWj9Bca+Z/sX0OLiUV1mVFnelq1+lMTgwQ3DekhZVaVh\n733ZKbXh+RZbcrZn02CdYvCM3a7tc18l3LoHB4Uy20J73k4wr+3FBiQdBEjq\nerAFP3Os1TGX18uyGsJYlxB+rH+YTf3VyHdjYlhyWVvF38bTJ8f8q2jfAkww\nXDdMk+LJCPMiPzy3wso3XD/hAQ33fWYo4/jd4yzNa19TGB0qJQoVeqNsJh+1\nCnn88RHJeUvY+GBApqu1aR+kwJ4Vti8k4oSAbUO8DVElkXl2z9Uq1xDj+q40\nex6grHAEnkoTa0Fak249CmhAG7hJPt4nAi2C1ShM2/e5DcK3tblZi6QWBjHp\niUdT\r\n=5MN6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoip1f0r9Tyc4NwqoBIKm30OGtNP4/5kSeP2PKDqerIAiA261iP1CSxi5ROqq/EOts7f/wljs5sA1dFo+hjdVcpBg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0_1583755843460_0.2896240874558329"},"_hasShrinkwrap":false},"1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0","gitHead":"86afa445658cbee58273245b44cfc321b5f14d70","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Vr8c7ErhvOpNbKFPkRw7AWbCZOHS8YGML5ri4S91czqK7r2Vhqe5kxHXzImTNveFvbz4tyeHqjYUOiZgzZs+yA==","shasum":"d46c29b1a710bfee1b8e4c9b3b9a5760b9f4f2ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0.tgz","fileCount":22,"unpackedSize":96329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZjL7CRA9TVsSAnZWagAAUqoP/1uv5lX+tseRlBGSJ5lI\nYaN3QzGg3dFYjPIHlSdBbLOlM4s1NTQ3GSLAamF6G8g25Srm36ZqlRKoE4M5\nyQI4uGWqul2FYE8o3+zoDA5fp5MvELn+F7D115iTDV+4Wefc3/2LXcnKtJo9\nE4O7Q/iCRkcWmARbrxUWTRIgtM72L50SKqr4uTDL5/UI2XgfSVO+0H7vJtM5\nYA2Nj6k6rQhrYxg3TAJS4ilbxqys/iveMGVUPnxthwwEmCnnLTG2ZgxNmEzb\nK+Ol/i7iaTZV12ukApmp3YLlO34Y5GCW8SWJm4KtcJQuGUH21+82IcsMIlkP\npo7v4KJPMR1XQfYCndZqZOBDlzHXX7ZBMlEBM43i7KTf3FSGuJ65xj/QXn8I\nQ6jEPUaV8zn+iVPPwOGZNshpkERnaP6AXQ0kYXxaxilVQ/3cLNM5kPGTQd/D\nh/IyqC3U6tRELARrwaVNELQn8fQBZAC1zaFjuwm0iAbjCR7Mrzgxs5xd139x\niZCnu/GeKmWDQ9waGFxx8/hdTMfKaYj3/90Et1zqpEG4ST+vIP6FZqDhBuk4\nkJ+fTtikksS6m7mKnGrImlvPZ1ChYbQ3qI3zNk5FWyKKMBUyhk9fgetqvOcm\nmDBpXIT6c2kXoYWWaWDoQHsOfRBNRaT6yz73BIuqEcpH65y6DjvjIJuYF1kc\ngVVZ\r\n=bdBj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6BEDycJi04YWDaxVmjCmnCRLLLCuFA7uegKWFvC/mMAiAciWHa8MNkX16q969WYiYbaVSHILhsF97acf6XEIQERw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0_1583756027389_0.4517102656813994"},"_hasShrinkwrap":false},"1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4e7fedabfad26a5a0c865c9221fc80f445334e3e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YKb1oitwF+ruapg99jGXCEgqNJppWDzPZKrSPuR/qwcXIcL/GikKuqzn4O6+H/4l5i8iN62i+JuI/cR0fCsUwg==","shasum":"b0c3bb6a88b72975cbf0dd8db386e863eba16153","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0.tgz","fileCount":22,"unpackedSize":96329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZjUYCRA9TVsSAnZWagAAwngQAJlwQm3+GLqziv+3xfgQ\nPC2lFQeKgfMpWUMAhtMqCSGrSjfNKbrPY3CabSQgbJXvDYfXk1rf18a90tGU\n/AIOFrWeusPw0DOxtRFxe+hqcqEpXAgU+F/X+Bk45YBTCsfWSUZQP7S63z23\nl/NiTN61ssaZd7c0HzUOtBGutTdp17vpsaDX8YA2IA37HbDlpqfRzJIYJ/1N\n6FNvEXoAaZwfuf9EP3KBeQSLNqnGRh+DuovMxO1qz9OUAH9cq2ianJBjXKqP\niA9mrPA6b7sKJ3Oj4IOm9hgR6eOKRQq3OopMw2Gt7i6JDNHLkI45k013I40I\niNi+25C7P7PUL1GcdfyyaV66abFd1aO5GggOolM8ugvxFEhSWuf9HBIilQr3\nM+RZKXi8Xne7jJoEQwPEAHBBOAVlAsLCp4J7W7UuSLfmszpw1GxW62frrkHL\n5cwkx52+0wugujrZCHKHxz1D+LMNLvJmM9sy16Ca46OEFQigTevnQDGCLUNq\nUwshY34218fTWH1rBKBCnhz5rJf5wgShdlQta/jIsUq5lpJLicfNzhNNcofR\nsmcgWHUB8Cr7HYi73PHe6xLTr/+vuzQJc3m79SubC/D0pvtZ2tGIcE2l3CN+\nC3t3ZIXSjUA15zTdQgz8O7iejXdmlEwyIxw7G8C074uRmYFVz22dDHim3jgf\nsLWn\r\n=Yxc/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5hQvRRqYEPJpZd6Q4LuOpTyD1IdXi6jIOTvGEOMT3RAIgT/0Qb08pMqeFZnyOv7s6hD9w5368XygrY2w2PAgXSF4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0_1583756567541_0.30966042572023245"},"_hasShrinkwrap":false},"1.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.0","gitHead":"7eebd5447b8a05963d81ab355b2592fc4b24b1f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-jfY3aMKpsuJZ8uqLsQG5WEE0YlyCxr12VkUgwA84vL7w4S0wqkvOo8X8siOZA+IRTw32XGcanbpN9FRgqL2W8Q==","shasum":"52d52ce4c67756febd225d506490d35f635b6464","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.0.tgz","fileCount":22,"unpackedSize":96544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZjUjCRA9TVsSAnZWagAAMlEQAJdKkbnNbdBqIFwrYPnt\nbtlrHEXkiInbOLl8POMxVVTWDA5/PACyfrsmpghplPU33nohTlqSvLizvxs0\nzQhvAkOC9738v4Q41xBM59RWztGlW1tHenSddVLL7D7/lJDHzcfYCb9Xu6Mw\nqN4lN896BUk1OwAaMCo3L/ck3TgfKMEXfCRKdfu75J+QzWHbFciPooKDqb0B\n+M54+s9HTnD3eInmcXCHQFVXpQtWgLQIVQ4ooWMrEczVKl8jU7o5N9bGq6A3\nRGtjZWNjrMs38uYoaAmgDmiNqjR7jKuorWT98IaI04KE0V/3UvRP8g51Vkn7\n98u8GXUiVnsm0uHGwB3DX3nAEQ6DmLx5kAEMyasjWL+W/PXdO9jRULU1r/UD\np7RWUBu9arneCRIEiVumOBWw2AcrpMZCS5VyS5SR4ZdT/HnWbWkjGIlJONPN\nCk2hK65p1jZAyEuc7nLgD5GN+HA6/QO8xskZcJM1j2rAPXpYDufxkNR70dOO\nD/4LOkOQQkhQd2Mw0bRif/qQnCUezW3z+uJrXAlKvBSF9t67b5YtJ7lrYWIq\nKV15qVEXqrfBNvPyyW4psqkRk2XZKn5co1laeUCaRCwvQHnuAere742jXU+V\nH/YFDu7LheFgKubPVgAyrOZo2+jtoIp4xFfnlMRykm4ukj9h4/3zt+dGijpA\nIAGJ\r\n=jhwY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4ZlTi8xL5uLP18+7hYyhUgOSEsurpz0UpEfq9MtYOzAiAQ1icmTjL5rRYqToVoJGZW/9yT8lUqNFH4lUZdAzhnuA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.0_1583756578741_0.04570440376928109"},"_hasShrinkwrap":false},"1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.5.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7eebd5447b8a05963d81ab355b2592fc4b24b1f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-HGz+LGTITZc3sAbMHbFO5k+Bh9tqkla2Wp6HwRc3NhYnSjPBdaQjrdRhlJGVTCb2eegZzIQxMn/v78L3SpdINg==","shasum":"37f9610e31d7bc0a389a3a5ff0f2d2b55b6711bb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0.tgz","fileCount":22,"unpackedSize":96587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZjVNCRA9TVsSAnZWagAA+WoQAIUxgA709WCb/I/BMDvP\ngDNUaUM+eiE8g8T1sgO9zqUZ5aYtX08YbBWglgmJ7826WEQupBjzQ4/bl3HL\n/Fe91mnUWsZavFASpQqsVtPdP6PIBzGcnDn9FMpAV8c6Ran5oeIGjSfFBUY7\nCEqegZKy9ePkhtV1BlxxXuT+ua0dN0dBG1RJIaPWImBp9VCLE4weDzDIJQ8c\nAKpTPjIFktwaWCQ1wcTY53M4X3pD4w77/HxEyL/RNKGyppFwAig+/bS3k3KB\nlvg2OxOeQz3BB9KJ3q6XQIPlTr9KRPtT4CJFq18d/rKUX3fBp/98MmM0nDy0\nvS1h7W3mUHLkMjBB/clin4/VHTnWlvRF1wSBtgl7vXfa3FRov9CBEFI+aEpb\nBrBcQlBtvJNQNdelnRZD0k1PQAyRTkjz8eD9NU8yP60a6A8wGzzhqr/GVCds\nCVvo/1oZo+XCKXgon+YLKgqIOmlBNaLUBTZn69SwD/uoyvhetBT0QEfkQQji\nbafHUpEvd9lpcUQSYaBrnnz8RXkpA7+aQCrOePVAitC4OJPJWJyzaJqqe8hq\nBI8olFJEnoUJo4eHoapLr+be57jXBATZRj79UEJadpKR3WioP4NOaHKU297G\nHreVF5rD3wz9qGvg32KcJxm8hTocRfpFW5A1hj3gtawx5qqOA5aRIaQYSaKt\nO52P\r\n=o4sE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5uwLASP4WdW+cOEBf6eclCoNBflzzeKjPYNrGibpYBAIgMBKd0fIB8e0d6ILmGQEff47EPLpjnVBQqN+mmGZbdfI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0_1583756621025_0.015320345859563211"},"_hasShrinkwrap":false},"1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0","gitHead":"e9ff05ef0fce090fd4d689c498716648a0743f76","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YgNGsdRd0XDQ1UNOTUzNxsvjPl37KCpHEyLrNlKys1hDJROxA8clH3uMAsIWEePzDEzR6lp4NgIVjWIoriB1Hw==","shasum":"53e95dc905353cfc903acd71e658705ba7c3a5e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0.tgz","fileCount":22,"unpackedSize":96587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZojVCRA9TVsSAnZWagAAJYAQAKDUoEcLmr/fEpe1nyq2\ni7Zz/rZsXWir4PAPeicuHTePAArKPTQr79lJn/XexDmiTz1LmvbwulStEo3S\nkV92615p3A9WvW2C0XYTxYEekXNRoVB2rcDPqyzy/cnRkX0pP6hP+WvYhulj\nhCJmNM7PUFxM4GlcT1II43HIIklYCJFmyF+0F0bM4vwuaCMcb0/0Y6AzJcXP\npRgkzJ1eXgsq3fToD1S9acfbGsD604lrsUdPTHdMMyu6+7BYJv1qi+A4+kXC\ndtTRQ1UWMjdEoDNoBtYQ4+342zXGKiF/Tv+pHxUtVQSjs3h/MkKqvGG53R4e\njYPRQwYT1QINvLDOjNkufGs7qTYSVB706HaVIWnPTZ/5qwX+BKnz5faMkdSM\n2iaB3e5tJV5vPVLtncQV9u/PhdqLwlVMNacQf7EkUZuVn0OnWzm2SRqZIL7+\n89KVpY+OoaOvmVpf09Fdv470uEFyKlTU5WFYNrrNRvoA/TkMNASw34UgGKL3\nvEd8Y3F9pvDOOMVvUovilu7PybjN2f46IULTPHJgC403N6thUvw23m1ylS6w\nDH31PA7z+rsB6esdtomjivATHVlde/X4jaCwMH34xMScLSWSxhQr6kx1Gu34\nuSVD9SqByPaPzP/pe6St0Aj3I3jCNPOe7kyQzJQCJH0GnKlN2iVChWUry7LX\nTU+K\r\n=DGon\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+KuUretyjMn1wV0DPbA3Xc7uKL5IHlQHwUlbEDtSlSAiAiODlHwNuVi/RiZhxVPqWtPECbvIWIkYxR8E3uIa5KEg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0_1583778004652_0.31390570345847424"},"_hasShrinkwrap":false},"1.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.1","gitHead":"dc51286a3b4d8f5712483f746b6fa8e4d794d3f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-xTwYvBubfYDwqFsBs0a5DsVU8l+zyuPvwRAfVsBku7gFuynx4Cz3QitjElW32mD38wW8yj85P88Uvio9NZbF4A==","shasum":"036a3d892e12b6192e13a8832d6c0ec8423013df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.1.tgz","fileCount":22,"unpackedSize":96829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZolECRA9TVsSAnZWagAAK+oP/jKE/Q6drNJ10xwDC1zK\nafsJYhtZHxeDp0l3xUyPk0vnU9EUYbfkdhYzSBxX//+MkFfmvu+NGBYo8Vjg\n3tFkOwmmzibHFOsQ9rQdIsPy9I9F5E1zD/0cRqSZ9vHxtJfSXfvFZwtBgwhy\nRKWfrpFAJpPHUtMGqksk1d8fbq3z6Y4cRqn1aTHICAYUEw4HzpKFIOo7ha6C\n7G+cfZlIdUX0+8sKWNCbDSwMEa21m0tbljycpv2xRneCJ8imQ8kCKubwYhyH\n7lx6/cFOZbeM6eDex9ckMV2cPaQZIT5Kerv/7l7C43hLLPZKXzJKlsd+hFim\nu8wyGWxGBruYA2ZS5HA8mCvh2CEEmhaNM0V4/JS4f44jq+gDlt1SviEQbUTf\nRCCFqabu+vEkpK2fQHLRXfS0EAOE5rqybIVFi6zZSl2CpmwPpHF1PSvg9RaY\nHHT1Kacnu+VhNLpBcmmvv32Q4/DQ0sFsEQJe7GDtwr4jVFAOljDvCOpGlgoy\nd10pI2scCrauZVBKNi9+BsDhMiFKTESWOzrqnMJtDYwTKbEjkEkmdOGLi44t\n4b7jQ/o2YDf+G6uWdK1Kt3UXW1Euqof1ig/ki+F2YhGyPPErS3HE0rubXK+O\n3YDFL4jIrDchSJu+p/Zkvah0GihTZrDXaQ7GmRQiOwPKrfEZ9BH5gc3qvtut\n+yCO\r\n=faDi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDsUz4hM+lCroJ2YXGG/6kGI+NFlzmp2oIusENxBi4feAiEA7zCUkN6UR/00HLf5fKa8zUidQPyc4ABfpHhKlvXbmlk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.1_1583778115605_0.1292738741593331"},"_hasShrinkwrap":false},"1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a9174165042fdb46196365a3dada2e82a8f3ccb6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2MqVfLedNpUAM6Gt6STCz9cOTrHx44x1ju4wI/fUKvXeyQCMFba4tX/BKfYpA2RB4ik463UUD2Qp07IpkO/u+A==","shasum":"5972eebf079e7f7ed1382b2da6ebe4aa76464d91","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0.tgz","fileCount":22,"unpackedSize":96587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZolPCRA9TVsSAnZWagAAu3sP/3JdXgNdb9nOiUGi0gS6\nY4lwpcpc4x32Cex4SR/uGYGU353WB1yLp1OcTUJBTaS1wHPitPUGZ5u3OZhV\n1H7622vaU0v8UFV/pJeU4/ya9S5Vl0hpJCvoZqBMlnyuzRobkrApRKdBtB7y\nKxcjZYHHCmGxbZ9AY9F6NdsSlyzVO+hgmZmjhNhHTZrQVVJAnxO6gNtwAJSr\n0LydvJ4DwT+aeEfLiUUdTbuYYzSQAsRmJSBguEHCQTs4xk+XJjL6z+pgsJKw\nOyCsJ2yDOgFgdqBLpn79t1FBFwCyywYsoarJpuIXMbvSc2rkRVyC2NhHYfxM\nx68FBr9L04blRAf6ipTS4aIW7W7u2nXFHIM545EK77svQeTQkfEFfZi3K7sS\nSUEgRnUNhfG+2efVFgumtnsKr24xOzryP7hT7O3lWeLPjj17AB8REA3oTFPa\n3mhpNdOP5rMuzHvtgc6oZXWvlUo0kgxj+SrNnmPDNmQ52ft09I7SK9FxkvqQ\ndEF8MP2F1Bx+zUn9gXGMK4ZdB8c8Gut40cqxcrz8xNzBP7ac585PpGs/O01R\nzM8jju6AW+bfVtH/ystnBc1PiVn0DosZCbcypbG0dUyopWd8MHkgx01PEeze\nbNc0wWY2MDsgM2uZhn2z2KPx/V9a9CwirezyjsXTCBfGujYmy7UP6N29CAdO\nNllo\r\n=rPsk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAP4so0CnY+HHXN7nckeMmRWP1w2GLmt9/e/ddwcJSw6AiEAqT/6DWgxqjHYkHHAVR2qnu2IfkcyWgFspMlU7Kbg5NY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0_1583778127199_0.45612327733012714"},"_hasShrinkwrap":false},"1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.1","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dc51286a3b4d8f5712483f746b6fa8e4d794d3f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-IkV+4WlyyTfVJATI2ptALhOzdn6fpHkqLH8crN8sAELoSTYfv2m2BF6c6nPe4SCYfLh+/gqXlIckyiNH1ioIBw==","shasum":"2b8c2b0ad5838e735988f5a1537d68ffb6a93831","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZolnCRA9TVsSAnZWagAA+4gP+wRgkwOxNA7e+fPDJ4EH\nTbUZFDYUZVmSnvMhCgS6+PgtFXKIeUFVIzMlBS8NI9+hjbDGFUWv1K6eDN/4\nKI78gai2A7mkxOpVBO0sWumXCs56pl3INPDnl8Cdq7T/SYa8BYipCXuj2Cfw\nGw+r+TfoKxA2zulf4JPfWnmNbI3mLvkecgI4DEVu52zDazFb/T20uQaBHzpG\nRUbYRk2n0rEisomL9jjx0QKOCh9xm/ztEt9CezpUcEOF6Llp2REihLUagwpC\nsyqoP9v0RLUA59BTwUXAsq6aGt1QQwtbUMQ7NiuNlDWxfW5AkUku3dEhrT1s\nN5igns5yTClzUALMRDSDcY0Ew/BKXwYa1vuP2gK5v6JlVN8E22mdeoUV+TH0\nY/c2m6asxAT7oVH3Gq/FRsFxSKMdvAZmQittE2RmFik0C5YA+mrHroKi1tcN\ncDNwv41AAGWTbAMmyh47vr/0wQQ98y3Zum1Zit5KavL+RNmyXd1hy+blLUVK\n0KRJgTdLiYRtMeV5soF7x7R31hcw9IJJbiwjHQMr0p/4R5v6uUSHmM+Zcc9Y\nSbuVOhK3guoAJonbwLYfhzJaRgJeKleMdW7UowpVpXbpqgRsy45FmD5lWqRD\nc4oaijqdVCMbYKp8p1cplavEIe643ucrYjpA30pdCg+1ruyzgtewiQTWPqQL\nNOBP\r\n=4XvB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqkp1skY90HFEzn6+44BH7y00Yaxh1XYrYiipiESeC2AIhAOtyQ3srTUSMaWf0gpB/eESiqFWOAGHjCBUqlOw5uW/H"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0_1583778151227_0.25018446606667455"},"_hasShrinkwrap":false},"1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.2","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0","gitHead":"f41aaf7f252cbde7f3e3cb7dd1c130791f151143","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-7xKm0twpabpkjepsYCbeNriJG+8MvJQUTlvsZ61747G9/57m6Jnjz4jJnBXcctdOBv+Y+XDJg8IVvB30fKD5aQ==","shasum":"702c39feeb996545544b780d0e36b4c0c62bb7d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ6tECRA9TVsSAnZWagAA3EEQAIpXaaHtmHqg+5BgSv0W\nbKSAgkydzeTU4GnWHxaQSSVqvEd0wx1LS1UKs1U/jgx1/LJJ/gyRrrafOmM/\nJJIvosYuPpgOso9gwKKFX/Fh53JYRDdyONbJF9cZL5xmfDFWdfNbXVBoN6RT\ncLxZj3xdMdC5Wtbj+RDtaWR4bmYl1YleavTBOT+TPb+MN5m1FOrdLnrh8kls\nO92zzHf+l72Y08fVCnmEahhZ7qeDOhuVK5ircxtSCZ9V7OqOYiuvTmZa3ghX\ng8aFjsIK7pJJc9T3l0i1+bWk5dl3wgM4ORGdO+O0MR1aq22HASO6uD3373ed\nnbj/bR4W4oZrSFbvOJPjeXSta8+8hsTS6cGWEsAEHJvFyzXWWUs2N9QPlnYo\nF9szFMC3x2ZnoceRQowD39jRlX2XipZvOKu7YhvBiA2PI1wXEG3tm3I1pGnN\nTWU9kSZuqJPWx6WX4ieCssHHUdsH6uph4NkzCmK8Dk1umS+ljji59FJXx0mf\nEsdAFZQL7OnxSoinKgN5QjZx8aeKHNWmXV4nKlWzhdFnyvAY9Shj5lRiDGBp\nPUG8zVGS5wy8zsuysOevLQ2+SBtdhkV6tG5FGtp1+cdthgk73UPlgjnTPfxM\nDjuISVPFKai4XjYuOZQPBXmgmNCOkXqj70yfAtovRJ9HyySuM/BzKpadOO7V\nvXGG\r\n=eZkk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv8tu1VDVyw6Ox+6SA3OYnPk/1DJ3nwbpEao911JmidQIhAMdfjlSReqoePTlZd+UY7nxNf1MTEn1fcyGvxomPF62l"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0_1583852355800_0.39727046522415255"},"_hasShrinkwrap":false},"1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.3","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0","gitHead":"4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-7TO2cuVSvzBXpOFjJZL9k44kLckZG48htsVxHuYh3Dwuuws7INXa2KV886NSFggc8GDkzCWPnisBzS+ecXc2CQ==","shasum":"c966aad34b752adf5b17540a257c5fc1463046a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ6xqCRA9TVsSAnZWagAAxE0P/1F/jMicosVCRF+M5r0/\nbTdQGqX9af4KzgPm309+cyfjP79imLUHTKpPgcXPbWjVIC5Q4o+vltFbwfe/\nhmX29Sdtm3ABK5MuesnrO1oQCYYHT4CijpqnIlSTry08haLwUHNrNBuf0g6H\nGglclxNEc45pQMHTqa5EcgPt1OUjVhgawORxtbLRp2RSQlY0Tfd3icLu9Meo\nV7tWV45JDAspIMSFhnIJP5WbmXpO1AO13RAV+27jTVE+DOxnpqkP5OZ7+r9n\nPhTGrF2FjLmFKUn0ZoNwKwzrYN96669cCqUs419L9M3FVkB1Khz1cLrNx7WZ\nU6f89XRO7UWNBVGleq0DfxEEJvXh3kMSNZD4yTlmUX9GWBQ8KY8+eVIg4zup\ndwcCFBvnZZ28yFQJsjv4kaM/iPxLIorben6uv4HshlRpp0ox4iz9mtMdP64X\nCT57Qal7z7dE8CqXen+fGqhKWjiUvmr+UaU2nVNDnClSM88r0nwxcn2NwPIc\nsWeX7Ltv3+YvtR8hqYBVlQehnS92xl5xZMvRTcwtGdLuXgF6dSomjNyDdRiY\nsRPb6mkNIXnvvYl+legjX2UrMFkRlmUog0nTAo4Tz08WqvFJykGuV32HFPFu\nVwclB6SbAnzEUDo7l8HGZ71b83dHTRHDDeawzvFklagaEmZPLdatKZUqv3m/\nSPzs\r\n=uxka\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByzY51eHAJ9n2nSH6yaZ0ik09OX5Aw95WlGYN4IEE5QAiEAlM7HNeq/DJQurfImoHmvQOHdRU4Zlx2YaGeXHE6ORQs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0_1583852650011_0.30830487997519507"},"_hasShrinkwrap":false},"1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.4","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0","gitHead":"626135243bd2b6dcd1aeebde61d47c7a7a251ce3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-xNp10uZv3N7ChwhFfNuTiBt6pZDFx6K+5JmG9MmcjnRd7I+8pIL7aRGN9+nTTdFEQqWO0HN2CFWAKAXZLltbyg==","shasum":"a2ba84f208fa0a68260f0ede6d9171137de4efb7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ65ZCRA9TVsSAnZWagAAkMIP/2MdD7oOCHrdyHH6uiqw\nMn7jxyIljm6ZiveLm+0K349hzG+652wrO2ZD3lpvOmhxyY7ba5ui1Cam5XX8\nu/LqyQ5iQyeYalrwmFJ/6HW0HJ3ese2eGR3CYdkx89XYXBUpw/3wFTScVWOP\n71mwymep17Yf05o5zL99jUsuXiPeVp0LniaN0KssaSTAAiqQhcZvgJPLCkaV\n02CLk8yHgq+kqaoc5qNepbwlHDCFZ66lZTLyfcaTdwMzi9rZH/TuomQ5Lnwv\nsvu6CYdqnuh19CTjrIRQhF9pJpj0yn2XhxMuuimgZHhtaf/mjhf/Lbtr/XWR\necZH34rvBdmhaO2HW7pLzSqSeg6zxU+/hqajMx6FDk+6+IxX7QVJY39ZIcvg\nOwsNHehL1Mw80qUhMb4zAMyDdlkDMco6L7KeOCdfiwHDOXNaIEj44uCwyJSt\nHJUFe6r8ZhPc0GYgd/c0hTcyyT4+O9aCJOlIRn4/kFZGlc7JKNkCfuX1TQ8V\nvoC7o+YsH2obJtLERgrKLf1lIq4S/MMwTBm+zyV+sseXILbjAKkCUCqfNWJX\nBQmbC9mL5jZzXIZd+rQGbcczbrP2yypoHLETSR2IrEzQRqvXub9vc/8Nl2hw\n93orNPd7o3BRzsAuJLBOGg1zJtCHaw3CcRb8kzGYAWj3mWC4NSpYJyzOqvfY\nMVkQ\r\n=Q4A1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1NS891iS11rxmw2OF6Et51SmCoZkRyEeIyrtVGu1bKAiBvznT8J8ujrXGW6WTMJhSefwKSTmSGztiZI7uV4iZXMg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0_1583853144667_0.764450487585"},"_hasShrinkwrap":false},"1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.6","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0","gitHead":"53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-1oqrdnRjkJC/hmWZ1Ge0XM+UHrS6jO1XMnxqtMhTjp2N48eFf5192Om/V6G4h8vGWKPRAX1w2Tw+EI3TR1W/8A==","shasum":"24e84d4052a7be149dff3c4ccf7966736844a3d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaKxQCRA9TVsSAnZWagAAMSsP/3JGE82xCV2n2FY1ntO7\n3QuEUphSObc2KbkSvpeHj7V6KnQjBO47Vx7qGcGQ4fcDr3YpZsDUi++vASHq\njJKFIlec16tvSSxQ0ZOe8+UT/RjD0eUe5mhNGwQ6KiXD9yoovtzKiFnmv/EV\ntjCEItShNO5ZLUtDqkZEmjyKf1zWvkMeeECBYB7LfJ+pQIrH0mA4EjPyeaov\nhyY2fQvA2AJNANULV4CPVMsE1QyAbGJxdjFzgBysstFTC26BHNj22jH6TGtK\n9o3JnMzIgS5D9hhTAU0BUhdsApu6YyLbhLzf2+9+Is0mgL98xTKlCccE0I+J\nPh735feD6WNnLPlUqFl3nzxRgRzVNBtvrXH9t5QxFZORMJP8QbigQ0To5lC6\nR2O4GdMJ8G7V3pvEsP6UFa1quxLUlXB/7kVk74e7wFsbMODYcjYxOn/MnUAG\nRsDqnw1EjG8Qt9eFTjYb68eAJaxjxwpO7+M9JnD0Qqno0SolXwy7Eu52++n/\ntNtxdb2NRnViMTff7iALqIaiMOWkHYdWIULVx3R7OgsWLBJKSNPZEHKOX/8d\nB9KARbIxwYFPPL39DvpYm+rZ3W5SBxm7LrcB/i/dFUodg9AzpMvZ29EoJJkX\nb0xgoMHdLzdlmz31WwPZX6YQ9iIYOfykU2tb/y26YaCf1vfTxIP6Gsx7hv7x\nrnrE\r\n=UY6U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCotTJ3N8snTbYhjGqn9tWt1uNk2ab8QSeqztYhy6KsmgIhAIJV2N0f21nPERBKb/TjxJHs3zfP3SbdrLbdGeekhqPz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0_1583918159265_0.7015614641907544"},"_hasShrinkwrap":false},"1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.7","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0","gitHead":"cd0fe8151a950cbfa37bc6ec0f6f212287ff1084","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-SMibYJhqOJPdKvRMANVTWZr4c6hGHI6VOE3xRGqwNvdYg5OmCx7kxMc5K6THKuBIV7/YoQQgf0tvU1VeTq2Fsw==","shasum":"fb7761185b23d02692aab05b57b151f0911e6a80","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaQ4aCRA9TVsSAnZWagAArNsP/j55JPC5pGSMnEhIdWhw\nLnbPuliL8KbF644rV3+UDnkGLEAu09mDr6/i9C3c4Av1i37dtJChL+JN481m\nMxDT01TDjXoHFJQfWklvU+ghl+gKS4pI9+BC10DVb+9vwvbXEeiGGI645Phy\nVs/pwI6hFBGyxUUaLrvk4XeaX4Z2HQ0wtdQuRLI7Llg9m8JmqqE6qOVlERRs\nCOVTESm+H1sjNGX7Nsj0ipSyAwHySvm8k9nV8AbNB249vVADuGCX+IXK5msm\nDCqKDwEC/eKe5l2aZep9okQufd0eVZAZfwbdV3s+k0KlUq6Dp7ZKVtphTeuo\neeTHZc6EhRKyjN6vfTthcXtND2t73cVzROuZQny4zwd0lHInxMjuAD86j2AZ\nD/uxXXF4VHBxC4R1uSOfsmsY0Vxy0rdVVbUckhSa+XD0SwT77VANOMrMuBkz\nvz/K0bqxht/K9u9MBMcYRbEWiRURtfTgSRoxpwqjtkoeMWtHrVAUItcWDjaL\ntNkZ7dxRoP0iPr+tkJ+8CpC8fF2gMmXVkYvPTRdJIELv+x+D9DcN76V9M78c\nHRsRfnQK/RzxCyY3d+qISSFY926KKOT6kBuSqXCJKgcspbXDl+B0U35ipern\nL5poy78DkTH29l74y4n15/gfmjYwH7ZuqoWHxtAIuiC3JxGfgGXFFcENnTbP\nlIYH\r\n=yoYc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA659X/9LOu2kqVEOwq+AzhQzGknIfqhU22s+/TrXd5tAiAfsQevNkzF5bHcHHURqiXZEmwLRUGoBoRrIJqdJNvzBA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0_1583943194142_0.7233860139640569"},"_hasShrinkwrap":false},"1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.7","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a257c70b71ba02cd86fe3bb5b430cdd66c6249bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-jIpGk5H69vCJel1FNQDw0IJgiE+DUAjJ7O5093dcwag6YfY7Wnd0gBfNTy5JBSuv1yJrQqzlCVC0tgyUXO2GGA==","shasum":"755e850e749b2856adb8a854204d89169af43fda","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaQ5sCRA9TVsSAnZWagAALBsP/3lashlh2yhyO7Bs3N0+\nZ5UoQj5yXOHLMZ2BsZ/ot8/0+1lsUtnFxOr0q6uI0jn9I5LebqmDJWRHBNR5\nummyp+3lsjElIWfG8LTYY7C2YejjTefvujuCwkvx2/8usdWKkcNX2xo7BKYD\ny2na2KRjByGZD0Farf3jbXkkD2XW/aUacamv40iyL7l9x+UjGoY1R3LdSgTT\nDpGSOHI201ekUR8xOkJh5YNiuotOl/bF2u4gHgqfNuCko90XyJSpLMLr1YgH\n8afDe832Ix55FO2wOmgjXSiDoTFJxeFL7XkO9fUYmvBmS02k1NNzF1S7llNe\nxSfmzt32eIeWcsW0LNDGHjL1EMtZMrhhTNuxRqIrXrOY1V7n6DKn2E8C1PIr\nbltWCDY9O0zlVHr7+IT16vLjYWItOSBcfrbADUHbRz2NNxbky7eTFr4rnv0d\nntBwCuv2MNsChOynIkQUZMAZZlZ88iXfLNvD6vopDdGbb6KNGKQ2dbglEvBi\nCCAybOdxsbw0+JCPu+8txT10M3eK+hBOsqONF5XjTaqp/xfg0egTvWamYpcz\nHSjhATWn9snYYscpYOcDlnTBFDzmL8eXEHElG2byxtv2J9b82nVWKp1oKc5/\nYUQeQgcIXzFBKtVUc8coVTT6gdSaQR7bwnLraWvUVL6DB2SW5JEghzXlfHj9\nIL53\r\n=W2Kb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqbf7sgIA5AUF9ncQTlYMP5+sf83gOEMbtfgyBwgBNkAIhAOExLsAnLIaxBkovjbFKoVe76mP/uty4oC8uBUtL/Lnh"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0_1583943275541_0.9127808904070829"},"_hasShrinkwrap":false},"1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.8","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0","gitHead":"a66fc2fc48f50b9795e2574012a0279726e69ee2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-rXkWj8RY7J4UlE1HtFB8+f8XZb3XHfcmJKPDDTE7jK0+JGvY8Jn5fIlL51uGoahj4lzSCIfoeV3ZQpH/VOvrDA==","shasum":"e275c9a5ce9d1234ebda427ec26140531380ebe6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaRSLCRA9TVsSAnZWagAAtmUQAJrrdw8CaHtO2o2LfC14\n/LMEzAewyegteX0vy+rG+2XJ4Kd4tH8UtGzJ8XWqLVlNf2Row8LTnL++5ZcT\nIGak2FGgHVzrcjbXTeUgNQtUsLzYIRQFpBaEDz9TVtxUAYKdIm6Bc5MpHFPk\nEU3I4vNo6e2/K3bh23YLcuSgJVudXeL4hkkkshfV4ciffroobB7SN9UeGf6F\n/bosw0zWjcwapfBpdyfsYZMYaIYRpsBH97f7XlmPQhMzxBXzcnB8LwDvLdO+\no46OEYTLoF07AYRvr5bFkdhRHl55iVYSJ6tiWgk0COj7p3f8AfdSVyhgDkj1\nHWyBQGF5Ca7c+mxqbDIo8os5YjI8dOyZr13KAlRmvLAgC5QCtW7Qgr429Hpk\n6ee7lc++VtMgg96OiggfViApJ6HcZt7m96dcRWBbrZF62FvcZNWu6IjjE0Q4\nT/AuPIA75/fV4KooGUiyR9eCrf3Y19OrX0hiZJCXUHGtX5qBj90fUr3clSdV\n+UKtwYRbBDOGjoCd9IfgxhUhMRKYCg83gSOPf90nPKSz4xJ5tmMgecdIY2LJ\nuAE/k1WlcE02Yn2Uh66eMeFNG32P14WofKEK9+sZASP4JFuX6qWtBSCybVCb\nZTLt9gokSjj4V3nyVrY9Q31jZq6pGDIzueGHwCJuYK91JDs9RdNvIluLUJqX\n0eJ1\r\n=qglI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+ZetVmtjQvaUbTBPJCtYUeqMEbGqctvuC+YMK9w0rbAIhAPdy/7etwlf0pyNgAzlJN6KuPsvzK+km7gcPnRYSGlgB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0_1583944843008_0.6820781991582017"},"_hasShrinkwrap":false},"1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.8","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ea63d8d14fddc234861588b8c0c4900e4f83f5c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-pg9N3lgB3u/wY5d64IqGjm7nOf8Z4mo2OZFcdaXx40ryOuDMUwb31NRJqRuZVgtntXTsR6R7Jh3rWDwSYRVI4g==","shasum":"bc6f79186c5f7fd78502aaedff26b81e15b283dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaRTuCRA9TVsSAnZWagAAhMkP/1UU4wRNqokkJit+2Nlq\nQyg0mIBWYOaI2gcCaYTbqS4T876IEA/AnZiiJDdZJRGajpedvnRITgjxGSI4\no87iX1OEtLCgJwZlfHQmcPeg0FNtvcTZjNvP8rQYm4wR8wsFjrcSqYbWR3Oe\nPVYCq9Eu0nCgfchIIv05QHbER7PhrWzYu5B/yN2Ojvex8PryPvuQOOV2RPfJ\nE5iU+t2RRiCNOpMsWH//OhEDRfyzu2ccsXjQq+ftE5nN3hyy+zE6eofe/b46\npjIzuViSN+sQbcJ8DyFlfHzQtFxEiVR9KR8mORVnooILo9ITo1Ib78JN1BUv\nii9Fq2JKq8tTRDlULJAHGQ2F4XNSZWCimKbiF4ApIkRqJX7ygxb/m7TjU7gR\nMqicsAmrC5mvxyLvu6V2p982jeACDrQQBw5BmEYUAn0OMffJSUwNHHA8HBJY\nhIB5a+toZx/pB6vptChczUbRrmZ/QTBawd35b+TjrFT1VzbHDdWfUBoya+Xa\n3hJYMp4wJa98rPD8otltYFF5IfNziOxuyRKGVjEXmh18ofKO4P9/B12BGNZ1\n9DTCgF2+OXTrVISKeh6R36cqQfLSGdL1F3gH/7Qq4zEKb6eBXRq3LeKx8zJf\nVUWJTyJ3LSM4yBvBTvIahyF9EPaTeccG7+ovbUmByDh2zl8/prlARIdZPqhZ\nQj2K\r\n=c6oX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDV02QKuCEAJIj+G/ctVtHBIhwhD5+EL09u+zsLsMZQWAiBPbPt6S+gtWixs9yeFOXc94Wr8MuSsELyieV/vc0bJqQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0_1583944942202_0.6701976530519929"},"_hasShrinkwrap":false},"1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0","gitHead":"9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-/1jmZ80CHQtSlqHHQ3A7S5S2/YheXmaKVTQO+8VjLo4Wzi3UI/xPfeQEsoUjwdUgmAnMsUfb62oaz8blZ4B77Q==","shasum":"052647c58b68d1c5d006d16bd409e46eab0c6928","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaVv4CRA9TVsSAnZWagAAMnMP/jT+sCwStG79oeBkzi11\nNQ5UH1Dmc6KabU24bRsP5L/x6BJBQTD9OEEGgug5zfTCJ9rcaeEeb/N9Rap+\n5XYhWMVSXT3UqCzStVV1+QTEwAsPRBrPG3ZQszZkhGJ6rpgxyzyESAEAbYTd\n+4L1sU/85z/00VmHqpBNKv8fAO5Bp2lenJOWg/EZpZvG6S7BhuU1w5ezQXj3\nXraWMSeO4xKYxIZ6j6C1/P9LWv7X4hximMZTP/UOnd9fLvEeIat3p+FggFkB\njxCeUcnOqMnQbc0fG4D1/N8RRd2crd+3frrstvQwX/zKYkqz3JOlEJAozRk8\nVZxJIoSkLp4Pb5fT29h6j47t5wK1mqCG4HvUX/rwVd+8VMt/G9w1/oCVeg3A\nZUWR1mUMx0zwN9edmoq7y8OayAu2wweq16MM5hiwRLCYVJGZ5tnZAp2vzKW5\nU+83KZfRXgT/injgbq0HIATgDzVxS5Am614lSqrV5/upTMTZh+jJspeBFNvO\nooEssaxshr9fAlarQVRLV9/he6IKMHcViS/zX/LgCoMCkuW2XFvY5Ws+j2T9\nJKkFqqtnnlJRSMRB/U/O23u3besL9qi2m+sIIjsj+HHLzVb/1vW0dulAyat/\noyQKmsayAnrSixgg38IzWCh5fBvohuy0eUEp9ghW6q5ufOJslpC/09qlzvh+\na+m/\r\n=WJnj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4JJgN90f/sPNODseHE9wbo8KKA1t71FK314/woCy1BAiEAnLFrqrFldxFEL/eTHsORFyl2/gDcNuAc0v8Z987Rw20="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0_1583963127649_0.28459729256476507"},"_hasShrinkwrap":false},"1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d755be6e4c9d635a7e0a1053520e12d59956a0df","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-vX2pPhFEMmD2ZAdzXtHlZPo/XP3YoQbhZ68ioU0gK2jdeNli/UGkfj24su3ZDkVMzWLecki6jZ68+80N1/TyIA==","shasum":"1cda317714c20d53651a8263d748507df91219a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaVw7CRA9TVsSAnZWagAAqIwP/3klGf7aKNKw0kjpROrj\npIDOU7NYzCsWsPc8ZeiFXiWkr3LdXS4hN3Djlc4RDLMDQkPSI2KjFpq9rKGT\nVABlBkzz+X4xJLKGW8578dhsekk7uD6rUXZSVeQTi3rsqoNscFQwvwTGqinz\noXHaY2jKhjICAwjSGP/sghVr+2pMxGvgMWCpV9/Phg40fYD/Br1F/VOuawal\ndjt8/5ROFqMyhpDAfGREA8iwzJbMKgdfNl0rp9i3WYAO1Sa+PKmDiQ0s1Yea\nVrAp33gPgxbnHfcONLwwIlrSuOLgox01UzkaAX3ANC7sJEL7cKl46BsplOSN\n9LHTAhfvphHWexknGfqNZqOD4XVWx9dSyZ7RKkwQS1fLYHSntqXQ/C8AssAr\n4CwB2whpksIZeTbXtNHpIl5OVwIqMXaIv2UNQ1/vX5BJm0aA11qRzMMj3ypz\npVfuew1T4EHNkZe4tWHIUe33085l8xr5grYKXk3ntyfupLUxu1ZSLBq/V70P\ng6YSwfa2jvXyn8DiwUvp/YFGpZ706xPJcNdk3BRlF6DUAyHFnRNZFzEpsdA9\nz12ax55PAsd5VQG/B6m4UXDnroby1c/7/g5RvGJfLouUK1A9XfyX8c192UUI\nlYPS/V+esS3Ti/6bXLCfu9N9VKgZEZX1Z3s8V84iExra14pbo/cOYYSw3YgH\n0PF5\r\n=pYHh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBhmCH3UvSstuiXGCscpjOMiUkAxg0eEH3otBXjo44jAiEA6071dKx7Bc9CtYQLPjgpNWsky/nylfgAquFjrAj1Ef4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0_1583963195184_0.5731960480329381"},"_hasShrinkwrap":false},"1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0","gitHead":"54719815622e8cfb839824f3cad94015930d7b27","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ucwFDMq42ZWrU7+zHJurt0kiMQLBBqRbiCjRuQVubm9KT4Dbr5vJzA2kEr+j6XURqzen5wD7ZRaYmqRGPNq3pA==","shasum":"034458c179c7b9a7ba64d5dd01df8d1bda2cd1ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeahh+CRA9TVsSAnZWagAA4sUP/2sNTPoVNWBdSZVBdUal\npX4AAV4IaJuONY6tW35Byy0qquQB+ZHDNpV77ccf7Mx2NEJEh2PcQ/p+Gjoo\nwbi/VIezXK1/yJchmUsB7+7iQwrQ+S3c92U3LZDXC776eMu4H/Ykqu9gBLvN\nLNf44jra3M2WIvfdWt1u7kwRDII0jnSVor2iU1XOhdMTmW3GifY6vkqGvgyg\nl7DJqOszyduQHUudH1mcrpHzQsNDKgU9JgvGEGOMK5k3nYsmFJsBmtaQEbiV\n9bKHP16UAA3oiukt7CrQMHrHFNFCRyD+q3wg3xN/BQCHjIlP5d1qmMmYHOLr\ndJLbDwE8I+byMQiZ/F1VmW66izO12sK/d7VoPY+epkmR/Q799NhTNC1apE2Z\nbYq73mYrutdQtTN/6rX1uVeUv7P4nr4G2a1ITBwTOkW39OckajcSnV58kWa3\nIqvsNOFU6pQMi8V1fuuposw+82c0dhUNNWTPKxDbJVfxNbKGszFc8KEuvFWA\nk9flfvoJ/Q7rZb3L6J4VIbLd3Jp0k1YHEtW5b4J2H2dPu15gb0oraMaiIsz/\nhDBuiNgTgAULZIhzQvQsKNeDy/RNOjOrP2exOrkK4Z1nWQjfnoc+pspAwwxc\nlE2km+fipViVij6mPN2Vigpp7ngleN+X/lq/rAWKwakSnboZWQDRmpaBELFb\nh+YJ\r\n=T0XZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjK9VzmPoLBFWklbB9gYcdL9J1WlvujQJbC4BBHZW2NAiEA0lsMXB3c9n+Zh+aQ/DZCVQ4xJva4KbG7ibGsmKv3OdQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0_1584011389463_0.8823322894353705"},"_hasShrinkwrap":false},"1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.6.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0","gitHead":"68563129a833ac8fcb62099b057953b474d5e3c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-+RAEdbyZVeNWUyrFIyU96VHoZDEAyteX9l/GSWhtA2hfQSEXwmfIlH1vlqqLIztupZEVYrlFPENwmrJWaTVjKQ==","shasum":"11a0ecc64f2e416cb060de34915bfc512fd75734","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeahj9CRA9TVsSAnZWagAAWbAP/RVCjDcxJzZLnmweSQMh\nL/j1jqxC8w+PXdmjpi/N5yjLalCVAb41YSvrH1eGMd2LaP3iWDotWg0h7l+M\npc1v+cYBZOLARVaycQB8Cze+kcWWwFllgDKMm9Q6J3U/j0cIUbqbfbnuy8Dd\n4QqAcBmqK+UvRpRgcl1tKtm1VB2ifn/QmO90S342U6DKKLHGLTAcELa14Ql7\n7kSC7FpJRURP2hjPcuX5CmQkNOjIzq4hBxCVFaTzg7OcZVZ5mGQjNJOKJCRr\nVYhn8URI3iT+SduanbXxVJC6Lcn8YuVRdTXnEQ8hJ92mQWP+BZlZ1CwVsLoU\nVf/HUMi5MZw3IQs+MBrKSq3Jv7opuXYAWbvkeyLLJ+tENt//OuTFSrEHISpg\nb884NagmcHNsT7XorZ/WUotQQCGUeIDcSfYira8uMBIdA5JLWdb+/Fl35Ksm\nYMN61+LDS4i5b7ct8Md5ZyuXZcZ0uEzLY6c9wL5xJ/a9tcZ4jLmtojVNuRSN\nWHA7dJmDVAfovv8RWcYnHNArNv5Wt7CJ2pxLpQnQ+pyeiyRFGNDj9OwBsBvs\nkZKieVwxRtSYW13SZ8vZFWH4PqdAxiBbJEXEv7vdqgqy+luWBowl57s/9jvk\nbPcZBD+evq7V1f3yC7eM+/nagSEilFf8ekLUTSON5P4dRNxdc5KvisCs4ote\nuhNJ\r\n=AUXj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAa1oC9kXMIcjymDD2hAS60G1z33zp1OCXaEnKS/TCy7AiEAzp3u9A5PkPErfcMpXi+8pNOqQG4+5mAI1WDFJVeulCc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0_1584011517269_0.7009552781766115"},"_hasShrinkwrap":false},"1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0","gitHead":"50ca1a06ee6310c1c4d7531af1d0151435447bc8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ywbULSXD1UIpOATVz4N4JFthsSEiozvg9liVWCTg1m/EQ5ER71DItJZm13xjQs0bsyt3sJRILSnuB48jLG/CFw==","shasum":"085cead8c703b280f99c7ab97d5a57b50c44194d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeakKoCRA9TVsSAnZWagAAko4P/1q6ULuZd6U1glh4Yq7F\nPCYbzR5GywY4bgyCs8oD0oSO/4mOWO3WVXQ9fbK+5Ek2BwgNttQf4Bbqp+gt\nn7JDP0Yuq/eF/n9TkPZ5Mv2RccsXm4Nuh9CdFP45Gxm5ZXDzxv00BCHOHiLD\n3KH+9shLdrv/nZLomCB01rdvpxAX4HMEy3cLaYN5CeZRqm0KoYwN0yMTds7N\nTN+TEGgOUTyUi8doEy8K73N6bGzTF7NZEIbqi4mUA0nn0jQ2ji5cZ90DuKhd\n2jqVlKDYrSDR4gK8D2rErYlnCyUdq8XIMK3yTSpz8KVHkDolT5Cfm7BJawVC\nGbGh2GLRdzdj2pY/tBFj04oPQsY88BosElOY5/elk4opsr9f96+f5OcAGYyA\nQFs837rvjzU58wxnEI5TxYk4u3zzk60TJIYiOSUPUTPtQxKNkLBdtWQWRCGX\nATFn1+BYg1Qyq2BsAiCk6K4+R8MhWJKumZ27tCW9mxDOUEVrOwW2oYMULufv\ndVtMTilgrWmycQB9w6zfL/oe3MMg5i/AYN18H0YzqZwklDSu+Qs7Wc/lS+rM\n9Fsdlg6dLu38hHxSz+NtJghROyYtYbYb9E1pm789hrBh+3LmOPQr4mU9qEbH\n4wu+/gkDDes7uFAI45isWS9X3aE7TiuetYWWSZBsWFwJ4QAAgpy1AU3CYJku\nODMW\r\n=oM5A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0tLRfTIGoZlkNMTgSzSGKGNoiYPUyl2v6QuHIj2pHZAIhANms+qckiufJopoAiZVCmpTo8wryUD1eX8pbWj0Vc/bq"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0_1584022184267_0.8195308796171779"},"_hasShrinkwrap":false},"1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-MZmuaRBtGTtx8olcKxb4TLG2Xmq/1VIZDrIgYJDqLK212EjTq98w90ntWDfCAJOEnqtJgv10KoSRpB3cgw+xkw==","shasum":"b5c841791ccdbc6953f493789b4e68a5c940b110","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0.tgz","fileCount":22,"unpackedSize":96872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeakL6CRA9TVsSAnZWagAAiDsP/0uTXq8ATD+XNC7wpBTg\nve+mLmOZrLM8RYABR54nc2xuUzgOuq+cv6x0fATElOYh+ZSdh630jdLh4/Ks\n3zR5uAYC/8wJRUA7hR0vXiLs8RkjZ/NaOyxeEcsEFufGHxNyBqtGCH1v24K5\n3pFkXhxTdJstxjZFe97YTkETvXAs2P9/9kn3ZYtEAYVJ61Jt4Wdhxkg+fFHe\nDbBMlboAjojKYxVJocXB2KUAxX6vaNabzFAWgos6Opi+e8QRP+aGlIoBrJ5W\ney2hgFG04ICiXsLSr0pK8OP8AbiKjyQYp2I82cJjRTbrj3kp55XDktb8+Ttk\nLLZiQrJB2PrMFXw7EjkwCPw5rSbTTkVQEwezXh7gH3XO3ISZ493O+dD50V6m\nfipfXfvM2S4ruIm2TCg/V1iryCljyB8m2P1oUATs0BkKFhf/cnX3N/3vjVCC\n/fPW5RV5u6xzViXRJUpuatvCVwbUF+xEOcNoJ8JfEqDcVp0X3tMztn/D15vi\n7QTlSJHHka2f3YVQrEJKtZN99Po50gn8AowgPeiv0yc9zU2WGn2PmPDBELfe\nVpbTh7Fzsu44niCwMldmCdvpcseKRnvmzRrxOgFfjIwggt88/M5eT4rsbUvp\nqvg2VRCiq1mRhxPA+6ftW5IWYoiwN2oXXCrOm183zciirF5XLiIi1OHA5Rx1\na5Tg\r\n=UHQz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFjlI5VTckuSObmRB0yL3W4Dk8r7umlcmglLHQG3PZ1kAiEArk/aGHK9cwKAMkRAd0R5SoAcw6RS3EbaJCUXInyms4M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0_1584022266133_0.19101572271805178"},"_hasShrinkwrap":false},"1.1.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.2","gitHead":"043233db5ce5c9f3d51a326145d4955a645e02fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-RySGLxRJ8EtVzNhNcziTatWW78fSTkjp8yamdS5VlJOjhitC17bK0kqJYyG9qF6xYKlfdSAdNlL04S+mAWUF8Q==","shasum":"ba6b8a612b2fc401c02a352109085e07f0a587db","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.2.tgz","fileCount":22,"unpackedSize":97645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeakMLCRA9TVsSAnZWagAAzEEP/0r5WUNvhB+h7lDgEIxH\nXd2me74dt6TQOUp+8Kf26aHoTT52ZxhxEssqeIs8vH2UJGgtQoc5E8iDYHrN\nMbqXqxKB/eEP3/XjqnMOoyrYM0g4iAd0Lv/KIEmh6xQODOCkwL79cimAVy40\n52uwxNh08SPxPOrxiKY/f/RQy8esmybm13vDoZFAEAipHqNeolZRZs9+QBun\njN0c9ygwxXssTNE07hM5JPVuYV7TU5eEGwemWC9PzN26rLi5xNoz+DWFs/Aa\nOfluZ2SRHJDfZrgI7ppqFfw76pLLUcZa8oDxqHTk9cET9/6sJkmQQWoA9nrK\n7C+GUmLslm0PgOanmEiuwJFKv4jMpRiiFm8UnQ+LyvpTxHMojtjooBZOIYuw\n+qw3Ffpec5ZxI34NnXnnfs5JVJSaVXmNP2gnjiwCJtInhz9+sZrX+kWJudue\nhWzPTfEJirVTpDI7lnGX/REAKLLfEcanYgSMRZ9amQMoDZFOUj97u3GDBXPD\ny1i+SUBv9KoBKD9l/HO3QJzZjWppgco1XLbILelrMLR2XDa+gbASdfCu33R3\nMiurFNCJuIH4EcR4V/CO43Z0MOenuUfDBpz0TgyyyOJ3OruGKtAEiS76MyU+\nUZGmMzqwT6VixGh267nH/9x2+FzMLFFw874sjO17KD3vJhWm/axTW38qZ2cy\nT00w\r\n=9NA5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaZ868T6WJS3FByzz2AuoLaNy7ujA8+/AwmrteV015ZgIhAPgyNfuotR+Sj70X3CyPAfGjn2Qc3HcPQr4Ob6si1hJE"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.2_1584022282796_0.6290273350154203"},"_hasShrinkwrap":false},"1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"043233db5ce5c9f3d51a326145d4955a645e02fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-X+7BQBIS9YmczO2gyGHbLFcaOD4dornK8G6MvoU/9QQE8NccrT1ZCZVW6eQNP8r38hDJwbwFqDsuHfKk4R4ViQ==","shasum":"86f6e56b6e731f33efc7fb86d089bc197e1f753a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0.tgz","fileCount":22,"unpackedSize":97688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeakMlCRA9TVsSAnZWagAAQKAP/0GZsO/Sgat5fNWYJwE6\nAfuSVBwfu6VJDT8j82OZDU4DeK5rtLCIFX5VgcSsxF3VSyEbidTH04eO43hW\nAQjOTzmFeuoa48RTTAkz+qh+E6k7ctx8ONnNrgApb3viVcobEC6XwtqJxyqm\nK7vtTLup3N0mzYdjsPisecsQcSDWMzj8FnS5NV+kcrpM1fdHWzPAH0ObVz8B\n6347EF9YzLt5x7e+vmCAM6+9uEu6bm5AtAvCiKUr/bR85GBkiGjxGU7sEpmf\nHByFvYI9KJP0lgWCBiw72kx6c5fDYeudHuc1DmLzpQ+W09GkomZnNn/71nXX\nGIQWrUrukUl0siWWvzWimgZenkPOmYkuK2G/NWOreLfG+jeEHf8kR+4vP3iM\naqWWL9456AvfrNV+N6jspIHelNVGx788srqsK66QN1D4Jg2J9lIBcIn/yrNY\n3XeUp7+W4n1aN+0JUuje5FZOLE9PwJJDPe1p5gXSyU54/0hnBqky/S4taw0s\nkD2K1Nzng4cD9DeehmsQThAwF4hdWwmdvoHKBowXCpFHnvnpBdG9grvpaLLy\nrd590edjYiQEUGlj0RBvs+eybVQWzQrDhOP375gM8Ix5OeKNqrReaIUxQnYg\nZzNZOBoTWRZfMFBKzD8l/G68GA8i42jFV0ZKAwDSK0ZDgQMCNnOILrqRnYpl\nxqXy\r\n=IAEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVvBFUc89ftOFK7C4ZzVp2xv7hJvNQzA0RNKfmMyrXPAiBT9pZkvvm1PB+sZVJNhrBObd4pIymE9Y18UzQnbO34Vg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0_1584022309019_0.8976918836892076"},"_hasShrinkwrap":false},"1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0","gitHead":"af5c9180e586ad6828da0b3a43a122523e0f6df5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-QZax4+Qh+sfrpjRK2vQaPU5Mcx82vfbqeUZ0dJWcWkjV1zWL7ja2gUEsFSMuBSGiXEe+0tTzxI+9s9zftVjy2Q==","shasum":"8b754af63f1b22fca700a06e266364c17c329fe7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0.tgz","fileCount":22,"unpackedSize":97688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeatf+CRA9TVsSAnZWagAAXxQP/1QfbjYu61ygzYgUc1VK\nEwNdyei4wY+rTyAXXw7ki2OFVgmZj2vo9SIm7o0Fnq+zj7WpwURfGaXtFllA\n7NEbkCZDGVDHmhG161np/KKN7Pzlv/EfQ0TKvXUILS7f69H4CRxXEOzs3sAk\n1InrkFngd1KglZoxQS9+CN+Zj7jyVc2tAy8i4BaRz/+35LKUkrmDTDlGqBpi\nqAngGEMrI0PGv1x6krTPrOEeq7R1TypGDA4ATPXwMxtD97V9O/3ErmoREI7Z\n7fvDI1B49mkLsUmyVIpsN/yp5m0SljS/XEXELSfJet3HwQKLckrb2hxVdxyj\nwod7N1CwpCPxbLrxN6YnwMMYRAp68TpJV907FpaqSATRthQ9L/Df6YA5wKpy\nFAFx2nR05EkTbK/S91rVaPwZEj3bB/qOQXXIArkBmMH0VOEAFrhjjl0RC63b\nKDDTKLb8phGzL/C947a6HErVLxqOC3T8KN9gEL3IlQ9JEaO8XE/RjMH+LzvN\naKkVdnQXm4v4edHP0vhSAyDmQvjvmGug20SPg23tnI19WqKpzWFEN/vN7uBl\nCD+MQBDejNiGOiMdeHlvfs2QIZZnsmi04UhNyimaBYKouqDbqhG7PsAfdHA4\n6Xb0b8J6u1wcjye/l1azMnWLosnsqt8s71Hadn7TREHA/ucWAEAEb6irfAAa\nrI0s\r\n=zPgb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDodxDZIbnZaAhRkqeCQ8b31AsYaVmn+EYgBW9T3pxPgwIgb+GYk7hnqhKj6YLvWJAudCzITCnCz7YHeXXFE2Kg+Jo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0_1584060413556_0.21173956456314413"},"_hasShrinkwrap":false},"1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.9","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ca93d9372795d4907f4771f580c9b2974942cc73","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-oaVPowXYj67q12R1qNLBhJamAUalM27VWqug1dE6TFjAyfGpAp3WbDG5JVo+SL4LztHwk1kJSbKWqvQEvHjQHA==","shasum":"1fdbb687c461cb4608a23b200b8eec7f3d17582d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0.tgz","fileCount":22,"unpackedSize":97688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeathVCRA9TVsSAnZWagAA+lQP/2P8CtK9KMcZl0tb/mm0\n75a1z3U6GlRllhQN77b3f+zt+CWUi9l+fs9+pO/w4r59UmVzYfj4v/fgzF21\n8FTFEm86ARFGC3s7LVc0TBU33slZoBZUSey+vw11zfiToU1pK3pklm9c+21r\nlyOMXh3Z3JpgFJxxHTeUNibxPcRhY0zv0evT4n6wj4idEKvUIGiYXdEE5ZBZ\nXjaXEHo6dAl9XuVS7XQPCsyzMR+gLrBRbx4jD3pBlSZT08mkYCDlIIwxjzpl\n6LWskTTXei1qCyEu4epmx9mwJzE2fORQC/qnIbttSZAcPJuCGgVOmllnomMB\n2JvbycBxw5EASwlMQl11so7fsB+3cByjh06ZjWGUvSCiTYsTlT13wzQ4nvWk\nBXKZ8yLE/7ucSBjl4v+y83PXkD46zRHcuGujhPN6k8JLmSUxZ1f0KICblnsG\nrPIbSGHZAlKBITCBUq6UiT+keSIZ9ixA2l/4RGRhvTGnkI11oSpm5ymei+Dt\nqK3jXBc2sBETQh9soyrRR9KYFGpBrTOTJOwxE81TxeXNZbUepViN9CIKFYli\nk83ZFO0pvRIy4P1SavpVeJQVIP8oyteqcTmjU1+Eg9PCcL7iPRp/8nqy0gLC\nKlQDmkYwCnbo4t0mT4mO5mZ6ZozpO2x+Z5Og5AGW00Q4mbY2jjg7aIbSEGp3\n9HSY\r\n=EwTQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8eWa/TGR0eaWxNEHEFV4zJpMUaGKa3vNFD/rRsP6khAiEAyQ76RhA8/ZZdbKAO4FzJNXWdpRm8EhxTG9wwpa5slFs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0_1584060501152_0.5935734470377696"},"_hasShrinkwrap":false},"1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0","gitHead":"b86083aa924a848180be10b2605bef2f130cd940","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-HUtnymYw192CwuW+rzvAip2Cq6PzP43Y8trO9SA/SsP8426xRahN1AstExtOPhaXdy/TJZ9ii+mouhmc7RIY/w==","shasum":"2a1e8e2349c2479b3545bf078555110a73c39c4c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0.tgz","fileCount":22,"unpackedSize":97689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb7Z5CRA9TVsSAnZWagAAI+EQAJMln0fSg33kiRKLgNU3\nLgtNZb70oX7xank7nVXzeZcEEJcTsoB/vdUHGkoJSNxCN+cRoHT3fHeCz2Pr\nm7yFqOycDr51aGOVTSbtHh1YbZ0mH/05iFju8MD+ywbShCA/hzIFfXRy3FL/\nSrlqkYoPD7dyRhMJD281WsiLDS4wPo+mJyBWXX3McvLBr71thk0jQloiCHx+\nhYbEJnZ+ohU5WFI8HVbXIT9iEGJ74hfwzXG2jFwbb/wNl/Dt6ShjTJIoqc84\nXt1/9bHe7XK8ToCyFOmqyL3LNX7BFMb66xkRRIcUTW/zD7Onym5Y9YfGVLMS\nHOSsgGbUyxEozInRsxpctkLfRONWG1KDdgEpFuK8kzKR89C2GAR4fhK4DGle\ndjq3WmZ+pBZSIDHvjjrTQwH559hCuipgpBOmQF8q1Pe3r+ZbwLaQtjXW0PTs\n7tY8owi+qnZ0anAUo6pEmrIKMryOMuhVpoVKF++lBk27r+fGY75PtyFPOho9\nbfSuzppP5NTT6BXV7aV0rlDDkpjs8jQFdT5uYRukXJtxJDixd8+u81fImqPr\nrgZNn5UlRJsI69/Z6/e+lr9L2QStgSvvQu17bJeHHxG2xp4py2cWZwGAHVlt\nuBR2btSL3J+knqqrDZzTMhj2r+hD8MHn6tF056PVqQ8WG6JcEU38fUvXgWr/\nvTEH\r\n=07lO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICszjABTOYtjTibtS8D03AYSXLgNeOxAL4kQC4TP6bMwAiEAkWP7IzfU63vgEIlTOU3H2CgkR0CPoYmnG2q6j4L/KpI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0_1584379513113_0.11322318665832554"},"_hasShrinkwrap":false},"1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.0"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a65c431408c2328a0694f3a1d63d9c4282a72d98","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2LYdmgMhdytCrpFZJ4MwNJJIt26bEBt9ONcXYhcvqqegxQ4hZqRdXVz5knhkpYSILiw+Ay2YTsU/Le0lffjSuQ==","shasum":"656ccb1c340b81722dc1e3a2e2d6277a9fd243da","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0.tgz","fileCount":22,"unpackedSize":97689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb7bTCRA9TVsSAnZWagAAq6QP/1cHLSAEl8YOQgSxEq0S\nfGL2FLbE2xrIMld+ZH0VaxNdKAYg5NDeRgG0JYDRCfOjJVTu52lRjZAUVuVK\nWkUlMDEYhPe9vwvMuwFNiUBW7uxfMzAnprHuxoydcWzRMUvCGx/ZmXlmEvAu\na24D3rg9sAKemsUKDXhd5Fk9iQW+FbIHIB0qiUh9M/ZD0CJ3JUKZ38Rkrm/b\nQzVqwDjdzOk9h+/4083+eScOK8JsX+ecqitCoU2D7S2teA6Po9uU3CzySvGL\nbtOBQ3IbFVs4BwEhSc+CGcvd+LZ8Vc9M1scHsPNMEhbkGMCK76DtC5SJVaKY\niMr6htAEsbbhfmGPpSVH2msrfSV1C2uJOB49G9Lty1Q9FBE39ICb/IBXpAqr\nK38StLve/vkcSTvIA02EOGHnya+EhOyekbBmr8cY4lQUF4uVVVwof4BycuLZ\ngv/hrIz0a6ppXLNdY76RZSvQXY/CasEtLRhdFGAOtelk7yXJqMxCT02WC6K/\ng0M8V8xfCxsuHlu23ejlx0F/zpIrbMZ63mrt2QHFcFtsG3JBOwe5At6o+g1J\nuIeO8Dp1YJJFKz5VzV8GXOudZd8r63W8Ut3FrHAhnvrwq4FMSJOT1pVZoIHN\n2rYNcrk878OrliXx3Md88/jJ+UKfMVnQnXW0ic9KuLc3cuXrJIhFtPz+kYGv\n4j5l\r\n=Ip/F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICF7eo4QpG8v5XHSTeTcvyG+BN2eskZQlTHTrDk4LL/bAiEAoYNKLoEAl6y6yOe21NYxwummtTnbl/FCH7V0AfvMYaE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0_1584379603416_0.4546021687522346"},"_hasShrinkwrap":false},"1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0","gitHead":"4f915db136a0243be4f4a8c4fa00b56d7ffdca47","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YbwJVdyTjh2zHMerEXqv6Ay96KFqEjvilzbeWDfF7ZtupMah++iGVawhWKOPNSWpwE9gHHmvjvBc4MEqVhChMg==","shasum":"7072969904e27a0957a33f2d4af1725c47cdcd97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0.tgz","fileCount":22,"unpackedSize":97689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecBF4CRA9TVsSAnZWagAAxIkP/0tu36MXXhhetJhPyoew\n9n+YNihHA8Vxo7cAAoybEz0iK5Jir/obG41m7B9V3z8wzEqXPVn2ye8OFpyH\n6mON+aeR6LQro0ep9Mv4lU+iLdbKofKXStdWze+AP/PxzVMHUvyWbkLTCifW\nfsyNhxS9GIhJWn7+pKoQtbkputbLwp1DMj5ud/Ugr2ARpk89NYIlOcrh0Ocx\nXFuZ5Ez4D9xWb6Daz5NJ0adYCc2cbgoQs2+UB8rEke0UpOtWQxhIbk8+/FG1\ntaxogj6GgbPuIIgI9fh4BUtATJ6kiY/T1XDxCqwwYjUQ3k0NQhJqUXvkUCOJ\nWdR2hSsv/IjIrEOmthHU62Oo0lQyjEV3RumNAFjzIL+pDArYweUGxrB8P8T7\nZZQLQq/FUhkAB0RsRFqOSTAKrMzmEfC2a13khj2oehqAZlhdPhD7iOep7NbV\niyuXWntmi1GzKMoyq8HoEnZjNInxk9vSpRaCrI6/ySXCmZAvVdFRyUQfCiTU\nSCMIIvETW5xRGP/qTpb6fuk3M8c85ktrd50gv50MlB7voCNq3bhctk/fNh2h\n23LGelfnG9XAQsCWdxhNEv2ucBbPJnW07VNSQvCHrREl1eA+YyjqZ7s/5hvY\nYQUy/Ls1t2qv8RKYijBgQ1lzGLcL9Hl7jcx2BnInC8WghJlEEqq0tyg9MmYI\nIh/F\r\n=GqVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDRkLD0vT4CmdQooASRFLCSSuQ0LdFv6sxjQb+3hGtTJAiEAzTp+akTByua+QfXqzACdIMV3N1YrI9iqtoabNBfTXEE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0_1584402808127_0.9228593525819391"},"_hasShrinkwrap":false},"1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8933e2974173b6214a597138545ca1309601b9c2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8GAFaHylLRlu5zKQFbNg49WDzST1pXbH7n3l+cK6CXDl2/4NzaD5eViPTL6fAU5bs7dWKgfmWCOeTQa574Cjjw==","shasum":"4bb5d73f63a8b89f1389f194179ecffc4e72a8b4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0.tgz","fileCount":22,"unpackedSize":97689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecBHpCRA9TVsSAnZWagAAzTgP/jJa3hgN82x9/FJBjwZJ\n8HzJN6Pn74JZyfmgj+pjIhyfohHk5Rh6sY17OhiggV4PnA3pudGXv2DWIbUD\nHjWcffl1+viCEeT5u/hDacMYwzf7pgN/h0eXmSL+6vg6xPBsmY4C7Gu/x4wK\nhPSF/qXf0bucpqP0dxStxIig8N6sy16KiCfmfy7+G8rCikLqp2XMusdEbS+Z\nTj5n2jwtIHGIDrRhqxzWAhcaprQBbczqzrjVcT+i/dcsyTRijuqVzEyNoSYH\np5TJWBOPEMI7Gup/4BTK4yN6a2mQUbq+VoIlLhTCL7cJLhVZb37VkQtjEJ7W\n2HnhYIF+O/vZF+7ejoCOzI0UYzu4vEL04vnE9m3xGczWEHikw5A9A3NEUEey\ndaqn2vVSaLKFVqh8BbtqHVsxAtu22ltfB7ODkZa1puARwYT+/MtbdPs59KI0\nxgbd7uN0O0aztFPD+WXhAD4tI2BWBjqtgvcmfPLh57TleyyS8m+quAoPv34B\nYp/lsNrSuBsecmoOimAdOxvaxM7ZxHSkug78ozunPxpBT2BkySBUoYQ33c9r\n6cCN829jMO4Y7jf1JtXSdZLCFzocG0dS55xP4qwBr+pBbawmgfQ6LUcl2Nil\n+Bou+86lytO5qaMHKjzdojV1ErbpU5MgQCdZIDM2Mx81ATI/sVfWZwz8c+Pu\nfS0C\r\n=jODL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm9rU5OK2XxNbIP5Y8jntN6gHmF2MI/CDueqBGWmZWDwIhAOa3uWx49KdkL1Z0LpfjckAonjqEha38NjFYAhkzH6q0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0_1584402920567_0.1513546410184885"},"_hasShrinkwrap":false},"1.1.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.3","gitHead":"431b4a7edc42044dec38848773659dbbb3d19d3b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.3","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ibyezjD++b1VQN6y58+L4YmVRq9+eXoasxtc1Zv2lvahCqlF9Pn2Kt1uwnQvbO9t1p4X6shWKxMLXWtPO4Bo0A==","shasum":"f10b5d8d02787b5d334fd0816193fad59ddde27c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.3.tgz","fileCount":22,"unpackedSize":98276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecBH6CRA9TVsSAnZWagAA2cIQAIFpInbY6TlS0zp8bf9Y\nGAhK1jBZGvXNgD/6gBFn7n+huqml4WDRNYMJOKpy6idirk6/qA5A8UUWL6UN\n0DA+VJ+wzc3JPa6Rq4Iv98K6DQW9dYEv4i0YQ1c5LQIcl4OVAvXBQMjcf/C/\nAshv236ZFYgflXbmdoLffnnv/aQpbsaH7QQCeYoftevZpVwmkF6E59CdnrxD\ndxQi4t0adL0mtGsgJrz4FwjpHU/NReElLuGlDv+TCmH0zRpkRJHqdI5uWscv\nGjB/udjbA2DexTE/uVfpPTzDL1D7n7s3iJp1xWjPXxEbIFBcZ97MHcqloVyn\nQkQI4/fBsEHiM8vjZETHZdg7GGxgcx+Foqqu4Xo+5Y/IdzUmZrEMas7B8V9s\njUYMuk3poB2zBiTr7ZZqeKdYMZ3KE4SMCAMlFQAqzgw/Pqt6wzIjzadRoGtb\ny34J0e7GDiZ9sz7AZdDZes6Gdc4n/ADaSKwWW9RhCedW8s5gehwDegAufyAT\n2QYgbqR//A2QcfJbK/ySr32/+hhkeZXAqzGbiSRSE1UekwLSIxogtXsa+b7r\nOsC14THComJ7WG7Aat4TYDk3RQgGZVSa2GLorBWByfdroLwamjbIxch56lUG\nbu+I0lX4AID2czfSndiHvDabMZFAchsPJ/nPfdneSYntQCXUgkz118coX3FO\nmVZ7\r\n=W5TW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzRby9Baae0HMm34dsjFrZ6+WYn4MOCap8Kcqh8lOhaAiBaktS2Sx9QBbLe8zZ8VLn0M40iqhWORWVgOba9hzPlKQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.3_1584402937491_0.5749967926484916"},"_hasShrinkwrap":false},"1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.2","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"431b4a7edc42044dec38848773659dbbb3d19d3b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2zKee6Qbw4+HUuafkBrypuc5RMyokC0ElPc4DbkADhA5E6XxP8ofChbTrjifLfE7ENxLtO4FX8r007Q/Gw3BgQ==","shasum":"349243fce264ca926d5de3577d4971e143e5fba7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0.tgz","fileCount":22,"unpackedSize":98319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecBIdCRA9TVsSAnZWagAAriIP/3SdqU5uL55ir+HRjpBD\n7dZoA//I0vusgHu5u6rPFXvg9hTtPOKfMAnWWCnM+kXsHMuo8oQBNFc8yV/p\nyS3TBqkUYh0cMsmbg1v7Y5UveLRezDZN18vTQi2ec2cr/LRwhIFvAdsekNRr\nfjOq2llGYYCWO6fnjwrZxecJdcrE/XeRhu0KKFFjoJvpZGhwqas+p4a5tFQf\ngufLzztJ4IDH86k3S6rp7SUKBPnSoC0P5KMX20vO7L7JJpV1gcMcvGCPySF7\nIOYfU5dXOlO9SLwkQ9MnxvjI6J+U7HCwDqb3+So+QTWMiFsvqxwUZOH2a6Tp\n6UGh75aX533clM0mzIDcUNzHeLXP8P973bSlY+jpeh7SwTpibbah32CSS8sO\nNdxoXH6AyUk1pEhO478Fp1DHdwMzDSblCjtjcqI39L2ySxiR/KYxJnXOG1jy\nDChunC6G+lfTgehiMe0V9bQkASKXsh7zW8aemuyMdqYq/xOhnAIpkWWevE9E\nMhTVGWXcxxzKELooSquOeTDlhcV3lXLB4px3NT5RELzqWUUDJ6yaIC977w8q\ndSnqZIB5WBUqPtQuqE4Fak9OksW1eZzx6ca1EpCQMimtw1utKS45KCUtGoqE\nj8+o9gV8cesklgZR9/ydPIXwMeuS+OF4MoTw4uKppr8eD+eCALKQz2cFg80+\nC6P5\r\n=OMgl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRbs7Ecw2dKsMMgSIpRe+iJu/I/+ig+5VdJDqv0sxXuQIhAJayKUeMFSsYrjRf9F09IbXFdNqKQaQP5SZJEX1AahCy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0_1584402972576_0.12680052471949343"},"_hasShrinkwrap":false},"1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0","gitHead":"b14a3f2e36445ac5f906b4db631cf660714b56bb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8mv5e+tEPEWHEIo5MG29kr2hcV6bt5J5/9zYxsrot02LJCR5ldwxU1a9yha2ePhkRQftRJs9fmKS72O8ksY3oA==","shasum":"96bd2a7e081eef37d622b0e57ecc10a317eb4557","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0.tgz","fileCount":22,"unpackedSize":98319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecLsiCRA9TVsSAnZWagAAQaUP/RNFVmBiGCL+QLyjLKck\nwAifhyvdiFFivIJtU0T00eNrJ5YuQdK4BevEkVVS0r78Fkg07uOxQVjAnKSC\n9V//UuvhZqD/l5my9hiBw+0etgaSE1E4P6bnsEieEcXCDZoPXut+lkzEZVny\n8ufQO0pdQPdu7SPtJAESFAKStwrT9IYEhuF4xVBv1NhZzoCxK+pdrQ2nHzXw\neNx0/Ubn+ptOBwnnwnxRruUTIDWO5i7aLouvOJbdcSyEs9xInT8G6zf1gJ4i\nk6gMS+zk21ARqACzwYbWFGB+9qKIl/OerakUbMyvc49sCNC+fccN3BfFCfoy\n0A5ejxX6Z3Q+a6uUfongomLHdHfVL/iJREPOfBwyTg1wjIMXnUsIaY4bQHYG\n7EzGKhcHV+BfovTnuls0to7mJG5Sw5ZcSoYe8clCEOguvQEDJ5yR5aJzLDrV\n7xRvDS/9UubnVJgQXcN0eIvDg8sZ/l5xd1WlngKVCMscXb7bfwilGTX6gI1b\niOXJtl2DNZtozBPBowtUOb7b5q+Kc9fn2zqhoj8sFg4LbrSwHJEuqPbEUlJS\nvVr/EK+r79IlAB/lvIePzMXzm2no80MZaWn0xFTw8tKDfRitY8msbl31pbyh\nqIW0n1kFqEnx5I50rLK/XwBxEesP8PS4PH+Uvbn8zXM3EugXhLsuvVusJSvU\nr3oO\r\n=Q6zo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+AXzpY1YDjfMc9JqRCnxNFeedQksATlx8gWFRlluVjAIhALEeUiMjusA/NQKCtEKWwpON+OoyaunPotgOnaGpCuCv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0_1584446242103_0.07732539310222086"},"_hasShrinkwrap":false},"1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"804732846fc35f5945cd3e1de578935522f4fe17","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-6xvh47T1zJeNBz1jp0KkfrJ3ulHv/eWQ+Oqoa+6syecRIWdTioWtednOciVmxhesN1jrQHq1KHDDvcAveawUwA==","shasum":"5b5662acb9d0a51db66b77b2a9a37887baa072d6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0.tgz","fileCount":22,"unpackedSize":98319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecLtpCRA9TVsSAnZWagAAeyAP/j8WXsWENcxaaIu5rLt9\nifZT0EtwfxzKzCHgCQUQ3yCIkhF5wndsr/Fn/ntdHLqpchonupMisIJ4pyR3\nks5TorJ99SYAZQK3LrqieUQklLltOndh8YZRx+vDlL2jBi/laaPVFzk5Z2IM\nON963Rf0xtN0LTFz3CyAl0Efei2FoJewUbQdCIlfSXTNueYLFrtsIH+Smce3\nOh5XZ2JRemnOiq0pGhP4Iq6yr7BFI+sKZWn378qHD7XaTCF05S/AnAbUy+k+\nzfhkFO8Epldqi/VpZHVf/d9eb12Zsiw6Rp3VMrNjRmz5HQVlx/R48fRQlgNn\nPhk9RfG0mcxzJ/oDPbbpNNGaXDRIx+4sNPtqpx/2EdxgMQVTsHvdDNG+/xTd\n2uea3nrvKiscvNFXBs/7BJyBYAzBR/pmZl0i9+KRAyhXwtUqPnuxcwWg+whO\nNSLpxqkAikx12bBQFtGGI7Ej3NiUJZDyVP21YGTQleokSdJXaSlCJLNylYA4\nwoovl8TkECvGKr95/JC2Zl5fHcWRc4+3OXOp1Y0XuXr/mLf0J7ho1DYgjDKu\nlt+XmJgF2tdDV+Bn8aoQrcZL2DidfSFqlFlGBCpCOXRoS283PRX3hRnm54WU\njVMDqqgo+dLMYQluG/52wkOfbJ1fnHn/OUDmGRvQ2zAWGorTP4+ffEto945f\nUit2\r\n=yWCt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8Ei7q5bdi3Ua1z5H6Li1QWvXaVM0wHS6yhgEzGuCTfAiB/H79LxEfkn5Y9NHP6aR+wcv4U4kvTSRd5olNE1TkD9Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0_1584446313031_0.414978522277923"},"_hasShrinkwrap":false},"1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0","gitHead":"eab841125d55d27b016aebb0eddaf1fa799e4c4d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-uln0f1S9fKJFXd03jQ5yWwtW8CpZPZTFPVX08bRg2PfNxTqD3vCKu4YcKrsHMIFDDNg+m7QCOQerbpCrAkdxLw==","shasum":"4234ddf3707f035393ccbb6a16ebd22ef104458f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0.tgz","fileCount":22,"unpackedSize":99537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecfpTCRA9TVsSAnZWagAAU4EP/Rrv/Q3eVxW6+vRWQtH3\np20mPCiQpubfA99Pzq+fywfp56Ceqotv+1TZYASvBwhiYOSjxs1YbfVmwtDk\nAbsZ5kvMzGtw/IvzT31bSgMGnOpkwUGZuN47c16gSscaZgp1n7BZZEKFUUnc\natZWAPrYS18kK2I7rXru8qAnoazDXE9fbz49sclNjxYXCuxy8g3pcEHfoCfz\ngoECd1hSgZqCTh9VksnSaZXoMfzY/Hkt8mDZKAXTEaAYPrREqYjefXfXgm5C\nX5+sC+NIc4CT83HwdoKL5NnrOlZA/rogLG4gdTjvhduwXKnFp6dbnfRnx+LV\nO/51+b7UxnE52Mf4Eg+oJLp4qrsE2SLZIIy3HGKPhuRbVX9uDMa2iiTqMrJd\n3JCtmLduNrF9sH7nA0ug2tGsi8IVH9lXegtvYvmLklAHRUZNY/rIu4sBT4Io\n5VALJ1LgwAMgHDsjAyM3QLvNeU+kTgIY/+fdPZyfoPXgITDdBNV9/uDaOC52\nlMrInseIpkb1PygzGJC+44ts2rFKXURQm3FdnznQHv6e/dsv+jSsZuFGVxNZ\nsZWFXQghCxNbfIsAftaD3FY/KIZRC5D5+K9zyjqXhBQ6vbhDTMgp7qcyJGXp\nFOF45lJAqBHvDVqqL0CdSFEbqI1jz7SXj8gWUHrIqynrakcO+msbuy4d2N/C\nlLYE\r\n=nnf5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPz2bqBQ2A9CbCSB9Qo758V6ssPGfejHx3+0AezyvrLAiEAkre8TQQ34RJB0me8sfvahai7aK5wP29GseW90bsMTcE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0_1584527955273_0.5349611024827254"},"_hasShrinkwrap":false},"1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0","gitHead":"83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-CEGzUWfhwGYgZ5KklzsEsgkLTnFFrqh8xjcvtEEamZW/l3w0iv7iU6o6LCUw90MQtr9HwP2dOlx+hZ0JhelInw==","shasum":"170dd713fe511ac80ba7125d762d0be4be4f1f05","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0.tgz","fileCount":22,"unpackedSize":99508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecfuxCRA9TVsSAnZWagAAIFEP/0OxjFqtnHsi1kfet6Yo\nMUer5qDyCCc5btpWrBDY99TCDz29l0jNUIGbk9L8/XarkG8CX8S6PkpF1oFz\nbHUqNYq9om1WknTxdJlobpofkus8CVi9zGIZM8H18+YrGyIXZJNWA1ZONIc4\nYBZiBKAmgoaDnMfMOiazO9b+Vuncbg+PGGsBkKSGuyRvhkzzQep4AEc/WLEI\nmE/eapPcOMdAOGZnDRn0eVPcnJ/imZz7FBKsjMl6N4nGY8jveRbp6738zne1\nASQIAGix8IAAFFoBGH1Ah/5wfT1Rn3SdyhpHceZtO7Wj1EWMuEltszwxO6hC\ngqPrswHFnTKUsgUyt+bur6dY/dTViVUQfJnoKScuKSHVrFClZMbu3M+P08QH\noBpM853U6lk1v3yn87Vu7t3P3fTOjXGXK429ltaZgIHtygJZ2/uKkzgWmGW6\n2KluCLPnpB3gVzPzSD+ZIwzjF7P8xSssuRxN1Y3ReQpXLq7C1vmwweE4gDcw\nEiuCZDtIW0CyAZHAjVHig9JFU+kc0W7E0tlgq1XRADeLe3zIfu/OTBrvFIVv\n2N2q4bMTiKw+J1l9KS/FlUhnUUsRy6fWd5FUyFodvpsKHw2urm7+9k/pc5k+\nTC9pyPa2gxIs4TYSl+EIAk+36cv/C6FU6YFCxHI5s6RS3oe2AO/sIR2WLx4j\nq7Z+\r\n=meZc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZjd9/2oC5kFs79/ujnqaDnPBejrpy15kF2bUyAw9bfAiEAynGKTdo1F25HAvZ6J8ZS4pDWiAPsKrDFgtDDPNaTjXU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0_1584528304698_0.4937863963538729"},"_hasShrinkwrap":false},"1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0","gitHead":"f6ca7ed209f64f72af77392ea5b4d918fd0d455e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-mKLwPq8KpLnSIY6+kZv6THJdkni4szoFf3EPXLAlurhpy/c17Oiv11OQ9icpqnNA/a7Ny03NUi9PT9gWBHm7yA==","shasum":"91656dac6e2e72b9e357e9f39fe4b66e99dde588","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0.tgz","fileCount":22,"unpackedSize":99508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecf00CRA9TVsSAnZWagAAPGYP/0cCKA5kGl3EA+FgScFz\nN3c8UMNO7x1luqUXLsUqv1u46G7vx4Qjw9fyQfJhjVMaKJCRKYevlaHdzPvA\n79WBS42Vti8lNeZenHi6uUTk6nqtkCDUjCPiy9fvxhHURKFXJQGYzpcesXXD\nJPnrYNn6TrEr79yAC7qGfRml7qlLCcB94me13aIVKLbAaXUO4ula2YriYKpi\n6c6aoOS7IidSNO7ctZNXf9aSkdqCr/Ik5bBYCIzK+/gwZ2ExteiwiBp1omcR\nQA6JnxvLRkvGHDn1kBM5gTtJxYJSJtTOp015OKBRR+t0urdPPtqU5V5CQlVw\nVn7cpfqtYzLc2GpwiGV2g1JuBVZlPVR2P8mbjF+GtsA6cFk4bEiiEjLX9OlG\nLr2Zbs6k80aqqPZBIckslCh6dz01/fuj5iEYD/dxvgxZQbyy1xTRRA2sVNdr\nx2Qvja2j1JczaRAxRbTq/F5YTHuo/wjy1OV5TPZnNJE9CT9C1GkEKuUtqoMk\nW17MJnVUfXODTOHtord0fi6t4xDg8KK/HdsGNUSYlxCJ48fkBmdmTYFB7iAZ\nck8BKkzbi/EA38Jfn4Jqyt0wyDfHzNtdJhADbeZXsxKJsAYr02hSs+hKsObB\nJDBzK15VMh2uFsoJxaBuqgwSJ1eOGqqzP3JRzCL/AQr09yS1BNDcBDEA6BNA\nLo1c\r\n=M1uA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDx7vjhKemuLxqBscqRSNpToBuA2L8fgcycVxgMyl0SAAiAwR5PLrb/K2v5BYLT0EAa0tFU1xb9daX0NGgjAhPyVBg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0_1584528692200_0.41216303648141617"},"_hasShrinkwrap":false},"1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0","gitHead":"65899c4606f3e8680ebcee8e2c13f5d71164877d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-oQDw15RpFgpJNv7O6ooz/pPfLwErVVU7G4q67JNrUahmcL/FlQUD2lWv+dJ4qErEhTada+XEwoIJX7Hn9W7ekw==","shasum":"130e68d95c1c651d8d1e197e5cc4ccd89f80bb11","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0.tgz","fileCount":22,"unpackedSize":100025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecgLeCRA9TVsSAnZWagAA3igP/jLMZAQbQoquQeWrRpWP\nqwyAeG8oqiDzLVh+IeKpft3fT3FboHXtYvuXxNj4TvOYwJ163r7BXhPa4g1E\nj1Aws+LU4IEkadjrX6xSAE7Nhybx4DKyfo9LjtgzFFeR4pdNsGiS70NXTtxZ\nII6L9k0zYafs/8mXQSPhEHF9YU4BNd2gJG5KnJlBlneJtyRekuFpROqG9Dnm\nCaWxWK7FGwyuU9nS+ZwgiGMTrQubYwRJkKaXlXLlZhe1jaATjqbP031kmbcw\n9dOmFgm3s+xmnI1+Xtua0S1Mp6ga4Gg/sGGVBtYG89Y5hY3MXPZgTWGc5/kp\nVMlajizyiyO0ri4z3D5ZuoNyl/zRqZHPrHJ43WH5Iaf+Z8Q4BuayNUddnUnv\nTuRrXAtwkPiqTBAMsIz6TGjD2exzhWBkrclfppt+5b8LIkZ+gG9vmhi859Dd\n+mXFMI2T9HhQWYiyb0ykTzb/HxXBzpMwhWLlfq2Th4ZvZg0IuKufrLXqza6n\nEjejGr27ukHi2LNaSWDowZViAogbtce1t5kwDE6d3ECPuAkEDNB7VrpeARjh\nddwLNDm21nUEHfQ4RMd59CmdwgRlxeCz8GtkTCXzI5AYgRTavJya8gXyXc2i\na64AdJLYnCdMowEYkSwy2eVEv2ZfkgDZfJHB4kCLts47+yP55HLo8oxJiTBC\n3xR+\r\n=dPKX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYuQbKaqqzSXZ+73RrhU/K0K+LfRhxbJfKYLDqDD5zSAiEAu8TH1SwJHMsuemVph8Cuw8AMauyJsYegZC+Yt9U9CwE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0_1584530142201_0.4723363842412722"},"_hasShrinkwrap":false},"1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2cde7518020cc2ab91bbfa8c219065216db8367e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-4Spie3+N5hAQxatIGT/XxGz+HKbD5H+LyT3Ts1jdd/aWPhlVYQT5jzzCQ8ttIqJw4/qEjDR0gsJ+Vx/asj5vQw==","shasum":"2695ddb8860034185d27604030be7aaa5416c452","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0.tgz","fileCount":22,"unpackedSize":100025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecjlOCRA9TVsSAnZWagAAW2cP/0oKve9PImM83aHcxmAz\nT9xYk6500P20B4aWX7C4lVEcgNFYXwyOsCBoF0acdS90yztBrMS49fcp9jdi\nML9E1gzoMd0U7ui8zZJJC/iNmkAyBo1tdQb1YCsrJQ86wmSiJ32HyIVIxPEZ\n8WLH7aOs2jUrCQaAIyJPrU08kw8a6wfSyzaN/hNEWU2jZmxeOEMxzTVoZkDU\nlA836c48m0sRaeZYfphYzPY4XqV9az4Gt1MGApmvJLkiSSVh8cx3UnIWxS4X\n4U8FMGPG/14ZlZDlSc1gsRvdRFCNgkg304TaZn2QYzApcGE4QQ74eSNM33J8\nVuvxaKPlDJbaNe30ZwtcoRPFOQJa91oJUvrWfUXFl0rdiykCvtzOMp/KFnMQ\nEyW82HzD64p9/9MQV5m8e3bPLYreLO0OS9hyUM04KOPVFq6HqnuqPegyMzSA\nnkbFz4kQw29J9WXDecQTCxyKbGWPc5WcEGQz728/MKD69o1pOwKQwxZn4Cdq\nFTFry05RkJezafMD+c6BCYmxdya2gxUBot7TybC0Vy5c4mIk0WGedcQZMoNi\n/kQkKCYJR4h1x+kI/ikDURc0uVnCI4TITfvw/aD1ODxe9XufZSGUZZ3oV1YE\n6KnBFrd/iLiQRrATVMP0xtHI0UbEIFLSIubB4ln1kYd2+dpHhckTcFoWpdSD\n0crj\r\n=Blpk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFg6wOkAh0EaPKNenzWpXiKLdJGFNQh/OIQf3JSG9L5AAiAsgSGsfDcrmWDhSg30bUIf77cx38UpAYMuGCVkFQzv7Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0_1584544077631_0.9540562308946323"},"_hasShrinkwrap":false},"1.2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.0","gitHead":"7a23966c05682e07abfa934b084f3115f11707f6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YDCIkDijR9OJcnPW7fM29oD/gVoYS4Gbw8cLXLkxcgRnwC3KUdjc9liB0ap7uH4nUgGuiJdySu43TwM4ohUtHQ==","shasum":"5e0de453e8a91e1cc54bf98f944c09dc7616e275","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.0.tgz","fileCount":22,"unpackedSize":100417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecjlmCRA9TVsSAnZWagAAg/8P/i2YdkfvX7VPkdle0SLP\n1ajhCNbmRiII9+Mge48zyxZkBCL0uURPYeXhz78+RS7PqvLUoAUcgTcTsJU1\nsHYMeyo1rvpmtac7qhlRQiV8ZL5PhB6Eq284meP8Ed6aZbReo2H7jOzmD2K3\nl1hPkaKkaGopQYST659k4onWmo99dUdzUs/RVrxRs9SfG3ysJKXJXNWL+CD9\nbQpb1IupK3lHVz6aa3sxXYfjnyc2FSjZZiXskzL7+1Fx/BnfgdiXGBJwKPgP\nqzOol+bLaakYTvuarau2hR1aOW6mF3JJlzR8sowCTRd90AmbpWSxddxzeLP+\n7qRJ3rrty5SkRrWtMaDUZ49V7qJC7ottqMFsl5PAX445mB9bYcFbYHMO+IAm\nZqMgCvU659kroGoDvJkYTePZ8brepDR6vTmEHCBtxP2WeslbkchfVcIBOAWg\n4ciT+gJXEe8ZL4gu+Ad6g2zgByUAZT7vNy8FZJo3sLV7aFRwKSjjsVXBP81X\nk3/JqINQayqheAjDzd7yIeSuJS6D1xNIySBTWFYz00JKMCHmuWR5tP9bAP36\nNRwAiGKxdCXjVrXQfIXLcb6vze/s4j8axCpRHjID6fmX2P8tbVyO9IEsqlP9\nUHNKx2XbfiJQVL8qj87SACrJEuznm0IY2llAC+X8i9ZHyITuAP+ukpg05kKi\n0NzG\r\n=8zd+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwXttGRuO0y/TpdqZT21gO8K8D5zwTtbHCiJhLTZd11QIgSCG6Xm0NFqeh3/cnnJQ4Pjzgrt4mgRzLmYy6ZcKBlR4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.0_1584544101946_0.30278427416557174"},"_hasShrinkwrap":false},"1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7a23966c05682e07abfa934b084f3115f11707f6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2TxHyDbu98T2l/plN8KHERVLsi6M/XSmw9oWhR9E8T2hOOphxRpCQ0vwLBHbXAgTrHnYvJGJyO3o6tu/993nAQ==","shasum":"549b2636fd2b505ba15f27577cbdd9e636d12bd3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0.tgz","fileCount":22,"unpackedSize":100460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecjmFCRA9TVsSAnZWagAAFz4P/AzQMUHG0VUTz2I4ODnn\nZH5bfzuX1+JAY4DM27pH3uo6BYx5iUKqsIe63+knVEFE/tJexnL7k9ljecbk\nt3UqVDAjQz1+/w0REWsdWM/mpxFfR/AcgKWKZY0Ds83CTcE3FrN/JP6Uhkd0\nSnMZnd7D33CuUXeFatKETv2KSQFOieomVXWnSdzqyLNVnLUu6FP1Qe1yT+nm\nYUbmf89bEYWrkp6Vu6KM3aA9UBXgeEAlggVTiALL5EcPDAiH2hb8FjA46abq\nANbJU2Zpplxa47gfoo0SLml7JbvGPNrVXltoG0//hC13qv/dvFIomW2EayL8\nJ7dOWBIwx/gaPrp3xbLKDdOzUTfykEJiCqwCxMjIYMvjtJEggwb485yFqOlK\nb1Z1JQEJpQj2pV/zAdtoHXVgrWgV+KW6xXPd2vCfD8Wo1Vn5tdxYSIFfsHev\n2oEPqliydcOt5RDsCcdYwndo6ZOYIf+3o4hD77Ch6KweAr4W2YtGheAebIQm\n8V/sZ/zGOVvCDZxCl8et1GpPXTCFqSkIbf7Mhu1/eA/3EkNlwCAfagHozh6y\neBAoOQuC8eD3cE9lp0TutXXLiIZBhzWDXWG6V6GTjDdrhtE/4lTwZ8QnkIKV\nl76jCAxsZqVC42qf15R39AVHBLUoTKH2XqMfks/W/0iXsmnc9UI1cLl1Lscg\ndO8F\r\n=3UPF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/3TOAlGvKXNsZTSyrlcW9DGy1m3CDkcXF39NbnVkzAgIgCOo5Jn9cYFcBlHf7rYSk2gieLW8SD5iXhcoz2bcHk/M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0_1584544133076_0.06570132715982346"},"_hasShrinkwrap":false},"1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0","gitHead":"a9a1c895dff058718804fc633f975511eeed728f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-802MJO+uHnqSg4Z6P2HEWIMJvnex6Z719yMtszwtJE+NbfMmijdZwE+s6lDVrfel5419eT5O7Id6WwvVTlYzPQ==","shasum":"17ab4bdc570399c8e6c5158d67fcb5fc420fc4ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0.tgz","fileCount":22,"unpackedSize":100460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeco3gCRA9TVsSAnZWagAAn7IP/1SB4LrJpaXm0JmjRZA1\nXh6Jj8Zh/pg0wS/LgWNINtR3JchKI7V5JJ2LY8qfZ+BpmEoJLlDzjSPKNRla\nJmC6TD8Nv2MW0uOtyKyEN14UCXcKm35+LUl9dgj/k7L08sBEzA/UKhzglhmT\ndIvyCE1222APea1QTBTmntDbCUyVZiWzbaDnksDTeSEr6roeaCMnkKkNVwx0\n88YnmxNAX++PcUSL0rIeCDIw2Jy2gzrVUrRRH/gI2hrKOIuwmh/VfAgE1eIP\nSXNNsim1BmmMmmJN7LJ9WBv0tLVRUE9ogDJN1qZAtad5HnWS/0lWxIYjtA0B\n5r5E65/J/DmqcA78sv5Oea1gqeWqrEuGaITJ0wzY0O1LygU1Hp3ms4K8x9jy\nsq3Y7767vpHSIr7H9rW7YYFlAqudk7OinWzMbqaC8EmEJWTH8/IyJ28A9WYH\noVRopmdgRcS8/YS4fJairMnLk/EMmzqQr80rWSqzdeIsapu2FregBqBsEUhN\nnh+UMt5CYsynqfgODHyN7zDgVJWtDw6dBARJZ8pf+B1DaWSdwK+tt5FajFlo\nN6+GhNQ7EdFGdgasaf53ghGd7lb6YONMBjmCV3Kep6yg8O5Icvq3fb+GJU/q\n6I340mTrbqicQUkWp/JAbLUEX5slIGkEXIEwRIVzdxS1C2RtsBZUyrwwDCTu\n3bXU\r\n=P7+k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTwqTBLrAHDvBeQI1YJPMRQOApjTFNmRqUccdweSivpAIgbo1qbLP0m9jIdd8VLCn38ME3cowNCKCWlmxU+qLNawM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0_1584565727956_0.6940975870545292"},"_hasShrinkwrap":false},"1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.1","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2Hygnua2vU0rkmdrbZlrPma2h5lVGftwXHFlPbo4QpI7An8RyMxE9/o6y6HPPWUXnQSKr1C4XFTLKXWUpacOgw==","shasum":"d322e18ea7dd19547ba2a7556ae064abe6aa9d59","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0.tgz","fileCount":22,"unpackedSize":100460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeco5QCRA9TVsSAnZWagAAvZ0P/jd/Ioq67krFf02m1YTz\nyF0E1JPGmeX4cGpK7Y8fKrqAMo5ILfOHUSTAIlIa2bsDk+AelfzWApljJoh7\nC+K95KsYq0of03Tq1udMatZJtyDsnSS0wL2Vh0Wa74xL0FP/44Otx8VZKzdX\nuV1spNe21z8GC7QWa2ThUjRzIwOSNaqGGtQafQjA/sNVDSWX0ZVW5v3S7AFS\njOfMNfatYh2CJVqq9Q2zFbMst48iB1THolzRzkN9EHm9PiA0FP1XDIQdto/3\ns2RIRlkpSOLH2nzSWn0hHh5bZtFbCEIfc1SP34QPZjorK+JjfXNS6KZ3rxjN\ncFAQlDretEm08yMkFCIZZfv0YPUfZiLHyXQfYQE8kWhxYOhQnVuBWoDEqgci\nUJDgkJ9BXJjQGSQuTaE62SdtG4Ym7Djg7Yt9ktSUZeqnH7z0A0yztIL2UNVo\nUq2bsM4t+X/O21vmAse6Ghk8sBCl2kAcehfQ9j42xTkrTBZl+KTyIJl4j45F\nz30SibHlkOrnW0UcY542JGx6S+zOZ8DhVCYrwd0Tb66B3HqbILgDb94ganS7\n67Av/k6lABZv0RxD8aOtiWVhedgdf8iTh3yVSKlwRCKiLUObd8X8FFPNaDgo\nxzJca4pF0p9T5Hun5IH+MyVa35wJB41g+qoEg9Gwe2ePEiovu4pA7NgzU8AK\nNzbl\r\n=61OR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTpM59aHIRj/qRGuYBpvVr1dM6SST8HQXWy2VP698c7gIhAIi+Yjs9NY9JD9tW2QsOpqtWi+yck1SyJ+on8PC73fJa"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0_1584565839684_0.28056162625646897"},"_hasShrinkwrap":false},"1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0","gitHead":"74467e88c4833934fb468724aa4f0fe321cfc7d8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-48lAm5DJVhm8awkPZsXuXyD9CYT7hlPV8rPmcgtVfc9RZsvJ1LmwVBrihYQU1be+35jcjng5xKeMaTzsj//08A==","shasum":"ce333cd344fdd55858a7bfd3024ac05b8634cd13","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0.tgz","fileCount":22,"unpackedSize":100460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpGlCRA9TVsSAnZWagAAcZsP/35CUQM3ZpEXGHq64H4h\nxyags0oSysFzEcxwLL5CjQHLmpyuGvpo2d3jch81ceCzoLsIlKaF86cn1a+d\n/m1YUpzhYuJ4O0jf8edJwYodb+If03iM66JphVD8SLN5s1klhEMJbleMkf5e\nFBmYaEL/VFhxH8eMHqrC9DmuDMe0se3ugnCgDF9FXYT+0zCbi62BVUfoE7E3\nDoEwZfjcoc8hJTWcNuuKSMUQQ7AsKq1oQtN8DQbWdbA7vBga/H5c2ggybCwx\nNT159SDQugJl5jqS+2x4JGBEjlcVof98WMaA8noqHoErGoZMTTUGUcKK2f2J\nghnYtIp0GzmYEOipKxD6dSNKxF4cW46ghhRvv96hzpYe9wLbzvHDKcW4i5P6\nATzICoiWzJKpkSvHXnYLhQaIzQgLYtXTfs5Tvugo0wQCJwG/LP14xomW5ell\npeVoTVS1duK7A8U6xUY5ddB+NPQX9SUYJucEpTzPmtb5+Qh+NXm2Bg9axARl\nAHvCHcxJF2u6fQ/CG0y5mGlCEKlHgByN5lk1tSPMOJM+HKZCaR+gGyMqyUsG\nDdAMsgm5318FZsMsSumT5tYjmjhi5uwH7P9L/MbaHPkhWj/DGnfXZ1g6FuaM\npZyEoNz0zXAYFYULiwuzi20fQStZJ+G3p9Fuzu/SptKLJPQHFjADJrhqtpDn\nP3YN\r\n=Ug63\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCRNVmTSBvHRJWJXTGUe69O7dMaq59Lxma0RSBisia1AiEAowKeRo25EI0FN/+9KU2sJRpSUUIJODD6jspXveobWCE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0_1584566692838_0.9604428501587299"},"_hasShrinkwrap":false},"1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-PxH8H5Rip3s15GoZ8XeBJK2RFylbGDvv6lczvx7oWSfBWIczYG9RiohRPToUuniy06gpRAPb701JAPtyIicIng==","shasum":"432e72d6d42ac9cf11edd1c76fa9652cc77bac29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0.tgz","fileCount":22,"unpackedSize":100460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpH0CRA9TVsSAnZWagAArs0QAJ8JljzO0a5GPZsBXRdt\n2CE9RtnmYP9l7WxLzbLvOrw9jfoNHXzFaoePpioIzIrpyb1/gApIDP7t5BUc\nUqzOWxmOB3gN9wbTwUrx6+43R1WjV29aHpu3Lx8+8ZdPP1Zn6laFtzp0L9yp\nVWFF9w4vHccpMHS/jbwYCmMT0ZGsRJXuPAeC0MSA6vwrSLyuIJqfsX+r5HYo\ngY5e0o0rrzSjMZyisqeoKKdfRSZQiqutRlr1WZJb75pMd562TIBzSjesr5Za\n4MHNu5x8ad5h0Hlvgnl/5na7ssYWwGZfvlE4yVEoKQm4D60Q7PuYUvF5pQ18\n6Hn8BV24+GcOAvpqbKMxNQuzTwETkAaNKRHjZ70rPr9eVyuwx9VQGAoOMp9u\nLNtq+VkW4yr0CBh27b5+apNaVwzZG/7VGD2GSosH6LObl4xt6Z926fj5llib\naTVKngWlCrPxBmyjKQhsuc3SJkxhh5cpLvIBHeBSccKDzcqwhf96OO5W6axu\njTq9oWuxG4iGVctijDlFDaQx7sy7Mnaoi0YfAIX/+HqS3zxxq5OChVCieBU1\nwtwTsDchb1k7cQ+H0VXCpZHq8UMgz16Rr6LWCvE+31oDvTnv3PSJruCvMeQX\nv87NOXAMzCewQBM+npY9iSy8GMgdG63fMwfYlFHMq+bQPx+7cmm9UOVVcR38\n7Jxs\r\n=LtJ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9zK/6nsKo76YhOjWG6w2rAT+OjPylF/fMa2nUgQZ+MAiEA9Ki1fXxEoc9W5GcADP+gu18JfXk4xdL/kWgEtlpObv4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0_1584566771714_0.13483170124632582"},"_hasShrinkwrap":false},"1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-CIl167wZp09C0m+0a6TO6A9RIKK5cgkj6xo1xgGG9FFhvynRM/WxzeI3cmsoYTXu8zRJWUkzozzDT5lG40PfLA==","shasum":"cfdc9dd893db5d0dc17818ca33d9789d38f1120d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0.tgz","fileCount":22,"unpackedSize":100211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec5p2CRA9TVsSAnZWagAAbUoP/0oeVnay/Jn5xI9wpTbx\nH5H2xIVTF0WY84wRid/kYu9BDqXWptw+G1M8uyBjKpTeXCisENCrrqOJ+YYY\n9mqPQ4O0bZu6lOUBTBeJ+68basdmAjPC+faiYtD05j1nQjD9nEyGkOBljTdE\nP9d1sRMxLpVfmosH9iJZgtCdE66+KknGLr0ZX5Z2ZYhKYY3XdiwYlTSOvsOy\nd9Y23ZkWuuv8OuNSjGI9Hh3kfDvI49iayborg4tENP0lxOtURnUFbOoxGedI\nbiJe+XQigyXUzdN5Ybl52oISx118tba6YT3dkQqZ8eklZmY0bgQzZA2YzAtn\neNyOQYP3X01XnXpdZOgymbZOv3oi9IdFf/CdXdYFx/HdCRsLH4IhWghVPpfe\nsCSsAfUWCb0+zOrITvj+Mqy14OSCvk02jFUMH2iIRa5HoByszl0aS+9BSmy3\ndqBg2WmAUHma0krhkX39nOh6r4k4jDgzNmY/HH92z5Xpi/Q88le85EJi0Uvy\nbWrRJUWhdk4GT/KSkNk2Ou7XRPiouv9dEqKdfCaTuqLXuGm0psisBv5NBw0Z\nHZYF6D9XlHXO5QQ/jhi8kEhlli8pmFXmdNmYxARPahvFYHEJZlcCChQwMEBW\nxyMMueOclRzm8cL036QLtvJz0PCBqqJSG/LcW8MVgsHc3ciu7bxwj6/KXsR8\nbBip\r\n=3CRC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiPPwMJJLcYRmfpBL7j1oAF3qEjdIRa8m+DEpSW2gKyAiEA539OtuCQUgZY4l8KipY+b65hE1wK0HJjCRZBqhW3INE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0_1584634486236_0.030968087491550778"},"_hasShrinkwrap":false},"1.2.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.1","gitHead":"a0cf280285289c5f940758c517355b13a8b6217b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-eQOtpc8PKOfc1SX0kXyusRfwShhYW1eaJ0xffE2v/fjwKwZIPmmgt55/C2sZj0HKPz3dK0iZaDlF5305WTtngA==","shasum":"41382c16daabf77ca7ac8833f3ffcf34598a3459","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.1.tgz","fileCount":22,"unpackedSize":100788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec5qGCRA9TVsSAnZWagAA5XwP/1cYF7Qf1CWp+YSAGRXs\nG0iFWE9O5PhyYESB3Z0ybSbCSzISTq4aoQL017KsS9CxqLKuCfCufqLd8U8H\n82fj40B6GhaGkV+zPMXJm/7fYhSzzp6SOp/RNBPsslL8Q7gAdLN5CDqpvRyj\nTmC3qUTE+AHbGYYkWOCPub9e1YbAXBd9X9js1oIw9F1yXFLXxBR0D1BHkcPf\nAu+96ndCpVOWBRE1DngJhSNvZixS1S2MyFJ5+NCTuISI9oUJQxeZtbKKDtT/\nf7Aw/3uQP0cIpI8YNjDxBPtchrfgaOtMwH/qTVCGtv9ruwa9nQtw+pS8SZyU\n2KVokjjzIokaWsKGKDRmdcPSpw7yh568e/XaunoBxDCtySwj/k9gZJC0rGJw\nJBJ742zCadE5/oXjOOHFqlvcPASD0tQjWXnjTRh14vv1G+uort/8cgXcqDY2\nWDgRQRPSIZ/MdIdpPnF5JmIwJRNUoEXdah0nrG0m5VoovirV6J6ExzjKZScg\neGNfizLXDgzQOs9WMH6NsTRqWBH6Lzjivu+6pblQnv/OUx83KAJWR3mnBl6s\nYJVmsRg3FoQPdrIQyv9lQywXoyn25d/ZRqYRNZAVOk/SQz3SoAccHrkGWRjH\nneRZj+L/B8wo2ssFAkyEcOsw7YEYdyxFRh8yg9P16aVuqUfGEa4IL1aSaMGs\nQmzG\r\n=q+zc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICp2cAjR3Mj9X2KxjoBYr4SbtAv/aEFMKfp1gy6Q55EMAiAMZ/0s7Dcx/dWDmUW93BKaNe3YvYA8F/GyD8JJf33ytQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.1_1584634501525_0.9410030783662098"},"_hasShrinkwrap":false},"1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^1.19.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a0cf280285289c5f940758c517355b13a8b6217b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-NQ8gbQ1svjVTDG1ynesQ4UvGmJrOPIYNdvBaC41O6UbdlYdBYB1envvzsSbQ8hARRaXAx5aVw0CBJ2CdCrzhOA==","shasum":"b22a1bf0be8808780c87845e533a32f1be56ff5e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0.tgz","fileCount":22,"unpackedSize":100831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec5qpCRA9TVsSAnZWagAAAhYP/iJGP4EgMK/OvprchORX\nWKuoeukf1I2dRLP/h9jPM6RTxoB+YdoOs+a/trQF9/Nwi4+B+rORUVnesi8c\nsTJzt1XygJtcAAXUeamD6DHQ+tBszKG31kuGhsDgh1/ob/poVv8szpUXWyHj\n/Tly/lR3eJzFz3bhBBRfDnnX9BZntYIIzVbuufuYypsjM2xka7adbMWRPglt\nGYQClKkK778Md6kxzgrVzzrQ3409Yy0Z27PY6HgXJHeJSQGZpDJwm+nbV9Z8\nsws6ZEb1Pkn1gET0o1uhNOAFWCBmcaa6SJhaI0YHa3Z4z17mmxGTksIb3W8v\nFRkO4FAr1M6+910lnS2qfusUpZZqFGtYhi7rjiD9WR2osdgOiUqb7yEuoHog\nuwV7IZzN7MTJjBLdQeJ2Y+Ovq8yfkqlvMRULRQH/RZPmGH8lynd3ooZ7W0uN\nLMAg2ccbrW+zcvQQgPHuqnMjMc6z4l5aJE+LIg+wZoMn/j5TpNmD1MUrDpql\nejquhodnxJY/KBfRhWk6SXeXJ/uzptPbF82uBM2PHh0L1o3yj1WC6Kuv2FC2\nxX69ivI4kLJGd4ck3+67sKGyBkFTSTeLPB8EBMMoMUH76OF+knl0m9mq3UMF\nZUgSrrFOmJHnP+MIB9xOk3JckZGNy2GaNR9ebXxqqPNuji6oXqD+IXgyMFmr\nvLg2\r\n=Y50S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2hFKoi700xmnjRzlIYBETjjFt2+U5d1B+jgfUMzCjDAiA7L9y2hOwoj2aWArqH/DrQaRMgEqUZimC6uZqqjiIq+g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0_1584634537123_0.6449819211846597"},"_hasShrinkwrap":false},"1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.0","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0","gitHead":"25178dc555ae625d155e431d114eba673c2caeef","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-pZ/vhBLYelsV3WDWj5zg5QW4ytH5j5z2d1kfJGaE79mQpwf4DvAnmq72MJ4gn/EmlCtai1jRdMEFWhzA3Fb1/w==","shasum":"9151ffafe52c41cf7ed6a1def803dcb2dbe282ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJednTbCRA9TVsSAnZWagAAMn0P/RQgKnSBHARJVT0RpX9z\n6r1yWEmtX+5nnfG1Ejh7CEla9gKURCZyZs0JuSMMTYruAOLcVOAcQNQNNiM8\nxpVtbT09boNHgVfqYTRnVhL3NljnGnbD8wGiFs++nVpqg36R13MTKdfc42YM\noany1jKZZvDk3Y7IwRWWBGlKvugPMYUE8XHVxYRRA/vueLdJJygeO4UKnILj\nKXloE0PzFTsbRfEoOiqurpvMjLhI7BLjaldptp0idGAeRRoPXNylS+HhSoS6\nMuFclaz5BQcOumYnef/axEce/Ql2qsedMGWnIjbfh3b+O37hyIQkXUYwRd0E\nfo03A9efvWpBZf3S502ivd70eF086votC+KKc21QXW5Vpws8LdGRFDoDhI42\n6Q0hoTr+tQS5CP9/O5LrMWj5jH96IgYwRcDr7wxSOquqqNJBHvea3sv7GgMU\nzwSd3Fpr29pl3ygHP1ohFgnd9BeyTHTJuBrnyM7ha8NYgcUVP0Bh9etgGw9d\np65ttoXtNcB4HUGBcPtkAcaUHj7Zdb1C24sox3rd1ZJSlgnMiLNpzQ1P7Kf8\n8iU+VrVj2j5IGVgXmdzKkd0HT9YHq6bfUM6VGT/PPZDajaItPg9oOfohf6AE\nQ2YHyEhiCkEuoZrPbWE6rcXboCgceHprS8wqPCOuLcWfxLGXk3FVwYJn6wpp\ngyJJ\r\n=gbo5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3luC41kvn2ZiePk1XA5/B83WPAW3+xjz6mtOATqXhjAiAxsgWqbr7g/K1ic8dn/Pkew9M7zQO/4xChejJELpyiNA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0_1584821466544_0.30482049662824373"},"_hasShrinkwrap":false},"1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.0","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8f7f34b9efe1a3ea79d3541877d38790f2bdc045","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8kM9t51fTfzZtCoJHbshHGUcyQk+mrUqZ70ubRjN8gPEZcRBtiH/Bgl35r/j1JVPRzYHjQ0u2+5evy29K3p2ag==","shasum":"09b43eaad9411d5fc3c31ed1d666c3d113438c92","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJednUkCRA9TVsSAnZWagAA2qoP/1Y3nFee9PncEDrkWOXG\n3c+ASleL4DADkWpTrZNgmmUGG25But5v7WjZzP/OLEcc6lC+vrdjBc2zVIMM\ncYoaXbwhdFavptewO+tm+n9gG6qbz2KdBE+vXQafZHS/UZXUFwLUAc2XCpRg\n+0F1MBqCnmKtyCUWfoGQyZcjx4X8QvsqXEZLNCmCUk3xbmP3tSCQplf5hJAQ\nNPcJaWM0s/5oITGVG/9QB6TBZY3wlPBX6y2+EpBdtQiOKlnbUPhqyz6sPlu5\ncF+YRYk5OrV3wcuJGTHNRL2jNn3LGS5sjgVogp3qkIPGkJFlgsJTq1BAqH3Y\nK8EX+lXRA6ZQdcgkmrX6DLjUzLRwolwD8tlKa3PAk2hICYfZj2v7xpEtov1g\nvjfMOLko/rTacmX+arSmrWGp6RwojxRN1cSGVhHekUaZglYD7aTBFIphh0Oy\nINVLjJR14PohBua/HgGbHkxOs+mEOm9Y9Ol6XY6b7ZXQh7KHnvM3OHl/HNtC\nsF5/fz19mEkan8oqJxOH1UU71HPyOVvPEi+60gQfuKbycIcHy0jtsUg/Z5rB\nJ2HBFzMTt2iE1iyk/ExFt3QTF/ziwiM8zlyWS4CTJmAsSw4O4QZfpWViIojQ\n9An6eQPOI0AvBA05TUOedFN9QIA6Pk+IvzB9A7yF1leoJLNxk3oHoABCXVzt\n2ft1\r\n=pj2V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiwYo+DIKSAL164VTL65YSTXUZ6xd1qCvPB5J6hAtyvAiBLAK7XY4qmzOiYLPY1JoFSm1BfspYDdJXW3+Thp+BdoQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0_1584821539823_0.6812652890434909"},"_hasShrinkwrap":false},"1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0","gitHead":"c013340b67caec3a94ddef2d042463b57ca188dc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-RJO0YVqjWyJKFO3SwQ+IWoRxU3UyMRvClln81SOPRFlroQoOinXNPeqzqSGDRPadYJ42F1FEZ70dXs26bITHhQ==","shasum":"f758f41ace98c10f259bd486adac09ebed91ce79","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedqqhCRA9TVsSAnZWagAACvMP/3H5/SFhP0UqICpL0WVv\nGqbuFAtvMMpMTRtRr9nsARQsjNhWmaXmxwVVpyR/1ffz5JaV7H2CFwyRSpwj\n+gjosYuEUFK0UPzQNg4DWZUOcj0UZ7mHyOYmxvbOuIfQfooILVuSm4PnMkFX\nlF8Wu2NBcUpOuFblxLLCoruI6Xt4fybL4lJzgxvTEDeQiYMIIgGyhZNuTizI\n4/6oidW5vGZDfHE2zMNXtRh0TU9MnarE1wcsGJJruRlAoXZIC38CR36IkpqN\nOux0D/qJE07qS6bUGAze5JdSkwf8UR4CiOBpgppUW4pXNncdXAolipJuMPJg\nb+WQsjO9fSjnbQoZwiPHlnaFwkXS2s3f1UHHlLA86aHqYUIeONNO1gJVfe7A\nmzuqbQjucSFsRDuQjkuMsRzWMIeexX1psv+FlgmiJC/p4cq4S+nimBzKbSzC\n2ar933K0gHBxSSJoDg/WOp00ynn5Ifz4YMOld+gW1IQP8fhBHwbRIqPABNGW\njKYVhPMcnjlOCiwES9U5P1kKoguSjJTfd1PtGsTjxzxJ/9ZmE9Rn7jpMIndm\neQbqP9s8OGhxOb7d3ZWxy6DyH+hyLQwOy4w/1hpnPx4x24yzXx6xw6VVCrHL\nBsfZOM2PH8Sgyqb7z+cpzWDEm6IzETGjzp5obG6JplztxHAJv/QHFlZZ52cV\nFcCU\r\n=eIbO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAwchFHfp6gX9BVA5IG0bNO+7ETqHgyJF/Nvj/6W/kCeAiEAgoTbasNunBY8I8m3ZIvgnYPLjlAA67Sf9nfoCMB1Rbo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0_1584835232800_0.24004134507010688"},"_hasShrinkwrap":false},"1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"28e552ef0dd71913003af24fcedd3b8c92395b23","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-cR6gcd+pGRewxJjJbJPyjxyvYNC2LkMlmhfawnLgTvH9xOMLEpjW3y/odIOy7xyCdiYxagodXsYMJwwHBIVuGw==","shasum":"ca4a9bc0ae87f8440d58ecd2c7ab84b63cf153e0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedqr9CRA9TVsSAnZWagAA+CkP/1Tihjb9KbUlRmdkL9gK\nCUgo6sGitPguAy5ukJ4B1VPjzQ5Kk4yX77AxdP8ZoQ7jfiPlGbgz+UN2W6Bg\n6JDSZCpl50zLMDS3tpqaL0zF94XHmXVwZZDpK08/It7Q2+bNhLCjIkdrZBSq\noJ4vBhd/57UgTKG0GdrG5SpjVFNt3T9OU0JVy7V+ZJn32Nl9c7eJNDygcPQc\n5WSuZybFBJA9HL29rc3ccQOgU3Tc11NWMHcuK1E/kMjfGOgqiEqh4p36Cond\nZXYeIkrP9zYxFNV6eJe9zcE966dNnajVjaQTNb6oy36C6yU48nCYgABlQQ3Q\nhAPvRdRjPaj9a17HioQdQ06gLBBqpn8Al6mClU4km4FrSyxi5sBQ21Rl51Ai\nMf375lwIG5rOYvfrP9nB/7XXf320yF7BEpc/0oNToPNMN9k8cxSsRi/Z0cNO\nRkHlbjQZL8q5A7o8JLc9PbYWL9kIOBIw2ZrFKtWEMcczqdcWwVOYCY7AeEFq\nFQmsQ3nUsIees6c89UDLyui29WH4zLypHFAhd3oT6Ab3hHrCUGiHG1x89Dpt\nLqdCCicY4OncSS1xJP3lfk/OfwUreQOH86Sut2fA/1/3P6/2E2WFReIR/4xo\nhY8GXEkSfX40G7a6yrMY5kxUjh0ulwjLESpJlgbWti5Fjj+U12khbE1MWCnq\n+dhz\r\n=ojq0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaqjTVsafxsk1RFJjq/GafcsW1jUgfU/v3C//LRakToAiEA/Z9ICORmpo38kQfK3dXZKNK3NC4o6H3KSJ7vd/MNJfM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0_1584835325264_0.3454746249840146"},"_hasShrinkwrap":false},"1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0","gitHead":"14de886fd41cf21e046b5f808170f3a9c221bffd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-1lxsp5XM4WuTpaQ9oDOGTvARUpl5Y4btzxYYDaIh+nvCIFX7UJF5hwtGYeIAqQaoZkx95UmuBzsIP3LMPRnraA==","shasum":"d23b408b7defd05b3e97d7f87d7872ecbd7e6773","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedq8WCRA9TVsSAnZWagAAeJcP/213ViBfnaxAkx2fcWmg\nsGsi01U2qyr1iKl7J+67dMMBo6018o7q8ksbxbY/+Tljr6vGbN6n5urbV4Eo\nyuQfj5MFH2fvqqNclBNaTJCo5EJFIWlXUCB/wNsw61/8pCnH6y0HuB2ur6Aq\njv/ap9pllKNPKD+ma0oFs3hPNnt74TWoXUNN9dHZnc4w12U0tOUFrgjJwhMh\nkzA7Eeo8rRq7JVWiM63roP8QPQnRfCmYvOos5yL3cHFWKKoMyTF4OmveiZFR\n3ilS5OiZPVM8w6INNx/BdhBoBALkyYWDqt7xbmWZj2Hwosg5HQnwaDfyJSzc\nq+dMi8quemA9MvZopZJrcvuYdZkHBHlQFM06/R1Vip//JOMl/qZ1caRYwdQA\nocsGb7AjVDkYaSR3rW0LLznG9zYFmRguP32oO5N6zNW/ATq3Hg62Nc3LeoVR\nz2XG09enB7Pa+6vAJNk8YwmK6Y9ViUD6ByaNKQMctgPyIQLU9Z9xP5vg84o+\na50cJqRv5x08Oj/6Q24QC3C1DDRKfNoxTVq1efqvPlCDsXSkkvTiuMQAy5Zn\nxdZJn1dVCbZx4PjO99zoFdXUo0ZyaBxaF8Yf9ljaQB5Xzk1/hSle8GTmd4Dr\nlCGhBnqgqnJcLmmatDXtD1XxaUu9NE16P7E4hm7l6yNgKDmoL/HWZg+vB0Tj\nZHbE\r\n=Xj2U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGy93SjWAbtlTfpC+cM89I+BKPshfHvKi6eBWgBE7HeDAiBwYX5H0Y+YMKfEcES6cAH+HvXu+IHHD1T1ZIFShZgKiw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0_1584836373713_0.7586735377762939"},"_hasShrinkwrap":false},"1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.0","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"47881c56b36e65e3e7a63fb927ca99d91808c49c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-qisP6Kw8RmHp+XJDkOy8x92Y2qiHUFlUeydmCPrqkRlnNtr+3W/+bjzL6EprsJ6F7z90O+NcmNtJMNDzZQXW6Q==","shasum":"f406f1c9b3e5a42e25086254caf4a1eb747f9d92","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedq9mCRA9TVsSAnZWagAAdy4P/R54hNMh9GwzMFMQ8y2i\nO7u+EXbTjFGvDCheB6h+2QTinw6JWhn5fMx06IX1Yx8YFQ9NmBFdfhONzPaA\nuk5OcMceTxM/7gpKTBKaX8YSP2NNsNkK9Exa97anA7Jvnvd3o3WtFiuM6tCK\nKizkt0FGALkvhJNpSBK1y1q8PXEUA84oN5dQ8zBKqmCgkxMA6S+n2a/cO4/p\nZh3UJ/Fc7Di4skiPd4UEAHOzHP9CSnMQqaTYfelIOOFF7MuzK/105l/XvjxR\nMxyavLD5E6ETVslA8JpwlAGd5kkbKNRvJmHVvB4t42NdU7YBHGAtb056MwHg\nuaV7RQbJbaWbI3Akk/AhejeldWhHCI+O3KvKXQ91178FhZXV4KyNZilz2Z+Y\n9lz9hgAGUfMxkWjSQr5sMUtZTUvxXdlOL9kkeZZJLn/kLAUzvO8DfTx+p6G5\nmZIIbdwtELH1vSEEi4y648TdBc8pKSSZPymNzf72FRmvWJTt/0WuudyR8Etx\n6Ac5FCcqBleYSBdS5XNAIG+Bh7FBp6vAdbWqex5cV4p+HIujSA8xDdQcHqAc\noyvmRtYjyIot8wijbkiz2SGrRbdWue0ZnUP/PZASULfpZxN3YXK1EhbYFxWV\nn8NYP5QuS9+IgbtSPD/TULDampAL88X3V2BdoNWdaAxSPv+CmrW5G4ws3NCV\ng0yC\r\n=Avpe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnaGMxoAMSvk7UW+/NtT1TOXn16BNiWFmdxMXZHBepzQIgYbk066EBUDma2f/gAi1BlraInC1WiSIA2xIJXhFW8I0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0_1584836454469_0.3807436911077482"},"_hasShrinkwrap":false},"1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0","gitHead":"d80a9b97d359dd33466da5b62a1cac91f94af0d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-tlWwnS/UaIP9P0sSXmr2i34cX9cVT7D5p8n08bMIc10lxzLL+XakhMT4uZ2HIrzOpbz6Mg/d6C9b5odbJkFqMg==","shasum":"522a8e92171e230837b07625090dedf5cdbef0cd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedskJCRA9TVsSAnZWagAAqT0P/RFWp9wftMPo7nn9A82/\nfBe9kFFE10NWVe4uecl+dswBH5SfKpuj6ex2uTN50wTu24zTsN4RPNamqrpl\nYrhHyBFytLcbKRjnol8xTNHzgvxcDjz6WNFwKpykILQJxNEK4IHRcaEecBca\nHDLcnQPOa9YnPzakjAulIOO+GfvWmp9UfDPaGGjVldifeUyxk0YB4aloZnFH\nMEH/+x80/+pjJ0Za44Wd0F9pp6CGsbW9opGeVoLvVUYkxVC8oUZR15yGnYYz\nJm9rCd+F7QTYdALPtZmxBKgbgLzUK38ljH50UW6EN6V4cXodZLDot7xSvik5\nBT5uK9VWqVSnNh7mrFhgHMTY0G9DmK3B0FmlAUO2pdok9uCRU1bYLrhh0m8N\nLL9ZhIgEWlvB6yNamK2GXGKAaujCiK6/q58NiIpYFX9g1LwSPD/iYMrPzMg5\nzV3u/lGeiNNwheHl6ZlEEIOR8OVqsntET4AdyuiZ5WLdgGzbdI8+smxdA4D7\nmIk/Jp75O19rbi8ecsVF6ry5PiIdw0Tgc1/VS+xDQ3sfhtZgeJ03tb/OTuUe\nUWD4fRq17gCmFyAT8LW1PlD430zwJxJi8gbmeJPqpUgFIw8f22phCBooU8l7\nRlj9hyZ5SD3G7sg64h2mSZHuqYUwrFq+R61zh77s3YOYQAZZPUPb7xghwUgk\nfXfc\r\n=tHTb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1UgHUgnGITAcZxJJi0QZt9kTb6UT7BS1x5bGFTtxswwIgZZJlBqechsUgTcgb0lNAppLKqBTHI1opOm7kgS8WTMw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0_1584843017224_0.411768785745283"},"_hasShrinkwrap":false},"1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.11","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"01697ee80b802e68de54e2ce8fc3d8bab415752e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-c7b6SajN3Sip60QNwK5YvS+s4SBxjoqJFVURv8oIqEyFyYdtLVEK/1NvyGQQsCZHtRdxzcC/lD+nwrdUjslM1w==","shasum":"f687a6a6c1446fb48d056087d0d12d6b42741b42","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedslWCRA9TVsSAnZWagAAFTQQAIOEDIVAD4lQpQ06jnmw\nmffYO31cGX7sqwuKYVN3FTHcAN6nhanD9enHDJGS5IANP+oqhs7+nssbqMnX\nqxrrn9JW1ixK5Yiij+Dp/Ru3dpzsC0cvIwETrgkjUXklA5QciM9vCopFvYiw\nSszfkixBgFD8BrP+wXTyDdyRGAPy9kSI8fZrWw0zf2nJVDC2w3TpO4osDKfK\nFbeCor67zusH56iFBQU5V6Vz3JVHOeM17CFjCribxnSMlQ/Come0OrtR7BAR\n4uq/HjcrBGd0c4xANbXvhYLzV6XW2dab9aX2oaGXBQayQmETmfAq5X5dBW4C\n9dZijS+WM0ccSRzb9Q4k++JGzEIW/kDygxajPrh/fBWJ0oDCwQoauUIDeIeg\ndFJuI9WWtsuDnvx6aKhhgJC0O/uSQ29QuCde+f+JsfKkC7ncsw6U7AOcqxLH\nD5jyzk5YOIQMHWt9SznQXzVWF98gEXYCpvKZUvfkMEFjLP8PDAoA9RiDh+Su\n28T7PKeRk64PitqcsNp9RjvHkGpnt4QtYZ4DI3cktRefA+iSfrdyyBwb8gDz\n5SFLk48BRCUp43iCw28gUpeNJh4maf+elmO/VF2S8A2mFIhJAlciJdfldEkW\nAWAWAln4FLlcD1HNbPFEB+kOJYwnWGOQoXcVRs7oF8yCmOlJc5Ff88R0GLFV\nRv8Y\r\n=aVag\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkpfcHUinqV4G81SAuFyD19S2Jv65p+69SwrlXGz7uuAIhAMEqvW7BfaPBmFJd2CSfX5vdCQtYh4eyTJZcZfQHF7JL"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0_1584843094268_0.03800091891374069"},"_hasShrinkwrap":false},"1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.12","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0","gitHead":"012e582bfa9fde9aa02b8a77fa284f95aaef79df","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-LG/VRnwCmGBZgYR6+MEJI6+n0DWpEcLqTxGnYNWq9HURyS0m2tcupp3Xmfdw5l7nC5NMU+09063j8o8ucbr1cQ==","shasum":"e5687796d4f7e6b06f28fda589ad73a1c1255b7a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedztNCRA9TVsSAnZWagAAINMP/i+PaD6C0Un5Og6yeJr9\na9r1xASp5f72HD2QV0Gf/t//8TotTp3Y9NG8mPpRxTGdDe0TjA6fPb4mB9jG\nEzM+gAn910slK8BeWQChs01/Q7ByYZ9GkFOtHwP4pjI9hS8DhxBwOyMMe/C1\nZ3lGUJ//+UloW8E8wFIcKepAvBTFiC2dVIguXF17Hw4xrAGrh5brOcGECkcw\nzvX55OoZeko0BCY5HHDZvs4pJuo+i3Cim4NSWTKB77N9doK5T3gHrxv8uoee\nBZB5C2UspcN5hFvdB+W5DLtTAkqVvnprCeWuSogcJA8mAx4+MDqfaeOtaBAD\nfVNllRyrIfjIOODsyxdb6tRNHjzcl2DA//rCsLnC5gHlOulAxspnuNhbKmX/\nalNP6LRJZtJmhSVlamaChZHbl6KynZqF8n3l7ANaq9fko5L8wQNn8j29hRX2\nIH5lSCXdBzGpyhjvGk4xP9rFbT60eNHtwu5vucFrSYGiA/krhonLAWUdzMSe\nzBCKF5DytJFn+eILVnwUI4/52ywfL81bXfTtnp6TAknUIzzvGXq8GXDtNhAI\n8gkgce6bCxG+7H2Kql40lPFPVmCg9LxiL0R20oW0uV6EQ8Pm9WNTeSwj9AdZ\nvgPYYeFs/869BbST9QIJDzPu8wTtNqXMgHY9ZqfW+FO3KYZW/dU+Q9Wcb08s\nxL49\r\n=zYzg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQ9g9xp0x3LOPhYoNwOD/RTtXxlVQsO6nQOqs+VStfdgIgLFNelH5KtcdS1kurfJwyzhCzPgVvxXh8C6yIyTWw8LY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0_1584872268769_0.030724027769280626"},"_hasShrinkwrap":false},"1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.12","@types/jest":"^25.1.4","@types/node":"^13.9.2","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"347c0f427e647377a817a1e5b625d1174839f19a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-WUdnNNxmCbIyhetVoftNxcGjZ5LVaIWqr8rtaQdSKWUHPVi2iYQpi0aA5LfgRf5cgG75dNKbr9J8QC+f7f97bQ==","shasum":"08dc3f7e48fbe82393929f5227a081cd15723048","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedzuOCRA9TVsSAnZWagAAwz8P/13p9azXmQroC/CaBd2x\ntyXtC+g2wZYaCTjALHu/Cw4jFH7MfzzxoUepneMp91CRhXWQ8fPFJM/2plow\n3SBAY1zmsKnm7gbOQ1vXzGzQRUwS6PYsiTPe1inkdF8dbt2zXc2+uMY2jYZh\noC3IVUr9i1DGs2SgkDaMKXQmJNB06/LtMaSyQdm1Ck16HEuF6L2zJwvCsxE5\nBoGd69VG/ZBEKlcHMggmkd5+Teu9RgTPWg6lPeoIDB0FDqIyaXP6TH/tL578\nVuPAMxN28ZOmFvUmBoBZN1N3zW7G2Wh6vdfRvktcOgl1DW15PNFAJlUW/rXA\nAw0h9j6G0ypen0J7pCYObMtTxbL6MdtpZRCgWtP60T/hIQJsLYRAHMzQtYKO\nYU1NKazvX6IM+qz6VOzmvjDJpWgiZDreL2MTH5UvxGRf13O7DVPXbJWld30I\ntn5fUEvT7DKdfrLXOkC0BUsb62/q1nhWzIYaAv6Apn/O1yWgBjiPYHMPe2oF\nyMvX/aUS/3mHsX8b7bPHEux1agoqOsyLbkwRqAHOLqJfY3VK1fq++VooASp4\n9+cpquNXnO2naWGgIpIt8QZ6CQjgHM8oG0YTISXsc0PTTR3uhR0x2C3ymQxm\nOS7JOMprF+wp82hPFDumqZ0E36QUBFRSjON3xASIiqu8fJmm9QmEUmJeXWyr\nDAJ1\r\n=eTXG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICWkoPUbh7ZtGwG21ngfuo/LivRClaS1HJsnde1e4Z8uAiBYIeICV9v3CWp17G/S7EGNxu1fXLXMga0nyFkdlSyUnA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0_1584872334530_0.34121503335348846"},"_hasShrinkwrap":false},"1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.12","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0","gitHead":"d680917533de0db79c587182c7f5f4a50e50df09","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-HlI9tT4l0qpvy3GPZKkd6vABtA0j6u91KCUtT9xacAXivEILiXB1HDbfc06iSgvhcgAqZF0PDt3aa1gAc/DfUg==","shasum":"da619d8540a69630e915027968878078627d9b83","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed2e7CRA9TVsSAnZWagAAsbQP/jhnoTQheFp6xy1tNo8l\n+3moHBMNSbf2+lU+1SKUr9ws8EUXjrOdUS+VMh6sGbrGpoWsIN/0yusVYB/X\nc41ivK1hf0qHMdSh5pQ5MNXV7Y6KniD4c+w2d6Fp7y9l00ovefLZnIi/IFcR\naFPOTWsClzSyFHWR1I5tlW+ugIPAJXUwbmhYD73B/bDPoRSBbgdAsK13UEyM\n2F3jBYWeWAlqHYABAOqFtEMb3mCYXIsPuGTwPmHJnQLoANdEmXjKqS+qSsq6\neAWI+4zfUALEHkGDdqGa+Nolxh63Z2WLvJZVMy2MpklRdjhSJRAGgL734x6W\nlEQ8YOw+mLZyPbkFft/6NPFJkoY8Vc3j8TX/6KqkN/2JVz+P47xJgtCtocDo\nhk393kHF5yBMy/kwUwjcdGjzEh+s6JNclpeV8eBDxc+0UhNJW48ZpOvJDpUh\nJjrkcJaSHwJOgHR+t1FbYlAUGWTVt1/Ru0fkXwFitm1C8CG5mt1PNl0tljGx\nHNFyQW4NCj49iRZ19rrPrelEnMwFZHqIBCVsJELzNew4k6mA5MenKtKXeoDC\nJGS/0wz9q3L5CUohB4P7D7Wr/BogJHhOeWQsRc7UHIEstFYglwGfcB5IYUm7\nTj0dT1EEfaQCIkMiP30ckAddMfAUfj27IsqxA0vd2etvZyIUME6995V5pfqA\nmZMv\r\n=rMgn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGE0B3DkKE1Nrsgf0WGgU4L1WVwGKAg53QSw/adKQM57AiAA32eIPOU0zl6MqH6aJUdP9/6GRfykh4JaLWnY3RGRMA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0_1584883642532_0.173928306429175"},"_hasShrinkwrap":false},"1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.12","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"816434425d1d382b72cadc4710ed7aa8f6a5abcc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-RVkLLdB9axluPtxbwZnKI+Ff03RrHhkQRNFK2QoaNX3oAHY1qzpwdJUe57qQzI/Vo6Z4+OzSyDjk3BFAmxOsfQ==","shasum":"3d322895fd0b8b0ff552e16798c7ece0926acd22","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed2gOCRA9TVsSAnZWagAAmxwQAJGt8l0/BQxldUmg2Zy8\nHLiFVmzlYtaH38bGqEcj9lVQ63jRwvgztJwA2mWWLxkQiGCMx89Rv2el12gq\nrYZHhOkVlqvCp8/2a4g5qEI9bAVcit9ntocoCCUArSKAb+Hoj4hwshsr+w85\n8MS/OV4ocInirZZ80z0xtnbkFmh7NQ1Z+uW+H+LhEgwvXudHZmKw2BiPz1j3\nF/YQwHuFoMK0a3VBfiSS0Cq7nPJUgJkWHShzA9r3kzW5EblR7y/N1JmgfRLo\nQFeJGKWFfeQoYRxLfSSKf32ISyxxrpgvMYgaVax9kH68JycKjjGeY4UfcrnL\nCC91J2L6Xli7r9rM0Q9O4e2XUQPfOqT63EGfJquX5680ybhZ/oD6vmjiV7TZ\nSa0fRpNAanlW0VxhaAobfiwDwRhgolUL2DFfjrA4LrC2NAcIw9DIkH+cW/ng\nw6i0/+FKGl8duyAZvtFT80UtE2xqJeW3d6zaIqfw2JZ1de5Cli7EJpJ6kNCw\n82eveif9aEy1qq7LtLi7nIflQgOweL2UVDhWM1m/+HlCNqqKLeznUp9zd0Di\neFmGBzb82TPkv0OSu7RejtY4N+2TH9BbN/Snds1EDckWGXXRzEuZVfT7FtKx\n0L4AVI7peoF3ev7MHpVk1wbtJTtthJoG6eYd+bbxqQg9Z36DSK+43ACn6LQo\n2C4M\r\n=4NNL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5mt67+95lVy8Ly2MpR/Wgds/qEkn00ZGCAEslr3xcYAiBDrMNgE6WVLS0/+OLB3qG0MlkpGbgQ2nuXZbkfCVDpDQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0_1584883726163_0.5333725679253054"},"_hasShrinkwrap":false},"1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0","gitHead":"763885f070b226e14ff3c68fcd24f9ad1ce6ea81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-osEOZAfdkhxBMvQbwgxg2/WTsfa1SMt1WxC7Jg9NU9WTBHrG60OZTHzAnL93Hg9rmtPHu26gK1Ez2TX4kJrQmg==","shasum":"ad32cc800db9c0bbc7d07f1509acad48464c4de8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeRchCRA9TVsSAnZWagAAmasQAIGK0tUa18nr2iKEsaMt\nYzC2G3ysa1+lflDpo/a84JMkeuTcCs/rk2iYAPENkFJBkS3j07swUxT5ebnK\neo66bXYhusbH5X49t6c8yBiZT5jcvx4xTn033jgr1S/7iJaMkQoaJvBAH4YS\nb8m/gtYNgv8IlK2S13dhuMVYu8WVN7n9uy8JONiUEOm0KC8rXg4PsKTcQTaM\n8GeAn9ENxb8uiv6j50UdTETJLoni9Ht7sa9BMaD6qLBgE1RBn7PThmMop3Vb\n+jrdgUpQ31x5cpmkLgphrsxhXb04FQat/nIfxNjUJWretI/qUgoqXUv4yjjr\nX5AgBpZmmbB5h45mAqJpZO6e41RY63S0EQYlyT9qwEWy9VqrpHTEdRv9tNRV\naH6aQZyNnHd4MWeh49g9v7sw9hf5db1e92jiBJ+djG02Xxbfp4isg3O8wBgI\n8XJtR7+qV6lyHxEGkINFXsgpUIDfQ7h+iJbcr+cOL7sURPwArmM48cD1mU/t\nWLgmjas/pesstO4/3LtZpdMfkP8ILjkn/lXEzKPXTw6rsoshDoW3ofYGYxOf\nutIYBpK/v89x1s0h3+iNB89WATqyOBI1EfHfMQWEDaPN6APxXXcdNwpk1kV5\n9VX1OZ4JcDhRs3uGKiNdh1hUIBoeXaqj0iMdq5nR4C1XC74+gKRU+1UGWaW2\nbG2S\r\n=Hrt+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeOc+8DRofSPZOQ19uV/Usi62jsM5Bb7bO/ejVw9RLCAiEAzIkLSDR51BD07PZrzcMiweR32srltB0Dj2aol4iMJpk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0_1584994080953_0.19823222201683777"},"_hasShrinkwrap":false},"1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.1","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ec360df32533ea7ffb666c59e364a31038da3175","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-FVXE79ojBKuodrvE5ZftrVcvDOJXDkps5urC1lZefCVI3vd4hDI7qH24MDfYWB9CeHnZTd6RfgBlBRcnsmkHbg==","shasum":"fc046da92de5158e4f661cde3832a263ba973880","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeRd1CRA9TVsSAnZWagAA3ngP/06sAopYDNVFemZLmdXH\niyTkkBLTU+zWKWYMw6Ngc8MiMSo9cXt/q6XFyfiNCMkzLKT6PuoZXLgap+Jc\n+RLOJImq09B53wqkzprIQmfXQH3IldIXBbEQc/wOEmGwuiP7iqZ71bhi5OQ4\nfNb4CA+/A0r3d7zDHKUJNUICOCiUGqOIkxf4y2mQIqQRgYbdAsdJcbEFlZIg\n4RIAglFt6u7uEMDk1INM0nWVBHKM2dKxWOQ09lJCYCOvQ1Eo9ZbeUX61nqyE\n+JYqp1l64ADikXqHUkbTJ4xYYLaHhydDqwBgPtEJMn7W5/RArj5v9XVrLnVm\nVR9GD9A16+2v1Cfk5CyWH+kzuRoHkMSJ595SKgi5upRNhPtykKvnXneOfgF2\nPbMaeSfaV3Yf1IO8vzA5m5tdleQRGSyJlLjFtT5LmkCzJYtX8/Sd60bNymIj\nzshgTFMmfkd7m7iL5ATqV1k6cHwgxrJEeGurW2+bVLqP4neigfoUx+jsWFEE\nsmuPMXTYCGYfxTC5SbjajhA7hUQIY/rwK3oKHMGfL1aMkukkdWQLNoUqcaZS\n0nQOxcsTEvKVml+M1Y0nF180KxuZakEdDASErncFq9Ths0cdPntUbLqdochJ\nzEZ7uD7sBMjE+doDC6eUmSGucTkyWsi4oWxDrX5uFktwd1vkC5JOpqKSK58y\n/1xg\r\n=4hR/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL28Sdh0eZ02lXlSWjy6XoW7pSGQbSjz5okgV3ikB6vwIhAIvQci6e9WJC/rTWklpbFD2AW6o9BynDbvO64aPIm8pz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0_1584994165623_0.3624737301675316"},"_hasShrinkwrap":false},"1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0","gitHead":"d308a43e7447b8cbe20d9d2cd852c9c891199b1f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-vX2DGZZKVvC6/dTv4KXOfH+jYJF79vxEM75yJJXwSqoLyaET1CRt43T1UbXRYAlZ0rwijNbeXcPJ4GBrckEpnw==","shasum":"5759eb56e1bd9d8b742efd49193d4fc467cb04eb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeTqOCRA9TVsSAnZWagAAZmYP/AuVlI2ZJhkUq8SRV28G\n7D2i+77eDQGSYJLxXIc75T1iGVFkwMKx3JV+sSAGcVJs8b0Nw5DDMostugSM\nBtDwQivBihTjr0KswhaUD1A+aK90Sl6AGlULHTiyTxloRpXZta1TTaM+D61D\n1ce+OFrLDiyjFc+XGZw08ATIygET90fzLfqLTrAfkIAF2r+OQgqLXiiK3y7A\nYjaYxz9vUky+JTec/Q6WMvh0Qd5bBd5UJ+RcMDsGJHihI+XE8HVe1g141iaK\nNNaGslAex00T1sFaBqthbuYFEaFEFlRGCTpqfi3BD24/aA0Xlf6SkM3Wro36\nvrcma5Tq2y7whIbcxLhjM1GQ9/zyfMEKZYIUlvxfEkHFDQfCtMg8/sN+Fb69\n60s1fhCIYziCLVEsiYrNUm2QsmJc8DXpVp7uwy++xq3cfjSX9fCxLsoP41+t\n0OCF/OGWDG6lQMQ8hqgMqYkXBGQCW5n/MS2FiLnUwYmYQp/7NPTuNNqtDKrq\ndsGZNMy/klJy41V+O7xXfKH9JngX4lDqQ35x9hi/DY06qww1H7m03TIvBVr2\nzwFR0PN5RDUGNtRTBq6UZCPA21Dv8xBROh0GKwICLa9NwJF4SQ9YSNt3F/KB\nRHmEp0AaJxXKmhkn2xYMIRsYiAtKFTPh2tUOhk1hq1gYmB3V3MdQSXpcNO4L\nkj4g\r\n=OU4B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSswbA8ARvLBiasWQiPlw05DOwfXVtABsQNMWnblAVVQIgSGOhPQwtT6waXSBYD5W7HLC5TPWVTKYzAhTGFfi87qY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0_1585003150388_0.3970337274754272"},"_hasShrinkwrap":false},"1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"85a56c0ed3471514b1e0479bd6251c364182ac31","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-A8d8V2TuADGdgDALgFuEN7AWw836vYDRN5ZmBNIsRObgkeVm3XAIEUhAuB+4GMkakWf+Wbc8JVYzWD4dGWA2TQ==","shasum":"f6ebbb228bc200dce7259a83cf13825ceb04abc7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeTrkCRA9TVsSAnZWagAAwi4P+gPtftwBqTOaQkCHiEkB\nWPQ8bk9ossPGaOYoiG89PBmXuOGLLJpI537Jlozzft71zRdw8dFVGNdQieI/\nFd0Vz+UDFnx7kIWKeJh45aNO7ZbcbHfTdVuDQ34ljT8m2HN1jHumj5GHo/NW\nxbzp6VRs7kFxyXENklyJY7vLNpMDO0fkW0uvtpJsaBN+4LOvRd75j6VC2w08\nZeqLQoWjXRvDK9KuOiS4/6gYep+v4k89PQiHldfajrWghuHM5ni6Fm9Pntu9\n2TakkBU4ZnYjXM1o3/pIP/7tr6Mqj2VdGanHBGQduz8gU/Nwdy3car4ubL5t\nAe+zAJUiZEbQicRfbuy08vH04g5i8e7HQxlBr5ivJJyWxpUuTm3tbHpDSIvx\nFz6VKhQuwzpPHVAE8zV4HghLc/FBj8bthh1+5fYP/0b/kefP3jyyNS3/G+bf\n3vxxPhj8b7cBBx840oQ61Z6vcgmAtbrMPDlzz14sK50feGtyVnR0xon7ByP5\nfkTwS1OfhrzwBrpSOlEkxABnwFWtsYeUo0CrSghd5MC+f7lf71KwacD+FpMT\nCIpyrKrNBkubldFvZprXiYTMDMAIXVmyvBdQBFoaG1NA7WPeO7aPdZdU6HzG\n5DRN41I/mzCIPJOyOV5LDXQXuVJ4mUXJ2JiQxzlHD/ekClGUvZastbvSrcbn\noLxL\r\n=CurS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMwwfTMpBELUUT6NRx28Qiaiwq/YJMuGnyvmkk4jQb5AiEA8YilOi8q4+Hq2JjQPatsJMzWx/4eocHXtNa6L15dg7E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0_1585003235547_0.4332468774046363"},"_hasShrinkwrap":false},"1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.3","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0","gitHead":"b930ec738faf4e3766e00479e1d4ac9d7db183d6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-akNHL68zVwyoy464wiQqJdX7uJfc6xAGCgPw+DntIfmAosc36lwytmqTq3DaGR0o4sQOAusipZQT7XTwfLuYBQ==","shasum":"181dc6c459c7d787c33c4865885d4e41b0588785","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeZpbCRA9TVsSAnZWagAAGLEQAJjlzzXblhOTPb3F5I23\nq5d60ZXWDPCIsc/A6XV2srf9GSMFVvSq4dtrLKWwal9n5YBwHWpx/DPoz/A2\n/KM1PIT3siygfStOw/hFEHp5FmdMUXIbucvGEnn9l/fNwe1pn5xKWsWy8JU9\nGFe5TQswL61cqpTRfcnKag8hQPMgGUaWCNCN536myyEdmRCTUvQdaQhVROYE\nnPaUrK0ExK3I1wNLQ6wG1U3cLDBNVCFBo2ZXJMRboEvM+1f/uYV+3h2AUpHI\nzsiT4f2AcOiitZaEFu8U5EU2Zb2zt/0p262vUdeK5fNECPNSnJCj08cuz5/2\nU/tN06wmrJebrLGT+sTbY5L5gVgdexgFMHI7TRzPROIbiUkujsh7rNPfgaA6\nMF34F2JXQspCA6U8/eP9iVveydkWXCQlG5GPpsf8o9inkJJtL0WwzeErym5x\nQRS78pbtrs5NVl/3F4QjMye8zQk8MmAMxORNm0CWpRqBQmE/wWeHt5ua20K+\nlIv2/jwABbl1VS+GzOaw+YtgWltQln3yWsBJEy1W3ikG2mTANWVaLoNV18vU\nQd7Gtc2rGjwB0LEGQ8KSkyD0z9zwmmOoNyIcnXEEECdOI/9nsYxNLx6COl6J\nb3dwASVsj2Wjy96ggQjZwLUKoz3shcpx9febgfd3z1Wq8s1ZNRTK6BoYRGhi\nPIzi\r\n=B9Vb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXVWI56zdUboFBPrRKfcYHXMGF2DNq+RJjNt/83H2h/AiEAgQdwArShPM69QnTQ5Q/zNMV1vrywgV9d3xCtPNNHAVk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0_1585027675311_0.6746484564136548"},"_hasShrinkwrap":false},"1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0","gitHead":"3e43edf8b7fd17aceab10fb1cd2f7f467608450c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-TO3jC4AO4Jj+kgylgbF9o+keeytTCva3GIKF4q8jUlFHBdwCnzNoJILkGHjZy4Dlek40xhF3X0PPPHwtXz71+Q==","shasum":"2c8a452d21e44acc2761bdcf43fbdc816a21308f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeew7kCRA9TVsSAnZWagAArx8P/jh1jojnSALLGfIp+xof\n6UExW5fMPiPCqTyhhnEHPKwyr7RqtwxhbOl0dC5N2bWbJoJa+Vvgxavd2o9X\nB3zS5KZKQR2k77BFOqnhj/aCjF0SSvFlhfIaZsyCwPre/NJYX2xuZi48ftUY\nWLk9hqvgN3qHkJAOmls+X0nETwlr9wFleyaHVVqckNHli4WBA2SwIHb4Vi1D\nweCwYWh5DuNQdapEGOGcs2DiH2pP4JxQr8CvDZEByv5YkWuermBBZZoRiFOI\nhq75Lg7JNy9iRrS13HhUKXH45v7dO4wmkmEMhctcUq5bSvZ4I/rbvD9RS740\nFpAOB90Z4fyIPkclmVnn+w1QGDfCjYMDuIu2LQQjckFy1GydblPf6p1tWSCe\n5BQkaWENNdHRKcttW32K1oCO6hPc7awKBOo4BNV7hANTAabCgrBX32efGUlY\nWB40yYLjn7hPP0hOQ8r7Czq3pOjn06TyZ0vPgnevq4+wIL5HvRK4iWq/NfYh\ngTKCaHkWmjpYUEW6XfhIvRuQ9Jx+3Qxqcr21pHjUt6Kcu/V83jCiD3YutEFk\nZZHI4QTD2OWsC2xrXJtdHxxSax6CzybrLprJPPT3p6qnMtQ9zGMtA30Yl+4U\nt3HGfiKeFXNIEvvsyemDtlAo6s3Wv/rCCFGfSrTfrD2IV/YZpLY5YVN+HHRP\nJmUU\r\n=7fa7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6oY9v6xquyK6cc5jzI53VZ5J8X1i9+53yxLjlnbU9EAiEAonzrYNGoW3H+Eapqt0/gDitEA82aTQe3lkC5ig49aM0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0_1585123043735_0.36414609065954595"},"_hasShrinkwrap":false},"1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4eb1baf1124ad4fff346508cdeaac46da90d335f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-KFok+tErJvlhk+gDs1UIflBr1+SiRTeeJmbquEAb3jLzHlCO+QIHQLg/ifysCPvMnGJX3CRaRX5Ml/MNcb6Xqw==","shasum":"c50b4a479e68c985eeaeca9321c6329dec39c10f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeew88CRA9TVsSAnZWagAAMO4QAIlFyT1Bw8yw3SHHFEjT\nc/65WRtZOKiQFTmexEGC99QHrdlEVUGXnbyEr7dwEWsmWBBmdsQ2VzUVODeG\n2USa70jAT/MW4wNC6cQAgXrtp/J8msY+zlQK8uWVEkaQBKzg6ar6i3hVHUjr\nPkmuVorWnFmFFND/4f+GwMEhf4mcDv4x98+6t6Y3SF13H1ENQhQN/Jhn4meC\nl6BKelnLr0n6s6wXHcfktZ33g0uU5a476LUDyM1R6mvgbBpgNVN/uInT2Vz4\n8higq73WMw+ze2d++TwYrGh15FHx+7Ke3XeXX73gMplJzBmWkAydh6KEveJm\nrUmXrokms443UACq3yeG2IXBqmuRcHgakMUSERBJW9IcviHJHbS2II5x7NEd\nvs6SRaBlnqKT3k7JRkwCp9ESwcIjTJ6TYbOq4xPcWL4QSOmpHi8O1scqpKxi\nKt5WQiXNpntCwjOFw68WXfRitHkCFuoCfBT+CzeYscVqahk9Tb3YBriHJgGf\n6UadO4yDyKM7Tq8uwBrRMtSKBaPis0QeTXJXsgG3ZetXRrL9g6msqXw0eVey\nXD2UBCuhRJ/tfFZvpkr/fssKVeqyOXAty2pwVkVii1zTL8S1Yu4xVjirHrLB\nAdCzl5FC7v1WHbG40RMtwoSsm1gQ5+ov1dxGphXsc2wTuloBHICxNm4hTc//\nvomf\r\n=zXy7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRconXlOBjH6QRLgQjLlj6bRK19qp3KcImLNLRo0wIOgIhAMF/7DKHwQM1IXYfuYjCtZ7W0+dt/JjIO/mTxWdriVkE"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0_1585123132387_0.7471505231219164"},"_hasShrinkwrap":false},"1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0","gitHead":"ed14156d1439318c0af5ba303cb6465e5b47f890","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-PubYBB9UhIks8dooYUS5dsJx2k5AC+2Lc2elg8tUUe7CRND9rDVc/7cdBVSsX4H6p9hR31kg/bdXaeMiWgdf+w==","shasum":"f5ef9b9c0c93546e7285a05102057bb41eaec2be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee54RCRA9TVsSAnZWagAAJ3EP/3l2GhM04aWz2aCgWDyw\nfL+mZkuo5JlhS3JYFgkKmyyPiiuMsJXmjZNH20tqcfQfzcldFroD5ESJCaZ+\ntsJsrVjVibqWJstbODAz9YBnqrK1KNylmzSq8KKVEaK76MUhEBD1lozDuheM\nnx291GiXWCHYERAJhslAhfjVTlGVEf/BB8BkXqGiTuC69pEBVlqLXxgCKB8V\n/6wfNxIPU3Q98G+O6BR/hIIKwc3JPEc303s+45MT2gamPKAt9/I2PMPY9YBM\n3UcRP3vedCB1zgn7gwDb5K9gt7KR/poLKwQT/75BwWk7bwZt7oL+5+CEGdEg\nM0hi2fpBxTRwOxegsiQ0LOB2weThc5WLj/MnaKbiY/SY0tgFYoQr12PFHumi\nHZB2BHJud5zHhQa7uYRvBGxYnklw4EdYSnsUg3vppbC1Hrw5W5x5h8MNhhhU\neS++Ur8EULIih6dvb11bPcHE0N/AMLovw9gMQvukp4hIf14cfZt7zbvLy2ug\n+gDlmbE0zKY8G/qerImhwnWkfFeEwH5RCkWzJE8mMMQgtSQZKtb/KazhcEaD\nDo7l0vk17fTNMCIVexzFFebGk7FB8tGfJipqqTS+80oRNh0cct7uJX4TEUm4\n/SUtBjbha2iDlum3MP6zKuc/c7Ada8bd9zUTwAnyMWv3KAKFy+x8Bazkhli6\nXKVv\r\n=O7HW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFm6UKQdI8e1Oqw44G+MIC/wMMkHxSsFuKKgKjAuifdwIgdJOxSRi61aaC/7ERW5EgXXqTGgbYQVy3IM/8hsaihcY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0_1585159696575_0.9302108025655929"},"_hasShrinkwrap":false},"1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.0","lint-staged":"^10.0.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8f2183a7fa77904cebe954356716093afac6c007","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-V/V1euQQND8oSrSim3Yj2hQMfBjwulXCJG8jA9CsjGwwPAEZQ1yctwYgaKUfxufE7XCy/lxQGufstaCQOw3AlA==","shasum":"72b3bdb58fd57de69800327a0dbb1d02a36f4a27","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee55dCRA9TVsSAnZWagAAu2YP/iMEwbCg4RfMFozcKagy\nTzUD9NrGhLNLeGX9NePU85gX/Sf3bdbt3o4U6bK0gVVnl9nMNLPmdfiWK60M\nO+vUXAmy1hRwtfeS6XyUy8TD8q3T7jfwvGYGvvFDUcrA6yjLkIhbMZw32XHy\n3XzvX2ZRdyGIDE3r1vdc5/4Pr/OD9CucxMDFdCX2Uy59eYLbLeq+PCEA3zGd\nD9ZrA8ZZhmT4BeI3uk73eBdGq3sujBev57Rdkf88suotGOBWyijoT/NVb8AD\nI7rI2T0Fw/YIQtXDWHuFRq7OsUDExUGmH931ooeGFiLH5Hy/zt1p1NoYEmNI\n9lCvAp6cG5nsQoB4LJk2HkER2uTc44fBuHkOlm+z6aXoezgXqAr26uswrNzq\n04yUU9wClssVT576VLm98rCQlykRxXMVvJ0UTlfLF8Z9ScGnGxNUfucGiz2Y\nHfS+4qT7xAJz+rgTiBD00TO5ZR/F7yrF288/E0g7YjkoldNAE6KtfDtOmy/E\njHo/1jZZi1opc473+JkOkbirmw7MEBr7B5I2poRbiHAOKn0cgdNr8ljANHT7\nroYriQVM/SCp39ai5LfGdQEFSugjNsyrxHiuIuKRnm0kJtNB0e6YKOAnCdgR\n8Gl9xNAbMiJfYy9OBrMiRhICUDSZhAKn9zLAGFMQqXC8/R0pBb2clRTJrSAE\n9YHj\r\n=RIC+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8mTKAzmUpHs2pcs2fGp9kYuKfgzzSOey4s5a4mk48KgIhAJxLcLV/m2Ad8ZrKjC238UKw6A9zm6mcbys9hdqEhRqy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0_1585159772602_0.18846592563910636"},"_hasShrinkwrap":false},"1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.0","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0","gitHead":"38a2824187f5745df469245c5a8766f8ea7370d9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-kk46ltE30RFz+SDdP0Gwe5zJVoHuz6vagmfd0w9J63Xx7otrqjR4g9wYT9rkZ7ftKipus57F1jfaZ9tFZXt/uA==","shasum":"d33cf5135dfeeedc6c1e02438b527b6c52d79291","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee57rCRA9TVsSAnZWagAA74QP/iel8cLYEQfCuSGLJ9rG\n3Dmf4kWC1qufe1OcEUq82yW9aRzOrCaYwpKMTimQtHyijq82K49/TMlEIrqM\nljDi5RDau2w9HFgeHNnZn+WB/I6mzjiDgNzh5LDp3hmGwKXWhXj476V+aLoS\npEgKFmNEcZTENGJBeMv+M7pp6IJSA7GTuk/FhgVKar4uTWbsLrhncSgLlTBg\n5WyWepovt3FQFoRAWDnGV4lkVAwldBHnu4Tlyqe0gNte2XGCeWHxzC01W2rn\nk7uV8D5++Xm/LdKB8ANpidEWEVhhCDbCnKCpnBiuj8bb1LwcP7IMfgodQMvt\ntbXeWD48x1mSVEHgerhXkBkq+tXCiub+R0cf+1yfaP0u5DJAL9OAxgLe4VIw\n32AQE5djmPL+htRpiiaY8yGEZpBl2kHykiJU2flXWMft81NzK5x2q27idTwt\nOgSNwwcHbDYy26B1wlKg2/LC5tRFrssGYvKLsegiIXExEiX9g5UJ9flFmakO\nLb1ZqyLT/qBsjto1TW8oO6/NX7ueszXRDsv8HD1FSkF3Jtm/iYvYtplnNwal\nq4vcNocKu6V4BpTVTWBGudkRP3U2YmLNlBoL8KfsN/m+XRZD+FiYfD4uO4AB\nU7ox1UJWWFHFyZbJGumowMIOYu2YznV8lfNZPHlHrelr2h+Lyd+psrsOqK1d\nu0pJ\r\n=bSZH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpHMjzSYB2j5ZcB1Z4S4Z+35mJXu+3smqsdflQMDWReAiEAskVNSBx4w+4OzNTpEgStk5Uch3LtJmUrLZfBV55PLfY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0_1585159914263_0.9817398771569301"},"_hasShrinkwrap":false},"1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.0","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"188d0c4000cfa9a96eb624550d0664c565c303bb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-I4Ub6M7eDhUFyZ9by8RIu8q7mkukswzm2nhpnuh1ohlatLAhEY6yQeuxhmIpgjQpOiap5xbuMfVRvlo2ZK+O6Q==","shasum":"385c2e60ff1f8e53c280520cf11b28d920119b3e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee582CRA9TVsSAnZWagAAz+QP+wfYgy4lHLdNJ6uASTXd\necP5HGkJld+K6leVMHJJ5uHiWvnLjC0/XM5FFqELoVkOJfUfiqw978WS40Uq\nCsJL0/3UJPX61JQFFksV/Qqg5zGuYEI53IB5dH5l9dFmFZxTCRF+vujhnUj3\n4s3V/0k6Mq2sY5bWpSfpQT7mw1L5+DEkVZsIEh2kEL0d7LgmdrDcta2OdClP\nAW2ZAnIqZrTdLZSBIbVK6nFbEb3wylu9aROc6+3Z7oO037GHvmLjD00EBkpR\nvpOp60qF+Mn58wStsjnd5tpXXNdbTZVXr8IlgRBNVpPHqaPHDI7w1L7SyCLV\n9ss/32wLNtTaNi+2EynPj2NMbeh355GM277mJPzOsBZPl47tySMT+hLML0BP\n1ZTphzGUnzpuwgnBoOrrfJCNehc0Bxl31sF9SCHYcn7dZ+J1uGODKjFLaMnC\ni2vfr3vMHzZnmg1q3mr3oie/tytzkV03pGtB9jqYEmbO0HEsvXFM9+7U3ZYP\nSdsEIid5tfzrqCMnwOjliB4XpwsJjBduTU2yLeKkSoM4zOK+p6em4/XH8lYE\nb2+39Z3Ex0dnJpevyQMU8POV+/ueGUUsGo1ZqUFLkjnVpDdupaVWUTfZAGby\n0e2P8rTRHtzTt8N78sOwXyKzw9kgJUkVcjQ9pNGghyUmZQSt4/XzXCzYbc2u\nApWH\r\n=+I0r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEC+6uxtfogbu6JA2C04AmsxFO9CSqTx5p6tdU5YqwjRAiBrJS0ZiKCMl7nHT8adkW5Iph9cLGNuI2+NvfI8cv4rIw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0_1585159990524_0.05451440208410485"},"_hasShrinkwrap":false},"1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.1","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0","gitHead":"80572a7ef260306cdbf4d5b4660f1b7958fd7226","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-evc+6dZOqiaae+XmL/46uo/k0Vwlm0huMh/WXXhGH6vGeRtHqB8uwKTobXeO8vbEUkfO7OU3+RT558JEA64yqw==","shasum":"4a7040e9b7c70b72251cf706568b5b27540a96b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefHiCCRA9TVsSAnZWagAACQoQAIV0EkkSmclh4WvCqmGv\nXK/x6GhqPiulSa2ysMYug7YAlUBF8xS5hZf9SdsKLAn+bveBbhed1FQFQTx0\n2z7Qmn9CDTIm0JgwPp0L7gFm/fhYSb5JWz+jW1b0gbiAG15jU2LdhljNiHM4\nPp+KHnlj+e+bQMZXahZM8UVVNVB7GlnSskaRSB9xxFdbulyOvyHYBWIjy0Um\nDz2/A3fjCfKfbM1P6Xp+YPs73P+C+V/3SCi78ST3QGqOb19j1a3QHKMspX0Y\nJYx/wVris8iMZMmuWQ4dRybJ1nq14JiNOJCPAZ5t+DyD7iG9yCKeDnmxCkTH\nMCxbuJRJjIfVolFuTg/iDoxrrw9fJ3ksJPEMw7oTF1c1tVcfdsdSjneu5uwj\nV/w1NJpvfLzkpwUsMaoTQq/RPc01iKvgo6e7O2OdAPY3Q8KxznLAepYNk85e\nhLMEs16e09nbDt/CAPXrqG23nTZcli7n163LY85WpyAFvT4EWOWMn8h+A19N\nCD71rYhi4XAhzVmJS6fQwscipuYvCHcqOQk1VR50ZpBCpr4SeTx/M9f/6KMi\n9C0lRuK1Ahj2qhKdGsHrB5YMm9O+/a82zJ4eDr4ebLT0LVQW2lIBH1AQtKfM\nvk41vaUOWiZ5rjR0Wf09MZ7+2Tn+ZRHqqwzMuC6B8JIZOFksYfM7o33DTYuf\nlI8s\r\n=3TtB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj+Pf5Ah+ce/0QrP8DGhmW1xJj6uIRPRPxR6d4U5bCZwIgJoxBXu2QWdwfRoqCA6q8FNUsuGPT/5Pp7s4nMfe0SqM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0_1585215618011_0.16700380999280284"},"_hasShrinkwrap":false},"1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.14","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.1","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cea8c126406fc04463e25bfa527fb6aa10d9709c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-l48gsBk8VbzbNa94y+T4CnWIUI82nhzAldGlPx1LSSxDnEXE99rwNej5y7GPe55cX+bwYChXIGBTD8DNSmVzQw==","shasum":"46426b2a3377f2f38b11d51e5be596d7a5acf37c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefHjRCRA9TVsSAnZWagAAObMP+gKLlttpiqV3cUA44dfP\nX8yxlVFHeFbzrYkPLdM9NhA2k5XnbzmPVEmkov1bhtL1zV89OCC0JA9xgI3v\n7HQ7e+yd0yYKwtyInAyuuY2P0z8DUrbQuhlaNRa1LqRkkJoeglM0YFL2YGFR\n5qXTSxodb8qC2A/8V55zUo5u4UlEr3TijywwmR5PU9cm26nP0FX/+SIp5pGc\nT6+WnXVuJ6nUEeuCyi+jnJExSD70rAOPbKxB2sg5Mn0RA7Ok7GbipM1MHP2N\nbfmtp4GkRlwDBk3o7JiVzndyMgF7gSVv2h5vwvitjEURMv98KkhFjT+v6pt6\n7vOVbBzUgn+gRyHW6Q78Mv6D2u/Ln6gG4VarBnGe9SFtXtc8zXWCLOTtqCdw\nGDRbJPZnxMF2QvID5Ga1fsmmpykZVb2t/WlzhAybunTzlBAqDoJb9u0vA9by\nt3DcWAx1V+svh8N+R5cyagUrektyTcxwaj8Q3SA6A9MxgzhmMPWtdUUbmokm\nHUP6WsFIMursOGaJxHpCxRPBt79Q9FOqGCA91KgL0NpqkX2aLYoVFMD/5J4B\nPr3KdjiuUmW62zjm6h2B5ts+Ukdra7P2K/XtAggZzJQv607iupuT6LuYwNqF\nWnZcv61Ml3TM/U0K5Ydaswp0uDOa6+pQ9qMhwQtxr071Hw76/8W2iDoXCmcp\nRaBN\r\n=B4n0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCurpwNIbXUtxumzPLqi+S2rU1mh2yrGUHdSq/GvOZQowIhAIOCB4oGr//IQ9V6vlTnjf65Lspi4CcTfn8yeZjhc+k6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0_1585215697541_0.0326211491054913"},"_hasShrinkwrap":false},"1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.1","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0","gitHead":"1760ee84c718d88073f203c9b6e2d4dd9dabc455","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-aOUMfzYunxPA5zgZaefCW5EVIr04YKXYqUP/MS41iZPe5WscxLO6fTxqIWPMj3LDZQSRP4tzSyLZTyVnPZmhUw==","shasum":"3fc1e53a3c709348b14239c030d0fc8726f8ba84","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefMqMCRA9TVsSAnZWagAAhtMP/1a4TMWJW5S2EO6QHz6R\n8sW7bQFLWIMRQXjRa61eNI3ZQOVBCJGiv4kYxOfwz8/GX5H1hX+5m3ctAhIQ\niljiIOYAzZ6TTjZuCEpTi0rHCTnAPWHivcsEOAvnx4o3dVPLKPr8K1kvDJIB\ntNPfSd2pJxYAEJ+roM8qJZlO/kfFansD3c+GIopMi0CTiFPjr2O0vvPdhcQA\nk7xowzl3t2RoGVvBpElEzlDZlPkCWKESdLClvuRujwjY0/JXl7hyMFRcyhOM\nlgOeIlIzx+T80IaQk5FSzS9+IHq4awTOyX2bIct9olZwYqv2RY6Qa+KkXi89\ncSFwy7TL0NJvFVrML5purlwrj/uwKktELPt3SklWCakUjezJaSoF95PdsnMZ\no+CB/7y6lqIlSWUrad3ag3oQNLjy/foSdEH1XGIciSHOgROHab06UbdJFoUp\nx9k4tOiv3LR0Rp16uZ+OHo2ztjag2pihpucDKyJTMaY+NGcL00pOaqcAcxy3\n+LmRJWzlpv0Rccqx/IP0UboUTKYDrSYU4nfIPLo3le1yssVE9DuXynkKIJSn\n1JspiJDjq+vkCqoAnU+sIr76ORzgp46tCH5h3O38gsaHsrSjhP+LLwJ9JkF9\nZkH0qLQn/EeOXXGemhRzhP+0bgvuLT9T936ttRmsd6RltZQQkVRS8c7RsBN6\nKwx0\r\n=GRNZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhfLBVabscnXynT0/bVp6kPJ7a2PuMHOX+dJhBJVQv1AiEAmQHSPACXu3OyiED1b+AyACIHu/st+Y3XY4j/oyIgXFI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0_1585236620365_0.7422910482714877"},"_hasShrinkwrap":false},"1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.1","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"980b72fcc6ce0e217a645f53ec702dc5c6ee2b00","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Ar9G96dbWNPYREHIWfKbdAP2v+NlSk6/YJguKQmp0HYfj4uaysZrbTqeIVG1+pwyCj4E4FkO0tCClO4obxzC2Q==","shasum":"be5a7c0cd7608b279c5abb2165d72813f1b102e6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefMrgCRA9TVsSAnZWagAAXscP/j5uCG0VLG6wYFuyWXTz\nggYaGILu2y/Tpx6o1caPNP59/VJaDKpMMWhkisV1UlZZY/0a4p5kWl0lxz4K\nNl9PT+4eM47vQUmqo9rS/CCQKUg3UDEoCug6qmWLq9DF2bKdvOzULG6MVwK2\nPFTxcWrhy28speBGTEe/TluiWVr5LpBV3s0CapRP6al0M/L+fX7Do2vy5/7K\ntBZPP6TD83dF5rl/aV9h5C5ZlMabqrGcLkMVxyUJftUJYQqIosrFji0opj0V\n+ewwLYptcvjGUWOHYgoQo8qoMGqOM3AgUQWYGLkrt1ppJ7S1O9QEkq3MUfw8\n3/LvWg7bGrYIjY2hv1jfo9mYVyyI4Aa2NS+qDcX1euWmQ03X78zKuWmVM2nG\n9qCHvRXE5acWWw2SWHXXokvJFnEU+0BGguLME7SEs7xpMv19v8fpQHOTyAKt\nd1bxXeMV5xtS5iPGpoM6EEtfbL/3jnbn2CzHHz5iU0CU72Vc8kph0KQ01SKP\nzxAge8edf77CvQB1Nd2wV8ZxXLCacb0zuAImQaJ0C18d2sYZ4IZA9IPA3C5t\nCQqyX1HAKFXSO8VqrlGCGE0Fo/x90MbLSJeMY+zGjlJxsOsKbHsqqTaTj1lr\nLi3XSjtAVFeVyZVO6xbgHVdpApoRiKfWTs8+Rvr+4LVCgsdhsSbKAXHFaQAR\nEIEW\r\n=U3ZD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIXmPzsqTibBnBSqHcDLTanIqUvdCM86bRIP7QOOFDeAIgKDLSJUYFfW6OPORDmSbpO2APdiqU8n3NheDRtpIHEX0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0_1585236703786_0.5373295443099657"},"_hasShrinkwrap":false},"1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.2","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0","gitHead":"4d621f57d2e6faae39be1545529868e29ac68865","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-T3JmcR1RAGV5QXhJ29Lsnds+3j5Fbsf7q3MqxPtqoy6pVfOovfzI2I2YyokFaAauO+MDsNy6Kn7eN9ixQs7U7g==","shasum":"3e724362e84d1116c31532482416d2b5e9007935","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefNrtCRA9TVsSAnZWagAAh8UP/AgH1SsZwWYwYojzBUmv\n6/o2iEtElMmH5793eqRr4MfU8lIvyvwIyUrrp8Xtywvf8uldhHSYAjtF79Zf\nG9LAQyF97hCxVhIOURD+Ruac+F8HNYJ1yVRcW2hoHGMNS6aiXWhCJ/xcE6J1\nsXV70xjj2mDMBTmzb2734hYejcy4+BmcmRiM/Wcsg+hPMrlPRzy+h6FsLX0c\n/gOv3RF6dgcvkwBB8ME/ynEeg34+ipZ6a2+6RIEavo9u6iIJJgsTre+9zj6l\ngosoPjrIOv3xsxwvzGCD8eBTQkcBl40qcSFP4R88dv9rM40MCi20kKYsrueW\n+4s5fabrGDqPBDJSux2Uzg2vCyKa8aaqsP3Apj5Oi3qqvO1hRNrPZgafHTIa\nO53LCQgIDgeNhVUJDq/4I6GvVQHb1UP4fnOczD31CoZsrwi2PzzJuANH9l+Z\n2QugowNCZBwsVQI2zh+sqKwG94oeRLqU+0UmN9lZkuv791Mx/QajRiz+Umiz\nm8jM2Fbstsl799avny0auNBiREayykJQyqaGDg2XWuP1+zygDyVhNl7oTuyE\nNly7n82uifeyauqcRrsxusfIz6w5YrL2mVstcDC8uyB8qqmVhXRAB9Zg0s3h\n2b2YjZN0N2OAootdrHGgyMzrJyNW9BKcIPwaIB9OuWGrF14lcCf3ncOzwHiH\nMGnf\r\n=4mXN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8A86KNlyUJqZxeDrmwXbBgcTBrvN37DwZRmRO20fGqAIhANCSVpw4emft2sEndvdX0VYzph3UvDyTXA784I1kDs6t"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0_1585240813421_0.4055567721952098"},"_hasShrinkwrap":false},"1.2.2-e885962af27652c040af2c618d57c882957f5c87.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.2","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-e885962af27652c040af2c618d57c882957f5c87.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e885962af27652c040af2c618d57c882957f5c87","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-e885962af27652c040af2c618d57c882957f5c87.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-LMIeVrruu+aSILUZTzojcRNdG2EbDeKbRL6dBDf7tGe8TbCKIGI8qRZ3Tx8pZJqD7m47cLRqUbeQtDQNm6YmLg==","shasum":"39503958fad4d379489f0870b68bd6fbc40e59f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-e885962af27652c040af2c618d57c882957f5c87.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefNtGCRA9TVsSAnZWagAAS5MP/3b9z7p9IHCgCvhN8ROi\nA/gFrywlqvtO50ub/5oE/MPFDXrFxSBqtgI1/GZjTZ7ThsB60sC4bVQt9nJw\n5Fin2HMRJFhPj6lbWJSPsYt+3gUuIY6cTWvF+ro5bZOHuNUksK4aN7gQaGom\n7QDmpCPIaNRuIZecnegRaR7giMoWPizZ0P756AnZXHAiXgn0Zhw0p7sVFrGt\nFjPM0I0EU6HuMsMC1ArHLpg63hho+AX46fpH/BLIyAvuR1yDcNrqu7CVb1D+\nXGClR6wAgeMIzWdLXc91kaqs+zCInDjos7JxMBE/7XxjuqC6s+EmbFdvleZT\nX4NOOm2PqMiE4Dg6s6I+jqWMTtFHs8RJescvdknHjetH/LJ+4DNmPiFiCsiA\nLmI9i6FZQs6re0kQDzWnOrysCRmc0nNdJU61+x5cwa/U9NJUw9S155OVfidX\n11kYH5rS5npJbk+81hR+v/QHNdkVxtkxtYLN72WosH+/XTPt/OuvrLVrRG3z\nVgEh8QCI0bziwtnEESYoFvh22i1mNCORhWvtrBSZw/4djUwC7+t8tW2q9Tsf\nuhQLTJZZf6ic4reidhEaHU494ySTZkf0CGN5F5zv+OxFHXHglE1qjWz4s/wO\nASrF4IQCo176YzjfPV5YF/dM183t8qezqrU6CH8hZ/LB998Vea9g5WkDpaQc\n1eg9\r\n=9ORz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3wWYCyuazpq5lijP20Hc9DMvyW4qvUMzzBcM1vDhv6AiBKu4tlhG0G5ibfL7mbWShY8vo/OW/pqA9+Pnzdl6dO0g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-e885962af27652c040af2c618d57c882957f5c87.0_1585240902490_0.5941182295941982"},"_hasShrinkwrap":false},"1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0","gitHead":"cc5af6526f0008609a2817c2c386d04da4757072","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-x0NIUcuXr1FLYHiG2uEwG2odsvOH64AQxZfC0P9+H//ZyRV1qh7hjuRbp1daYU+mmjZv0E59E28WrT6eOjyyRA==","shasum":"ac89df0bf5ba9e7fe9ee4b7beccad4b811474b1b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefROACRA9TVsSAnZWagAAWk0P/1Yzy9J7bnxeBH7ygwkg\nz0ovaIOFXGJR5YcxwykYS8dKUZLPVivLyORPLYcVIcUS6zYtoD+tynoXWamF\nrThE1p5m4+iCnl8zJV9LHNQJNtMQnU0h+4hVtOEEMLuMw8x26n07S1Ude6AU\ni8TPgSMS8G3tFTnFJqsiKWouQGN71vDjewU48Q+G/weKM0Mj8eMIP3nOkqol\n8FuXJzCPyfcItC4KpSSiayUxKuvuYry0N6cUWbZ4O4m4Fhc8icPZMWiWr0c1\nqcenhMWXCQhTPUUDR8ku3//ZCMwrS61ZSLpzTvGOT4+LcXk4yCLSTvCFMY2J\ncm67yRrbDNDAXOGRudtXUX5mBbn2VmcziEUp2VV6LWQ66QI6Af/3A0SteqTe\nEUtQEhmGBJzxkVnITb0sw3j4SKlTmIQ39Ws/3sYG6ts7Ur9fbrl1okEKdzEY\nmxjMWuUV0TbUYp70u3QJAIKoo8AeN9KNwYR0Gt9k+iydLkUPSEFiJEJ4Xusm\nUhKIqFrlh39JBxeyIMv5e0GyQqujhPrpyDafyWiX6Enx3lFYMqYJugNvU7EY\n+x9aOuNgNKXdS7B/uiRPIDVxsHBt2Ef9V4jkE8lOV9Io/d2yOec9fbfk4KNr\nFgfs4Tbi4QI75Yx9B2y8OtXZ5y71w4QU6zoA8pZ6zpz4yDn49E83aR2zJ1bp\nlMng\r\n=sl/H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/X0sMjD3H0Sdc2goI7VrJds0vTFuIaNCjfRE57rWESAiBxqZ8OuzUd/tt1LSUWcjENC+dm2BKhCimN+p9Nd2je4g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0_1585255295532_0.017335529642758862"},"_hasShrinkwrap":false},"1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.1"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5aadfd445bb51f52b315d375b417075aa78fe747","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-jpoZAqIxvWzPJo0BIR0xXeBvOs2Cbl1z5okhJV+nHj+UF99zwHa4vyp2lw5AFonmd3J/msS1E9fomFNv4TvH9Q==","shasum":"5cb1fd1c8c114401f8ccb8c806b7141e696ff868","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefRPVCRA9TVsSAnZWagAA+LMP/39h35aS+avVVKqhwzi6\ncAjmkikazrZuW9u17Ago5tC1aVEIyujMN8n9zQ3Ciq5tI6udnOBRx6k0EINW\nQ0sc9gV+jQKhTcY/Q2qF7mp7VkIVkbCAK+bw//82zCdxo6w/v+NcgmD3RcTH\nD7DntM+aSHlwr/f+T+gRJRclUnx/WZJxA193nfiZFxrBTfAmMemMTtO+lrST\n6EkQCy27zcqoBJfi0sSUTxcSg3KV8sHJD/4dHthm5w97t9RQHm3QpeB38qOy\nlBrJUmXZbmvLObKXHyza3P7AFCXA6a77Ej0iG0SOqRoqqn3PBwfIFww4Yg5f\nCNSIPzT4ZRjrmxeoj45UCWItGsCFcKZfPwnL3Xo4G3tMFaVsquJyhyLRKchZ\n6y+Qe/DH/MS/GDXO3v82wN/N/S80twTK7+e7z5bVDeoGnfE1gRm5TFvdgsxs\nHRrx0OLEQ3iakq07d0DL8/8xfA+7g3ani2rcj5CdFCz9PYBKwQ6ZcuDk612I\nyI9InLR0OAsB13Jfn+KKI8Z467ZzsiB/QzUFtFUdYI9SaySUMBeDZGlXQRVP\nDIvqigum62VlxL8fPyINeW9IqlRzCXBzfdBBci+Vepuroemks+CrNh81n0Ro\nh4zwszd6g64J4RBR/TniqzDZyJAD+S059fgm5ua6YZnJUnfFSXW1QQ5xjCtt\nEFYM\r\n=iJRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMsoLWcdtOUAT5rNCpTKOmV2uirn8c74RnMaQSiI2Q3gIgHpPPVERz/5/Xx0LI/ImMAag4ao5ngNjJxU9HSalVVWU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0_1585255381453_0.460551580484704"},"_hasShrinkwrap":false},"1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0","gitHead":"32810c4f55511335be07c7ddf320629b271ce13d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-X3Vb3skf9matro2tE6+6vPuhzXQqCvxz71glO3dA8hyL8bzI3DkLDo5NCKHAeeGMg6Qwz0iueloK4Obo6GpSvA==","shasum":"63ce7a52701930cc18e99ffd95a737ec6e9e5e08","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefU5GCRA9TVsSAnZWagAAO3oP/13a+qyUJXELXBg/ZwoL\nXGObje9i0swlLsZ6Yn9+HS7V6lwjv5L9VCHEy61Kq+xWAGJz3CWPnUwUv2B/\nTOQbeDWqsjkyVdhyfggE3udtrxj9p251SwqXjsrwa9IXD8auO+ZNcjBs5sV/\nunuzMz34KO3n13D83crbwJ09r0kPh04qq9wPsDZXfskue5fmQbrHkSTCaCoG\nek75jUPgxGoxsw6WAG75yPainvvL2s8Iz9kj8mrt0ry0UYV+a8+YfTPq18Ml\ny07YFUvMSEEAzj3ZfhohJcpZaVuVwdmDrinYXZE3uNtdB0hfdtwqJGa3PC9m\nnhUaJ21VtRFBcfHxj5Tc2kxfxbU3UBwmN+51Nz9JVifZeRJAkaZl4oRVo2GL\nBITA4neceXmlzk19JCsEy7k99ZBca5aAndkT0hId2Ft8RL2dqgCp8b+w5zlT\nf1zzLJU2Acg+OvAvpsUb3iyAoXwSmv15NZh4RLT8MsWpshtScdVbuFDEKHj1\nFHSshMsxLLCbkCHHx8idYTUAJNV00j0VEkb4Xf7ssmp8Jflfp0YZmx5fm2xy\nk+rrqjR1kdr7+1ljs+eXnYnhNUtqlYHAot3e96tmngN7eIjLM0IYb/uvgBhg\nIJnFIwea/Lq47nQI3CI76zoX1q71MoHWGylihEH3wFzgc833DF/m1DZiIFjz\nSWqo\r\n=lB6h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGuUlqff4ouRNoVHNF0tHiWeeb4EaCgSSVA1+htk1p1PAiBO42bsTyxepHrfporuDN+RCKUb2Fe7es/rrqAvMUb/UQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0_1585270342186_0.031637073483858025"},"_hasShrinkwrap":false},"1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b9f4255070bf8ade0ebbab502579eaf455d5dc6f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-UHR7e3Zt5ZtR8vQGkvv2RzAdiYqzg3nPQCnvafSIFzJKJpvJ8crMzr6aDHqBnrSpUfO5mzbo2gfdZS/GXNhKog==","shasum":"a7d763281b93b7b17da0208c735d526f40163ea8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0.tgz","fileCount":22,"unpackedSize":100830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefU6dCRA9TVsSAnZWagAA5pgP/jxMextjG7MMpd+hqEwK\nbeDatti5/JlwuL1sJ7BbH79JlIoncJc4zQbhv8VEntbZy1MSArgwe4im7N6U\nwzvEfJuQmwT/jCmErV+XgfrAZ+TXbo5mW6H/BFxAIZGnx6RUHiyQAb6WvYXF\n07IFMO6r+SluhQCYsIrvi2FD297Ean3/Irjq7WXuAKV7ijM1vgNBJWvjOEnz\nX1xZYkp9nx0r90XDP/iWhFnaCYOhgE2jkxlitkCV6du5QVbLVOjDWyD39dkE\nud6y3P6Z7j9QZxlHqjwlbCf3Bbt1za2rgoE32EGApiYs9pYBpykEoYCgXTMr\nr5MemirfK2UmxLEzXE7gWscoZ9icHTF8oSBil/NBYsEEpLft6M3U5ht2UWHC\nFQ/LQma/FSl5tf2YoLAKvZthqLcnCY3xCPxbRRim9MD6Yikqdcr3wkD66Wvy\ncgNqx74/vJV5BPI3+DFQX9+mvpoiMe4Yp25pc6a5S8MSJ99O50sFRA4tS27O\npC/VvbCdfW2ELAo/t4t9jwOHqoGenYLa+scYcfcJa9PF7V4FoSNTjUmdfKOQ\nKpMj+Va4AsuSexJT7JZ/MWoz3PqLF0E8OUWwL9Kr8V8yDFIHm9YYSbUV86VR\nzZfHHhYMVXj32dVtBychm93sLRTkBHZq29r+jBTlmZTDEL4ejFkDQbBiX7XV\nZx69\r\n=yEXe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQC+FflI1y7D9zBPbwjdGsvijt6YiVKsjZpfHWSwSauifAIfN1t/9U0OBmlgO12UbLeckuLrX0pJvGiF59ulDP9lJg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0_1585270429129_0.3746985961772522"},"_hasShrinkwrap":false},"1.2.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.2","gitHead":"484baac7b0dbc789d4ef77f089fa3b73aab83240","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-+d5AbF9mh7KuyRURKr5yQDMCSE0hAmPe7dNe+uxJoIs9ONhIUgmILyIk1C1ooh8+GdKshCQqykvJBDviTV0soQ==","shasum":"f753c364d17597e46d8308154138ea3094190435","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.2.tgz","fileCount":22,"unpackedSize":103559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefU6pCRA9TVsSAnZWagAAiDsP/01GiAT/oNhum4fM5AFv\nwXBSb37occaFQuPBYTYT+i8zXzJT8Q6DqE7QS/yDck4KOJ9du9PTBMG7tz9Q\nES9RJFkIka3Pxk8YBXpvY1csA/OpU0z6TTD2Bx4cJg94FWzewFCPScSC2mXO\nJuLEFp80wWOGI0OIoPqwbg4rD6ZQzkVknq6xACtT0KGPWMl0V8l7EkmV1PkL\nSgq6fcTeez83ZNYfZTyjM40GDhkI07H1HRw1xamVUjUOXpCkrVrA2m+gfK5y\nyCt7pWU1McBun+dRGX63NjttLdQbTACZVerPLjAwkHaYkmJWv2of+zEQiHxm\nD4GbIbP/wgLeba6zNPTlfE27yDu10VhbVVb1q4k7Gommuy1uA+6up0BYEus0\nwenKGb1akll9eW5PPhij6BLhL/BmoirYxBeqBTkWdGqnCkkkPzs0767oFIbY\nfYLei/2U0ZKDU8UWr0oFxqFyiUb4FYxuQH/6O+3jWHb9tHyAgyCKI8wpcFMr\npcFnxl1WdlGw+8Qa97jLVA1fNLt3XVfPnojdW+7xPGB9/wHU7EleAQemWyRx\nRDg9ltxZzG/ple9Bt4GF3raTi6BP4azWZlYESWBSQ9ONsv0K7uBO45ZTQnsV\nmsLtBZGLix9M2YWGK8uZNOFA64VF1ssSAFkW7MbO+Jqma82MKpB0KtuamfuZ\n5X0f\r\n=+vMn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuiAeXTWkjxb4tP499MAFcPFIrJMzFPSpHkjvv66HjvQIgXj4jhy2CAKDBK6ZfgJxoygCSRfqJ67xkaNIHljgalKY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.2_1585270440567_0.7112172924110023"},"_hasShrinkwrap":false},"1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.15","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"484baac7b0dbc789d4ef77f089fa3b73aab83240","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-T/mhOHa3owSqeNmU08P8PgmW/dwdL5kNLKfFdyxvhC/tMM1dgE1zInta+cjaCkdVd2wlAvmg39SJA2sHBLQFbw==","shasum":"219dac9bab078b006be0d4e4c9fe8931ee912078","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefU7HCRA9TVsSAnZWagAA3Y8P/2ny8oUPvOuSn04jeTVc\njEf76gDJqxt4L+MKktIkqRtl+6xBAEUBYvsjxmJfsfu6CP/TxWPpzosRBOfT\nUFyx6tnpiovC9+7oEocfFgyxpU27ANWon6sCukCggfj6IbBQTaXg28dVzgWq\njK8JHQMdTzdvlfJ+a41iYAt/L9d28+/nJJ2oe1YGKGSCMWYhlvmCEQJu/pF9\nWFvkU4iyOsQjzxTU1fHgdSg4YOhoZxckfA99tRtJMChE1TssG+ocAb0TSwzN\nj0tNwpdVL5s7OVQQvqg/y2LJhSTtcw758p2I5EeYX/dznw1mJhoAaLA9nLYt\nmZpC9iadRmjMBSymDttYhlNy3Hz7Xdf/bQWCl7tnGT9XFSvX9o1nungJrKcU\nkRH4JUu6p3gq/qfqSlzKJe3M2fYV+Wv95g1UNxz1eavAjjLeA3/jawkfasvJ\nZWeQIRhYjNUDvl8mqDGkpbfIqXFL4KFrscdJOfGLTtzuaeyzoKsxUPiTeWTK\nxzSYeJlnGv7KSoFRz4YEAwq8vmFwTheEH3gZmfLz16xiaWbYd5SbXyyYpNeB\ngoLHJKi0ro0y4Q86l4pIVZQUY1ns+omjeTdjM63caSwfrinO/7590yZs1RGB\n0q/+ia5crG7kU8vIjluTJKvKPWMrAZTnqVtak8dYDcIoMNSs4sW+0XUvartz\nLomy\r\n=3IWW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlXMGKpvd/6hyEIMgla34jCw93usuN5gA4RWjgucMMrQIhAP215DxwY6lanQRihmj34ri9hPq7qqVNedFESlkVJfEB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0_1585270471032_0.015446787043162047"},"_hasShrinkwrap":false},"1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0","gitHead":"99f423670bf015c5673a07d7db065d05b6827bf0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-lujpFcpvTI1ZVTVhmDD7IT3gtukA3OLPsM/tvObRQEqWm2zZcy4KjlVMSYqIjj+Z1HMz+7EHb2/uLmNStpY4jQ==","shasum":"25ce45bb0aede931fd06cc459053b88ab32e01fd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefbthCRA9TVsSAnZWagAAVLYQAJgOaOt3cxP38RYCrm84\n6y2PnS5Lp+B5FKRGi9lvRDU/HAvQjt1RErwMuPtiuVKIpWRFgh+t/irk9aB/\nKo1GSByfikfo0vQ1HlVP60QjAOMrlOKcVtdtYLyVc7H6148i6UAPr7/Z0Yx7\noRZ+ztyDxiPiDYVTxzHY95kk3z/lCXt6oVXZj6s2HN1sTpUJBc2IRbS2xTUE\n7jKvGdUsGmRoJMCugihwo77STrSfDYg1Xm5A85aZsvGygekogY3xZrIHQLKi\nMxUvc35pbO9bSGPSXRyxPjQYL0UIzD7o4lWtzk/QItyuBKESxecBMwnQ0i/b\nONIgAIHMDZNwjXyjicU5S0LzoRCMoqIOeC+eWQJ7mJbQLovcFqIwkeaTDw2v\naCCs+OKP4j0vIbIH5rIXpIe1eNRJ1pJp9sDVP7/fLoeCyM5JG18ACB49Ssyx\n9Pngru2Xx5YaP3iiPb0BFPN6VuyY2qEZ/JQ47Gr6bZsI45oi9eKcdORO5aMV\nbBuu2pcN2KHGoCDCwJe8Uqdgc9VUP77DpVzcF66MajCvJVCahZNf9UHF2KHr\nycRO/H4UVZCq4Rot00EQS3kdiXYvNtows65ordin9IwrkNgcbVfJPF3ZhCYV\ngvfo3LL7KnRY1GWu5KY1xPftGM9rD2thFHjJdN2WUTJHydztz79+UApBD47n\nl3O6\r\n=Y8bH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyIyZ7JQbufyv0HWUbR1voyWRp/zJDPmY0eJoUGqfY6AIgcZi3/6rnFxW8aM5mT8fHjTSHnV8GqdSUQtleb98uNG4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0_1585298272808_0.577874758835752"},"_hasShrinkwrap":false},"1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.4","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"27307c8e649c67646adf362ab0f5ba8993d08940","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-5SgafD9dpqceQ+Fq7L48KsSaZV8C57JgebOFPp6qCmOPc5g0w92FOlSSJYQsNlIQGYHKTuzQZb91562GrtbpsQ==","shasum":"265b5f5cfde2e2abb89faa40ccf5efa4044819c5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefbuyCRA9TVsSAnZWagAADC4P/RAMclbGk5T8LcSCEYUB\nY2pXSdN9MaOShvn11Cv0LPBr/YL3jlYbF9Sawm5IknYA5xHHJsITbfA7LjY0\nikf/NJ0iuutjBMKBLCJVYzq2FdqTFH3O2OgDk0oalwCYF0SsXYVZPK56PrJB\n7UCJCnn1CEXxXbZDSsIc3QaMqLMvKOaNZn2sR0YpxeKfCl5WLxCRsihow+Yg\nnKv/HeKv/ALexz91dGowTeUb1vwQ2msHnKGOiDKeHdfwAwy9450TV7QiCp3x\nCQ16bpJEEXijNEYuC0sThYM5eODkZ6UkuZXXGxLZNHigR3jlfTA72sIbibbf\n0DGMiC+7OlzBMKqxLqf+Y0ZxLGOcCwKFxvaY2OF8EKuFATEd19Phqf1c6hL7\nk7PwOFEghzKZrdIFtJK5QXc4RP2jwl8/NAqYcV8m7cnIQIBJ5trGMrQilmNA\nqLEKq/g7F7typWAnveHgRTMWiQyb9+efbHKPka4KukmU7hSNlG+9qvR8HPBt\n4s+4hQcOXCw+ITUmhQI2PAUTr3Npg4hJ12luWj4TUM/2qjWvqIPkXY8TNw3j\nuphzrvWVr2uaP5Ziub+c4lpJadjaeQ2sM9eHbqkDtq5nMt3Q3XM2BVxGqH0i\nIgoJDxXy9fHMIdVttSqYKjmO+gktSHnqr4Nce8qeNoEusIlAM4+WWy+oPhro\n5g/F\r\n=og8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIhjdE2Mh21HPlGA6VaupToqknEwTwsedTNlo9PuD3cAiBVkYgfK1MuDf045zlaBbDj6i5DpTBAET2Ufgs49LfL+g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0_1585298354309_0.15083646615756985"},"_hasShrinkwrap":false},"1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0","gitHead":"3bfd0b277e349bb60c87830fc16691c3e200f08d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-FGXIRvwT10udWWmRvWEUpfH6y/gp5IHRZlduTGF74yxzviMu3uz7cWMc2E2yHhis7C7s/t3XFEvw4i1jOHyMzA==","shasum":"26b70ab8624c045c6d1aa593c6e2ede8eea934db","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefjF+CRA9TVsSAnZWagAA/q8P/3f3qIeXlFpI3DaESgz6\n51bkjiYxTGD6e4TnMARSef/s6Of7/IG7CiwLLBewxO0L/uWkKPa5lkD7rpeW\n7/DlRmxiMBuH1/GCwRcCXngdftxNJV3opit7KjsiDWU0uX2vvsX+vVeswxPf\nod7M6K9I2yX5C0KIoPX7XrPdpJa55DUKv0eJZm8C52LetP7v37pDYQV4soKT\n6MFyhRiORfO0oeDs6hYNqGWJfGLozKM3AHzXFQ2Hl+y07qzjOdHLv+BxAhJx\nMkhOJ3aTKGQi8xWq+VQOeDJkOjBxF0EyjJQGQOOhhGpm+jwNOQiL8jspfOGf\n5fDmM34dzXrMui7HQVsr2I7WwRNiXEg3DrEyoxQ62SC3XlHDHhKzTbgXunRz\nZ6gxZAWd6HU/KqdVtVfOzADsCk42ZO7fKrnqqz9aRqA9ET+M2g3DTTbj+SQm\nvn92dQ6GuZBdBE89v9TxoDP/Hp2dacY7rJIsmlBH+8OQclTt8gxWbbDVEdt1\n4bz/tFYL8UrEv/jKrxGC4legsEfXEj9VXdwdeyWnfaWMhVIIFU3UliTm6ZDY\nxW2LszB0C0LfqWtWrnyFdAkOzgudNDRq6emhhRU+v9I5HSRyyv/vFq+Vhqmp\nBdtF0jFsqZwEBVGUYSWi+4E7rAcNaIG9ItspuFsU6HUpjLKpsarfsI34XpC+\nQnIp\r\n=TdEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICD97NbQLciWg2HLLZuKO+zPezser86WQWcKdGM4eP/XAiEAx1Lu5mrK09/e9dHmqjHvth1TmvnOYde0lGkBxN1bns4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0_1585328509847_0.5342644212457413"},"_hasShrinkwrap":false},"1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d64e116f10e4f090d9e27e68e80becc7c3731580","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-efBBWd1yu1NaBtH7SVEqoAk/M/rVw9e3TOxxttjNv59ckt0o8n51X3UoOksXxp6beJeemhfi5uKbc/arJk7lXw==","shasum":"1cf1e34bb4ede11f3ff6f9097df53adbe6fc5803","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefjHwCRA9TVsSAnZWagAApEMP/0bz/gplkXayL+wZC3sv\n5sTsqnqrqHF5iMhuoptdbB5/moiXzI5Sml5QaV58aWqtcrNBVxu4k0+JchN9\nHlnVmObJ9nWIBPv0QMMeeCcz6pK9jiOxVgQYgxYfk/RCn+7aLfsSBn+CqSne\nY4L0L2EXV2kzbG7MWDRQjW0oa1jBfMe6jvZ3UYY1GIjI70k4+YTpD0HHnMtv\nabgriE/PmCInWe+Nm1uDsB+6rY5cfYAmXrukRUE7d70+JQruTquZoISILgT4\nYR8BC3LM1z99lK0Qc4FEZSlnEkM0R3tIDgI9nzXlT/IZlPTXvkOK2W1OSRJn\nz/MfDQBd04p6VRJc8wBSwimaWrxXdN5rnP72ZXs4iQKTFxZcAx+KUYi2b/Rl\nyYo2ltKZZyTfTDPHmsnZ2DaRhWnEQKAhGiXOKwIwO2TO+AW5W9xocTlwbC70\nJSY9sVAbEcK7dANnL+bGYUrOKMy9MTZIZ6GQVqpxfTR0zOu4m4QND2Pff2PI\nLa1YBdwr0Li+k3dFUdVZ1qvFHKHJMt10XybjoztX/29y9m+cj6IMCVse2Reo\nvdcrnlX71ICIsdJ80N2AEs2PXugbyJIB8b85EkDCFE7o3VfLW7x/lULLb92q\nkfRoYIT4ipEcDZ9jF9zwBLJBBGPIeA8kXFnwRXtJqswlYQas/MGIY5GY5KAs\nfzwu\r\n=imMT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0lqfkTc2y+g1eP3+Lj7GBBbXLNNH7Y8dYlvpNrdNWiwIhAJYHSYkgbsZBEli+Z0PfK8weHF+GtQk4hGS93JnBeupi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0_1585328623954_0.5088269680422308"},"_hasShrinkwrap":false},"1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0","gitHead":"df90165fe8bc490a1c59f486e6c43d9ac5a1fe15","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ym25VYuxDjUjO4yo0oGzqAtKXCVL1z/E+nCSNOI+ef1j5OgJ4Aosho9O4+Na/3QJqAoZzFigpJbV3XEgvcBSDA==","shasum":"c5ed3116011ffe4ca5ce668bdc0855cf19a27a0d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegKNpCRA9TVsSAnZWagAAtpMP/RTEEfEUKyOZG+Q0DCDc\nNllTU0dAcrC3XPZmmmkKDc2dGKprnngkR6dZK4b/QgwB8JxaVX9GVZxBBhca\n9NSaBkHmkZyE1MLPJ7S+4JJLcQqY2T01dh9qR/J+Qt4Bd8EBsgozJEqrsPKr\nNASs+GMVn4S2KHIXfxJfOZCZ0QlXC0rbewWp9H80mzZlwnr956bDowBpFrbC\nijshj155fkqNntv4UH7lqRcBd1NTMmGVT2XnfGyAOikDUeff4BlU70qbhzXp\nCytJ819IEeU6IzQAkvmFEtsJG+Kzt94E54RngOzmUomDGVrPyXFY3CCnoEAq\nqdSMmID+Oaq9ZrN6pyg/KA2eILsZhZ+XrgnAUAsjfEgZWEPUmmXr9UCd6mot\n4t4yezRd7bi1JjFZYxHEiK1TW57B0MNklEVm/AmK4Vx/6a+vHlldZ0vFNaYk\naW7wwvmXHYJYUrJTI3QGI5qp0xeAhmKvEnJdwNCnuEOGY0zFJJ2Bo3QLoPX+\nAV/KGjFstVm74NRSYpbi85fABayyi7G8fHdryLvGMrj6NZiEPfcajEVzBUv1\nWvoKag5Cd9vwIcdIQMSQsJ3z31Lj1YqVldPvdp75lS5AQwZr1EH5Uu6YdD2g\nI2FG9IBSfdnWtS85wD6wZpDYEx8B2qqh9bhhviFNoaort5uW9CprZ5J5k8fA\nGtwB\r\n=/kL6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4zAFlvY7y1qhyWl/xeg6U9lhnECUPgHSphWc5EukpugIgQBT8ZC/J0OzJMXbRT36Fbe0X1konH1Y778CqyxgrXVc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0_1585488744496_0.9410110074359743"},"_hasShrinkwrap":false},"1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.3","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dc13a680ae6c31365a96eae3a3dcfc5b624a6392","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ATeYLWKELYN/HaaHXGgiAdwgd/xoMTeYPTN8bgDpfppd3hCm9GDZrs39rzdU18abCFj2eyR4jfXIp4yxrxHVBw==","shasum":"bcc61deddd0c9056e6ad202abd41a0b64b82a34d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegKOyCRA9TVsSAnZWagAAF8oP/RmXDGrVtkrVQ2jabsYm\nVG60KPUKC9Bi6mK7bstS8rSpGWbT0uaHEJXvmA13WJ3TOqWyO2vFqrQSC8Os\n4HeV6IfSs77exSeN6zCX3YyMUmGX/238oLj8nEKdCcaFf2GM8QY4RzdiIA9Z\n1RlMbQ+VHvVaTR50zGBwLOfQgTGX9Wiuy9/5h8sRAIfVvPGNAOOugr1G46OX\nEQgcUnpZcNNry6pckuHJNpOHHIg6mVH+zTKvR+vnJru/KVwXxPiMYxGQ+BqW\nHInE3XgS+T5LObrICuvYOVoYMkFSffYqHir7L9frp08EP3KbJAjXLSixD2aU\n/GsJCF/kbUiMaqxbBjUtN/50aJkpMi0sVfnwXJvff3ep6lpKbtxwvKpULDr0\nnVjX6GYm00PzZZmooEfh91XoESoIfQbLu57GZFvDAhgvEXXhc2hLlIdz9ml0\n37zGTu2aAtf5YBL2UkHbDL3c+8tRkwdW0xZiohcH3DO8XK02DYQdA7auIlxv\nG0RqXypFw5mengsJc8/YdFQj5KcAd6sqSeUMs8IDg56+2/mzCIVGQqzGM74J\n8+iuL/Qhba7VF1hCiNhnT8Ltqf3TyvdBO/s0qqYR177sxFjasi1cZp0pGiZZ\n+QijuUyGL62b7ij5ELa79wO593VLi8sEcyDZeW3d6Na3vJJkqnwbpfbZzKq1\nFXy5\r\n=+lAk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICR8a/SCVxtAsGIeK3o3k4xPHXWXT1kITNfUp/oN4Kg5AiEAvQVuRqCthQwT0B/3XivrZj9IpERamDnLoDDzwxEFgKM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0_1585488817677_0.912877629245961"},"_hasShrinkwrap":false},"1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0","gitHead":"3c79f0bc0169028cd59a447e47f80ed7d48c4580","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-TTXCk7R6ztnTFzwnvrKHwc2b34SQn+W4fOcWIep+y0uN18WpRHYiMSxhxQ0lv7u/2LXEUXzWkOmhgvHjR1ikiQ==","shasum":"331b4dc862a5ce24c5c836b5703d35f04f43c04b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegP5hCRA9TVsSAnZWagAAnAgP/ArF0N3ph7iiGBJ6TKdo\nUGHR+ShXQRlyNUFeFHy/2MagqhffJ117nzqOs9P4sSx8ZABUR6vYUvv480TB\nvB2XpqstKOdenkXgngkUALKNAxqTTkhrfG2YiZozNfMHwsYdho+rbP0Vs6oM\nODJH6TMW1y1AORCLpC18PWl+AnvThrQ+V3LHwv6WAZMYx1Gh7EFjKWebKk9x\nIPAwb75870Ybyo6F/T0t8k4QGFiQBpUtdFw6LXEz3F8pgt8AcSHhZMxUO5qI\nPh+lTWPkVuS2dHVxDxvgPSJizy9QiEL9jND5+NbL9xv0lad3XRGeaU0tXGjR\nPuP0L95DXDzg6kgwfP7O5olI3Ze2/UV0sXOkzZCqdrzLGOYIBYOGmd5POP09\nDKyDuxPRGCj2zJEpreqreX5g5FRJXfD33PmzVQJykpSXSdu9W5ab7i5Y4Ndm\n0yA9pxyZQ250k82YITUQ3U4uLmc4cOjQSYA2me0xm8eznvR+o1BxYq+SWKix\nERSRV+5YWbii+NgXwCXFjfk902VkgWNuVRcEpyZKIUN4R3Ifv46KQM4R9TI/\nqhEXi81eGdyx6fcXqniu8gW76pIjzpm/2f6H4KaSDYebpxodx4ZQFGUs9006\nbrS4u9SNh/FN3QxEXB+jz+198QfnU2FbpJIZ4dQcHXCUx9UVvr6wvl2yySBc\nHI2J\r\n=uceQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm4T6v+UMGf7skCJ2lgTUbrh/g+tu19dlKC8LtIZd6TQIgNh1LgTEo3ng+JP2c+igLqqLgs4Yt/aH8gVTdvnwQRm4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0_1585512033088_0.33184441296948886"},"_hasShrinkwrap":false},"1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6bf616493e3682d22dd1122976ba4f497904b72f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-9vYDnCxgveOzOgu5IMwTeT+XjQMYfANEiX8kJY6yCwEsDDcjoF79oW4hQ2eyI6wvXkFW5OOWs4d0L6c0Z1il1w==","shasum":"1181903b945aa8a6e08ecf198fe96cbe8be32d4c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegP63CRA9TVsSAnZWagAAYMQP/RwXi82sML98BL0AkhMl\ndidfb9CjxjrjY5ez037j4O8Hv46n/qE/Us+TYBoz045Y9pp+rdILkeoCiLfg\nFkyLCIpBUxOZjY7Npc+1bKI1ugVCWZB2rDK2a7Y6si9so9N0e28TcdS4GJa7\nWf74GmLNwCvxGlldGS443qDmCMNA5qwKmpdqIH6jU0croVlic/v032HrDsCK\nqQkkLsBHXNHWWN0KSUxDPlrZsQ4QrzD5j8Id2Ej8vRnVH9RO1rzV0FMdOv3l\njZ0AZSlWqygBl8Lm1E9vSFKGvGgFqbTmyF6dJc3Wvqb1/b4kATbI5i6819rj\ndSor5IKQHFlvlz9ZWHNwP7nmnQSzXIuLhZS15qleTegBhpV88h7IY1YhWHRv\nLUkd0UZnsfOuTMISLZygkDxJWnd4QCoQfP4hlmk1zQnJPBLneBG3I6tZmj2L\nJlY3WbIlpHE0lcvLE7ws3501aFYLcro4UAM30YQxRncyXPWx10Y8rJ2TqG9M\nuw4re758mFkjCklvl537iDj5RDeJYqlXvv5b9hPgsCbBEDowdk396UxeJ+P5\nII1x6uSWpS7QZTjh5wfMrRLFn3Pn4G5oDrc80gIWDJ68PeBAFls6xtUWLuXJ\nG+gXP2c5j7cHh2P82crYSesGF+p8OE+tiV2PkMOwYiqTnx1kOaIGXxecFwue\nztdt\r\n=lCEn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUgauYOMvhu61gpBUOCAmUfuGGWjQlb/F+vQbBVfDtJAIgXjP3WlbqPIWq/M3KMUH7F5X1nByAWPo1wXdnUrf799s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0_1585512119298_0.9309204558792084"},"_hasShrinkwrap":false},"1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0","gitHead":"f59844f1efca49bf8d777cc19f97f5fb6b6061c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-H4QMARXfZes1i41suJOx+iAyugVAOQDAPPNWp1bLB3O5SivQgR5r5SUXhoJ6A0mFNiP9L1Ex7PDKjdv1hE//3g==","shasum":"129890560557c81d7b09df67747b770ea4f04df9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegatRCRA9TVsSAnZWagAA18cP/in2gtITPs7g5enRYCMR\na9deHPPZGEmLp+Z1QD+iV7IDl1oeuZ0Kbc7jKKJwubxAmgLZCYtbhVaCM76o\nI+JQicjsz28Uf8A2xnoOtm9hracBXumQbn+dr7MM0JAIMkV2DeoYSS71UnuY\nxPFNcUnnDAGjMijbUhHdYLzzHOeP6CjsX9BB5OHTG+3QUoswScflrWDzbU0A\nLObGT0W1putgQjUxlGWocCMfzX9vjNNlyqX05q80IlnhB0TRyk8sbT0SdF1M\nIFDIFKf5pOmKI/X222UqQQxAaJ792of9K//9tGnCYXWV5Zr7o8mdPoecQ8Dr\ng+XqwhiL+6O3ih/CGTZtXELaHSCUp533CDwqa3GNv16EKQ0sYKjO8/nxE5je\ntoxvGDBX4M8XFqTbRH8jBa5LvN9TvK+mnj72QzQGNPwHSwpxcEaaxhaf64nZ\nV/UuAsP2aR4HTIDqlbfQsbxJeHnNseyRWN/ABCqLmkQxJCYXolYQk9NGVfQS\nUq9yZGh8X/m9Qk+je5m8weZukjgani4bmdGbyYQSm6iJptnzxDxAIBC4RJKu\n/Ibi3+3FXGobaHsQNvizVbzLu/zJLGzBcykr8u5nrvTXlWA1XrmgORuCvFxg\nIEaLSIQSScna6kFKnPUGRXYN45oLGDLc+a+O3Ii8Bc0xQSysw1zb7enyZzD2\n7bTz\r\n=zwOg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNDZXagf3oFyFTqmwqCI3Dv/DC1qySmuYT5H1R2Kra6wIhAO4oD73e45rHJSHrglKtZvpFbDxDJRj+fxKt40IzZvG/"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0_1585556305152_0.46426506216673347"},"_hasShrinkwrap":false},"1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.0.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1a602ea6b4bc012ff7fce2747dd73375bb639b2f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-dghnWKNbCosx1rqdN0LIkuATOmexe0apMAy0pO+IG9t7Jfier8imCm2e4J8R3+avp9MkPneKsRDNc2KQ5hhU7g==","shasum":"326e6948b54f7342b49e3a5acabdb4f91e77a524","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0.tgz","fileCount":22,"unpackedSize":103603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegaudCRA9TVsSAnZWagAAmMwP/j9XnMa4RLkSV8NB7pmt\neEY4QPQnNF0H5L5Q299OyAQIWMOJ/Z/qHQmuvb8+vvgdP9FKGWGdr7qlfwMd\nfc5RN8h7CJp6uovZaBVGhdLdq1NBdkvN+jyKKKomvElS5oqAGVdTRffoYjtj\ncVBSx1qh1nO767oOg21FzzBjgL7VLIDM9ZQMG8158EXoO8nj5Frk9bXmGP4T\nKhMErAaIiUV0ibTgrd+emKoyjWRVjhpn29VYdznYz1UOPyZV4cUtV3DesIqk\nuOecO9rFvJYEHBGrCh5lRN8KwEk/Ajo6dm10mi9ofPHq1pC7nO0H/LWXHqyZ\nYhTc91XxbSKIzcnIs0aIzlzKJ7jvGafWWkhaEyY6zlaBpHHKsbcPjR4nzaxG\n5SKWYJ/YdEvgpUK6EP+Lqm0iqLWHgSqbxjJrveVNykRl6/3slA79A7goXGzh\ndGj1Bc3cbz8/MoOKC0DPCCpmqjAijZS0r6hkiSBdE9BXxQO5cucT8mSAg5/k\nv0tdU125lp7HxYNZndxzjo1SQP7H9EIAvcAcTPe5yp0Xhn7cCAsOHlT5YP5Z\nU21uKy/bq9n6cr1v2kdihLggHIQlAbPhx4gjdXNJQVxNwKGs9W8SVhoHO1W+\nVWwymUodA5FFNW1X+oGs6hdEFt2ekLnJrHrJGoDxlWlJs7V251YwJ8oyf1l2\n+FTv\r\n=0wh9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcJY06Slq2nugsmbuF6mSXyGgAb5eDaKP8Bqo8jR6V7AiEAspwO5KrcFHdxiQxzOf8+CLfoO+WSNc6mNARkB07ssgw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0_1585556380877_0.534185496988062"},"_hasShrinkwrap":false},"1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0","gitHead":"4f065c0864cc0cd356a41130da69e9074caffc07","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-uO9d87oi8zC9Hsr/CCYLXnCYeDoUGTmB2AGwZzp+OdNDwSUkIOlu+kE1IDdDgJT//nB94bEZcdVrQDEDpBFm5g==","shasum":"d864723a583adaa32ca12f7a1102dab0752ec49c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegfjtCRA9TVsSAnZWagAAxqkP/0XulSPsiXd+WjWG/66u\nZg6DkwK/poY5DINukvWVCkv75kHKpFZ2K8fgEbQvcgnO0KBbthVE+GYy+MNT\n2mkqml2NRO1KYMCDw3jukPGtUNtQd4VmXOYB8ezZ8Ghf93dBnC2me1PBywpK\nsRukh60syG0f1IcUTQjX2H7LufJWZz4/khNxqf/Z88rhI2bCKYCYwFQjHVFz\nN+Xv62eZKdozJwrHIYulEwANwcptxmt2MjLBHB2NrlYuk9kuzQFPx5/Y80YE\nz/5lcNjtlvbqrUwOsTrY/0GurLovZk9U4RwMkMp/JrgaFTi6cs3a87oSdomn\nv7OzG4BAXFo4eb9r5ypWFDylStOPc91u7AYTQiXYm0OIg44vaNIXzWKdaP/Z\nikWNPI5GjBQPCwMF5C+Oo8EpMlFUspT3SnpcOKX6YLkPvzPgaRTl79UW4sPJ\nUEJDyfMToZ9al8i/Tf9L8vumn2vfKzk7NlSEqZd7fZ2mFksZ8OGvwrk0TwRg\nIyBdLyGB4H+iB43KrypBaIrLrsbeyL2sf2v63R9Odnu4iR+iULq8Z1ojzEdI\n9GDOZsZ1Kdkv5TRaxlbHz/eoD94IX+zR1C2vsLIu52F5VWgTKrHp9BethO9h\nz2GrQS4Co5fmZpWjogDYPahDmUrIYilXiXiOi8cJ+BhmOUGSTpkcIRC9lQN4\npQ7E\r\n=99dI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0DRb0VXKiyNlEGDadqnkOp7rGH7ov0f8gIK8Pc2znGAIgMhCnXy/a0sXhCuHNOk1Ss0W5dJ6vQAA0FQeE70xBKMg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0_1585576172933_0.4342023323618558"},"_hasShrinkwrap":false},"1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.16","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6a38cb50964d4f252ad0d200b2cb394fc669d556","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-HiDkvszmi+oWUcvvAxnuOohNKF0LAqem3ZdlPqmOW4PN3IBQ2bAjAF5ZqjfhqE3j3YdrMi1a2g0CN3KV98yk4A==","shasum":"f89047fc64a37a9c3a444902a2af254f740eb474","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegfkQCRA9TVsSAnZWagAAL4kP/0A6owLD5O2PMYhjuMi2\n4dHozZIXrbnTf7rpoxdYNRBu63u7VFGaYiZGzm6tdCPIEQb7NF+s/Bba+aaZ\nR6GsjzMFxdeudugDKTxsNDw/yKrb+Ta9Pcv93fik8bq55SWG5DbcwjAsFL2q\nd/c9xPooadntch7OPgFrF/9t28NDEhwgNVwaYrhpd3LbGsxcpPfGd0rDmnTw\nQ3L3oISRSPlKeSG9G39Wu1cz4NVta68nETY8GAZQN1YOZZl2gdmpBglC/EAp\nC3yuo4b4hkvail92zsLWmSAy8RagitofgmIbMv/ZQBx4FPaDkk7xXWIFWEuy\n7Er/6iBH/n5nT4KTPXeVEtUi9vJK8Z1J8vFFaeW/saO0YgTKmY1lTecC2j3S\ns95ITi1GdeHo4R4nmoAYhkU92Y0vQ4TN7coWq+dAJWD3Ir7uqQKbB8qUcxeu\nIFtYlwGiCCaNc1xfh6Zd9jolWkSaLYizuyDfB9GOAkhxgmrypPvP5X9RN3EP\nvTCfbGwC5mhJaXH8U2kKA8mrrgW5gzgiESFlGqXPdvC9sS0IxGCQjUssIRbu\ncb5SZ1EoMjIlugoKVFLzh3QFkfLBIG6hK6PCmhEm9zeclyAs1Z54TqanfEaR\nI3VEeU1Vbw1dYDWuFyLOCG58pG/4ME799yx9hSGuu4Rz5TEOwa4OjVaR76EJ\n7tDd\r\n=+bpn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbqqmyLsZv2wy+v2AnL6/RPGVEyelKIyu+vIf95o+aZwIhAIbiVYXMhS5X0uBHURNOnsC9WKzlEldKXPnn26ZHD0PG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0_1585576207559_0.5766428400355679"},"_hasShrinkwrap":false},"1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0","gitHead":"1a0c575adb0da31f7436e786e6d318a8a6cceaa4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-hKqHi6UHQxI2UnOvYc9cdA0ngW9K/SdZIlSfTOfEV38ZVK0iHB/5OgHK4WJKA9xV7SvcoJLvBlZC/VuQXuiyFA==","shasum":"3e9d4595867f4cd096161279632ab47ee7e7419f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegkx9CRA9TVsSAnZWagAAMWQQAJ5ozjioOFbWFyyAKGIt\nMnj81qIwuEY86EBKsZZ4YH5OKq4KPQUaC9aTtcRIKycXRM2y5f+D7BNP4m3P\njvzhGV8JWt/C970Tyy607y/FAFsfAX1Xa9NtoobN4CLJWdHHL8yByWQ4tbDW\nwl1WspMYeQLy/vl57lxa1mQ5DS8FmEyoanh27q13UqfUpM2QT/S4OK8Z1JiZ\nMLC5aezc4DkK1SLqsW4gfv4/KVmlX+/kNS3Xh7RfHaL2091wr1gkvm5n0qvW\n/FYNaQ98j/5XxBL/XIWFqW+O0aw25BmkvpH14LAWfEMX6c+BGDZ7ETPSyOgq\n6BUrSEBBqKkNwioZg+AU+CiE7LpJAy3hfaQNxFUpxewPdnCHkgWcLsX9qyNZ\nTLb1Ckxndb+p6oiZaZ8/w6RR6L99kE6GBK1c0phBjn3IW7KDGfu8GDUfKSCU\nEWo/2Z5JuLvs/4bCgpYcBK5WvOdXsBsMXrhsV+oZQoDYzbBlyVx1Uvet1shM\nkHPNtwp/6u6aygzSbxtGzJyQRQ1NKTLp+yQ0v4XcYLqYCHiU56oviy2rZg4K\nkam6qnjwFd0hZDlADG4RrS5BhLtwszFrXeYRvAqsd76EvBRR2OYQ/XLKBCA5\nzcb2g+Y/K3cFCIBjijyc4LC13iH2tuAJwM8Nbd8s7p5dYAPqKtOB5YXe2HAn\nWQbR\r\n=2POR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDT8jcFr1Td9bbI8zt1OjJfB76BMrmWXxmpB1gMttPamAIgS8W6ArDdHip79m9e5o45RTU3zXg+hSmPXAJRimv0y28="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0_1585597565345_0.5401356417899776"},"_hasShrinkwrap":false},"1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.5","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ad10748c8cf707d76f3381fd1514f2288ab75938","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-W8CBv6LKuZPLdJ6ZpIklEd63TWcbmpUBekp6IKqadKcsRJLVHq4IwemGcfsW0lf3NT8LQJLNMc6oiyfhBblgpA==","shasum":"b153b97edd5487f409d0cabd68321bde1bfbc628","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegkziCRA9TVsSAnZWagAAbEYP/0p0+8feGPNDc3BlamQQ\n9/dfcFmrMg0KXfVJtnME9pDoLQ3YEJwMEOxBpp8hWheyn6mCqXKJXhSOWDNo\nRQuE/lw83OBNo269G3LwcJAiRX/56ocBRY2mGLbZE/KLcVDiIb2YYP4zBWgm\nvvEqosrK570i09BzaOr8EAknuY452hxYdSGVpMDwePSqEOMtDSHfnjTcCJsn\nQ3a+oFTHSatnhA9uMt1zkzue3Rep115z4gnDrBaAaG2w1n7xi9rQ60G0ow6G\nS2DAC0CgwT+e3w0r+MGL3QnNYte1INJKO6XfDFzMFY45qvwFB3tg/nyZvUzw\nd2YkMN/x9HAlNHxmhPLhP54G2FSvJcCc3MLCVnlGRceCs0CmldvazC5Wz0us\n6LIAl4ZteP6c+nG2p64/JbYlU6JnB1w+jrXlfoZAXDNpTWCoafs3IyVzdXNe\nuKYNkLTHnET6OQC4D85cc1kfpNHF7khSrGIetg99YNUu/kqshfooGJK4CrU5\nXEEU/lOk31X/ml+tWrL/uARMzMVYp69Z3QZ/vWxUb8B3M2n/hTrusDRIbHbm\nUVQqAjJsKojiehoKV6V1WvCFR+gCcS7pUu8CUEnyZSb1xXtDFsLmVW8ZWNCs\nVUQEOjWzkwbmM5Y8QjkFtKW5REe2otfMlm3xiMtRZZGvi/h9RqCl6lkFGF8f\nYapS\r\n=9MAv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRARTea1ivEc5cm8HhQzfmwTtfn+WU+M2174l7JeyVYAIhAL/WCt0s0PS7J69BvmzLBFBLPctL4ZtSqOiFxOfD3StP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0_1585597665395_0.8111449712169991"},"_hasShrinkwrap":false},"1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.6","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0","gitHead":"42b6c525524d7117c74c1474e12f9e374ffdf585","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-FLcD0yS4HMjqh41VLLQR8eUkjzBAwi2Szk6xm7tVqGtZEQhhJpvcIpS3FA4c0GYhM0bMiifJO3OXb/a6KUk7Xg==","shasum":"cc4a1c8b748b55d387b815a69cca8484cd7fb3b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegnOlCRA9TVsSAnZWagAAs98P/3nzO14Yc2k5yeKPWT83\nHCwJwdfF4NTzXUzlBS2T4n3fTir5UqiIaauAhagM6PbTmzujjyulKkSR4s7m\nev6AnA21ViiO132vqA2dMrkAe5Z5D5AB3yQuNfnZOHnQfTfSJfvc+Szq7m3W\nJhBseir8+mR+xO2RI59c9Yu706RLFDComCXveFrQgoVpnEhUZi81avkgH0e8\nZh1UTnwC3+MD7sDcSjvUOR8bZSTQ/ITbQDM4njtEPNg8n7VqaPicHvFRFlB/\nuCyILqUlf53r4dGkhcegtxDDqzKpGTbQHGNvgH/9W7XUMUuutmpL830rz0WR\nF4C2imCe1kUd00/2mmp0a0vJWg72WQZPonRNpffEQIpXN42SHLOa+MqaAyOq\n67QNU6Es1Pfl72b+FwsYNYPmWbHXN6bBvlYOczCdgl7zc988mCx1EIzNp1Q6\nMNGYCzGgBKgMufrDwxv5xQIb6Nu7FFA76v4iadRZ3P5c8z10wxX+Bvnzn9hl\nBwzKLmYDMZ0x9jVR1AtUQjmGtMlm+h59d0Yu+ykVYpejSYl1NKh1RUGCkq4w\nUM4Eiq7J1lPxupVarnxfMMRsJ5H9uiN6ay8+ixJ9lyix8x7yMjMv5NwubpMg\ntVaFbQVRbD60G7JA2R2GTrg2pgfN29wIeS0TsBRNcewQXRuJE3djdTT9qA2B\njlB5\r\n=PXT4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATNPeW1LG9Dad1/d5Tser7Lp17Te18gl5svGUOnKHZnAiAayKhVO+5ZEsJSYALYxT0KElmCG9H2kToxLmcHL2kgQA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0_1585607589251_0.8417223429413356"},"_hasShrinkwrap":false},"1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.6","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c3f694c967387f653b83c79def343ba07e19c5d7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-SVnnrfMVVaGi4ixashQFiRz4llXDU6Kw5gF8PGmVou82kycLXyYLPU8ODaYHXhSpj/E39N6uJe46nv8xxeU9ew==","shasum":"e2f7e908a2f7a1c3c9c8b9f6a56ef0d1b66ec774","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegnP0CRA9TVsSAnZWagAAL84P/iDt5x+BGWHdKsPceEeI\nkbnjNvBSs1/yO3qwUAlkzX0yIwWOemgg5IraEi7CIuEY1Kqk6PJnK7lFtO/p\nRSn3N1XwI5eYwr3SRf8weN+nkG5hydMU6teA0lntJXESavUFGXmcFcTfNj7X\nIDGuCJYlWf+QGjsC7iX3COuYRUzvLwXWIsfLOk9pYrwVttCP0esBREHaeZWS\nygOds9uiPKql+8d+i6SHtEiOslBQR+vAuBQBONAlnwzurDMaRZiKLrCsSIs5\nJfkrzaF+khLu1dUFkwezxwQtW19EXh3QgCFhSf7Lj0d/kJh64YLQ40AbMkH0\n8pXlTxls3y/zObsfBO63fVRfQergVDDktz6+njexIQIq/AgpDnmiV+NBfkTK\nJDyCCZ7tvbowlYOrYG7g3QaGpXqzTJNMu6QWb5geUDUXM1IGcifnB6bCvH9s\nMUEaRv3ULhbRfLH9Y0lmbFAw/oQu5rsIdTWrXrWZxPWuRHX0wubodVBO0xT1\nBGufGhFtmfz1vYNoEFWTJEu1kWXNLMFFp9+gwbquRsjKO7Y10h28TW+kcKeK\nll5/rsVmfsCHYlcygda9Y6tmYKgk33Rwd4BaqmaXL0daXIfsjR1+e2u+KPIC\n6EvpEiUoFGnZPqr3yH187D8EJD7URSJL77hHa7LJ1iX3AGa6enoupGYnHexa\nhvsU\r\n=8m3X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSlH0PT9yxE4R7RI7I5AROm3IyeDsYL6KKRTX+G79q0gIgWmr8mMXGhr20QECVwyc0OZXEFSk3vTcWDwxammRQRd8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0_1585607668144_0.8149633347312253"},"_hasShrinkwrap":false},"1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0","gitHead":"c9ea25a20ff4aed03c2f6e684de3b061c7eaf186","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-MFO4j17KLBGXjmYIGypZ6tbwwDAZqqwi2pfdxYCrL8KYvGGzc5vjp3SGx8hM6wCk5y4ImqtCsQdjgnzp96VuQQ==","shasum":"25b0429c478cd2772e15ec9e040c2abf0abfd59c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegoF4CRA9TVsSAnZWagAAgFYP/0J2y1S/m41lpZiaFkTR\n7Ho9A7p4bGkD/1k8Zjih7YF5Tqa8Ew04gQ6pEAI2xcieMva5SN4qLt7fyaQI\nQc7DOiAP7FBy0IFdbHaJPg/ys14/yCrrBLwU6MdqMkkuHkHRkeu0IkB57gr9\ndCPlXcSDiCzdZ8dWh2OkfR8xPQViV66Mo4ZsNmmIjwUbyvUi5mrvB0695yvp\nF0x328aqwIL1hFmNZhXd5QjX81hhgvxrNuxePm0RYZwWm8Cr+lrEwtVGIzCK\nViKsM9DmxQrLkY8KdRW29pP8PM++/GlXYI9x9yczyOevOMWKpOByxvF61699\nSO4jYynpjw/gEpoC2Lyx/OFmI9l/hTXrSG2c9MWLY9tmlhQvTCM4cZxhYLYr\nnVY0dw5aiGTQR3tMA0mgvO70VGqY3+LlfOpwtxiH7xtibywg2jAxK8NK/hsn\nLCWuzrIppCKtduXj4DCNyndeU4nb0gmJ/OpYkgKb5mSMcvwBa7sH8esTO1Zo\nPLB6dZmGptyhO+71o9sE7UU7O/nzlSCLIrXxJu7XDNp6p6VkrUUsGAoEm3GE\n/3qkZf2pjvCSHtfGDAg2hPmOLPTK+EYhJJNaQJDhYOc4ujjhlmlezMgbCBBv\nFhFRwmqRqC8gA14hQIr0uBieyrjrWLinEUCeK/fmXsKXblcT0aaaZved9MsQ\nnxXV\r\n=TxLn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfPY/VeOMOsgy2CEPtPfCu9l3CR5nWCxcS7gNLKi0CvAiEApkIUc4HyWm9VdmaYLtxcnGDqFfU3H9MNMah9O1Ie9js="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0_1585611128317_0.7491398991038496"},"_hasShrinkwrap":false},"1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.7","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b0b896a6aa10ee894325cd7f9a8fc9542f566b2d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ZsYWC8fVmWI4a9R8mD5xYVHW+eKYarePbLQpHzb5JeY4PjZ2FR+/0UL0q0w+wgIW2HGRk8ZGoJfd7Kv5LY9ARA==","shasum":"aafa036c5bfe0a2136e2a506abe5aded8c23122d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegoHKCRA9TVsSAnZWagAAFNMQAJYW6977undFZTykXfBn\nwV34GiuWt52T6NfXyRwLitQhWwCE2vTuqu2wO+vBp07l9Huf/yBuxo4Utxwo\n6VoZo8tnNbYIHj9LGpZcb3CQwgf5RF5F+nob5vZ3QMeJOWifUC4kJkImVlwk\nGKYgBdaz5muVYAX9kM5FVTJt5MdKmxkdiBJ5mKQwP1wHLGcarMimIOLS3TS7\nkeoG85AamZDmZhWT8AIHPxiU9gdNs+YxAjU/m0d6JYj9dFj7EGX5BMs+c3ai\np0DRFMeZo3vxqmg1SnKfqmtwuTHVab0fo8XiDkXbLRN+7CClQpBjwCdWclf2\n5fE9n5/l37p+ESoekH9OzIHPoQ4jWZ1F50j/uHf7y7L1uksG9DE6xkyjmZAv\nzOvdbzArKDNeqMhihQJGc1KKXsqeNW9S/6XseE42y3dnDAKGKuXpkgGxojJn\nTGBYUmJU6AttpV+lri9Q3TmyCYQu9EkQM6AOAc5ZYcMol2rPc4y1QHxW00hw\n4zs3xs7eF7fA64XUqgtJvAvqfOFjggIooxanH43Vc4Ys/7qULG4yYAiQ3G4J\nMkNvyEhab2Mx1GHo2EXZz7FlsTtzl53lepRRSv2uHqdygEsFcMrx5NkyFUSf\noFYUAYw+iyiPnjz5f0Qnbv0jTJtkzVe3sWRK/yh2Au0XgydDdfBIL2sEMrP8\nR5bq\r\n=0vcQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGGj3cS4uV+wmAJV9zJ5BUdqbXAGz5owwGZFVPdIZwjAiEAz5+EBlylKWVFVD+jGp8G3w22EvWkGpAWyLqoyE1dajk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0_1585611209828_0.1139590732648812"},"_hasShrinkwrap":false},"1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0","gitHead":"12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-KFn6crD20dkRnyXpZNb8hvZVRI588eXHE5nSTFIYXijYU4lpZq/T6Qo5r3frx21shO+ip1fPtGkRHiJGfInS3w==","shasum":"c8dd88821a98e5ba75434f295578e17b0b616bf1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegohXCRA9TVsSAnZWagAAPr0P/2YE5F4h8tWa1CbDBDab\nqQTQy2Th9GbdMqSDP7MYmikyN5P7OlbRkzKb5vpENIMEDl6rBC7rLB1ETDOn\nG0WDkPw4WhggncbIRZKsYp2Du00VPsNxtMgQ0sNfs+UDMlZK4WujQ9f4xxvX\nrHosHP2hNzM4CRGFeWIZiSu83FyTBfCPQp59etRX9VLCrA/3BkPowobjctpk\nQD+tTSfvB28HbJ6cbbHFAVkhwiqrVUvF4+IeYUT/FzVkzaQR28mBJ8i+FzFL\npZ/qFVWDCm4XEsImUytIcCI2eZ3B2hoh5W4tk1gNYJ4se96e1bx7pXa/aS+E\nVL3QOHbCqCpUJWrdFw9yxI0tzkOp66u9ThU3qNObTGy/8ugC8QbpSDpK3GYB\nABt3PsF31EB5WO/PvJZ59KVzMK2W0UJWSsVKcJ/l+5NF8e76rxaYUDVVDfhM\nE2ODn8moMm9HsAvKzCkwYOzYZ1c1VpVkDfxknssAuaS0SCIMy+dtHZv7br5G\nbfMeXf8p/lkd8QKPtj/c7EXXZMgG7NthgeZosWL24oT118Bnnf/zDQU8nnYD\nsmhC+jpLP+HeaVM8s53RFhzI+DQu8qNU43F0cVSODTW2un/I01hRMZ2KbdH2\nhdsIggnODJvAetvrCLVM83rTf+N0gGPjIab6J+XcoBxYXOkhqUGzw0kzWwxF\nZbYM\r\n=1XT1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHP40n5CTrMY+RLuzxCzB5dbAzH9GLLzAc1acfDUSylaAiB9ToMCk6QeRx7rjgSdUjPl1lsIexv7ty237Y59xaQbZg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0_1585612886824_0.2478306598914064"},"_hasShrinkwrap":false},"1.2.3-003296202731b0e2ae41452506b364f990256b25.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-003296202731b0e2ae41452506b364f990256b25.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"003296202731b0e2ae41452506b364f990256b25","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-003296202731b0e2ae41452506b364f990256b25.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-tNc/+71DRsSQqX8N41/8X9jCIMUnEXHIh/JCLvMnoeKXWEwYSGuSsf6D9EixSGR5KkGWjmmFbe5I5esP9u7KIg==","shasum":"5be60a98ec586efc1dab24967a069ab3f71e1411","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-003296202731b0e2ae41452506b364f990256b25.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegojvCRA9TVsSAnZWagAAQ38P/0sIhQHr2+UyH1g/4iiw\nwPWNJiDx7C9L64Il0cvHa6ts9k/cxf1EU/nEnLSQupMkHg5Dkb89dCu/P53P\ndvJXqRtW6XUZZVrRFuuNZY5Q9AB0x1ZxqjAH/TySsP0BqxeMwYsMz/1cXi5q\nGe25A2VGouWWhaw34InvYwZhErPF+TJlsLyFdkWGnnlten2NlCcVcmX2PDCG\n9RtDyKyQRcJo+kmaYBIqZvUOu+Kdf3y8rz1e2SRXcMBWRKhfH5uoRGqC0Jqe\nOseopZiD76K6+1izpJ7A4uAkkHKASTzoW2gYP58aqtpFtHIVcsgYK2zrftwN\nXMa8osFanVlhKTkjkYqq/35vN2i1sQoTwhZ4J36G9DUa46r+C6wkGrj1wkDj\nqcambsPLs8aVN/+oZ5MfE9oUzJCyYhHYMV0ELmHmSn8tTLYogooQrpMwH7+M\ndzxSu4XZdsVNNoATDNncGP3L9C4/fLj1czbmH6QkRnPHjqrasoqO9Gshfgqk\nDj6Tb/H2SULwqvtGmDU2VGyfFWRYBb0Wg80solDhOdA8mEaOv6FEkHYY9Fhj\nlc6obYfv1BeEqbQTZDaINdo0Lvc2F4n7SbvYUHHn22K2lKRW/y2iateltVGO\n2rOtfqnUWnWALpeg44h9Ct9E+Gui+thsbkOQsBrBPFV0KzJ968dFZsTdMakl\nTIGk\r\n=KPkp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFubalGZIeRtY7qc09YvRVfQiN3AIfggXJyDHEQjV20JAiEAtG2vL1tSS0R1FVoDMTK6KYrEsWRDDyn/AsMBdSfPXwI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-003296202731b0e2ae41452506b364f990256b25.0_1585613038592_0.7013098588760214"},"_hasShrinkwrap":false},"1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0","gitHead":"5094471617d65b5b4b3282767056c3bf8064aae7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-pEsDg/ZF6qw24P8ZTDOWVJYKgDMTtQYskMUk6gfCIi3UEHphgmnQGNDef68oIim9zdGmS0l40IpY4kL95yVtjQ==","shasum":"97abed65bfcac2b6bbe7fe6ac09746be373aac98","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg03UCRA9TVsSAnZWagAAstcP/iKThVILQsLXQFPckeXQ\nhIpTi+w6JDtJb6nur1CTrHIY/jDEK54ZxiAgaIDWtY2zoV19ct5JERVkFvJj\nSn9xRsd0Z/cJjj+h5XN6r9GSgyf8m7vlABHB9NkY+EIQsqCeHjDBTN6rk/ex\nMGdd2AoIXsEmDfpekm5DM+qkdRgrhXaeMky/EjVs/9HazZNYVeSagQwehlNg\nCWWajdulKc6y0a1tFM9SdzWgOLzhwccpelj1s2klDjUqval5N3AR3Tu8bJSo\nwKpKAG5sTlXmrF33USutsbbbVLKnnkqzWkE1u30RwWWhp2YMQ2mAiM5fC5EJ\nJOhuD6UizT+zjQcp8kaYMna2qBj7+p9lpknvJBCqbrujkjeDecQdzDUZM/Nr\nq6hofgPJE4vkfuHCW8sK5K6XCalH3LCppPnUDRvplJW57FiXzcEPQ1ZjX3Qw\nEqQJr7qshxXP98r39x8wwA6SzE/HxNsMhKuL0CsY+Dx52aeRlAFTw5I+o4wa\n71cVqg5bEvYsufyfwbQovB/cYWVYPAmq4IkD1GDhVF36f1qAinh1HF/CQ0Vv\n11seVwQJJap7WSG/rBnJNwAErFH1ARAu4ZemvEzFOsYHmaDWvRhGD8tbUr85\nQBAs4qOwmtuqNUMKbblQhTUltzs/85utSQVw1gpo2gxbCQ4LB3HXTFj+a2Ja\nmLPj\r\n=/624\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/XM3eslwfViqnhRuNFlBRt3cOCvd0UC5jF7p/zPj3OwIgT26CE9lF84JnlPA1FlRAy9+8hq7O9EDRbrzXoIx/4nI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0_1585663443783_0.8070615549742175"},"_hasShrinkwrap":false},"1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.2"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"993568b48167643d9d9f26c6a44dfba3818764ac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-5RxzAqQS7PczH8osthTVvUDURT6a8EGLZ44suYX/DcEqDJ0JlxcZxBrW2g8fuZAKUqx6qDjiMpYVIWLzU9JnRg==","shasum":"fc0a73bf338cf177c89c2c8c17ca0aa4444d8e74","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg04rCRA9TVsSAnZWagAAEYUP/Al7XbxlhYUsrYZSBixt\n2P83yyv5ZNixW4qO31EoWEezAXiVFThf5uKacONies6jarEmxnbB7Gzsxyny\nSReOkMSx0q/iFVZr8u8NOATZqxRYZVZA4D/DMZr8qW8t4+hjnn7GL053juK+\nAxlKsepIBn+SyiB2KPTiw4l8TubX9twlYcryNNhf9lVlYqf/NT/dGLHEG3u7\nmmmiaX7gCXfSWgTvb31ywpBkyVIfFTNo+/KjSwcxwb/DEsH/d8jhxLxfmYr+\nCb23swshXYk+Je6QVmfVV9Bp6MqRrw4xMfLLt5SO3+zkR8utGgqhrIZb6jMa\n7cYqqlRF8a+HjO+8wTnF659WCGuj1AXx2fTzHbJqb6QcZgs04+hQ4VNByBUI\n26MoUS0bcQAf2bD80hqqhP26YDX/Pp8Dl6pcLfw/kKB2POpuscXH3ShKbRRA\nIuqvR0VBOsMDSCt/cgHxKxPb8r0BvgGL2OHbJr57dghPURizhq3kgMxC0KeA\nU5D2ERDntBaT4vr1Luh4kdu79ZcLcO/1x/GlPQOtku+NFPhhkSYFSSVF8bBn\nyZFj04u0BpOq37uxccsCVrt0mkKEZEoIFHHWyJaaLBvBAXRpxHho06HF9QfL\nldzp3A9lWO54lIvDXo/YktBtO1qxEg60ijo8gaUcHD7PBZBcDgNiDJddTd8s\nWjum\r\n=rM5V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwuxezbuUlM64XTjFnM38s9dTpAesuWMsZNY58J1SB+wIgCEDUlvX/CQ39jmBu+F1X76TT1CPAqPGB6mc/kqA/8pE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0_1585663530692_0.011122806425958753"},"_hasShrinkwrap":false},"1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0","gitHead":"7163c63e6f01354a0680edfc32fdb04f1c907288","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-BAhKZ/jXXtc7MPpgf7HIpX6h6hDM4V0oAgmzUlisnfKXYZDPXTfrNQpI7klctbbC/jZ4tSNmGOr9FW/5Eu/wRA==","shasum":"37317ac1580ea2756b4625fb2c350275f1f01ca2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg536CRA9TVsSAnZWagAAj9QP/irisXX3chpvqw3DcBOy\nin/tCzxspEaQtRNtfwnlzZugk3QWpe0EyG5FECP0FrOx7WffJsh7TYmejwAS\n67bE7APOgUs4iZ96xKWkl7GjsfdOyVFpdWKqHSXBel8sQGOqPqmX3iSw3gIy\nZs4UHKgxcBYLtjCz56d3k6cW5CCOhiB0k6MkDdM60up09Mru68tYWw0vHImD\nXk/yRRaM8VJEoYZSRuexVk2GSCt99kBH6oKvTqKGYhJf5sDcG/zjBleAv38z\naa8et/6KZqqyieQGZoWTsKuyH72xcXw5PFjmM142SoUi3TztnsTvDCRWgrr0\nDEtBw/OR3gC1m5Mma2YqGgdm/gsv6voKbO5jXyB2qe+rSNSZJ+Q6wQwA59LE\njlNfQka0Ys9RlCLrGZQ1P3BuP91zkMI7nnCgaQ5HbOI6dlyXIMD0Opv2lLb0\n/m8WtBNf4O3TYr4v9tXhbk8bGLkFGk33hjjDs9H5n9OjrrCqDVMVUOz4jpUt\nL1fS1O36DFLug5ooFN5twsplZ8WlRlOZvrsAuGHmsy0vnAQyuvIXpiCUfdYv\nDEIL0gmMGdEOxIrAVx3ZJvOHRqK+RwkACR27GZeLB94dMJM8kLlGkDKFYxT/\nORkYEMw34sijXsNcKYzxqjogqTPqpUC+TQui7PIs0rGIPvxJldbOg9TP5SEs\nc6vI\r\n=BSfP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQhEyM/4TQPNJzJN1pcB36rFWTqgxxeZyI9ONkqQ/cJAiEAuc5F2fAtlLwi/DMTLogHC60ohLsZWtsayzvw2/sgBig="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0_1585683962228_0.597244710636728"},"_hasShrinkwrap":false},"1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b52e5438f8c631be3f88d5ee825742d978cb9d57","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-BTl06cq8d2Azw2UlwWSlP6yFNy/ZOhivZpXafFv9qtREr4UBn4Xm22ngkqFVYlo08NL3cgWmoeD+2hen3qsrcA==","shasum":"e37c1c319249306ea8c49ce4a4ebdcd4532ee475","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0.tgz","fileCount":22,"unpackedSize":103602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg55MCRA9TVsSAnZWagAAK74P/1Q6q1ytCUOUXHhgcT0U\nitZY0/toDsBJMNiJUL2Ov0h00OrooIWMDmdbZcN9IywlXDi0umQj9uqj20UF\noGiMQaa1W/UOJFBLv2Kcq8VbfNd70UamDdOwLDN5zZpMf8qjBf9AhChKTTTh\nHFnGbRzcWPlTlUTeSpUOgbbwO+3CnfsTr6D5ORvuq/wDR4aJGh7evFr66UQg\nPSX3QpqXzzIr2JSRFSg3/YozkVLGzoqpw5jLw3F/wjUNvSQLfxl7w7LP6x/P\ng8QPwESLd7lednqJXHHr7TW6wHn1D4axVzExd04vVNTr7erws7fBMwsdQdND\npbx/mJm1HsyDAemAAChMyR7AvSMvy3h1hFgni6un6LzLEj7Lya3Nsbb+eiaZ\nrwlCplKlTOvOT2vEHKtB8bdmK0FcvxyVrpWa1h/0Le8vl5atJzQaLEATwaSv\nMIM66i3vktgExRY9qmY4vicaYWJaqN2jap6BAcGH3+/KLqv+FG8P+zgYszjD\nMDHIo6JhI4TanrDnhO84t9rj51j48FuhYANeiQd5WJRQC8igZldO0PH535G7\nOB+bsGKhy5q6o4zjvclH07Jj/4u9dYCpWbTI6xp6eCE22Ttb+roVMYVtuj5M\nosEL3VHlWMSAh/+QA7uQebBFRW2k/gHeT0axfU2VPKE21OABwd+afWwhbzb2\nZOe/\r\n=7HrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIw4CBnZwMJyUWhzTftnkoeUGO0hOvDzuhTcsatBQfgAiEAu6v5p6N+SArxePsjuUUvxlKQPy4Y/tTCoklDjLc+R7U="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0_1585684044377_0.7144491188558573"},"_hasShrinkwrap":false},"1.2.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.3","gitHead":"ed956ac86a88875415e97b45a5d73af3ff1bb52d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.3","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-TusYaEcMid6BR7+UbqzCHOmxW5FsP/a5vNOZbycyocXB3mV8Q7WLgzgNaf/xWcm/3damzmfoFSrX/JUaa0mDxg==","shasum":"a3203e9c8041aea82f2b2753fe43d0cf4b9fbfd3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.3.tgz","fileCount":22,"unpackedSize":105696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg55eCRA9TVsSAnZWagAAuQwP/Aq1GY7yfWQNKLsh45ZF\nKCgRrJ7Zgi5EMrChrQt3NjJbIIHAwxVbXuM+UCRZzJFCPgv3p0pqRS3o8hFO\npbVT1MkDlYPZFvdw6FGiBzKsSOPNpbo13S0BGH/m4qUfd6Izj2dmc4yZjSRE\ncFNX38wuy5jFClVLcgkG2N5DlnXCLiW2p0QpyMrXGlk9Ko1MaRajoQtWQ4au\nW7Hzy92N/27CLOmHH0z+nD54uv2SIA+dp0s+JEcozGvL0DuoM4FnVeEY3O+v\nTrormtpD29TRwvmXtpUij9H8vdA4AfKoswWImDlJHn+7In036iCNRen27cAm\n7meAhJTS3IKX8J0E+lXO5GrSMW/gINsjgQpt6OtE3GyFzAFYFPDHbmMs65Ze\nyKeP3nusjuqI59xPhfI2DVecfx97WYrmuZbBDHf7oDD9+SF60xIptCB9Lm/K\ncQjKdPVipxuoK/U5+6TTp6407294S/AUJCNcefUgKLuQi6MQF4uEd5WzF+FD\nCjFXhcemFai8fG0IbCUb71eXAVbKUinQUGa/TqkksNtyR6HdbYXHQbjMGXnh\ndd9MU8urnJfhWyUolxOYIRh3OOc/WUFJj7Y7DjVUP9/PVY4swChqkQIinnaj\nMzvUxr1KdJdqtVKc9x6zUVr4YHvLt2KfpklEFhZxgXbuM0X5ydlGIMYlqurc\nNKkS\r\n=xcck\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkXsKQ8xkSOokUupq+7CYVs3ljUTdpftWkK6o4KpS83AIhAJ3qHifFqxGIEHE74o1YSg4yAXBjhBe2OMIEKSZmy8ZX"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.3_1585684062326_0.9158007218722877"},"_hasShrinkwrap":false},"1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.4","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ed956ac86a88875415e97b45a5d73af3ff1bb52d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-DWNWf12UzP8HTn5NEzsrug0TtJMoP7r6LBwbTIKG60ngZnn+EDhvYxYVvxlNTE23k6dLV6teZTxQj28dTiUyAg==","shasum":"02ee794e0cc0187dd8e792ea503137e248faba52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0.tgz","fileCount":22,"unpackedSize":105739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg56ACRA9TVsSAnZWagAADo8QAINq6LWgMb7QbxuEMSLE\nRgZNUdxSvfQNMt9sXGlKUpH5aMdFpz9qruMPK8TGSbxFDWHxFJuuXi8x3wVh\nY9+evIiEBYyVbyLj4wYF8BdV0cF22S87mZ5T2z9Tzl/kQrTQAoWi5lla9nAV\n9aGfzV2HM72poPTZWZ5FQBubzPgRQ5Zs9PNOlWDHX7UChCn9gRBARbh3P3mw\nyab2VRDx0SdWD1n2JfVDY2b4x6kzGgHuRYW1zCKpXX6hvmnmILKd6deLNgtp\n4/o0RB0oHUiJJANJ0iyLdGWhDav2AHiE77/oYSSMSAe0WnO4HmYMhHF5VtQA\naL/wqmvWmqwkxy5s6Pb+UuVmIGBJsH+Es7VsDiAfUCpb+r6ShGvEdXfdRmMO\n3UBw+S5pO2Tb0wjOZ5h7XxCrD2aSBdzY2JZXHSXqlJsspS0+JyddAuxMFP8b\ny/oAdURMtf/BUgL9sy7MzKEHd+1GYfOq5DwGLdkzdcAA3VqnmTo/WPV/Ig4I\ncqpAiY22/Vwfl1JFFsY/7zDQaUGmTG2KWPzSd8LXqsF7j6u0cbmxnUBMUppu\nLnJawWAtllseKUuImH+EsIKB4qv2813J+x3MeYUKXTCTPQP7+d53kxOzc4uv\nL/vI543TBYMs42v7Yy5xN3cbr/dApjXs1oXd0L4napDh+1lfv2W3pLalctdK\nnHV0\r\n=CDFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxipwD4Q3fOW0MQW6wteOHpsvULzIEB/qO+R5fjcYo5wIgMtkWD1XMNEVq/8hvOndLg4coQ0ZHAage7QZteFE+7eY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0_1585684095554_0.4560805796354026"},"_hasShrinkwrap":false},"1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0","gitHead":"abfef04e2316f2f570466fdb238945f77a103ee5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-LHNJ68/Q+OIcS2ZeXt5SyBBEqS/JMkzvI4VIPeBQiQ6OMEAg7PsOc5lqEM9KohpkInYzHT1EhmqzpyqrfTQ4ew==","shasum":"f56a4cd137e6389bc8cae9dd270f2a9be1561f7d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0.tgz","fileCount":22,"unpackedSize":105739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehcLrCRA9TVsSAnZWagAAjNMP/jZ3y8RxnkI4chjrVNxV\nU1MGn5x8MtYE4Vuru+Z0t7yuUISDdzV/VDpMom8c/e/lHCwtvsQtGGtk8tP+\nEgyz2AxYuYFb9g4h0ZjERjLqfAnV/D1TcxQ/oD2AFcV3s0BZns+ZL16t5vV2\nGsAKO4CLCpz4aUHHlBJZYX2YsWuxcJS4evJ2UqkUUA0aIL2uRcXumLLga7y5\nx1D3RhhJelL3g6aUvLPpsYng/1uUvT1A3qOs54Zh76YSXns/EDMhQG3RcPbk\nCmTgTXVByFmXfEKp4kE7KabSKnAJ21m9rPIONaFBnKDjAEvGwbt9uznGZ0o1\nqGjMwtN1yf60Z5JT6enS6dTYzNkCcxlhxDIAg2XI3lV4KQYuIWXfi2gheVHm\nBjIWizpvnGpW0izKkn/AmpkRT0a6AtZPvLsB2zrzKxOcSgsWUyNp/Up3MGX7\n1M/TzDfXzkXsiqJPl/g0s0/W3Z5MRjuCdzSBnmvxPPfhJ2KyWx7M1p4iL1bX\nNkl3EKYXhfSjFw6yFhMQ38R6o6KRhjPkgdiE6YLCUE3d3eYMW1HQ/kEf4B/7\nbbRjoDs+UGoUUgIF67BiX+6NgedY97GJVjuDgVemGda7xIjRj+L9fb+duC9l\nfwQ4qIrn60dsitz2IG+M4fFcpp0sdvQ5JgdVpXji2mVIjxun4k4P/CbV/M19\nFMFc\r\n=g3L7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1XWs6aOEWHOhsOrcU8taRfZYEFf0gJqOgCqw11nBiggIhALnzoVLJ2YHNAIaNQPHW2kdnZdL0+h6TBMipqMIEh29e"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0_1585824490855_0.012425546730027603"},"_hasShrinkwrap":false},"1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.9.8","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3db96d2955e07d7f26805f0ee4dc9cfcb314a553","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-MDOa2ukX29TeWKKNGKM+ZIIG7mtzfC4SG++C2NjTGNsYRE6r9VJJUmIRxf+7J+rCeABIZ+3/Y3VUVSkfupmBFA==","shasum":"ad2f808d09f6329a1731d67dcbec8fcbe90910cc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0.tgz","fileCount":22,"unpackedSize":105739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehcM7CRA9TVsSAnZWagAA7q0P/2026iG7HJvGu37Cg7Yl\nOaADSFjAEs+7uYvjNRSJBv19GbdkaGrtvapdVtj5USQEjNTt4Q6PgdkWTcky\ng48kTjRiIXm7BZ1S3Pp3fY9mmtdjNu/3Zq02iIGHK2MXKHpgvfgmOyKipiQS\noP3mBW11nZwtkXARaluMyAL5PpstG1BS+FHg5DfA5TjEP3I54YaRsZiaKrvQ\nPfGieDJoFtcoSREusTN08ZvA8wjKcduAZtg1h6CYu/muKuxRroytBn83QnbK\nkjrK1p77Kttn7eghdZ18PZFJnp0ghEO3SvOLpEj2BL+PIyP7nkgNA2qrEV2m\nxvBpyb5Mpos6+4ju5emAKNPzxV8qUMXm9lu7AgXJbdpJgPYM7WEFiEJyXWEI\nQMnj9ykIeicmT7jlw+qT8cvtRUoJXULQoI7O6tCHwKohUXgmtR6kUbGk7T4n\nEmQbc5QV7DvE98NtBb6I3Pt/O/+oM+VzMniJNWVD/CHZXdPJcMELX7LE//mz\njCSKj3IoJPOeC/dskWOglaSJAY8TJ/p0X6CgUPA+AHjdjThRHi0J5hr24nR6\nuskgE0EGYVMwn1k6QQTH7tkIc258TLNB0XF9TAZmis/WiursthMPJKp/doDT\nYW25ZWKqsghrz5FXM6Z2Jteo1/ga83FlEDHYokFU7X5906chcDxjHSNyFZ3v\nBmjo\r\n=f5Jm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1tAiW+6bGQFnbEpkKfQWhyWWlEpkdgJjL9Jm8sF0AMAiEAmYFd9p80Tf8JuUXjC9mZWt02jN81jnpsADWXsMTD9HU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0_1585824571201_0.9550793805484368"},"_hasShrinkwrap":false},"1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0","gitHead":"586ec2ced7db46e473d8c4dd5adda29792c2af35","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ej+GeDAKCFnbjwyaYudrApAN+7lFA0RsTjKz8h94qhzC1KtiYlEsfmdNteM3BFSOVjrlnHjT73KkwHJUlPujcQ==","shasum":"4137a3fa4d4c3b6a9d37f6eb3993cdac91caeb7d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehhqFCRA9TVsSAnZWagAAG6wP/1Vw3RIUs57FVnTP9Sk7\nUpjkoAssab04AE6g5vmgP+Jmmr9myzkKLxSgrWuGWv/RlrxhbHkdVt6IVDw4\ntNfVIEk80iB2Gp8uQeieNQunbKHmhTlk8VspEOQ2aLMYdZ7jri5z89isrMJ1\nl9E4MVI6zldmQgxXxUpzKC4icYn0YVkehLf7mu5wAqj/8bS696EAeHmMdxhr\nb8cDm4hXAaEY07h/txXfrkOoVpxe4baU9a3chuRe7dRrVhCQDtVGKJf6rrZ5\n0NPaGnhqddQEnindIpSqFredwW+rG9XhW9gDjUm/yHLb8GTpbZRuPwpnSmaV\n/uvy4hL5bSvTqz96jgkPhmksHpZ51wivGSdTf398sqKgIvpmH47ubZb+HlK6\nB8nkRFqXtSTFHji0vnoya8+ez6L2KPoMtB9jwlmjLElo2kXK6zlwHTLBxR0L\nbmidWjwPstHoFhn73JXPwgze4hpaM8DMxFuV3VdHtgL4bAMWY4iORltiiwr5\nd97IWl06cyNmTGq6r/nszpWNECjoHHATkJz3qhPMoWPVlKFPNO2egTvhBM7S\nUBmvc1SJCQsrD2v7UyUIe/7eMZ24aQxKQ3Xu4oWBcN/ikJM5TsaQhlBJ95mB\n05EGUF367pcPThbzHbsv4qMlE0TZTi3kjx+UuUyoErxwYSaAEUiFPE2mfw2E\nNKnu\r\n=iMAE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1pPmAbjnCveTkDXewv/Zv+pd7/qtevZgW7sR5UooxswIhAMh8BCgNBeewAkvDvZ6AAtVJwlMSatm2fs9hfg66R5Ql"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0_1585846916910_0.3112258172313964"},"_hasShrinkwrap":false},"1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.4","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2c4164c534a1f423215e45255914d4132b67b03e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-srCx7QlAE7zFkMUYkEqRWdciHvOSpfXI2d3yyba9c3PPCc/YyrUVAFnFJ4acv2qQ6UBgDj19SIobJ4h3clQk/Q==","shasum":"4a1fb69ece64bcd53e48b46d8073a7d69d66cf1e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehhruCRA9TVsSAnZWagAAyR4P/1osKCy20EJehaZ4P7jG\n1wcmx9M17CYgcNT5eGJ2Mi45pQzB/lFhE46cGaqZsqRJvCMb5EMFBzbp/YTK\n/qsEPxZm8Qm7oITkmkv1tNipC483mYQ/wwivF4oe9B+paYe2xP40uOWXPuUy\nZD+Kmrhp8zeYqVoHDy47op+Px7C8Z/J4RidVgfz6itBB4m058TQyMR1CXT8I\nJ9vpToT5OqJfO+1bRCdJC3ylH4VusG54v4XDiwdMfvwoJIbbT/asFAZdOntX\neJPnHPInfBzURJ/FNAHBxpc+iEtuYHmhi54/MlAPuE3LXbOhMekZiz6hvfzV\ntrD6yFxr0C6v+qCH/dnJ74bfEYawbZT1E7WH35N5N0J88ZiYfcvn6QZNRDnm\nRzZWVFiFd7LhdP6Q8aksh/WkiNAX74dLZ5IalSEHSXmpxntXI0h2NlJLGoxR\nPN7gAb1kQ/o/FpdGXBDssdzGrDyQB7RyDkNYS8EbXULc4c+5tnQJlVj8r9xB\nS60yh1poUKG3rweeUBYe6QZzLCtDzSsmdU+ro14dn5kkrxjob0dDWtiTcUJC\nrpukZkZOi3b9I3TMndcjjXA4OUmB9H+/oU6lWJBPC4CWWZx7dTkH5k36/ohT\n2Nf2z3Fag7zVkSH89tT0fYCCsfEfah8Ba78rBWkdtOUsz8eK3PolMxGhlHAM\nNmo7\r\n=bbjl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpPSZTPcecaU4WtP4WC4Y6gGVLcvdrHeejYIQA0HEJhAiATYPdiepgdAAK6j4vgiRkzWy8oZzLzjsZ1yJHVqFrYmw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0_1585847021901_0.18371215437724997"},"_hasShrinkwrap":false},"1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.5","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0","gitHead":"5786e52b379c06ed1e5551c462f49730a325f4f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-OhmyC+SBRiUm3AOV/cJsO21p4R6gbSz9pGAXaiv2quSKMGv6F96obRJ5iGEm4mfKZ3avQA0SmADneOZeuG2BSw==","shasum":"fc13a89348327415c9cb98653be458546007744c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehhuBCRA9TVsSAnZWagAAtPUP/2cQAsNS2yrgMSxPITHZ\nqHHNwh9eMU59+wPocArfURH/aIgeCdAatlCI5gsrNCScuWTXt27y1OhrtbnX\nIe6Xs6iNOsQLTRXY9A8ZuBWdM5kzTUaasOBYBZp9MvMbHT7YWGh2HtQE4RTe\nYtrCtP967i7UwdDoTwZaIOlZ4P2fKYZ2sND/pDK805WaSOsgHE9i2WNyG9Fh\nqOHYo136knP7fm6eGwS83UKeTWVr1s6OS7Ln1lxCBTyMctkNf5I9xhjBxS/M\nqYIDbQBSwGqZ7kYy7DkvJirav+RmVcOfK9yhH1iPs4X2HIYYZAIdq8oBX6iF\no81R4Qy4Xdn11cbH9BuiGrxB7Wp8eZdll7d/+4R5NFTMMHAJyjjJ/Hw1slJu\nTlpP7CbJ8hNmRzdbJHnmkM660aQiiKgiCliNPBmpALp6qiCZGHPUFBAQZz/j\n3C/jhjAtxvjJPETpM4DOtQx6JtBa9X6pzPHzNY60hs5Yzx1LcPZ66QVprBt7\n0SCBnlnG1OMY/IKCAc6K7twgiGdsQkYuZb3+AaeFjDoYWoYk2o1XXnRIJha9\nrpkSzMeK1S9s4D7LOEMb8WFuXwD0ezPwDrt22z2UwhoQv64JyMG0/FIDzsaH\nINVToSUpn50IOUtf1cF/Vm9OTKhoZGPYWIO/2v7yF/qHpJ3OwNO9PMi6lQJz\nPmPT\r\n=exA8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAq3nN4elsbuQSkDLE+P7B9NKzR94dcBSJxObFWpq8KPAiBvTtGQbXVESCIi9p3MlmAckPBwpBPWSF/Dz065G5Gklw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0_1585847168969_0.5334471542211419"},"_hasShrinkwrap":false},"1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.5","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.6","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d565ee3968c6df5dfe1bf7235de6553b06858838","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-xraG4XNd9IqIvWhBio66nmXUdmUeYuxSd5f/aazL48ps2j6Vhl0FRmCbMwLPG8bJJjds/H70f4y/qd0R/fhW7g==","shasum":"f9a2c3b7a0621e570715ec70b514f4338f6f1eb5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehhvcCRA9TVsSAnZWagAAFo0P/0XgUPRvIf5tdEbcZN0f\nfGQJfo03PePffO/bcftDu2gvI990vqJKXumYiyrzpV3pl/t+WuKO2fc7VbWB\n9i5ZyZChWCwIaro82obs5m0KP+JUx29zEA4/TAooH01PAmS5wvGHNIb3qRFa\njB+I+pY0ajqNzXJJJKHlbX+UJ9KaBk1YWSc6JlK5XqRW//vHqBMRxYkoENfq\n2XQhBETEosguiY7llHrW9pY2AjDcc9+X0Dc6lG8EsBsnR3isDSVpNvcHStkG\nb+3CpagcbzhCTLMUl3sZBhssFyguj2SfYVuOt5dHeckBwlZlqI9JhnT4cndF\nTztPTI27zCp1kTb8/HmY/saAfGsvxVZAA6WEZMC/i1448O3qCGtpUExm8D+x\nsjZSdqxGWbl6sl5Zl7r6Vxj+U6C8WwgK5EyRWy3qpiGQWAM3TVUupOPT5+n1\nWXXxLbUkMXzaXHdo1I0ZQAGC6tPe3RXqzViPtavMRpSt+v3Y80VQaAQq9uX+\nsu6fVfYllqD4QuKuRp7NwxFc8oyrUcSanoKZx/jY0wqGLG2bes8GRI+7jB+j\nrmC6b2byraLI0BBDx2m387W6XCwMsQcxAfN8cLcq47Zr950uoIjri0vV7Pc6\no5uZH8XpOjbO7y/XlDLBHEfbq+qE3eRi52QkG8rjt+2hqjG4oyE2MfsPIxAt\ns67C\r\n=xSRY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExHumscQYORQ0gKxe4JsPkqDW+Fg5cUtIwV3vAMasPrAiEAm2YvuQvHf62R1JUGulVwJzYD3m3XWS67kQtK5MJjwvY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0_1585847260365_0.10330414208486127"},"_hasShrinkwrap":false},"1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.5","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0","gitHead":"134a488e45c11199d8f1d6b92a90d69621197c52","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-/X6FKCpoqtpEk7ajTxoKFt+npbbeb+yPfnchjjIy7QxNNGks6WYInCQF7E1jkToW755D2bZSXEvdEboBcpkYIQ==","shasum":"88f8c1bbfa35ceb5fea5bff233a05d0dd899add6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehvkzCRA9TVsSAnZWagAAFNMP/jpxHIrpqOPtsXprlaTd\nbaO/ryRAxG1UOQjEmOgZWYgm1MfN4bpdSUAKMoeUKVQkkxXYivXN61oJeP+t\nBp9gSB4h3HmcjnwkwQzdbc99dQaQll04Nn3Nn5w0V14z18ioUZ5KvXOxy7be\nx9tWMYtTVOnqVKGN3pXAnULV2aV4a/cyPKb0ALaHtBb3p4Y1qR2d1aZGi+jx\nFgpSnONSoW44BH76nM2By5rCpm8vuCoCf+E4jXV7rUTeYJ60rbjaBPFm1d3V\nzc5pvShKX2xlRy8VjBxKzPPWWNX85zpDQ1jv7m3mQuR3H9Y21M+FoNSJ2NGR\noPJRwdsa52dw2cSNraIJrs/9yoDkO+KQ5TDM7UDeRbXX+YopYx64rvjoxB9i\nK0oHipU6ce0zQY9AVOe1KeOm911WUf9PpJw38BsypXmI7SBlbyFmM3/lVOVb\nNg+Bqalbcu133rrXHOAKYAl4DJaIjNp9nGgcfAjBMAiYZzh5tKBLZN0jVv+z\n8ozKAMLuc6w5jAFtTcOHOaO/WBYUkEaAGX1c51eMGlGQ9XNFnc1ayKf7CY3j\nhww33ydojSo8cGPZAk/8kZkQBBEiyKJAXfWHUtgdlpt9KsrhhF79yQCSHBj7\n/hI4dNBRbyhWJ2Adw6K3bgo76+awgGuodHLzG473sglcRRJO4KpYkKhKhUZr\n+ME0\r\n=9Jk5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7HPo1HwlKeoZvWLg+5RQ3WK/YY4bZAW7cRUpFLR3RRAIhAP0pBFtDlew8p5WBrxssfadGq/S9/30iyJCnJavk728K"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0_1585903922782_0.5161028362607434"},"_hasShrinkwrap":false},"1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.1.5","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2eb1114119efec11f9f09a359c434b99d193bece","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-VtGvnktJ5c8wQVeVhOizqYL/eLKXkUFxdqFPA61EDv6yF5w0NbrVeMZskwMjVlZ8GsN+ECXyrrNc5izM2FU8Bg==","shasum":"f2b0d168bf6bcae965b2945d9f65a9c22d8e8027","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehvmCCRA9TVsSAnZWagAAtIIQAJ6GQBf33vgwOyaVjZ8G\ndESx10Uk4ea/lPEEo9iQZ+6BieTlUkovKYGO9wsdiRZuL/JIiEsTTB1t2a4Y\nzrky547w1ZdXk0lQfy6AtPNTrcvrd0quCY2ItENMFjZdUkzE9UZMfvn+5Ype\nOj/J/kqj5QJRgX0Dte/ihoyNpQB8pcY5HwL/4+hv3Pw3+dG1V2ByAmelbIfX\nUxAfFrJV1w7EZepQywxv2+jVeg3lAgNzfNuZcV1ofcmNI7UTQ2O83uMX4uM3\nofAb4sU1LitJa/raxxNB3l7AFoS2qrxnLfpNCSAH7xSDJUb2+1HN4nsLDr6Y\nzOhg57huAb4Uds0MmJaH6bPKQr5Sqp4fZ4h5RmrUJDBmvWs4asxfxdVARjoK\nhHzKHYLJuh8rdWvsHCjWcwfjwzDBMlL2/e+qTolIKUXWvsgfre1YvSkY524+\nLiau4pCuzcH1vgS9fVyVYUwr8ENHdEdUcRdi1AzCvkyEzxb6DxKcdZTXRNnq\nUZ/Ta3PNkC19AoqGF8PvMT1VxEeLlLc4GkCXrUjonFYfl6+V/mRMyEPQok6Y\nN4939EaRj/1Bc1E0PnE4umi6S8ZrHnyYhtFgv+r/apQmswaSxENbPauWBGqe\ndbZJfyFH9VP6qZzFvrxVFBAkRrnfVG3lrfZ2jz5AOyvfko7Rw5n0yfmlYKfL\nbu0o\r\n=medX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKKacdmIHuQgPXzPPZtiHFxhvdZNcC7myNDvgSj6M0YAiEAwY2pkav4fc6KNxkeezeE0VyGcqqjIgu7pz4VRKcxCqk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0_1585904002090_0.15201743371426235"},"_hasShrinkwrap":false},"1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.0","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0","gitHead":"29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-PGf/QUo3Tm9QjOwC3yyGxq6aQDRA2o+eCJC6ZUu7FDQFUtGEgT4FytIa6elvwzTEUgfjjVqdkx/4FrPnLB8nxw==","shasum":"816b7bca5b62ec3c2ee3eb1efa2d13e7e84a6586","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6SOCRA9TVsSAnZWagAA+MIP/Riplyc8pYgzdquhQX6e\nsqRnbgzQWYH1CepI22FfKmScvbynLOL3sfKyOXxovfNuKU4efasYpyhYBFXJ\nEubQynSgCvBh8dgHkD4XPiDX6mgHp5y9wSKNslsTA7VoBfUzWb7e2ChWY42u\n1XCmLYCbgP80pP6nXb7yFgMLMRPzhibP6wXKiFJYGNYzLtQfxFrza4ePLoRt\ni/zQ7yLdmRp2v9VAqLyq2dgf5Yuj5cNK/Fjq0xWEHwvHEhYvGoTx/Th5MNNR\nAn4Pf5Mcer7PXQ5KCeIr9Kjxq8qIsGgaAixPK1scZVCpFwnuyBOw1OZiwKZB\ndf2qxJuwb2HCIPxWsRGJ9tDQgAYCdNeu/IlMD8eTWCvdC3LMD5rQsF2u1V0L\naxO7qdGXu/G4Y8D0Qm3KgaHa/I2u8l5+zN7W3ZuoJDQdX9/VPdMctkEJwLGL\nXqqwxiOnzFIpXw9fGR1m/57rRTmXJlkk77hqDiJ26nYGy3smChTEM+Y6YnGy\nK9YPmOpnPjorTa6Eked48AhDrO5gIAJlOtZEYCIT9iN+Wn8YMZNNbKFEMIl9\nA2Ma/jlVJQvkDS6jccRmdZ9gYYThYpWv26mZmSepBDyd6+51/1Ur7dBfQ/Cv\nyqVxpo2MV2iP6XOCSGF4KeGOLNqnhNOB18l6FK1ZJExLvceUde9ZMyiNPSyu\nR8/r\r\n=r2Fp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTP4nvUX1qeVb66OA6J0Ob9zwl7dzZL/CsNPbYOCa8qAIhAOV1maL51YA1jNZhntv3T+kRLRftLXtHUxgPYqd6mJNw"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0_1585947789508_0.8897349962970047"},"_hasShrinkwrap":false},"1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.0","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4cc95dd884b1c76425968c593563d121be9e171d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-F1mqthn7VvmaUO0YSDetOGQNT2NQgNLUKh5M8H1cyWS2og72WO9bzpyNUrmEbZ8NfCh2fElWTKUpr7WWMvoM2A==","shasum":"f801c92dba69a7f828721c7bb8676872adec2fd4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6UMCRA9TVsSAnZWagAA9zwP/jGg0r1KOvGvDtM6rxdS\n7qF6C08yoa5L+9KtXW4Ln7X/F6t7ihLkCQwuQO3vTBdU9jIvijis2B6iYMA1\ndnV0s6viJP2XEmy3/y1t1cwMWJ4O3nvKV90OXYA23IsXBFg2S7sb/f4lReEK\nRzyB/GhMDt1W27i2uynNHdq/TNL+EKtys4KU9hhrEI6i3Y31mf2/xtmAnuhk\nXCbRvAuNVbnQat7mWw/fMBNcEz8DaZZPVZpNyYw5LqaI3+p3+BqVCgSoKJGx\naJcW3ga/mXVUn6UNq61hXSQ3GZHvf8dIAb+mjhDDbNvuga4I524157tK10rZ\nREO6TAGppm4BofDOukqm9Zbong8yivFjeFH04tJkDfzk9XqIEAE9ekuQ35+7\n7uUZ55WmpyMmhOFixjQqMbfbmAspIP2E5jr0xqEjQaHRoMtuXj1YaN5mGyWa\nC7iZoWAnw5OOaqO7aXJrA3H5z+Dh3bChuRaFbTddeoOydnNaTaJFq0MpswRu\nij8wUBiGJmpgO448BOQxZzbkTKIPao+8w3sp5jWwYsWuEp0WXTc6zFkQwf61\ns4MU4Vw1kEfx+0xiV2eIbtqEQS2ybF3PTzDIWvbkiU+KPTeq7WbGOKOk8Y8A\nN/4k9G6KULylroPXqD55QMDiGHj+YXHT7a8w/P7D5HbNrGqLlza8/AZrmOx2\nM0wo\r\n=PGPx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICigdjHWEa2m84X1TexkHATjGQTjfJlbvbBgNBZ1UuWsAiEAxMKm0HW6MBFKUd/dd892oDZF2nNGwfofxJvGdmG/oZc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0_1585947916302_0.6632427040147062"},"_hasShrinkwrap":false},"1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0","gitHead":"5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-jVnyAQzWDYXyrxBWajTbABj2O14Il6iQRDBHMrzC1W2n2HSDZLXgdO+mai0NTJJ5qlpfVBmRvXH2h5qhLObyLg==","shasum":"a661b92bcf62084a4abe635588bf60a4f20888f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6toCRA9TVsSAnZWagAAU9UQAJCUcFcL3dwvIhFdpppl\nxJKW/JiW+OQZIwYnLXAMWdQuP+ELp8p//8kd1cenGpj32OeLo+OZ/pWYcx6E\nZ+baawpnuSSMXa9GJSbM4dYySAG43NeSLf5/jqRjZO4lr/Bz2c+Mc7+WAqC1\nlGppYNO7L8+AbXv+YDXtJwWFnw/DzhUFkTDw0lBM/AMKIGltZ8uz7+NVtOjM\nAYa6da3b7ZbFtMi1/Lr7nJVkqeaNJlfuUR30vmBj6MmyPBpMcDlUB7Kv2AKC\nPkF4pf4dcXVnBibfWkGGI1OLVN1bVDSBQW9QTbDdGn0A/zHFaCZA3kcKxhUQ\nzR5WXGi5rbUkYcOQOzFaPJM7Dl92LM0HCP4ARTkNwhdVgaYohZqSQo1fhh4h\njWlWPL69Ywd5oQv2wDoQtIDXZuXvHsAs5JRPu5vfzoBrorM3L23LATnkykFQ\nB0JlUz55Sg8+lAKZhiaCyIz5rpFOtqcT7HrReUBdKwxTdzTPLt7cVsMS/X58\nw6lH8qQGP+SXRPGOm4sXT+bhEFLlSmh6vnneIRuyel19ZYMWn8d6uTglhmu/\nFk6ojs1AewzzB70FkafZEYXp0uYLHzobmSErpT/IahnDhcoZMOocZSgoWDk8\nRPNFDh4viF69kyEK94/Owy1mlviafwC+NVElz7GMABttLU6HbB2uioYIYHwf\nHmsf\r\n=scn3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqnICorbNEi9HuYMry8voK65kLPZD8aWvN5gjit9ALZAiBJvNduwSHRPZX0tFfdGv2yu4pdO4vNonW818H2sOF4cQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0_1585949543728_0.8034098347060086"},"_hasShrinkwrap":false},"1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-/vwsrKwfuhf9UzHyVh7gpytIgyv0sBkogemf1/+nBNWDqeuUaWA0QxeGbRtFAvkiUwCbajDo7aU31g1z/X4tWg==","shasum":"c2b6ce8dcd8bb9f2fe6be26de3b090304c84ace8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6u5CRA9TVsSAnZWagAAHBgP/AhQtG7WjNmHUPsmYLjS\nRAVkzuBTxI+TCq/aC8+Y97VPv0RtID08G2HYhW4TsT4k6fI59O1nDFbEbnvp\nyq/lwYCBu+XeJHC6AHA93aug+cpHxt1xr//we6mDXuV8KzZpv8i8ak3j/WoU\nodECjDFhDzSh8RcKi1pHXMPMdGgyOQZC2v5UKHpz3afNu/hlagkDJ2ah8jGw\nYw6h+1eQG8JaMfLXoSpaFtj4NmUH91IkYMLjccoP0vc4d1NYiLROpYxTgfjI\n7bPgH1PYBIwAtRrHZ96cQOauQfUG66bgfpk1E3VRwAQnMjOrPmLqGVc7KZBO\n6WhRb3mgFlas7tqFPmINreIdjt26sfuegZUNrOzICQdkn/s2RbK6ljFm2yMp\nsT25vdg7KtJ7VkaoYDJlMrtC79X07HMISgaoq0JiV6YYOBmTbphNba+TaUWT\ndeKbkTAQffoq6B8BgMZExVTTH+HyoizBFKWPRqdX2jyUTdSxgTRiVrpyEjcR\nnrWeIQ7LyGG2dFH6sttvPt8iDsCgResl1L8NV7xq2QCg2Et+NntoO1cm+P9K\nSfQhpWXxJzYbbScg1tf1apk/mShDUDaG+xfyPyTfvbMbX6FP4lDvrFXWH8Cj\nIX9wFnV9XtP3P2ra3XtZDGjVyMRNFcD6AFQJ9glv0rF4mvBfYQjH7xsQ65J2\nxvEB\r\n=5b0X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHQowjkLyk6zYFUDxqQI16Ki7ir/HbDxIrjPFF82UEhQIhALFChxOr6FKmThEJAsaS+R/s7YRXOf1eU2JKeRwJb7a+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0_1585949624325_0.6483106343017331"},"_hasShrinkwrap":false},"1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0","gitHead":"99e47716791c05c0d47dba7d3d987c8c2e022c90","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-P1+D2OVqxdktGR8eSIuXzsk0XMzUF/pb+DlT+9PC6mXU23kUa5aue2H1kNlmBwxoNNwzG6zD9ajGQuHlyj7EXg==","shasum":"6645d2ccef9d498ea5d184cb294770e8decb37b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiTktCRA9TVsSAnZWagAAQikP/0eGv4gCtYFgXOvoC58i\ng/hdAdz0gQPIKIiP4wa7rSJ2iNsharhlFx3CiwNKnM5mfyRO11eRaUK1Zrot\nXzGlxm9meZOHuVsJ9GLKHykiNpxwtvbEvkbmY9n1Z8jvQH7+UkUC7jYSzWe3\nAYwW1ZmkVdXl1QYb6AqtJ06jbIICPmfkyIG0+zcFu3hePzbxYTJw2lS4M+JX\n7TRVoncQ3KZJVlkTuWFxAMp/ilKZnj8+4j+Ia8eUpqvAALtVZXnoINAZVlWh\nSQB+/XWxfF1cQsqHLEwx9PU5hwK3NLmE6r2pmAdXV1mY39wozxy9YjEMQ4HS\nU9xSHE5YQu3JlewIWeoccTbVhg1PFNxfeePtaOsOtb8IhvanL6gK2McMBLXo\n19kzbWj2TBFx7I3alX/6JSkSrKtGAC/7TwMPyqqgxkihkKeDJXPL9RXmA17U\nQ6gxcIBiQO7/7q2k05aXjlb/SmD7BneNDyDIP37nY7T10ueS4tlfrKwQveSS\n2bzFTcNaaaMzifalc/fgJB5Vv2hGJcV/t7RovtwOXOr1/ZgLbKrzrimVzYei\nOvvf2BlDyULVoP1ekncoNMqshnNiCEv1VPr1LumefNkJiyWoDuSXgnjtWBWI\nZQ+CipxnDQ3y6zuboJS2Bcts1G5KHIiCqPrsAks/w4l4F5c/bh4b49qzriKQ\nnEJV\r\n=e9CN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvOyrtLFnQom1d0U/sYd9D8/VS+5t1O1odnhJR1/XewwIhAIQ26BnWjlXtAOlKC8HHyLmj5BgKLks8rIDZFrSEQpUw"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0_1586051372759_0.7837550131538418"},"_hasShrinkwrap":false},"1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9457bb12fe7295c8d6b939a31637dde4429b7e02","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-FH1rM1m8TQeiB3sS12wrQT6gtnp1Wq+3IoWLq6muEIRcB5aRJcBg7uZ1W4mX69Z2/iJLb0YrPeWehsFZOiHgpQ==","shasum":"ca5237e632907c36773bef5a4f9f071c7b29914a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiTmFCRA9TVsSAnZWagAA6+EP/inNgi0p7iRuBiP5Cq/N\niWXC/SrGbMdoAIfCSEBahNppf+dy/ET1Fgs8Ipu5eJ70gc4orHnK+msZ+lR7\nYd8I/6RPFIBqv6ApMAzPTaQNjpXfOWjDDC1N9lkcTEmlx1VuuYdWsXfx08xy\nb12nv2mkd90uL1Q3x/EryGXEko0JYHqPcHU2jK83HUGiK6o1xuZhv6Ixa+4B\nbAUAfNv/w5vQC6hRj50fOUTXJwwT73W2gFAjD0wVm4S6azFsrpaF9E1/X2C1\nouJb1dUoi8QYUWHb3gF3C15fVmsp5TkjVwFMCRAqf9QnY4xyLCQkW84UO2SW\nFJMbOyok5qJEJtTurB854U49xSnBLk9yLOJMQcYi7gJ+lslDDz6NdAa5bfjC\nj8dTnvqGF7fqhDKmpaBv64uY86QZ5kVsCCNIeUU3RmwyC0VwVuugFFElBVRw\nfpBWKvbh0sphieX+DzUTyEXOng8KQYoPt1Dhj2P8FHp6urh/w7tKc8s4z+3e\nincxXAYNVGmy3LaxMrP1g5AphEFN6fxTClKTr6v2CKVJahPcETE02dG9uT4n\nbxxdy+dQkH567SqhFyqBvwQEZPpVcxwoReDvAZRVX2uy365xcTW32Zb/lCXN\nnt8UzyhuvyO21eejPTcJb4tx0HVrnSLPEbudEPYC9hubxTfhQasYUcP6REfJ\n168M\r\n=3qk7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqcDMSssBK5HVJ3ABQOOC725k9av0R7JV6xGtrX5vN4gIhAPioxvPslIKzcvqYNBq86CWPkVwsAzXnHaczRaz8TIrU"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0_1586051461161_0.6138147422611857"},"_hasShrinkwrap":false},"1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0","gitHead":"15f9d942952817a2c8d45006aa7b05205cd9f307","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-WYx3MkxROwUPbt7X8kIpPNPNZtYgaK/OCQQxARL+VrS03MYkD7EFrYv1uYni3943ns0L4Rwpn2TOeuUwZWJcNw==","shasum":"1224ce76dfeba37b63e049a12412116063df3e72","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiaIoCRA9TVsSAnZWagAACmAP/13u2CkL03zjJEgfv65o\nCDr8l0qjPTt6tfygkvG/tk7WFka0Hj4jqfgagVdkjwXxD2CVqWq7hJA1amAz\n7tVO6MzGKjS4mFNwzzV3f/q1Q3nFe+AytWrxA76Y8L27N51PVCx7SpgsM6eL\n+4QH+vBQ9TOzpdEMWA3/gHtL02L9DVbgxeJ/3TVwwGozGlQHYfFp3Jn/w7gR\nhLCnJtRE9IyEJMdArfaCLTZzEdcfgCSVq0besfMfaI1WmWcysj/7HnNC/MrR\nXw/K00orVAVccFvCJSJN2PBcOhQ3IDJqlAQwjhy+fa62OS0TP94tlAf/knZk\nd6xQ01pQ8VFavkapmHV8L9Ku3C6JkF841WGUM2/Ggl9TavbOGA1wq8YrMBDv\nxTLg3BemOn7t9sQ4jhU3gd7cEWtaEVbmSSSSr7gVE2gWNOlIECkIihE4Hcid\nZrSnY+GsOvrvHTc4EIqZ47VjnG+O2Q/eXbqIg3qNNi+lrV+uPhPK3Zg8Tujs\nH5wJlPbr+K4iqR446e+IEIwbeerbNdTOfQOMwHTOLV9IrjVQW5akyjQV4Rae\ng3yJnQ/Mw7zBAQ+18ICpo8qDa++/haO+8XDrzhgm19wk/58gNAum65po4OGT\noV8b/h9HWJAUSZNloSXq/n4z0Hy4bFEZ1kDu/KytAyWuKRzJ0X2aGe2qD9CH\nXVWl\r\n=3vss\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIIGVayBWHlTcIEc9KDHiD7YkJeA1yBune7vzF2/VMGwIgFhbLE+8AddZbh4ZCHVDg1TKo069poOYm/fHJW/hJqjM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0_1586078248229_0.5432235098088469"},"_hasShrinkwrap":false},"1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.2","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1d3ae6e4c7442050a13fa08a5b2d783298b12223","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Wv2/bbGHWXg/Xyp3T9yywV5WdvQXRXOrG/h+OP/1bKO7I42jVRzo1sPKfzfTr89QiIduy+Ex9jDKh+/An1gmqQ==","shasum":"48f28ae42a4b4e5b081b3ae29478db37d7f0e2af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiaJyCRA9TVsSAnZWagAACDMQAJCjJ79hQs6tAsX3qlEd\nVBTyOPwg9ivdp+olKf3al0J1E75af/UgaZvFKilPJ50G/6Rf3IULnqqWZKg6\ngTusPBKiM+VTPbo9ASAfwWKmnrL7zvZnlU7DSX+QCJIpHdHlebcce6jIuVOW\nIcTeovWEDguObLLCCdKTFVFuMXNpOB08HgzzyhtQ6ytI2oOaxoQwhGwP/r+y\nlUyAS2q689Nz8ip3Fy4QZjzLMq7CEmYoFwj24YofZUr1wO6KxTbma89sPZbJ\nLsnxSVO5FvnJ+9mmhQA3alCslb0+HdjCnfmsqXNUsqWEIuKKCcE5l+D3gQt6\nKf45wHfaggDWxVDmN2pWBv/Tm8qabb7IKOV58JRjbVj5hpPVDxebuV32htbo\nVHyVo1szrd7fQctb1PWbNaSLwTmRgQcZJ4gQ+c2Wby9k0wyyzgJ89Jd54wL2\n+J2oXQcUW7wuSp3nik+YIYv+JyB2uScQcPVeu2PJUYg6KMy+6EX8rqI6veB9\nGSdGCBGUJQyi2Bo/jBKwAJ6bUbBTIfhp5e+EgKuZd7hMGtkJFucntIzGEDsA\n0NhjaZfGPFBu3HrmsEb+L0e+piiYjDSo7onPCEz2YuRmuQkVrL9s05d4Zf2z\nLyWxlXfXZ+B/wcL+gRkQcr+byHihghlkf6TMAeuKe2DixaY8VyKNPTeVEjj7\nNc+n\r\n=sQwC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA58vo5MaAxwSwzzx6+S8pJ1OXLwtJEh94e9dIR/0bC0AiEA4/hcY5XSPoXmhwODuR/SmhotMfYm1rwjRSuChwP12IE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0_1586078321729_0.20978946167722"},"_hasShrinkwrap":false},"1.2.4-262156dd190a5669d56cabab1556960768180dc9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.3","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-262156dd190a5669d56cabab1556960768180dc9.0","gitHead":"262156dd190a5669d56cabab1556960768180dc9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-262156dd190a5669d56cabab1556960768180dc9.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-F63O0atAnCjc4hmwdJ6seP6wAsl3OsWLTvMKRZ6k4N0KLrCX/lAM/mMJpo4Ls49N+h/Fxz2aO1tsp7LnT3bITA==","shasum":"97ab4e9d305d36e1f6caf1f1b4953777dd607684","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-262156dd190a5669d56cabab1556960768180dc9.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeikj9CRA9TVsSAnZWagAAV7gQAKPP2wxujgL4Ty9El7WX\nr6n7e/DWJDw6t473AONaCdflCAvorkesNSJVNtVcAmEbHAyTKYj5vDaOeS4/\n7UwRxyns47XbSb7jIEYxnQQyP153FRrBbEZQ2RurbKI1LY5mWcR6FcDNWqFr\nJoPUVj6LvDVQAYCRWp8gagX4qgsb4fqJXEZh4hsAIGHibYNUwc3ZmMoxxaHj\nkGMUUfrin2zDe7TED4cDOaERTaC/BHJIV6Gdh4ZPgC5LCZnCuSUzc7FT3WlL\novt1TRIYhid2KJGGqi3Kl6O8eeGP08K8+7dGSTSUFYUi8egS74BsNNw+/4iS\n8eLtBl8RWKXnpTNIUn9Vxa+xH389Vr9JXYRiGOvZbiXKxRgLKs/7l2UUC9pF\nbAvCHWVltH3E0mHt7nzeS5cNHjaGyq0TLqkSHWxrtdVaDR66L4bnju9WodhR\nNUU5H0mHdaDdkmrgkeL+Tq6k0KF8w+wnie/MfYbSkEri84Ruf8oNiWU0Yttv\neM5MPqUUBYaNit2znLimvlyg8GU+1KUfS7UdIiTOnByWBU/Ndlutg/6f20ar\nHVL9aVUBZrOerufthALaAn5wT7ghVCy/Ra+paTeP16r8n3gLJvlB72b7c0q1\norgZA/8yt57zrMUkignIXVI3Ch9L0+VhcfBh/z7PdF373kXFQspx9K8Tbgy4\nYgVn\r\n=04dT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOOeJ6h2isHyU9bLBLtjANhEd3FOT8gewzx3Kr/2VAuwIgKZstiRUYmvcE66tus2s8/QAou0+IfeU3TUobxRKfN2Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-262156dd190a5669d56cabab1556960768180dc9.0_1586120956682_0.4994949885923905"},"_hasShrinkwrap":false},"1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"18e1a3fca0d155bd62f18f40652660b0b694f48d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-dNYvSwESMpmLCYulYVAxZNI/g4yUU5kgNSqybpL5pg+XJjujRA3qIRxo4Vd0/aufuz4K83rrBpGbl1au4eiYjA==","shasum":"1d7c83c654d219b5bec41324ec0d9416ec8c0588","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeix/mCRA9TVsSAnZWagAAkpgP/04FPnT1O9WJMtYMdHl5\nSHKdg6Ep3YkD5u74QlwFsaHAhgKvl7xhjXf9cuVQCppjgYAZqfb3Hgzp1E84\n1EP9R3GaOXgWDSIxTnIj9fmH9dZoijzA/9CRXU96fRt9tho2pa+MMUXsbLQv\nrnayWXb7j99rPqvMvAobbMleJZXPtwGbinPhnDKPUERBvmI3FELHStHQikzt\naRSVH981nA99MggIgwtfT9cSTe/hnhED7l267eksKdbNmLP4zYfV3kCXr1CA\ndFXd0AcQYdT86VTDzSNZlzMMWWlExJWiZz8NAglFQw5TpdMGbdChZtFAsh5w\nkoIGtVK/+0qdjgljearrZNExKYUmc+OFNgvF3bVd6IGIpI1HDaCVWHjVZ6s6\nkX8GdM/u93o2TKZyKqLVx9EWse1k2SSM6jQFTDoMc6zU1Gm/FwocE/VZTSEc\nTQJr+vRd9inPpoak+oMNmpHdtODhvY5JWxjTqcF32IlGPRQ9q+uldMIgnQpu\nScOJVbPxMA+6ze/NJP0kYlz9YWIWswBteZxFWw/6wLwCir/Ghxne+blzvVmi\nTicNV6MNOXoy4gk728b7ArsnnpjqUxrNq99xuS2n8AzzfsXc1A+4FLRie/4T\nFnKGagjwM6mzuT4R89HtaNw7TnVmPKy9CHmmW8h768OP3M20O+tV5ze6mGor\n67aJ\r\n=S+mU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyxqzWJjAvuW3olMEl6AgT7EhzdEsmY8i31II6lAN8EAIgCcMzrO1iCYLU8RQ17Tq6QnUq4Bhs9My4ZLelE+RoeFc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0_1586175974249_0.2718050213655183"},"_hasShrinkwrap":false},"1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4feee49321891bf4cd88ac5e7f26ef8c179253f4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-dhqiny48CxRrIHbNdxhi381AzqrhqsyDxBgH9EdRskyB3fgOti08TrHMkCEFfxiXlsmiZIyKxhHeux8EFkaQrw==","shasum":"3a75e44f22a4a36cd7bf8eb74b5b0722e7bd45c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiyExCRA9TVsSAnZWagAAHIMP/iYTwpnqqT0o0tXcn5RO\nPKjUTJQXA8xeVHsI8F5tXH27iWVga9NA7L8zkfg2vKGOZCi8+wG9EzBP7kUR\n3+KLxTFTxHs1M0tauaPF67Y+fyIpjQf/819M/th0QcE/tKPXgSZ12vI/Q0gt\ncugfVpOk6Fw+KPfhgoJ+2F8RoA/Z0vhm59gpFZPmj4eEFrTD6A87JeB8pK48\nZtlob1wCZsUMiqfynMatM3o7t1kry/vOlbZ4XZRBdneXBFsa3MMQx3dU4M9y\n4PTPIzgL9/tYnkBvCH1GnGU4xbZP3GqyD+3wS6BPTEN7ys5e+qqpj4sSxMSD\nvBCZ/NOT6nJ9kyVRA6Tud2iT6tStJvBPqMy/xyvU4Q2L9vutQmRPG+EzQlZd\ntjPYxwEX6qG73nnCsKuyx6Ouofy/5b/J5daqpjTERW+iQz/01DKC7EcyozFx\nUrSPRrjnYltOzUvzYhCNWvixBnSmzgdHMIXV32l9E1xTa9s0CAAZ7nzBeMgu\n/jtSLaV95ZK5M7Rp0wm66baf8RiC2kimXi2A/jAhXZ8V8QpqzlYSJIig05/U\ncE92TtA9lSkJdoNEku8kh2nFf2Upn7Hg09eGe0NrGPepCXPJ8tSWxAnuWGY1\nboNAsAZOCptQUjHCrBp3o+izQ2zlfMx/XMOXlEX/blvqAUgEsCukuTKyvlZR\nxP8z\r\n=FGaJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs83+yHuj+Prdh5wRuDp6JsJ2WU3ZW301d43Bqbu/1tAIhAJ9NWjMcd55YDb6s/CfKc0Wa7vB6kRQ2hKTZLfcIhT/N"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0_1586176304662_0.8052670965798123"},"_hasShrinkwrap":false},"1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0","gitHead":"568e8bc555dbe8c0ff99f46392c32c903c4e232c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-mDaxO7Mgg7B3OtCrlvrGfzH1KAFAsBFsDDIKPE+4W2suTWSrses/W+bu1XJJuBgjsBnDpJS5QifcUf6OsHxmkA==","shasum":"1e67bcd58393e4c2e61d41a6ccfd2f536714ca4b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiyFGCRA9TVsSAnZWagAAS5cQAI4Q/TlDvYJEYAgmI3vY\nFb69bGTdy58FDiYDizHHOMEUfQadWUP204JtLgx+gYkSt8PfdTY+Bn7W6ugQ\nosPN3KczEdNEY6Mx94HHzNkUr9st1f69IdVjGPEiwkhb2+4I2ePiIow2ka5v\nCweo3umcIg+UPR7Q6A+xOkomXsF2/D5vSeFmpKqEaTvDTTSTKE/GT00aWY3p\nnWAih9JT/1K+C7IknTYWrt+jtaH1l6kln9dQvPKdmwiZG5TQlTBLCnklZJFY\n+96bgETtvQ0Zy4Nvx6HnZ50dZvy9xTjWLrOYqNiwsjz3K5hUkae13Ggs8uew\n3TYs8c+aNMq+AZ4MSMoQaaGebzVimNNUzAmF+S0cd8ntIhF5NS0g62wkQIjx\n9idCCDX+jGIqzJRN3zFhwCBnu12EvsphYrXYRP4KuCeIEt6MKUB/qACLRmPT\nRW6NBltrq9RaoppWXzemZxdh2ASVl/eZek3m5+ZletgUP1VCMutBHJ1t3lcl\nB6wYC7T5Dvn+SI/g7+GfZ10G+13Qpym0KWRVFKlYcNnnmbb6SptOrjFT4FT1\nh/ui8hr002KsyEKPnVNfuC5kM8DF418UXwuE6dEviTTjWacglPpdMSrdSjIo\ndGMzjMI7MLDh7jOqa1SGcmjJYmnn2w6NnZxfKAiYbhYUkF+nswMRDIH+FkEP\nFnaz\r\n=dVB9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRpXZ9/REU31drKEq4yyQweLkrUInC+Mn0XvKz6gXKyQIhANXi9BpJQMiEc7q7kh4bC7hd5MIw0j1dua5s2Pvt9pi1"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0_1586176326225_0.14925494482450175"},"_hasShrinkwrap":false},"1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.19","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.3","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0","gitHead":"8bc4a682d71c28a286ad6c2c97af4b06d2fd7564","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-KgGieC9hKmE73MwEaoMqs/j5wvHsYYxYmytpaW4NC0X8qAS+shCth2UzIwt/TvgubbBVg5Q8o2yEMfK1BuNSnA==","shasum":"229db1a8e6b3143585c7fc6910803beec23b730c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJei3+lCRA9TVsSAnZWagAAeFAP/iVoMuY4vY/P/B5tWFUD\nCUrDk0Ope5YCWuHlDAvWdnnC1w9+AW2R0d1FLm/IKAVqIxhthTRPK/S5ISHn\nSAZxNlR7v9X4fWxsr4FRH64Buq4t7S0QpJxhopXkd/goXv8bE+oS5hQ7Saq/\nka1JQOzp8KZX4cnIqP3/DVX5S/ItrXuzK5jfTmHCxkxh/L8uqx0bKuolp580\nxwUeyEu3Y2/DbeuGR/2kQvrNOVfQbF7rg42xYkvM/i3B8Ww/oXcF7OB42zKK\nSgQEka1INSvtSytJTeqJWtKNnktgNQ8HS5ZwcUm2+Tz8p5i7hKa+xHreMRLC\ncl8VqneTYAQboxNjxOzKa6gGLsyWuRYTJI3VJBLEKcvr/ouJtgNmCUaw/uXw\nLJtewbr22MGoC5XGf6ewfKPWdxqF8RHOMEd5Qbo5SOHgDNvYe07gfTNVVvd7\nSjaJAx9KqdSjhc/AYuu/rZ4an3FQ2uHnJ33MuSehIwG1imcTgG01WP3safBA\njPHsPnWzYMYp6qt/+ZtKFuxurx6cw7fvMWWPf8wrt7aUUz2IVrm6k8pz4LOS\nA9tyIa0Gw7fzCDzKSRx0gKwRXJ5EAN0bWsPEABGxlG/GlUgYZk4pPIDcLjEu\n82TqD+wbO6WNsth2Msy+Q4hHdEUg05hg2ZUBE0zpN3rY5Z7XfPUEQ1kU2Lr0\n6Gqi\r\n=EFH0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5iFUfMitOO/1QLqVnQGlbwCqMdxHw/TA9G7ynYcfKRAIgHHL1nHOlOms111o71d2zqkBIyPibx9PwpRhJzmmTLgk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0_1586200485288_0.040950849977801296"},"_hasShrinkwrap":false},"1.2.4-413674f56be006a7d7519cae841254086f42b2af.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-413674f56be006a7d7519cae841254086f42b2af.0","gitHead":"413674f56be006a7d7519cae841254086f42b2af","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-413674f56be006a7d7519cae841254086f42b2af.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Y0svcG2dDsA6tN7kzioeD9/+9NiUZq7cVFsUQF3yO+5wNuyZgQMTBT0zBbKVvoTAbx8qv6Bz0a+Tzwlf0r1tDQ==","shasum":"dfb5033ad8eaebe1239f97a6b8b29443062491a6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-413674f56be006a7d7519cae841254086f42b2af.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejN8dCRA9TVsSAnZWagAAMvIP/jClPCzKpxq8gB6lo8ii\noPh7Xmw9W4cxoOFFbYqwRUB9Fg6pE1K6H1NtEcU0GkXjOAfpHXNhr1Xh+oid\nqWtj+0omKYswMvCh8duE5t/55jqQZm4iluWMtEEtJqUqg3R++/Bz6B+ncxAE\nv0jw7G5JsvJxFxO5XTyjdcnIwssZiHvkv66llMqRyVEbSvDBw8b9KWuvvrBH\ns7eB+m1j62QtWnGzgJUB71fRaHFcXDADYxtRkQiLyZUUlmlhjTYLMUpu7OKp\nCpO/fSg/2QKLztwhrJZJ1SuCbkCaGfeue/CK/rR/K3c+j0RG/0A6lvlXDQQb\nYSjtKJhuGcoZXF5AHsudTKSa7max3UmhxrTxNiYMInx04zZYNwthpbWsQeZc\nTqH0rDo8wN1bgKssSj9aad55bAKKmRDRs0kJNvBp0DxQ6fGnWia5kHj7/xd9\nMucsaxnFvy4ZHUm+I/6MfgQVOMgjL/eIrtsalQxoJDuAvcMUyI9QzXSyrrvd\n3IcAhHnRUOJ/swCeyYGGc/IcuTur4CUkxebggbsNPUt/cbC5riUvD2CuKNFO\nqvSVI3mn2RSRUjkFJDSMOyKWwcnX9FJhR2qhPMaBj5DLXUnqFscgBNVeeeFv\nUKL6/1gWhD6Ei7z2/d4ZPiP/pP/KM4lZ1hxRiaa3m+d3CE8lMWoU2GJgINtk\niNJg\r\n=pqg0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNPt/1D1ezy8RSt8lDGjr3k36f3UuRoKw1NOX5IQoOPQIhAKOW2gemufGBiwzjzG85yOHbJ1Fa4TBloC3ElJ/6Jn2O"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-413674f56be006a7d7519cae841254086f42b2af.0_1586290461301_0.19866365741567482"},"_hasShrinkwrap":false},"1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9b0d64d1bd3db240c7dd3587e5bd585001957474","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ZDYwJxkLbEBx55hziLcXoEb+4cs7snxhj7KS045+FDqcOXzhSgr4UlZAqvSQhPuvBlClzXKT5qS/iyl549m4IQ==","shasum":"7d2a4a36179b60f3130703df9111bceecb76969a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejN+LCRA9TVsSAnZWagAA3V0P/iKN7mVdpKpNJlzT6WRG\nVZB0C5lG/xt4SbzrGTJ7BCeSCkvX+e7M1rzIopA46giRdk7YCHHS8xDaN0Da\nMZyRU/7+V1NLOPi/4Y3lt2J5gYlhr4tYfDInqeabpuyWhXVq00lR1s8S4/IQ\nLdFyUy7jinO+GJDBgsLpYGLPa/YY5FTaBla06/dSjVSqUQbMlsmgmkA4Huo8\nCfSVat9xZkeGUjVYh9jirAUHSsLHOboEYdZ125KAkeXK7LdVeFSir/cD7Rr7\n/hQBYnhyoTrxY+xuOKhkOaW4IWBaODKqESFcHxTkfcfCy0SeclqWyycNEnPv\n06KFICELDUkAFSTAbK2sqS+dG9AXUnZSIaM7slrQDYHFI4Cs/wB1ykG6iKc0\njY/oczdt+t2y6nwjtfZKPV2Tjp3UBIlggQjZ6KrtJLoBMT+0VV2C//YeUzXq\nrvO2yUIqG7AEweXnbDSDcBiJR+5W3QZrtRan2NXiSgnc4SzHY4TwrQmM1csi\nTl2B8mncQvvlf4CkRKmh5aIjIS9WrE9cigwR8oh7B5RrodloTOPumqTuHXkh\nCTg2p3+Vlsh6YnHJeaAyzx72NXAG1E3FsiX+ftGBtGaWCgh7N/3Vb5CtlkxB\nfqXiBVTvPzX8bvAFvTERBF6LNR+7jaeQ0m1S9wTMVySocLYeMoTdYd0+Cdbw\nrVZq\r\n=QswN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoaFxBIxxeAcRIGxGFDoMmLRWMVWL0l4DPQXNL5h9ecgIhALK2LQSNsHaYRt70JnzQ7Uxu17GT+/l5ATKVhfabBP00"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0_1586290570706_0.9409827647379976"},"_hasShrinkwrap":false},"1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.19","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.2.7","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0","gitHead":"933a46e907a10eed49445146ac64daccdfb427f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-XrvznbwF0Xev9EmzHU4EOULqVVq1Ip9WdU/pJhI6GGe2FzNBLRmwAXxWAduebjYGPXIx5j7uW0X4FoHoPep0gA==","shasum":"8556a4f9075acfab93d82a66eb3c2042e847d713","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejOAECRA9TVsSAnZWagAANnQQAIYtX3Lj9Hc191WpclDi\nLsxTTxna5n3nrM6wDG0gQixAPFZ9DUVXI0mIMCerz5zAVekOMctN+omkYbPd\n333QiCrF2SzireLFRaSR5B7PS5K1WyAP4u1XemIxGdl7ibPK+sRW/n0/DQu7\ngQ7XKfdCmlfZ4J9sKCCD8jhf4iOWCbmY6fzscK1AzuxAR/BdYArI9A/OmeRe\nAfWuPdir4Tt5O+TqH5ggJf1PHgPCfXUry8ljv8OjoefGiZtcZUz4yoei7nL0\nVM0EiJrQ3e07JM5F4C2iVuwp1m5YzwajuvsXW5m00+JaGwHGzKCem8qy/RJk\nK286ZqIFhp9MfDrPs+1YjHAwMbTLA66aK84ZeV0vH0SfbckfmuPPgi7q/rOJ\nNDQDOt8xr+AbZG0tGbQJdWQgi83o8bdwN4TOYNSRcdWdrT9kAZZdc8MCrzfg\nqaOQxuf/7nUODD93Tfa/WRAIDrENZmxu+4ns5IvumAvRlGtiJFPeHZsw4EmH\nktzcOgM23BvqnHTJeqTtmzokZymKpmehP13Ie12NBpzna6a/Y4K/xc7A0fQK\n1sxGpsYz3koGL9UjRwI8V376ePdgGL9IbTwx7o8y2e/dUX/Eqrrwe/m0oJrE\nwSSSBGJz1Q618E9RzCAS37dj0VHl2aKhc0SQ9dNP+XfpHw5aACc4pIOjp2/L\nGftL\r\n=40mJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfdYUuCA601jZub4gCEuU6GHr/iHbk+ehQrn8xdNZTWQIhAOcYerD17/N+uUw6C4wTnUs2f6RcB6/4U+c8801CaTv+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0_1586290692149_0.5696219400896345"},"_hasShrinkwrap":false},"1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0","gitHead":"b3f865e98040b798241f0169e7be18da4e1a711d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-iNCv1+STTmuDsG/MusIKgTcEmcq9l42uWffHvPwUUuT0dqg1L8fHfRkd6SZMf2Re/p6pcFQ0UD8y0V3l4Jeayg==","shasum":"22cbe98ee605a910066e6bae975d6cb1ce5eed4f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejdNSCRA9TVsSAnZWagAAWq0P/08w6LApKFMrCbQLyl7f\nGTIUuAdA4D/HSxsUCNKKQkkpbcNiNSocHHchYLg9bnW/yBwuSjFcwkaPR10I\nDL3s13J9WkIgkX71idVK/En0geGiMi4ADc/wqwgs+gsRbPJQcYIkWNRFaiFp\nB2xePz+kLqeZ8v3ZJq57XcBnCpD6jcpguE+kM7hAb2uk/I8qoLgkUU2YnV55\nm8BrujSeIXzBlQT+xTMM2QgaY83Pm271nVfAIsKfAKqMpN+i+3E6FFsY/J/Z\n8D6IUlsZKO6qAS/nIkcwicL/guv+6oAMQ5c2WZZJo1dDNmVCvGlMR2ATxplH\nJEheO8o/96nYdH9IndwxHjO2m8lBLvauCDqCYaFeB59JfD67EowGfW/5CaB6\nbhwHBFbiO+jfpNzc8BoNL2L8Ers2Ayir8SGo9vRUq1TGrzhA/4e1hAG+nxDg\nx4OCc0wcYF8GEJY+wf/DI78AfWq+ChO1uHSE3NwYaUBhZKaoOvLp35QXOEm5\n/Rfx+ZanIvrvW1MviQHzSLx0dAC3eTyx48Ib5i6hKHaBPkpvEAD6GkhzF2Wd\n4Usw67zcBvTRqK6zJ9GPg8wMOzF0yBiqvwk19n8esvcxNWlRdim9UBDLHYgC\nsKJE+htjxaJdTS4G7WRCc8qdlib2OVT/MUlPRXlgH2sizdcP/XM9B386wKY5\n05Q7\r\n=nJBI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmJKrl1Yfr2OCMZ4NYxSFx4pFDQFzC3v27iRZJidYSSAiEAygK2qxlgH9ENR6UkDhXPztJMBcYxiksqUyGwBElwNl8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0_1586352978019_0.8558876535047848"},"_hasShrinkwrap":false},"1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.0","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d1e12757312f81cec0aa1f77d5d83ba75aa1280a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-A3bSbAoT2laJTutvkR6o3xQ8Tit4O6x0JIb48YK0n/qBZ13FDjituuzQgGYUYNsb98cg9XB8nCED8/nMQYj+eA==","shasum":"d54facf5872319907a750d5f057fdef870992c07","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejdN4CRA9TVsSAnZWagAAHasP/RZYmbZOwyzS5eJJ6G+S\ngFWTvXEj+vUExO4wtKKuvav1Sx6ERIR19O1Oj34qpkfnAReOcj81Sg2O3qhE\nElEKzWbiKY+3gAze/aGEPRA6ig6b5wqCLPIMWaweoHmW7Fhsa8gagKoky29R\nujtCiQV1F2QFih/xXjzVndJLBk7hjBRm40vCDF5tS8wXciaT69ahqEMiVHcG\nk8AzIhUqOZqjQDVOXJV8vOyI9GIBNNlYDCmKRV00KfBEK5qLppI/fhDzuFXt\npm8eTtEkeObJ56xNfshJFTNgPhsddVduuNJh4YBnoh33ZpKrtm2LWnVIj+SW\n92rEIE7k037FHLUdYwwM7yiV8WeCdpDYD8VlCQnwkOgjKaYVN+ac+zvWHo53\nOF6U/GtASCTN6adlsVID6bBNO/gjThP4UBqauMgyw6jLHOc/1KGyeelP7lT6\ns1bCijjlgDzkeoDKfY/wKKf4fsCDm+RTz3PpYIR6CG+NG2Tgk7TOCIhtq2qt\nkdj5BIn1fMdmoMldlNqDSASxJRflaDzfMv6BF17kPNrMsFyvEcvuRYAeV5Ff\nWFUZA77NyeRmIlVs5zP7wGK5ulVtbhwHgshsiKl8nY9Z2pUN3fYDQ+HINTIr\nXrFn/38ZPtmWzEBlq7aEZELRbTl3sn+rhtl57ncce2vg7BYo4xPXIprPxlvL\nkp3a\r\n=rQAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnp0qgXu/UtSl5jIm71l9dUtJqbiwl883LTdNQ0ZckiQIgTsnVI5gM9IB/RVCDAAV+Luv6LD39gZGam079eHXwQZc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0_1586353015652_0.8866869317340635"},"_hasShrinkwrap":false},"1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0","gitHead":"1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a48FE7s/W5isrCCs1sA/Wwq8ZAgWx0mznxVJwD5BeUOYqQlD250nk7hT8sb1diutHaE4L6RdBjPTDow//5tw9w==","shasum":"1724b50bf18338653f8b9cd4d060ba5cd8792758","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejiIRCRA9TVsSAnZWagAAX00QAIzEEtHRjAYbyCiMc0Ya\nor1iZuz9CeupSqLXRl4TQc01YMinlPI8ab9vVux7ddJQosiq36ABKxX1X+8i\nRwyvWvXVYhFe54bt4UmwV5CJc7FbwI94XeD0eGvJ0M47whYf62DOWoS5dJ9x\niWbXiRxB+yGRQqaUsUmRpiBS0CWVi887AX+s4Ynz/8L2LsSQwhKLiF1OSoLI\n0uurcQjXGsb7g88cGuBVYxzVN6s8cxYHvzqnugmvyS/3AoX+q1wBBEs/fWl+\nUO+dZyJ0zMZUklRSx8kWhL+my5tJI3bygmsXWFoqaRWOhO6uPltP1gOvaHll\n5YHXBpz5VZYD2fHCGRtpEYed9utuSGoBw8DabIN7q4OGzJHcSVKkT0M4z2XH\n0CHJlVULIzAi8EN7dLgoqUF1rZP20A3BtUsOryJKajfEPykibGF45AIP/Za+\n0sFSHJTelVQ/+0H9qZBIweWJmO1832F3l1DILvbSpBGn2CZEv2bIwkFiyibg\nJNUdCI8lJk6HSOFE4ZKaM624poATfR8IdGUVFcXl/B7roPe4EolAtn/lSGsN\nzYZnQJQtsu0XUanVM1oubQn09IJCujlo6Ml4DJ1hDuetqRciBNZWwoU7IDby\nDLQVb+B8VZk8vxBdmZekhTfpinfozG4S/g07CEZhKHgPDcCgsSJA4c1H9q0z\nectF\r\n=ElkR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHExeyhoEa3UgoBrfLbryJuhi2S5yTNes8ILxPMzyBTwIhALczCHiIbvBFIFGYaS0fjX8bWSaEvm9BlFPswevWnWax"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0_1586373136774_0.3323477363255465"},"_hasShrinkwrap":false},"1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"529b3a40ec7a09ee92a597bc46de62d793bdaaf0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8lwy9KtB48P3Z5UVnDP1KswLs/fjF4BCkdEEUmmaZyskUTzaEF/OKw/JVh59MJEsY6Ld/O21fpSuujONhKYWoA==","shasum":"30bfaa9cde25f2876430e59805f7156844eb8a84","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejiJ3CRA9TVsSAnZWagAALDAP/2wnhku3/w/DLFfrCtOr\n+pb1luW9w4kO/bdIfnIgHNStChzMplNCCjdoGHnG3ATUPYnr+RvwCkkyZbO9\ndaj3gUomijmhNlVrXlixP3am28Vokpcy0Oehxs+PZPy65bx19ATsWkDHVY/U\nIlaMbZDv3Mlv79VsKQeXT99Ia7cwuNZFfEy6DrRJC+m7pkTjU/dl07XbHM+L\nNjQBkPm3T6BTLUj83ZHUXJLoxOUuZ+IiFpQFYRAmOHerv9bi1WbUxDgi4YWq\nA3KHemytKyUcaOC1Z+awOPY9T6I4kxer0cWvdLXQ/samSmHFRqxDrXzhFrCw\nswKcKET90bdeUZJgU0OBXf+fPr4awhozoOUFvnbASfm4vc+jlGHcVYGCwhM8\n4RA1vgZ6XBNs14BwXcoPfAuZfUYoMSnTpWK80nlc5O46577F/AfH9cnSFjfv\nDV2btxZmQ+VBusHWIJYfF09tO80Iye7xL8rdJM9gYDeM/tGM0oMIk4X/Qixk\nUYkrvaFdQcc88BkAIikJtTI9NeLhOymjHaaJxG3YK2uU960dZNDC5M8X438d\ng8snVTZOAYBtJWKh0k/gbKFNr3DmLhQmEAW2mS9x5Zqm5YYGZYI0N9MZEXJ2\n8sZ0aNpBUz7cmnFVtLGCrnDSVnECXsruGlCCiR65h5k3TaKiFxwURxLIIzMm\n7KlO\r\n=7MIr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBPq/qJ2sFBr6mAJqLPvexKN+Z3mKiGLUW4FlV+A1rZAiALjJ7HOGPYLILD8q+8XyEzXH4lvynPR9sZCx77Fdc5Pg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0_1586373239034_0.8395585937978107"},"_hasShrinkwrap":false},"1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.19","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.3","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0","gitHead":"863782127e3576a5bbb1fad76d6922e4b68602f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-D4s+Jaq3gLpO1AryC7UxHFMSlhduSzlwKpHUFxrzUFh7YSKJuAMzW93ztUVUycKouJf3KQ/UXiUYNMUWNIXAAA==","shasum":"e23d49cb7ce7d4c1c22e774e2834f90ecce30d82","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejiLoCRA9TVsSAnZWagAAVloQAKLSjnCgyWSYasCuWECo\nAuf2yBdaIzFF4OOwpiMFUglMMw/bsoVTf4DLr1uQtTiHY0rhmSm/+J0LzHcV\n9lw4nDVFHWdT+9m0GzMDsEVft7Dm2bfWZL7ZdjtO500j+tligr2hoG83yrQs\ncj4hy6ZvoFwRQJXAuump5vk/GlJqza/EGtML/JNFVnGlxbjTplndy0d0rUbV\nemY+XQmnbucesfEPXul0vLDG9NThCCU8UAqUMfEuPm9bnyxrkb3NVUmxL6KV\nfJg/7Nw1t7p+fYafvnaFASXirVmjPpqyN1kt2vdHBwHir2+cTU5hvSPdcKxk\n++jI2MQCVujxpw/YBME8L6I8b2nxSVO8meOljRTrNk2PAGGk0rVG9zgZ6COB\nhS3ym9CJYNU3VCVoDxDulYYDVwu5BnbSJPGN1rKskzhWV86lPpBbvrm0TmVW\nZ7Pm5r2BmuUpDNDuRRHwUcPnlhSQuF6TqReJ5wKwtOTfaTL0SryQm1MjVQNt\njcKjDwogDsbZaZ2WHanADabCVGv75hyEd87dN1sqMCxouu079IWj+zjlHZ7h\nCrfD2PBety2Ow972C/OcXCA6tywZOKCbS666oLN8gZH3NAKlj5OHD9PqIO+S\n+w0skVXEUgsioHhfc9oX05aKkY6EQ0qLsiwNaQf83qAMcS5rj/jO9De4EHDw\nsP1Q\r\n=ecRW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpeJbfCiUwCVXu/6ZbISwfAVhjbbtSo6qwyIPr1uYWIgIhAMvtIBlaNUPfCe9rosBMHu0f9ynbEcbUblBQjYOZINke"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0_1586373351830_0.9425879919240518"},"_hasShrinkwrap":false},"1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.4","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0","gitHead":"a7bdbadbda86e9f0a013e51e3207350f9621dd89","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SWV21m/OaRnj8KpsGRncn/Wq+XIMe8t6Gj7l1XvMWjZEQMGx7X1gZnHiUpTGqfuhXe06snqv/O4VWVvX8C/KMA==","shasum":"60ccceb00b50d70e9185e8b0bdaaebcf576cc938","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej1BmCRA9TVsSAnZWagAAwGQP/A+A/KXWjBfUYt1ApHAG\n8dkYzX6J4/coAcqixkKOet7ydcISeLRyYwvy3e4ObtQfUso1sPNwi4ATCZZD\nxifjh/umUMaRSw0sHNRbwNcEEV3jcq7yA6J0oye6iLBFlBk6LAsqiOTob1Xc\nZnCAMHZ7IZ30gXW+dhN0dQrDWrxsd2/oHBKo4ERo5CERO3HvC4TRafG20743\nsyxl+NJ/m5yUvECF/Q/nfOleKVGVD5ccQYqSs6qD7KuvuLevpRDVUJxxH0Lp\ne0eQH+myvqNzfiAEsNJFNgcWuGtnqhjLnLTE3EFWtXPYF8AHQ7lhDzKvB7vb\nXb76obMTFN3zjU6rlllUIv0/g7llrNOwMxaTACthBhCTk3BkiT60HKpn6Sje\nSET7NCLWvxYwDDDA/jYGv54VPeexKmPoriw9Hvp3kxilKGHjA7uYKGhjKJao\n51Y1nDfhrXJqdtSpYHw9nuG/hAMr4ZR/2X5YzxWLCrfADNrerVFRhMNmGoK3\n3ea8Bm4wOUSv6z01lY/JfHWT7f1nNzw2G07YmIpjewHAnATdzuPL9aG3kP86\nRSZhc79IPe6j7UUcMNrBekGspIUSaIK3d5FKkPyhN8iUI0rOeKa6/cYAddxm\nXBkSZPHYY+dxXHkH0Phz8+Wjh7P3Xmq6fjA5uvd0wpiJq4Lft7B+py1K4TJo\nbijG\r\n=+/3R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+1+e3Jihi4AmUgMstXACX5v2IIt3nSKVY4AlwczmdTQIgCHbvx5ctY1lOrj6YKRP/vj8VApHwuuDunNljoF6RlB8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0_1586450534022_0.42968410398018064"},"_hasShrinkwrap":false},"1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.4","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f9438c2ddc01b39c3cee2edbbc4411be0e9567f2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-W2nAdpEIvCp3NE1d/GnMLhmc4sjvrOYbva0nrG/ULmm3SolhwX76KclgeSXN+6kAvzyfAZOeQqguh+LqEyf9RQ==","shasum":"748b49393d70a4db1005690b6c2596b0bb3c130f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej1DDCRA9TVsSAnZWagAA3U8QAIbQ/IDRNhSdoD/e9UsZ\ntVSkZzGDUh+ncU2Kfrc0P3kmWXk0AHDfj0V5GaSg6JMhlvkiqwfSktfuX18D\nTQBNPxsGFPJtCLYP2Pjvbi+QW8d7SWX75wpnxPZ7rrFQmF0KE8SO/mzNHJ+D\nSP4TiZ+FuWmsYGxGyQEkcqudCLfDsyvlyy3HqJWaFdDxa52plMFyaY/7n8Cz\nUZoeNuZKFXf1qBx/slIkABMfi1wHL2FgfGydzj2IoZeYDVI269mBOh3+XTDp\ntm23XEOEL0z0PUl4Z9eETR6sWY5lpf2pqsUwN86kty87QUzXlcdL8mGOznpD\n3nX+eAtXPtqVcnniZthokkNP5ikcT1pTDfdMxZxa07wXPcpIbrpKbPml4FLD\nMSQsSgNKLSMDZwdf456hf3ezRnEmcl6M8jIFWI5epr7h8Dx0U+ceQM1qzgzH\nftekdBjYl8gxnmL18T4OsWGrNYm58jC+Jvhty3l3YWH7+lXxf8Y1LBMNDI8s\n3w+A2AgiDED8Ds8+E7qa5RqIUoGT07dDsFPcFAEl08oTys78knByQxh51NEe\n5+9LLoc0Dzs2BkRUUPWcA6KepYoxM7Czy+plHSyXayWEUYMPqUDdxssjVjHx\nn1qL2OpgqHQL2XoS1mUOXKnC8li13/qNwPZ1upWu9loqqSSsl+KtNOaKysRn\nsc47\r\n=3U9h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVGPfbcys3/IhQN6xbPNB7zRz3JQnbAN8JjOZ65jTSjwIgWepCMUNSXa2hk8J13/o3dxCLF8W8DpXyD28K+FRVvPw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0_1586450627034_0.5850378496879254"},"_hasShrinkwrap":false},"1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0","gitHead":"e77f7db3044a28d25b1eaad06f32990b5a8c24ca","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EzyjAUvSL4IPVeCd6jExYo/yQPT5kKiiAvh/Zd09M3tXX3yC7fi2F122QSEf3bK7o/itZWchxOD+x1kwB3jPow==","shasum":"25e5a21d2ff873bb61eadb395ed20aa019fd09d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej5T/CRA9TVsSAnZWagAAQuoP/1GUmaDa5S1VpZsOkjY9\nSjph5L8A96Z5ti19B054PwuUXN3gYDAS8KV7kxDR9Cqts9Vv5hwgoIN38/TA\nfHgTJ+05FKyEfN0RF5/mUgWrxgei8z1ox4rtn6affuUOpmoeiow0+JE3bl5l\nHTLJi51tvN9n1AkSMXq8WxO9o/q8vJ8J9G8rFrn/LSuVAvdGN3bNEbe2xQn1\nOHuQwndVNb+v3gk7uFCCTreIyiNpwp4DyhXSNIlWwQiqtdpfMRXWNvP5xfLl\naxkRW0+CX7DiyCOMTBl7kxJdV4RPxT5aD5xpXl1enW5HCrwrd6c9bHK4Ez/I\nc2MrIzNWI+U1CWNlAFTlI0wyYaoGsq/ZikdNfowd4EqWZNHd1bAVIfMw5Upi\ndRQDkBumtW0Ox4RsdkjsE7MqWHNJxzswyBZ8wLXvg9Y0q3mDWQ7WMaUlPFMh\nkxKAznTg7qPYAfZqjYg67vB5nzNr6+8AKZoHGmbSbp60lxY766rnYMwWC83d\nAT246nsOHSCbFsvNsaLoUUctkMoXsPT91YMu7ep4teNdDvwTs2Y9wLWBaDxH\nq5N2pXyW6K+w9capkCvQ7wqy/yPHMXmkTBf4vmBFal2yyRf/2AMXT0kWiHMi\nnmqgUxYdzWVo9NbG9wpSwH2PBwArI9TEVzVsE0qZokgL3D8WsP75R4rb+Lpn\nfkEU\r\n=0Rdq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClwHeafQ9Y8e8eURpfWCezz/0rsyTVUsAJHzr4wTMlaAIgLbxcbvPTo8/+7YIATxX6eCNi2mIYyTjdGp0CzzGJfKE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0_1586468095321_0.47313594138439674"},"_hasShrinkwrap":false},"1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"db60c7c6e98048d960a9f836a3470ee251487195","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PM/txFa+iAYxrfriCNQZpnUYBLp1UITL9Dn0NDlWCp/wK8UE4rzavr/OYD+fye5NeVnsEWdxXdChvs/fOP5LFw==","shasum":"e127156efee1c110d0a2dc09a2033be6c46fbb10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej5VVCRA9TVsSAnZWagAAZREQAJ6syHrhHrCKSNpJ36er\n+vbSi3U8E/EDjQkdd3wtYfE0H1cGoP4Czt/OnEvPivwyIeXCwqHGfU6u7HOd\nB0nVtd+SEeKBiy25+TeosEOky6GSn5ZAiAaRemegm5Tmvxv0HuC/lUfSWgoG\ngugzJayf65m92aQpdsG1dYmMZIyEoY5NAlxk1HrZricq1Dr3YtixGROQz0mE\nNxOhKIsRPBH7mtF3/OPTLC4fMxBTuPPWJDFb8/4vEFFST5WBZ1zkZbaZ1hY8\nK9Y4Bt6ia2MvVOCW2zWiMKzyKtUXSLj7239bphFPPZBsO7WoGkJzzZI5xEad\nbz5m/lRwCj4tVxyXegLZmf5hVwFq1jYlWofD4qwkRnwsq8GjfVhPLT0/9Jm0\n8Pulo4Mlcrrh6gM23cbTI/XZe6pTzodBYvtnDHXP6d86VTlmmvm1MnZK/2Bl\nJ5GTLc3/JCbKotdULSUG13RN/xyfrNDiiAIQ8RlmQD07wekBbI4oTJg+cSYN\nFYeEQOaGVfn2E/nK6Rvg2QwTTCXzTHd7sopsdWpgGicrgNNDA4wQYT5r3Uta\nDgA9/f20DINPXcQ0v5Jle3+ykKgecMLu3T8nh4I0P1LqBgRGVmLypfcJuUQe\neo5uf3/eNOXWe2hlZ95+CpvsGTei3gXrR0cpCUzmd9igd7XysmwbXQ0DhHkH\nXR9Q\r\n=YCrE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBfE3tBUqHT/cb3W4x7FbdmlK11P0LYehcVDl+EHpsnAiAHhoI6QK1h9LEn+v5IzfFqulZyzjI80+Lhv+7RVAM5tA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0_1586468181057_0.5832448861219204"},"_hasShrinkwrap":false},"1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0","gitHead":"1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-B+RLBr9ttn24DmM6MAVksDlUhpuFm5efA2nxRtdyBONqsqc01rFtK8rRilqarLeVm8/9f7P/WQGZATfgrjY7hA==","shasum":"1d5e5ac7358cd9e777423d27c466f5cee3e19914","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekCk6CRA9TVsSAnZWagAAT48P/2vxnHuzwu/BJADdQqjp\nsqZuVntIu7gi9pWvITphBPSt2brjMepmJLvJrCNZz2jKDjZo9yeFvk6qx+5n\nLCJ4WTVcDFt3P/2DKhxIBcoMP85i8VgsErOvH3ud9Lc2rJ5MztXhYcog8XMT\nLhK6pCP8oZbbrL1ztraZEAOccZZQ53UBIEt5al+W+ZxcfyfT8wsRHmAPtere\nsF9Vm6NUg2YMU9KufE6rNgkCoTZmW7+rkkCL7H2rEnbVXptgau8xCn1NikEg\nliutpG59RimjVATQGNMmjx4JJ/V61bM/6yLUxRt1ublS4XvxrijSBtymb9gt\nHbZIL6vMhroRVLCOvp2uwoI3Seh2do+QdGEcQFnkxtKvdOnHgk18cMg7H1Mu\nlRe7n8nakVV1x092mIoFdhN8vXVHwj2lWSMVD27JncAtHots2jO7OnGdDFTo\neNUd27xA2JdcHjNoUIS05IIK6gXOBYD3jnxqa8sdAi5iAwqR/cyIoqiz2LIL\nUNPZs2+COz7WwMck+39f8+jumCy7R9Q3Eb+x9iUG/dpcPKGy9f2TBbByHxxt\nsQ+NB3TSETTrpN5wAhD/aRUx4THc0TGDkYZSuPzz1m/DO0zKtydr8olsrScM\nbQPzGlYf/1tVxqzaTYTEIHZclOAo6rHqCKHF0bIqEEfcVQ+prxl+VuMe/Xww\nmmou\r\n=RC2x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3Q+ciIGVkSExJsOkT9A+LLu4a+ofGlbYFLeRLAAjMjQIhANnO1IDdchhevrJDQZfnne/Wy/Zc63l2GySiTUXojJBA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0_1586506041504_0.6199052518570587"},"_hasShrinkwrap":false},"1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.55","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a14c9d193b14327b83646b1d64ba86a52bb994d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Fdhb/4lgXLUiK6lB00IkRIcQyCYxeocZ8bz0drT2AjE6DYXkmUN2dw/VGkZkeG5A1Dl4HOE5hg+FIwfCjuYRmQ==","shasum":"35d762a95ada4c4e7137fcff2cb4d3fd229f2721","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekCmJCRA9TVsSAnZWagAAck4QAI0CZ1Zev6hyoy/R/sep\nUCT/viqakLmriipnZnWY3erDDGwXbTgXYWzkcX+OPNzNiH+n0ACZkAtnfktu\nkJgowfxsoItUYC/rM6dyAieAyZqYb9x3yAo9qKuJNljnBiqv1mFRoXA1FaoM\n3epayYWh7LtC3Al1G6imgI5q7fZPgx2CaY1aaKToN+8zLLNBmvVJYC1GlKBp\nAvQ4k0O7SxytTIIABipMoyQpzma1FqtmwtFz93JRDYHi4AgIf23yNuCvjG+G\nPDavdQQsMrQ/WuczCaDYnfxbNTNn8SC8TRvtCPG4aqPuKGHl7hL4nelEYndW\nTw448mTZoTQpFsdmwU40Lgo13tWks15Twhp6VGgl3kxE9aDEekHeqc8E9E0o\nKZWw18bvxvAESUQ3HzlSaByGYcttAwsYFLD+KG7GA2bVRDmbY5G1HGrmMtrL\n+ZnuG+yVlsHFqB8czqLuxSuCYPHPoh4tLJCGo9Fduaw9T3cCCHyuWL5lo6wM\nfrElt57yQFD5iisfQvmCjsx8QCSFVTaCsMMQrMUNo0COeT9aTIUNH4/ftz1R\nRO1aQRN4JxObGroMmN1yClVlfYLj5bjwT9PHq407MUrQAkffg855pfCXJpTo\nYgeABk+CCqa+Q6Z+3i4aGqjbUeXmwDknlWmuQGzV2AcNstoA34pmuqfmWGzo\nwenc\r\n=QAoq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLZ+N7tZSABoj8NIHNOF6bNDQofJtOZszrfplhRmFnHAiEAyqh/76rSOgWc4A+AYSHuJ23Z24pZRgfEjIB/aNwFYnE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0_1586506120722_0.5150814213249431"},"_hasShrinkwrap":false},"1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0","gitHead":"1dbd7c53697b40ceacb891e9a3492d1767763ea4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CVp3nYQ/h+k7UqzX//bSgfLo353cuf90rgGPFrPJHIP1KQqcoCb77kZP0KCM9pNqIM9FNpPGr6pzUCZMjm5tug==","shasum":"30c18356218ba6959184a6b389fbcd650d62870e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekEBTCRA9TVsSAnZWagAAnyEP/A6NUkzmpP+e3Gr3U1UJ\nMFahwk6+lpTTl3o5TRrQ4m5ABz4vTjNyrnP9CjgPPWtZieIfyfbBLKlwUcRw\nwVt8IynSDyhz/IYMbblLzRbrmnMvUPN64MFlAO8s9TWE/Di9hfoN2eShYIRl\nzMzOo4x34YrJikOY29qXOq79oBR9f7sHIrmVUnxid2K/aEk/sf+n1oUWEV/M\nKSU4GcxjkfPi7pXh9bhpneABVJn/FchibmqOPL2Vze2m0EWM+oCmvakigRCR\nJBpTV0k1VQrMmxcZi02zst1Dse5rPvmYak7Pk6hAWOqTJnlPhFMFvCFq4Kcb\nvdies5sf3vbm8Ksqwqr42Nqs1nkrPgPKuMfSc0LedL/XH/Rv5Ds4WUuzyIEZ\nM9J5qTJJwqnOKsxMnE2nq0rn2Edzq+lHgB332mMM3SzwqArUd4SpZLFZ7Xu+\now9YRBPgRVXULHfwc58d4ZHzIr+8jEXqKPyE5BDIUGmJz8CfET5Fa8tFWt+r\nL+2kt49QX0ukqsSUzPzP2T9oN2nMdHcVvP5kj/H2yO0pq808uj2tzO0610tP\nBqDqxs+CHPzi34iQe8lQqp7KPNwD/3wju2ZRRw3BI4H9p4eJsidxHmGa4W0s\nsmiPqYmPKNIp5DSJTZq0wzEZyOlSyeMe8Fd7Sg6j0jSSUU69v3VwqWYURZDU\nz9nW\r\n=kNyP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmY9vxeAEjM6PIuy9WIuMO/HIq9gJ4UB+W2cLqY9AhQgIhAKpCUfuZ3wmOpRK39n3SfTlfBfbOLjiXvgQ4VIrC/MZr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0_1586511955394_0.4293834876887066"},"_hasShrinkwrap":false},"1.2.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4","gitHead":"e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3+8qmVc6r2j9mbJGNx9QXqNzzSjVBjnGdyDGbOWeajaA7zXt7wcp4jrQMY4MizLHcd7HJ9we1Fx+zlEvr/S25w==","shasum":"b66398fd7d8b803d4656507853ad766742df4717","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4.tgz","fileCount":22,"unpackedSize":108591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekEC6CRA9TVsSAnZWagAAmwUP/R5aDU86etdHhvRmtL57\n/kNUiyh9UTQeYP+hK7TJL79TJLLQ77VaQXmdWY3/64pJZnowOoOIpD5TD3Ib\n4s/usdVMC6Z/u7Fs0JVDq0lATrh52Dyiq9px/GQadXioKhl0yAED/PIh5dpL\nmUeiYN/vEu3qAm5NedbIkMd25meEaP1XGdadfe6i6Tc+3MHqS4zA9rCgnrzt\nmT4QhkMH8xvAfuZAmHfoBx1QyfaqF8M4+odlDZbLQmyFuKt+qziQUjIVfJGw\nqWP2XtKEHbiG5o/LszLJTmH1nXMuDx1DXK+LHaT9fmTe3jS2ldP0Z0fKMK2n\nlYwsKO5Ub/KxssTsl8lG9erfvAenq+EOhfUYPX6KEf5v3USs4piycswwLW/g\njRIItgmoWaqk0CKsbB+DOM65U/+IcTMEWrAFVRRQvLhc0Evc5Zz81CYoYttT\nRK3oKg2M6ErktTJXitYORsoVqvSFEAWNvF8NYNrc0hXi8G/vuvBpJ/J5Vfa+\n4PZn7yQFZ5u/Czjxs6qHWWrVBObHP6KWpZ3UHnH9OsNMCD0a1LYuEIW/ue8x\nE4MqMRGxkwbWx1iRTlK5Z8YaB/VzhXsDIXaxwh7xoZeirfCImyViohyi7FjP\nv62Q95BopET1ZUF+V/eaNHFMnqSxh0qNOjF6bKBQdPJ+zntYDHg8TDkPmxvL\nzDeA\r\n=SHpE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDtii5u6suTShGk2mUM20EVoMQWfaBJfcmpmaHRW/KmCAiA0rLoa4Od1IPjeyvcIh91/5Q9jCn+57oYmlOhvFh4GWA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4_1586512057895_0.714271501425431"},"_hasShrinkwrap":false},"1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LRJ9qK0sTi1MB2c8U3BO/jWaQYJkb0/FX2cZ6d5t3nRgnOXkTDl2es1s0xhChnlTPlZGxs7EG7Ate94AZ0H/GA==","shasum":"cbdbe5dc4c9747ec795151908dd871e83f96a685","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0.tgz","fileCount":22,"unpackedSize":108634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekEDZCRA9TVsSAnZWagAACyIP/3lVIyx+HOiimAYkS1/9\nWIbPIRc6YZeb0a+vPlvvwfdDd67FIimfDwxxk2sOE2HJODH/xbBiK2FDcwVw\nUbZhs20RwMXufW3/vOH5o+UH22s+6h58tR3XcRRsJHDwhnMwqRD0tBWl1Fx5\ngM+PpihT7jbMxgElY7bDD0b3tHfSo69HKeBAn0eCUkzKKJ5l0nmyW0U4qmmR\nsfltplA27IGJDQ84JODdNgIVj7kZx+RDefOnqC65q85np5vmQLLlIAbA50z5\nqCZy/Bc5lrMu4GmSTC5hiVL1IBVzySSIVBnkOTSultr1ESqQchmrg8DZLiD7\nXSvGaHb0RMoSoDrWHj/zAPLEUNmQGMbJ+KvO5eHLQ0IwnkJ14KXxZAufy4mL\nrsraWSEkK3TytO/A3W4q53W2FOKz38OQXdoiRGBaH8LlnNCZ19UZ31JAq6Pf\nHC9crgSZawaM2tzxNH0AZmxQyRbxdASmWfRiSuYUWE8lfLnT94uxvS81hpNx\n8M0Wwxr88+9FVhoulCXB8CDT5IS7dy6kgQlOC/hnuHsHoCuDGik/HMZRDj9o\njQvFC/mcDWl8eMEzTagqAfOLixka8HOwC3qc0NniPeo3BGMBjtkDBV99xqPe\nQU7+Qe/6KCxgoTAe3KW1V6EKbNl5RJeGSGz4r4lqQdTbQG34IE52A5O3Vksg\nc+PM\r\n=6GOJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUk5Reo/2lgCkqF3SZiPRZQORLCkqxbdEn7pEsUqwLmAiEAvbBlHPJKKtK7gtntjsQLbx6w/KcU+y9p+JUsxflcqww="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0_1586512089403_0.7100961479156163"},"_hasShrinkwrap":false},"1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.3"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"af0c109ed8ef443d39e896b786f0d361e44be704","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TAroV0Agu5icMn5Fr4uaY2Mq4Wg2G+w2u2GGW0e8UDKgIKy4ZoJEQsnMBUgMNnCdjuhbx0ojYbwxFtTaBGmUfA==","shasum":"dcb1dbe9cfc12bc2f83f4f068b1e11f60e5c91c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0.tgz","fileCount":22,"unpackedSize":105740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekEDxCRA9TVsSAnZWagAAgRQP/095bV1eJMw6+6SS7Fq5\nYy+wXGrqr3+RtcfmyTsQR1HFoIYXbNWQjj/9OW6H6rgHXWH5euq7txessRTT\nMnFKCfWBAtlw2VZxZtNXKdRivPT0/hsHCsvV1Ffmjt7M/N4w0SsErkNXYeem\nA3enlu6B3hPTXgiRVk1rUlscqiFwAZqdIYoZUVnZ4TdAKcBsjoryNxYjJi8Y\n9hd2wMlx24jSduvQ9qAwqPN0XP0fwncD9MOCCpSzQ8PNBqi+lxTjxG5D1H/1\neP2JhORV8zx0txYA16rjJ4YXRWbRZX/WkzAYDA8a7ktnrxJh88WFx6eR8S6Q\nFEBU/fOXN44KXFKXqWhX5bhCv8PFIw0nFXGJSgz/0VKwp9LxG1GjcVR/G1Ia\nXKXnn81TqqF9/VORkxYq1Rq5CFTLqQ+/Yxsw5+I2zaAtK0c/Cqs5L0qjQug7\n9hj+XwGV67OTg7UjqAx59TOLzm8TuEhqw7Iubb1n3wEeG0n1Bw91G70MWi7S\n09TVZnJuUYV1VFxZEhPCK52w7ewOdXs584yk2z+lMn2FDaqD20truEXclTIr\nsy+fUKg3CQzeyUBi0z6yPu7OuoFGpBjkaaoJQKhvMYnS9hZaAgwjBBLt8tdz\n50qMSYh7GrGV5hMMkrY+pWDoSZ/Sxv1vrjGHB1kM0v2a01f1qkiA47Q8+aVO\nr2Cd\r\n=i8uO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtP7t0sdrhxP3807v0ECnteuKkRKEZiVmIkawkY9Al0wIhAP/tt7b9uY/OpVXRh9E5RJiakw9g+rmBnyV6+cISFz2p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0_1586512112750_0.2975748371351703"},"_hasShrinkwrap":false},"1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0","gitHead":"8b0c0de2257ba1eeb7514350547104f84493eeb3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/RfAGiH7A24c1TLqdH18BS2DxKiqcYG+S58Raukr3/62ndvnszzLnLImseZLanW+1XGuhfhPgVXqQdmu4/uXyg==","shasum":"6eb3912e4f7a618cf6402cc6babb897c5edfc4fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0.tgz","fileCount":22,"unpackedSize":108634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekOAiCRA9TVsSAnZWagAAiTkP/16O81eThONvGeUirkg/\nPJM3KK04qIcj6pGg76NRvfyXLO3jcFTw1T2Ry54aQzzJ8qxCoo9Jdk7Abumu\nJqyYZABZ1yo43+uCXvFN2qDf/dk56AN2IPj/35Hq7jwINeAjW0vWe3+qgpyW\nLawcwMCXWFNTq60rkTIxIlGVlgiYnfC2aGMRTSNpT68XHahyEuw4L1ic1C0O\nxE1JlbuTho1jPElmvQbWh7z9fbD9D2a3QLg5BUsO58zIZZSZbHAyay/GHyT0\nsADa1OZGVYDCFOQ4rnRI/Jyzsh6P8ItfivPLzAm8qQDELSWB3T5YM/OW2ORQ\nJXH4LWqE1kEksIRvZTaQe/woLxYEPVjb68ZnWmsMfMaXRTH/zIlwgRywfOHL\nuvJhFQDKh7CPHE8xNKYJYnuIAkLqome3QvQb6hzl9q0o5IL1/MZHijaM8TDN\nfaZdqZkmHpQHTlhK6bp+XPDuApFJYE50uk808+UZbruT1kkhe/oJiZh6NWDI\n57b8aKVw/04DE8Fi2eUG2Xg6Qrm2rY3OyT4vnZdBjPFtRiCRO5oDb3RDrtOB\nAy5BRt0uonXmRJdBEJndldz90Avrb1V9vqaP0ySA6AK5Ga00Wg8GQ0xcSorI\nrYAfAEiyG7Wpoc97GxCfN9guemA+VOG7xJg4+kHlBLMjCLFu5isoL0Sfkopg\nnfVx\r\n=OGmH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7l+PX7CeT+h3sIKzEvch5KMQtUVSEO2bW/RFTy9+KjAiAd+luzVp1fAq5AD55J3rxY0nIbZ+bWbp9xTJuc8zVKZg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0_1586552865560_0.8878482925161169"},"_hasShrinkwrap":false},"1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e3207e73ea5e92d23be79df61d55b1a682a8234f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-o67f1yi44m0W7+KfB+Dn5dXieJqZfGLm8jdStOgHxgy8wUUTPOq7eyrPO7bNd8V/tXs1DR8SjWVCtd1Igpprow==","shasum":"0e1dbe329b74e9bae0ebde2268897746bb23550a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0.tgz","fileCount":22,"unpackedSize":108634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekOB1CRA9TVsSAnZWagAAUH4P/2cb+ePMvHVCFHvVGn8X\ndbVa3+JL+wAnsbhG/UFbw8lUVG63kQDqu8L4adBrxvQAcLlBSxPvIBj5l+bL\nfzt8c1s/i9Pa22X6MpkMadfY6zG5fo1umO2cW7RYgdFC6p+k8s7p4wGYjaAa\n3RwRMeHBdbgpDxaWEweQmMr3zEhqK2G8pLWvjoLHCowH2+PwZa8TzKXmo8Y5\nUKMac0jtc+nHpmunc3OwFjOVYhakWHepYGRSDA22dBRqmr0O5nqGxAezj8Aa\nMpZPr3PP1R1w4oabhqUtTmP9a4NCq90cnYJ4yqgR1Yr6x1rxQ9Bu5qEo9Anw\nQg4P3psx7tmUTs1F+uL0/SK98gGd+j59QV9LSsSUUp4vfgiSD4qGnFgA5uUK\n669PSajzPhuMq1is5HguXrKhcaK5CBm1eZOIq6RjQVYYUqSRNdN4ja2zybMX\nAljoiczqNOkpkrFBcFTAzlS+9TGPF+xeBGirgriewVA4+dkSjfq+6EsJSHxv\nBd95cx1DxKJGokSEgk41aKlaQAMtLG5sBglhQeHV5g77RIJZuQQjLJeYFOGM\nAogZfkWt1UQnJt6AcCdcxAGgOsHS0sMTdNFs/kJiYkeuTe8P9cu9scBEaJWu\niHJ/O4YFV1QtvA04NhAr0FgHpqk4TS/zGUHSl07hE+oZcXc8qVwUSeGNc3nV\nUQGt\r\n=Y9k9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqVBtxRdd5d+FU1PIUyoWUhb+fvYXGWWFBfeysu0T3HwIgeHXpPJjjHd6d8iEb6YwXxrequBmqp9xzgxLULipM8no="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0_1586552948707_0.11860295154389267"},"_hasShrinkwrap":false},"1.2.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.5","gitHead":"222a22602e96256e6b1351f4108e550fdd02dd7d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.5","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1BSKOS4isIiANuBpP+Tk9xCHyQ9NXDVBOHjKCvWZa8zfvyqowdBSer6aYKeDLq3F/6u9vCdqjy/Kjdn74xT4tw==","shasum":"a90443762b7928da9769925f2ae2362c41b8e0ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.5.tgz","fileCount":22,"unpackedSize":108876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekOCNCRA9TVsSAnZWagAAqwYP/06PuM38zX4IQAGpnNpe\nr8Lp2qtxrdvopR7aoA1yGt463U43988hlbqgteoqnvRBUwqtJ53b+uu6mOrK\nRmRjDWp0y+m/mhaK/4TJ7WosttHRqaT7SyDEG/baKNUxPoGgtrLUtPFgb1rS\nyKWzFH9cSlG+nKlc8nqWNxBHmlrT734AdOv0sLlFZKGOwNmAOTLRrBW/Hes0\nfft/Msxvm/wwo63hmxC+IxoQ6TRI96LnxYNVSuXPXQKrdDNtjfqleOQz/RrG\nOY9Qn7K5JlF5tqblwGkJwpOuCYzmeCKi23UguBPjT7mKl0Hb4rzliSCPhjBa\nirYAfVS0+yiAF0qYqSspcaMfJHLUuwrw4W6ty/T3DjkGNMCJ2+ZjatoUbDNn\n/jRi4VlSrE8Nd0TQsLwtyt7Un0H1qF6evLy68cNVC8RaOXwJ1hlNTcPPNIc2\nm4/rTm3pBrX0hPPJH893XLRj5F9hGpRSsxFB2oPj1zlj+pAKYICG62p0Q2Yl\nEwTMR+H9b4INWpCPWubpugP35tEvm6M2c57Vq5pooRHbVpvkJ29aZrDqDEiI\nG3rymahxGdpEq2cCacbkDMLLSQ1Nc1EG4dskvD8AJmH9WYfOnObMe5XMujLQ\nNLJ2oUt53v9l8+TikUN9WwwSVF3H4Pj+Z4QbttUJ6+b9lNBUlbKSAA78FhWj\n++bw\r\n=D5Hd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8G4OMykgh1RnWd65RyeTjlL/7rRjXAWw8RqEIroKEyAiEA2FB0uK8yGjYNYWCHz5ebNY/9aEjlQ0NP8qWt9kUqbCQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.5_1586552972719_0.4886273441598594"},"_hasShrinkwrap":false},"1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"222a22602e96256e6b1351f4108e550fdd02dd7d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BPh+27ySe4FvXQyqCyiHgS/O1aJZdDrH3CwEUATN9hRDgXeAKt1ZTnHdmfq954aj1XRz5IDDjPV8z05KYuTlwQ==","shasum":"711218b0c4c6969abb14812deab2f2dfd90066ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0.tgz","fileCount":22,"unpackedSize":108919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekOCvCRA9TVsSAnZWagAAVtQP/2sYoVmWzgKCG681mAW0\n+hrWhuh9VZCJur0F+vtO1/Ylk61u/Z7mqyIjgtD3+lhXJbUvrXl9bEumJM0s\nX9GokFy7nnhUaS8ENRHNf8vXA4Sx6a2ekeibKZbZ8TK7/Qcu2fq2x2lV17Nd\nvxa4frAPdj3q0LmKkh7S35zwjHy3ljzStB+5Ojqd5b6O6hOMaoIiPoRpMnFI\n5PXuUqAu9+DAv6ikbX/2tzPOiAUzQZ7vyNmSmvPKmzBfNglT2DpcKo77Onij\nwK2DLF4M0RS+B9quj1xHTRMwHq/sNOlaKPjFj1R2JdQLNzXFl0NfgGn13O1w\nlbZoQLlKhJb5IYAg32XKHma5PzkGr2RcSa9+/3vSbXfLHcSgOTD3fyXdzV/0\nrrbw3u2TT7jZ5mNXV3oFIMOGnOMw/Q7MfeqVtOHOXHdBytTtRpx5TNa4/nOf\n/y31brn1urzgirV4Yma8LFP6kbAdtxScY86ls79r8MRTj5LpMmhuiqdJWVtv\nPGBWkMqI0vEEDkusS0eQgXLZx8Acpr6VqEeEZAuzGsFKDOrMb8oF4xdohSat\nAiaj/SVBV0zEVdz/7tLQ8KUxM8TtV2xoHTkKveOVrxx+nZ199hTaDUw/ucRd\nSuAMvaOhUIIbOD0kLZx5G98xXpFPo5IoEuHhikl1lfKb3CjPWa+U2n8s9Vbg\nXDNl\r\n=tuY8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdeDRZALV20S6ORTbe0XUXfg9rOXLKBb2Sdqc9a9K0dQIhAJPc8Wfkk1J58kM1q9RFWvMyxQC43FuRvCm+1ueYHXJm"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0_1586553007280_0.939557603451626"},"_hasShrinkwrap":false},"1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.0","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0","gitHead":"cc32d53443cb94743368dc3247bdf8b8b1ab93cf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0","_nodeVersion":"10.20.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JLxXyME8/FjHvWjx10okaq2PQvKfmrg3Vv6Fb4dbYdZHH70soD+V9ONSueEDQcsiD6q1pjrrbNmsWGYsbed7Hg==","shasum":"3bfccc3c8f43418192edef475160beeefb9a05d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0.tgz","fileCount":22,"unpackedSize":108918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekeBJCRA9TVsSAnZWagAAb5YP+QCuNufQHRZqPPyOwwOs\nrn6Wxk0jyUwmtxONkX3sd/3EPrgcKcaj8k7usfLeoFUvdaWYPkhfZO8sJOjU\nIcWtP1d2zANSLeeJkXDcohRV17yaMSm0syLIHbW0+Lo1acAKvIxl6zxjYP0J\n8es8Nxrhv+wjJV93dGSKX56cFDFuZMS5Uux/Nn6zhq5tLY5b5png2UzhPc35\nA2jvdojXVJ4f/1WiQCVXzJ4Vauy8NdVwuHBg3jRLtelkXI2G0leQfs37Tnsv\ndOr2Qg1IuF2Kafm/9Lk31fAYAp9d3aRRrB6tDXQ0mE+AVH0F/jHlqblpsmxV\n4PW2pqkux47Rq2lQrN19ZPYV+KKniCj8AmlSXGO2TBWzuC8E2AFkaCQ1dGx4\nSn6Go+XgIbccfA//khe9VMdcrEsR6/g6Ko3IK+Bik9sE2A51rEvAPk9x9sbc\ni8/ZCJho4yHBvtEt5YhP7tjsaK3WQGN8lRK9vDzjfcp1UwYabHsgRpKT6jQg\nNhSInxd43HFcMfnrVRGzpnKhq8S5WN7+hHSL20PlueEAod5i5wG/XvOejp56\nQ/HVCgu2wTqbdQ6exBBTylFhZLqZokF2XiIj66lCtCa92Syr0/BLd1BAerNm\nMpYUjRc9rGoUMXAJWyIeZAgNjVck/oIvcmPvnIYePN7zHAYgRVvjWhA65VID\nfh9o\r\n=ldXJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5WeGAC9L8n2fYoKUQ+KFL4NEjtkymZPV55sjgLDdEAAiBnNliBDN6lQ0+/mBhscnEWjJyeDr8Vs7ydR5AsFhj/3w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0_1586618441374_0.02256125699252909"},"_hasShrinkwrap":false},"1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.1","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0","gitHead":"bf10ade4f76d69e5d98ed2e72d5760f35a817690","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4Azsdc2C+psRwWiZiE/mYOHsZn5tAJ723s1/qPE1klkp5MMQZg+4fh9xd+JQahMZz1+N1lmMnH4bGZyWAiS1JA==","shasum":"941c8ede9a955939b8edc3a15afcdda71d7cf57a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0.tgz","fileCount":22,"unpackedSize":108918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelB1eCRA9TVsSAnZWagAAdpIP+QFauYWI7Usd7bD+ZP3P\n5A8uA/3H2SfVggBL70GZ3tBpmLLFWV21wnizI0rfthDq0UzYDGJQn/dz/hba\nAyxGhvEsGXExbo3o0819FCa+V7JLuJsODAN8T7ST6zt64lyzSEDcK0SZxUS1\nOOMQ/tQU8sm9js9veb2v5bwvAAvAfiT5dlVfdbww/BZAsz+0DbCw44wzSibv\n6VxTHhIQ/TlZ0kFAUXsLyfbupBrEHvH9P79LP1MqA+C346IimvffHeHlC+Xi\nrMtgVLTlEa/6wqMXDlBq5eEExBcFGesCidXLOrpRX79j0c5n5O9yufnZdA8B\ndntkqOsySJnyu3H6u0ZsiT+uRyhQbq80WWFpVe2Mx+miy06xPxRLO0+IQNRN\nsHKgKZEPDW81mCP5PQBU+aIlfyYztU3JzFoZn9B771HuZq7KiJb5Jsvk6Lb7\n/OjJtqmcBmp7YTK2wTkW/lAG32+keXHyfQP+Vjwm4eT0Lom/r3c9O/SpqypA\nMcB5IL9WWxujNxMuSMUwcEKzuZu+y2+T+27UOEduFwrFcDFuxYxMvY8kMEsj\nkfMgLQR7587tmOGQ3ONYCxiLCSt9fMdoeVeR4nn3OoMUV7lucCsjLtxM9pr8\nOjfQcjp23o9tevTkVzYDyemMW+tapywyUCF/1VRvoCzp0cq43+NPc6NMSHYD\nAv9v\r\n=EOfz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8njx9MbH/FL6eCTS+klU64G7i9HM5k9KgGayW05GfuAiEA4n4BfWy+n3MpM1xESXUUOcltup75l0+Joonv08xDPLc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0_1586765150073_0.8742983684781489"},"_hasShrinkwrap":false},"1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.2","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0","gitHead":"fd35a25d459776c00b71fa628e771d2ffcc27162","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6KGqa8pJ5XFgI379SzqMnBQY58SAzXhS4SRlkOWqK6dHsV77tzg339zMw/XDSvLtU377/eRg5z9pZ1tFGxQBkw==","shasum":"79c3f6066f53c0b3adedbe8a8e3a32811dcc7551","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0.tgz","fileCount":22,"unpackedSize":108918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelWvgCRA9TVsSAnZWagAAAB0P/R8uubpfd8uAh94GpIzY\nP6lU1jUVc1YW5VsOTTzcz1Bdqtf5sE/Br/jvaQCQU+ekKcIGzbTWgbP9rBZ1\n6/+aHQBeS+gGjKBybjmZW4FeIjP9eSnUAZO/ZA0LOcR1E2HqRk5pQMC72z2R\nXGWTw8UGmUDVybu/j9amGmDXAtkW9pBEcYBT8yYNfITM+8NErc0fF9mRCTm1\nfGdXMi74gatozxt2CcJT3IuqbJOKGfWgXS7Q8gk+oAUPnswCXDSw/tXdQWTq\nP5TIK4ngFXwcEU3sHpvW1wiYkrAmDrGYz79gRTM3b69TEnlWzZFqgoqbOf2z\nz3qX0t7O3fY9K2gma8WxPXEJWhMbtEqjOo9l4Uppsn24YCC0ptYXj9DQAhZD\naoll+vh6yvRcWeY0hc+otqeGx6eBuJ31cGArwMMoRsr23x8b0Y020j36yktV\ndtDc1n4zlAD+h15KF1cjEIEVSS8fCJ2TMYaBXXwc48QqYJan6zBhFU9GyAek\n64BcxibIVYV0lWOZYD2/UkeT21WUaLi9pAOAoAWXt90q5jXh1iK/MrKKLFnH\n/KrsLcwC3IR/Jiw6blE/XFhZZZeHkvX7tLrmz3DBaL14pozDFX7VKIHj4E2p\ngBk3e5G7iS2+Wzns/CeBselw+0DSfhZJROmqEEQrItHVNzXbs7iXgKmcNsjU\neM4x\r\n=B7jI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbi0Rpaev4SPsvMInI5japkUVzIODsNmUouGgThIpAzgIhAIlQXmEpD9laDX25ewCHxkzbLJzTieFcTIn3iEiDUxR+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0_1586850784285_0.44540745578889585"},"_hasShrinkwrap":false},"1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.3","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0","gitHead":"b0a24e2963565affe71743118578f9ee249d7cfc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SqMeOHGNAJ5+nrUuW3oAtzNRkIvT/hA+3XX23m0Q5X6eE6oRIxf8NZYFkoboAYPBbttgJRVKh5xWE6FrjZcwVw==","shasum":"974c8ed8d9f9f7c584181a49647cb1161cf72fb9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0.tgz","fileCount":22,"unpackedSize":108918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemGTvCRA9TVsSAnZWagAA6MUP/2g254/xM2h3dw1+sWQ9\nDsYXvyHgNLZhM6hIly+jt1NQKT4ACGtxmlnQZi1CkKn4faz5ONVT+6xSFf0s\nUTTSmTwjSokmLj3pO/NHLDB1e//IpDe7rkcj1hNsfGLM406IrtrFcTu+8y7o\nrEPAXwiS8kfksMBpVSG7x2xOu31g3v5ymhMO4Ioh+sjUoVxUGk+B7yT9cUHB\n7uKFYdUESKKIU9Tm6QRCvZH6zbhWvzQxfAusgG2gnoh0z33qJ0mqzMS/knGz\nP6updmEMk3P2h/IAc3W7TqstnQ7n60kT0X7IVimZM7iNgSPb7iJS3IiR4GCw\nOYXGiH3WMKcF2LDQACYkCYTWKRUWpqJm91r3baktTmBROKToTlB/mk1SNI4g\nCfYNKfH54bzeV2r/2t7OKsB/IRncXMdPrTAAZlPAHj6P0vJsAr4rF22S9dE5\nFDk8CePutXGgsdzsEoDAHQ9Be0fc9lPPqN+8u/KWg+pj8pR68J+vZt3hLeWV\nZ+4L1a8+mAYNPgpuQJnw5bw8o9P8V3yBxO9cPyIc2omwEEkDJ298dL5Wg/bu\ngrrtjrdHq8WXC2Pi0nEga4IAVZv32QKX7qNH6amLnD99DHfAXYvrx7ETtuzy\nHW0UMahNQDKSl7SjpnzPYLAl+9GSwzK3zROOveIorfa8xokzH19zRhF4fMJu\nBFV/\r\n=dken\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC1bHv0mh654ShlXHAwQ5cNRLWe5Rrshs1lKEEd4eLKQIhAO22eJG2me6m4sOHUBnnx2EoKAMCGxB8/zzsxG8OPJ4F"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0_1587045614768_0.06506171428749274"},"_hasShrinkwrap":false},"1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.3.1","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0","gitHead":"ce158feebf278bfde2e9f25e73bb29d17f567217","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HMBQm3pXA68HzfjVb7aw6zF9cP/FDXR5SiBz07/1iLbEiWhuyfeS4uUwtpLy+Owf/K6wKUYLm7cMIHK4RlEX8A==","shasum":"518951c429dc11299330d204180a07d71c3684c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0.tgz","fileCount":22,"unpackedSize":114102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemHDkCRA9TVsSAnZWagAADBwP/1NYCz+3SrjXkqAw50hV\ngUNMKqMzdTsTrmYH0/2SoKOBqAp0RZlxQrMqfVx5tXAJdRKzByqxvIbD4kcX\nsoti+Q4z0gRRe9VYwHMeV3Zwlt20R7va1aNihnRsvqep+o2decEZGhezUDzC\nhC0wzefCFcmy4YH+0sEz74alUj74zlO5zugRS/Pi/V2M1UlnLrSUo6nZ9+pe\nez8ICNLaTvK8SAIornX5EY8fXkSt9Oa+V18uFe5TRtkZd2sWeMKtI2l1o9lp\noZTaO2kq+08q3tGuksAvKPl9CIdZqsu95prb1H+pT110lVyIBNeQhTLcrlWQ\nTjmpGBdeIRqO60NkBnHvCcLQQt8IbXobHlIt+XGSyyYjq4Es8olmCPSrs3ZO\nx4AkKWzUIxdH2q1rvo2eEGOh0QwAnIEvmrTRaIFW0lmEobvnMEEyRQVZ+tC1\nr7AoXSqIgX/kLTHjzJFJmkWdApB1r29eEOmvdcGAq1zeGYoke3ppS4c7hh3T\nnks6ArgSMRvFR3eZ6z5jk50qukQUYAiXBL9FNkeYiYptUE3qFigSY0ZlpNaZ\nZ6eG3V6mpRKitTlYdm7DsMArhyjX0axw8EBB+BPWl/x5soEeeAM682CGAz2Y\nt9AaVij+rBYOaq+rNeiv2xgBrxn0WbZpWpCVjCGUPfZP8rE4KyhiOQyiJdEy\nHLYO\r\n=Ysf2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLZx9cMcSsOdjm1X8br1j2rJ7Nw7s81n23KColdsUNsgIgHs5Ej58G515Knawldbw1NESCkCMsQnVz8faZ4I/UGs0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0_1587048675332_0.7650906242575579"},"_hasShrinkwrap":false},"1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0","gitHead":"ac170a22e658c91319c21aa74e8a601bf16faac7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FHa8XmRTi3JfBdP8W4PbnowWQ+XlAWmyhKVUSdg3nduKARW7xEMNZsr4STLA7G5BPv9DvtWOyHqcAh+SjN1SHA==","shasum":"cc01ff6ff95d2d88bc09faecdd0a5431435b322d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0.tgz","fileCount":22,"unpackedSize":108919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWApCRA9TVsSAnZWagAA5/sP/2Q75iCNYzrNMhvA6lU+\npcCvc2EN9VyvCE4XNfvZtcm6xLnfjIljfM17DW00y37PyF2A37srphR9cNdC\nh4GQ9tqW8UsYXeOyOy+FrVQGVCZkIif/VzdlyFxfJcj88Un1UEDl+S8xaLdt\n6pHSWG8WkEbGl0g8GfPRxjwlYP/Xr2DS8Gp+Q9rr58CWbFHSZPBCVRKQ+1px\nGZTySeLeFohGRvFnaluMW/jh7EAxMGvAMytTMnixXn0TR1RoZuzhUQChA2l1\nzAV4gLS9YhwI1YOAYn1q0JUs+spVelg/tF/MSzaFYYkHcUUhPEXVysINuS2b\nwQA0aWyOXJCBxwXvDZzoi0jYldfGhGdxqPYtd9aRBytqUNtmwo4XoW6T/rBT\nUaZVrp1x47QMe7Ahl/p7wlXQ6IOnb42DHNVuEtHFoP3rJiouAtmy3Ie6ZKGM\nG2fztX0HTw7inrW3nBe4Cq4VJS5ZGkEuh1BOmiEwXB4auhPPiYu1CJib2aTU\nBn8d4NFEmKg+qacCwrv7I82e6UOmCdVicbksYtxzKfckzETzY4BDYyCIjIib\nQAwcEGgypSmgc8WSLVZ83j8+zkZIKjTsynTzvT7Ux0EgwLOV4jz8BZ6Ya4F1\nzgUPpDIO+LUJKWQL8YNMBTABAGFswT81DLeCbTM/QKA535wO3lW9Cm/5vfwb\ntPcg\r\n=b69w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF8gi6qY3D6XRK9pV+ZdIF1hm3k209VgBxTkEfSXem4CAiEAolM4PRt+8wMIFosQeCF3dylG8eeCsRL/3nd/Pw4KGcc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0_1587109928416_0.13755713213224796"},"_hasShrinkwrap":false},"1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4b3084adce7faef45568ae48be71d45a0f44295d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-R6HP1Ye2kmwtNCIuZxHLz5FEdx2dzS9mg47L3UZB+e+y431CfJEX6HSQJc5DuT2OGkePZQunwplOUODP8oBglA==","shasum":"c7648a0ed9cbf91308648b6b338909c1b3b717a7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0.tgz","fileCount":22,"unpackedSize":108919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWBLCRA9TVsSAnZWagAAzmcP/iMBtyDiYj5yXP66QN1c\nDk7kVxGi26/E5VoYDOdEF35jlnq0FvWKJMfvW+l4tLnmqJ0aCWTAdbikv5O1\no8iuONr+cwrna4k9U5zFAR3kDSXhbSBtScnjX8RGVfK9yuGI5T5wJBIT/suu\nYhHjAxuX8E6ZNvruxaWLb0AUzIHgHq+FfbRR1ytC4LglEc4JYcMA4yZw98qI\nGvRYojU7gtKPLCkSwsG/W8yk3vfpoHIB3NqMNs1G3zBlZ3CmsMcvcSp5Tc9y\niVxRbPWnzMewTjKivX2TC0Ep71rQHOqoSzbPLrVL9R/Q6c1ARZTPU/UHrXm6\nMCMUEL2/K2vtMz8BYM8ES2FvTnslxUUzmDsmwYUDvqqdceX9p6SbdeHqZ5aU\nvWnjcU/HdXSkJm3CqD/SEA6Q2qChaqJ4b1UJcuAzc/pt2sfKFpFCVFjrNtXz\nZocSARxWTpMDvJDkzL4tYAipAiEbY8P+L65e9HxW0YMcNlf5tG26qKdOkLtb\nJSi1HPvP+mqc39jvMQBhBXblOgGAYXr903WxRnSutFmAbSO8w2z82fgkJYvs\nzvfE+3g5lZWAVU4j+GgTodApJKG3DQrDhZ/M97TC2lZdnc7DncKEd9yYOU48\njJqccEc45Xe6gpwfo7JLDDv+s2VxsZgzFA0VKfuF1qw8LFrDF55cZcuNnLDv\n+o9y\r\n=N0oZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/+9/wA/FTokCzqwsX1ImelptR8mhFllCWF4fFyCYMEAIgPXybzQvkAXJk8kHkUJuDCEMwGxn7XugTEMBtnGnnd1M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0_1587109963034_0.21931880838183693"},"_hasShrinkwrap":false},"1.2.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.6","gitHead":"8f43751352aa8cba64dafa46277cd457c87fcc3c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.6","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/gw3AJ1C8PPbKM8U0drbuo8Beixhwqf9dZKQRZaRefiG4uk6M56PS2SLZL8fgYUVx5EYZGbn3VhfUBgPrIDGsA==","shasum":"1c80eb5dd493d3237e5a517f778ce13dcf582299","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.6.tgz","fileCount":22,"unpackedSize":109151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWBdCRA9TVsSAnZWagAAdKsQAJfOxq2BO0+26qIt80uf\n2zwx4eb4tBuy4/jP4JRri4qjbjoUNjABV8fm4BZZe6HYu7akFiDWr82Y2rcr\n4jzP5z50WDnt96qZ+D2BOCcca4lkV3JnXyOCsoteLZrxm/M0nD3aQD9Doeym\nozS1U/LGGU+twma5Bcnxh2N0LjBUGdBSNnf1z5UdX0ZGupU1eUw6idOzFp4l\nniz7lXr1mjgtMJ9R6JMo3A33DZuq4CiRaUnOk5c2wfSUC0csdKtzwfi3tyQp\nlNwu7VwqH/MzAEW9Z12p9ljb4ZlMY1cDFqR6c41UwtPYwnBxDvghsrR8KHbd\n1zlqTsq45KEQkrArtmLZPsJzKPc5hrFzkGdKTFwpSoQtnSQpG0nXLTvJljuQ\nbAx8cLOx7hBNzWQ4OBD3UPm+3o6QYYtYVb9UjVeNUAIwRdO4E+6DHndcJkLB\njyj2Jhu3EqLKpVNMZ+LpBn4DBVZMEAcc6/yiM+FJOitFpen2KCq/NPWUWlxk\nT1VsLyQW2fJQuGHWaLNCsCqATalwK9T76ZHr8xGHsa5eft1DLOh57byDRZs3\nj4BmZORA+OEfQmh/f35cfCzNvIGN/YiXjpFA9AAlvdOT/nIRJGqZok5wieku\ngKagko8cIYInD7f2Icw0WKIqG9ze+b1oryDZVz5Vr514CZKkkYM/DOMzQOTK\njw2D\r\n=BzzF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYdYVqf/iR5ZFMDZlrpfpxdvXL4QQykkZdHGyaWax+jwIgOp+Q5eQv2BphtigAqDTgnHDWyyFEx6rMRxr31n/puag="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.6_1587109980907_0.7162698110103483"},"_hasShrinkwrap":false},"1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8f43751352aa8cba64dafa46277cd457c87fcc3c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-oQYYrCTF30kx2cTuvZZshxuUjzRbsTgJl03aUhCHdZlrhD9+lavq49iQfP2vY77zRENQoUpA995UFDP2wBvXQQ==","shasum":"a63fadb3ee376e183175510c8346fbddbc4ea466","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0.tgz","fileCount":22,"unpackedSize":109194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWB4CRA9TVsSAnZWagAAmdEP/0UI4N8lp2Ya5aarKghi\nY9LohEIvIwpVQxjOIINqoA4jMNFct6H+GDXq/Gu01uxaEpEhSEVEp0Ezj/eW\nyzK0sbqnvac9A8+zwUP30VclZ7KLrRCMT50T3VJbBHxdDTp3AYtvrF7146kh\nDvSHzqxA9VoEzQkRdauESPlPrmjOUUQkKhAeDdMkpHkFt/SSfp7XGHzUhFfC\nW6nkiaXJSBK+WmlXzejC9icsFP+CxdE3Arl2/G7ZZopsM55xlWnpVgBwKMy0\nVTeI+dOGbFazpS0RH+UQINtFDRd5UGBPxlhGqIqspcBPSfUohtyXFmzZxpY6\ntEDV1CsHFgZx/y4bV/CPdhzY3IqUmo50S3prv92G+yvZd4HiYbJeRcQi47kg\nKtFQuYURxNiX29VQsY+1i4qUvkygRiekcG7A6oh6dwXTxZeLHMtaXjamFkKu\ns9zodIzdytuSFHKUE8QNzWqgJA2pTm07vjzeCbnzPLfocic9lyVDfOf6PJ8W\nKb1hze6KRINi7w4sLbKWfwgrTga1tPngewNnNcRfUu8ViRU7G7Zvq9t4Yn6r\n9LhbHCbPWFL/4v2uf/dOUJISbzbOzygeJC4kAVQ8Pj1QZSdHK0C4DctW0yvc\nmMJxvZp1HD6DkBML3zUHGnR+seU39PEEqjyekGyRbWXZNonFkTVD32E3wjya\n3wsR\r\n=KSCS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBMG3mT2PMvRBMlNkRuzgluhzlSwE1dXFN3I1GF4q1bAiEAgT9MG4Hk/NRVdw3v4C+vHwibfK3PvW8E+hXJTAUoFh0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0_1587110008344_0.7525447654216197"},"_hasShrinkwrap":false},"1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0","gitHead":"d103e6525a731047ec50bafc79570a85a2dc8ede","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Rpk22vc1YN5suVpOFmDgP6Gp5fVol+58XimGEQUA/QuzZi+t7gDtEfBzgVsX0+Xm6nDa+vGMJH/4beOz1ABMfw==","shasum":"582d4d64d720f6ecb9952083f75c40b2ac99ca1f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0.tgz","fileCount":22,"unpackedSize":109194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWFICRA9TVsSAnZWagAA5cIQAIa9oWc0fv79FVrRRK4k\n1YvHrSwLK4x7ND2r3MoHToLEXiZ2N+yeEmWUfqMNhh6gAI6W8saBM1iPe3aw\nt0M54M2xJWC88qwIWCVuhOtPA5yYxxvpELBUN3xNxHVV5U1PSpFEc9iwQTJo\nyV/ga+TD+vfC7CQHtSqMzSbZdi2hzTkU9fHBfZIHv5qAtQOIFJ2ubIh4nhmz\nEw0Q+Di5U37CPkt63J3qisOQeLL3UUBpl+oeu7hpzkJLSpetrwwexooIrN2M\njz4crANRWkxhcc/7LFtjbNHSwe1bjfSG0LsnKQatr2iJ5JI1kacoNTKltGY0\n32327J9SicUxrZm8mjBosvAJyancoNLBdBkZiG4yv3wCL5XesDYvJplKUkoc\n+XObra9xZip5eqj9xkbcql2Ld0wCqGibrq0tNFbevL9jtu3nBLvzowZ52Css\nM7ag0o4ezXw8rqQQq2TTiGBRGxD78CgQr0+yvEDWGXaAfZ9SB9BFCeHPfdAX\nujcCz9++9/9YHEtvQWsIOvNitjlGWbGxXoI/iNZVG182wbvS7yA3txPE3bKl\nLTCf95Fopb+HcXLNhKxnn1q7cWoOEFxxdvs+/D5S0dIWItW9vWh1uSQDw8m9\naVr1iHQDvs8zA9i/a9gX4BS1wF58F5F0CE2wB+u+FUGCuZdJQIwElT0uWmS8\nquUO\r\n=fIJh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+rHazAOFYK4Bl3RXF3fG6TUeUDzcVylslnurae6pqkwIhAP3fqqSqoS1QzUIoWLq39++YeiM8+BKA8Xg9Q2IEKwNt"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0_1587110215717_0.9469063047577304"},"_hasShrinkwrap":false},"1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0","gitHead":"0bd16eebaedd642681f2b586e6e66854397d444c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OapL+J7k9OZqKE/cSBhkNWeRcFaO7ZNgfPtiqMPFkXgCPBjUbbdAlzv2K1JX/hHZsNC9gMPHZ7km1fJo5KtAKQ==","shasum":"801461e77b57ac697d9a0f815ccce87ffca9a1ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0.tgz","fileCount":22,"unpackedSize":109194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWHKCRA9TVsSAnZWagAALoEQAJ+xgjxK71T20TnI2AM1\nP8e+WorM3PWr8l7vuAkWIkto8WwbiPgPgs2p7UiqD7R89mkk+aR1DFnihhej\nFsllAYWGUU3iIQs8ODZNjllYpGp9MoDf4TRR5caZl5jkx/rxMsgTuoNL9NdH\nuQhSoHdUdUrR3Cg29jWm1NoevvqpOLS9eeiHGrhi/HaHZvyejY67MImeD0gO\n54sVCLxmFNW3s38Ez/M3T9sZYAS9mmDmuj/VeVQttzONGKpeUAfA6f3ue6Z/\nY1f732U5L0ZNzZntuX8mGWvbAAozC7aAscQ+Sxb7Wktw3w0MubHRyd3mYVNo\n37ym/W3fsw+ydOHVRhb+9+C1gSTY8qnEqUBujQGdAQYlvEPl4crheQRdcx/s\n9zvOC/BI4Jl/7p6RKwNNHvh1xP+yMlUydlm5/nb3Gf+JhUX5osRV8bN5VAjP\nU3wt4Tdn3J+Zof+OG7I+uekhvJLAX2ROyEbDRqLlwuIW5B7v3gf2bxDcxFUp\nX1to0XRUxbYYa3ou/xWY9fVU5yZcBZz+eV9QW9HPDerNuqz1Rw7P/W+ntyug\n9LagbFfkr0hFLQiVhZENJlQBwVVB7YbfDxASyzlTkF2SIlFgElTnNbC7FTP7\nNpHAIEZCSFox+4Di5cso33p3QwLA82x2Nilyrq+8iKiGbjKwri5BGQLme527\nTZAo\r\n=oDaQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgr3oj4cN8oYVlYa4P5F7BXOBpPIdS2C6KhfV6KdQrgAiEAk2TBtepUlto7PzsB+fiRl6+eaLCh2C2zEuermr1ApHM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0_1587110345594_0.9136867761371745"},"_hasShrinkwrap":false},"1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cac13f5b4fb68acd7746b4c1019a41d08ac6754e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xe8xzdUn2E3suvk4YLNt5+08LI1wSWv9hR7s90oAqsVhP4ZcJyn7i7gw6Cp2Aj6YK8nLrtdd6Rn2hBtvl6Fy5A==","shasum":"fbeab5152be3af8a6d68f66cd8d85d3af89911ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0.tgz","fileCount":22,"unpackedSize":109194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWKWCRA9TVsSAnZWagAAsTAP/AqzciBRjkcedtZOB9yG\nx1fafnPGRCMFhSoPfBr9c6rqKm7BibLYuLv1areXe8b2a4BMS2wa7t/cD/6r\nOMfVWcYBnjuvQa3eKvKRjwPbHTHDyjeyOOev9L/GhOI8qGOwGdcP5t0DDG3i\nV+dqqb7lQl9C4NzLbfMV9ru0Uov1hGvP48IT+jKwU1CW0uG2KekZduhVs3zH\nCgnM/LLMZSQ1IJdpJKSJe+IUqijZlYKWl+yAY3pQHfiSBFcc4D8ld+ObvJmo\n4Mtli0sOXV64UBFM+UIB6cFnzWvEpMxT/VmBv7cjynaTuANjZKWzVjrgwAI/\ngSqjxHS8h871wAPKddTCExa3S8lFymKu/juzmmiK4FgwHkICCoMr1t1yBa1v\ngOkmAel6xqNIluPt7OTiRsgBziHE5BSF8bKCrXT+m48EdQuXsug9gytk2XOL\nOYPOmTVNgCQFQ1odtqLjTncIFX/6uW8dc7duxi4pfJlJvznra+Z/e6fxhwuk\n1ah5SzWjqjm6LuHd0AohXAFguqkPZ7cHEd0zDmUlzT5HhyU3js4sL8CDItXx\nk9UrBTzw/5gavA9009HS1fo/9Ufio/D1ABd/uT0tv20gbZw9W758sXAs98Jw\nQkQQ/LD+sYK/2y9UEtD7q3uuS8OOZfF8RHpIh14d6kqD2r0szNWALasVb6dX\ntxru\r\n=Wh7g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+TwKlV/gxlxKuoGXGNLWbTDRdvlQiPU1Ncrc9gXojzQIhAIBj4v4LPti7RbjpuwBhytqR645iRJOl3fVU+1wOqYyh"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0_1587110549974_0.8645672867643421"},"_hasShrinkwrap":false},"1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"33b188aec8266c4a7dffb128c132fc878bb9d58d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-H8/OjxAOI3jMAOn6xzSOQ3Wg+ygcuypWN0/4jPyTPLtKOG4oD4W/pIBV0LPbfchYEQRMGcVyWKjptYzaeTpwUw==","shasum":"ca46a1348a6174255a12965100b9dd3fea63d954","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0.tgz","fileCount":22,"unpackedSize":109486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWLVCRA9TVsSAnZWagAAVVgP/jX0c27BJAi8I0j5EWJN\nNTdu8uUFgzlA0YcBLGxQeVtODHNI/iegHEoy9PTfr8ZsOeX1J46gPPH4fhG3\nwYxdXobMhKt8iSvVB01rNqMfmoSCdoPJFGXz8WJAzdZqkin7sLDRdLj24Nw4\nYEzvOYyBmAstPEarmbeK+zTgTGGECm6yy1KxUhbAZZooxsNJetVQCosxkF90\nAyc9NGxV7bDRfQwckx2aogYvvSIg0VSVO6CckNZlLdvMd/ztgdtdeBxGOhtn\n1oXht915MShvkVEfMqmL8ZMEYTTOxhLQwxxTB3gvmR664IxdsRq+eoEdrXYZ\nb/Upm6UhBKLTrYU/RbbPD+O2E1hEb1cH2/mUUhIMTubXWvkIdczxubAbiMLZ\nwCzMLR6GOscFPCMR2mad/fEFcgY8msuiBVh756DixyoPIupxGt87kSmCcPQd\nEC3n06arVs5vU8XnwxlMDrZJWtUUT5NXlkUlVl0eWzTnRDMtpVTW0exWvauz\nPkPgMmvUmffWBOXK9Q+lanPrXTeEOXcsnROO2qnFYZhu6s+ZwAXEgo7pzIVO\nFpWlnmrq0yoEMj0s1fJR4qwwMSES9e+zRzEwQhSrfUP6NtWfcZC7sgQZEOkK\nN9H4cmcgBrauLUJwUR7epJZJBPMcBGCsSuK8Ej4bi/SqIJnK2kkhugCSB47p\n/6cC\r\n=s2OP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcAnbBTkI7PG3up97qchR/1ZU/HEIOUh8r4cDdsVVS4AIgPugK7X6Cgaf+pYTqpc020Z155tynw/Pgzui25CHvrxE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0_1587110612641_0.08407539592115443"},"_hasShrinkwrap":false},"1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0","gitHead":"506150f727c1a1473ba8374c076a8273c08b3b5e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-96LyeNZ9AfKhyahHDXkGYVyDyvNNF9PYu3/ldrDw36o4hLZ1EMcljH8z2x1aiXZW9KVyejT87xtMVkcVYdCP5g==","shasum":"1adde75da2d876bcd1ef1625e4449a6adc3cc73c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0.tgz","fileCount":22,"unpackedSize":109486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWPeCRA9TVsSAnZWagAAwWUP/RJnvwF0ruLOyP1j4YCg\nBDc7WWI/Ocyjbyphc3vzPrEuigEkfEcF68wDWrcvmPkoDJB1z+IuIYPNwO89\nv0AArpXPq6tiZNEXZkU06/JA8xdcaRfkn/TxT0Yo6vfJDSN+BVopaxzgAb8r\nJQiK7QFgsGMc6gI8lVz9wxKy+Mw5FYQ6SC4cLc6nebDyCo5cG+AixSr1xqVL\nQhdFfeOqMwzXUhGbG+flBm+/5zrHhwD7rdpl17Y1NqY/f0UrRLtdV3YKmTCj\n2TrqKLTflh4aXucHay4hhc/jKzhfr7lmraUHeT5KRWc4ALkE4ffWazZFIolv\nyngVM7OpJ6A+8tdpLAgxRJ9aZXSgYlN10+tuKJXUn/jYWcuDbZvTE/sGT+iM\nGXURVAXwTx8ZDs3x5U0T8n1SVsN/k2m/FoIMgq7zElmV/QQTEQzoS6EKofAR\nY7LBTFFpyMFiWDZRrqkWzysrKvhrMw9wNAv0hQfKt32WuVXQal0EOqW+WQmX\n5I29a5v3VtgKDI3ozvoBb7yilqVLCidU58FjvEjDu60mAT79BS7+MfE9N5gT\nSIKyrCDCINMz9uKwf165sLMN1JgqtDvQoandaD3xu2w3ju5gtkozqzY0MMM6\ncoPg1OVk64pe0O7ZIgfEoEaijlOFRcp4vV6DYrCcga/d2o4kEJukL3geWQM/\nKRMy\r\n=SxwX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtVPcKqDZDDv7NSZpbggjZSUWRptwDTy0fN57AqfLrAQIgKAqmK7Hkrz/ds/Q8p8axFIOqF0DFK6tjMs8pA1toa58="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0_1587110877641_0.9347386061729959"},"_hasShrinkwrap":false},"1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JvP4E36Z1z0vWtQIvgBrlhc/pUjZDgzEZgSLHXu5D9oWY9IbUn/JR19ZEIMmHFmwWQ+F3BDvvYilimuznUYUnA==","shasum":"ad3b4ba57e7da9f1c9c881c786e69af7be0cca94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0.tgz","fileCount":22,"unpackedSize":109486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWReCRA9TVsSAnZWagAAqO8P/i6pM0RoEkg+NH2y/wYY\nqiAOwun9xPtvJMEdw/C35AVjCGcSQz/qtSeIdKB+5eeR3vQfsQMHhOeYB+Ms\n384FjEeJWteoDuAmW9Noa0fVWQpl1oN7Z5Fr+gnRsI0AhFqQOe6V+4lONMMr\nU+qj6KvGRmEXxDYoLWyFwKYxaGcRJn6dcNEhwe7qW6kFgj4MuvCrkNxIkPIz\nYtcQsKjILFVHViMPnS75bBZ/Oj9cjrSGbKQRnzMANyHfehGz9yeDmOK4uHYR\niwNjw1Kr7KBSmobm3KrXK0XSTjEbb6qqKCdtyTNoeyvu8N9uhvDxoYQbWe40\nxoSBt7nlBPqHYHRxtYtFUYckOYxUHUHQrD97TQw3O1HqwiNyWA0wTULxeYbh\nd14+cwvgS/0d6EldUAbxYqM2Ey3bFCBMc3g89kxCAF+7JTIyp26d0FU0ePzg\ntJBvcrub7/mL71QeuEKmoWLJvOOoIhnPxI+8LF0lzOvfn8WiK7NSGPzJY2rm\n2IbhxOgtlshFm6V4EwTKgm/KpOCN0OOvH2XvwHhBt3ivt1PyGsV0aW0ak2K7\nNtWfB8nuf53YzuubGgkVc6LaFZFomkgMqSQvJE0V9SqzJrbeFfL0rAraMAfa\nau2Ven7nAT7UUcZtx8dxxlsK/UTO8UYLsMzB1hFHD4KhIaSXCKOehAjkjE4f\n/wcI\r\n=J1vq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPDOfq4XznfHk/C8BrHvL97cc2ThaYC+7a8y/n+NHLsAiAN0OwafirGOT6yNy400X8vTixUpRqU4DnICa+oQMQl+w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0_1587111005829_0.42770997872739946"},"_hasShrinkwrap":false},"1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bc1dc5cde0519de1de9cbe8da193f907901cabdd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-D3ZMM6u4zt58pY9WPzvQtm1c1BMD9o2+2UXBIQ0MFTjGdUxKYIwIW4L14oYZpQR043AGEVx6eimojewWHHUI3w==","shasum":"c98f866fd529195569bd2924f4afd3264c597d77","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0.tgz","fileCount":22,"unpackedSize":109783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWSMCRA9TVsSAnZWagAA+oMP/3aqFtBQEAnAJliHnXDt\n5dUecT2SQ2gMyZ2E9IBkA9RhF9pi5RokoZxy3Dr+GT2RpMmyqA3BL2yFOqbg\nY+5TVWmL/Zmhc/qR31fpe19wTt3mpHjpGlLcGM6n0sdgDCw+ktvGU9Mtb6w2\n9M0ojSEUEU9Ljq9IWxk9Z19uROyjiI0vlRAG60dpka1eWWOn5absSGLwfcyv\n03g9IP70KEjYX0WLh+Fcs3dc8hY+oBXuh5WJ8CW017lgtQg38o8n1R/ymMI1\nKW68u3wg/ce+oaVNf9Pn36U+dAxbWTWANqjtnaj1+a6l2tDdRJz27NdQNKmG\nUHLbGqDLMvkXMRfZIrHs0vWkUXHK/WmoszyomLgkFUKvpsr1m39vS9EFLAOr\np+z9lTgGFaVfWHI3INpFWgzvwS93PCLyjkl/1xLIebXFxUP2yzFSZSkGrY5s\n7zhWN65voYaHN4XOiu8hkSRoMuzHJ5HtjQyLSMziuskWeSPFAVNvZ3Na5scu\nfQPdExxbz/2Lkdvg2bTLpXzJKPVs0rXdmztEoURKoH4fo5G7qhJqYx54xLeM\nkOM+R1kC6PRNe5+jcEqRbWol2hY4zWPWBopmVnpLoTqhjqrl8Mq0oO6TsF0T\n71QS5YHXM/bI9USLZUEMEuFL1dbmwXuNfi1aMhH1NOwzTcrKs9xtb7YFmTX9\nhaqn\r\n=vL5w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHT/Y5TT1nD8ypDe0/lF4xq3Z2YrvBZEufdCSFzryd5OAiEA5o73YkXVl9435afLhGqNkyApECODUyiD76udvDEQ6mI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0_1587111051722_0.988210289772735"},"_hasShrinkwrap":false},"1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0","gitHead":"dd4ed5a079c06608c080001a40abcdd5959ab824","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sGtm8zHwZs7tvVt+Aw6DXtr3fxh53Yh/X+YzOpv7VftnuyffFXl8zIxvtb5U0+U2TkiYzSWPlk5b452UhwwbsQ==","shasum":"b735dd2bc8ddd4cb6d34baaf309eab981d892050","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0.tgz","fileCount":22,"unpackedSize":109783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWUZCRA9TVsSAnZWagAA7pQQAIPV5+RRqw7TLUmKnqpW\npOaVJbc9XXojmx4l+FCdbCOadN1TkzYL8TXXc8rSZL0y4F89IXs9dtQyTJu/\nJ4mUu8mJZpUv8iIauzxm4xQ6ftNoaR0o2ec4ud+bftdXHs+pDQQtPWxfxToM\nUQqibneEVoFEr0KsQhPqheIhge3SMW7D4s8dyr5gyRq7O9EaEr0vxYaN3YTY\nVAZOxWj0GnwuHbRzsi4CgxKvYzOo8/xUEDKW7uPgTmdLxWcvoV+/TeGj5oE0\ns3tOkPZpnM12kdTTvWv+kL32Rt8Kl3ItQcQddstdNtwde5iQM90gYAAGKLND\n7+10KjjUfJPfp1nzXnd8eKndRuTCcg4MQtCJmPKhsL/ANBwCEGZMwysplYQe\nH00gG0basOeRvXZddnR8e7zdpn1n2BBp/NgpETFH9n9GxC83bImd6RPvWgUd\nBrLatFVWwV5m9kXZXuxoWqyZg92WUZhDGjvHWbsAgpGeQzxgb9vc0TzpbUXb\niQ55+6mU87ba9QPwCr+qKFbPg1L3wzFXhG9IRvsJILxdn4yiGrhK+PTNORwT\ng5+rpRVRHDRKDXBYyE+EOr9uM2oyzQmHl9Qo8dD0RBAeU6yEgIAklYv4oaYJ\n51LixhxLJz0N5uJ3nTUFnw2dTxKyikY7Y/cKvlMgFumRzrlS0lFFg12hh1sj\ntdhx\r\n=+V1L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDyYPgTInOdqrjTmlINfo5gVWrCK6AFKlWdUSN4o9G6kAiBB7F7Fj2qfXWFC3dLK73iMntesJxLKxFmfB/R3KZZcvg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0_1587111193192_0.6154733861500783"},"_hasShrinkwrap":false},"1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0","gitHead":"18875340e16a53821bbc5ae5b17c84f6cb5489a1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xvFFMIw1c0MsGJILECkV4Z+IKKNW4jlJ1QyR0FHTGQqd/vkINEaY5u80ibHpveOGRqknHEZQhkGFyo1JQYxw1g==","shasum":"185df60c3e93eb6e62c44a88ef0c483fd00c3664","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0.tgz","fileCount":22,"unpackedSize":109783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWVACRA9TVsSAnZWagAA5CgP/jnGYTwnPZOTOtt5BiQG\nACzigJCEcnLrUnYizhGsai1kcrXV9Gculvu3Id6TJfXNrSGfSVbC1AUSgscD\njcuWqV6LtZb6kDxJAzWWr9MqcFJGxoaUbSzsGOrDZIWE8SxdFXJWbaELVkLr\n6a3ju800vvzUD+IB81WTmY+3OYwW/P+73VR5SxIlArKurAjSlX4l0uwp2+CD\njJTc28JRTsampbjQ1nYFLI5dn5FAWGZM/DpRxKSI0IrwFqny5e9uWhGk6zT5\nla1bQu7sx7TFUt/QiUY7dwvKBGxoQaXDlZG2EkPLHPYID7gKjiS6r4iJr6To\nktZd9jHqAGfH2UqnNcD4JlQL1fdWpQRPBTZ7bqvPccZacf39iL9+8vHmPEdH\nnh/vRWzRgekp/rGmOBB9i5RT8+8h+joblVSwq5XlmxgTqz6TD8DBULzhP3Dz\nip/oXDJ3q8x5wF8ypsvnZAFT+yxrY0vDQpF5YgYaKZ3ARSqk0UVjscLrqDs5\nGP6KwHa8oNTEbsbOt4S6wF1NFacLSFXhbQhlltyJXFxXsPM1CtMBguSVbJdT\nHOuMgO+xqrsPDxUAt77Fgm8znhP2J0h/0hwIn/yu1+AtcNpazdxW9qSKbrrQ\nuES72h4FLsFAV0iql2vLWV7KXBaq+uWy3WQgHCO35J50p7xcvne/Gqfmz7uC\nTShC\r\n=x0Aj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhCFV74wuWybA0MvGQkxQ4ABLOlw58W7jkJfKLrTpqswIhAL5g93m43W7dbFjPTRzzCcERcNQooYgWX2gJosPU1E9G"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0_1587111231883_0.904021808030484"},"_hasShrinkwrap":false},"1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0","gitHead":"ba53be592e953f796d5c2f304b70fe447ab0bbc0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-s1So7JtnJYnbRNUmZMalmIMEBNWlDzt6zulddTyIlSlm/HxGLbBViB+JtR8P+8rfitiQnqijWz39R/MJdAPzbQ==","shasum":"cebf787b2b3f9481b0e8c7b2a6feb8abb2a59dd2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0.tgz","fileCount":22,"unpackedSize":109735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWZ1CRA9TVsSAnZWagAA4ioQAKS0cp4q2Tw8DWeXsTMp\nskgn0dFVz+jtJ4AQS1fxHWo8eK/XulUnXcRkjNuZVUMYQz70oJU2M4CjG6/h\nlXcQD3CzzwIIyv/Y5FkEQFukSIF9Gl66K2iL1B4CtPcb404JqD0Fwp6GxhYM\n6t/fGkkwlS8DD9uyfshSDKiR2ZnhIosw93WE0hw+v0xtMEnfdjShfCaVs4+Q\nFtulEpxlOnNbIs5a2fenQpsvIxdT7A3UFj4+2SivpnYt7J2AhwXNffh71bNP\nDzJfvmKpXfIOC0Ef5btE03bp+WcSXlTsyeKst9veSeQwQ0Q+7x4wQzRW74/c\n+iQHA0SET7nHmLAS4rGgoss1RHgEZn1Mh29yaLQi7qNQnhdJq+rgsQA9r5Ux\nP+kDqBTRVuOG89K97K8RX3PwronRLriRjL2swhO/SNXfk2aQ8syBvYYXqmQk\nkBBtxfcL/9CZZBBfM5GUKbPDM8oJe126JWlJRhSkGdGLt8VrE93Gq1QFmICO\nvrJKYx9MnzdfFug+KK+k2yjR3WBqna6kHAdY7bgGjEz/XSSTTBSSthZf8tLi\nxRJDj1cV0Iw5PiF5odpEQvNO42THdTokL4XmKS7Q/lpDFgF+uXoqg5h3CW0x\nJ5R9VWq/5WtTvGDMNEXnHgzFM2cZKww2fw70BTUP0WWjeUUCixRi99/dqMH1\n3tfo\r\n=gATR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAO6r/7P5xvwjk5ZsOaPl+obDlj+6n/dnHZSD+PsbuNnAiAeGUB86L03Q/ZOxnNHFDOls5SAJl+9b0fH2hr1f/OR8g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0_1587111541288_0.7079036909459768"},"_hasShrinkwrap":false},"1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"68ec0bcbc481e92e780ecb64fd5fe3be55e52473","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iZyR9WTpCKta3EEyXckY1d7QV6RfrupWZ+kmIwSiAyCQmVrMMSiPkwaxCKpE/bolfYgJUTVsj9sdpg5b4UIdow==","shasum":"bf225b07eb457fa4b2ce61b9768601fcaae89fce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0.tgz","fileCount":22,"unpackedSize":109783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWauCRA9TVsSAnZWagAAkqQP/j3O9zWFml+s7gyBDsUY\nFyJ6cBnrFbfGsi7j+tyTs5X+ZilyxSZ5dKLDrPmdYIjvrL1MfCfusmpSJI2E\nsTTD/xe5VV4xp5SYLnhtUJ9Ogmvn43PCA9ppY15K9+rsXXFXI4wvuxgkXj2q\n6vMYGLnB7mT9yT/kC8S6Iv7oWEghD8vBps7dEn3bnmd43mj95qgJ9S6FRc94\nmeKxnPdnuImpG7IULukZlCxiW9hybm/Fsw/hmt6nxHD3oNXmrlp31zU6pZTJ\n3gpSvWdcCtgQK/RLOSywMeTJgEgvnKH/Fp0eqYlsF6AoxdTZlD69K/grrGQS\nB+OoLBXLu4gXfJBXO2RAoZATMlfemn2FeBrwk+3KbsjehL6s1Trotgj3ksem\n4ithLdWVBnVOrIlaqNW6oj8piqX8xysngVpA3ZKffrWp3HwqNemAzdw0p2Tt\n6/Nxq+vItwII2tfNQU2GinqLJUlROM0afaBvPkye1S6f4HQnxhxk5g6KbVJj\nXfHG6bVT2SKJlBLk3ekLeUBtjJ51VZXgKLlgsPdl4N7zL9V6l2VnNzSOzD5D\nWPB4q2HCeQurWtkxEdJsxo1kV+gZCSsiKCbyNc3TLMHwjD4NZHfxbpOdDZ8j\n68OelMLEEEwT678ZOxZ3ETYo2UaJMpeg019HBmKmLi7/SML4oWqhjtx30MOx\na+cg\r\n=5mG6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzu/Kw1rQvthb2inotETdW87nG7GgCHsDxFcupIFQEmAiEA5eQbqi2tHOWPD77Jts3RZR2ulHy9cMYVrPGfweTtiNE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0_1587111597817_0.05136401442538285"},"_hasShrinkwrap":false},"1.2.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.9","gitHead":"455a7093561dfe78ead5576c47bc53ab097bdc3b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.9","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-akCZIcQFwo9mQnewg3UnvD+UQa8+KOSVEfSUQcQw/AL9eP1+knCerQP7SOc9cBIZuoGTdSzV3a2qWa+mopkHCQ==","shasum":"c1c8b1b97ccd4881ed63462603f9f52f9dd5ca74","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.9.tgz","fileCount":22,"unpackedSize":110014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWa6CRA9TVsSAnZWagAA/QgP/0U65/I2L6rCSPY+QuQs\nq7VNshRVRQq3uPUvW6CYq5oayG9TDky/npLYl5wNTWQbuL2J5kEGUvao1Xa+\n6biset5It0FChuHv+lb0xBi43rs8KMwhBhdgWm3zV9ySU7YVxpk6uQAqd731\nHhk9pS+eRMqBt5ktqu8hBprfpKzJDL4lj1AXzDiXj12Zl6nXmr7G6qB2Q7ou\njvrvyLcZi8YWLHjRvsJeNNAoVHDce00QvLlSAwwhq/4bOwPb3BzMTyf5fSZm\niUCuB+DsPddcyc0MC8TcACZdSZygJVjTCYWY36T3McuDrubhoeEpeZQ4s0k3\ne2E23J4UGyyGspPbna2iwcnWo0bbylmMaYgScvXU896HihSO/yj9hWbhHAp0\nRW9klubBRkQJmdww3G/sXSHi4c8WPtHkEt9Z0+a48d91QwtzaXe2MIpLrUej\n5y0YZgpTaFGfdpyXblr/VCTt+AFfwYaZHU/tYvtM2THoR6oAO1e2maSUSnM0\neejGPraGsJhMEOLFwe25FcxJtn3zVXS/at4MaOsbShFQaHMrsNM1Nez3Eqkb\nImpNc3xCxjRdilsJiWC7QA7seHF3HxB13o9AVwLeoNElRnzPbRgBgiDelkcZ\nwighDAe0MBYwR4jQyiaYf0vIhW8/Zm1liwyI5fh4LcJ9IJ/Ow061qY8L9DpT\nYjbZ\r\n=mR50\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDA5DIK7vzF0SwmBijKK0NJ8gFr/FPm/dryytyf65rHXgIhAN0g6hSkekuekZBAhjdtDtQBXVKVmUHli0T6AgtQUvbo"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.9_1587111609806_0.5952529254738197"},"_hasShrinkwrap":false},"1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0","gitHead":"164e64ed5d290a34cc4d3467fb5df84a7ed35f6e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tZgGZT78XcH3TmnAydWVuGEbUlCDRi1vhpdRWD1KqzY8sLjrKDsgdTZXkf414dfT17lLYLfsc15yfJ0UPdxTog==","shasum":"046e789701a90138ed322020a97b66008ec4d55f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0.tgz","fileCount":22,"unpackedSize":110010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWbmCRA9TVsSAnZWagAAobgQAKJOc9KD/e1W7Ffoqx07\nUqSitqNxKtv4qDUoyU1lnVlRfUi1poZvuI0Xd2cS6hpOBAMgogkS8NOWZv++\nCWvcLmYgu0B+zVxhQtqtMNIFijiStt5Fn+oeis1cglIrQXVKZXRyM4BmzJc5\nkw511qSQhLxxIJKxBUcahi+EnoTN3CRn3OWH0mmc+nS9W60ZCVJQIFqS60cL\nuzf1iR/HnuM6QGvlhHUy2hBGIH0mxbisnBUGtKf9aVrEHWMLlOvVd7WTaNrz\n+ZLOP6zqOBgHEhTVmtdaHVq98WnvcY+XRkbMCvye8indzCvK9qZyshmodcN1\nEUczwSadTqEi1B8qWg8pg9etdYQues869VnWvwECh4jeLzB4w1xGI/IVoPcA\n2LldJSfEBlA9/hq9f4aZL5cztrEP3CJpA1K24xCNHu22Utt7qk9B9C86+Zi/\nlUeP8LmgT7qXmqG1G6gvUZNNOWHxXtwMgIlulPC2ERr0Fd0EMxuGMcz4ShEc\njyCBFiko+3OoOkZXzg9+6JFr6TW8jR0oA0JQSrpLVd/1L+cbpDBmVj+/3A/5\nTc21gcZWA8+wzABDKrZuBwhUc6r7dZnmxbJVdNsyLNUDOvB8KPq2d2vzHMog\nziP77cIC6AegvC9AWEF3JgifkxlywGcd8dGlnlmKk06NBGAhnWwA9wrycDas\nOUNU\r\n=j1fF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3W0o/gPn86OgGcgwUypl4yzDSNbyBoFapGcuYoU4dgAiEAxoT+neLm5sXAWJONKFxKnXljvDGGwJvFBum0lHbiNeg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0_1587111653937_0.6239378548448902"},"_hasShrinkwrap":false},"1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"455a7093561dfe78ead5576c47bc53ab097bdc3b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YOdtwxOoD2dbazxaaHCeqth45J+lTyZv8hl5Hgx2VVNcU/PtZdmnfm4SVVh2jnsl0HYNh6nzUTZDpNI9YzCJhg==","shasum":"6601fc4055b29feda2d3ad1521a83d12cc6fe5f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0.tgz","fileCount":22,"unpackedSize":110058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWcECRA9TVsSAnZWagAAXQgP/10MyxvPXUi5HIwh1rQd\nBDEuLV6ylRxLjo+zW0hLtqzbuIrfhJbW5hfLVH5u86X90tBtAV0SaYsrS0IP\ntKUz/jFEs/pdqAehUZMGNDiGCf4xJKl2ZQDOkmK8rvksqAnqvvtv3WniggM2\nZF04NVPkTupFP5Ii1kEklHa3Y/RmVcG4wevrUnWh0VrMJFYdPMwdK/UBICzo\nOFkUTC8QPeuJNXr+75acOadG5ZaT9ChPvb25XQj6tn9khhkt5Mvj+ZDdrna+\ntqST2UVIu8FPR1arqxmwhH1e+yXUWBqLv0/+CF1HhwwiUe4D2ddsdyxemSoh\nI/fZuOpWBWr0gJoIj7QZIHToBbIVWroPn8jJfWncb2P1WdM7aXjeu5DX6CqG\nWOYKQFA3RkYR+S8HcwgXO6nGfbLMkC3v4tftk0n/S8LErsy6cfuw9DgID+eq\nSQZSiso2h5FFoy/kALkmSeI8rXJGmH9FmNeCcWYgFWuoa36vJtHtaPIl3Rs7\nJfNxPvK8D4T4xM6bNaNh19FShpSMQil9HWMQAAuBJBORRKE+8RjfdB9c5qsH\n0Tw7LSi9cgbM3sCtTWk8GMz8w/YcTB2J53hYtM1Bf+jeqFNF0VZFwXeP36EV\nl2CYlb4zpHLyPgPt04WlTlCedZvoA2zRbERqQR69z6MdRxPLctnzHYuCV7wg\nw8kz\r\n=OMV8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYS+BQImfwv2Y7S71t1qEfZrc35X1qfRYcPQ46HBJOegIgBuxZdBSCnC6vBRgNOS3u9qLzmkLPgc7oLKQhymcP18Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0_1587111683752_0.585871523233435"},"_hasShrinkwrap":false},"1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0","gitHead":"9c1d70ff77923fb8b523c13d6db072430f3e0161","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PSi2SNXWS+A6Ta97AdwILAlu5JaNC77ZxQGaaxavqketVVZpUbpZjACZsXfCeKQ7nYGm8rNFsTlbcQFjEertkA==","shasum":"559808540a854f45df8e7caf53266d9a45d426bb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0.tgz","fileCount":22,"unpackedSize":110010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWcXCRA9TVsSAnZWagAAb6UP+wdJrEx4KvviJqOYAWKp\nJic/3Q53mIgHIbGGMtxPObis5kob3CvvYnj/eTDcEupMkqsPdUQG2JkSXrrz\n5ayuR/rOEMQvZEngASTNDa6LQE3cuzRMrgdJ1cQeZ7VVSY9n2X1JG8fzMlTE\nos+CJyvw76l7s8d8eOGmIq7z00XYNstrq6khcUt41g1uc+75106tllM8j7OJ\nlT6dZK5LgwCw/7Dv37fMIffUbCMlZ1nhIhd1vZNQXWt/NpeaSM/bJzUkBi/B\nnBf4jxZL6ZAM4dNUCMSLHy5boSAI/NXJ91gItvhyKhFdzGKrTZTq1ZP9tGYg\n8DJJsvlKdvHpT1b0kZc286yUEWX3+sHtpRt7mkbsSOP5gAv/PXL7YX6T7wc3\nc5CPmkbSjN7WwV5Of6DGYSUbQukOqp1RuI2x8n2STor4qriILXo/E1eAV+eo\n2X2jJCnokK1prw1Xx/BF9+xvJ2To3rncw69qlSKxJrqXHfRDEA2GnKpMsjQR\ns0I+cd+11GozljGvr6t5KXFZ2SCNGsJoGp2kNqgdp6R4qNklj7dZkbc671RE\nzdzsSRDOxb8gU7HCPJIotY1rZcQbMCdB9xT3tczhu7x8SivociDUcTeH4563\n8Wq9ejCezudWDkAs3E3FNzb1M4yd10IprfLbSXHmfXHV0zMZwIymztWVSunY\n/Gmn\r\n=yDSU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFq+hETgyPKxUXAJYERF7QCN48q6MrKEgjwYslsteK6lAiEAsrIHmaDWzUiPXThePBjivkzFctXWhLXTNoJvvl/zQCg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0_1587111703024_0.5960813124503077"},"_hasShrinkwrap":false},"1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0","gitHead":"ecc903da7bc5708468c68b7ab1fe0004a83c38f9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f4z1/iqlM8K4S0U6VTIUHsC/RqSdBZQrMo+HpCorNk/F13cqccfAfqFsn7U2UEN6hYon9uh5F94GsBM9w/uUjA==","shasum":"c96dcad785dfeaea0cbc61578d319ce2cfb0ee1b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0.tgz","fileCount":22,"unpackedSize":110044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWdNCRA9TVsSAnZWagAAMKMP/0IUhBv+gqTTONpuHNnd\nzoCgmYiOqE0t4S+gullwhuZW0PtNUjKVx4R31BLd5YnGhnLR+J7hhhtD6Pmr\ndwytomPCVU3GQdueNcyQXvCPOlzcWEJ9WXqLwFXXWUBKVVWuk6kiHRWTEzxB\nvG3LJ+yORcLFQ8JqlPVBqq1hSR4+N8pQPlWPU0aRkqxhJr09Qo5Xc8bW22na\nfXUCszdi90X+G8SQroaSisVomC/Vltm07DZfrxpOJk21ag724NbZb9m6QVya\nx5WeVr2VTUAcjVR1LdnkhTP3Qp30S3S0a7E6LcX1DHHrP9eUHsK0WHNidVWW\n924fEFlvSXLqWtAHPGPMx/2J5k9zMMaUj4/uLRpOGmcLABXu6wKzRX65lObm\nhaOvZOppoWMmiVXlkCL1YnBLMbHOmTUkvemnySWHQDrKW0OuDax20zxqL3Ip\nn86tAjOXwkOXZ4mHChP4B6IPfSTeq9SGome9L220PccVOZ6/mekrU136PeV/\nrjOFQh3jVBWdS2twnJTaOmcp0ujZMVSsBm/PkXp5TJe/6s1Nk/0phJLZRsCa\nrFune8EaUDX7C/B9djrTzFVCBonhTz6bHNTbTRPQS+5qqyuaaVEwdaaUf7hE\n8nAQ09iEVJ/HRWKTa1H9KTVXReaGZwq/6WzHRdsTl1afAIeJmyAL4XtkikVw\nFGXj\r\n=Z9cK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3e4qQu7cRKiAs/fbGgHOCiOP4G3c1eEUarro965XalgIhAKI6/i7sqFAPHOBahDWcn00F0fmtv73YkdREAFtI9WQO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0_1587111756753_0.6563258480671879"},"_hasShrinkwrap":false},"1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"859dae7d874ff71f126ec45e691fa6c897d4f4d9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KVtMBZXml/RtsfIuMAd+w44fQVaLslEdCKN9CKdFG9eutooKH3BXLoTfma37v7IeY4uauhtku7Gj2BktWZY4Ng==","shasum":"23b9b546c689c9c08002db925f1fcf96e8d1f92c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0.tgz","fileCount":22,"unpackedSize":110010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWdyCRA9TVsSAnZWagAAfxUP/0oY6lAp8l5ri/1x/NAH\n41FdvFnTASUE5SJ1h8QjqF54v0+rOWYHbgV2T/OhHB0JBjZZeRwtwlAFI6uR\nzxizq08+YZ+ktsLnRX/Wm7+iE33YugGZpC0pEjRGLBmD21O5h1enGAQA9cxj\nOxIzs8TjYPN6vU9UZYd6YWrJmadaGdPGro6J0P7Mw0o1p1rlSeARDG1E/x3L\nlwESIbimSdvROlfb2Ubiv0dWZqLVpY8sca9HI7vTdsWHuAgh3Tipk/YxE9T8\nGrDg9LgxaU1tenXGUX9B5k7Xn8rhhB7g0BLn7kHGSmwcG6ZYIgzXIPvSIER0\nxRML88aulw+p2bENmtuDpSAb2A0HgH84lNg55o8jVs5I3klR1u1LrOQWfXL9\n2gtcFILRy0qrHMzJEJ3AFA0lLlmyAUl67E9oAE+0hJ8vmX9EettWpKhVBfn2\nbrVr5XdPGiBw5RHQMyCkBlFAiFWh2d8xoVS214TShwCn6DIVSmU5wll1TLpK\nlJYiOM91xgb9s2gYKz37Wz7cm86mLbjbwogO8mQZ0lruh06A1Acuk541vH74\nVJzX7GBNB4t/m06cvjXbiw6wASIao188dve62rmKKOBcW2vxQ7flIrjPp7Kt\nM1FrX6YfHYjJ6mIu5Yu+jXagIW3UxSYikEIDP211PBLmVdVCr3skt0Q0rtkp\noul9\r\n=qTna\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQ/ijlwnUa0ZJOjGzL5e/1HNQ++F1IbOl55tnNscrRkAiEA3XmN8aCWXnbyZ+mDHIR3CUKJu97yMv1hmfO7nN4kuqg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0_1587111793361_0.052791380212082295"},"_hasShrinkwrap":false},"1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint","git add"],"*.{json,md,ts,yml,yaml}":["prettier --write","git add"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"","format:fix":"prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","lint:fix":"eslint --fix --resolve-plugins-relative-to \"./node_modules/@ridedott/eslint-config\" \"**/*.ts\"","spellcheck":"cspell \"**/*\"","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0","gitHead":"85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4FbIM+HT/9nKl6czRpat/DFKYR3se0AOZjWds47Z0ML+Fhj8fKGaerN7AGRv8WZx4TwKNrW2LbTJZ4Ylq/cQ/A==","shasum":"4e24eda945ac73cf79dbd61c067ae36371708c10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0.tgz","fileCount":22,"unpackedSize":110044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWd8CRA9TVsSAnZWagAAEkEP/jnh4jBRT3yjt3R2+Z4q\nji5Qh2OopTTH+imNBHkm18ooryTxoeQpAlVNkzUbE7lyn4oJMg0XwejvbjBq\npQJ3p4d2mzJg6Z/nx7IS3ulprAwHz/eFIsjgI4fdszSHybPbWv1vRtBC7lKA\n4InvS4/W2BEbYKSAYO1Jpqo+Ei+dNZipUo3sKogqg2fj8PpJhRQKRoUebk2L\nGhaeRY7bp9CJkYgZKbD2AULggLGck3nhoKsAZ+UF3gZGQLzpcb5UFubiukFm\nFtn0owoFsmqES7k/wf5YRtSaubauDmBjEFfJpJ7aGfAC5rmb0kq5PHXoJ/Rb\nsYxKR6xjovI0cNoYYgEPNNNMipRBi/j9oyRRwu7T2ZqaeIBrZwiyT9zRojH2\nxIBITg1Bl3znKs1SWOE+rm/Y7K+6IohWEw3IwVsAJObKRaxKUkaUPe/NDh3B\n744Kb0X2oiarsCUNCdK2SuKp/nVTT31Jbfthr6x5l0suXyeIpibV5D9v6Bye\nt4cuBktQE+zglpDB6so/af3UAtbyDU5ko5whCOnVaIiJWVzX2wSokAPA+CLT\nOwdsZVwzYmwqCzVoGIMYnEPdeswiRz558Eobgfd/aa8eHu/C4cw/xaGVPXYP\nu3DftebRwuol5FlG1NkCUeWirr/Hzb/TArO0SOxwD7WcFgWTKsNyHD1uhKwA\nUKCY\r\n=K6Ku\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwnIP51TYmDFxiy+lJL/Yv5wfniRKtE/jnSL/zcLNTDAIhAPNg62O1Dsrz5FVChf5ue/i09wSaTCzLSGSsEzkDUovx"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0_1587111804123_0.11639703107443977"},"_hasShrinkwrap":false},"1.2.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10","gitHead":"f8c79d5bd55b503f50c8d7f959acabc5deb11b07","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+Dk10R8jfIhYKc8frN/dvsu0xemDhc+HQOsRcgw0Zi6YGJtdskDJnOhdp5kmvfTEa38uWQBspC6tKVdrqJ83aw==","shasum":"5ae89ee2d58fe7aa4e63304e2e04af3b81433ccf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10.tgz","fileCount":22,"unpackedSize":110228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWeLCRA9TVsSAnZWagAAPiQP/RCdEFfRW9gxddiMHQyi\naRE4Uz4Rc8dwoKWTbiNDwfU9gzLgEjadmuN00utRC9B4onsI/4lA2oJzKqf7\nBXioKhbcXgxMN0dZivyjAxf3/Fbxsnx7NPHyHPKI3/9OwDTBkI8j0JT3QGFU\n/UB7HxUujxyNL2w7yIk/eixcHMEhs2dx96//FAriQ3IoftmHP+wqTggRXtqp\nsgfocyEg0CkhlDVLs0FWmTZgY6dT+v4RpMAvnsb/8OidG3IlmzATozzUzEAa\nWBCyjFJ7cm9zV/BJ203/nK3vqhjjuLuSqJnZb342Hs7tc7V7c17scB2PQZ18\ne6M63SUOT7LjwtzaQOUib3TrKt6pVwogBt1HPsd9xuZCGuR7CybyKa703VvB\neeIZZF7WwHulet9HJUqY6ACmiU3dJnvER2AQ/LoFc3tm+fpICdJlJ3jysHiT\nlvm3c9tq0gfegUwkeEg3iYuOpRzt+XZh0Xb3EE1Zmy0NTGQO5sBsAyFgwBLt\n8HqCybSSVoCtdnn4LoCYFwIWvWly1kNatvzbXADoCDjxnZjILjgVNigA/S+S\nngkObyS6njU2/bTtKuSz+beWv85yOvjjKukWgxM3kq+jrhYXZAhX5NswAhxK\n2T6NS0eZDsHFI+P8+vNSKKK517MP35K0oFtSWmj8MKVlHL+DTaNcCnHiYj8v\npKM6\r\n=SDjy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBwJjiMWlRBk9wO6NObuXTR/Bj8zKWuhWMMUN8KLjZzAiEAw2+C+Z1zWCR0O2TMry3vyWMblRWfeThe+z+qBLRyUVI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10_1587111818509_0.04508490761786699"},"_hasShrinkwrap":false},"1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0","gitHead":"a7fe5d4912204e081b072ed1b66428fccec5a0d3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+tyay2X0FHkbHncjOYPDliB/M6wsAcrSsCpm8mDdnDcFLz4IhLc0olWTsT6iNU+QoUlKOF695PjQH9ABRpXMMg==","shasum":"6f34398ac11444be764919cabbc4bbe7968171ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0.tgz","fileCount":22,"unpackedSize":109996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWejCRA9TVsSAnZWagAA6T8P/iQSndgnkR6YDa4s+j4E\nUV506hDkw/JwGMphp7r1OSa6QSlrT+nOqZk7J93bnha/5lvqrwcwpqWDHS98\nCvIZZVpRbaRv3v83OsOGZJ3g6RROLhYpydd8wevknR/ZZE+lMBTtKls1Lnk/\nHcHTLwUimZbkNfZfIUsShBUY+3HWwN2gjiNtcQh4kT/Bcw52xX1MWR6Ifhy3\nsv0vyi02tvtftF+ovjNO7ddIRDvP7L0oGuhglxQbNW6I09wTpfSAUXnPGGHF\n3S0YlpyvBVkrCya704yCm7bkoyl8UHtuoX3Sa9f2OuVuw+tZlVeFaikmw7Tz\nhAcVrKpSMBG3cjPbFgijrJaOmC+2wIsEVfR06fyqrKQ0YSQnXatD7DsvzKbh\n/adt4SDCM+XS08yMHqHlK/Zf1rRU6SKdcKCm701fotThc/Emiqq/PR/8FuDF\nFhC/O/3ew9gvSv5zL+6+lsWb7UY8U+ikMKqgEm+wYRKDkqeb/I/njuwCv7z5\ntfOXBT1exBnihNpG9kM27MMNOOS4dUKEa3miUgS6VL+k3sSXKME+nQ+xb21S\nOruLaeB/7LsUqEgYZtuEL55wJuHVE/KnXaOeeN18yf2NzOAX1gVXlE6pLgv5\nJEhiTmHI5pL7mjyOKKUtUp+1K1pbQZSgfN0FraMeBxWRuJ6AYEBhhDSHksz/\n5pV0\r\n=usy5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBL1UBKaH3YQ9+Shaq2PTummfM2uZuJMwC+nrEZ8hgtyAiAuo2IhEJEJ/2HU/O9FdHaFYtuLo4ODoU5iuiiPF/mTTA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0_1587111843458_0.07631820677905599"},"_hasShrinkwrap":false},"1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f8c79d5bd55b503f50c8d7f959acabc5deb11b07","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-eB/eXgMF4Cy0aA0CzkiUAa+YKpUdV2w6Lb6TbEgHN6Kn8PvUyfsEcUIEZfocSOLw8XmpPQISC6fQPMG0Jc8r/g==","shasum":"7f153c8005a1618905703d666d95da537420bcbd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0.tgz","fileCount":22,"unpackedSize":110271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWeqCRA9TVsSAnZWagAAsg4P+gKMwsE0xz/DFehGZ21Q\n9zbybcW9OyFmNQoehqwSDvY5fX4CB1rcjMLMygpFLwTnBEOZOx0zdI/qvR1f\n7ivyG/I16Zb3z8P4CfPcpIFYOES/RVitcNY6HX7yFXLOrClfv1GCQOEplyaS\nCUm9vRXvkHLlifGt5b2BIpotGADqKBKfqmAqVqu4pdR7/tCwv75g6arXVRZM\n5tmBhW0g7HFWkBTvyItvSx2zwpPoA9KItHnXW1QaJ/kHyo7S1CaJJiD1u6Qi\nQpErpwtE0iGseAw2qnuHS09rSZ1iuNT9QzGznswUzvDOGrYuKv7sEeJDgRB3\nQGJhBaDwy6ZOVhS6PNG7N8EfVPvqoTb9UaiKPcfpwHtFVBHRsAI+UfnjuiBj\nM/dcAFWk5IcMaFAygWaPjcCPBpEX0ugVAwU00w8FpTcOfKf4wJb0pR7LqL/Z\ncaiQR478/Dzj/1HEPzFHlyxj2PlByRZl+cO7V+6rk3NcV/dxeX/xp1XmRdid\noh0gptHIbeRwHi8JmomY9wuT3FEdglLU0fFLoZGe1RX4QxaNmsMGGwsPkpVH\nJwR1jylc39QX7Qt+rGaJjHhYrIxgSwRMqLyzUtNpVxcbU7FHP1v1xbeVAWWa\nBidrx0FIlem37erzbIQypgiIDBY474eCPVodWNTdpImbD9SFyaQ7DXi3vX2A\nAEoo\r\n=8ZMw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP88onN//nGFxqMSOGFBq4jcdhtdUT5dgZ5eq2DEMNAAIgLx6XUZHI/yBUbg6NHxfoMuKFXtItphLZiEtFIBBAa3M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0_1587111849521_0.6898641219355168"},"_hasShrinkwrap":false},"1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0","gitHead":"0c7fe8e2013b10a447130f60b82e46f13fc6ae5e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HvOb5Sjd3dSdgC7YdWzUOi0iAHydq3QQL1imqjYlEoG17n1w0ezoNy0cJAeEiMk9/AD//lMNz+LaUygiyh8Lqw==","shasum":"b22c67693473e7f50e15ad9f9a8be8b24ebdd08d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0.tgz","fileCount":22,"unpackedSize":110271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWfBCRA9TVsSAnZWagAAFHQP/RygqQNnjjNmdb7IQKOT\nM+uro6u75tYyYqrzPl9E9g4Qb/9W20W/lqNb9OWbQVoCQFNcwWuL9jJUFjzj\nEOJe9ODV5GdvJhU+kpq58GdQbYA8plFptn3SOShSPCJ+4+uPOMvENMo3dsbN\nEf61XHW2DjsH43LX19zqp+pqtlst0WYHFAmkrE3a6RzbaCgI2imq3AO1d9h3\nHMNLvg6AD08ZATbY23ZIVbjWRRev1SqP0tFxzR14Fv7vy9UaNjHsp1b7gW6M\ndL/To7g/pgbcA4X9yPbpWu7BgUtrKc+VjsVlDYCemEO0d6WxTqiNoHRNHrkB\nayFCf/ysnaDcZF5NNP+HnPq/S1/0VV5f0igX4c5hZ0FdECq2hVuCNh1g46Tt\nzCpRSnJaM5EjzK39npVWMGz7972Pd7p6bV6mtTwaXPjh6drn3f493P5fFtps\nQMwjKL0TIfCCLl3d8I4NBsIy84piaBEGX1fY8oeDMWe/1hVMcoIPCsTN80W9\n1m/BOu6gWrc+Dr+BwCWcXGXKEH41WHMrvYwLFFwmVuYXw9hHgEJAL9DhxJ3H\ni0MBRhnRixlUK7q9V0WBeJ/ju4GPaQ90pgUZm6p+SvBDMM4FBlyw0fzsYb23\nEzonvZZZEPQeGdaUwnNl4DErkDk4TNqyVIvaYV+Kg2hrZzBr4HNzDC0rFRSA\nmDM1\r\n=up7I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDONZmk44FwFg7I3PZCGf16zA4YsRASPz1kg1Ah2S7qkAIhAMJefjjVp0d2uGKqPcvFPyi26QvN+UNZXlyAdSj3CApn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0_1587111872952_0.7828170522092845"},"_hasShrinkwrap":false},"1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0","gitHead":"09fb3056fb83f908db0b03d3dc9e261d3616c94f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HWu4i//lwnRERf1BUCSmAhquzqoy+ZOhBW8/AhkUXTT/EJOd/N72KnuKecqM0ue8NthJ5JjxtSfFKZDlSdLjRA==","shasum":"9b965476165abeaa398c4cf518bedbb77ffc9400","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0.tgz","fileCount":22,"unpackedSize":110271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWfGCRA9TVsSAnZWagAAlPUP+QFnNaIkslcVBQCCqBeN\nIYsNJX3ameWsCEUAEsodYev5Sd+nM6QtkzoyHKGMdS9riE6ZjjaDN3nTe+bC\n7HlnxHusU2FgdNsB2Yw2gQDKpoh03Jk6ovFV5Hh+i5/45PX5iwnwOddTBzAr\n7lM/JunC1Wpx0F/V9ulssdGsUIVGF7tJ4AkPwwUPgd85FKzyOuaWBk/ilUMu\nrffEj5F7ZDnQBlMrf6phjk4VyjVK6TZoNig8PsJGYGoMgaU8hvWPiQA6zUT3\nwiNo1JAUJYcYhky0Nt6Kq8HOOA21NJSgzPkziSPNW8lqJ5JSCxV9k5AyQKU2\nd/TKT8kKrpRxwu610iB3isfDVyJlWRzECmai8Tj6NfaKPAlaDzwjk94PBJh/\nYWU63Of4QkjJeGR62tGdpq9XDgkNhBSa8r/WAv24NCanR2juRRGRCezaSBm+\nUO2UCZw4dxUbcO+hXFt5ujZ8tvyRnvvndpUYOFl3i0p1rzJPmugRzMZ7gPva\nJGVe6UYlEIEZzi7wkIIoFMwUGTVaHfl2mtO5DRl3p0aaIy39TrbGLWi0X4gN\nekUROAHKLe/CLczt0lFzMTUKtp84QHAhc/+UC7TUdkF0qJF1p0H6aySSSCzN\nBTKO9sBoHz1j9zAhXSki8+6+FUAcmYYDJw5ulbCrdXmI0kDLZ5yELnKL/pG1\nz/lv\r\n=83zN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGupTIIZzKZdLPV+JQmt8KeAMphEZmRR6GttSTDErLkQAiBpRMglNcOfo4ytpCpTZB2JcHpZ82uCi9aPUEcUQ+lRCQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0_1587111878112_0.735081997581339"},"_hasShrinkwrap":false},"1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bba406ac585f3a8bc6f74314bbc526921a034244","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZV9sVj7J/ataXtvq6PU5kp/ZeYaZX37exoIXWH7Bc94ZWI11K72BxH3m8W+20oYpQX0ZheOyP2WoRfTNuI8FHg==","shasum":"dfa75d1f5918aa1a9f120dde996064074d6ab096","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0.tgz","fileCount":22,"unpackedSize":110271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWhFCRA9TVsSAnZWagAAMk0P/iwo3ySsxy71XIILu8rI\nVk1RF/190h6d/yVn9tHqZ3nTO8V/l7v9WWR+ee5ZLsERF4Dz/TFRVIjf41lx\nrXNmMZ/RzwLCi+6ijUnX7u2oLayZ75Q0O3W9Brp0D24pvWo9ewbaITzezA40\nKlXfqq9qvIXc6xGGBKuruZv48C+WfULYpxSxVxyd/BjOtt9/esfr33qiaPvN\n2DIINcvxxq8NsURimwG5T0tajlBE4vHU2qNVbBja69jQaP6QvLpHS9E3M4hO\nqgyMjYof6U8Sb8wqEZchgJhjUNAT8gqGgU24Ogi71rcw8Rr3i3lfBKavtZ3X\nSxkQvyIYfqzkIfHwQ9EKFue/T+dFSKxlPynjtIHa7QXKkzAi7SMu/KLUCC8J\njoC6QUIEbMR7dph/NhjUXUkhkh8nYQcHXvQ9KZ6YOJciTjRpPEPfTyur0pmu\nBiQBxRqAUj982RSWuN/2MWTZYlxfmJTmoSFcNAG8UK73u+m11mzbvr2cWlVt\nSJgmc6Vy5FiwTYg+4YVhwBxUbAJ0XxKWBgP9ifflvEjOZsP4wU4PPfN3bWgk\n6MfTKvjfZHUZN9NAWYlIq9N6lcrOQpZQ5wnKPeuGiA2/gWAgk9n9XQ7tHYbQ\nMq3ClPEFueKSYshtVj0Sfk8gR569PHCE1q+OFsMsx++/FF48Uk73zZlDoyoZ\nSH94\r\n=MC/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRkxK3I9IHXGpXHpayyS+H6AP4sBLT2shgbImR4OCJRAiBBRMYv4gKj+aFiMuhV1qCjP0/pxPzvNsht1+etpm3TXA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0_1587112005367_0.6309800927052485"},"_hasShrinkwrap":false},"1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0","gitHead":"2594669582ab397a3876870cceee8e0822fc6529","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pgqIPSoRZWwyJ34C7sLAWpcPPSt5Hj5sKDKdlhyiTA9iRkvUfRowoaCQGMg0Dzu8KsaYbE6WUaUK/rBcz2tsNA==","shasum":"47cb950de2fe39399b1f6d9bfa467ffffa4f542f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0.tgz","fileCount":22,"unpackedSize":110257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWhZCRA9TVsSAnZWagAAJIUP/0EGrtcGwOuYXUnVkufO\nIPWw8vOSsdHrJSe5whNUu7UBoRDUXbzM7zJKevdqJcl30oMRLKToHT5pm35v\ngIV32LzMEu4y8eGFqII6nKz6cGEwAggH2h3bI9xAqDS+1GEV+hh/JTCM1l3A\nc9js9pWUi6o17tkfFGNagapDZhJQw/cKbw6kFRD8M3eXhV5L2LF1AOfDZaW3\n8pq6VD9xSvVURTTae8/coESj9jYYisO8Bbjd1W1j1ZeKaGOLtIAHup/FFNie\nzCSyP00pia8Nckuxrar9lDdvGckzvsdnpOlDPV5gi7ynFHjkR51G9ViMeSHh\nZ1zICBrPFGsKvL/lR4rHsXFAoF2Xpt0NZQZGb/z7+yYMOgEJlta4v6Nhbwyx\nu7TUvpKBcMj79NiQJ9pUbVObZKimskfFcA+jQABx18ZaGkP72b3aTaIQPtZg\nlvSe30ADOUcE1+PIgHPkrU6d4lkM6D3pfiYnnpZy43zwMDfYwsg62j44ahfK\nQpGAYZZsEhJlTYRIlPWBy6D+HYc5k4EMDe8qpZJzGLIwy5dCfbHhD3XRJjD8\nu2cPst5oaABUTTAztmk9bk6WTJaC9lRCQSemCWmg766nd+qp9Z5yeNXIXoGe\nZ294bCJJ33IL3Rt8aUmJs9n8HKyBCMmBR4MgLN9Gk/nwhVOPW3csJ56GRsSc\niP6M\r\n=TnUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCMWPAbTR4tIjhq7r8VE8i+LoYP0WZmyrbyoiLA1kBoAiEA7p9HUsKtF5H/nHLSOlw3lh+J/TtYkKAcnWDA2tDH9S4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0_1587112025290_0.6163015776953986"},"_hasShrinkwrap":false},"1.2.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.11","gitHead":"aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.11","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hhMoYZtq/51UpHOaMwI6fFdj+f7pDwvlvf4s+ShscKl8hqicKPUOTT6+TKJEva22On8vcue0rFDgcXgqJee1tQ==","shasum":"22ca770d400a8e17c5619a269e83376a4e3450f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.11.tgz","fileCount":22,"unpackedSize":110495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWhoCRA9TVsSAnZWagAA8j0P/itagrm9STvUlVRWywpc\nil1Lsgjrtd8q6FBnZyNsq7zJzpSoo3pPJOCrKZ+YPw+lIsqJpoOhyKPpAGw4\nX6lF2z/qqTvhGu3d7//Cgzmf1rIu7AuUidtqJ5EvLNyF94BB+VtOMiM/c7gy\nwUkJH7JA7OIQarB9QNuHPKXk0e7H4WcJIJxG2h0ySnpDh04QSYIH2esehLVs\nQK+QVQKt3owJqLAXDoiHPjnNlhhzx49f75XWlCs3Sp34zNFEjnkUt++GxJbO\nqCNWyzGLJULBi6wEDesV+1bijU0l0kcY3qtUW71Ez9pfghJeJrgXl3D11EbI\nI3eDL1OPm5LltH6jNjkKRDel9beowzMa6TBvFl7dpmXV6U8+lZiBbO+lLE6T\n43nBd8sUZ74mI/4LVBioWo3lhDrk4AUrewuP4XyqNTUHtWyBurXZSuE1gtFk\nOscoR+RAHb+9bYuZKsNP/B9Pdk40M563+UD2nkG4fWtbc2KQs8gFbCboqPl1\nfrlvkqdoZbs8O1bOS7RwckmlwBbONCQDRRyQx8BxBpifWRMUfex+QViq2JzV\n1i2Ye8rTW6ywGjgCd6iaz7THiro4NIExuVCg5+bsRROfPNPR3yz0TRoBYfKI\nVRPvlxX1vkeJHhfVT4jankX1XaE1xzfFnY/wJQ4dySQuezK3tJY5mMeFTzT/\n/lIg\r\n=Kqlz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSABTU3/RnoeabiE67v2OXyI3ikYTf7/kKNokBjrj+5AiEAuAaetuXWEuuFQcWoGE82x5nFKZ8DMEW/iXK3tLe3cI0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.11_1587112040261_0.17252949572036624"},"_hasShrinkwrap":false},"1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":"12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VE+hJAVZK5rupLo7cgyh9qKHjW7apBbPGdKw0RaubLxtpa6YOpuTonTMC6DeODN6HR+lStGQtViHbxVnWu/Q2A==","shasum":"0550f356751b314a4b6e9a86449d0203d6910e64","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0.tgz","fileCount":22,"unpackedSize":110538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWh4CRA9TVsSAnZWagAAYosP/2y5Y5s7sLrMKASXSZLL\nakKQDYK9ilsCSR/6VbEhHktHdj2oztLcuMYKEB7cW1KDeQFvMm3/z2yQ+eg8\nxyWmC+WWbMSYCPck4jc5mT8HU3is7lVwBJz5QZ1Fgyn4mTS/5HsL9pd4jMpb\nAxU7z7s0+49EcG19yDlbf/67VsRdjyqc9ti8f6ShFqXR1wckmCMXu+9byrgj\nJzDiIWB30BfTCeZ+n37kcTBmtRcrIouMkVybdihBEmkm+XjrlGpWpLA+vrFx\nzjErv+MN8KDjqRIiDvo29FfKV6zwPm7gyTsuFHY9unu4kcaYSHK25ZUKDfcY\ns1Ar9ZYWmkoiX2nGW/U2do/SxWGJQZH2NWznrh4lH5viz+pjlqQqZd9KnbKa\n5RWQQM89cSHRqpNkHOQenJdL6E2CNfWr06pYNEKDrV1rJMgKNGKyz2u9SwTY\nuBc1r17Abvuy8FDMuODIG6C2HyOqSfOMBPAiumB/8Xtu8bKZCuHp+64OIhvX\nGO8u3+msOvfF00Pj4NSr4IhuexLZxl7p3L/vZwqRwOXs0kBSGW9Clb6wYXRp\nFLbjdmLiRbQ4VCj6SZx6amklev45OmLfs6JqF6jdsD2mpbTRswUW3M+iL0CD\n1eZqf2UklysCqx+dII8iu+/5ihitFZ9wmHiUTTn6DBqJuyGszzq5WtPaeMee\nZBRB\r\n=yOcb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCODZfIsCQQxYPB+OuBAhyQw9zeS6ZX8AG2DTeS7kVLGgIhALnvCb/BWPn53YznJOZ3Y/QRzdb5gSl/Zuc2GbOS6zSa"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0_1587112056057_0.7593499982829945"},"_hasShrinkwrap":false},"1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0","gitHead":"4c3e4d5c9a440135830e2735d1fc1f67bd172fa4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LI7706Nt90XHNFkpffV6DM2qSW+LS7RhY5Ar2g1SSRaHMj4LczzhJOx2hoDCP0GjVuSBKok9ZoS2Winf+E1kjA==","shasum":"815a88623c19d858b80eb054c0a8ff55dde06896","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0.tgz","fileCount":22,"unpackedSize":110524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWinCRA9TVsSAnZWagAAFqEP/AnxZbGDhNIQCbPduo0L\nfUAJba/33UPqaXlO/Y79Nvo3sojXdOBUv7oEn4KdypYuHSy6kvk7Dh6VHzst\nRI+FtIKcbacmA9YGRamaxKdjL49dMT1Cfi+OCnr6lStk+m3PAVY+DHM9IvNU\nagA8G+huIUAwbhLFANQUnalh3+mMsvQDXHNXbjZJxarrM7Rp9+Vjxu085lyY\n+mjKBVHamDHKSIrvQhaMprP75ri2uF/yg4z7yR8K5FSTK3fH1b0vhMjnGNLw\njZKfciV+K2k0Fi2QPl404iKyT01CF2AFufLB+LiOw5wLwjdcC3QME6KNcEwB\nRobs5clO49hb+Qc4VPtoy3+v8xfw3HBdwNs5cfxqxoExKj8e7xTYOxvlzrw+\n2B/kjDAPc1mj7bEJnoA+iZYpAAujtFtIEskwJpVz/pMrbXpo7g6w+NNy3KcO\nEnei77YCetHKZPyiWej/6OB7yjhTDtquySfY46yEVmplymf84c6Eh4zoUTlQ\nb2hKuc2UaBbwX0L4hKhsuF44y4q0nzuv0zN/yPIF/qlwMpdqQfZ6AIrKBjPD\nqNbp4kpOvfKHqDLTLx3KeI8Dc+H6rAnBjDVKkBxRuemzIdbjyVWrL3gy0NnO\nbnJJEr/+WMuNmF9gLk6Rovo5QbkummOCR8iIVs4TGIbDKrc5DPIZtKYtjCJK\nmtTV\r\n=89hU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDajTzFR9ZLgcI1FBNmeoGHHBC3Wcka70bG+zbTIq7FhQIhAMFlDIirTHNMxcQfwh+5f8iy/zU2sbLUqErAsdrfl0mW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0_1587112102492_0.7842204519719154"},"_hasShrinkwrap":false},"1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"20e8e5e4c2b7453be11842526938a7f98edaff09","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZG1s1ahkg3+bPzJBVRsgN38NaCeT9/wFC25hGiEiEhstplyxrvCzXBuunjfBuuF5iBBvf5Qtqu6dJ1lOQEMahg==","shasum":"775f45c95a65c0458363593ae3089acf33c0e91c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0.tgz","fileCount":22,"unpackedSize":110524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWkDCRA9TVsSAnZWagAA6YQP+gKw1JphdqANnYWpFM3V\nvA4jX9jT1nI7nyNu8QtbZVJan2WHrkKbBE6OYzClRoG502w5nn7pqunEUiiY\nup0nN7vDYK0cHnNpspi2vCkyVod3E3o8Qd3rdLGOObKAjF6WxoqHD/XqH6DY\nPGRjKS/qUPY2pghhoyCN673I/wbeaQMbA5KnpZ6WYkDfjWQ+om5eRu793HLH\nnlu8bT49qYTrxhcAPG3WaIUd9blcQOi0C6mBmsfIr25wgo6GRZ1vUWERmnDD\nZSr/Bq82kf4X35EhgB+bjgIi4tEHAhzmX9axd/U5rW5/rcyQ5imW7lIeoU04\n1JKVIeKawocr7Y3zB7MCL2ofkcGj99/4i9S+c6iL6LG7nE6Oa9Ygn4BXegMd\nJ+2v3qAw7A/q7h9Yde9UyExNq7NHQ93swqt651hgMexOG7x/DivRFc7ySnCe\nxjTZ+UYcrTEI4/fqjz/jrbkej97V9PPh3HGzRjcwz92K40Rp6VsYv8dYH4Lq\nam0B/j/kbW9EpnR+DCFnNaJPaTUiGk86IZ28WqrBeN+IBuAIb2/s23vYLSBK\n1SZEGOomDa04m1vTQPX6e3dB5DZgsh3ig52BuKdpKqfNSr3lL1MvEqzCTjcm\nKhZRm4OL3YNM5INtbNxNglYazWJmw/aTPPtSD85Ow+Smikd9IUP6aeT7J/8V\nFmid\r\n=+amP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIOrR3X/QhrcuVZKDxcMcCSATuEYSb/OfTF/gJcfwZeAiBJsiAOdomco06CH4MAUmnbz25Purj3FX2wSU/emP5yFg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0_1587112194542_0.8800129077958587"},"_hasShrinkwrap":false},"1.2.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.12","gitHead":"c2c011b566deb9a004db2ed9d5b88d0584a43de5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.12","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nBTnfEuVF04jQ8O5hCfoemjRNwz4LkuV7wofSLCMD/KKzVKZzzHMpcY4+2n+kHoPEZid5c0gpcjMok4jPv0o6w==","shasum":"91bd05f55a65a9d4cec62c6716d1e6f1c65c8020","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.12.tgz","fileCount":22,"unpackedSize":110764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWkeCRA9TVsSAnZWagAAdPYP/jOpi0dx5vmMK8t4/4Nq\n75weiJaotsWo4iUDAhw++5S/9yTvcB4xgEThuAr7/R+YDC8IxU7/AqCpWLsK\nmmCk0tfxzNG/+UoljnFHqhy4xzSFnJZQL48VFXZ9Jup+mcCxo80qv0FP6B2m\nh0H2dyG+8kKNxw7jsuaTztuZu8l1FP4nuV+QDku5AnkErRoj469cC6JTPDpt\n6NMGhyM6brQeBIc5dARwgH0WfP+e22ALWRwc0acoDZzDi3yjzphPNDQas8lp\ndhzhW08PXaHV3W0LgpAA2SmKS2U/5qkMYezuxFzwOFZfiM5SJPrvr8ZIJWNC\nBK2tYdtRdOmAHz6bqj6jHsFjl/Y7DrDl9S5/+0KElPYjMtCWjuyecgCsJ3iw\nFjtz2fxN59QPnn84MuhwkMTPhnxtV5GhksFILHdUaC6dCNwy3QvIPY1Bo84z\nPJ2sK6HzbLgnmTNLiEtJLo9pu1a9xdB2+MtlJVCxIp7JZm0u6IxjWIG6gs/B\n9kkxYQUf2IlQiRogHpELL2GQd6ykakJk+5Ftg/346/06jqE2fAyti9uF133v\nCGpsitEzB5vnOtOKDiDBDktUwNybXcpyFVK6IYyGuFK+dZsn0WD8QDard9Hw\nAFWJMAFFlETSPTi/3Uo+91jxgnVR98wnIrw0b4dfZf+s0UsfoVOn7f4bUbf1\n5FGZ\r\n=euOM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbsfldaxCzeax6VPAxzkhzCP44IO+C71G/AztGILT74AIgfPOe5PjNIuP+6w9R0yNw5TZtzcmEyQHblCpAGa4IwgY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.12_1587112222120_0.2014121271303555"},"_hasShrinkwrap":false},"1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c2c011b566deb9a004db2ed9d5b88d0584a43de5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OpLga7strUvpWvlgG4utxj90bsaFQzW2+190vkaRnn6tLFcq93FyLdBNsVZt46pfUjebDaXasAN47+6Cdae92w==","shasum":"454b18a487c2b3d94825cc37e9233f85fc4a72ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0.tgz","fileCount":22,"unpackedSize":110807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWk/CRA9TVsSAnZWagAAbLQQAIiITh8Y1zUvfGHBpJnb\nAzjpp6AIXosVaEwGYPvwlOHernHbGJGOe6A4rIlqiFD+sUblXYssgfJ843+m\nJsXZcDnw6RvTg7mFOy3lPiMbweCJWgES+oHax2Sqlp3PGk7FV0NC75hMvpLM\n0cTW0HTgDFcnzc6lBk8J26WsRQQCJL9qB0PWL96wk7I/nfYnSVBLK8vCWwbl\nWZdRSZCgUtUpKfhdSWCOyCtP1zk7beDeIN9Ib2jGfiGhv5qsA5/sOO33Z8rX\nNoPShZGzmm3wRBKtBOKvuJ6DDdj1osqLUHVmLfjOus1V6eR3ByxkLw9QIHVS\nVPPXtoqaaBddh9PvveNJRNbFlV116chl3BU/7MbW86nJwGMmyeQx65XBxvNx\nyNw56gi+cTBGJZ0057bHyjLn839HR9KqEcI/T1pKcjUE9ho3X7Y8POZksYDB\nwfhjBX7yamdzxWh8YUHycKOs728MeFMkAtoO80pWl9JrwELyeEaC4wbusXWS\n8GnL/mdiMjr2LC0iNJE7tyNFsXDsE9XOvcoDuwtm4KW0+DgBwViAYiqb1oTx\na5/UUc+6Y8o7sqFdL3qBMHdmbgajOsWs+4WIvQTzjmI5DaINbloyiERcEeNV\nJ6w5FDFWNBmz/ZwFKkr+qjG1GckhX7ZM429QiM7muqStHPb2e8vISW99KT2x\nXHlC\r\n=srJa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLWdfDBbqh+ZleBLnYJUgHaDRhM8QQZfNy8GP+ZfePNQIhAJmu5SUe840itNFmUjk2+/Q47HNmxL/GpB6JTK3MAGmr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0_1587112254472_0.7967121436812685"},"_hasShrinkwrap":false},"1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0","gitHead":"e9ff48ad97191b9d8b97c4595a3e4209623a3f63","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WOcgieBUTQZ/CM8bOTAFoulbYKst85QZvpW2r3ufZ/rXeIQo7X+KM228E3CsMK6El68RRVLdAdhCroLxw//Muw==","shasum":"e5530cfe52f536c4c5dfdb4a3220197227867745","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0.tgz","fileCount":22,"unpackedSize":110669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemWoxCRA9TVsSAnZWagAAHI0P/2HJRM6StMuMiD4UYCuY\n/Fl0ek7Q5P2OCTYJOEwTQ9utdDlAH2bCp7olvFXF60h+YEHNY64IAoV52tNK\nIQzikBbHw3dPE9DgtRSd3hGQVmZMczJYWLN/cTzfxZGo+xqyLjSLQkKe60OH\nu0DETiJ6Xb0hK3zzO9DGFSxUAAapVePaP1NwRt6uhNNWpFPnT+JPHUWX7cDx\nTEX/RehlK7cgQogG46PQEg4CpXBrwqNl4vxI0lEKJqHIbCGE/1j0m6lHE2XY\nmpHFACayVeOC2XJXS7sXpwrvfhm7uy2Tkt3ounukQUiVLuJkZyhqF5lfpdGO\ndnvZyK9DAfcO0Xb3aNgkII8Wf9o+4jHPiBYTUFdfMsyy6mjCACkrduFvPfx5\nBiBHUh6SdlxHNjGsd3e0ovSvK2p69j4W0ZGiFdPD7grmSpU5InUcel1whEDZ\nyZTNkv7/k7/NSaAiUuNWngU73fMsiPn2l8SxA3dptDFWBHAH4L/G/iv0pb8P\nZzL9MKNKIO9sI9AGcSat+/xY55DLYhP8AQPZHudZBhnsxX+I5jcDsrI85PNq\ntxOvxBO7cCd7C4If5yt0FIZb/sRBLyvPZ8K8BOSDBb5DN6sGmoOpgV9ne7yL\nxx35fHnW8DStp8IAWTJAofe82BaRZomCNcJvt3xqX+vePGPNa+yQRWWaWF5m\n+FW1\r\n=DCzB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsTslv0W5QP5p3G2UGplVNA27Vf7iqY9cixQrlRfgQkwIgGPiazvxiqiDSQA+rcFVa2dQzWRBTffET0PveB/LF2EA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0_1587112497273_0.14854928817198143"},"_hasShrinkwrap":false},"1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.0.18","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"057ad2ec0508029df2f2ae498060cd5d88b11503","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-knB1vw6a1UNxl+TNNdtVeuptKETfMHPoDMtzykiK/mye5/HlXhYAVPFsXHdEm1vNX434zyjGXK2mnCcxququWw==","shasum":"46feb2bc5a8a96057772c4c27ce5c23a889c9d20","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0.tgz","fileCount":22,"unpackedSize":110669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemW5mCRA9TVsSAnZWagAAENUP/2E+AjM+N+D8ZiAwjgQY\nguSfPINOkynv+r4PVhItoCzPh9vwHIlpyje+GswLuS1X5yTDy5Axgpgby2wu\nVUNvK2btRGGFAIv+aWWh4RWJYwJdBbT3AUMQm4oz62a7CBYw8zu5aVcS0AYP\nyW64mI5h/rqOWW3PlUla98ynPyVkPsds8twf+0Xoa+zBQLmHNhlBbJUr9xet\nVhhhV8EsfzDkm/jR08Y0vbsi49Wtdru7KisvOaRsDDta+8ab0zhoPC698zxl\nyYI1Yia5JDML4wFcZMUOppsfnV+/CgIwLBRSEXC1fFRfAYJxSHBGSbjnB21p\nqhQ3emT46o6nGjUHJtXzV9C8UeorxZPZayEmk43XrTV8vxrkWO5UPEvxtjRQ\nQKh4JQpnyrZ5Q/4Gos2Ws4RIrz3kIi5xEULh1uiREO2EyHQ6idpkqc/7Xt/Q\nxIQBW3vdo3+r+UOqp7z9W31XL1cG1fru2/EzQSYWVTClQ5QcmGsYJilju0OO\n2Xre5tWy0byw1LaAxf94N0LMOUrJed3klqBaz6kZf5HQqpYdZVVQ/pzKwnrL\nK3xDzvee9Kn9oECHw1z2WYxndGzdW9gvG3mJQKH72iWCWpNp4Zbtnq/nxXXJ\nspsIX7UAxROhF37mVrxmkmMCiwGhLaEbp+7yZHUtUoq0AUnureASjO/D083i\nQrY/\r\n=uXIL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtkKgHaQ66yVjEWIpUPabssw5E2t+TeL00MYTLlebsNAiEAleXQdU2h2wfjsiiQxlBW1GtocXIo27yYJTH+1Q++OMA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0_1587113573705_0.6528232945300512"},"_hasShrinkwrap":false},"1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.4","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0","gitHead":"30eca418757411c0c3ab2f64de98ea4fbaf0f70f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zGyi8I3CnCPLuaNObz9FgAtuFyllFieTvy9KrySMOKzN6q0Sxc88XV2j8ljjJA6ajP7+YkCjwDekn+mn3MOezg==","shasum":"eedda1133bcb73ca6b229778dc563f838d32f104","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0.tgz","fileCount":22,"unpackedSize":110761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemXMeCRA9TVsSAnZWagAA1gAP/3PwhmCk9FLx/Ca7hGUz\nItwW/Bsdo8PEu2mY9geeCrOWU/20ahAA+9WVQfPKIMdj5lrG9IVVNW4CILe2\nn+oGY6SephIbNFijC0nKMimXVGtGF50t/rKd1xhSfWnMe8c9IvnkjY3qQFsS\nwbgSZAgn0q9FcXB0J2kLyCrR6FWhZknsngge+R2yr9+Rp51FZvB8BbkRgtK6\nfAJZqME+NRBEdjn2bzugSFCuZ3PIWn2w9xxYwtooGE558KOhWuxQhmdTborf\nFuOMjnCF3IF4ZQsWhGGwbBfz8v8Rw1nlKkv9oUsn2GwfUI5nqPfTp5nZdpW3\nbz2Qys66rTUxo5O0qERPLyziRgIQEn4+TluI78tnaGDd0fTo2QDD2vH7O38C\nIbk8rED1pwJY56Cvrf2pkSABfAlsVD4GGv5QaBD4Wd36/bK94OulPyrDMVwT\n1c0MLOfwlKk75IWQSe02hfZpdWS0JsN9cUagXDxrra8pyB4R9/p1JqxRhrXY\n4LOz7VZ2l976izegC8G7+JrrFmHKYBWDMwmawi30klFQMY4vtAP49HnQog4K\nhrXETTwYyeTZWYI3Af7ILaZ2jkF3Im0/KOcbkD0/tBSjXGXHqXwwQr56e1vC\nG510/6ewn3+jBTAsdjOH4pzM0+s/O3vswr7HFZbqPYluUs+SErjtiVmhgTcR\nR8qT\r\n=+4T7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQHmjNo369lOyz6m/Ew3RJzFAJiFQ9x5zKIHDU3IiRRAiASbJhmNA2xrXE8ZQjFiFJs6SIXyUXPCPjUsCkKxoXuSA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0_1587114782024_0.28130302265741824"},"_hasShrinkwrap":false},"1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.4","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2c5cae19633095273c54cd319e9ef32a5df1223f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FealFXVfLyfO976SMqj/wDWRCUP7uQ2/FA6kGhnkoDH/bhNT6WOmL3iqVeyqB0PcTVMzfgbn7Q9P5uOteloRvg==","shasum":"748637aebe11603249e03cc40fa0dc287dca0cb5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0.tgz","fileCount":22,"unpackedSize":110761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemXNqCRA9TVsSAnZWagAAxtoP/0RNxtv19xCt4GwZEU+o\niLVnd4zQ5xnLRnzAJEo/V3mbNXWuTtFgVWNshu6dD4t0GCmnO6E3idp/7Wn9\n/F3BkGM1DHiqQtSDtPdiMl6roI0ApiSY/3LjMVdBGFWE8pt2Zx7a2O5idHum\npRy3nVg7690cvEwETawwuRlR7c82oYg4rbxzfxcDJWhYCmBA7F+VaIKMLWst\n9S+dcvhxd/8HyMMMXi+A1j8qKd7WqudXLRdBuo4B1NpVqZX8jINF7YnwR+jE\nPyQ8hrt3SM/Ydkza8OMFp5NvWCU0FfDNLMj2dml6eFN0TCrp5O14Q0PMxsA8\nUV8stYMAxskkEY4lykfIsUTtJGLC/qTw2tWRMMCdepvpc//fI061mfvDGkPm\nZs2SXcJ6voo+Iq0cC7plTn98z3hHe9eozqxWWm7NUHJHr6Ozs1ko9p+x+AH5\n1bcfPnT56uCzP1o9TYephqMCEFUcelhQqnj6C87hUv+B7KjxL4th+qxibtb1\nThEhiYYjXHd6SxKPiuTbvc6jLgsAVXX3horaZphDW5jANWQ5El1C07coKHXC\nWZGvh6ZklndRdC8n8zUuYLYPtF5SntTc2Mw/De4UOC9v7IId0h2GeZC7QwKq\nVpDJyyMc4xRmGEsSm7Dld6zOpFemfZ7X7RBY+kXKMBjLZ6DZHtiqCBEmwMVO\nXePu\r\n=Ryhm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpkJ03HyX8iBfXPIGpgfDw3jytSOwBPacduaPfN9vR3AIhAN4azP1Pahi87pEZDDA3BczKYIkO2lqM4stn4CrwcWDM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0_1587114858058_0.42685638839189277"},"_hasShrinkwrap":false},"1.2.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.4","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.13","gitHead":"5086410ee3048df6446b0bc102ab8d090e20d2c5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.13","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-T2e+WuYcOL66KhO7ZBknHHtFF1od/nA9F/JzOHwFK13SiPp0EdpnYD9xLd9NVFUI04vCrD5IFMk0V8Klt5JVNg==","shasum":"332a19b04e18e6e631f578413ee834fa56b7aa4c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.13.tgz","fileCount":22,"unpackedSize":111194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemXN/CRA9TVsSAnZWagAALegQAKE7H5OcrfsbsG4b+cEo\n4o5OrH1hl9tyGCGcNVaBWODFSyLTDFPhOw8SUfgAoZFm5XyFeBi3mDYWigKe\nFKmj87CeJ1h1B4Vxc7Ew7e+zkNLSfEKNnL4Ai1r24xn3P9XW5msuIwzj9qLI\nrAoIIe2kV0EB4utkLgSOIN6l7So6FZ5cL4CrEPJZMUjWrp7MhrJpuWRI0isB\nqYFfD9AWpM6e3fyQm+5ygPMrhZgf955nj/Qwmz0MBr1WAY7hHrXr9HfHEAYA\n3r9L41rrBvi4UbyeHmo+QPUZq8Ce/x4r1fRNakZDXiFVNLfWBWz88YJc1dxZ\nCtLY4MNE+e2I3M9O+FeBC8cIjn6GYy1NMhx2x1ux3iA8XqpiXVzFUulY+mYp\n06gqWVsTX4tHvQ8ykOE0jCKK51PJ7DBjJjfD9XKbCF0Fx+RE45e4oBkdP8g2\nwCq2NpFxX4+qhOe/84XZnTksQ3NaF/hdzDqZFRtFr0gTAaaY5qp7tcX4MGEH\nuCoTdkmQNd9Ie7AlTRUq5BlVwqgb85S+McIZnWPTnva7pzevwnVrRL7+V80M\n5r5FkZQufO558VIJsFRV4+TwSaoe9uipG+4vvH4uL3h5o94TEmC/eSYjzANv\nTRtvPGm+Y6vmpVsw4VBEhjrlFYOOs8Ln2lpnPO9sKWi6gmn4ir2qRnva54V4\nx7Vj\r\n=jr8v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0qElEdWz++fA1X2p1+2kAm1gd2bUH4K9YjWpmi0zyLAiEApKdbO9p8Mer2WEm8butYtZRFOkAPYJeLAefeSF11auc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.13_1587114879339_0.04168380794618187"},"_hasShrinkwrap":false},"1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.4","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5086410ee3048df6446b0bc102ab8d090e20d2c5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AooYj4a11h1bFTucyb/I+hkxR4TWKZrvLdSyb6b394Kg/NLte6NebxK7OWEyVGuqZkPYG95JbbrJnXHmtPYS1Q==","shasum":"3285a311b92daf8dcaf27dbfdacfc1e78f325afb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0.tgz","fileCount":22,"unpackedSize":111237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemXOfCRA9TVsSAnZWagAAXmMP/2aefKd9/ousniMe8hyJ\nA318mT2UW6WARfs+wP5zuB0Y5WCCcZmGeTll4KqCIFRY7MNHqiuh85JymsOE\njU+ONwSam6oqWYoDiH23XgFq0cjeffEXq/vZX40hcATlH+mLs7pEZ7XGIbw3\nynTvEGRJIY5rOGSRTzHQhLC7lCgL582KfurZ2Yn/vUEBubpF+sqBtg0O9JjQ\nWs7oABs/Bj1jvg/o82eF8feEFnS3pem5u7PgE116CAYn8SF/BOptMNBRzbmI\noAnbT2F3RSDzjArndYkpLcqyW3PZGrDmX2cK5JcL2Mc16QaczDCU/wo63m21\ni4TI5OOOCNIQdBkfQIussUzzmxoFcJfulJMH5Dr0Ggv+t9WoR6KA6CaUJjZs\nHTcVffsr/uVTdAijFxASHuky/TWYpWnd1Kw8Kz3GCy1T3Sy7xKAXYPRTPXeC\ny1xbkL7EJiO23fS4ZnEtT3IDgBCNUr6hei+JjNucVNlQ6hv81QtCdtDMmoCd\nHzPQeQIRZAJbt0Fa9v5Yv9V0o7OFz9sU7R8HEtigJvN/VXsy1cA+uNj3wKsj\n79+T/0RWTvF9UU+oaCTYNnNvJAXocdxKFtcXSEQrthhfHjZkyB9x7Ebiqzg2\n+VSSnpmk9frMiZ3bPKnEeToKRATkwag/Utw3o3gtBt8ul4qIeNt4bnF5daeg\nLx9u\r\n=l+BL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnImnXkId9ecOcoM70Nzp5L9VIxc5THC4A0tQ1Vyub4AiEAyP4TwIx99yz5mWJNXsDW0gpKqu9HDS4v3faw5D/IsYI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0_1587114910878_0.8341096716916212"},"_hasShrinkwrap":false},"1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.4","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0","gitHead":"a4d3609ff0948cb42e1d9a8fc7a8480350dc815a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-S9LHX/p3K64rJmNnF2jM5kujp6KDeKTZ+vlfEom6HrlDzIornLkjFSdHxRpLuuApfUFfG17sykvItMQxnlnazQ==","shasum":"ea65f260b9af64bf475dd8a14df66abc6c66fa18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0.tgz","fileCount":22,"unpackedSize":111033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemXVKCRA9TVsSAnZWagAAjOMQAKFaYyeAv3WKDpgsVdGj\ne94E2OgxtGnDQkb7u7r6UEd/x5gQ/itY5WihBe0oi3nQe+InuFvVdW06WJ12\n83pMoOwKxfSabX30z2Rl8WxxzFbv+vj+UM0SqMUXeX5/zQ9uki+usZ338XSw\nTx9yHxdTwgTwQLWZXTTE7FeDKdgFRSa+6NY7/c1iqAB2ynrL4AFrf2iZ/25y\ndQ5STN4EYNDI9RlH6gkQjOYPoQfDo4aRpfUfOp+J6QO5/Gfq0dSoBc4cIo/f\nntklzt0k4UchJEWArQ66qalEQlbkbYVXBRg03iOcg8TD5Ck8nlbE9fGq96Wx\nMIeJZETesXVHdiLjq0BXKoiGQaBYxAdY8HWIXnQ2DtHdXcVp3ZeJ+QIFO5XU\nQItd92mQb8gcl74/AjJdSbd6Yxdhu+UfK2CxkU+D9bmpe8hfVB3B1h9FuMcf\ncaJ/n1q6hL2/PFIz+GtQPlSSEOywqNnYlqSK4hf7yioGgaiZrELN+WaH037F\n1EywTBxsuRlQTAPxXsh1ujFFLxRuj2NK2RMPHB4kzIu4FvYjc1dmhPbeZjRJ\nx2MTZCs8t9hdsyVTTxHyGEzw/Q8U89vFH9jWo2KnGsQp5g/MpHRUoi4gRYuX\nYGL1BBWRaU5RiB+jFu0ujgiH4MpIr2JWPiJFN9o0N4JeysYoC4TAJMVQt4Di\nZQzJ\r\n=WP34\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDS4DBUIcEoqjWWK8iYo2pCL6G1/NaU3S5TIe2VckZ7lgIgfvo9DRSPztqrgwEPaeZ0hNp4J+Z/7WmHsZtYclR50ZQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0_1587115337793_0.1270462811684776"},"_hasShrinkwrap":false},"1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0","gitHead":"4fe473bb08c1d9d5834710c43c2e3fd56c9d915a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YXnPELeVkFvsdZxns74qlZmIcm0Lq1HrD74XuIlFv3J8/YfQk4e4FE5mMqdKV8nNnH8cOJzlO54o3RiQ+vWZRA==","shasum":"cb015080b549147b1ad5283d3176b611301cd24d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0.tgz","fileCount":22,"unpackedSize":111237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemcZRCRA9TVsSAnZWagAASesP/093VbwlndQrpCIDtGVV\nzPkrT+A6XnBhX7flGwt0R7+c4OndET3jylV72UsqbGgbW0RxVDNHRsRciYnj\nxZwkF16eQ54A23eCQ2rF8Hv82p6VOUQkOCpU4vIri1/rOXCK/K3qBKpcLnKR\nUXIr5Y6DN4tpbz/5eJX5qRWwsXMz3Bq762UrG7DSBe+Hymi9h3nxxoAq766Y\nrKZflPmmXdUL/l7t4pUGLQZP8ohRoVXabLRqqA4UYay5qzD4fFtl+S8aXSxR\nnWHwf0nzxYPznZygZwbQ3JDFTgKycF2bWeyiE7t1+7CHZTcCVMoV8ovEQJWM\npJppK9Xx8+zrUalVvxdO3n/+d9UdnzVzLNzBy+3ufMEFhbaN1/cq2Wlolmri\nvs5ffiJg+Y9yjxp92u/sdpdUC/Xa+YJm0tFMNnSstHbsUVztrsEeUlKZ8vyT\nDbLKiD9w+1c3szX82a0O1U4RA/HEfQ5os3bcabMK9ax3eYvh40wUoV84liJR\nbfe/L9t5B7kE530SOKkUM+0IlcvSyaFnjL3I4qzzt8WZxPnDTgfuUqSrkX3g\naz6JYsiXQ5BAMv2/HuiZG5mUqbXU9bQ+EAs4C0CiO3WjLtU/mPb4wBCf4Fc9\nU0n8q8O2EbD1KecfGVqxBo85qwfgchaCHR5jnZIgGeWrBB0+QpzUhW9P93oR\n/f9M\r\n=EWA5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCf7Pookn/UJv+W3rGpRxe5fXDQTUL1C4QOBWSaHf86cgIgAJKsy051kLPzY0q+qS5YFcq3I4391L+ZQIf1cavuaZ0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0_1587136081072_0.9595519617497716"},"_hasShrinkwrap":false},"1.2.14-5101751fccff89dee1f207f985759a59e5536485.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.14-5101751fccff89dee1f207f985759a59e5536485.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5101751fccff89dee1f207f985759a59e5536485","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.14-5101751fccff89dee1f207f985759a59e5536485.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6blO2FPGEOcaZxqlyZENvZDNA8tWudcchjL4lvVeHlsq+L0qRnnqq9+7gp+AZ1nmMfAv2C8XETyTMVVSE9NSdg==","shasum":"3f99797a4f3faebca3b11c83151dd1cdcc30ab8a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.14-5101751fccff89dee1f207f985759a59e5536485.0.tgz","fileCount":22,"unpackedSize":111237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemcahCRA9TVsSAnZWagAAM3sP/itnlD7s+k0ZIY7QgEAq\nv6u4yETNq6E9on1p62lTkc1J8s/PS6lIWmSfLPDAiamvMef+bVhlWD8SbBIF\nihwIJPT8B4Li3/ZkWA0CjiUBXPXg7JBKoYCXtg63+plUEd/uYWpjCqePCC0Q\n/7NeiLgPT6oveGLzfS+zBZtj0JyWatMXo7/Jy0cu9paTgNZv9K+Ss4NdsRGE\nH9gfQt45yTht+k0//hH+ISgbuyKtTG0wkw3c03eVVzssKmTNdMV475qo/aKg\n5gM4Ru7bw1dffPvdG22WT48zviukZSnTkeKm56S9xcZsUj/MefuuZgiADSOH\n+B5sxWocDmyTXsorXGGb51L/rPlCa5zs1yG/jxMuB2BKFgvRgTrR9ReJuIqe\nVL5nn57tAYl8SyrlwAjvroFyv7NEJNUkFGAil1yVgxX7O46G2YgozFPUUxOL\npl23WPEtb9dcBgHJ/TBvifCxTX7F9B3OgTrN2akouauY1n+AHflnrUrrdYtB\ndhgSAkDA9xre9QVhd6QVEbtLLWhv3bT54O+LRySmo5cW2vs3s7mDdyAemxGJ\nloa6ubWbkOfHG+I+7y17l/N+2l14WrQmJV5J6F9f5hnZZb1Blpe4jzoZ1kTw\nDcTobrmoZ0ikbrmqjlZy8/HOInaEe7hVivgY9DqASxyzDT2pxFXu6HtKnLaw\nNQXS\r\n=Dym8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeHI2ztNl5lgM+KcX7WtzSIUEBDY20gYpVTpO401gRKQIhAL4RFk2L84qLhGn8vowkMY6bDnlNetHMLw0KjOW6eMHG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.14-5101751fccff89dee1f207f985759a59e5536485.0_1587136160640_0.916079010052018"},"_hasShrinkwrap":false},"1.2.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.14","gitHead":"8a989a7bb0d9de41dba662009223a5b6531f21bb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.14","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-riQOB7lX21uhhp/3i6j/Fy3cW2dAU52R8OAQ+Kw4oASN7mFpjfLaVg6oS0yPCeIOaYqK/xQMoc0vm9cfAQ3I5g==","shasum":"b0d5c131bca092993a9c0288767cc475b9d1016b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.14.tgz","fileCount":22,"unpackedSize":111486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemcazCRA9TVsSAnZWagAAw0AP/2U0elJVChjquBLt7CCn\nBufTNR9jeXlDM0s4UipgJry98wvUaz+bAtAn9Nh1G54gxmOEQLVN+qimgEQv\nApXIpO18hNYwoygQY09UlFd4yeXTlcqxg6qe74rL7USvPsOIOYRwHurQitHP\nCuIy00vNLTEGreQWWbMeeQaFNQW/9XozjS5DFqi5BgCjmDdCrEXPUiywsqB1\nhKaeMCIViPO2oCzdnqpA6Wv6zInC0UHRHv+e/ZIRVj7mWfIj4pfJYr9+J/C3\nM115ygjn6r9LullB6iuBkwWlFp/0+CfVdHS8g7ssrxA+x2D/PC7NEr7ZIH45\nmT7PQgzlr3s7iej6MOix5ZH9lZuCxX7WkbHPt7pFozjPfi0Cd6DBxuvIixr+\nA6UfEph7xq56bkoRmHAFRkE0dz/wUHH4cb/c/gJBZ/auegwohWbU8ZCxn81J\nrV2fEJoxmx6ZUrlImPKkEYaHh2ZElvzfcnsh/N8xdwCiKTfm8PoWoo++K5RN\nFPvueGwbwIogVr3pRiy5EWIdEDQ7yhy9T84Vw58FUlHBKYZ69DHfmwf4Gv73\nfXje0Lx0UclG9aEdgWhJT6NKqQO7tEm2rtNfqJHuhz+GSl9zco/wNcSbAVZS\nuxGVJ0f8jgTGGfkmcAvHvOK0uWy0QndPk12DGlHwOvYyMWVkbVNSWYAy+v5v\n87cM\r\n=45Rr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyAdU3YVnYNu6pPpwIC21YRAJyv/2ps6eIAQHxZiYxSQIhAN9ASzD8EC/wfESsyEC4BR4DdUjcKD4WBnWUd99Hc9p6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.14_1587136178595_0.5284462069344484"},"_hasShrinkwrap":false},"1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.11.1","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8a989a7bb0d9de41dba662009223a5b6531f21bb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-A5Ja3eGOSDnlwK/Y8cqMHwFM9mBjTGCkMNr9jiEgr811+mfIeSLTLHJ6XNTU+4qUltMycMHbzLUHWmHil8WOoA==","shasum":"b10ef9d07c3fc22f76114b6fe86b5c3f2c4a9aeb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0.tgz","fileCount":22,"unpackedSize":111529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemcbWCRA9TVsSAnZWagAAiLIP/Rw0978RIJjJzojSG364\n5B3MX78tSxb6lIVKGfRs4qTYqjaeN9mypQW4o1KvQ7bn440u1E+tXr68CqUQ\nIPwnPOG3v7hUe67R14pop3d9lmrIWr40YJfUveDJNsvtmSaYhLl9jwx27jc7\njnIv4FhdNy4q+JAs6CqkKci6TacQzbFd+DvMNDkKJiIQ/XAj5yF/OFPss5nR\nG/6YjMQjgGyma37J+sA2sU4kENiKzkO6Mf1W+v98p1JDSqCTImKcjQi7vYE0\ncigWT1FUNP8F30cg/O75pXhIylZYwvH1vQqZybBf/366wCSulUVZbDFcgsgY\n2ZmR07tnnvRG+gIv51m0tDl+aWzMuUgZ7ik9hr4EYUTz5/jeFLjxK3OOxQAQ\nE+2HesMi8JaH19KizVQFT75G7OlcTJFs+ENaLcKO9Zz9/Ih+nyulr2Q4C+l3\nr2FTK0FPgXssV0fgre9Ze8AUdI57H0B9pm2dAbGecp3aWIZLGH+niVUOk7rR\nFtOJlgcQsVkrAyUf/3u06a9XWQa9DX5B+uNGChHvuGFwlGMEAbSpm1MtgqgS\nJUKjpFcl/R/glfNN3tS8y2N1Zue6C4dKRp/wSClfPZNJeSRtwBJ83goG7hmP\nTig8T49l8CSzUy09oEfI83IlAPQ7/aOIRAMZ5cUch3oHCPIbN3eAS7Ai7KfC\nuVC+\r\n=QJCg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhApWK0m4GnPbrNTf3G7NwwzIjEioR44fu1ETegxVmpAiBsb1ToHlPRBsjHBImZ1AF3oyMl4akf6fEqRopMrnfJsg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0_1587136214175_0.03366637840069142"},"_hasShrinkwrap":false},"1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0","gitHead":"9116437540125cdadfe66abef9207e4c93fec006","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VKidSU2jTZSiaWsXHtVp0sRUPTh2VqwpoQYhMECWUcxhEhyJSUu8tuDheRgwCkqt2lRigmYld+QyTA7pG1GtBA==","shasum":"10f8273692a146308f2bb17055db0ef3aa0a9f27","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0.tgz","fileCount":22,"unpackedSize":111529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemh4VCRA9TVsSAnZWagAAgeMP/0Z/hdFePpYcdLarv0QW\nv/bOOKzu8F+QjBRV2TPlzWIhU3dugPqIcAHpVw0BDWvDtHtBzCPTB1F0gDxh\nX/6OmTZAdsELKJUCqlCf0xwSXwPRH82XEoy6CkoN4Yj5MGWvwxz04NBC30sH\nN3II5gbFWHPB9dtRGByKGpKHIOMl228wGZQfxwdqs7iwqte6C9fmlSkdtWBO\nEZOBm+YeiiE/6l8w6uU2/kjJTNJ8lTQwe8W9bh1xvZtPwUurYJHqHKviP8xi\nwdcSp++IDM/+ZULXseIIVw0N9c8ozF4JhsCjWDfc3kb8iMQmJ8yN3ihcSXfM\nPDfeHmo/38cIQYVgW0MMQEpPX5ZiFVuCaaklGUUs4b6ZVaq22bDdrcftYRYQ\nzbI1grO3cElFrbG6D1YwRp9wWsLxxkxkCqwdZIpnpMCwvGNdW/9WHCcpFja7\nVN2HHW1A3GEGi5h9qLtQQyew3pWz58V8ts67io1Nx3dSuWe77fu/gGOB9Y/E\neEBDZNpOZGfCYTwFPIjN5lbvuVnuj7RGsc8iQxiAriRu5UobJotxBgEq2fil\neDAYrJ5XhKnNRI+ro4IoI2lM/sNBqP+aZbb6npHuuhgm+auGl81g9feVwxGw\nNCtrp0fapkA+tItu7lFvsjsxJAWG2Q8S8gn5VjW9BD7N1hWv7gM3fycqaDXm\nfN7u\r\n=FVNW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhG0fLrNpMNcYTiuatYaksJYo3q8a+WwE6HqY3gVvtfAiEA/bAezcJs8XDNSmp3GNYe9dUnYQ2g88PTRJ0hldjCnB0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0_1587158548762_0.3538577844280659"},"_hasShrinkwrap":false},"1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5fa23c56154ee357a0a675d0c866878256dbffe4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-M7kryduBvqdtb3T3dyUFBnH2W5PmhRKiL3e7TkHtjxxkc1jxOvZZbrhRYIf/c8Tpk5ELI4j3ZKSaFu+3Vtz50A==","shasum":"196682f13b710cdf5cdc3eb6b47e70513e99a7a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0.tgz","fileCount":22,"unpackedSize":111529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemh5jCRA9TVsSAnZWagAAk1UP/jA/+uXg4/Ze08F2fmwn\nHOonzqDIpvyciKWg1GIGzYEMjyEyXyawvG3BIsaQDg8fsUd8tIE8ohUjqzz2\nK1BbQHrsceXccKsSBXeAv9KU1QrKxBrV2yJRE+yGPMEXT8c+WQOkjmgaQ1sP\ntzQmdKv4y4Uhymj9G58b6Do5Y0Y8Gaf2hCJvMrAdun+3dvWmbDmP5m5z8GY0\nyHuOCzV1kfzI9BLPvIl/ww8zI66WdgHNHqhTXxQPwcsGXrIMP3SPdbOgc71c\nE3h7cwMwvvO/+SVtU5ctBRc0PvljdEhVH/dZUxxRVzvr5l+t94bqbWw5hPVT\nkvs1Nev9d/hc2oKlcOeZNGToITUxvMFz3OU9JQfDeO60hGekDbywJd5+daif\nx3E1LQ/tBfWSdYRCx0gFh/KczfISeHvTBubHyl7FzNZ+JAl/tqni2/RqPAYP\nM6F7Uvpz32u7b+LK6KvMpun5veSqA6/M48Fdeey/OFwZFY8h0Jp8l6tt5oXY\nX5dH0nZpGHTxDsMHYKVLr9nAnLtGDjO2wdEnsWE2j0EKHfemTUz2UIt9aHvi\ns8pXo1FTfchjhguToYU7nJ5W/a35oqqR8pI3a1fvk81PY9cHjpoCBM93sMBt\nH0BTlLj/YGSsU5d67qLIuz+Lzr5fAU/yf2IcGyiD4o0Z+oa7EJBKlRSbG66r\n94+R\r\n=7xtT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaOJCOwRHpu+q5yByJflf+w+T8B+pUIggy9g0ee6grSwIgKm49MwvOATzIWJ6Y5nLkZbFWLBUu7hHAHCeScmhQcgA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0_1587158626797_0.6395876926058226"},"_hasShrinkwrap":false},"1.2.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.15","gitHead":"fa07ea5258e62a6f2f7f2d9968f65bcb9c001862","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.15","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-z26O/ALy3rRafGt/cmuKvlDMbUlEueqcaJ++kkJBnhoCZRVFD/h8FXegsuaWM+s/Hg1AN8D6q2HRsomq0P34Nw==","shasum":"f0fb6c7d2e94d483a655eaf7aa61c57eb5ca4b8d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.15.tgz","fileCount":22,"unpackedSize":111770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemh6CCRA9TVsSAnZWagAA6nsP/RMP4v4xUDsyFcHqG71J\nbRNkbJZ4uWliXRYD5FfJYrUJn97cjjPS4eD+x1cwnlrPM8cHk1LkPyq/fe/L\nsrR+3GzUC0PBvWjGDT6QHhJXa/N2akHoU6ruXBkad25ZWmRb529FEKVBD0fo\nsCzaVAS4YI4/0MBuX6wgm17MKzOHSdL6E4+9N6FtjyODUJTfDtlh8ca0VTd9\n0mxLbw0vk+gRR0Sz71BC7/GmJKxLkWp3QboBZ7Ng+YGScrmE5hDGnZZqSNlk\nlFIFu+X7Kc8wME/QtpHj3RnT5E9+BER1xsIPuiCjz7jFWKh5ILjyDru0kVE7\nEX+yAaBwVT3ZsxzQcaanDu7+v6ywm0KlHBNZQ+Qr0fqu57Mk0Qq6f4OHFRNH\nfZL7UljM6iCxjENnskgEgp+NsmISOIMQqvf8+wixph5VXxqIsxkJ9Kjt71u/\n8KE9rYE5w3eBzAbBd2tRsL++L3/f84U+Evd+mtYWzDL+/C2BaC9uJpzShBLT\n5UTwgOyqfZk1R91WluCYdyl1g1CTSodqZ2kU8aCmoZZqPGk3g7v/HT35rpTq\n6uGMtHZAs5yh+p8HZG8AMP3t7cELY0sMqsr7kDgyYPKfDInalsCmLMDSTSsl\ncgjUck89OFAKxalfntb/zFvZBBM11K93jjoAK/T0j1vH58m9l7F0w11bL6+R\nrJpG\r\n=GPa+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbet9wyKZzjss0C4Z5CD6OrMfRxdOz5tlxowFFCvxQmQIgTzXBEkhzCJW4maVLwkx2dM3lpdM0ddRpfP2xjRGOJBs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.15_1587158658349_0.8506287660406582"},"_hasShrinkwrap":false},"1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.3","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fa07ea5258e62a6f2f7f2d9968f65bcb9c001862","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ouAnrqqYt5w5cpT8ygnkNRGJ0Nrx+MdPbYdJjWjkRUR2B1ULM2v3oiAAxx+QNFG+PHN8QOg2opgUrUvEwZ8ghQ==","shasum":"b634b8bc80589f59579dbab92ab8d5d6bdde17bb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0.tgz","fileCount":22,"unpackedSize":111813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemh6kCRA9TVsSAnZWagAANosP/RD21INiRIm1fnA1qj0k\nGCskMDDjVmSITKsXzreuSpYOgVDekYm2L1U0aoI8cxwZErQSfOgzV7AgOllj\nBzSBJSVNeDJu8U4m2suQECimiYzvkcKIO701qC6rryObdMt1wt6vgrsb/OOF\nD/uYF+O6zv+ZkUKdLjwuoH93qPSo3Eg3TuinuQ+EgtHr33uE6GMj3CQz3TDH\n/C2LjsVTAWATFTf2rzQHLLfS5LZc8Tk62/6oDTyqJnPbhn49G/uQCSliquS3\nuTsYK3yf8t2x6G7TdAN42JuWGrDjaWKVM+BZDI52I3W1t0ffrO9kdJuzORoN\npmXCJMqi9w+wCtixrmVSFMkJfIh42IKPCQG/o/ZIwsuUWByk2ishNJwPR+7q\nGNjmUCmLPgeqjmOVgI/oEc5/qPm8qv6LGm92O+vfZs7E89gri3JF/oJWiHQm\naMSF0bZJKPVHG/Nd1/O5tBbZ7ZAx7UnTYc35QaMbOf6ruyQiXcAGCnL5gCWd\nWkjUPdu+k4HfLYz0gmTPJ+MP5L/xsLNrEyPdbqS+MeoakTEHjS+eFYAI38B/\nreNVFVfDVy+AMl4mBvbHnTBzG8quYE1bl/H/e0P2078L+GIhnBmY88NSjT+W\n7LUq6yTaxHFTWPT82gY6j2jC1fK9CdlcBnhOvXahmkg2KKwl90MTtMGMSXIW\nArEi\r\n=fpO7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6GTUToMj8qTLisX3wO40SPxMXCEK0M/OH15RmPuGv0AIgN5zPwdjVNNqWNYtkdZ7fwmQh2gV3nfZ/wcgiVmKm1WI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0_1587158691530_0.8500439430551845"},"_hasShrinkwrap":false},"1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.5","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0","gitHead":"5b3e1887398fe052eb326d90f7f441c38e64f891","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vFOQb/vC1QgGNgTLgLFNNuO+mwKqch1BOIjY1PQBcNwjGLH5Wq8iVJSjdVEZ2kbDkBBgXqRWJgmOCrPjkXAusA==","shasum":"d9aea76fdf9654cb1d31640b0c7cef8581648adf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0.tgz","fileCount":22,"unpackedSize":111813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemrkqCRA9TVsSAnZWagAA0cMP/0W8RDI/SMUUmaES8NOk\nkNCPji1z5/mlfxcNy1sZJJ4Y5YxrAlU3GvDjqbXHe9lT8jjgsfeZdRztW/c6\n3LZQz7sNa7bKisCrwZfp0/AM41rAIvII8zBARim9fzDGGpUoKcnokod9qCtr\nzI1pPg0znbudUdLiV0nhfBhE+Y9q7LUGGm6/8fR/l80cwzES482k74JDX4Mz\nHZTdZY/S5GKq3yw7pb+fTa2GOAOIn+MyF0v/YZCt3E2M5M6vlJykyJW5sR1A\n3ISaqct4/VsIXA7PLEkVh8b962W1hkhSv/H9/exzDOMP8C5f9N50orZcD0DB\nct3npAs9z1+umUC9Uz4cC09pkLr9kGXvUtOKenfAttwGpgN1Dmnki6/tUsGI\nmBhiWMKibYEuHbGw6y9QIsQAn9h0uPzk2fN2ccg4MXxjCUfZRTYHFTLSi74r\nPxIprpe16/EwPxQir31D7ifc/wzZ4teHQ4waNDWwZBjaXTt6oHT0BYgKORN5\nYtTcOZKBz6bxDLPZSfNMA1ZBAAgTKWqzQqr8DSY4BKeQAXmxZ5gRphBhIr/J\nl3qXTpYQfba3ycmdtA2OZs82VH0cFRUVwBSUjh3u4fZChEaWj0LzaDUw4GGu\nDPja3oYuJo2IfcgOZkxT/2giBB1dTaZH4W4nj/08w910QOst9mZsx9DMUgtj\npWvI\r\n=O45r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYfA73hsYAMJAnyZIUmllUMfJsAE0E4EbhoORFfimVqAiEA9I/ldoVcJgGNUi6vRJf4mMLEON86pJHBoaHRUJQDkgk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0_1587198250181_0.24757395738714516"},"_hasShrinkwrap":false},"1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.5","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f26cca8bed39a3824f9510938198b7c506e2a221","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-araUqXgddJ5pMIFKPTsIcqRV9Z08W2JbFGYZ0/mXy2jqpTJ6F4jqOHI60SinEBenML3JoKPaCg26KgAHuO7sxQ==","shasum":"d350bff93e98fc77712b94eb9fa28258059acca6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0.tgz","fileCount":22,"unpackedSize":111813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemrpKCRA9TVsSAnZWagAAjkEP/RdCLoE4Rb01UoShHkFn\nthxaDYXQCGYS3hfA966/pew5CDZO/WyBMKEAFp1BUG/S4vOnFgBhjcuEbj5d\n2D6iYjkiUXCKAxjLjTpQcnWa6+pxvr8wvNbc3R3MU7cvzKLdkddkO0zqZTTL\nr0gF7+wzqOgF6iIJYNzz+IXyoJCQfqbQTwLTkKUTeFWBkoO2wuXBtUxRN3YY\nsly1tmJrfEXxA5GBfPAs1q6O8VSeM54EDtSF2CWTrt5UyIJecv5fXbE00OMM\nYM/j+m0BZL8arFrlwEHyrY2pMAW8VhfmXgMvd32tvKyybFeux5hy/msoHLvW\nqk5kW0PsLJdgsGrsZOc04E/8CwGH80snUAZ4SF/gCONUBkK1/Otbda/S0VzK\n0fJ1jaC5cImxTBlCc/LxTA9TFL0AD3MuCAh0i8pFElhVqhAsqEMMM3uhppnX\n+cpnLq0lJGzz+1Xn5Ykx9+sX/89hd2xFQ4GYlv4hiZ2DF9dSsP5r6AjokHLj\nxpFttrKjKj1alK1YRixeZUqFV2N+8JQC3P4Ri19VcPGjo86M+UpUGMdr3AoT\nzEINKfTO3n9om+jQl95bHb/GoHbx6mHKAiGVqqQjZq9rXw6vJzklfGoSMGnt\nG8D1rK5+JH2sTkUJO7F8GAD43FLyhDt35MLv8u/h7Lp4o4ED4kVL052K9LZI\n3dWC\r\n=xvXA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCADcVFAbM+F+aX+4EdXUT9Wq2mMDKcl0QIUIayvCxv9gIgIMhQmRmDQz904py3aTMorNax2PKfjkPhX9bdDWdTYV0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0_1587198537702_0.7916844256418918"},"_hasShrinkwrap":false},"1.2.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.5","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.16","gitHead":"acd3827c81198927196fa5696dc3ac4ed2861eb5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.16","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MayqVP2apknS0Wf0CkJ/eFa2bCC4y6864FKGcmld7MIq0i1JN9fpCPuaW8ccZ3tJtbv9by0todUTninfFmAqHg==","shasum":"430b0fe9ee04ed3c2e6d905c0223f24b737408cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.16.tgz","fileCount":22,"unpackedSize":112052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemrpsCRA9TVsSAnZWagAAK8QP/RdfzcUvwom/ViK87xk2\nOVFoe/OxG3H3GJQgobWFPIXMkn0J3sczqzDQj6mbQMKBiYdfPgTPqAtC05gd\nsuUYWUx5p1fBNZHGCROcIN43nohBsTp3Db02x3MeJ8xApoH3PqJISmygro2r\nsnppn0S/ChCRZrwSbHSiEONTjGVG9ioCKHFMhrl/hyMiU6Pc/rcAn2uh+MW4\n8Fx4Du+cpia4QaaK977UKpqCXDBPKn+sNwKZ+td7flxutKrugPRSTM1Vpsp1\nF7a76n+5ksDLblaqzu8GWVl5jv49R8d1YCbOKphljR0D7pjYmizN9oDRAsIR\nA8RCdNegJcDfEEAZC5tVLEFW9v8BRFI67DuovhHQQpHvBdaOUQS7g5u59KH3\nLLBBTWpTAFWvkoSJHsNDYN4ASOC7vZnGvIcqPIoG9AkVK748c7x7QFRDaxmf\nqcccZ2385Q81dXHrhsMk9WQQWDx547uW+Yf71GuI7ks601XOuMl06WHlpR0a\nrkykqsNqnKoF22/Z9F1R/g7Ti/Agy/c9jv0ZB28a2/GvNDPw+Znxx8ytCXd4\ntHE5KKtwKTYWkhv3/xeYDYAhLMj8yk6qrSBon+OK/+77atxVgwBUV65lH0nQ\nqJP5BOGdukEwfyAGySYWe+6qQAGGP0XnSYBUtNobk/gWr/KyDgoK6rIBgMDU\nhwOE\r\n=jZFj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICp6etZ3fH7VuTm4ogCg/zjH2fGWrj9TQ62ioO27eDeAAiEAlA2DGniT5xdpHAtTaG8uIb3bFMs1IU58SspwYeXSt2Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.16_1587198572439_0.40535597569935944"},"_hasShrinkwrap":false},"1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.5","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"acd3827c81198927196fa5696dc3ac4ed2861eb5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FU6CmxJFaMq8MjJPHV4ypV6/fcb0W0KwJdjPgbZsnM1FV6m85F455e7cB+g29rRGI0hUtL9BPTnEpC0+PbKogg==","shasum":"cf4f831398e4f63a3984c599eb777f20c38f802b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0.tgz","fileCount":22,"unpackedSize":112095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemrqUCRA9TVsSAnZWagAAo/kP/3raOHv5e89wH+p4lkMT\nyVfQpFj1fML6HPg/j9W2lcSpWAyQ+pblKNGUUEwpAZUILGXhuZbWc83O3wQK\n0j3jNxunNnmdhFHxG3kumXdc6qyM0ovvou2l8hkJos1OLC90dUX2d8wpF0sc\nt9oqgW8PePOYmcgAwtcb8W4x7bxo6R/DctlTgPsa53XyQ5hhpCelhIyzwHfM\n23AEWugFLK9/5niQ9rFHkLE7GXDXfmtGLbfQLYNPI9nJOST16f0NkMAySWKe\nQruQIhEjWZi4clXD4i0CYexLuCPidyiXYr+4jOapzXif3It19DVTKwWstf4N\n9k9wo/dA0hpo9NzjyKtIqVb/bfRAQ912mv7o7LgtMfY3m4wmvH9tH5bOeMUU\n7ztZ9sV3yjHQA7HFsoV5vUMu5OqE3svJFpt0AwEoVvn5kEy//lUdhxMkaM65\nK251Gt2SNxE9ZcHIZgiWtqdDyIndhqNrIjIZFhm5FItZ57rRYvoSvyMz1QwM\nScV2j4aM3hNmV1IPryI57yqf8YZYYNgVApS3rLIoWvT8VPbG90Gc5BUR3+FT\nG6hxkVYoBfW2M77at9Xg3aQOcz4GUu4ajZK84j1mx4oBSTXtpEyQ/zNKmUTA\n4AWpmeya7KIhhh8TKapNIq4tFOcMUHyBYrtDlYyZgv690F92EiBelT7cbBGH\nrJJh\r\n=52PU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUlsuqd3A8inReazHjg6Jqp13NLnEGkMddreA0w+vKmgIgANSHRmKS8ZRX9garwDQJ39xcpwrntrrMMuqPVR0vLLA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0_1587198611884_0.26977820446256184"},"_hasShrinkwrap":false},"1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0","gitHead":"dae9362d93745b179f8a28cecaf5686cd6861a71","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5eN5lW0p1nFfeJinZ6ont4TI4HG9wB6H8RnzK2k/G9iA5e8pwJfMvwkE/4kFvSPZlTSkYKw1a4NV6nlr7kRUug==","shasum":"96517f8080e70288aff9a51fa54e42545e6bc169","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0.tgz","fileCount":22,"unpackedSize":112095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenBpKCRA9TVsSAnZWagAA5JkP/04QOMwamCufsfcRG2UL\nXvmhAKeQEgmrCubF7CioELg9Rxzp325soB7xCa+kEPYNupIaRjuLIAW7n+oT\ngAsnwUrwbkRNhxd85nkfWZZFxx9a01dNEiICheTY5aYQAb+zHVy4ujVoVfXL\nT3yo0wuAGvvtRORriNbLZ+j6T2Bf90INK2u6ffu4ZHEqoxhEQwOEvCiTNrBO\nDxlkMw2uur6p6CJq0nAuuGKCNn96XqNwBJ9ifLrhGphINDkbqjjq58uraS9E\nn3dV7ssz9TLh5hK4D0z9v5Gp/I/BjwNKyU75dlI+UsjC2Br7hDxlu4SRMx5D\nGruvMi42hqTQS31KHJsE5dSN7q/lvJpjbEffxgKP3jm3bCAea4S3ruxYn1FT\nBXXw/VaoFDX9K0hI7V5UwcfrhN4W0Eqc447idNyP7COHIy9bQa8eP7QCLmD3\n+nKCm0qXel9FfXw5XYf8kHNl/5TGC6B1+/zIqVhHzUf0CCSb0w4YeYQZg7Mh\nS3yxvkycbEyyh6myG63LT8RQ8XEbECDtyW5dZ4co+BdnepbzlVNU8/suikQ1\nr2bQH3RcrkjekkiITpPtgAw6nFse3KJ0FAd2J1gHnrcimFd8R4bhzJgyO7/A\nYKDQ1p1vDFhg34J+3XP3WvgH2KYsi+Z4ZFOUOxJkIAWlzPhb9og+lfOi6bJo\nSTZ7\r\n=Ln26\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH0Jf+ckrmNx2USvPGCKOOr8+2pZlkhO2ZmTG9hzG88wIhAMTeI80NDKC+iorNgt4cyn2/24UDn8U9TLs7LwExS8Bn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0_1587288649415_0.9766921053888957"},"_hasShrinkwrap":false},"1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a1bbeb80c08fbca06d3587449a8c30587184a76c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kuI/qzM28JWsDbw0RrkV2OpUJk0JdRfnNHdry2SepyzYuQqJL9DBOYkzURZiStPG8jadeKLsOAW+Y8yB1GO2AQ==","shasum":"41ab960d6e6406e09b512b030a0a8f4a322a65d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0.tgz","fileCount":22,"unpackedSize":112095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenBqYCRA9TVsSAnZWagAAtyMP/3kpG0XLSzb5SRHSdnda\nUEk4XN5FlZkKNetu7w8N0oMGskRQuWDCSIu3x5QDwHAFJKrlhXFeN5osS+dR\nwkNp42A74JuoteF/mk69Swfvg3R+lSmukYy4I6ns85k3Y/qXtkYJmdW8PdFr\nOy05uG+EmLdbYzf/gbbWyC1I3MX7BI8Z7yRfFtWxEFrzhXNRlhiJAgnPt038\njw/Un4WauisnOBDoS3Nm0g6X6AQU0FksvG4C1FfYUGP6VaBKNm2ol4w1whhS\nDzx6pizAAO0aq5VcgmqpkCom5Plaz1f089dKm/9Y8xH52+bJRzHgrzwYidIe\nzylNSxxujL16L8gIuOlxi/7AdfgJACI91Vb+z2zJ3H7SvSkneBEuK7FGH/Ai\njVrSfj79LtOPnTR3pds3Usmbv4up57wcbLJQxFslOKHsDQvCxH2lVVLvNTxD\nH2Zowq9DqGv5WpbJ0/eYzaLEFh2tHBzNL7aU050QuwOEelOXjIXUYMvaaKUS\nzSOHp86dzL8EUQ+kvZhN1yzx+NvqJMJz0MiHi67AN6crgo3TSBZzC5UhyBVD\n1hhcMxbtQhx7I6tvK0aWCNWDfPSfrk3XOiFnRCX/nhxoNPqZb6lCjiCzYDzj\nhfPWn8UuwhgveU/V68n2kMh8ZmD1GMxAsU/gQZQ9QKdXHPvvnQE3d6qyB3I6\nkMa8\r\n=KGwg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiMtHyaEa5h+9OrPM8q2ZQOtSqgyY33j4IJgWKfVQ2mwIhAPcxUhrVI5RZS1T/5Rqf6MWIMcd1tGeGTWsgICt124pa"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0_1587288728134_0.1054976363199287"},"_hasShrinkwrap":false},"1.2.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.17","gitHead":"98b7a8f0a949cc75120f3481bf8975db5b4a6e08","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.17","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ldpTjFzox4lhemoGpzvLM0YV1z/rLp7uM/5LL6wwl6eI4KrpgbrgGXSHdxjFtY3lLtNPv/exkTqX9ws26AyM9A==","shasum":"fe64282466dd3736b9896290b1ed9121d930194b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.17.tgz","fileCount":22,"unpackedSize":112334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenBqoCRA9TVsSAnZWagAAoVUQAIXDpaBEM6c54wctgiSO\nvhoQbOum+YIcAeuq4+1XhNHhp9Iu4+MmGewYLU2vzzPVyg3ygdypLZC4UN/c\n4bAbneu+12SGwXbdMbQFefMWfxzMRbRQfmTMBegj75unBqtAHsn7BPe4szzS\nMztIs0s0ZHcalqXPJ2062Fka4KipmcG/sTkZ7qvpuVPe9JamFHjYNM3allcj\nDSI2ygiqAOn1mr6r2Ac6g2JR/L/SndUwLiJzF6bg98fmJgjDZGnJZVzRpz/K\n/rRp6EXICrR8MdW3aX/24kuWxThNiDQuT1VcGHw5hXLRNdhOkh2IVdaX+VW4\nZH5YrHn6UlxFwvB7P2XLCUxII2tPgEjNL1LiIWfeQdPtgFZsp+SiKXXLqGKB\nd0LsaiiTRWgvswj/ElMUTi7tqrQ2tTAwL+OgVXaYhenaXE5p2Zjxb2U2pzHH\nqo9Ap5GZdTmqXrpdgeoftVVSMgBvFVQfcX4qCIiUnzCIPM0q4z3YJJjxQwQI\nm7tQx+wHQQTdm1neB9e3xJG0RLxr6+d66gHWODU/8VC2MyeTrW4qGrmaVTa9\nl31DjHe0gVLPI7DX6I2sfLLHBn73o7oP9mpLGyYvW/Oz0Ei5siJ4/v+bxK88\n6JSF50Q8+IeZG/UQtoaZl6ik9u0jUvHE+qnKyPj5SXq0KLUWOOaO0y8Wwidj\nRkQP\r\n=Vh+o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAysm1TRMnOixTTHr6DCLMVQ7JTSEyRUXEwQsfb2lRQAiEA9Ybg6akbQtfMnYTZcUJQg6hn4gHeA8EfWWfggvtD9IY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.17_1587288743920_0.048855220376309294"},"_hasShrinkwrap":false},"1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.56","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"98b7a8f0a949cc75120f3481bf8975db5b4a6e08","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-U+VHk/H9rrdW1rvDeWeF7+R8W1nTTAa9C/f/RBN7BGeEBJkIx+ljWLv92XjvYt9oS697z2zdNmv2EtyJu1oBCA==","shasum":"9258ac43d9a4c04c18ec57eec772c8c979dbe9db","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0.tgz","fileCount":22,"unpackedSize":112377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenBrFCRA9TVsSAnZWagAALDsP/2pFjBAH5OwakQmTJCil\nmQM0AM1f2BzMQIDBmLb7BH5IR6GuXugH7WrGDMQOmiHYGEyHPV1IpzuFI0Qr\n5F5d6DRO5Yr2hmZDYp3XIVQV11X0O2YcuYvmu0Hg66O63ZBCdhVlKLkafZiv\ny03gaO99nOOur4ELp682al0wvvqTj6VWl7NwIJErE0YT9b682J7uqJ2tV6ML\n2HEgL8zUBTvOd+HQk19MCcm3Ejy/6W34Tq7g2zPOmVW7arTUpkXUIyJ6nld/\nCaxqAIF7eC8NhM7CGy+ImHYUYTLo8tNW2f8BgxhcyFoULwNXFLJuTiq6NZkn\nY325s+84ibrZbS0oE5JeWaw/XiX8mY01vnYevn8gTRg8A4tS1zOaQ4OrYJut\nazB75FuEnTSt/Gca6KlPv8hf06+0ewRitMmeyPXypyz/OdUrg/rq2+O98ukS\naiXuAXjjyNjK68G1FnyvCUBB5e1Fetzys3FaQM2sY5rqKYEWr0hZb7C3eE5D\ndlh7BvDTGhl8/9vnYfmSekNqBmu84MeXfeu91neRSDp9qSqKmOs7g2qKSebN\nLGjqy912cWL62s56CkCwfCjEjMf8qTvTF/7YjvWo9omfyz7XjKHqXhijAxH2\nTRlVOn0OF8B1+MDKuxhGVig2o4JH3bb22vPvFDsqfu3CWtiyGX5qn4UXTQkb\nRrm1\r\n=sMg6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJJQUDYvUFBFbrzccrkqhmguJTWTWYEpisfpo97fUjDAIgVP4bmpRLU7bckIFHEAJDdy9IL/TrPmJB55jbY3ExljQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0_1587288773202_0.1805242545378063"},"_hasShrinkwrap":false},"1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0","gitHead":"f1c535b10dfe8ed5230d140866cf56297fb24dec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mEEAeK6b0E4Z2eA2HsCFedfa8BnmMTZfmOzskdjvvE4Pu7x4nChIGtJpna7V92Roj7PnyHf+co/D/l8a9lzXCA==","shasum":"2704164acc085adbd138c35ea7e219426abcd3e6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0.tgz","fileCount":22,"unpackedSize":112377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenB5OCRA9TVsSAnZWagAA1p0P/0bJLUi2jlyw+4v8448d\nfUtAkVZs3dtZE2s9f3VVLJGHR2bvXTsqXd0IkKKbiNyC/0gFEXhR1mRYxmfU\nF/LOyMGHfmhCXX/bC+Fsr5gbn3Z6UcqHxB18JbxxRU2U+F8ERtpGkpq25YB7\nGe9E1PacAwNQMg6SJv82YUv1MW0MjkZLtM/f/UIjRdlUbvk+sRw2nm0xS7WV\nWGNvM+p9nJ2cR/CkT2aBU9AZmKmrI8nUSmAZnuoLOv4aLs18sIxJw38x72uX\nbgYjQs2uvBiMz9MTzH+NAKd6iQJ2O1q046GbUjIAA/hU3Gzcikzb7Gusk8GZ\nmGmMD/7itUk/w8tl3ugRhcavqomMY/ebPb3KZo57gbpOwZpfAwQoRkcDSBhq\n8Ssy63/u37iWBUsCzUfYmrahXauVemcpzEYulLRlhOSIt18iS9rYg0KwvIAm\nNUKe7F4xHdsihV9CZFy/Xu6RFi1P3ZKFycwzkqOQlly0RkUHNypKl6zusK8m\nlp0jz10p60ZqHWLVy+fSrSibMKkTiHQ3awKAvbkNcyxeWcLSVoZphmWMgimW\nyeWHvko27SD4fhhgCh0mEiWMakuXmSiTvvF+RRqjFeP/powR2Hm841Q09ITc\ntENbd6wNMdA8qq138P+6QKAJWRNQl+W/S4Q+AWJMEmXAmjN4jwdnStGRHusz\n8Tdf\r\n=3WX8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1blX8zZSxiaXQDqlFWi3igeaMNVIK4F4cp9ppec0/gQIgOKgEzFR21SeA0ETdmzTHLlZ13vCXERjvdMzDFB0oorQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0_1587289677611_0.5893348472169295"},"_hasShrinkwrap":false},"1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cc22a2e5dcc7cd11d07cd01708489ca55f639a1a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CB4ltDsoxoD7hgc+xupjd9TBDenf10ADN1XB7nBSWXNr7PjEZZ7vtVlq8Jif1fgJwWqTHTUpkFv3DMs9QPOACA==","shasum":"6e99859cca446e5d4c3703ba3202b05adbb897e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0.tgz","fileCount":22,"unpackedSize":112377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenB7JCRA9TVsSAnZWagAAd5MP/1/+ALQ0/IsdGdaJfPNb\nwPh3N+1phdw7eoIwnpZ8iXBVn3ycTzDPYWuQ6bHFAzw160mldU/D2N3PKYc/\n7Vzo477SbXBr4VZKK5JGni8npL5Z1uo9U0Mv0x8ITAWG0JbHhy7MtyzEfbWD\n1xC4k1j4p2xCTHbN5WXU67SAU/KqFqTRXheYC1Sb/O6Z4QA1nlO1kDo8Oyir\nZSxCzCpyc0QPkoip5/ttXgULwDOwm4m+pxyenVMVgZv3ifuoDFloHFRVcVje\nSdUmBNPGjsxPFBYGqlGAdqGpducIGQiu8vxQ8fHY6LUUXj9WCQtQLo4wIpy8\nLt9EuKZuzfgAqSJozBFVmo7CydlFNIm45TGk5rh5FjnOupWAMzf3Mob6YT0Y\nTWkfGAAn3H9ER2h/v5kLz7bGg5sYXWjEPXBrr//d0Lpn0d2fCcOrsJQQYYLw\nHZv7T5qcof6CuMOtVTni1rmbFRWNpW89ZYlU8MziI3NV3JGseRzZkdewt2R4\nJwfBTvaq9mk8YtcOWwV1RP7I5jhu4fuVqmgvYRr2q+niqKcwY1B5AL1laHxV\n9fgT/bpUObgndC0spDRdVFLhmvZrS2pkSet9f6Obm221PnPfwHuGncBoulDU\ns8ek5eyMP/aj1UHiL1vauEAo/WbTERDw7S0sE4p3GrKGZ/5g7di+aqNMXXZR\nqm+q\r\n=hYSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5E28TB0uxIpphos0HM8UOOg5MFBBoUxul6eGpAXty/AiEA/Or44dpNNc9uJ5CWqIZLtabzuAqGw95NLcJl1ppB+OA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0_1587289800885_0.5987690002880015"},"_hasShrinkwrap":false},"1.2.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.18","gitHead":"5f388723b3aba7c448dd5942e3ec896f243fe523","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.18","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-p7n+XCmUZCdTEGMyrM8txwn6kUL73Buqgj/c6/LfCFnRqikmf6CygqUDVxhNsbzIvskUiGESuM3qGtFisv755w==","shasum":"acbb40d4f205a2a395a838dd7f4bec6a6b44193a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.18.tgz","fileCount":22,"unpackedSize":112611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenB7OCRA9TVsSAnZWagAAY5EP/1eP4YuAUJvgrpEwe+k0\nzx99p39Y1ipFOK1rFoPUg81C/ra7ky8nUcxNvxeQT2u1hj8JkM2lUQpxsqX0\nilbhxBrkge0eg6DSvNEiG66jsoMHMSHLLD1DBJbWlvbWCBfAysJeNLZIveDg\nPHiER64dofJfy5qGks2ykyoqDbMvvbdO7REohf1NNjyJXyvvHEoXZN3UzuLG\n6RLDNP8GMjXAAduLRprVQZ0X/wz5iVZa9xs+zk5EAnTeQl73ENw8V1TDU+B3\n4h3hbcqi9z03o2pzka3xA10gLNddlHTxUFZ5AtyzFyo7LWTTe8ebJmAklkrJ\n+rKKmNpYf3NT96dj1lIHYWfqeoqAUIFjNCIJmn2Si/B9MVfTuUEadgSvPFt3\nUlQFAd1fB1SHyjPpXOstEOjX8Pe1OFpNolRX0Vvop5T13XVCxUwopGRffzze\nsS+3WEwsbPpSfuUKwn9MGSZWsOrLDJ0AqfuTvOzGzQAblclwpAwyXQslkuN3\nS9jYPqdMgnIZjncAL1LNjQnmlZKckFwoWdiQgOEaebTkz6Qy1cfisn/UVPgn\n4iwPLTlhUdYjxVJEGtNiJ8ddUEcRChyyNwV7ZsdkdYhNvFTlwvYADickWJh/\nLcM4CKVH4X/RyHNaww0rMycxocjN6vQGXpftMrdhOkwvdDkvW/8VYq9roUJC\nXgtw\r\n=n4Uw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX0Ce2EztNb5wSj1ku1MYsSPg7eW4y6ARsrcg57pzbyAiEA14ElJgYeW22THG8lEalzvZ/wyFrj/fmIh63OXHsj1yA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.18_1587289806114_0.5671609475230612"},"_hasShrinkwrap":false},"1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.5","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5f388723b3aba7c448dd5942e3ec896f243fe523","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-U3f1SGOjVEHpHDFcLvfZaSaT9xXacQD5f3WjDWzwnZI1YSMz1mwe9zmk0aOEFIDsr8KyaFUHxJN7FaY1UqSpmQ==","shasum":"15d1e7596dd3a0ccc4507f93d66ccb18792a39b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0.tgz","fileCount":22,"unpackedSize":112654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenB75CRA9TVsSAnZWagAAKkkQAJG2qv03Gl6l9V2FvUcb\nTnJdq0LFRMxuUwFBDdFNE9Nc6VWi+l3nZ6ztcyT61uu2ztbiWi2NMQXbivrU\nY/IIesZ3js1bX4L9pekxh4eA22czvhTP13WIvBtTG4iUvFwYIdoerxIm9reW\nzoprApepmXsvG7yYja5R0UowxtZ0hq6V6HaEk11GMeEwbExvsq1TRqLAmC1f\nfmUFoH43WEqWTjMU9GJNd75XspMAQnUb810Lq2CKpSMNINnbcUSGTaNeOZdL\nRt5Q6cyMDBzMC8C+w5wA1ly22vBB+GTbfbFkcpd2dUgYCAUN0YRfNwIyQ2ma\nZT+b8Wa763wm1DTZDRDvhp2Cf2OIyxAa19r1S0OF5yu98W2+55TLzn7mLJB2\nsgdjdUktSDUQlVTy4B7PfXXjf3PULEbOEvl96XJn1vfo9W5/LYPBmAGfmudC\ngzfEtCdiWOfuGMBvG7+Aapj3QalJs8MgvwmhjovYSxpJUuV15fuLOcgwsYu0\nm2X0wIDmutU684yCTkXyfNhXle7Y79u2ODFbRjnAJJ52Q51wXuZvooN04+rB\nzL6grrTIkiP98JPge2lhF79PSN3l/sYyVpOODK34jLoprGe2ud6iJSoxR+pM\nvXWh5FuUEwctxy04WP7zbC2MR21UgExvSvef8kYSHt0Oq58N3lYlQpkBGlGz\nI02X\r\n=pVaE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbzS0eq0ivgdCCydiYNkG+rtLO6B2Z8lQvoI+KrMWlZAiBGtXDsbJjNf0ML2naTP9puOfEP4Dt0y+rPjkWZta4vbQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0_1587289849251_0.6806751584215671"},"_hasShrinkwrap":false},"1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0","gitHead":"fa9dc5bffb40bb2bbb222b23d744879205d84286","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-x3eh+XTdeAxmMuZXBRlK/QBvTzy5hOt0Q933L4UceSWAoySm6sGVP3FP7lhMoOQna4qYazsAZYoTJPlKNeVatw==","shasum":"a17406f67cb4611f524e037ffab97fe9aeac510b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0.tgz","fileCount":22,"unpackedSize":112654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenCX3CRA9TVsSAnZWagAAcj0P/1I5hsNRe2zdzAZHulOB\nf/w3VEiz/WgJu77d5YmHwsRIrKyjBfiOZSgMriITxqKMBbnDaAUdXfCF+uzH\nXGZ3jMBWFOhkFoo0VgO/UX1XG+yrzYC/LygI4F13bPMBg7bg8aXaMRsGGuxd\nIw0tu+QmW5Ch2PgiWvzdEWp/qdiNXmqP0WMud61Std++uoBH9MHdxQbn5WyD\nLlmDAJXSXsWWTHyUTyA1bZlrtz8xkmhlGrc4WSwMWaCI0NHMumsOP+rDROBJ\nTqq0rcK4pSooBfKBk5UFeHe5teZdmnri1IDVFGlIjzRoUXhoDhrE4XIBu0nE\nXAGZAYUNEK7549iZkxhrffKRUjZCLXBwrLvBLOdw5n8X1M/mV6eJVCHWH4DE\n3JBcZ2xzqlEUgdt04Zf9ceiSK2Iu9x+AtybTtE2/a+vdnxApuMgFTYHfsQW8\nyLPdflp81t8CbXS7kwt8FTcxVwjSgfmSZlTyem/GAaPTh+7tZenTs28oQq7N\nuLTqTHJewtenbD2YyWErOrnbW08N+bU6ED+bGscIGnwcp7iOS6jWrQ/1cN1L\nvYNkut7O6aR4YVWW4FhrgyQ/s03/ZoVbQoak5X4u8NwYHKWAtOd0+9EsRJo+\nhvPmL1jdeMPfiUszVsBGk+CA2eIupFVsu1VcIsTazPxipv2Z5rgzaqqg9hw7\ngjK7\r\n=82NH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrn/GCVT5fjTmIUkCGAw+uGwLfZFbZdOTjgAsD160uZAiBcLedea6mbtDSbPYeS3hzRV6zwXO1cyhYxCJr07MwEEQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0_1587291639094_0.6892196914548059"},"_hasShrinkwrap":false},"1.2.19-8802554c59587b389519129be8af53c014e84269.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.19-8802554c59587b389519129be8af53c014e84269.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8802554c59587b389519129be8af53c014e84269","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.19-8802554c59587b389519129be8af53c014e84269.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1kmy9xWPJ7iwDOEnQ0/VeTPxm04Nh8EqNzvNnSH2dH62dl9fe4G7PN7qZVUOYAGxEW06RuuJAhu7UsFREqDKuQ==","shasum":"81439e8ff7ece3f353b189fa378cfb9a86bbaa8a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.19-8802554c59587b389519129be8af53c014e84269.0.tgz","fileCount":22,"unpackedSize":112654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenCZICRA9TVsSAnZWagAADDUQAIik/7QEdyquhGT2vGjN\n4VheGbGtzpVMpDeYZm9pI8OdMyJjMhsHrBk+73r4in/2gvnKUVogU7uzv58O\nnu08eR+9IRNBujPi4/7I0FJEL1KqaOkVI09CRDjGnnkpq0v8ntms4TxzBw42\nM9rIlFD4dipxX8kMrRnsAKRC/Hd6nkbAR9DdRzXeCYrpymZbmDoAbOH5DJIz\nCJrKpA5KGxP7TrFC12BQdJvFWVLg9867xB7n6Jk+s61DViDBbjrxFyskW7jM\nzCX1pKCzRZjcUAi7RXMz+8xvKdAQw0OpL8uUpB59gGIrZH1LMW7cqTHwJuTD\nbL75kEKxK2z3d+d5eGjFPYtEGjoKGMBTCZIRL9N2fLj4J9k1AARn5vnMAZ/I\n8bKzRb1qtW3Q4beeo8OZKAmaiaxdEH3Ryaf7iU/GxtzerOZpg9gYzO01pXtq\nFY0NLZR/1efQ0yCXmeeUEMUyjtEmqsYxYBaTvWYDUSQCb6lfdlJC2OITaLuh\nr6WyAVSm8RRMzJ5BjXXkYzdeVHHzvzCvLXv19SdlshQybfzrzBLcydkVX8d5\nxkRCgbsO6YUYa3P30pwsnf5Faiu7oUlV0peYGulDR0mgbRsQHhXCCeS/jD5v\ndTdMpbLH6T+JZwqGguRmMTup0fMEQqoBJDSRqorDLlMIP5WlOUK6DVY8qKAW\nHrWm\r\n=oNJb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsv8Pwr8+yNnWjYKy5qt9U0ULM6F0SMgtj7TGsZxJgeAiBzqUrWgfm5MXL8uvxxBQJEICYI/RLXkwpp6C6akTvuJQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.19-8802554c59587b389519129be8af53c014e84269.0_1587291719715_0.8003553158104539"},"_hasShrinkwrap":false},"1.2.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.19","gitHead":"8c5ed8eccf07cf4a862254b328878bf2db6ee6a8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.19","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QbAmv0UR4iT7hmvE5Wox37hTlxC6UMIxg2H0bGg8TcqKfN5ndu7RLJKWBL8PHDff8aDVR1Y0MhI9mRwcxnkkOg==","shasum":"8ee221579c6c3e2293805bf5872de8750f107185","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.19.tgz","fileCount":22,"unpackedSize":112903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenCZZCRA9TVsSAnZWagAATMcP/jTOv+7ymw+btUyyCFNG\nHUy1Z3b/sBINdw8oXoKVvTqgtxnQM+3RYOFDB6ZuUG86v1/u6Y79gxUZPSDZ\nYVDmxsryn0DsoJm9lPcRPSupMrWZYGDM4YjufiPNXk3994jbaqrwoKi4diGE\nI24gQ4ZGUhigVsIC5VRbptMqQEKrRsjlP4T6JZaE569DNQc68hs8mp4rFBlD\ne6Ewc+MKfxEA1rT/cboL0kP9cayBLgsCrrCMlRSfuQ/ckYf7I48wNIUxsd45\nIvRMOvnbwAsI0lwIT1Z37by9UlCqX6nJm9+5yIAGABZr0DndvUI3pRYDGzZ9\n7JM5wewLStD21hp+6CGr3771l4sGFAgSmGh5wdB5g55x6YaJvvIUWUfHUC7V\n+5IkRYH0o4xNynnfy/OCoy0nC8JJmMvpb97012Ya3yJElcgQrnazf0R1a6DI\ngHFfoJEAGHj1m/508lsfmjvhgipgBUEceiemQmjaCsa/+bI7KkDLF7L9Fx55\nKx+fj3/ahNQiWTSV8TQtqAjBE/BwQrIPEa35otWh6SLKjqMrUAVHM+4MyrsI\n60DM05VUs7H58KTDFeFo2oScJXezQBtc0XXT+Wvff8/Ae59bfhYenoDRqarb\nxSTZ31ZRVj27pcxm3iUCLVf6dRA6FA1VvMslZ56AV+/M1TxnzApjYiODCN6O\nb68O\r\n=W19A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKBHKvPaik5k0QaTgh9BZyHEOcnTnoXI1SVheThKew6QIhAOiTu3FwZaNV6yTU+fGCnXIBdSFvLy3Jq/8kUKtdJLBP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.19_1587291736491_0.2544591544909811"},"_hasShrinkwrap":false},"1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.3.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8c5ed8eccf07cf4a862254b328878bf2db6ee6a8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DZfzWkCGauwlTmYIQUqdcRabh9lNwij9CUwLIXe/8PXBk8BNTsgbHz9/bBjc1yp9sbS0ENswujR9nsNLbRcxVg==","shasum":"20e63ad05fbed9e90ce6493aa8243a5a9a94700c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0.tgz","fileCount":22,"unpackedSize":112946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenCZ1CRA9TVsSAnZWagAAF34P/3+g9jQ3rjgbJCDsVsHm\nIRhWx+rcIk80HkRW1YaF5McWNt73twPAeW4YH2EDN6EvaX3THleCHKcp6XS2\nw5odn+g1udqpy7F3saPfDw7hoyZwVnWnj4pZ/O93P3Hi11EkUnJ0CTZt65JK\nXq4BF75S0JspVJ9KIXLlGLC5dxEs7YdRKd3m1WbVszlBppKePKPAwrWCxSio\ngeoMvOKlJ36zCxZ6b8CWv5T8LOrMpsAx93AHzwY+Z0SRxcxVMFzZq8O+aeru\nvM966CleJYF+7so02Pg6tFgEJO7TutOfwQpiNND5woOOoBZiCXS7jkquZ+kp\nYZu99JY/ddfuDX67xmuG5vqADci+UakleUlyxPxfai0axtZTtRmPYuFbNLBn\n//A9gjChd2aZI93ifHR6fK+zfLOoy26is/LdfaS3CDbccj3eFuGOnuYOhOFE\nXTNAMIxXMD4fC2UR8jodaLEvRqNrU/QJKnvAgCrx6ZDppbjXfNH47uHDGG3u\np7TVzLjrATnhcqSEx9c3Ljx8fkSLnjhHJiVGbDMdNu1R2wkBbOvwy8zetnX1\nKFpQKsNuHWxhfQazo0MKYAN8UCUEyOZgs3ioAU5w5QHcd0mAE2hFxjbgVb3y\nwR39WwaQvMKi0JMpjX3jSwyytqDWuiFO4ta+DH1sZc+HZraod2iR2zukhH1a\nc/pg\r\n=jwBF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyeTUfaSLnMRU9reuqhrbv3v9+d6VkFWxKGUmfuZfkJgIhAJl5NjzhlH0COmBjdQ6DZTi9GfDlgE2D8S6DX0cemJ0S"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0_1587291764865_0.6974399780154492"},"_hasShrinkwrap":false},"1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0","gitHead":"0068454f8c979aa2d1c4b2d4a41e96049c72aecf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JWOCxUnXJVkEalRSv1PWThH9RlhpWCcCoAJZMjJlEL08QVyUCx7dJ45+FpJynffe8J4sm/3slg5/K6E1H8AkkQ==","shasum":"52bfb5f4585e0b575b4fb452c40278e7bbcd7bba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0.tgz","fileCount":22,"unpackedSize":112946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenMwhCRA9TVsSAnZWagAAND8P/1IOfEgfLOQe3wZpPUR8\nM4oHQfYcgIrOVqc2aKjqX7vEBsFJH1YX3lO6OFdjo09PgMMjFgGqj/KjHTFp\nVnyvCoC3stNvV7sd7q+JKG15LtUz+oqkQ3XJaR02e0XTR/+mz5OjGgnix8zP\nrS4KVU+4Z02uKpRxdObabOBOuUU0hir+Mmyj9y+Hc8RZ2AVo9634tVUam37r\ntA2T2eNNqLd7m535eKsVV89ha85J4O3N7mdLx0QNtzgnW2N4oHvIXiiOomf9\nTMgU65MmZ9IO6KhL61AICvAepvT3wfS4uGupVOrh7nefptttWpq+AS3DBZNp\nN7XIS7+Dwx0abPfPL8gjDdPwQSDCOJ6CXx676WRIK6UWS0eW7Grmws/Ba52e\n3zb+B9tMwNbBylc8jUA72WoV2ocxZ3MDHM5AvOdd52HQLyg5pyIMNWoDkerH\nrxZKs5T42eTJLkRCdT8NHs8IQG/ir47wDgvsa5Rmdo17zH98eMFkjGloFSVy\nmMgvI1zp2XJzrmYdXhyOhFX4QtUSXjwkcGZA12RlOF/4NiTY0upUDCllJLhS\nrtOFobbAzTirJeCcsGohRQWQvgmieT9Y4a0J2VSIsJ1LvEt5by2D604XpHpr\nscQ+YRyqo0rb87U6jb5zGDUaHhvMyp865+dXVYMLD4N5PO6/d67y+KXsF05a\n9myQ\r\n=a2A+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY+7ayMU51v8gBU4SbVZQec4RRQJS2Cldp/53Sk8/FDQIhAJLz7Zq6w6aq2dzkXLtfcvavnMAqKmxZB6Es2hEs5fpf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0_1587334177044_0.29303084454528405"},"_hasShrinkwrap":false},"1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UYvGk2d/qNyoiG/i+kn+RON+anV0jDU91PtsZq4yX6bKxKpvK9TTKKSv3Ohgd2d6gWFlkrREW4QtgLKTL56mUw==","shasum":"9f5776a50528ca7768558ed166b9864b37b56a2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0.tgz","fileCount":22,"unpackedSize":112946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenMxqCRA9TVsSAnZWagAAXOUP/ApyHjm3Cl2d9o9NRUWw\nbCz9GuGJshq3s82UEGLsrklchiiFwVtKRGPSFUKaOnjA+veZwKOrXDXXPJAe\n6NG8kciGvVkyAuITVVCPQ4A7B1OVhAJhadBjGQchrBAyiOedina/ThJWrhw4\nkBzBwbmuZTOrcWR/YtJm2w0J5ex+Csfn8BvTZmjjN++g2/6lSeMIBpG5hFXQ\nMIh0MHbfotUDLcKFa6eESqMZNEvlQBbiopAxWsIUlQyHY65hU3brEcoWx4AB\no1UcqNWTRHT1rFN6XZ8oKgXLDLaZC9pyzC0Vb57TWBEXHZhRD0AvVAZPKYDW\n/ujRMMPcrYiK0sVGSHjCOXbvw4INXUuEc30jncC3iJByGv/hLXH+u3lDIAgV\nmA5RwhxmOtLzpiD3KsnfkSSn7QR/jH6e5Cqb4mCRniJ9DyJlvqU7OHP02g+y\nA1ucGaTWdRKDto3l8202HUy4rBB7Cwn84sZxOLe5OE1nl/Vt0yKCN0XuHans\nqqJAP246s2crwgCV6GJ6Prk89lPLc1V+EBcui12P8cPVmM4jFnz8pJULWwsZ\n/3Idvg1zuqMY7GIHiQcZk2tRshV+1QMceu9WDWpEGTA82ZGN3fdZz4abfAw+\ncZz+mbKqNd/1iUrhQOOke7EStweumvRi1gNVEIhxEBx01BwJ2/KRtM1uCo30\nG9re\r\n=DRtw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJi4irTsqtGytirlvKYc9WuUwmpLTu9l0z9uq8A+qGYAiEA9tHSV+dtx3Zr+8nZ4NICV/oKaKybWShaC6w3X6jm03A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0_1587334249658_0.2962739779174617"},"_hasShrinkwrap":false},"1.2.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.20","gitHead":"ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.20","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ILQQ5L/AbGnG1kxAeAbeJCPFgLMxOm2kKtJL7S4Gp8Q3J2/adtnXFHPPOj1Dq1lEdKb8GWWxjPsc8cFMzTD7mg==","shasum":"d38aa7f1ea006668155aebc526fc4aaae9bade8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.20.tgz","fileCount":22,"unpackedSize":113178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenMyBCRA9TVsSAnZWagAAGgkQAJcpwG8MEB/hDg/Tx3FL\nLr1y6rsFgX9tSaPleB1UKn6si0yiMmuZOmQnNhLEc09rbRyRdAQS7oMgLXAu\nfmxjjUCaP7x8N1mJMOvmMx1a0NLFZZRh4HjeWEaMfje11hQtOT+eJpNeaDHS\nAeubNM14tbWh+VqxQ2xcMU6xujiN5tHO6SQHy2bLE0vpcVGn3CO+ztbbCCUD\nyIROZ16pjfODxiarEbJbkVUaQc452L90umjRxTTjhs5sO0J67haZXNhTB5d1\nSC/mNhwRHcu1rvRrYZzLlcZc/G7Qqu3VRRlhb9lkk7HNl09tclHWtu+zK//u\nfbCljuWIUVOom0xf5PU7PJmFQn3O5K7goPCVClsLkSckWQ2jjXKUmIqdPCz2\n0lEnZyLgQ+yJ66thYIpxTJm+oIc1Ws1CnbkGBR4OVzgACxd3bihr1wcX/A/u\nE0TvnOxvcylIZyTzk06FMVXLkcrGXO02rkIKaEFnhA9PRlgwylNtmCCho0wb\n2o3KKGcXieyPfp7TPIZdj0O3KCjUWWh6OLgIuAZDwxBC9qBU/tQg3Gz7Prce\nVVwspv1I3NldaDknV9n+NeD0ZdrYTsTNcO5BcG4PTrmfQJDbjWIKPx8MZotv\nDA/qEMA/FIa66xZB/JjPynh2sgEP539lWSvzCGSxsv0diK9TaK/Oee95yJAP\n/M1Q\r\n=J7cn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUZ2eL385faviRB0qCmv0+imN9+YQ6liN8hAX78GXk5QIgSKm5iKqQcjKIumbMYpqE9zcmZllvap9S0gzGdBx/4Ug="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.20_1587334272809_0.04235810827395592"},"_hasShrinkwrap":false},"1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.7","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/tY0QU339HX+c9LtnwY8r6x1abelGQhwx2ogexZaDqbXv/Pg77xokn3NDYbPsYgQvVY3qzoKrzvvy5Z/iuaziA==","shasum":"6752b05e7876ca32bce02492253c23568a104641","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0.tgz","fileCount":22,"unpackedSize":113221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenMygCRA9TVsSAnZWagAANWoP/jvec/5fzr1Dyhg8HrRe\niN0Ov3pTpWZC9tJvjQBcttNFOvfARUtqGbM347VUQ5zURAjPlVoZvR3KN7yE\nI0n3Qe4S7K70Cg/6mP9r0PY9lGU91Yd0rrE/erM/mryeD1rVqKJT4EpXUzJ/\ncTMlqt8b0PeTOHIpRKGODltawqnwI4HZXrON/IxYsP3o95L1Hh4hmgZ/JMJv\nHQaLcBnNG9zYkmqGLAfW+F+rrsC4FLnbtfutf7RUOY9eQBjyJ8N+uwYq8zZh\nrQeocAPuEUrF9SR3SaO14fEe9vrgawSjtUvakPq+wS1ZpCGFlEy6InzyBIL5\n7jt6mHC7YDUiptOd+E2C/p/lzxItA/jlIVriWamAtC5BPaVUx0QXpQo1QewZ\ndSNLQAKVxCnBM/KlHABxJtrRs/Jr32oAWWvFHdYCuGYEzzBXQY6TA+I4X3JF\n64C/u4xPKhtYG0pK2xQcSbTiuCoxFEcF1Wwmh8oIsMa3ljjrliEfifu/uAYg\nXtk54hVeesBw0RtGQUAIfMv3maWsX7kB3q03LMkNQAmsFNlRbSN0pD5j+iku\nf7E4MX2JqKXExTUNfrrF0cLggDLqJWVUxmuUc/KvI5Ot+4p+5Qd+mJwQrDxq\nnaWS3rnGTRJto96EnLnwNsqnhTrFnbV+xTdi3Yqmkem3OMlKIMxVxLzaGo3/\nRlPl\r\n=YQBa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwiNmJfnKa6i61xRTeGhBghmamFZS3oezlbOTmRLTwGAiBLpXdSFhoIZ4xoUgFbBhVT56dJU2LrF8A3xiMDAfMe9w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0_1587334303756_0.7561289629816759"},"_hasShrinkwrap":false},"1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0","gitHead":"0e517734d3abf0eb1c15aa305f0e42c49cde9f6c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DyRVXp1/xC9uvDXCL3+sJ6G4rtEaj2hQVp3jr2JrJJ5HztnVhQuU9JwEQrQYna409nzalqpTXO5Xr3DvdC3/KA==","shasum":"dee95cd0b031ef92ec0470df60f265754bed6f9f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0.tgz","fileCount":22,"unpackedSize":113221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenNQuCRA9TVsSAnZWagAApj4P/2IkScxLw7byXvTgQq6Z\nCf+hXOUTRb+7RQpTTwFgYQb44GbyyZg5f/epcnmqmya44WocWHvkjPDB0LbA\nUdXyiYeY4MDOeYkOdeTaXiejObtYO21HBgLsisjcOuZ1Y+zvlIuSfyABYBYa\nSSje+KqwRWD6rAeQMAFxVYq5MDGxfy5/nphb/P1EimXMqKtLgaYw0PBlAbFL\nkLpfhk2l9IVbz6Cdtucq5dxVdTDmIN6pW/8mL6kCjNIYMAMmqAJ6/VPXQ+H0\n9DXWcPwSsP2VDMx5QYwdv8FYrBwY/+DFajW2hS4FUL9Q4FryAkCAh37dFMgY\nTBUez+EI11J90tb1MgRXdouCoK8L274E9Shcj3fcx5ar7n/gvUhxohxbGEAw\nEDSvOJyMANeq+R7XY8yFdccaSFnEJjCSloXKhKI65r+ieSDUzzr2k14XeDi+\na1R/je/Kqq9HaxAUtbne5byayRCELQQmvd+Zo8cdVSv84KHj4/wliBhDNslc\nc4LwU7j4whBzN4ISoDXSIDo2CxKTgwUuamJJvh1yQAbmeVN3JDUQs5ictlO4\nic3fUJc/fThhuspSnb+ipO6Iuyhwg45G5J0FxAq7OY6a4rWFB6743aIDoJRb\n+zjEFkae3U0ajzkze4phpaSabnAsKrwac2ZE3Tnlzn12U4cyH/yffy68U21n\n4zH7\r\n=/ars\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDS6IkvA9yQzz3LflagzZ5gvdkpwBb6bMzyOA+mQJwdAAiAw+G5AygtJi+4t5i9ImpD7dKAjM6YDTF0QCdR5fr3XOg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0_1587336237925_0.14386628842919613"},"_hasShrinkwrap":false},"1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"af2cd5cb28dc4af522a158a3f2e71a6773a21a97","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VaN41XhcaVoKsXT4Jalukp18jubTsfKtxotIhEdUg5L1Rfpe7kCuRs3XTUSu6m7/0tzBLn6WKD0+SSmA79O0rQ==","shasum":"7cc535bbb2a5d578e9db3a41fd86364925a6e7ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0.tgz","fileCount":22,"unpackedSize":113221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenNSACRA9TVsSAnZWagAAaQoP/Rk3ow564hhnvvUlto63\nTQMOo0D8X1tqWOYuaUND12ZRQKIvytJwI9+X68AvJgu9pNTP/EKVLIif8olk\n1vZTKYw6sahGyF2Wia74GS9IpeFmrzSROLnD/6IEBRt3VF0YUopElDqh63Wq\n9hpKlg1G5ya6JuyxbVurgVxatf6VnfUYg9Nr2NozLop/SNK5bOsFJ244ajK3\nzoxdcxBVng59jw9AGfgVfqFD8I5Zb0uETJixGGTWEEsTZFmefeJ7KgFCZ6Ev\nXuI/ds7LpbfnMLWx4z8oCpNHkZJ2cB1XQSKMHyvsB9cyzEL4E0PNDnLdmpfV\nExC7OMp4CzfzHH8bGKUS0p8qRznsd6eyA4Uq/b1e9S6MEnd4yA9oJPlNzoRu\nFkEhVVKP78suXqE2+6jIUBQUpYyrY7dnGGSe1zUvYTMyUcyL0KVUS8nsNgKy\ntXgD1Vekk0KddlJGzX69NTUcP2Ja3p8SshVpDnqaJMsv3dkTLyZ/nRfiv5SA\nl15semwe2m6QZOTAeRYc0BRYTy0stVKgDxmm3U/G5AePevdHJZcAvjIEeMUT\nEoj1sBAuSJakDbeihSoaOzli01ZBXAetn4tjDOm6JTtZi7VScyxJ6WRElS5l\ny9hw8rapW8NCt79dqcErl/NVQPPKOas2QsA7oaVgkAWlRqw526CKHwVpCeLZ\ntr0j\r\n=svgu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0I0A8Kfp6tBqYqUSKTbkrzvm5n1pLA7dU2JxB8RAR2AIgaxIXYjSkvLXlSl/1QV/JocYDzfmZWLR8bWVv+0fh3/w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0_1587336319553_0.3480795378495454"},"_hasShrinkwrap":false},"1.2.21":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.21","gitHead":"d513e4d6791c6ab1fab730db25265c5f568a78b3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.21","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Xkio9oWzlwcZhy22xg4dbz8MQnr1GAU/hzbDExJaHAXyKjlJGrE2MuHttDjM3vEEqqbkYOk5o3jsH92ijAkBUw==","shasum":"577c0723090522ad3bfe47e9243f2aedb8b3fed9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.21.tgz","fileCount":22,"unpackedSize":113470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenNSSCRA9TVsSAnZWagAAcJ8P/RKdeM1f0N5j9bWbyOnL\nk5Gb/38lIjdm4BvUpVXxk/66Yc7cEtJPZ/0fMzyriFqAhowlwq3uWxvb7i6A\nF2aZ5CQLx09yAoXI3eMl3Rt3VKEnHr2mvgQ9Pm3btoi8eLTNjt8x9tAS/3wc\n6YQ83khP67POFj8RTLB6CUCM71G1n0vM5O7qZx2WEBglByuACuDt0YQhGe1Y\nbNrNZjBOrjgcyhao4hnWF7g7HuQUiWMZ1nfy73dm5+1WB5itG5M9V05Uxw+V\nZBQJDKtQZMofbDn3kVxeNm0FMFJgrjHZa9Xov0DO7U7HtWwb3RCWOJDcQ6dl\n/m3u1gi1g6OPqUVNpsDl2kOCS39HXhLU9Sv+Om13AwRrtV0CC2+wrcs5YQa8\nwSjiCzCAbzHw37JmmFmqbyn3+dueBsxlQdM9pP4GjD8Kvsmqx1ZhxcYmVx5h\nzTaET1rBA06k/vrpLIKi8+7rN+loR2UiYwzgHxpDn5O4OWTGQcaCaMwkL/ZP\nmbammetO3djOQ1ZS9M2ZwPk63uMEKCGpfuLiXgvqP3uDq6+8cVPDehHdI3ef\nb1K43Zo2o9TqkJgABvx7V9Suyrwu9iVv5tc2sfhSEbDu21UxpmLJUoJ54WG0\nhmIAfuUSkOJXZHxD7XBFPj+iZmyf4RGozD5MGbIGLoV5VXuVhxbzs5cZjHnH\n7Zsg\r\n=Pr/t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcsXofeK/84Y7v+q+psrxBihsR6myXLch1AW5lzSruEAiEA+LE/AOs3UlKqmP55TA0mff+hU/V1vIALsaMi2MrVdO0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.21_1587336337850_0.6341713116707828"},"_hasShrinkwrap":false},"1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.0","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d513e4d6791c6ab1fab730db25265c5f568a78b3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wm1jTpQTKXpfgxbO9oqD7HIzNIQziB6xrrF2jPLrtI6PjR792VTUViUuIMwjlHmRRLWu+sMB6NvgVHBIB3+KQg==","shasum":"cef3af399488355bfbe308b2c4b479f10e1d4e46","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0.tgz","fileCount":22,"unpackedSize":113513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenNS4CRA9TVsSAnZWagAAYqoQAKE6BPS9NExiPLVZ+qkE\ntyEN3AVuqSQtukGZd28KIlcUE0iWcW4csVTXILWpa1yAAr1aRLJRJ/WBVwtV\nCelr9+a1rYW4ysaVsX05LGzT97zmqbsnh8E4nqF3CNWfIVW+y4L1xt4X8eDb\nQbAowryoBq27Rl/6tv6q1Mb6N02Vx9i/l7hhGyMeWFLwar9EPhzTFg7Sf1fP\nP3CduThyxhxxZpJ2Y3dFPxGe0EvGh0WE3JrtXOrU2Wb6fG54WHiyghaflWXd\nPvF2wp6Sl8VUk/QCtLQXVBIdKjS/b1ORzD/jMm4YvtNuUx3XVfQQqdl/aa09\nyxhwbf58Qx1wcMtC0Qpe+vAGaKm2YSqXMGU1ji8qWCOw9yBtQguv4sVvtpSc\nH6i5Nz7imelF+ZzI8LqjNm9esmewTMrdIVIJshIBZkI7R6Rf64az0076nyqC\n/Ir2wG1AbMPdTexDU52AfaTvMoA1PK1qU98vOn5ze9QyrS5g4+v+PO/Ep17C\nfduquyMmrs5Tn8sF7f3ZbbzRUuKeUB9gG3swXHb5HN3tbjTafVA5IWXSgWTc\nxSN5SaOx78gMDtojjiNy8QyPW/yn4yyAwuc+1paXG2Y4A+fN20LgTAMvVPm4\np/7FvOjUygI0L73lFrW8EBqdYoyTQn4ObtiKGYwLIE43ZVFIxCsaVif7+kEk\n+WSO\r\n=qPIn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIHxvMGMmhZoOtRANIaez9+ClLsfTIsenv3UCNGOsi9wIhAN2sI+00VCukdgw+4JFEFv3AKQ5svE6qyOABxZdxYrcv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0_1587336375585_0.0033831788869886914"},"_hasShrinkwrap":false},"1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0","gitHead":"004c0961a35dd4658bcb43abac901c2018aea514","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rObqOQQoT8RmilvGXny3i96kSRR5Bb/aH/E6RVxIp0URXfHwEFk9smj3tjKapUTJgcBpcSKN+PXd+WVIiCEt1Q==","shasum":"abbcb9bd26166f3923e50a257818f68d31956448","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0.tgz","fileCount":22,"unpackedSize":113513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenc7iCRA9TVsSAnZWagAAh/kP/1hvLvGjanQI2KRefDni\nSUm6x/hl6tI24YO8ue7TYHw9ijXk+m30ykeIynAui5Wsoh+gW4//6u7A4KQ7\noBN/tdCbYAcHHaxQg6MvjhgxVRBt8Bv8+g+iEiVyGg8ItvYUXAHgDdwCn4Ui\nYLyZHoK6WC9SFoWHZhPze4n5cjHhxUtGHOYKfm2HvOdFq5OmNW49fO4lloV4\nkYeYBp7P7jUGopkW8tICGPthxCCdSDrS6NyneOY/vH3NP5HzAxY2mbdW9sMl\nSs7xJQDsOdM68ybhY4DuzcZaonMBPRIK9ixb+oualwoBUDxdJwhjfZOvSegs\noRbC0utuaoaHN9tP6bOA1sLc7nsHVHpp5h7SPrwy3nLHyN032+oRp/P5Q60b\nBmmMct5SF7pgYudu/TVUtErFzPtz7qEvTUxvN1UdbPD+mIN0D8ytWaD4NfPd\nduHiLmsseT+huU3OrSnLkjKa4sjCwQ2QqeSUce5nxDOh9al+IFbILuNv+Kms\nnnTOQPRDuKA1hV1teRDBlcuCaERGv9Pzar76/JE1Sg1bryNudNhmeXSTkp3p\nEv9IOhG+HwQwCNA52iOZf9Wd8qMHHgWJZBb62rX3VhJuNzAlc2bUx6n98+U2\nh3epXfVNDi4MUz+U4sLjhrDJUXByLiTJx4tjauYctiXhdnZWuHqf8GOj5Sn1\nqUgM\r\n=sit6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2DrpaQ2sn4B1dlJGPz3IJUf67e0wqWqChe7HkiN64gAiEAxRObkrp/zpT895ulUVjYMjqNYtsFfJ2+LB6oVjdlIEw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0_1587400417931_0.3755557583603768"},"_hasShrinkwrap":false},"1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c68820e92284166cb2fbd401b80cc115c9e2291e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+IxOfTe7Jv1pVx378czksZNKf11WcEEOilm63eFSUM6p9EKEwEpWB+fYzb7oWSpOpIUiqTr3rxbleTd5EmZwow==","shasum":"809e9a8d6524619af5fd9ec43bdd15e612dcc0a7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0.tgz","fileCount":22,"unpackedSize":113513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenc8zCRA9TVsSAnZWagAABtcP/0O9jCoFY7LfDDcaJ8tk\nblDxpYRmQhbGxbMgv2h1jg9joOnnuuSl+CwyzHZfgLNNrMq3bvv2oUSW4rJu\nWfgiPpgCO1TyRkPs0g5XQ/uH8Lkqm1tuyS9jiSzMpYJW5Ey3VJv3/zOdRH7t\ncl431vAt0ZRULvHHc9sBnBu5BekvC0SUz4YZOh15kvVc/dxO1tOF21Zz8jqx\n3lwZbojCcWgh+0XBGo1NLrYUlClIyz72I7L6NY+6pS6BACqkb39DWi9MKZG0\n1hXxtn7XnASyZe2gPGcGBeyWvChd0uz7XKsvcvJCBDbMKZcQmlWWHKXCyk/7\nqPw2lJWmyGDFYjikC9H9W3/UqQ2bF2fmKnS10i0qe8XZ7lY9H+VDUixofNdX\nQLYU7lGCHZPBdvenzbBaUhyqxsrMOU/1G2s6jx3akEvg22IB2BNM7AQcschc\nZmR80czt4eHC930xHAIJR6+5d5P+2818cXqIi2BTw3kM9Gc6MdQ7CQC36pri\nw663oNrMBSwjAVUdrJPPdmtvywIPwqE7quKRhC2n8aZWbScmWLVGbwkvaL1v\nWfqxAIy2AW+sK3wJ6mGAwoTl6iEyPFRdo39vQqUUrNnEUaVRO8RvrjoBQkF/\n4o62aIkg5ySwodYOp14/KygfL4wXf5wjS9jpAFzd90F2dGc0BIRaxg+chekT\nunOy\r\n=GaCj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSHWLSSACiyGcq8Gmnn9B9N82OsvLhv4hiV1sbcHrswwIhALt8QPtKXMu8pwPPP707leLgUeFIG/gq9l30t6QVhYgu"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0_1587400498966_0.8817974312265537"},"_hasShrinkwrap":false},"1.2.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.22","gitHead":"63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.22","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jZsITGNj4UTLya4OcZ3GCdPZ8Uw+kHERYW4IdLdqdy0nOnswio8AJryx40OtLtu4aacQOMSrUniJDstsdsDbIg==","shasum":"d265a1bc3476a7476e8731130691ca2257f3e215","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.22.tgz","fileCount":22,"unpackedSize":113754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenc9HCRA9TVsSAnZWagAAegcP/jxUa1S3mvL70bISsx4E\ncdBD15oW+QluQeaGORFkRHyhQkVdIkKuER13kpM/q/BmaF6LcyVz97mLeia4\nDduNRlJ38OQUycc5QAeKNv1OC9EWNssoIY0w4pE84bL1k5ZzsWob2squdE0n\nEYA776qgfq1672i9Ar2M5DMz2ME6sRQNSqIb5OYK/yXKiQdOOADq6kszMQZt\njtgpUAT475HrTjFnu+Dd+w7j1IucZeEcIHv23gXTLxpYW4SbmxlgwaqQ1fGK\noUBntMA4pu8JemXZkPsOhMp6tN+ucWq4IApQ+YuoZVPBWT1p2jCTQ7djnip+\nj/jLbYwWu6Z6ysSu8wscayqvAh8etZyb9Ryoq9L5FKY7wFbO+fp4Q3TTIa5Q\nhMJC3IedgL06SsJnP6m+WwXEhE5UO5zomjf9MqPaRpHS7WXiZwKZ9HWG5d28\nUlPbx201AEu85XogSqsirLNaT5EKzJNl136XQChyj0YV7w7gh0JUpwcpkjgI\nlf3tjlimfHAyWORZ8X1Q7RCvEJFCqMtC9O1AlWRetPQpYCJXntigsVaT2jF8\nilh0yoyfZI4n4C508hgApHpQU2Suh8VAFH3Vn/gCYJZ0E1v9jX9KhX/mxeMI\nSG4CRT2lp0JOsGMhq1JwLb+OH+thqW+6UX1ZGXkOo6BG9Mh9xj2bXkltkfI6\ntjbs\r\n=yI+g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1DrLMrEuU5NPpQjF+OxKcHb3yBxQyk3gya7b8bPrzMAiEA8bggqOrdla18Y3ygNpBQVmdR8DZb4IBGA9j9Imhmcm0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.22_1587400519118_0.8159812513158964"},"_hasShrinkwrap":false},"1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.8","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JD29o8Sc8BgOgqCLidBJSJmQMltY3rpjs/gqFo4IF0jt6rbqa4aTDteY3ygcKnAv/1SxMR01JMqGh6r75SWYhA==","shasum":"fc6e65aed842e5571f60373917d8c2a5a00f67c1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0.tgz","fileCount":22,"unpackedSize":113797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenc9pCRA9TVsSAnZWagAAG60P/AsgI4fgbb2j1/O2bz7t\n5EixgYaa+Wo40alFrvRphtI4qNfwfGS/I8g7oAVKHcKfj2DCRzYTEDuyPLpU\nR1d6R4JJAhPWmFur9E3oEy+rwCGTR7rY6vOzJTy5Ok9sxJBOqLcOyeguB2wF\nY0yMxN+BQ2tKZWrlExB2cKCbyST+fTKx1ros/f3asUEYJ7/gTtZYTid/dKtd\n5muUw+ZV4hKsWwtEayX9WW+Bl6zQgCc34/uhHhaJafMON0anOq5hiEMxG/xL\nHVZIFEi2nar+o1ykQkbnVgVAmx7zt/LVkNECCBEVRdvWzqVhaqWdfnG1XXiE\nmisawWl8MOgizOp7Gk85F8mO339PfosaPjnErhpGH037xUIkAbABHX5Rs5h+\nfqSz2FNrsBr0i/RqrNdAiBo1dDOY7Ai6XywNZ23GhSDVm82YMlIbIHepccMJ\nNkgyM5inxhKAol+sl6DvWCEsIueDkfF8yhzM4HDm76vAOFfzXEw8quQBTuTN\nZcRLGwlWPRfzCT5g0VI3vw4M8lK5ygfGbOmRHJHRwKPLUk3Vy8AQvm8s42I3\nFdJ5YiB5IXL+C06q3C+3FGzGJ6Hl3ZQxDG+sUue+shLcl49TJHswzvToNdsV\n3+yPb6cilqJRdjl9ztfgZAHA2knv1/I4ccZQzl28jl95fxqgr6E+04ARBYW6\ni+B7\r\n=+ccZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSHDinfnIYaitqrgXyZHRYT8AI6GchVTK0zzGoT656SAiEAjltFgeD1W/Htgsc/RG236CRefpTf6RyFo6N1qYyJAOY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0_1587400552654_0.09179072316382086"},"_hasShrinkwrap":false},"1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0","gitHead":"c6c2d54e1e6ad46a404e504c5c63900427e2c0de","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-q2RZGzSnBszSSj658kE77XRdamNUPiwVhmtnrqHpQhGPKv0yxdoucDYk+TgD9kz70/XGmbz7XwEQi52wYYEJFQ==","shasum":"d483b4a909f124924f59dc22d3921bba5649cb95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0.tgz","fileCount":22,"unpackedSize":113797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenfrQCRA9TVsSAnZWagAAo3kP/2TxlNLPBfEV26wZlhH6\nAUlJA2LO5ItmxvE9OwlDEFjTHOjFCJyaxrshYVmYIkzzsAw53QdFj8OT1BlF\nlPQdWFCRTRPQSHQ+aJsNjXwl8vMmsWT/OJRlVEoijmZIKC/3eYwnEVLg65YE\n3JmMzKuxf5pZIERFRrCj3VOY8Fct6XTN9XF3nfV6x3ly1zXLDliZdeO8VOpO\nfG+L0kw7Nd6+thIYVogq/WuOJk90tIghlWIAa7GLFlE7rHPhDxuDpMQSgYc8\nJBcJTwRYmssRFbTJp73IR4hGqvXqmvcqXl1wjWawfs09qSjHsLziFhss/PHY\nn0LmAge1hb2whi3fReNMht3jyUxvJAyGlCnkHmpAIfShzT7TMlemivOcT/dV\nxsh1rDm5smXi1FcjGjfG6I1SSA2jxXN62u4I+D3DBACUU+JPZNKaQSe10V5a\nDYQ/xRJLAnfZfE0ZIdt17X+XPX2dX12As76Ptoy5hRBrIfBoOGOSv6kgnm94\nxa7dLXE/kJz0/bmB2uZu1Bl5p35AIxBz/nYmCcvy+Ft2/UFbtRpzndDiC/b2\nw4pbSJqHJzBaW5NbfqE6VCZCMHigfPKns8VJ02KkbIcsn7det658q6ZDSQVQ\ne/0vGNMwXa+WWud2z9EreDpl+vBT/6ccnGexI8hqbuiM58YiqSG3uRyLrQPd\n/Zut\r\n=SGYt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDprvXazMkeBqk2AzhwSSn8z8eXL0jJ71WZ2ltU6K6ZwIhAIjf8t7/0J+rphneOX+mSfJR+9/Tw9rqoApa56cb+qcG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0_1587411663794_0.24580007681662686"},"_hasShrinkwrap":false},"1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7bb0761f8532984d5f54cfa8f021506f2abebc85","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5PvJaRFTaPY1dEiYjiupg2nlvVLo58fYVltmkSHbXlt69NV6C3qBhv/iLtH4p57BhuITNFecoQeHoIv4PaF7vQ==","shasum":"6018f9a6bb69ed11b7324dc764cf5354b2c0bc58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0.tgz","fileCount":22,"unpackedSize":113797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenfsbCRA9TVsSAnZWagAA8PIQAIfXKMsxpOv9WksM74B8\nGll+F9L7uPXS3w6Rm+syja7R8rwQ+giYEZTorVs0vuggTSyFGtVqfVlFIWsA\nQqrMYBlsxfr5b7rDtpYTIbkDadnv0Y0fWOiYIPcdlUav2Y8rjnNlEsSToNwo\nrU2ob1XnO99iob3JZS7fMP3iTT0UIuD8zrmc5rbKcL/FsHUvqIMN1R33bjpi\n+VvSE6R3uVbu0wQYMYkQUNMiK/Blz3NPFZRnfk/S/SR+H0GxC6e8FDo/KfPl\niOx1C4n/z3cRnRTpDqdSbxdmPdfPtfYnbPyFevwpt7CQaPMurXQ5+hMAq5s1\nAlYIi4QEp4tfpUaCPBk+fHF7VH+6z4d9rvwbj2wjKQmTjZVHKjMaJEzzXvi2\n7hqlMtg+0EVySOiMLvw3oP05RZBabkGrfZ7fqHa7qFVTbuhEcNVQek/NuCX9\nY8B8Y8QzKsvQvYpwHH5a9JH0L0qjTu0rjl9aIF5NSs4xGZyoXREEor7UTBcs\nHOWaNwllV9DicyopN/yhC1NgjOM/R7QJsUX5/H3H7SjLgdixO0FvQd8ZCCyr\nxduo8m98benFiQoJSlgns2jSlNawzwmD11eejgaMFLNUYtvDU5MORIPAZ8Dy\n2Ezcl6qTuX/+dHdeG8CWMqoqMtCfFtr1YMjc0tPvn/ikZlFXfds6xk/Y6vCk\n+U2k\r\n=qFj3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC98lN76e/10MDFS6a+0FtePshU05kTxJTGOLtHqKiKLwIgHSqZhRUrFh4zYIO65TNVwi3Qdeiyirk6xXdAtjh+ieI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0_1587411738774_0.8149571682145975"},"_hasShrinkwrap":false},"1.2.23":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.23","gitHead":"4f96af794fbaee20b228d670e0df194189850d4f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.23","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3ZzYQl59R5eBnB/Fa362n56UHsx7SllSVvQUy6iqMAChw/WqJfan9wM+rH21YSV5yCoKba/xiy48/QgCnviaew==","shasum":"8da8761e4de071b0548a23197fba7fa2c5856283","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.23.tgz","fileCount":22,"unpackedSize":114046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenfsyCRA9TVsSAnZWagAAbZAP/ApqNXkfXiUXnGcBpHL+\nKOSr1mcDF9uhipD+xe3s5Kvf1nh+0TEV03Z4MvG+AR3k/k79ey9UWXmLO+ut\n8BVgVZsh0gviJsC6jiLY+ReVM1HrOK59f/48w0JkX1wc57nxdUIUKHwdsMOK\n4UuG2TIWgaDj4cCnQfdvFVXpY1O9pguyS3MJgRDdes1kz2iiES+NtbiR66uH\nEN811tOIRs8ep/J2z7EUHzF3P7ZgjzqIN6+8GW9n0Jmb5AGZBo/+6dhmYH+p\nEgghaavP4Ldq0pBixCvaU47SPdv0xdoN2x+DoeGHRBQxH5IlX5dFKSaRW90Q\nYKyRQxCLnAQlwLC+jJXAPku8aPX5KZ894Cmj6VkK/ENe9oX349TNiAxdswRE\n+wDIXKQf6H5ZsQF+KaC/0Gw16NtilqbQtlOnCEtdBZ8+rWPIshktNbmks7X0\n4W2fBWRrqud6hn6N0p5j104LsEzM01VSsUjhm7p+a0QQxgRTfabx15tv7CVs\nunStEEDXUGYA9d+ryST/7Ai4tddIrKBWj5t98C/SDi/mK59+be9YucHMJgZR\ngj7zupCWXX98bkfZeDAUavYpZu+eyVEQaUiL28vK72EcZEDggskwJQiodUfP\nPHl/Edo5OADH5M5CWpqCtiJq+8IfZzu/ABhilGmCWdXtTwkBbu+iemphtFLt\nP2gi\r\n=OkE+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiYRWxcGz52i+AUIUBgnXCMQ90XfhZhc10ycvckBoI7wIgZCf7R/gobuw9qy0aUix8MlSKv5WD4MjtSgvCVuAG4TI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.23_1587411761805_0.8195158527052975"},"_hasShrinkwrap":false},"1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.8.2","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4f96af794fbaee20b228d670e0df194189850d4f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gX9TzxOJjpU+jWQzlh870AqbwZkp27KiSGxecuZKrmmA1EXfGSumYSo5bofhEgwF1Du92Un3jOoFOFOa+4FoMQ==","shasum":"fcdd4c50546b6301494b55cf6f5545497ac94d17","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0.tgz","fileCount":22,"unpackedSize":114089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenftQCRA9TVsSAnZWagAAWmwP/2c3WHwpzvcnyKaFaks7\nK0E1uLTgql+/tv6R+S8DZMIzGOjNY3hKtZ0KSKWtQgj5Zlu+9rmJm+xK11Jy\nbAPvajbBgX2BUCtkkCKwKaIyO+h8YCQCG8RbOYFZXPA8p4/v2GdXov4/Z+bx\n94SzPAA3hYIBPdiw60bNAn/cf4zR/Mzt1zSsP9hZWuX7f0L1oHXI6dAQpxqk\nogTTQ8YiHROkbODw5PazMnfpkhTJL8NU/qAu/HOFpyv9L4191HKy6XpF9yc4\nIfMWXuxpWOo266h50GZT0xX3rK5ddgfFJtdh9qPSji4pqUIZF/zKPym6n8K9\nIbheE6rtq2x4Fl3DNksbKunip5OV634+c1//e3BeRgoREhjZ0V4R6Hai6v4t\ngpjsImQSyHzp9GihnSFbaUHFScukhsUu73xvBuOQTa+pvHN2MkqsBsvmrGOC\nEZWSiFyVsfqWzj2Vt5J6/7o3E27i/fMqZ+XAaq2jrI1h1hhsOh0rQZpxJxbp\ncNPlCRpm2K20agGhSL83g7wMbpN/4PEDYUOimyJgU6toVuOmGEblP5ecdEqE\nU3HhIzJ2g6bQ6EWXFo4FW27ViKvrI3OVV8EHSqnh+Gcl4zxG3ETbdqExiwMU\ngRFklRV0c8zjnsZmJ+RLpN10GNk0otPeMohDnrLuvDK40dXB1CC/meCoxaJ7\nIA1o\r\n=fnCj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmUZ1u3OyrqALChC/uDJVLnAcvyyhWmW1taYIz7RhVTAiEArZ8h/pNyz2CtPCPAol+8J40z9ubMAlbclxAInvt+ciM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0_1587411792064_0.6830072595233847"},"_hasShrinkwrap":false},"1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0","gitHead":"4c2101a8a05b60c3ecad6c68c1b893d7c02812f3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WIPrSSfSrJfqQIfC/BtqsX8z1AvjlzUtkB3yqYO0RmawKdZmjJYwgjG0mdQlIwhVTtITjYlaJVesZ//K4QJltw==","shasum":"097d5c918f5e34575a4bdf242d111723c53bea55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0.tgz","fileCount":22,"unpackedSize":114089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJengeWCRA9TVsSAnZWagAAff8P/3/TpVBn4Rb6QajIbh2E\n7cTPGDhofLrFi8FkQ3VmTXXefycyK6kM7HUSiYUGTW0ggAKE31WNkxYEUp4k\nFg46C9nJ+HaqHpqsQ7m2ytiCo5+x70ZrWcQT0MDD3G5TW8LnEFWoyrUoz/nl\n6bxPf2qwgfBOqH47IfcG7weCIIMbMcHl6b16VHoKXyowUy/nZaQR2bnt99L/\nPkqIdWHDL9Nx7v7C+lH9j3G4JXO5u2ze0umQjXTo1IkS0z7MwZ0NmjDeDgGR\nMZqrcirrNDfuuGMiMPuRZ/nDgc6DzgN5naLm6HU6iy26NvX9zjIKiafaaqTz\nuy/bRD3xYIbbAIS1SHoaAiRVyJoRoTLtthSdO34MQCgi9HUOVYQ13jyCj8I/\nIkTbTtmYBtB3iU1NJr3FcXbB26UBVmlYZmibZ2ldayL0++7iP+56vKL7EQPx\nWEwHosgsurEpOb88RN3ykW1OMxnZd2ILvE/CQ+y0nSaqfCepOnHoN2XrYa49\nUXnEL1TKkDNL9B6TtrKuc6LlWDStyBGBGpup6WQBXP/Pxua9UB5paDi/5qBB\n8ZJa5LHlQhw16cAecMnqNZMxcjm/X4dWRB+XYh6XYSK8O2/vIqgTAJpvmRPH\nQkEZ2OOiGlsvLVo2afyvkb+GtYD6PjfNDDerAu5hxb4ZKvEdrW+E2GNr7jzn\n6Zyj\r\n=kFej\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/6iwTZQqNciZFEr1Srvuxii31v8ir3JuRdk6+GFyRCQIgGYnKbs4lOF9EzaRS+isLzOH0MdpcsAjQ5SLpGLLNv0A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0_1587414933405_0.9277790313650727"},"_hasShrinkwrap":false},"1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5418b9df7fe8761af0be5404658c40c617aceaef","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3dJBBqgE+5FU+zM17ZCmnqqrOb3nyaJbIBPIVYE/VNeXvBDC/OatGaUkB0Ydu1r37F5yhAhBjj8BlL/ZCC10Sw==","shasum":"4f10bc69edc225e1504592e069542f892f006b4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0.tgz","fileCount":22,"unpackedSize":114089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJengfqCRA9TVsSAnZWagAAeeoP/RdEcVA2MKo61M0p5scY\nMlsJ/lbBN3d3jHSpRjfy5Jj+kTiIAFd6Fw5Uo38jghIfgY3SCtyD8Bux5/rY\nDYVAsTxHSfue7UXdsExKzLJepmufdJsm5bGNqMJEl1ezs4lMiSjsUkp35xTl\n8g4O+XTkGKHvOd+q5OtduuhOSE7YLir6KOlohnOIZ4CgERmylY0FWDCYNyP3\n3Daomre7dZkA9kp3JejGNb7OdvO8MHqZ6ks/YKMpq3JCHayr3s+v+BiE+8QX\nRo6N4HXDHbFgbxikAdPPyBpXu2HekyXE6BeaqpGHCgsoiumiuUFtySPOtXJF\nUg2A+SdgdygMm6QlAhOJrUzt7UBDl6hIprfQ5jBu07eEc40FNrYBZ5mbXDvm\nVBaW8TqLN751yDeO2BdoNXoOFs+aVv6jzKrvy55WekqV6vGaANkq5DExbQ+6\n6UrifVC9P2UndHXDMt7YhPvw0J8p0Zx3BXvqsWL3LZuZ4Op9NsN2iqsD4c6P\nijA1MVzHTrRSDa0j9TTzKMKPZ83EZZ0mJq52+1+4MCp1HjCeOGXIBtjpAkvF\n5MncBxGulTLzn3EMgdYGGMGeq2f7r82ylZ07qfMDNuGrG7p32X6roRYM2M09\nOHzxj1FYVcrmb+rnLYRHnwxb6Soep+alCIYbDqB9zIn7sEzvSyWlhYax7kfO\n5BkZ\r\n=spVA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjwqVS2abj6I3NfEEFPa5wy4JrO212+ST4QhduSEKvbAiEAjSWIoG8+D0DMJBCDOrSL6FGb76+s63epQeSwX3Omj+k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0_1587415017758_0.16596081732869172"},"_hasShrinkwrap":false},"1.2.24":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.24","gitHead":"2fb5fad5cabe44c95fff540608a06ae896f32dcf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.24","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f/3thZzVS0C1F9d23ps3B8wANWOUPRikH1zJbSkD1f5rT5VHlRTCqli9Ezcux72SkbwaNEYHzWn3TJ1Oym80aQ==","shasum":"e22eb4e00a26dc1081dc2ffc6561b8afc5417216","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.24.tgz","fileCount":22,"unpackedSize":114322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenggHCRA9TVsSAnZWagAASuYP/1sHKqe0kgKUJ9OPWoIc\n11KnOGOS6IBQxNDFqPU4icGU5N56qZYUDKpWtudQwEuB7TF8ncDOZJCni0ak\nd2XqWJgtW+D0e+SmsvVReBe/JEE62lge+Nqfh0tSgMdLWOQ2wt1T37KsA9+G\n3olUvvp35bqTCqQsOWhO9/p2X5tTtYFbQ85eFp4ToHpXp6O8SAX5vNL4/y7K\nD+aMPHfXh+Blfj7QiFM3QfIfbn+XPlZ97jx4S65dnudqc8nzl1sFtyQgMnXn\npmyiDqZelpvYFPRYT13pcpN+G6ktOzxCrD8hDxff/l5gLnpO4K0RqMos3jd5\nIfSWhsVgoeuywd1Unje5CvBGLcphHCX9wTzO79HITuLLzeuhxTcObslF6cW3\nRQgd5dLy32EgZ29/mNgRagAeuh073k38EBjjPhppPEDgh8nRXV/nrkb58zWv\nWXWTD8Vwesfn9GivXdlemsxQND51K0J35HUC3Nxg5blXwyWXjDrXhcYN2u5L\nf6IcpSj+TKIvvI9xxkJcuuvYr06lat7srAiuqO5Ayhz/IAzjuiqTsnkTAch/\nM3GuII383TmgZ6GMDhHLuSzQocthbq9QErp5a8g52l09N3nkHb8x7XO0HtC7\nnNBGAdJX0qOl0kinSL/9evWkHjH8yuznBGjPj0CJA6UWwc8aHEFUYnAl+Cy3\no1L7\r\n=GKU3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJRf55xeqedtGCh4Brf1P0lH5pqV12ZQF6RoHemnER2AiEAyS39oTuiLVKIVz2DsTqOych4t1S/ybHnV9P6o1cAv5U="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.24_1587415046814_0.27731754485631543"},"_hasShrinkwrap":false},"1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.9","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2fb5fad5cabe44c95fff540608a06ae896f32dcf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XhOBPMkNh9mvVUEu/4Q2+I8n+vuL1H91TMroEEHQ6qvsnvYsUsNe/pipa4JbxjAGUswDfomvxwBULp+jSf6ALA==","shasum":"37b6e46ec016992924952b0f9d40f52d073e97f6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0.tgz","fileCount":22,"unpackedSize":114365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenggnCRA9TVsSAnZWagAALZsP/28fzFZsJ7ZSRONBFKfk\n9v9anYIMuTlCDmvGAe+YhbSFclCCK668vgfPN/5a1Nuey/Ci23DnbtHxoEkn\nC15LvhWkuArhpBjrPKK+zkfCVaQOSrVZ1btO2T9yAIfqlo+tF2PoSutyhwnn\ndfeLiUy4idgkHbXxrS8E+GBoYj65YiPOCC4dP9PPFMEcHPnqgBh3Vdy3ea+9\nOerm3xgH/2h42B/wZsUkppE/3ZtjC9cAXy/vzSe0NYm4nXD17YEaQ4Dk736D\n6jubldSqlVmZBULD/NN0FCBmKF90CF5KRcMRmBL2LGgj0gcUOoAatZYucaAt\nEEw4Ax2AYHq+Y49XhVHloivQGUsN0vfbjKmkkUHjrAeLmQsFQM1ldGvcmEpw\nGX/4PkDPV+/fb2nsfHVVoeLc31UhpLCrxIaWiK8syWWviyrRjQpA5OpXqVGf\nuCCHAX5ap9xkgOfXsIAM19wfQfXnebUrWVvU2ZAArhXjAYd0YpOpovwCAhX9\nBlxUmiVqzHeAoDKfbMee8l0bHw29FZRBSEJDOTMxVUGWfBUTO+S+uGX0GO8G\n5HFsfCX4S2uu/hmlC8Y6jmLye7V0mLzmTcuRGHe0BKdhXMNXjsJvBviOku+Z\nQN40CUIyZVcBp9CJ4adc1YrbVJaI+vm+M/Hl2ofmk+Aw2QoouAg2lGo3cr0p\n4lWZ\r\n=tEyR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGb51GJeLOzsL4QD+sqTnChyoTxWdqpz7X84e8tkiLgAiEA2ugsj1sRgicF5zdyJLilg56GUUKTrx9z7Nx8yThXoVY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0_1587415078667_0.45235000475353115"},"_hasShrinkwrap":false},"1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.10","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0","gitHead":"922c8e91452bbe1214363c34694acc21cbcf2266","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uUeVPNpJm3cjvWK4epK0Q09QUz4IwaLewBiNGIKW9fmnibYuQK9EPSdLc02ZuOQ6o/acyEKinRDQNJGxF/92Ww==","shasum":"36ae4e205da4ebb92c506b1fbb0e6fffe9563c94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0.tgz","fileCount":22,"unpackedSize":114366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenqfMCRA9TVsSAnZWagAA07sP/jAzZAHYrzSsECk4+t/b\n2/Ccy28TJnjUK6HhDqM4ra94oLm16Qr5JG2acip0/vkXyFpA2tlIMX/vUTdB\nxInsSxFUD4GLyjQaW5Y3rfk6/E7w74i7Sz4Lxh7Q/YM//sEu5kaMnXf7F8FR\n4Pgj0OKxdNKzI+Pkk6c74dSze+pWoAaYfec+VfPsPKxBn9WK1v41Jkw5wGyd\nrZvoCiGchtP7hj8w70GhbVdY7Zagf+tBwQ/ysDVHMAk51429EBCeJhqh6KQZ\nkCgSCJ6gZe+3LquKc4pj6N1Ez/LInd45wDBDD8FoenwC8b+sLFHhl4gPt9st\n070QfQsPBJf53Dslc4c0usl023Xw/4UDStpJ0+m8wkK4l7hQRpHdyRo4c2qG\nov+A3aSJXPFaCU8Ye4Ot6EHwqAzGz6ZiPD1XjTJshiEACvB9nWdFWXx4B2gf\nmRgI4VFnbmDoAHJLXPJJEuUHCIBYy6jN//Cx9dPIpkhSeJQO+iTtpLvLdMWe\nZqZCUCbA5TDYbwz8M5ZmzKikzwDnlvECeh+89EYDIQe3hqPbeKG6pfmBdSXq\nSnkp4i2AvzW6tZeV46N25v2xAy5KjBjgstJzlkQ0msiDP7d9uFqy06iFKrjJ\nOsRdcN9U09ZZz7/MT1HgKwb3YOHtggfCvPI3+kTYQ8iJBCVx/jLD53gw9CGr\np3MZ\r\n=Impv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxpCfVj1UzvaAwf7YqjtqM9RKYZsWMTccmXQYxawMW5wIhAOPTnYzLE1GzCBrscCihhKPyGEtEs1n5wIMDQhtSArVW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0_1587455948170_0.9015166064180677"},"_hasShrinkwrap":false},"1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.10","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"de1e5e511a46df0124e2399cd1fc5acdf728c84a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6x8MQn13XxKLOyACMVBanYr1MclGrv1/syz2t5HiQVqVx0j+rNRtKf0zfLYkuKklCdahnRXlPPu63txaRsvL5w==","shasum":"70d2f215c24c8009b0736fa89d91809248d5410b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0.tgz","fileCount":22,"unpackedSize":114366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenqgXCRA9TVsSAnZWagAAOXEQAJD2sph6ykmMWlLKEKfy\nQKx1+p9iFih/lDXYOeNww72DcsuDJiqjzHLMbiBFEPxC58qUJTLsoLkNdRZb\nTdHv6OaWCeAeBazdMmot/1/popgi8gBX2l0DyTotd1CIYrLM6Pmxjuvco3eD\nZP+OlK89+9pyjRQGLwoS8XlOV3f/xjLtszGyr+mDBk70m1l70t5XKcZI2LUF\n6tepMPQDtu5EOhW7XBrtNeH4ab0c5vbMJ8F7v/EkwJRrhi8ia6XPRSZMqGZa\nwf3AHAqGrQep81v4Yf4fU7uuda2D8sINqBry0kM81NYDn4yrxrUr8eHXwUFy\nQF66ofilMPLXZTgexIiEzNYZIJXouedY1SxCGEwph4NehJGP/A7u8iCLGiB1\n4FSCyVzm1ObzzjOh+bnJgqIfG4CZA7P+265kbexMuP3dKuinbz7kSNiBjvCQ\n2yNKSra5A27ALVySZUBaTvDL50bOhahihKaGJojaL4A5Yl/pz5SKx0VUnvWH\np8q5IFwzRJPGuKV9IrWD/NrTeY94oue6UuaI/TVZHju4sVt8q92vzL7wDgiJ\nTgTeK3g66rhJFPL+KuVSGNKY7SexPEo3c4HfLdhSWUenMEB020KzNI6034SU\nbAxvNgTa4DLTMfXQQWYeiq9k5Ke9NPBJLJjsl1ijn6AO8OsW3bWGiLqBquY9\nwMsL\r\n=be8A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJrmLk9PZYxN1PCdTktgzVeIadMRWjyVjsiwa3yQdtVAiEA4KPRf1LxkAk/9pglB+UuAuCQEwSKQvYVHe7tCZTImqY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0_1587456022637_0.122022742831156"},"_hasShrinkwrap":false},"1.2.25":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.10","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.25","gitHead":"cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.25","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-X6XWwuraVxgQaY2XCCIvf+mfAmDb9rKIs0O1/OYIsVNFIKSMP00erCb6Aei19LgNJDEsxrafnoFjZpp1FmQcHA==","shasum":"33500363859fd30be4ed5f6a28c0e5e060c91258","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.25.tgz","fileCount":22,"unpackedSize":114616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenqgnCRA9TVsSAnZWagAAW2oP/A6n4Ck453JcvOaE9HuQ\n/QvGfmN8aZq5OQblSZGt7wMI0bda/otGpO9V2VQFgpzL4kBsZTrJRKPX1d9F\nQRf0m4e2LodGVknLLo5wMzYSgVex9rwY5NcWghjYjBsh3F/wDNSze/Ecopxa\nJ/AklP3aZ5zbYqmZe489Nu3LUNoP5MKtjJHx4k7DIgArYmp9kzBlTBEVabjS\nsJgBMIuBHvNPV75VnRXbuFlJevV7hWzJ2d5LCUl4nD0LWyi1Xf8GhdqAvpj2\ne3LaBKkuYuViADzNCkYl/gsiZODoNpOopxMhzxuC48PbPX1asOf5fSbZ8B4X\nOntSPrTxCH31HyK/BIiGkN+6LAELUl6HyUGNjtin2kKABKYkm6YyzWOMtbke\ncgMsm6TMUlQ0O7Bq3qazRF1izNG0ZkUZZoSBjxfytRXt38Z41wa1ufbCMfXx\nBxkQ8DeRjwFFeW2636PKE5xgMFTdUVXhnm/6Wg8PR3IaDVxGoo0im+5rShyP\nurPhqy1LHXhJT7+ZnWbo3whuNydg7dilxifs83OfQH+B12jCleT20Vz/76Cg\nixrR4FF0JUcdjeXhTdNGrFmfHQStFS3U1dMz1cdlni2JIZASZ7Li7ktgrT6x\nDV201tOfC3MCT27M45z7j1M+3ZtM66toHRSqK4LAQHhpfQoIa5AJGPEvMCmY\niFVG\r\n=HlZe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQmvUlpm0WYEe47ASoPH0/k5fsyCIiHoHhTVs91UQZ9wIgDawBvhKfDFuor3e71f2LMXiMZmH0rK7FleMaqYI8CQQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.25_1587456039430_0.6437216510252111"},"_hasShrinkwrap":false},"1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.10","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8fEI/IpUa9V4EXAmA3CTOkq9Eb9JKSCTvbqhAwZDBxrUS7dBVaOfNe0LaMXCzFizeUulKrmQ67mE5BBN7soqTg==","shasum":"53e1b810aaf3630646d910f78ef4409e3dd6f318","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0.tgz","fileCount":22,"unpackedSize":114659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenqhGCRA9TVsSAnZWagAA4tgP/1LXTtJ4wFBncVqYU5Ab\neGq/2YPBadC4F04rS25cpnJRCOlxpNhvumztAoYL5IBbMMGEmZMdoqTY3zdB\nGM5cK9+bhLLyAj3kjZHfq3rsne1L6gI95bGp8YhHeBpwGE2pgDSVwy2QtOji\nGV1BdrMS3Sg5zBybaLANGC0pH4Z3nxpzE11OTGD6WU9i2zRN2DFVtqQmuFqQ\n1b+qRPx/WzcvjvecA4yXV+QTimcjt60FSNnaUI+R3Twby6rEadszNhMEkGco\nZj1rlzB7hJJsbe369NUgyitUURyjeEsbwanpb6BGnvEOOkUkBjJ/k/WscGH4\nNBGDL5oVvDkGGMcxWw/JBDOpRDey3Cw4MHLrJUpOxi43PfMizxcLCpHgjawD\ny3yzBe5QjJdf5fvg5X0o4+A2HgRNbqpIddSGIBIOaWyHf96hpm43PuasqXa4\n2OB7IEbAg2LoMKIX7QGkN8K+oZ36RAt0EcAyMkLDepDAsHPM46GgykjTqNF4\nNj231SQeY9dyX6D330SFvj2I9TCQlRO90d13Lek/7LHjFsRwvIaulkqZOaS8\nZirGEDQAcQ+GftO8yh65jywO6urGwgA4GlqlP7VdgZd3Y7Ah/GY3x3scqOdv\nPGYqmjQkGdDmHfpms00rejMaMmn3eoQC9+VlXIcO4IUCUDh7fbz+ZOu43aR/\njV+S\r\n=Lrdg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBiDhur0Re01cB50/VycOsb3TWicdWB0t9TQjqR1JN+uAiBEvjDtk95bVQpiyKwzIaxz5Mwj7BD1mlcDeapgeEGyhg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0_1587456069653_0.2140709734197206"},"_hasShrinkwrap":false},"1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0","gitHead":"45116d564650214bc9140cf6cf5fb2c29b60733a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-B1Uf+DNkLAhCdxxdX9GdsQjPopX2njKwYEIGP7/2BlRNHeonuGNn5OllEV4C1O71pbB7O90TXpy2lwUDOzrx2A==","shasum":"d600528130729f68d107a3a6eab9b8253e4b4e89","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0.tgz","fileCount":22,"unpackedSize":114659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenuWECRA9TVsSAnZWagAAeFwQAJODfgkVAxqw+Jq9N27k\nCq6glseyw/4pMo+hpY5Q3oy8dQxiMapaABvYvxjtWPDh/mu7/5hqKqc7He3X\naoGOa2QUCMk92ZALjmQ/za1iKRTZXcXW1ZSeisk1em6wE8McraD+Xft4MXwM\nL9UMYse+EpxXKZV7u4sSdgSlZzAoJXZ/HfnT24bg4Y+Qy4e7tAGqzJKLT13m\n6tTlBhZDdJNEvioNq/Sy8akhDGYyDE3OPA/qGItxgFOFvdmwK38LvRctcH63\nCEdzNyaH4TddjGLM1BMUA+iFNGKISb0H6GMv0/SQWMKcTStimejyK2v42XUU\nFalJWR6M6cHlXEjqm8i55bKzgQyvKEyQ6eUPSVX70Uhy1gPJDph2PS2t1B+m\nWrYb8Lmf+f5UWiY1WhRby6elZAlBYaKBqyTNhfIw9g/TgV9qQeKDGBWWAZ4r\nSwKvv6gxmXnhA270Y692+bK3H3IBrxAJCrwC+xpVR9509iKkWZiSd4mnfF6+\nP57lOFra/xrMfHkdPsoWDru7v6o2vo7XxOPOUaCuUQe/LytnWrAjIpsVtY1Z\nDBM6n7D041gk1OAx7UDrSs9Se+6tUGlshxaMH/z7cnXYeyakhWykbBPRRbaX\n22u2P5+9GYqgOiHGGcMKBSwAGkfY55bhQIx7MTdDxJKho1Ef7Y7dx+cr9iIu\nFUel\r\n=zag5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEu2k4uGW8bwMQCXi4Hw2qSOFjZxqE/Wc0YhcF9KrLSwIgcfPuahR3//hpm7SnQtPEuCYQ1sYYhczLons1olUOov8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0_1587471747432_0.30142171260658346"},"_hasShrinkwrap":false},"1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0fa5d53aab81e1209c6ab72fe3891ddda858a2a2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HU8ItYUfw/Sb7DKvLeB+bfHQMtrI3Fk7LGlMOIbDFX/KvRw0RbY2xf06ZICn6R3IUffAVoYUS54Ou0xY5fyG0Q==","shasum":"7b1e4782da26aca54e042b446beaff0fa6aabc69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0.tgz","fileCount":22,"unpackedSize":114659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenuXCCRA9TVsSAnZWagAAE0QP/j7DBSwrV1fmntpHZ2VI\n9B9XPArvbgEWnx4xIfqWEJpcKFFwueR5aP6rdt1uuDOzAK9htCfjy3thnaGR\nUbUfYTZHzbp4Fso/DDQ1Qy9IMCG1FJhEy67D8lYXEnEcBfT1VF6owx411+I1\nh2kjIvcOqoNiQ5/6/a+l0oI8hJ10bqfkHRiAseIZvcm3iLYEFqcDCjl0sBN4\n2IE4I8pVvL0BHCI/rq0sgeIsNSnlcBDDh1Jvnjroomnxf5mSQ3/U4XgcFMH0\nWMnuU+v8sBJlDabn5ijVne0IUXLZmFrh6O4yvHT51cblnK+DAej2SAWLklol\nWOI8UPTt0IiIfpvgQ+0TRGifx7mVL7gOaX2lCAA2p9A4ux73nAaCxChRXPX+\n/qPOkp3wiQBL722zIMNJPz6bJ1gpTtgZueVMiNbS1DsdP72OC8tcP7xg50/K\nJvkxfJUND0yFdbu899h0L3c1LKTBWE/jIL8TqG+2eCr8icn8QURnMVg74Jwe\nB1YMa9pG5wBoPHwtkmGx/LyVbwfbiL6ERklf26x5+xy3vweD4Ed1RB9xivgA\nwD9P/q11Xw4yFE7PJ5TRHIKt+T08ubQQ1D4kImUBGHFOadpLjeEVavX40BeC\n+p76Ruce5+3M4N4aXsKF0jigpsc2HLEFZUIcQwKADsX5VjPceRQ+w81hQNnR\nBlcY\r\n=FAbV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa8EF+lDsBWVVTX0L1o5o5eU+zRqWrggIfqL6GDHdczgIhAOwplpZkcwsYU+Dthgy9SlM0pWeUwQuSTa7eniCX3Slf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0_1587471809955_0.7376444047498973"},"_hasShrinkwrap":false},"1.2.26":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.26","gitHead":"416fb9b9592716aba2b1c7785b2130dd91bad73a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.26","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AmmA5xtFvS2QWXgDs5/ossTg9BswuZEF7GnLeifalnY/4QLfaK2t7RrzQP9kjQLQZtB8USXKOwdc3NT2WX3VXA==","shasum":"8ceea66833fd0bde8c54f09fe3d78d5541b77c63","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.26.tgz","fileCount":22,"unpackedSize":114910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenuXUCRA9TVsSAnZWagAAVMMQAJEorSytsUy5Ce2J6fuz\noosi4zXirVzoVIzlG5LoxAIVF1pMFbIVPpG+HwW0Mskam56/17mZzQHFrBdi\ncYe64uxeQmuTeL9aZozbJspTzQJAWm7eAuN8hJyZ3Ldbfs0dO0lt/DRMfGzD\n5ORwThQouBH4nOP2pVkLvmL49vTcFvngVVMgjx3q/ViSrqx/3FSi/MVm/FQI\nmsFBkDcezyL9X/Jed2FzdvhIfQ2sRlQI8YqKvXRfKVde2Cz8JNLaDn7nRIPU\n/QnuejkgeWvgYbbVVZHfo49LTkLa6MkZcvQ1Y3mnytJpAIowQuQxViam630w\neEi1k1AXWfd11jXXkD+M8svIr8N3ySWsiL5B7bZdGuaO8Cjif5bnXHdSAdy4\nCjlrtjNOW2MAjtRKOK9/Bg+M7iOcPRWQQYqNFK8Narihttck7+jWMcWhRo5f\nj4oakbFNm6uK+ulWtCMEyMVeGWj6EyiioUaFHsQwruKRrZibKSNGgRFaai/u\nDYddUgv/k6KQU+1wuPcFZuPl0fqR/47diujKdfUL5gjirg6zqxLDBeASB/Za\neeA/kq1E1HbEVkR/1Y4CTSGtcBuYou2o8j88Guv/gTxOmnPle2CxxqhMPC2a\n9vqq/iSgJChcU3VcKMtiraOlDEhLLHEbyyGS0G7nX1kYV21TonmQf4CakKOq\nrNV+\r\n=Mdmd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+zZoOALcjSabDctg16fdPiwMt+EyuRPBSkyUR882AwwIgJX9z+mlb1ygs3uvoEtSgC2iyCjiguOrzRcpnSSIDYkg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.26_1587471827626_0.142395256907069"},"_hasShrinkwrap":false},"1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.4","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"416fb9b9592716aba2b1c7785b2130dd91bad73a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1aVOOFpfw7d8c1mniVZhhgbLE4PBQjGO/5uhrPKfGyhSz4vrVYL5pZJIYZFVcI+TDOd5moome80e0JxIyzT3bw==","shasum":"07b80a409948605dfbbd7209b1ff28e6371328ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0.tgz","fileCount":22,"unpackedSize":114953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenuX0CRA9TVsSAnZWagAAe7UQAI9QN1MEjjQ0sNBBPoz5\nJo50Qw/p0jEQBPv9vEjBp+YWQEjgbo/VJkhZrGL0cuNsNzKTE/8M6B+D2csQ\nOGrO7tcuAh2HZ8euyNG/rLGMfV+uVvcCRgTYW4tybK/2JRRdaJbvtZTfj8ST\n3k7p9zCMRgcoEHlG4vbUN1oZOol+UYuYusycAWrCyVyYhC7wDgIiATdS3vFm\n33JEqSaM9T3JIpcmtzF1U0juS1izzaRfpvlKKzMkHinvK3HKQeRwaru8ggOJ\nFPgHZ58CNC7TxP1VYfWdjphG2c7vBGyL55qrJ6vqfTANun5GXupAvxbALze6\nnn14KNX3yuDwuDUpQGGN1tjjZzkCIsayVwuXo3g/EsEOfUtbJTZCgFMptmio\nbjK///Zcymre3M9g0Fb11Vwj3xQrCibIjOta+FXoAQbKYKMbxB0KHpWx41Jf\nKwN9VWQu6oA7wSqMaobLJS7gRi0YHt7zm2x8KlxrLsHoR7SmuxVmptwPrvrA\n08+fQGMORX9ke8QxRIStD8adxR/OW0eWSsNuMcDi29F85yc4vb58hZSbWdL6\n+EMFjaDzjy3JgiV/Q+RIT2PpdDpTl/RL5n4Tl9rGY2eQ1WfUyfSr7QPv5q+t\n5zS2QIXSz5TChcgEabkYGlsz/WK8VJnkYGbPDoRhqlz02xj5jAxFfXmT6NkF\nX4L2\r\n=WZ/T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrhniCp722IFjMTSnfURuXSXiWVLL8zjf0ZzKe9e2M1AIhAJ373Z4ZgpaTISZIeqzojzXSSTtPbWAWeBO87SRcWuTa"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0_1587471860221_0.07203257081019965"},"_hasShrinkwrap":false},"1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0","gitHead":"9286989923c18adfeeb80ac5df6cc9d7b6144c84","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LfpZkl/AgdWWt8tonkHLt9qxxXqjcwloyA3ZmIjedt+XlMtThU+JKAjqLv0PcrrJ6uZOVdDNPasbqAK1jXre4g==","shasum":"2469cd2d8c8bb0be48a43e66cbf1900d51b088e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0.tgz","fileCount":22,"unpackedSize":114953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenyqFCRA9TVsSAnZWagAAIQ8P/3h/j5WWLOaPGWn0JIdF\nGb4bImo0JliSfO++50veTBp1e0NaupOZqDXgHD9jbeSA0AmNkDod4LROtx1f\nBW82z0ZF/lrANvQtH0Y3gKBCNW7AuBWI4DaEp4cZOC42+lZloyv0tgZCERtV\nbeu4KH6CMzFEThsGRHamjW+DPkb5I8vtr9I7tica7jr1tdth4MO+oGfnsnnq\nag7KS+Dr7U9e1Q4Oj2n5GPKn1ejMEJCqIw9NOmeymYBZmE/pMVxVIflbILYU\nLcil+eIUkIhlFj1rlq6FhGQbwn/YEAUdYevz95IeENv3aExkVHWbyhbPOzGN\nHq1MvJxSJsjdsYvxcz4c+/6gXdZi2hNw6sqy7X6F43B1LQzKzwH0gDOnRaKe\nn0mZGdimra8qmKFY8mwWNw+GYQB/ahBpG6iba+fxkcyKqKBm64LvzGOucKA9\nz/dWFXweN6RHKHke5191M2FLPHCf6bArrp3kxJ36YSTvcDySqnWylkRMgnDQ\n+t617wwRmkg8nMqPDcO+hbhlFk7di109njawVTQkHEF7gccldN+g3QyXRhDP\npYzJM3tsnWAdxMyyfB77iCQ3qbTfLdBmuLZ8cfLCHEmVwN1HbG4Y7vDXR610\nzY1xm1Mf2lUfpAdh75lYx2rukNK1M11dqsnuEUChdhI7HoiVcIJNJQMuG/lO\nc+CV\r\n=VjX2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASobkMvTduFE9jhxBAnunmOnaZWYt+HYoeOXPc9W+1YAiEA+LNRdo4hj9ZlHD7zOyE26VtlkGbWg3/cp5caFc0697w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0_1587489413082_0.7625907627193176"},"_hasShrinkwrap":false},"1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c1bb7fed813d6f36b63d5aced12050db5a3b07f7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rr/OcsF7M8WSeZWt2U8u9V9XEKJpbVCiQqM/A0J9ZNAB6f7mAo+Mke1lD3s3NEG0fcTvw3BnDBNjS4E+ZdbH7g==","shasum":"b1a8d900210e4a49136a2a46330bbbbee73f1d12","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0.tgz","fileCount":22,"unpackedSize":114953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenyrSCRA9TVsSAnZWagAA5GEQAJBCTdnPOJ3yqTdELbLZ\n6kINurEsUbBnC17xjI1mZflag+3Mkj7egH5l6dNMU8zrUCmirzFaWYiRGyRa\n34da1dB8cp/OrOcvSzYekYTDrEgBGZh6zDaOjRz33GyWXO48pvAq+mkue66i\nf8nkdnEOWPCKPdjeBdRKu9XxnN1B/vi6WIC9TJJorn0UGx+0uxWUcAayKtfC\nMS5/60MpSOvRAeCQRMpR+ADv7LtSl1puWzVrMgbpC43S39zPPWyPhSLHZNXR\n+p2J+rXZVvQmiIyNDtKlgppyE+NEOnBW+5a6I7ut37SmC+p+InlIAjNxRvF5\n70CV5ZJ6IC6HyCriIEOSUCpM2+azxkkUHUww0NxTEj8UXx0kyPZOfC3VvFTt\n1+US2tCBm9mguWHSVZJW1jRGk8LDeqvvqoi+iAE/J3kl4MQtu3rFm7j/291a\nk6MwDZFLNHzujoEQ3jE/1ACtsrpImayUl9lRCP5b+qaKD02ibuFHq6gEEhoQ\nA0gql9b751sElLQZGcLJmX6D1pPxxQ9kN6G8a3wMqDiO2W2EsVjZYqU0Zp9E\n8M8h8mNUnnmqHefu1Ncqyp+Qs3F9ex29dnW2152udEr4mxcRcJWCsKi4fGOY\nh/rd7SV0biPniAwyBM5SuHH5Qw3agp/kxv/KrqAE0W3lSHRbRPW9BWj5p/Oo\nO92q\r\n=L11A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCes3hmAH+7/wzN0Hq9lP/bCRcq9lW+3DbqO+DiviZF1AIhAOvSpDxTJ74RQYB90/QkRtzMRdCZprnok1Z8fIFH0vVd"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0_1587489490334_0.17238503884738088"},"_hasShrinkwrap":false},"1.2.27":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.27","gitHead":"98d09fee71d9374e623be97394cbf333e0719f30","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.27","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-h8ukEThjg9XFACAC6r3W8sZkmlrwkb6SqLoSuBgNi0mqKbwt3n0SGSrl80CEdrXWnStqeRAp2jwTvflEEmnSRA==","shasum":"e55333460f226085528e05398283e097990a2da4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.27.tgz","fileCount":22,"unpackedSize":115187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenyrjCRA9TVsSAnZWagAArLcP/2fhY5QOmQh4cvuGJVcI\nnJhpRKyHp++6PtiXubP1bBdp4b85m5qfI4k9A2bYVoNPmfLFxRGRxJTH5ELT\n7WtPO77GL+8vXxvpzF7ovKTxsRDH1vqjwaTKt3noees98mXpXS0JT2WMXhlp\n+wrAPGsb68n2EblLg0a+JaY3QWBt1K+t1D+ry4vWhSHInY/+XYrbNCJUtsce\n80EaIKmGmbEoHG2PQns0eKzgXJQPcxiGfBRKOEMFhr+Hiotdua837EPhogVb\nMba0YB0tTQM+g9+K9rV2ywcqJcHl94iIEKx/XImJ2m3rbF5ia1IocyTuFm8/\n7PptiSyL0o4hbapCAQT3506YOiqGqRBuPmcHPYlKtHw/D9D7iCWxq6tRbwa/\nzO7Xt66Ue5hKMDLNPnPzmBcXOptKdyfiFw/Sr2IYw5dYjqn+jCRECIuXPDce\nLF8n6N049kUx8xFN5+RoIGFACFeIxaX2R+LJues6tYoCv5Gbnj4Ti4cUTl16\nUH/EzPtFgjgzxWPscdZjID2XNvq7+1x7kYQ+vhw03fbGEu/0ba+4kkAm8lCL\nf/ZWPETqyXNaN5RvJ7jvrP4kCbtCapdOYajMcxADGBWChWrbeN19yGu7FqNV\nLzn/C3adOFBAWFEAosr24zqDGRFb1T/EbdLWJjeRVSedTUer7/eMQDNhEJPm\nDkK5\r\n=LJUd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM4GVdCIHIjz8G1e9HHuiJdYtIF48LEQ+SCQ2ObdtSzgIgTn7ZXh5R2Bn3KjcghZx9b0fOB7Ib+CPGoktB9spkSZs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.27_1587489507044_0.4373013028091297"},"_hasShrinkwrap":false},"1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.11","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"98d09fee71d9374e623be97394cbf333e0719f30","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GVWByAXaJyUWVxZAIeIs8wqV6CS3e3IaiEWyh68EAl8f1537JREBO7CEBF5HjdKV08DzlXImEdtQgeisanAHmw==","shasum":"73d06faeceaecf3dbad19c86931ae737a6fb2022","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0.tgz","fileCount":22,"unpackedSize":115230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenytFCRA9TVsSAnZWagAAn24P/Rw+IHGC2vm4P1wpPd+b\nmU+QneRp5sGyqofx5D6LhLbHoaa8xN1TzZX8xEbgt8v64M9K89bE81tMKRJI\nGKF583Lpi9o7lL8WroB4GFyEzwWWL2I5d2nb3NgImLHjvGvRWgH4lLHwz6c4\ni8ceaQZAB3p0FbH5SmeT3pJKONtTf3tKvHlLc5DfoP8pEmzVNCpeMGcpX9dq\nvGeK9FlxAMw6ZjXMQ5xteZrCPTwEhwhssnb/elT67o2mH0d0ktAKmFDvW5mg\n/OsX6ji+y+TBjaf09mAe48f6PejKca88kW3Lna8mtBwm39YQvTqfdg7qXljf\nm5uNKI1Oq7yWaAsuUKgkbs3MPO/C/tSVvgo7TRPDakf37IAHfI6bbge+Z5Ex\nkD07py2n4nC5Pn+7kadm3huNDkGCqKYabD1JhlDSqx96/u0T1QeFt0delhlC\ngzTmLNyxv0r4VRkGvWAn57RufgpX31XZYU4TxafnvDHdGlj2ocsGT8EZmNtx\noD63vhd/EYFXJvXZIvYcor/N2uzGM4sQB8rF81tqEYPTa0sH2n0g3kvG2SwI\nFnkpJ8L3LAkgsLPKv0j69RG6c4RC8FbDsENGr582kbJKYKU5ZZyglyhTTc17\nIFy/+sek8cNBWzX2B8axK346cfS/2Jiv9tHxfUMuQOXHothL/IPcSGCV6kOL\nqtG6\r\n=VqZM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVaRhvZ/A+8nZbAuOVq1wqF6i4qLbhAqFVUH/UOFnLWAiBgeWSeB6HPOL+pwobyYTOBcMp7PkfIALJkyhmH1d5TLA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0_1587489604502_0.1764943172828235"},"_hasShrinkwrap":false},"1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.12","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0","gitHead":"e454fc26c90f666447be871d4cca78ccdfc246ff","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BcqFtBXEqrdAICXQsJFKlrkO6czCAkzIwhZxeesMc8fo+a9ak+BmReiAZ7y2EJNCqYzPZyUlckZBcyJL7rfSTg==","shasum":"0b2f61d1ec0975f8a688caf88c529a8d33504841","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0.tgz","fileCount":22,"unpackedSize":115230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzAaCRA9TVsSAnZWagAAvSwQAJwUF1ywyRzNcm6Jjck1\nU5C1N+Fg9+5uhzVzglzm+6PsqrtFGZmtCvfaYFirf7ot/JLUK5BmY27mexrk\nrm+kXShqvG0/nlfslfirStG7bQp6htJRCOvehiskAHwqYikMKOLe9u0xG1B2\nsdMCQ1Lf1tPvr2sNGeEXbEYHa5SyQySTx97YA0Jpm9U90mVsoMkKu+xMH/Wj\n3HzPS+9/EsLxPU01W87DXqGGikaRIv+L85nHZ2I+5lQXzO+bXgVdp89ZWpcg\n0+eE7s+MsNlOK5zsMmVNEL0lJqmrfdUGzotfqSSyPS+VKZ3v6yL7e7OlOOVa\n1syGvRnsVJiZ/+jQrUI6dpc4WBwT1TLNYbhnY6xCgOMovE8aERUiRgJ9AE51\n4O5Gw48QxTs91QAH4fqozPeOSI3nOeKlksx+F+GI3D97ZDIku3IEkDHA1SUX\nN5bTEE8HvjxbasBtx2aRw0UoYN4qhnocUyGNe3tQ061DnYoji7QZGGarQoR9\nXmg6MnAiTa+OpDasYNsaLMflee7hGAdcbMF9TvDezhZ0nnKm/lSVbH6TrtGh\nMSznJH0A7qJIEZ20g2qA1Wfa7GpAqJU/I9Sy6cOkZCONDttYhZnElNO3UwZv\nsFV8L8M4l72l35DNPafm1nn54uqBt01SFOwqMpDjg34zxPCMDTnhU3tZEr2O\nGKjE\r\n=1HBY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa774WPzo8YrZfYjgs9m412G52MD9AYcBbXJyL3hifWQIgSF/APENkfl7apYsLlkEfgwG5yqVqYhrg7CTs6IU6gE4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0_1587490842127_0.45113759152598476"},"_hasShrinkwrap":false},"1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.12","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"87285fa8ec6840d0b562f0083a13c286c47bef5a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ntq+RG9i6uyUGqJNAKe6bGcfH1lm/AHLHPi3VxnBnXHC76nux4kUfCRKYjy6FYluts4838sGNbp+zTs8u5h5yg==","shasum":"f575d73b2f0115b66d757c039a78e807061eb66f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0.tgz","fileCount":22,"unpackedSize":115230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzBmCRA9TVsSAnZWagAA0tIP/23NLzX7CbcVtHnV8n3Z\nfGRuxqSHIxMsETPM5tvel1wBTNdfIBZEFVkBYlQS5o3PuDxs5nSiS1k4t979\no/o4PeGL9OZZqy50nsRoVxF6COJnaSQIIGJkvEb6OMTiigNIPh0ejx41pmum\nFzZaqgbPyeBExnmzHEZYlrHr78Rj5nIjUjLClVJoQTTMKJf0l4JCKc0+yia9\nyuAho4FLX2iJPUgM9BbtigoAbEW5c1/WPsVIVzxD/LcxitcEYOlQ3ReD7PUi\nEKAqY2pQI6dDufsMrYTxhFb9fUIsqsZi/iDBkJDY8bVBudmhPZrgQl0K0jQI\nkjOsc9qXtIBc0Cw/c+/YdFUmwygjE+nlh+6k+T8T/WygojI4ndN2UURPrLlE\nVZGDjti39siih2yPYgp5HhBbSTGYSMEiU42pNw21XHnIvEWHp6bBhMD+cYhk\neCbPAXJbdGsZX13Q7JBl4JrbNdIFWew6X5LZ/XepbURyqMh4PHZyJvmGcJd9\n+VQins+4M+Fr878jLrXUzhzKtKYAnRaqLJSetrRFu0enynjOWkJJpW/4+TJw\n5A0BhopX22nmiCK51hUFs8dwk3lL1LpiH/Z8efawJ3Pe2bs6w69UqOJa6jkI\nxhjcnxfSKt8ZTRu653CFAexMKE++a+Os+ZWbwI2hAqZ0RPvqtrdk4KdNGPot\nR1Oc\r\n=sdG9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdOjaZHwvZwAsWudUaQP1zdwvJ4IAxo0TdDthCEjg0gwIhAIRUUyT47p7v47hRCkClux+fGnKuV8BKBEMbbPej2WU9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0_1587490918167_0.16838732595483252"},"_hasShrinkwrap":false},"1.2.28":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.12","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.28","gitHead":"a61d98d9b2c8add7fc767cffa34980d904e9a3fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.28","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-W8BqzH1qNQ50CT4VXDl48Ot/YatTTRmmZN5vUGcPTVFMID5AkddPoRqeflR3NkueJg1kf5mSSFtcjQKcizPcjA==","shasum":"269f06834ab7b77310056d51a117444c85b7527a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.28.tgz","fileCount":22,"unpackedSize":115481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzB7CRA9TVsSAnZWagAAn1sP/A7oY25pkeCP80wSbF7+\nDeYUcn2KkkNpFnoQ4B41+Jvp7Rb0lAiZ/XPIo4GUOhq7f4OaaoHwfm7FgiRP\n7Lq4NzZhtAk/F0DbWl/C+7CS4tnvHco4bO8uVI+zMazM9U+lWFI1QTB9FL8i\nqvtQ8SSEmjZts4ZvQNUwXABvDSA4vMiVcUasRfr5FHUMEBAw/1axM+76AULO\n4JXSYSFOE2fJXTUHwDISsymd/9MJx6mw8eOZit5t0Q6aExmooQit9FigPWDY\n8Jqj0V6zEukHGgOZQoOiGEXU/3c20Q9Wj5uc4C+PD4ZlsZ4gtgdlMPYPKTCI\nqWaEyhP5yOViDtoWmNyk7233w1SC0E0mcsxvtHCKKx9kbdUTgrwNo+uGx7AK\nPYAmYxyqH9vvcFhErrvWbsue/4hm76/d6WnIigKBHXl0R4vj0rU5OLuBh8lm\nkhTxp+5fLmAq2Ox2rtEAZKIqnsRyZaA0zoxU5hRdcoxt1ri3kbOLr77jFP04\nIEdVRG+dBG5eb0QN9VeV0JEL0jmT5UiGQ8Xw0EFb42aY0chMAAlloaWDSqUi\nPcUcoJPR6mM/w5B0UYeii1zLdsuXqn1L0nsCoFZjloy4+QsBurmGcn++X4oZ\nEulitA/syHbK/hiKR8YaVLAzzN/kNu6zU5fHWMwN3mUdp1fhFLhPtiovftWP\ncy6n\r\n=/ZGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDytLanv+VEkHnbvWoE/TcHCjyf0LdiEvKUpCd+jTgC8AiAmaBc3LrhrjbhnAiWMn5C5+516IiFYbRxesDetWynUjw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.28_1587490938308_0.3080624294141996"},"_hasShrinkwrap":false},"1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.12","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a61d98d9b2c8add7fc767cffa34980d904e9a3fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XmQ5z/qqbml2SNScW9aJCWImUdV4TydaXyqGFeJUL9r6QTBqEJUU2QjDcZc/QPGPffB08N7DoxFstKAfDadCOA==","shasum":"406c412a4b4afac2aa3734d8ef4ea37b635b6722","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0.tgz","fileCount":22,"unpackedSize":115524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzCcCRA9TVsSAnZWagAAb7cP/Rluy80/6QwVseJIOo5o\ndarLwlOuNaZsPg2Os92pOJZ3bf0XwOIJGVMYpGIXhEWagx3kKvUyYLpghAWf\n38dV5PWpFwVCWyJUIQoDv4YxDGz8M3wuYLdTefXR1mLJ51xO0m7ACadKqgUt\n5ogA1qECcwjqxoxaLCi08cXOkJ1j7IuMM78RvxLuQxAhToLaqsPqgRFrJrR9\nCu+Gv0Y6rzWZ+zJViRO6g2aWJNo+sEsqjVh59jFH7yTMtvPFO2ka3aqjVGTz\nwINrjK82E2wCX/yJRNsZc2aWl1ZgQ2UGIPfozUNGewa+VSceBF5Fso4Krb7b\nV6H24y1m38W4axAgRd2emYGlj7vt7EWhDZIcIpw7zMeiVWWfIHCzbYgS4M2W\nS3rb9xkXpuRlHKixRSfJkFL4v4wlQVYZx79WTooXb6PTbjHHK7zTFVKO/ycD\nM0/oUwGbBqlLGoIhLvFW4lOgl1U25rWQOBAghTgVbg4pQcNt+HPQ9eC8T3KQ\nMBvvfJZCXx4Ok8uIurK4CEzuDb1/Bsv0s9ccUuxtNr476HQZSsw0H2DJAr6I\n1qavQrLrMfsuRE1RixF5HHtzGOtjK3tMq0qYLPfcNuo12Ug2e2Cifs4+2ELd\n9OKlDkmVAUqhOqCP0py597XNPtnuBpdcVq5F4RZYljVXeEep1182rf0wW7SJ\nalmF\r\n=/WwD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCh128XtmbHDmbiAwwT9Hmpp8r2IGSKEynAkCCBy3mrngIhANoRyjx2cRWfGk5vmpBocULt9hul4K2rKCCX07fVFAat"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0_1587490972139_0.3128080733986116"},"_hasShrinkwrap":false},"1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0","gitHead":"64a35457f184fbd2132686cfcbd07121d6a2b575","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-J8bGGv6A+UUlP7Hftc93RsPjg9ZQBq8+9gh4mtbssyoyajhyT54KhOBkmNdHeWP2vj2oVgMUHTlLFYmOe3FU9A==","shasum":"f7cf96affde0718d76edec999ef56750b13cd649","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0.tgz","fileCount":22,"unpackedSize":115524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen03wCRA9TVsSAnZWagAA+2YP/0gSkoUbRcSooYCaD6VS\nF4I8GeIBbdCE9rc7iRKlZb8+iYZemVoQwvQIjjPKPuBGFOmAjHKJA+5hO61O\nJesh5VNChKhx5cav2QQsBFmvlbdl7K7DsyqjqHfQgOPPGjSLw8Y+WepQTxX0\nw1ZpPA1It1q8+qZ7EZ3f6CLDTemsOin3mGQyG8Dj+9L+/sPwFY2h4NvMC13N\nngg83Pz7hVUy5jyHsnWaXYAz8nnPyd6UKdrKMhPdGFDUS3cc7PpfIzMlrZCj\n3pn9OyiMqxcgk/9CKQbirgMLQ8X4VA2kHSQEhFpHsMuEMUnG9pHvCW50MTH5\ntArO8xajvawWQe8tc5NMvrWyCg6plMEtzLDlUlbZZIqt5dVzxtWzH8CUwFEz\npm4YYn8HrNKlMgnEOJBzdY0vZedrjJ5aYNwlZm8dCKJQPYmJxE5IJuwg+mU5\nYINpWaV+00kGFD/IRksCVTF4CdMn9sZ9Ho0JbJdmAypLy+wS7ID1yjHLqeX6\nJz9veLyt9TOQ9HZiMc6CdYJ3VzfWo/bymkeCdibxgqjxsdTpkBjRpN/6WFx+\nWb7+87GC0ATrEPI3i4BZ5LxsN/0XZt1CAydf3Px06y/C+fGoJXBqXwKCVIaT\n263BfmGsnH9Q5CVzGrXEO6zl30N7ZdZWOnN36h23s/WI6bMGtQyDNaxdovU6\nPhyy\r\n=Jpa2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGpIMYOTr86bPejkgtTozNIxLYEpInsFdWPysX6HNHRxAiEAkR+k3NJ90yHeMydZga0rWd1HHLRKPoJYg7hxKFFfmq4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0_1587498480305_0.19970629932422512"},"_hasShrinkwrap":false},"1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8b5d6e976f987ea995cdb588a393238451e73fba","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8RiaGpS72NlqPk6B/DVP1NvQEiw2j50AZaC7d8zl2sMuZIy6JnND2pfz+B/6JYgVTENKI3cBhUp0iSKNGVorug==","shasum":"65e90723bed1b462034badca8bb8e1e9b52e038f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0.tgz","fileCount":22,"unpackedSize":115524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen046CRA9TVsSAnZWagAAwosP/AmeWxDJM7rWv+vzc8TQ\nzg7XVZSbZmZbsuZeR0wFp0fC5+xb4XjA90lO8KKUxHUfVS2OIGRzR/UkmmBu\nOKIvXSqkBHBI8Dv48MrlzyPIoMFpZX+NqVLMdcOxbFtZT6Oad/0wcnfoXOvN\n9lsLqnIq4dfjvRfcfyAdH1CmEemTj64S1ZW058ODAtUp82lLj59t612Zylnw\nkakzln588fcTbtHdSy4Awrt+DC3eYXo1EHvTEHvpA/Bl9e46kXVxNsLSL4Tq\n+8kiVchnkGTEtKIGa+WXKrbN0s1SekZaktXx44XdUCaXkkj8lNv3hkAs9gw/\ngQ2RS5scTaxQ8MVp+O0OkmTLrWCNy2VBepzwmLaPP5R4w6PW2G5Gel0GfgFH\nrdHo0BH7HXJIz3PZ72HngKlKdkqqp9ND5+VRerK2diAsU1saIaBrTNaWFYwi\nMq186gGHTXK6i7igZJzxMHvM34XKrKFXwfrubfwCbsVxRekIph6czQTcP9e3\nI8EkLGsr3MH8EKS8xm2SYx9rtxeEZ9REcfQ86WCWgcBQLSgC0v1SYVZVbm2w\nbfqK60dZQ+JC/hAAo+/OzU5KPLVtmI0Oo+1M/cM1oAWXmHrKluQtRi7l8H/Y\nZM4DmQO/4yqRwK0roVR9SYW8nSirJ2O/zxVWmS7Y3ZWn/Q08CpbdsJcu6qtS\nqvhx\r\n=+z1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA1LqNU8Es3uFfIjeTqhES4XVvAiRyWE+YAdy1+3obeBAiEAnIuAJwizsn5ClPY+xShFcIkdhhlFlQyXNaKh6AF991w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0_1587498553810_0.29408468704028823"},"_hasShrinkwrap":false},"1.2.29":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.29","gitHead":"18613cd002163e8e76488f3dc8b51374527b08b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.29","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a4oEHvlI7m0kYcoQ2BZcDyNGV7+FnKuEhtZGaSKk0JORIVE6ZOYCCpEaWEzuK+W64q3wdjiqyqZmDrvVM+P7Aw==","shasum":"40a54d483325459227758e831562bf9b1eafee1e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.29.tgz","fileCount":22,"unpackedSize":115775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen05PCRA9TVsSAnZWagAAwyAP/jaUYq9H86mVTrdSWkmA\nV0EBsLqYKmNtYGV2kdDPUELhTvAC9YsDfm/cakkTAyG6aAdOjTAXKitJCK/P\n/B+alGfwf57+C5vxMFJ2DzHtPLuhlMYPKPUKlw7wIyRneUwy0BZ/4gLo7lCD\njSjdQ6nkU6dg0EbTS331Wn0jS7MR8EJUbqZcXq4fjDtH4alxrbZpuKfTSM3h\nv2WCVnXcdp94BLUKluXA1RfJwZD74cArgyfcRPolE4m7L4/xkxyUVdODYWe4\niD90s7wJQDyxkxjU+GnYMTolLjy+DGIh/Id/Yr8cWj4ooOgjVrzCkSrGVMvf\nKxACh8eqNBTLgk5AfGFIjX3x2zcCJRspufNd8RrJ6Xuodkn/Un2Wi5kc4bOh\nnDIkqxxnjxyTEc/qned1msCjhA4Vi9RBPxcxCfZQOpBE/l2E9iwgtEG9hDbA\nlsftfapVZBZHLyyTSGWsXJ0geyCmlXvt5Clsb+BlNkqS3IOZIzyZu/KEMw60\n5X/O2vYfrZwFZ+BnQz4xgJbqZvM0jjfizOWQ82pTGNF/oDQewHRdiL3dkrT+\nO22yjpV8DmqCD+7KWiheQ3zT6aMaHwFG2sGQt6HOGqnG8Bg8Yui+ie9se/ji\nptmyUeXVJGHyvXaPTJjVo5Q4n2czqQb1osrmaFl0ql6ao/KvzUBTcExp+Y0J\nGZ2k\r\n=znc5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH2VkDVn8KYHdRmhJ/bsXaTMvnSX9LgvmKlJM5q5Zu2GAiEA+wjTVYPEq/ckMuwPsMeefo+8syRkvuCukf4TozcJXT0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.29_1587498574960_0.7530609114882012"},"_hasShrinkwrap":false},"1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.1","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"18613cd002163e8e76488f3dc8b51374527b08b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6THmKF3JdWqDXBscf29ZrYwAWZ/7c2FKjx/rGJYrG0Q4Et1RbUJ2urq9zDxA66PinBLuHLlMDm2cQvCVO+cTuQ==","shasum":"ac38e2407f2b9b31c9555dd502e4563d3201e3f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0.tgz","fileCount":22,"unpackedSize":115818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen05vCRA9TVsSAnZWagAA2I8QAJLV4LXU2ARkdEDu2/vc\nRWDcUH+0yEyP2/tJgq5EqUCvdZCzQ6B22mzH/yYbiZgylGiaBelNnTnWPerk\n7ZOrT1aA6y4mrfxbOrZ8jKl0hwxXxQFBuu5cUrFrT2pGftkoFb6qObV+7KO2\n8k0aKjjLcA53PX3jnIswfOpubtwzHjlPNuj1viVm8CmLf+1297n6LRUlHlWo\ncF3cHWEcXiq8Qj5r9UBmEyKGabgQ0jRzO3fM4zO3LWJkuyApKz5946scDmR3\n9dQudK+fHNZAq5wJFwHVeYZlcFryv+wI2iSkj1aAPkrzdZ6v7e03D8ByQ1Vi\n6jS58cRKDanKXNBDg7ItSDgzGyCHc03RnFYoRTY+yMsa/9ZWLeKSgDFINgOs\nnl6UNjuqBMZUBF/ygxTQcygZXRSRrEWv7PEWqnt70MHKyYFvl7Vm7at+COCT\nrxEjVB1TDNbQj0cJGQiiKMeY7xt5cxcITyFAfZZwqfjl+kAinAp2PgXt2QF+\n++kuijNA/RCvjhOwzEsCzCCr1pfl0NiMrUXXX9NYDqb9NQiAvRmFjJ3P50UC\nmRVOY/HWWvCPkWBPN+voVOTr9NupYt1z8NIDN03t9fZw5eb5PaSpOLCA0hOb\nwfGwyVlICpORAcmUQXNTeaD9y5RxEUMVyhU+FnISQSwUNcN8LVMKvy9BkE2q\n4Q9q\r\n=6IDO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjfhSXquCLuZzN6AdFd6TpA1ZmyQDbJtZje3hB9kP7zAiBH5B8RTUP63wKgi3R+FzI+eUqTXPjcQEgbpsyPf0qthw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0_1587498607125_0.7823168329177559"},"_hasShrinkwrap":false},"1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0","gitHead":"531c28738ea1eaf921516b43c473676f65eb3532","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7RPkoQsNi1v/xSczx5ZgKONQOvhbPEPC4d17yQh9asKAVZZ9drEq2MxrLLkskDoxQrX4lSvN9vBlOpBQDMifmg==","shasum":"48fb343860407a661256b14765512309cb1932e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0.tgz","fileCount":22,"unpackedSize":115818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen62OCRA9TVsSAnZWagAA/5cQAJ19iARh/eBA0MzXgzMs\npQwdkhXwD4e/5Qd3WDYxfr6iuZmz3xiJFsKUCVfmio08nm7hfykbnMLqJ3sf\nGLRNE9OWvle8FIB/wYomeVwlzg2N7XHnEUcGi2LvbZxGUKjT7bllfQHPN2NZ\nzaX3U3Jl8nIj0djM4jg5u7XMm7ey0ZBN8//j3H6lQSkCeLuZZYev/mJSH1jB\nOlZ8Fu7SgmQTAjkirNx1ctN6TMWKewJbI4w7HJWTM6cNRm30HnENvEeAK4IS\noLtI8syUnlkRQRc8PU4d5XiaIIY3yQEuiHgv0/AP4mdCKa+4k4nIdABr3DMU\nvSN8LjeL025K7gk7eXJFDMtBJzZETh0p4nfQH3BmkWK0+mOCi0NnZ6K7Jcxe\nTUDEKXNbaFAzmrVLvjrctlHR55XRsu0M1F4P7J9i1JyxyI9uqKV0Yt1IxwLf\ngdJVOpka1PotGdtfhxsGZxrT5Vzy2fP3GQ7AJ1PX+fPDc0OwSCm7n8PNMte5\nFbX7aOMoE/qzpkGVJ5wTGfptz+3p58K1bmHT/pWVoLTfWjCc8y4ZHxmihMCu\nAO0KAapCx9E36qWXgIa1i8yA1GCoISr7H+iInNa+pkqX1YRo2tgRajCLuaA0\nJ9Mc7RVQphKHQXXpK0X8eva4bjN3S0oxy9vENEu+Uo03vPVYy7uoSTdLE/gR\nsa2B\r\n=2SEr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSD99JDkPgDjjAqv2YcJQ2BtwIlrWBQwj96JB9Xku7SwIhAPNfe2ib1dY1id6krgvp1RcTRxxtfYlIwctCS8eVmUh+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0_1587522957337_0.40397550359654244"},"_hasShrinkwrap":false},"1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2013fafa98862a618378773dd99b4a69110b67df","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/SZar5p4Pc3NSAfRqkJdYDevc7FCGH2/hT1gsMEJn4JtvE2CrltpWLleB17lUju3MpABu86cxK606cKlC5uAGw==","shasum":"eb57d5e06cfc9a09f1eaee6ac75c0fa031309cb1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0.tgz","fileCount":22,"unpackedSize":115818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen63WCRA9TVsSAnZWagAA680P/1LKpS1QTsgkWr7hEeKF\nShbCRDA7OCr7UZwzBtGqWIxoK5K14jRz5AhwYccahmbXZjxiYFLio63Kyik9\n7IP1TI9asTOW9tmBkmzsH5ZgRAqRkbkOGb5Khs7Nx6P4ShEGcZMjJ5tRWe6v\n9SWABkXah3t37csUxrirl9uTTvP2GqE23d5pe9vkcwwIw6lbQkk1pL4cm4UX\n2RhexymZRbDMrJxvPIeMKpjpjwC+mAsUNpQ2K7pya9bDvfCZyrOM0apvwQcz\nVUIKGv9+bws9Rppub/T+EjhChQfkGeP207Gj+u8DnEstfmdWsnbBPbEpTZeW\nYVll2gFTZpSK/fox6tmNCosFT/+O/Ti0U5XgyQFm+4i0eosDMIbhHUDbhSKh\ntwC0LTYWILpW/RxW7hlFKV9mb6iHFTNAAy305QPNit0DROHdOGq5QLhuW7cD\n2P48W6rOfjt7brnoSTWTNqfjOaW3s+bzAny/arlYBqEFx/U89bKWS3XPUi94\nXJAk1/cIhVW7XnrUSnnjt5Fu9pzeKjm/7Brllnl8v25Snvmcrqa0GaMZT/rj\nWgrXsfD+N8AGDuhpQggHH8rE7SnhneboG27fIKHDojvMW0H6tYPhfmjSTV75\neetd1/ASalR/eCxh8Rwfc25AwGGqr7t4p2ZFz7gS5yzRZmy8JH93q+Ym1zjU\n320s\r\n=6d7O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/gLyNAtfjJZG8SXjFC033hKUO9XttNxc3z1oIn8kXxQIhAJNYazNQgvkmRo/hjZKGvhCT6OvQmRxBdRVepnjLFpzs"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0_1587523029532_0.48691561111287474"},"_hasShrinkwrap":false},"1.2.30":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.30","gitHead":"2c1df340931789318f2d14887f4fa5cb225aa46a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.30","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LoVeYjguev3UfoLp079cAF/8BYy+AHJT7aVXvz2nuCRyNKeB8XEPANtE6a4VvO+Jkq4J6j5KUAJAKNGT5Seyrw==","shasum":"ddc9fa591a8f299021ba78ec4232e05bff9375e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.30.tgz","fileCount":22,"unpackedSize":116059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen63pCRA9TVsSAnZWagAAiW4P/2Ms8t87qhsZ2FVcgXNL\n7oRJ+ODv8QqQU75+WbitEOqlmq1gFtwjH+EsLegZ/+uNxyjejzL7HgkDrODD\nlVI/czbu9X3ZZB+CCzsrgrcslyDl5SVdAfeBB3ubqiWRayd2QsVDVRh0eUzX\n5y688SsEE/Qnk2LIJ1AhsnCq7lI+lFon5lj9ngkGQ5jsFkwUDSipeHgR3QEk\nj7Pkkxk+IHCJwNeBg2dnO114fSOxCvs7FnteI55l8s6rBpiqnMgPI69ILkUo\ncQeMXTDxO/dWQLAICkHd0UeRu9EVig8TFPqvzXxBq2pkj36pCiF/HwwP5VSU\nIeDLDo9zqu6qEe8/jNU3J0zDnuatzbz+0OYkYEC0TTV+wps9kBVS4wwPBGHi\nQ84CsVTkQwnqi8Lq4YRxzwAbNh1PzeOqtJec0BY7a5s5FYcNQF78UhoknIN6\nf91qAcCjgXE7yhDSdP5vR9Nw1Shj2CQroEoDpQU0iRFPhdt8sZ8mOw8WFdrP\n3yPiBJJ8HyyJq3+ecocEPQz4N4SEEhZN+8kihXu39agH8fWnnTWsyBFB2JfF\n+pt8RkThKm63SC5gkkAM3d9gQtbeJvSwEnwvdbLNOkFdLywQKdfFJHU9iHqh\nY/vRci2tVhhcTD/QjogJVamjaQHZu7yHBfxGPMkiYunAs2prZiyiFnmm9fm2\nfSc4\r\n=Nut/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQrjF7yAO2+NAM/amObc5sMx8Qim6/3K1VMhPrFeR0sQIhAJjvl3GfwS90VwefVf3QaVWlKzkALn9K6hExFaJxDCX8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.30_1587523048771_0.5994517485303623"},"_hasShrinkwrap":false},"1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2c1df340931789318f2d14887f4fa5cb225aa46a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9A7GtsyZj+HvHQWzkD4uW3HMBgS2P51lLVq8EBeSRGQ5UMPHLRFrme3JyBoKJ5wsqNGK5ffBJgqbZXvAIxOXhA==","shasum":"088dd4898001436f278655da6a3052f57eda56c5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0.tgz","fileCount":22,"unpackedSize":116102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen64ECRA9TVsSAnZWagAANwIP/1eWg87VMHhenOVhBm5W\nVwXKu43OtMpwwdODxllS/xrwC3NnUG6/k+ievt02j56Q59U3vCRvlmWndpO4\nw/HSR8fWcmtexTz9xkotHGS5/8tpNRwJiJDuKlZFYPTq9VD71Y6cnAyyt6cr\n4r2oe7bcT73Syo5fqKsdUxvRRIW6yPqRgAzKBrIrCzsYqRysqgPw1Vr0tmW/\nBXpxQtLOU4Xnpb+NsCgd8dku9YyXz/YRAnraV17fMh2r8XOpVGG7ed5GBvlb\nNfOFfXIw6X3OspqBpOKn4N0Kmfom0MTZ2syuzJlHgff/v8mbqnk+luLnR58A\ndXKXf6r5U5R9MQVon1EMhn5sSzKAb4FsfZME+MURvL1w9rclIoYZfbpTl7gZ\nfzN2rcOL1JKSE4HYECGVCVsB94oYevxYP1YzBtsxN2SYyVgSBwsli0pX4lKw\n95fxrqaNx2K1jSbr5q/F2c8KL5Y55xWjfENW6581hSX8FHrdNB6MIl3z+81U\nxZuTUAhCiTpSEqYoipZYkqQptc817LEDvYdk4MQOcCDBsfvyAJmXi/sTFMI7\njLDi/sLoyiUULrzOPAY+vic43AQruR0WoYwxGOqtEwWDncC3o3qusCS7PvRO\nCdUVvcKSc8HsNW4cHYNwLS8bhO10IYNz7/OhtBsV6oTJBrsm3JVbC7fGPNRT\nL2X+\r\n=uX6e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLxmyA4UUkg8PI9eL89h3VFfI33Bb97RYH8IEAf+1pXgIgOkEIBiV0P55WrAUYp1a20rll5VV9sP6D9wm7VDE0uJg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0_1587523075524_0.13050983048320686"},"_hasShrinkwrap":false},"1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0","gitHead":"15ea6b3d7b6b195ca1889bc45016381ae7a7a224","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-14ft7BeMt22u5JDfN6UzCRm6Uv+iLrWr5ENLMmKlXxvxQGGog8MYtYo6AEys/G0K99/rTjH6S5A3gjozIglMEg==","shasum":"0d6bc432c89a38180996fc4e828f56bbecb2393a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0.tgz","fileCount":22,"unpackedSize":116102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen/jZCRA9TVsSAnZWagAAMo8QAI7pGvMu+yMS9RLt5AtJ\nixiwos0IqeZgdLLlwNn21A/jix3jN0NL1t52Tj9HyEUQVPBnAqtsv5GqT5Tm\nocpEsP1wiZ3HJctXHffS/BJGNhgLIRiUbeooMQ13N3o2eoV8DyPkEIzTDeQO\nv9BM+V12LAGcmN9jHBYfmm9UcH5z9zij8IyQfrj4MobAR2WsiR2QaxqAfWpH\ngz21MotMreDcEmvcMwnIoSaKoCzPfyMuX2bW1TEb99/J3GnbWQLRsG/hCEdq\nyxDsKXk9pBYdaVi6QDnlF83CMhfhNEUh4uHZo1AfKoirgau5xgC8SKbbROlQ\n1jUKOD125fV1F9IFkCcJdSY1k8s6ev1ipAzZotx/eGDRvdcoaIgXNux5i1Ai\nPbsN7gTeV7zMisUUoepRRvQ7KSvu+/7fC72A8e36k/LSg/0m+0H87qRGt8Y2\n6Js83oBrukOSRQOSjG74UE92Q8fp+qT8HktcraL5x59VLmLUevLAgt631zud\nwG8QMnTg2MNXhLM+Yo6lUIFd6bTeu2Rf9LkArQOvYM5gTr0YenkCeEeZu1Ec\nKj6ojOYTbXlCJluORksKaveq4rCI5pbBCFNEc2e5JDiS+ABAG1vMN5rUymE8\niiANpwnbaXgNUpy7DS9/4EoCDPV9Ts3mK57Owrr28rPqplW76iWoyg51cvu6\nOwA7\r\n=3gpP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjnhiVwK78P8xu3bB6GqohaJB0CjUWKSd9eKn8dH4EiAiAMKljZ0fSiQjFCt5LYSXRnuxsaGRZ6oIbC4nJR7/Rg2A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0_1587542232723_0.13852908213548365"},"_hasShrinkwrap":false},"1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c907d595805f90e78b0eb5532cdbf7b6fa3a294a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CnbmouHCefYcgMucDZOjh/ihd9oPHrpSyMAXn4RgS7ksIcG5/7II64gTMEjIeDV5/+S0uuTY1Yv0bLRNguI5Uw==","shasum":"a20c4fa4b8d9aecd764a4b808403f6fac37a97f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0.tgz","fileCount":22,"unpackedSize":116102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen/ktCRA9TVsSAnZWagAAMToP/2W9fQ4IbM0Gm8ZQIXh7\nNMs+5KAflITvl9CmNVTuLaknh8qJ6ml/O4LpeHmgHyHax4Y3DjUGrwW4yYra\n591Qn9hg7HDCXbN/PGD9nuvVLYfqodHwwTbA/uDqn6iGcU680mQYxPOTpK9L\nNimrpjRuYwdUARNoGu4+a77Z7YgfxLevw9Nldf2Ez90YxOX3ZqvWeDYscK0n\nr/vzygY2BPL1XuArG6sFhCVYCbfN5RWNqVi0AtuhcyhGAw4Si3//NAvqUwrf\nUxvuca6plYZ4m3vMNEQuoyFb4lb/+jV31iNKcXYoDEuHSftbT+bGCJ3AS2AS\n9kOzh7Pp7Rf9eEOwW0RRQ4AUB4LKtl+KKWbOiRqPbiGAVqMnFxxwzo3F1oM9\n08xgoz5eO3SWoPTeKuuxKWnaoDRuNIu+mTjjbO1MX7RuXhRQ+yb1RxcCpBjW\nphngoMj/2xKKO42zutRIs6djR54gWH8y2eZ0SZur5IJa10GswSYFVUjQQb2a\n2sEdkbaM0tuuB/S5pCzLF/LdOqySOB2rDVd7W4A1pUYwwa+khCvAOg0wbLu4\ntuHbamxe8kYCjmqLEueKVcL2KFG0g1jrMe0B8fT2WjGKDJECjOvAgyHo4J0b\nNysiUc41zN5X5PK0u9BF67IZ0sBpHc8tVwG/F8QNEeUu+ILRo/FG6p3Rh/ut\n9XvF\r\n=kUtz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiVZZjej0CTYMjIjZU1ciJxybaoAOfRS3D4yP51uTDUAiEAsznXvDzfHw3HCjMRT9ZOJ4G9LlTzZH0ytntdF6eSDqE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0_1587542316935_0.5182448130180353"},"_hasShrinkwrap":false},"1.2.31":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.31","gitHead":"8a907967b7960137842e613c57d3b9c87d8a65d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.31","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EhE7KCOGxWByQlF/tqf7KcCu0lN3VTyoSen2ywEWvs5HxYGxBMWuxB2A461lOm6UYLj2I4HmR5avZbS/ML0K4Q==","shasum":"103b0e56ed92722780eaabe9f7c8b0ba8d152d25","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.31.tgz","fileCount":22,"unpackedSize":116341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen/lFCRA9TVsSAnZWagAA3hIQAJLLCyoPkOQW2G93umti\njEeFCLdEiZvRfGtjlf0QlG0sz96zSIaU/38hQLvqKZirbEj2FG37Vqrve14r\nUp4yT+V09cFWA5pIpJ9ZA2hL/a3VuT0Tj1q4nAtQd8lXHwd8M4d4cA8j+eWj\nE7jpzr0c8tcecK/mLcwYtqWiVVIr6Twk1VKmzWilp1bSGQyNWXkIwxjD9GhR\ngqUyxbgu8bJtkGl6Cv783IivNy+OvALuO8k6y56W8htFwlFqdMRPCTVsfxAx\nVdHS61USod2f0SFDbVVFNtri513jzDSKpE2rLoW7oWHv8oIRso4tmHC1XPrQ\nBPJMHf3Qm57VC/pLU+/u1MWuNAy8RRupJcSnq+LuD5GFQsbSl1bm9U1Gn7jZ\ngyJstfK9+dWewTK+21CChopSv7udpwT3gDHFsSdm9rJZR/1aeOO34iJTD8+T\nFEdMKr53atusbCzeKnAh+eTk49nD71TDQCaHNL7l0eS3PyZB0JoQuQ/sNloi\nyembvT/qoevTIQKZWzzWoPPjwTE+BJnPFog2FjoKXAaFpRaYfG4MvApV2Nh6\nZsLy3HKu+VEAT2KAiemDtPX7cZRyKruwLRnvOOieVFhTo9rWroMkZDNBav7K\nZBpdYSYK99gsNU4auHoefkb7/FtyxB5NVA1lqC2NlIbuPl8p2AP6hgR8rVPk\nhJWS\r\n=A1tj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiGg+ty/m53QcOqqFrxNXYWCA3n2E91osbKFgC6ptSYAiEA8vcN+ltFlDaD+7tNs2iFsW7Xdq6ZdsCATcxHXgmoxZ4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.31_1587542341048_0.13295269637619023"},"_hasShrinkwrap":false},"1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.13","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8a907967b7960137842e613c57d3b9c87d8a65d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OChy6DLfI1l8srCgmg/VizUXkMpzc5J9w1aKWj7yvseIIDe3ElTYkt78ESvjCzIoBtFqtfOY/DgmXAfkqpo1Zw==","shasum":"a372ec4e1eedd315edc2c87f284acb7dc7567368","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0.tgz","fileCount":22,"unpackedSize":116384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen/llCRA9TVsSAnZWagAASNoQAImL3I+QPQJBSZZy0WXQ\nBk5UNZuUQ+gq7bMgbPuOfjerY3wgfQHh3bkj3YWrqZ4Bj+K+m/VF2U+LFEBj\nxnVVEDD7tWheUFk05V9tlbkwZnijbD9DdbOjATKFQsNOwxjTPrDtQtXgzcxb\naM53SALHrgVbqWDueKSNy8Km1ifCd7cts3F6tBNsyVwqft5BnQAaLvHbyM3A\nh6zbS4frTSCPKHs4tZynaTs09gv9nVXC6qrn2QhtZjnMnRSdS55biHcxsVd7\n0GuwYRLDzaa0NFBFe/LoJL7wvV9GG+l4hwvkiJtNl8LS5KN6Qg1sw+m8eP6x\n/kTAJ+THZtq/KqWXdZQHPOOjunbxcOIhw+At34EWlUX9i2faPbbjgtmKt8pZ\n160iE2hCy/f1aqMrOvq8b5kKC5Ez0qcotGDsQu806ukw8up55y5BbTBXhseS\nX1G797GayVFa7UxEf1A2TOh7NcONuV7Hb45hQwR2UBX7TUrKCfck0eKAqM7A\n4boWkuQUugwiA7w+RCvuPw+rNRulutg6EGhK7dYaJnGfRq2t+NKkLyz8xdMU\nUFJABck4gYwIZwUK/HL9twpNYxTBL4LUOf/bInfFcUu8xd46jpSknNyPnxck\ndP9/9PjfGgtyCM/Y3+eJ32E/OTj9/X43TP1tvepGPQ6gA783XZVNouQWcz/g\nrb80\r\n=1dzl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEToDcSfuOgkjShm14eNKPZ0eJpixi636c0P/Br7NPHuAiArgZpetXLZ35JOtdu/07GYTY8HVbvx6x59i8dAkAQj3Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0_1587542372516_0.6193970545206686"},"_hasShrinkwrap":false},"1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0","gitHead":"c14d0da00662a73119b85bfaaea925da11dd4c10","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/eqy30V5XKBh9elYXkbA/5qNeZPqyKrukUteoTZ4C6fX3KBAi6kmaF28+t7NfP8Aidbu0SkR9oeN0uEWwJK3zg==","shasum":"6fb8ff0c22686e39fe995bdcb42b56287375e792","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0.tgz","fileCount":22,"unpackedSize":116384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoAi8CRA9TVsSAnZWagAA4z8P+QHNdJzExachRA7fdm1V\nhL0LuFlLAEcIrwvMsMrQOuZJ/3xdqKJUdQ+VvmG2+fTzXy8333eEZTk9Fovy\ntSU9eZcT82CFb5dkGMo+n2vfaQQo4bx2iyEAD3pV1kLpT8GMaT+yRl7hSCbx\nj2fCD1UgiBpcCibZtTPlXxM7+CJpgNqzX5pcZ3aWIeviK/PbYsdDvXl56AYI\nB1J9/X+ewIVEPY1u4jWqAjOL14lzDB7A/50mqE5bPoVXp68AFcvXALjPlHlD\nidz7h6brmKbZ7yyjegkBcrNZRprJnfleDLNu9LigZXuE3gzVTE57U2i634uU\n9Ar6HaHuKrArqWQ05o9jrXFo52tFuLgyxcSwUApown5ovPBfFCOJ89mkbm50\nc7j4E8+kYAL2K8CxN9LSgTYpiVriXzQPc+hjIKuW2rwaKvUub7RuQ++vtFB1\nsyHIj00aNjZg8GPlExPf7WHFaZ5XMV2C5InDFXqr30ohbVZiZ7u4TIOrExtf\nc0WkBC2B80oV0S7MYwn4n0On0tLjLy/iFCWqv6+sw/IP9prpnv+QHn/W8fO+\nzR5/g6y01CbCBri55RHptHlysaS2jIWeOFs/pTsBxHbtS8fr8dJz0OJ14Cfr\nNh2Iti1YFZV4ZTPKqgQMc71bVuvGeSIUL8VEp0j349+Aa9IbxsklYk8sXaxs\nxxVf\r\n=3LBn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwheM2a5R0m3RP2ibk7JYi91IwLODWo7GQGFqUoYJytgIgOxEA1uesC8Kt2QvorKzKARekUaZeayS/vW63SRfhb6c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0_1587546299852_0.7404914615959419"},"_hasShrinkwrap":false},"1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f13c187ebb24b6cdb42956059cd0ebe7cd6fb413","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8q3cSG0lhRMaa3rVKraDuE7Yqf8vdREN66fauC/Ju1t5hve8IGgHqg8BBrI9rGwYHnuVzVoVPvjIIm5Jy2Hi7Q==","shasum":"fe8afdc74e0f43a72b8f4a501de92114ffe227b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0.tgz","fileCount":22,"unpackedSize":116384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoAkpCRA9TVsSAnZWagAAfbIP/2Q2iKulfamhWLB5m6KG\n6FIH+1QenSm5FbWesLQ3H3s0bxr0nq3QD6XPkokRXfeHCzGszIwRUSWi7Koi\nnqo4xIoXIbjfrGLs4wNEiM+yR2mkDEqlY9oY2XIwykbmkTUZiVw556NZ6mGP\nr877RzwpaOv0ptU0Zc+6sZkppOOydwvqq0vKXQQ2aLwOdfTtxmyFUaywP94C\negWTb4kPb1ZcM5Qm6+6J55fXp6EFRBpsgnNDUt/zXjZBjLPttY2wt7qhVrAX\n9sE1Dk5Y6/xtf55zldfGFF35VmzvUBhipjV36j4AUoZK1fMPF5G2jBTc8491\n0LOHRc6qN4wdqb6iWaefHEL6BOi1xVtxTzXjNucJzU1gzMVomScozZL6CFnp\nZnw/PtU5V42CMIinLuLAxFHY6l9Hh6kBzmflquIjJbh9SZpJw0ga6zIvs0vq\nBSkQRdUtHvLeS7Vvh1TjxPCVSgiVS0QSGWgORC1GPgXT0fojEgSlrtaoTRd7\nK8iYXYf7MZZGy6x65LP4kNzW+J4j8M272ap6Z7EvLS9H1VENVExzutoY9MJu\nMufPFsx9H6f5KMfqEjYjDV5q+paJNJGMfRReo7i5yI1zZf35ZvyQqg980gb0\nvQW5X9UMThF/aBjAibWlZn/O6uRYXJCGWZEsdOHX5sDlQZV6k+yKLm19uplw\nfiue\r\n=LJMK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu4+cYTUfZmHLtVn25ZsU33QS03hHshjTFfCZhpIwXGQIhAIuVU/0IrQ6jT+8GzzXBLJdkOr3aTrMOqlrOWqTR1F/h"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0_1587546409517_0.21514179180789705"},"_hasShrinkwrap":false},"1.2.32":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.32","gitHead":"4c19bd30f30a0ac912a1e3c7630681f107a67c54","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.32","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wuDrgvmnEha0v2DAMmh4FNGz0JgI9CYcL7APOI9rcpoWDK8N4pHYmfa/Vtv9JUDaG+ewOEkag3wgFhhhNmV+8Q==","shasum":"8c5b239a2d734a0303eeade461702c5aac766424","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.32.tgz","fileCount":22,"unpackedSize":116635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoAk5CRA9TVsSAnZWagAAW8QQAIRxnp87Mc8ah4iT/v+V\nBlxkiYlscG/7khddSJG3vgfKRtHstfY4TcWIQbODac2zrYDnRX11cZwrkM6W\nTIjj2wEDauwy9SAiLZGXPna5Fz7gAo4sjvNHTkfRyR1f66mFa+HoGw8pKJj0\n7h5whBV+pIjlW9AMzQxk7rQ6YaXQ8fpNIsK+By+iV4krwFL2yxf7V+X2ym9M\nwJKw1oHNXDogR9DDbEXVVg9DFF5kgMuwGlXqwq84DkMXmhyBZO2HeoyyzXGV\noiSE/X2JhSyfb5N2ssiWalVRxei+tPOGeCwydaSnldO+GmlfJFGPubl+w6pJ\n5774IPrl7/NkN3EVDEkb7vcz+O3+L7/PSrVVesCGGSWtJOnIuN3XZjrWvUzR\naqdUQMGC5GDu12QgJKIBrQCVeuFWg3ugn49YlpODRUhBOnl9Zhzo7IC7dyco\ntYk8tlx2VoCkXX/9bzqEn7QEukBWhc2XNUD2XWud21BT0hQsiJoXyswCc4Pf\nTDiq+IJbUtwuawJqAwyXEg/HRmKZsWzGiUbOCrFCffd68awO5hNA0U8i0Fz3\nL4YP+D/59TFIblLk7NKdFReqaCj2F3fgl3aSDHg3Y9EWPqCeOorieWfZ1sCh\nOE8NaIxtPtyyb36PXp1BgL42lo6MiYsr4XYiZRikRsNxdfKyo2z+pQggn07J\nm2Ha\r\n=4msl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1s5FuBSB7VjDGCt0VK1q0JbuDGHrXYLOWw+jnaN/NMgIhAKtrwd7HGLGiKJi7NWy+QG+QhOAGIX3WIavBhQ+cNhGB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.32_1587546423758_0.7608431642858398"},"_hasShrinkwrap":false},"1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4c19bd30f30a0ac912a1e3c7630681f107a67c54","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8N0eVLzY7nHt0NFUpY3cG6nhm5IpavLCEyTYqe+GQxckIvAmiF0iFWmQe8xjc5PcifnRimK/Ge497XWAzsKB5g==","shasum":"42bcd503167dc71bf3653bd1e225f9ef031a2e95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0.tgz","fileCount":22,"unpackedSize":116678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoAlWCRA9TVsSAnZWagAANUcP/jQqQWMeoeUHNIcftM/1\nuRRFeB9E2EsYMXrUlRogyse3HY9jbjLEZ+pkpgUeyHob0z6cj2canDYHUfqb\nA90dtXqa2G7x7eXyjA9fkatMrll5M87lS28FS1jSMmxPbW1telU5f6QeIhL4\nAWcaxIH83XzjmE3T3ySXv8eGEv4V5XzUelWDc5eGNqvHm7AhHOlGIWlJRbJt\nSiwkp7L9dmG5e9XuXxy+0a7S+X87+lgnL0u1amy7MArvS8u+QOpYgWVuq202\nIhH8Y9eqLpOO++G/m4queqsFqRNNJJWRfnkBGM2K6SAiLvG4CMfxKe9xV2Z2\nWbie+1HIFqcqH06NSG3V+lJMGpYQZRoT3wrM1Fk+jqmKKyJj5XBIq1mjsDdo\nSeoFDpq4K6UZzRNVM2ocO+hGlO1CyCL5f9vm2mHhkNJb7GuisdJ949iKnj9I\nDeH4MPg5upSXCR4hUZUXK67YMnIofhysixoF918ATECwnP3tY1riSzYDIuDp\nvtd83S3hICu1OIWOnoG7H9NfkbiAGoculiiNJhRK68E89jmZt1/oLD6n9MW3\nbZ/7z32eAZoyZn76fg23t7scgbwTHzK3A9cIEMFlnWi33swgAsEsc0RVyqEK\nT5QQAn8Me51q02cITz6SpZERpM8Eby7eo5D0NAGSdjYbgGW+ZWKogAtPTo1m\nT9AF\r\n=fwQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX2sORYWD0Ri5xCL7boVUFyneYiIqfCKo03UWAuWIRSgIhAKdheC1dH616I0Vy6kRgrPE0dbQjAwhAywq/qetGqRTj"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0_1587546453311_0.010165071104871526"},"_hasShrinkwrap":false},"1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0","gitHead":"6efc1b014d3b27510b8a5f8bcd41fd746b5f878b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-80l2Dadr0H8fZjwmsGFemFlzzZwrZZmu4nfDzNpo/6vJA0GdawlhBnKmDRPJVgzkyC9UP2uBFkYTE/fXNzblFA==","shasum":"b763ce49284bc61f957532fc93b60a7e009c0abe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0.tgz","fileCount":22,"unpackedSize":117068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoXGJCRA9TVsSAnZWagAAKr0P/3+vCmKqd2oRkAA4HcJw\nYzV4HTtHdsv2AHTsjNPMLZA0oZoHV7ySRdrSxjDb2TFFAu+sd3RIfhIBe9PZ\nj4r0hXrjTAg7aIc3mVWLqNXjE/AwT5JEBhbEsSlUMebdcQ2Cb2dXrZZRQ3oH\nEura/MlkrfyDxhq8IRjKF67/aCbDS4rDmdeoGChux6BLyc9N1eb15Py9g3q5\nw1+9ehw23OFmZAjFsq++Xur2PfMHOFNNWgsnGG/V1sllDKpOFOepPUYmO8R+\njnCKJB8erPjf06KuCC+08Lql85bZv9mhzZZzEfNeRot3xMrfLLrmW5mZkZGy\nfuodaDaLi7to0rP9lkW89mno6MxgvYLt7AuAWO+UPvDRMwyTPVNYRVfVWEop\nxd2m1sOTT1XciOZbDFaUVq8mjHLymngWDGjybQwB27vNJysEtEg8RKaqRt/l\nBMuer2g1IRq1DnLIaHAb8y1X8Re2DSaX7reZROLEXBUEmX3G+BMVK9WGn8db\nhQ/z8QXel0qHvT2lqzv4hAJYVEmbX6akxGWcHe0jdiqvaSWwhFjpJWu/52AT\niNyUAKuB5K4D8fLvhap9c5wR305M/1lNeA8Yoei5kFUq5Sk5dJ6lpA+x2f0+\nr1NRmKNTPea+U5eOu/HKHh/0SCap9vSnhOykItzN7Mecmx/CRCLDO0WsDiLV\nFDhi\r\n=w0SD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0B8hxQ4EO3kTG4ptxk1k+SAIIdQQH/d+VmPlk1In82AiAprd5mm6pkXZgWWQJRpkouEbJ3z8PC8KwxHLUHaiWSpA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0_1587638665100_0.3266489249457678"},"_hasShrinkwrap":false},"1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"00cb3e4719fc0abc869678402baef056339f51e4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vVrUKcXjnpAgdXKCcmCW65EfKWiDbpcW10hc5SFr7WYh2dqPXNq+tFa3SIZfDJ9DBYj8vLojV0YRmXjKsr42cA==","shasum":"6de266006608068731db8f2b1c8cd589ea19f0d1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0.tgz","fileCount":22,"unpackedSize":117068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoXSlCRA9TVsSAnZWagAAWRkP/1EQ9ZELXI2/kUywx9Bf\nJjTRqF/4FJB9UMJaqjM0/oL3BzyEAfAeelSsSmje57FjTKtMWG8xqp7eTtKj\nVGfCbgwR/UNiECoU/HxJfT+fasHZzkJjWzWxFNFzZeDj735qxYKx5nclo2Xr\nQ3Lv81p9V5WnzSlibpc3qoJBM6K7SsNhVjHzpkmYOjojRYkLfhtAKy8+FLMU\nV8sRjeVvwpsonoHeMOh08iwd4atCCSvpPtaKBU4xz0vZ7vYsemReYRYXHs0K\nEbA31m7m6X3qAh+IPkgCyM4C6rVhJ84MCrvlYkOFD90SAOMNA6uql6kJgW1L\noIhCNi+ne9o05hIoZ8d2RLkJHMGa8Ikt+7EJHj58bPWbCMCCwgIfEfbl1/fd\n4RT8RdHL/DsInMDMjSQpGcNQDxhZPGCd4sGAl+OOGP5Q0HecIU3zXjZaw6ij\nNOOPcg/ZaJnrSAzEk87uWYdVcF2Bk1L22ynjENUTpB58EuSzsv8G5aZlOqnW\nQOEX7fefrG1/i13qM6mPmRKJse1nXG+RYAxzPbg78T8spdb7GQfwsYDuCxoe\ndBhDdWiS0cLr2Va8/VyVz0OeU83ullXpyCUzNZ7knnZgTw4Jx/Zzu7+MShZ/\nnWHcGGmKSMXgv1IIoIqExurEarM0jU7y3oxmX1LIqcYVDPF6Zv00L+kD7mrf\ngwmR\r\n=/dqI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAEzexI+fcCerQjP9JQnILa/85FJyn+tg+ZpCGP16wqAiEAwJfpTAoV1F0SorzpCgqxRmHF+t6H1NA8phs8ux76TiA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0_1587639460670_0.9693987410254261"},"_hasShrinkwrap":false},"1.3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.3.0","gitHead":"ec21c4dece300cdb9507864fa5738b50e2945397","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CGLTubWaxNLBdttAYlXwgIr6PAeQNPcr8LEfG21YxuH/1oHg6yMlFWk35KnIhRzx6moCqH+/XlJe7ymyYoTxbg==","shasum":"ead33325a9048483c480678b9bc7734139caefee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.3.0.tgz","fileCount":22,"unpackedSize":117293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoXS0CRA9TVsSAnZWagAAA/cP/0Pa1yggNUWpmGigUgwW\n3dOKh44ZP5Y8xLTgpGj3Y5+IepoxNqxgNmjHn1qfplhxgVI0U25Wti7aD1q0\nGL/NnZXkfm/rjnk/1dWwFMbe4TM75y/ph8mWjzGqO6iBEVcdrL0vIYi1BCvL\nbC1uIyPqI3ltKxM8NWcK4Wm7vfZ8Ules1L81m6SNXcCKxI3g1ag5kx0r0VNL\nnelFgd3nKaEy4WTICkDzfdOZE1dHqqbW8y4SmTWAgGTHvyIwPcMi6buyu7XO\nTTzfPMZO56bhE1Evb8dqzdqxjqvD97kg8g41M4gYTIGbP4n9p0Yhc3Qid4lo\nJPS7A6XsuH91yZBk2dQ7SRLB4RyjCOgIzqI+V97Q53L48mJyg+iS8kbtjN4R\n6t5YfVzMEf2QwFDUxnqykfV6woQdtUrEjI47DyE9KX2nCfug8qtVaxxGe7DN\nx2YRmKAnDS9dJASQ8njDV64+Ej1w6TTbbePv8UHYyy1l9wF3NyaBp3daMeyM\nkpYDuBGDUoPJ3OILjiDfhoDyEbUXucNMwNS8xa+M99Cr/yvMHGbBL6SfUaoz\n7RTSzt27b6fWMxMFkya4Cqnj+3m/NzREAqgF8JBjMXiDOC7MiXI8pU954QqH\nJhq40wBoYhPhr+Ga29OUndtI8khxodIzX/7REZMMQVCI8UHMTP2TfjrHfGOe\nH11P\r\n=7OPI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAEZEFz0xkL2j2N+KSiH330hQg/kHm77Df3vilOjLUg4AiEAs6yHFZ2Y9WxWkrVzXZ2GltLIwMLRNWluczGlLQYSmDo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.3.0_1587639475521_0.39412940169963084"},"_hasShrinkwrap":false},"1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ec21c4dece300cdb9507864fa5738b50e2945397","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sCtyhycdFz7Wk220obs1uojOZS25V7UZneQFND0yL5J3bSlWQav20wt1aGCoGU9rJMYpCehhghZhmGn27Y8pHQ==","shasum":"908b27ec19fbafe4c8d594452e009ab82d6845fb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0.tgz","fileCount":22,"unpackedSize":117336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoXTRCRA9TVsSAnZWagAAPC8P/jA8tPBPAY300Asj/Mpk\nRcT3/I3oIibx1uAhxWyrvK711xtYQBuJM88oL+eFbetOyLw1M11ygpSpjyO2\nzbXoGU+OJ1rvoIHpNo4TQ8rqEOCt/CrspNPG5QmIACe4K03LJlYA6KGnhF8Y\nwTxpxb1L3wvfm7nH9kiC8oTBSgNvDqhxRlwIVfuXRNOnCUAYYq9BTnp1VL0Z\nG1tvXrFy8WSdbLwuYH1qN76Thsqw7x7uyY6kFZaY/U23AZ11dkHFcC5uMTTy\nZxy+WnZawQmElm1T8Uz0mRIB8eecXCpeWVNLY9Uq57YTUx4//y25u0TrsEr5\nMkCaTpT5E7OwI5J+RV0mjEH1eZLOcHBXRlEK8P/crgCTaoZ0tSpGBIrW+3KA\nhyQQ0tRPzD3P5H+beTCPLqqNvMSkuFblHuhF+xL48fKhqr6bNK82l0LtBOSu\nh/69Bl6bO/Sq34h7bf2A+cDHF/qtzKLs0QNkVRGzr5mTbx7CzEqqsjeJQN5d\naneNESGJMymZAlKk2zBI4PAlUY/qq0QZutQwNwZpmPMcT0018EpZ11o1sdVS\nyt7XTCJY0o3YMeptfKU5TbpCDvzQchO5Hhbl5TiNgEhNofyBhzFSIhCl1hHr\nk1EAGtS3bgSvEavgYnSwlcGhpdRxXai2MqGw0nijFEPpPXY4zRtU/yGtKlPo\n1n1d\r\n=+CV9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHt3vp1Qd7RcM1VEk9OSDsd1XsJCijLOLeqhvYbsJy1AiB7doiET1oyUczIeqWMzHee6W8j/SPL43tuJbsJ/cv1Pw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0_1587639504479_0.8629923816372358"},"_hasShrinkwrap":false},"1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e496ae249e8b378e4a88aefac77b333a02092b3d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-0ryZIHua4rd4+NKr1W5f5RaNcsOrrLM7OY3YxYyBSrX35MGwmfPtUdWysWxRe1Ecg1MgUP6yEj8uhD/+cPKtDg==","shasum":"9477ba537a6fe740f9272296e6c3e12f892ef739","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0.tgz","fileCount":22,"unpackedSize":117896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoaSfCRA9TVsSAnZWagAAkb8QAJbh77OyL9oGtSvpo70A\nugAPk+C5YFZAWOR73p0G06XqnNbEHk9x/9jc0/mgepqhsn5IKCbWOU+oOfPs\nEzvOsT/zfbmoCmNA2nKbVIGSNQ+aJTpFY36iquLcwCkgYzi+6TTk5lCbq/4f\n9hwtAWEpR1+yCpNd0mjg7KIehf1qLBROccNbL64f4IIpmYVXRmDTbgBsARfo\nHIFQpfHfLkjyCzFr68GGAzbWQ7oLY53UUh75ULcMlPs9oOS3Wrk7nmEeKi1M\n6MFluM3UhtN4Uto6d9poPImVy7Iz37Lya2LCVK6SZACzUupfLxvUj9I9BwG5\n/Q7Bt6sfRG2LYQ+gG+esrkeC8Ia1BFmy7yyLpLWPUFPnGBpzIm8eImt4gJOA\ntztN2V+KJdnCGL+K4Y5Y2joCk2PoYkDJHTgMZcgN5wpRz8RzZYbBvYIk0jLY\nRZcLrAH3XopSx+AKQSXcxY6/oHFJgDcDRAjSuRO4UWPt02m/VtHFNwiolfDN\nwTPJQUWR25HAJxdOiAeY3BDOVbLOp0ocMfHekHd3SJw7dLF6loRs/EZ49zbp\nqy76mUVhRAajIPdoYXOZmRinj3vCh2fKEw9iXi/v6datS9CGaTVMiCUocMSe\nvOoW1AQXBiPQHHjX8MMiToEchwmC+jdpuqnZ7pHCRZkAxuGxgpoHjwTZMpTy\nwUhO\r\n=noka\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAG926dKj4tyc9DAsIHi6P4EJZ+gll3brLjHl9G6vnb4AiBJo8pGA7GMx9GECmwt8FNvDNQx3nDfYoKUVeRXeyESvA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0_1587651742490_0.9046975821006888"},"_hasShrinkwrap":false},"1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5cae974fcaf7fabd4e34e18e88fd4568b44e7360","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-T6tgXA3eaNKiiQt4DFjzhT5k5pBqaVhPwahdG5CF5hwzLXpudcj5QC3eCKIUv+vExBe6Kz+I/wZ815wUJ1R61Q==","shasum":"383076941b388efc9372d881ceb198ae96fe4384","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0.tgz","fileCount":22,"unpackedSize":117896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoaVhCRA9TVsSAnZWagAAeL4P/2iL6jBSb9tCryDF5hFh\no3WP8LvaQz5Ed+q3A+AitncSpGlcO/gu0JBhz4kwSU3K9P7OuOKLf7PIg1OK\nwbbrObkToJuPPwgaVrYxuiTiYR3v6tLHux6BewIMoLuBElKHoLkx21YZWU80\nK/MIWYcDladpc6lpVnW/qf6pf93URXegd4xIHHY40RopKM9sRh8SIaNRxSRQ\nqwfyIR5fw2ptI8iqbuxnDxk1IcazjqH0pzribmHGTuTIdU9CKkwcl++gz/Q8\ny9dyUY4ise6F56NgB5IVF6RPz6sFd/D3sGkmKnMPFbzxxrE9LvPkR46m3uyW\nZARGqdhx/j+KNUCCEeGOpxj33q6zjDN2EuozBF+BhZR6gJBtGsX3Hp4fY4Sq\nt2952lFiG3zlJTUYq7w6df6+fI5jjGbFQvQUrMYOaBIRiuCqdtCDwr+Ht5d/\nF21QUFBRhzTZudeIhZPu/EwDYYc5psGdH2LIaDZGddJtBAuLAsKSa8Qc6o93\n/jQWqmhyZnEWRr1zOK3+sPTNVY2oCftiGS89oL7LR3z73bKXwlsDAvJdF77w\n2hvV8cHt/YSIDQhHlJhlmH2A8BjdgwDq3bhznhhuAuB2FdsRQsrtU+tBqWla\nCTWQiVrvyKptUZmgZ8M6FR7hXFByEmBun2QcF523plYZ4jLr+Z8rs8tyeGZz\nDZfT\r\n=C1T8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBghN9W26u4TSi/22Y0087eqrsaZFPpgjjfkYCcCKPV6AiEA9vvAIksHymBUbL+n86N/Amp2l5wGvw460dQNwWLaVTo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0_1587651937314_0.7328216349111247"},"_hasShrinkwrap":false},"1.4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.4.0","gitHead":"c7597f2aa084ddb874b764c3dd6ebe90f4699841","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-dy/wUZiiONvQ3QTXkyOLsSkCMVuvNhpZOeZrrXq6jSLKA1lvkZyOpcZ2FC4fndc31BrsPusfd5sqvgzKVeAm7Q==","shasum":"ce5bc6e557de6d8b7340e9aba07b5f48b361a216","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.0.tgz","fileCount":22,"unpackedSize":118120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoaWNCRA9TVsSAnZWagAAEpEP/3LeOEZL9Iav0HFP+Bb2\ng1J1rWP/GP2RBvBH6jwtU6rm9+ImBysISSU5GX0Z/SHLzVlel2KfHJ8iB6ss\nIwg8CopobAnkarSRgg23MzHl5L2V0w80+DToVAe8WqhosJvL3Wo6qhYJS/dm\nfyibTfx8xSTVzJWR46qPXSKjSWNLhaZDnQxX3FExgaXR6bPlagypQUQKLOyh\nqwxnNw9sc4E11WJ2P7rHBtQmDAUse2TNNmi9yi0oiWCcWbxsPw7N+uF8E07l\nqnf+hqSc1vsj/Uk7xl9B7ReVehKR2sFIQQasIodIWWBIkwUZXJR6S2qVYtO0\naFk+JqjcqplYLo2gR7vBauK0fZlcZMWSoMdlLDkWHSxfe6MklPi0WfUSZ3KP\nnuJ/Vxj6Yqh3Jn8QCqQy1GS+1S9UV71Xo8tX0nURib5K4jPDKnRwCXpsNuX8\nETdr2c07w8o0BPew69K5bwFI3DPYugnb7pLc2k90GsNQbFL8wzehpgo9DdUl\ncT+Zr2c4MuMtpVCefPjbooy63sRXI19q/uXm/HWadtYCFORFcaKLECRuApsX\nAzr7MvylFd8HJyI6qh98Tvg2XrCgggBwKcn0Yo2w+PLdLju1EuPtXVhLVOnl\nhF+dU50JCjgpOIohEzI/DhUdwyFFh2glB+cRV8ON15Fr60PkSkw86GAElFK5\n4Uge\r\n=Zv08\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzB4KaF4N+wS6QTj9q3BuVJFpzVHuVEbR0UZA98Jo4UwIgcT95LzWdDhxGKik7MNU7dVLXrJVZg7XCUZSiuAFMUzs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.0_1587651980434_0.6340353088218487"},"_hasShrinkwrap":false},"1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c7597f2aa084ddb874b764c3dd6ebe90f4699841","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gOyI/o3z5W2XCaJSKSStLKddS5qCzHihm/wot/NpKTucI42oUsfKvKF+zey2hdqnzfrU5q0g/itCuAPWYyXUfw==","shasum":"68d7c735b490c0fefc22651c1441d6eb4f0c1b82","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0.tgz","fileCount":22,"unpackedSize":118163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoaWsCRA9TVsSAnZWagAAVdUP/iQBBaYHfP90OfeTTi9s\ntbQrby3MdOSZ0eQmQThk5QFam9gQw7obuZNVClRFxGz4Cwkmi8nZRmbeTuhu\nLMKBgeUmA41DxlHTsytJ49O254AuSu+yKx369wKhoxTkHOlbM9AI8VPnP2+E\nNn27A2MGyeyqEryn5fX2Jc1emyV1oruUknlxbWcjMSGzF07mtseS5F/MfwGR\ng9d5ftdNzBqOSUFJH9AJEiv2xKIKonMYX9PqYIJUK5o8qkKmLGaKUB1rZOcn\n9aNtnX3wRJuRxY5N5FSfKVJLfF0HpPJojs8ketpU5EqO1DnaliZjuoPoEypc\npzXxDWqxGsAPeQP7kCHQV10VFX2zRpWhcQX3jQjY5NE0TnX9lEMJsZ0ft2lS\nzNF5IXPHmL4Qc79Qn0cstRx0FsC/hocvtjuMbx6+Q0C37Hz6QtJh6JLTT/2s\n3XAN0jx6iFiPHtdDYXqO3u/S0jAeC8fg/Tr48fxLShp37F+lG6qd+MdX2EBO\nOOXTwtQvWe5zbMN+v0U3s/u8Vn6mJMo1BT3OKQPrxC93c4HvO3UlTlkku64w\nwdf2lbE0Xqcz4odLN+0cmeAyEgslSyhKeWjGyYnYTPQQdH5oDMB+2hobTmUL\nag7c4U1TaD7HOuAhyuKzEK2LSXXAW60FwT21y5eiCJFdTc+r1VmppDT5uF9x\nsS+i\r\n=imZN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEThu+4/DiqjdfAI+gSwlobxglbAXqNUKnVxtdfc59teAiBx1baTIVeX2ILupQlQMwe7WG3P9049gCTqDDOtnejmAQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0_1587652011560_0.7511536073169667"},"_hasShrinkwrap":false},"1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest --runInBand --detectOpenHandles","test:ci":"run-s test:coverage","test:coverage":"jest --collect-coverage --runInBand --detectOpenHandles","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false --runInBand --detectOpenHandles","types":"tsc --noEmit"},"version":"1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0","gitHead":"9b0ed6624426ec123a797ec49546a1f2518c6ed0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kDqJX25863aWBZ+hrBCuB5TI2dOugL6ieSGCN7pvW5FpC77M4HHE2ZJL5smmCZc9Yn37khLCI6lUrusY1+ClEQ==","shasum":"ab57e4ab6c15b5e93c7592cd48d5810c002ce5b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0.tgz","fileCount":22,"unpackedSize":121590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeobkhCRA9TVsSAnZWagAASqoP/10D0spgz7wgygo+4vWZ\nmtFooylIEp8rAf+f6nv/nP7DV23gPH+6aycoycig5oucy//cxhvfvDqKJl85\nfB6/lj3NRpuV/yTitqkxtIGv7gbWv8TEMUL8cDOOG20wj5l2NCiw/tDcMtBv\nRfWuUdchdld9g9bFuUIDQg3uUxQyf290WIE1xEioLY8Zhr1XyEeoP0tyU878\nWTc7XhATw5crYvc1JmoVwrc5u6zfRtI1/7QdZnXbz23yq+3bDp/Y6g1O/5Cm\n8Z06mxb+VXb7VB3sh2NDJxCPPcG6BnxjsEGGBpcBNKDsI/Ve+cfLTKORXMU3\njXFu9CdJxcCoX4ee9yQAQPAfEuIKvKcG11PVVgVUkGHfqLgdmYK/MTXjqCCJ\nQ7kU6OHP6IfV1swdCNiUDvwcUsBjYa+qewS4/hYR6/InybIACrGYFFn2QRDY\nl5KNEBsaCo/GichnCS8vaF7LA8BSCXCaAajAmkS5uDRHUqgmV9U1GC2eFoF1\nwxS3EpzBbGOvo8PAmLaI13pYsIrvDXTtgJ9sPX4IpWh5t+n/SORijISSh1Hd\ncJ3KAsbT79eQkCFZln+rbIPtYWxMYAbS1QHZcayALno2A+rOe4nfBcqNMjzN\ncg/60/93zErgoqSg4Lq6VIgZhYKNYnZ07BmhBhwsWJ0Qukk/EixMwNecXaKP\nU+Nk\r\n=LJJB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDzyZdHnMqGsYR+CWZzxiGh3sWRpjCzgnY6QsVBO6H8wAiAsdM1Op9obvemutmIElAIemum2cN/DDW562sndQo4Vmg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0_1587656992608_0.14083426902225193"},"_hasShrinkwrap":false},"1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"run-s --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0","gitHead":"83fbf417ab43e7a92f8ba996d6b7bbcee10d1988","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9EjVLXfdhXaSs9pqJdVbGLC8DFiEdwGqirc3ZHl21Aqdl9Kr+0l/mDL8km4dh3GpS4+QucR0YKzd+CIrlmy7gA==","shasum":"fb910b6874f4b6ed67bc1f0d9f4fd567e8665b4d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0.tgz","fileCount":22,"unpackedSize":119741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoo/cCRA9TVsSAnZWagAA9k4P/0tzJPjZJKyveZaQSI0L\n7s5+D0mqGvMb9coA5oAvm+LtK3hhjPfjrRXQGork17uWqetQkCELKjYZj4iq\n21DNlH2vYFyB7t8+fJ1vzh4+XQy7rwWijYPvIczgkp2YPtIFiM82ZMMI7pRz\nVJmhpWl61TCKOtZ9MkEhQIiACWs2wOCDR8RS0kK30PNGkgQ4B/JtmFrxToQg\nKQIT1NWiiz2NRAfEcgGroq5WmPxdScIkNqYS3n1VvjXUHBEaVqSKySFvgC7n\nMMcgQ8V5Xiq8eC6OEUha77JTZcmLcPwYTLIbPHNU5sTDcAkfLs1xB0pKMuPD\noPb+7OJUoM4uRdHsqRWBK7V6UtJ/7uOD5keqvgmB0pFEUXXXaznZQcy6j2G8\n+T7CquYQ4kyaxGgWxywXDrlTocZrWXhoCa7cUPYaLorAbvBK/bgujojjquiY\n/+ADZdphFLk36s2I0GXFgfFfvEBANxWT0wxh3e5/W2eMHVHF0ic3A9zydgm7\nOT+C8cdbIHglCwrnv+XML8O0m9Enm+sW+3PTVCWOWZwimGSHasO6AW+daCoW\nYekq1NcztmsHfHggUHa6PhMwpKyf7rfs0+tImYafdy+L+ZRoFCH/1kkdweA/\nyG7TABLwGtFRLeduTOWS/b/j7+fyQ1/+AqBua8Hoxqq9+qEhsUZVvJhan9Uj\nuYOt\r\n=cIcv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOuyMh+0Mo0CfcOuLb5zIBz9lv60YMHKA4WFaYUp5jFAiADdvgAbK7d8pz8gO0dvfy/5q5tgeLzNxWr1MZ/d/kmZQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0_1587711964107_0.45078015980980535"},"_hasShrinkwrap":false},"1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"run-s --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0","gitHead":"7058b0ba9a2fe25bd1158b46deb4c612c09952a4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of firestore utilities.\n\n## Usage\n\n<!--  -->\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-p5ma5+BDTEGiGuOcBocL/9z7VATSzFI0IzhLKzdQlxJZOmTMSu8zIU8l6uutNbvlYOZInPuOpJHPV6Sc7MqEVA==","shasum":"0c7e438906a759c0e628fb896addfca511918fcb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0.tgz","fileCount":22,"unpackedSize":119871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeopBtCRA9TVsSAnZWagAAwusQAJXddqDjLg5omGDEcXLH\nzTAdRruKiTi7ZcXarmMEFbuRRNSFlmm04myWfT3BWNknjpVRUINnN0pu8ZMz\nL6YGWUiV7Ia8q3DiaDnQ5ZafdXpAYYF5h/LNOVr5t/arhbcL0fVgOlhv2SjH\nPaY+MX2s8LYWjeI5GKGAB6bD1wubOSAxAHa3X+HDeHI9nm1WFpEkbSiqjQ0t\nseMTG6JUmdFced+GYKDRy8FQfx/VwcW6FIxofw0EuSflyWgixORQmIPJOAus\n+AmvJmTwrW5NmtOfVDMXgJi185+0ziWtcRgqz3LfqDLA0IjCQ/K5aV/RQ/aj\nNMa7wwNFHeCVp0mKYB5dV8XHKKPh4eivJluChT2hpBUK5w8GMd0gCgN1xFx2\nVnmJniP9qIYD457gfHPxRRTJJWs9cI29ii1DwV1QkZvJa1n7L/r9bNhLI/vM\nM9R4Jdx5Nx8GUNg7nJ1KEvUp29bimN4wGSNViUwabKGgcdI3+Pz+XK5CF/bh\nxKKoj7GaAqxBKMnDBmeD+OjmiaUenKp71ehgwvIkrUzE0kFr8hFA4CZXF/hs\nnVwGsJNg1I56DopUwkLRdS2AtXaXqcbU2XVu5DBnRBZsY+H/FtA1jX2UPcZ1\n5ARZGLPFhLdF7crBIsRvR3DQHcf+cB5ggPuATMOytJ2kAt+QnGnf/xNt9atI\n24Zx\r\n=53cH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCblD53uVulvDcA57yUMbjfZ2Vk9LC4nenr6kYt9Jhy2QIgW/gkjcAZ8TN2iw9g0483tuNN2MyNckSM5STFsnCBIz4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0_1587712109315_0.0850624370611166"},"_hasShrinkwrap":false},"1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"run-s --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0","gitHead":"2790bf1298ed68b19fb339dd635d5e1609432326","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IB99LAbPsMgolRX4H56i2baARBO/Y8m6Q0ZmUTacnwMV8uuP6t0qtIzNMcMizMHnl0fM5s/y22NLZw1/FBngnA==","shasum":"e18fb0e762aa34144caa9453c6b4e6d6d6ff92dc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0.tgz","fileCount":21,"unpackedSize":119844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeopLTCRA9TVsSAnZWagAAbSYP/1kDjU1JgqCvKsNpVTjs\n1QpPJWMgy605tud86L3wNrD6kZlpHVVlt+j+2ODobtN+oES+3IoDQsUwdtgf\nNc/QUlTOe6IXLbafLgBol2eJFRBuUn5QHJ3wo8jFPMNKtu7+i9SjBQchSMWG\n3nldJAUnnJzrDj/PTV4+dEOTqk0TtJFQkjOrwRC8L7XJso0iTlJyWA7LctSe\nwH2Mt9RbWVCCiGn0rWKfyaWq2brcL1uOSkgQn5xJSyaxR1rX+cZrVH+mWHK2\nYUcImOEd5yKLKFET+e0B4RnFwGFIFn3Q4Dh6q863Rljj+CzqTXijJfP6yY3+\nBenfyYSEU2K/cGJbC/SkkBxFUAv1G9kdaTq31VU5rSPiOi2t8822Ml6ZEZ4k\nchxyORESrQ97RPJxg4ifxBxhjrqqSXx6YG/IKwOfVzly6hnLjZoSaXNClZKE\nEO5F4Cp9Bg2BrgnjreMe5nrUU/xo2VvWtA+xcMpOP/I0eC5Me0oo0lD6FmlW\nsSYdd+Mtk7qtTr/nCZ8lTKuzqkQWHG74w25yDweaQcXcLaNVX62nvYw6aVQP\n8ocUzmMzDWmuFjfn9oEyCBfyZE+nub1skywRlJjG/0Z9Y0m8jAGySPmUXYgT\nRmng/5s/vKfckEX/mxdyrKGLw66IPB0/9qeXZFTrVnYfnRLSN56DUUstjaJ6\nyDQ+\r\n=FEIf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxn5bt0BTUKFGLbH75kIfZ9df2wlhdxlRxpeLyqCqp5wIhAKRQlD8CKEdilm7x2+p+cJRHQNmtMlRhAo02YvT2uy0V"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0_1587712723393_0.9395181744135148"},"_hasShrinkwrap":false},"1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0","gitHead":"d6194a47b6aa0be87e6d5ce67d630f0cf863135d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/LNHUbWJVzCBa3Kx+khkFip/hZ8oYyoWdfZtByPkZ1MIHItoYswsI95a6TQYDblWIdwmTtKfLhUUjYhucj6Nsw==","shasum":"d33b3f4a27167c93b7c1fbed02c17ece12bbe8cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0.tgz","fileCount":21,"unpackedSize":119843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeopPECRA9TVsSAnZWagAAl8gP+QEH4dT4U2fka/WsYKbQ\nv2Ke4m0xt8dx7fJcQ/iqXFwICQ/bJiRadtoTz1ll4sN7/Q2SdXvnGr01xuqH\nN8eyz4qytL4rj4vnGPgESdo8HO+QPnH1uKCaY/XQEDKk9BYBhJPK2Szd9jET\n6GJVO2XQJ2zSVsoyVI8W/ZKDVKyMe8LOFzoTTX3fqiLW9qzaAs4/YpCqAPkL\nBAZAlmjqaotqasju5xtNhm5ALgPqfIDO2TByea8gfxYhkRbsE0fe5mLaBRgS\nbEV3Xxy694W9Xk2cOuFvsnB6mOYGSolW82OUwfJvi+EJ12soOuj/SRwQ3J7y\nuPgwc8WLJW0LslziNj8IYlWBMQsSUuYsrE+1IGYT3jypHbunFOAWCw8PyWq8\nzC16A1sjBFUvmQHvvBJwou4nxbr0fZc3jts2sqRW3/jqYPeGMCEGqNvPLIAR\nrKmZz7Ekrz73aVCHqD95ndZ0Vl+HOIEqdRc438TwPwiHunWB1hSXV9y1Kvv6\n3yZPTLBtMX9blQjuN9p+1Iaan0X1Z7Jb9QnetG995buZ6LwI7zzhpNQcJhGp\ntLf7R9ckvtJRmnO9o6Dmf7F2Gpo+DTQCkmpmNk3Xl8x1CsbguvRDS5NZNqjK\nq4JF2FsNrFAXTGDOUlaFBOUZPJ3rehvYkzb/nk/CeqXjoIfpP7cV72/785mC\n4Qch\r\n=SkBU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzSHgICd9+wvciqA7hZ+C1NeUJPyYqjp6tUs63G6lytQIhAIKWFyH7voS3AGGfn9C0Ja7Mr1IRLeBiOnYC4wdfogHm"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0_1587712964285_0.7316401903150733"},"_hasShrinkwrap":false},"1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c1a532a9a376f829057d10ec760fd2e0b35b1100","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NE33SojlfRLN85+mNnuysP6VbhNkGgDK0wLUorDC3+mdgua2/TyNOxu2A/ognINyhwa5LYtPT0RDou3ztAgkEw==","shasum":"6fafa05e03a36843eaffc9efd5f0f838d9acca2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0.tgz","fileCount":21,"unpackedSize":119843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoqxGCRA9TVsSAnZWagAACp0P+wUJpHyB4/5AbnGG+5+q\nQkjGTMPucdzlQErH2Gmnb6U4up6LCRhr7hABApUBC71dlqH5tcPISxztPsBp\nAs7N02ZI3mKhzQFJBpmRr9iWT4fXUKpFOg3lfreKP1+6p57V/6aiM3sSMkzI\nyroDxeWS/VLeOpCIt6D7gvc+mSDvstfxrbMKdkd/E47zVutSZi749UmJgWvj\nhh+9+oEM6Dv1beA7WnwAM9VvmNB0MWggZUU58uox7HbSn1JVf7fAKBoNAgMZ\nUzYnALoKkxBhvEU9sVIcIWxh+t/z9fRPf8EvllubabSgpu17ioh7KgQ0CsWu\nPKNYTDBSm8sa6NPSWhXlZ+DFSNeIOFKkca4EyMT1tHk2ElQKMxKGj/xgsNLH\nJOBGBkKJzYz4oxNGRmfnMkHtkrw20MiBYONXiLwho2kkpkzP5N8nZYl+TJdL\n0L3FZ6m9Cw2OvWzdpdm3dpAcklrMDo0+tQUepK9guC7DDbpfzH1rdLIObxvX\nV9i+M+cYWO7WWY/R/7nXHVMMMAVjZ6PuJB4OoI5w+23jCBeJZ1sqgu0PdRKK\n/bB9n3KvDRFo8CKhpv7XM/Fn1Pcbs05N45SC8lO2CGlg/+rE8O6PF/eHSXCX\nQl9UKP9hiT8B6sEOeTjLiTvUFdVp0q6+/XmGkeWlzx9YwmZJ7G0FiiQE32NT\nQ4rF\r\n=5n28\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTMwaf8hMhOOwcuMBicD/zxfOCp0PHNORqELhW9KpWzgIhALGI4YT7jsAthHNlnlytxkvSwt+ZqlNgSIENOOlk1+PI"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0_1587719237678_0.36112257772495937"},"_hasShrinkwrap":false},"2.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.0","gitHead":"dd8a5d5430eb1a65904b735c652d324c963fe817","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sgdffdgOqpzW1x+z4U9gZ8xxda2BwdS6JfbkW1XjfXFETIxx2udQmPqvnwBLBpXbjE1QynLzohhKBDOcF+Eedw==","shasum":"7eb245dbcebf722986909a614b3fc648121dd671","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.0.tgz","fileCount":21,"unpackedSize":120202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoqxZCRA9TVsSAnZWagAAlRkP/jaOa3jKqfwKUBzn3g4i\n5/cvxoPHOIiGOjfF92wfqzE0rAAKqACQKBQKvRT+TPgfs8jWM+8cscZ9J5uB\nSm1JslEk3sCcCbtaOObw05vGteRFBWUIHxuVtCVRQg10P0L08mxe64GRKhhS\nvaEHyrGj1WIoXuU7fmBOnJN0YekKbfEsAV75nSnyXu7auMzGgS392e4inD3W\nunecIj2fMdl7zBaIv3nweyeXn8o9OV1ckulEHZ6ADpKUc9xtqoDcNo/YiUiA\nHVmB4KYGf0slzfMzQmzZcaHby73/FSg1Mwh2JWseqWcBzPOHlxex7oqRkc1t\nS3i7dKfFgGV5cuK9fMXxZ4rwRKWCQjD4+gLRdYHBEGjTyZ0CJ0QvB5lDabec\nl0DR8Q3T0Cz6SZlbL98dhImvu0VV/yi8KjuFkhsxnNmxtGrLe0R3/CDa6waR\nZr8S8ngUluWUwDa4b8gU4b0lwteVZPltrIJtfcX+awHNROJM0mgvrfzm6/88\nqIGsL0ahRHApG6KWSZVO1jysaeY8ZkyuZqyHAyq8qJm2Vdpm1j8Xu5+ZK9YY\nLSG1RqdVf4aPhu9Rp0ENBP87ol5WxM29uIaQvh8qVqrAgixSGJUPWnFNoWJy\n4wl4R71cAGNJcccZdKEosjMsfSZuWoHR46LEK2mYhBZUjSWJN16XDDzxVpl4\n3Cch\r\n=OLmT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzTGz7wPZ3LoVU4TKkcCHxPdtTQsqnOH5NeHx01rKMwQIgHJcuJ7rrMKFxNFdnuQ8bGRWUyvQM/aabEZ31wuwJ1Xk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.0_1587719257280_0.6963982333149914"},"_hasShrinkwrap":false},"2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dd8a5d5430eb1a65904b735c652d324c963fe817","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-peONB+gizdbi5wGmjHtAPJDzTYqkk4m8i5qXnm9RoBvGCgFGl7r7rJDtnzw44jIiDcxrr890dZrBA0vgDpR80w==","shasum":"0a4e344a09a202241281ada849ec3b780da97fde","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0.tgz","fileCount":21,"unpackedSize":120245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoqx8CRA9TVsSAnZWagAAC+YP/j4o/r/rvic//xelHsWA\nEGb3a2lJ/oPPPeZjyWCRwxebkAgyhhyihVXj5W54IK3sAFN26AnQU/3dehM9\n7+QoMNJFiZq75lY0pJHQg2NrO5NNKhU6y3tbKTaJl/xccF9pgHfds3NqpGTP\nQ3MbCz4qJ5ylOS+tMCwOG9b3yJY7zg8iMoQv6qIDNN9+05UkwUI6GzdW3kKR\nr/L4PNEEnZ66MqQTFyrlvzkmL8ulGZg7Wvzz78qxjhGfBj6fFibCFdTvsFpo\naFkg5OZYEFSpKLXIWdeHl5cuSKS36IOJIAq7MmrgRkV58B1cf91OBa0tO20l\nFYq87UN+v+VDpPgN+nGuRD2MXWd2AqB+HYseZ+s1DLNQEKFAYuGvq0WasrMg\nVIFofwOhOStpXXFnROnru3icsJJ2gUqqJ8lS8QjlHUKPopnTginSTmLruLCI\nFJKVc3EftruJxGwGBbf65GbC47nruGv0kNBUIaVKhoM8C9pPnHBXUrbM4Oa5\nDAKMdkevDhbetu35U6yVXyERT+93VHLdwH4puDFb0xWWkKCWTFTaxcfNTeOg\n7cKu87JBI949UkVnLUlVo/rlyY1AAaC3F+FKuNXtlCul49/IWVjvPHz22mxe\nJ+DOfRhVIXx06u0ey8JSBDClXQtC4X1Ik9eNVMqvF++NZIwgKHd3BHYJXY/j\ndp8Y\r\n=v5wd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBVDY3rPL2PASi595lmNT+stxqbIg70CEmOp4CvL9vEOAiBaJg4BS+0ZkyQjBT2a74s5XvgKDU1F8IeeumLvhLZe1Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0_1587719291879_0.6464748927032038"},"_hasShrinkwrap":false},"2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0","gitHead":"5e01d93e0c214405686df7c471b35cc954a31ebd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZKPnDPhuFbeJpSEtfRjFVTRaOAOBwuwvH4F2CS2RSpr6uvS4uknoldp25yuhAHNraXmg7XDFiiqgfSA8d+cTaw==","shasum":"8378f492c857eb988ec8a78bd6893668234f497a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0.tgz","fileCount":21,"unpackedSize":120245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo605CRA9TVsSAnZWagAACTkP/RwaSa9n50shcBzBo5bd\nMk3YqXgkdATcKyB8mVklJQjAcuBjwuwDRspZaFs+pEbUJzd5aizKZVw44CO7\nIHX1t3qspJztHig86eOTEPH2RFNoaR47nPkRzhQ+HBL5yZSMbWHy0PeCcGO3\nkT4yfM5KcayJWEfthkxApi0dmnNu0LUP/EuAc6JaeWRhNHLFyXyfjydfeJFv\nzj5FOaBMBg5Znf+n2ZqySJV91MG7KvbL7jMCykzotk9Aj82cKIfHQzmTAoyr\na0PROAjv0AYAr4lYEQkV9Uk3ZOFAywZWVKCrlMKMirGFO/cZ/+dfDkevKUDD\nEVB0HPkLJE88dVKlpaTaIut+qylpTCgZnmsXUR/E1dUomsaE+UvcwCz05gi3\n0MmedF19wAa/RApd3Mgmjpg9SvhPgwEdWqtEYWW5/rFj8MJG0VitBZOEYLyJ\nK4rrriaU+n+p2WdN00sL1ApWX/H4VtxrFyFMZ28qcwX2k7qHk7vb8XrId7GY\nbjFuXB8HKeI52SCF89sLt23pUMDC3JA5daLzhkSLTkBlIeBpIOaqwdYVG+tO\nhX0B6/ms6NA+vX/oGp8rGdAF5JoqQrxHHgYisl0H8KuoVSrlOJHM8tMiDkSK\nmXBxMXqz1K+9pCpVFs4RxF1heDRRS9ryvKQ7UUv8vmjcPZxu4WHyKEOWpwnQ\nMtcf\r\n=RMZT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS/bL0SH/OVvVACZDjDl2FSkjCVBBn2BGExtSyfmsSwAIhAM7qG+rqeLKYhvCIVQs1n/gVx96bKU1CrrpLmyz31e9X"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0_1587785016661_0.9936930380013362"},"_hasShrinkwrap":false},"2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"93709ebe0ad93d0596585db9fcf4cadb8ba7a5de","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jAPEej5tFijf8DJQ5DPvhddfJCKvcRI9crxor5tlVKX3/z0Jnl/ZD8xUNPKVC3h7HV/1K3thYQrcvGMqvwaSlQ==","shasum":"73a3ba28790d7bdd020b2622cd7d9de767dc574f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0.tgz","fileCount":21,"unpackedSize":120245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo62aCRA9TVsSAnZWagAAX+0QAII3EBhw/hYctHn4bFqr\n1xh/GUdck7Vcvm8vFhfa7uDlkmteIBTisBOKLEsgixVlMt5fLnkP8+Qkk7EA\ngIgd19PQ9O3E1saX5zoeyL1KF13L/5BeTxeNIBRqRALGoOtS0BL9lHc5BFXm\nW7qlCjBGp+2jLl3ZZiJAqma8KRcqACUrcWtaBp2Yde5xDADcJVqIUkO6gkxz\nTDsNemnesOaCVo/ugSMWPKYZDy6ue9O/2cMY0wgTAD8697q5bYPe88vvYgke\nkpdFDapAn5rW+ATtKBs8YfLpsXKoNDzIx5May5VmgzY4dnaNVHlcl5BZ+yBV\n0Z5MPeXj3Qy6HL9vhWR3Lx1zSSliC99xhZnD2OPBjoMwDYX8hEfRXaFioL+K\n1jU2H/UA+57lO6l+Qy3V5Rmf+Bz+cfEXIUCeiw9bO/3sQ+GyCZqM1gVsPkqB\nGRNokpzWfKvwfSeJtRn50PR8J9ZB6zUkhcRahn1933UQWbljBkNhQo+i1X0i\nhgn2EzujK5G9mJljQyz4dDHPghDd1EiRTQBf2i1EmiooWnQVOyoWsZ6RnMoa\nshy/wFjBq0znJo3fQQujy+dIvZ7emFWXqHtk7mwIEUf1AhYajwtFs66jHIKy\nXXxUcACid76M8h78OSNboILz5wDhbrwRuFdbdkjJWNQQKCWh2TLMGUnWPP/b\nqNpP\r\n=hzkg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/om+U1xqJVN7PTj55pTwNGurwbJkTpuxKHUSyAn/KtQIgKcXbiq5knNmCRe0tKqsQg6pTReBkDtJRwyHsWlmdlME="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0_1587785113840_0.483261561299009"},"_hasShrinkwrap":false},"2.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.1","gitHead":"0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rNyio6bC4DCGgS4HPtmslY6aS1/rnYBDCGWj2jsS5qUqTQgLWdl36CRkre2jOJYxhaOWTHUkAMP0Q4su/iQUTA==","shasum":"6b2a81b0c61d80257680c356c37ed5b9612bf599","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.1.tgz","fileCount":21,"unpackedSize":120487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo62qCRA9TVsSAnZWagAAGewP/2DpIL/dioAsXhsRt2Jp\nVMVwwINfdFDPfhE8x9dLLw7qqOeukyzMY5mOruZEHLY93+j0lAaP3yZrXqUm\ncjnTZeHsT82FB6Anrrx/9tbPU/MoxVGSf0pLyh3tVvqZTCr1IwI878vQuKed\n5ho8FT0MOIhK3vv/vIWFyLR2RoZBJwb143yURMqCdNxuqevYYfN/HzGav5Xx\nGy7HgUz5dnSaygi2iyD7KWjpduiUm89VAVVG6IesuDpOnrM71ZsydqB0RymJ\nfefMyhYGuNGa8/p4ntJTiKAGiFrgqHaibpYNHjFkJYwE35Fc14Ng1B88PLPB\nvGN4oZUeuRqYKo9A1zmH0hkUkKWr+QgcbhqiUMaM825NurvJF+Smz83c22kt\naxJI9iwBBfh5ON+Lds/yVb+tuK62hwJZT349sCNeAWc5zI510wUuB3t+Liyx\nYuzeCNvXRwjcKVCqVKgrpDVahpen30y8mDJhhbmFrZ4ZibaDHfCEle31fbnZ\nTR99JKz4y6XL2//mmOqzV6C7nQkLJRjHEKoiFfyJW+IaGabm1RRibSb6bB8o\nARaPoPu1/zlqh7ge/bmqAi5WaG4GIqWbyFK5jRfC16Gd1QT9Duyx89KG7IXa\nGhccjRAP1KRJd9zEI6xKGtZJ8/XQ0gLpMFZrB+oQsmY53ZIaPaw/a+8yk/za\nLvsU\r\n=n9v6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA4izdkG5fXZOU5LI62T0ZclVgXoBpmfXlsqypfs3tZSAiBet91BlERJM4Zoon+XTrGBdfTiLoC9YoYlforYu6XbSA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.1_1587785129862_0.5337666760846349"},"_hasShrinkwrap":false},"2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xJI6hkn5H59Z5yTld9BNiZKlj4rhsdVjpxP8s+oWAZtbMmDXsMMIXlbRA24e2HBcl3+216O1aRrLMSmbMgJeXQ==","shasum":"0fbd1208586769b29f2e03f6e1e6c2c90bac85af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0.tgz","fileCount":21,"unpackedSize":120530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo63HCRA9TVsSAnZWagAA1/wQAJBBPwpB4NhJ/e+VCPoS\ndHzGjR8CP/pdckE4+Mw2gdHyL/CLsUAsdc/qJ2pfm7mauU8R60ypogrJ5Hiv\nNSP3R0ccRvAVdTNXAQOlCpcccfcxiSe9Ag50KM0xTTZj5Qxh/jUBMpHm5wkV\nzbZNN4K+tyIMdzU5I59OilitsIdQzRfhV6TlFZ9jfr/xH7XnhGsxUwqemPrb\niodytwlt6bCDWwNw62fSPU8NPLIrwPyERIPKknQ4DBBNfubewb84lGfX+xkV\nR8jESYGqyTgKLcWZrrJg7EiBz1ARHTB6fF+luDTKXwJSOL3YKpAqNN+WSxNA\nhj8HimaPex4M03vG7b4KGjcGMkGGmaaOQqcJVrG7OntqYzRc132BObo9E68X\ndmd7nUGyGAAsJv1jbWdyekzaWsC9O7Pm5g8V+v68sx7Ifi6TkT1IhzuhBaAw\n/WHWCnjSkUlwwbCviVAl/lXxiIBfqbtBg0ndiTgFcHg7TMfaIPPmF3N8JdrF\nsAcvOy8wONMAu8weoRHoIOm2GJoHu28xE6UWtUsfq5DrjXXcIrtfw3Nks7nG\nnjyZ5xQ3L3gu0Pqirad2YliAv0bfqV7AsS8e8v4MXCveG41O0mW+WVCM8HP5\nJg4YK/t3PHGPJoM7JyHd6l4vwAFAuIrIsOlAttHPUWlJuYwljQLmj/0Kvrss\nTcrk\r\n=WyWT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkdURQdQfjhPvjjFykTBYbPoqjIt7u8YLmLlCXlC/M9wIgO3usHijt/AK0cBDdIuB13/NMzP354jWc41NzC72B+2s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0_1587785158774_0.0022494706387847785"},"_hasShrinkwrap":false},"2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0","gitHead":"5ba6757e04742428c6b92acd7b3f637574e1d8a7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Wf+NyhIL228VgTf3a6IcapWzZW+KhSsC2obkw5Vc25sm96VPuLonnxucJ1Jxw/FQ/EqUloomM/l2qGP6CEGqTQ==","shasum":"857710203538dcc3eefe02ebd34dd3034e71da71","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0.tgz","fileCount":21,"unpackedSize":120530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepSM6CRA9TVsSAnZWagAASaUP/0mptqzdVzLCv91zU6gA\nye8BMF00kNkY5Vq4+VrA39it+ylmH/OqX7qQEBIBQwmMMTk0q04DaTl7X3dD\nCXMppkNdUhf51jqzCaiLynnieEFQQODqKmQv4oJgRu6ycN8Ugil28P9dm1lm\nM/30ng7VdyZNxLCR1TRY8qpVo1zYj5pmYr1EQ7xgYjs6KUNnCBrTcz6gqmT+\nj3Bvou+Ux1/kKZ+iNnIG4BsV3UNv9oh2+o+s1kfm03jPUR9OnqclFVKSMLgw\nsfN6gkv9ZCEZS/o13fvcUbNA7DgHoCeoDXkr9DG0Rvv+EG1DDOawDgcX3R/b\n1FMI2aW3msiSk4cKfAL0T90gQ5HvtoHjxTf3mw/EZ4NPMiotyiuKef1c7r0F\nxQKDvcjhYqD06rovlOMZf5fpgEI3GSkwC9sBODY8J014PB/7eBpYM/TBtDJO\nqe8p1nhDoGpdhF9xdqmlSe2lhhB7Qho83b4KNhzUwRByL0fiEFP4wLjbWwp9\nH2nTBqcvAtP6qnvp5pt5Sf9etsW+wXyL+YfHCwFz78o7l3RNcm9TNaAAddVe\nrCDmWKpsJzpQ+C9TS8LXEkv4nsKJM94VCQoMWazkjLrN+WdAZbg4KtIBL/wj\nqYr3paCX25SCxtqbNsg1J+fEwe7x7RgB11hWu3SOOTTzMNPd7ZL9ICdsOYVd\n9tXg\r\n=XsBI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnVHTXUW0iGJ5DJqyeIlHRwbmWId/hQ43TDoQhSkBTaQIhAL3M6898pPr5gwyNklx9O3JhNEIzJ4H6d6fi/8tbTFue"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0_1587880761977_0.523128883636953"},"_hasShrinkwrap":false},"2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f92bbc24b785e739500e15387e87611cdec9cb2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qFx9iFDnp96J1umBDp344TRr9hhPeFt0AIdl6aJvW7ZwAvFq9wKyOhRWxYyMOg/i+rcUN7Z0TaMx0p7iU+emXQ==","shasum":"16639079f0001551187992ed5ecb905aa16dec5c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0.tgz","fileCount":21,"unpackedSize":120530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepSORCRA9TVsSAnZWagAA20MQAI6fcvHY9B+s11O5w4+R\nHswa0tDfm9wfp6BTZkb7qrj6A+2Ny3/Eu/WA4EIKAXA5f8VnpkQn1vhL8HYV\nYUIob5jUFsbKoZF8P3t4o/R5lzzLgKqbzgfRFdKS4z9e/bGA2lehWdVloXqO\n57ESBYsYdta4Bhpn81sdE7L+bKNhi04/m5CunSmvp2mdgUJMEACmKIa1l9Dp\noJiUqe5YxSASUyc/NdpA0UU3ahI8HifDa8ZLs4ljh/gtyJyKGpyg5vFs1DU8\nTyjML+I6Aij3Lc5Mcd5v3qzD8PZjuf4T+0f1Uw2ee+9UM6H3HcNpvICLKpFx\n7Lm8bYFnqVbSoDMe/yroBlqcSG1Z5yaGi9mVReSpM85ERBTcJ3Djc1rPFiT1\nM1gqgwDVlSxExHOkWJbvmwIJSG85Nm7iLLX+Wxb9lUfNfgiorAjOIeSTb2u6\nJaUD4WSrazourHSsyYAOwkhWJCB2r7phm3bplzJTENnaZk3hp0gPD1kA5DVO\nduVM1xreHZPMNLklrSZlKRlenkrtE8/hNZvd8x0ywzs82/E/2Y1RVtDFUq2O\n5pQRJL/d7V9iThTPo464BPkoNZsZRT1tus8mzNjGr0eK9uMmDJx9NUmK7gSV\nIUe7AP9tDo79LijscYmFnT5SnUk8E5rvcQpOBpx+TpOcuIjqfR0N2Sv3legt\nnMAT\r\n=mhkM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxtCECzHhiI6SqXNtiM4lrASc8OZt57TurOcXSYbexDQIhANFiNWrBhXCtb+j5ejVZpjBd3/Ro1P3/wKyk7lb+G3OI"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0_1587880849062_0.20848985482787907"},"_hasShrinkwrap":false},"2.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.2","gitHead":"c213e43371b595532edcce993c129fa0f4d08ff3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Brh1fHuEBi9W4zuXiETLQOXAz+wnu5HkWeWAHjT/HCJx4ewdX4J28VdNwY4gsHTpgwFifUN7d4aLMDIJOKWHJA==","shasum":"e5333deccf3b8e58b4bc107d906c50f6a18e0c16","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.2.tgz","fileCount":21,"unpackedSize":120760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepSOfCRA9TVsSAnZWagAAH9cP/0SjpY3GacTymJ2HRLXy\nsRc/JkjzUptCw1VzeRn1B3CbFxkHyzhM1H8ICDef1p/TB16UbDsHoOH2Qt+q\n3+ZZcC5Sw8qHgTWH0UOL7XRI/jJ1w8zvs2TgBuC4ge+jWrlUxgYZHTmQ6hVv\nqXnXaVfCgOyT4MyrH4+teLGTtgfZEyPMd2P2cQJaTHMb2+anatbe/F5EoTyu\n0iDVcO6Tn9UWZpktGlAmPgyDb7vcS8nIxjt6VP1xmCvCotLsrhA174kuy+0M\n6xHILyk57DNZ5XjN1AvZqrLTQWT+IkqAxSxnGX6Uu7QAeTqbqC1x1QfX1Mmw\ncXs+IOGv8VJekaaKUCCA9/GMona3g1l9/1wZ7CACuWGIcgK+FqRmjFm3pAcZ\nNnCcbx7+9uVw9VikH1XxTiSSSs6XKKN5IpVMiF2yjv84mF7U9ZfjI9I0OWga\nbHp9wD0P9AUUpxCF6gtQvaZpYEj+03KqDSP/fr1xqSPCh3KurFXOXrk2wXvb\nTjNZaVRpjaguShS1bygHeBmHBYgZ/Ns4/KZJH2u6wNiODWrj3aXejfu3jxce\nwOCaacIiutNBhxyKli3AY4e5NRmarTmoan4nzZsNLb+6oACU6kYxz9wwu4xy\nL4eNsrP1+o6wR8r/UcZ5rROtfu206jtKzoXi/Uj9sK9nIShoq1ivZDwf9Rh2\nIbZV\r\n=46E2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCht2Llur04zXeqguikqxFnv1jOO9GLE6c4/24nsgoU/QIgJtK0q/mEq6tlyB14Wkc6ojKZaJA4IfA/TBN0Ez41eng="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.2_1587880862762_0.7036348767263942"},"_hasShrinkwrap":false},"2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.2","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c213e43371b595532edcce993c129fa0f4d08ff3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sXIAOH46l10fMUtCXcqKFo1RMiMGi2BveEGa7od8WqGajOzUu8Qdkpn2pfArwNQ0raZ8y+A7h9etPQzCQ/pEhA==","shasum":"d8f00b39ebee2412d352848545e09fcbaeb8c9ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0.tgz","fileCount":21,"unpackedSize":120803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepSPBCRA9TVsSAnZWagAAmF4P/1AURcM1UT3F5QiIMsLn\nnFpNNGBayCmYTnIpm2rXn3teMLm06LXj7QwCfXKESBNHRzhqRjPpolet8WWn\nyOg+rQ2g+ubPDe1MNrd8LCvQAAUEJJRpJklEdYpttOehcpjBar7ikOcHEyjK\nBr08JaHrpJBq7iaV2K7O2z2FPrElGdA995FnXl8/JP+9wpyMINrijGERUeF8\n6BbO07abSli/38z188f3KIVQ3AWjJmzxU12X/0yWwVLD9jzqFgo6pMV3paxi\nmHwD6mvf68t6EbeMRaCBIkzyIRvfderk/n5lj3L9aEfd96572YcX+u7Hv50X\nJO+4Wa11F5ocDKl91Wh1Ej7TtUvvldexnI9moPvlsNJM8MfEdfQvv25nPjgY\nw8gmn/W+gQTE13HbtrvdhrIN9UO+60JIGwR5qapJlvrvb3zYKdIvxBAor75P\n0UR5DHNjDSPXmTy1CGEPaLiEor5jU1Diz2LeK2vMCuar5jP83n0myGKKHPzT\nbxIq+49UwbrzLcSC5kSuddZ8qLu38hnJ6vIzT+3W5apZ4OwTsYqtiHs57Oun\n0lPI7R+GL/u16HH398TIW9Llq0tWXwiROSqTjGJZ+DdvCliVZ8ZJCPj7I858\nYHl9Bl3slngEFMVLE2AFysJSxQrcHDKviuqUQc26SAgdLkRu4/VL1wl1ApNh\nPhVY\r\n=hAG8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFANxeQTWKAp3A6dnCfN0BNamkupa9sWQy7+NaNBq7EJAiEAvcXoqAt5fXYC/M5HSE7qfEJh3m2AsOD1EIo5AOePYeI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0_1587880897185_0.487656162037025"},"_hasShrinkwrap":false},"2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.3","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0","gitHead":"79df4ca274bdd541b9bd880c2d6147866dd9e23d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sVNRmTMsWlNZ4N5pM+TUyMg5PHRHPMbaeorZQYT3owL0c11yytTGAyaRRhaDPqxWhAuBYYGO/zOqFtDe3Aa4Lg==","shasum":"16056e44aa4d8bd49bdc74a65a7b4c34ad1d5165","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0.tgz","fileCount":21,"unpackedSize":120803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepbvxCRA9TVsSAnZWagAAVy8QAJbtPUY2deLpYEgvgh+5\n9363Mow8k2QOTuLasHw93jEgHT/UX3UbeJIF4dHoK4xGxETUgGKFNgG6oBmV\n6WTIzmclkeW+o0M59K0NXj8CSzQ4O1T6RaZYmRGz4ggRTUd9u3KhAwvVhJE0\n9RtiXcfgfmrGYgbkollVSbaGIILVck9sxbiJ2n6sZdnfPF17Ee8QDnEmer9u\nftL+D8GcHNavedeaKExoQK46iHfgsIUgVs7UlH2SLyfECsY/p43boSefx7B/\n6r/uCbbfZVQ1fE2H/lLvZxlUm45Nt6Bszxn63f+lftV/MLvOFeLA5Yq4aGbg\nSuxdL4/MWD6LvAp/hthJIEwDTa/oTn7Y0qg7p9UX2b7kxPspSodGyk0ucIqs\nbR/FqjVAMqXpoh1g3ezNNEU2x4Vbxv0qrEGfsQ8DCrHhihDZ2+SJp5EjKl+d\nm2usLZW921iO2TNXo+vpV1zY1hVTknDqHL7V2K513gc8tDZwne3Gfzx1WAek\nvWryyO0Gh/7JwYX7cTbasOxJ441ItM3eTQKk34h1WqiTCvQtmgGtsaBmNIz3\n6FwpjplW3VnOmMnPOdBN9iLYt+T4rVUOv0ElvOJd3Ggewoiyu/tkDRVRHO+d\nxldYRCdUyTVewzNOSXPFonO6BRv7EgzHMwsRrjgojlnmZt+6xV3GgcTvuyVZ\nnDfi\r\n=lTBt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZYCjHDmXcw0Srxq3ST/H4psfZnoSNRjxkj2Il3wzaNAIgENgcgnoSE+bvwx9pLEVjCN1LMtIne4ZXSeuMrpuvRAQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0_1587919857403_0.5722541515113952"},"_hasShrinkwrap":false},"2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.3","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UgecOzsa29SUi6HaV4XtNIFk/4sADfCEMaadVH6XY8CttuPq1U2BN1iOY2qq9GT5XyTaqoWGGsBvKs7F0uip2A==","shasum":"452b8be20e17dd0513d59d72d205c20b8ee6071b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0.tgz","fileCount":21,"unpackedSize":120803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepbxPCRA9TVsSAnZWagAAWhAP/jn7z2GbKAdfP4xC8z8C\nqlzFl8fpzWuGp7l4V9UH28DKR18i73e7zpPK9UFJDhRFMdWKyqaMHcOONSGa\ntLJzFySlKMnvXKvbvf6pXHuwEFyv3wOc7nVEGlsPNUnYZNSPEPtcCZemER5d\nZV0244q0+Mf19wxG5AJcIq96g8+jwcy6P43JYIPOymgfRr9lDJxE6oaYOrRz\n2T0/wXPEvTER2NwRVhd07aes5PVezENHdU1TI5pmGr1ZM9UyDn3oWN+kBXdj\neuAfmI2Y3BTMSADhujGNiHYb2PDHr4xIG7hCjiiiT/qRGOdHKzcwndQgRsXo\nC4NPXgKuektW4hfu1z2zzVIkBvQCgrpaGx2tIn3aWCLAZwKUwjWF1XWHQSiE\nhgRGI/0CHbDWphmvisj5zZ7ee1Fg14+YFbdnvEn9aVP/krBO04ecU3rxaIxz\nUPJ0SrmWVwQjpNquZU5Y4vysHJ41EWkjOylb2CChZUYHXLjKc1EtjTWzvigx\npeM6VzXH9M8xseVThWkCbowCiBjD6eoYtQeI8W8JMHUUmVPj3wGr/cjqiAac\nI5yUF9UzK5Rk8G0QU7arHnsceUc/yUJ6h7nllVKPv7NjgH9snf/QFrLSerrR\ngy9dyKXVYfQ2JJrasrxxO5tZUFWK+dan5i+pd1+tpYxy3TUJnh35tfBtRMoI\naYBh\r\n=+LDz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX/tkcPhuJSQlnf6uVt8dGtd6d20Dlaj/DIp/W+8x/tAiAfce3Niv/0kpt7eNp1sSV75QKYT8wNRUJC9tpPoXY4SQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0_1587919951065_0.13089953572505464"},"_hasShrinkwrap":false},"2.0.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.3","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.3","gitHead":"de51af16a7d8877fcb38b1116bbdd7d47b6a6c60","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.3","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pQoiT+CNS+AQGb+ffgWeFzFVeq1IModVREqFEPG2ZetF9MaoXDeihZjHMnYsh+PMSdPcCbhX9H0OzOCiLoqznw==","shasum":"80ea9e474b6eae9f4c0d35640c07f193b10d992f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.3.tgz","fileCount":21,"unpackedSize":121041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepbxfCRA9TVsSAnZWagAA7JcQAJnss1A13lI4Mh8dAbOF\nP8IRN0/nsz4A9poFNrqzeMO7llVwDGMg6O3SoyXIVoKDuiad9QN+ToyngVaX\nV8W54Lsr55fyVSouRhAwAMS2nLlFtsfdEWNNdZE1L0C/jnHfrgd6zlupBp+D\nL5N2ywJaatX2FnSgzrZinrTuFTteAaTEwSup6Lx9yqM0kJExqry1lEfC+1G4\nPCVmOWT5kCw0iS67XBGj8HEOR99y20dBnM6No6Yzru0UMD/VtFbgR1PGMEC2\nPbKhzFAMGjOtdyp8kDLzHpHYra6LzhG3HvoDZxlryvWoIcqLH0sATpk4i9cF\nwqWdeiLQ86BPdd5fDcEzo5z6J8qO/X4o27AzTRQNHEBktxE4r+PNp7EjvN8t\niW/ph2Im324MllqZcT+NSVWN0g0kADngyBk87Afs0lgAQWMQ82Jv6PsWBMRZ\nj6sRfkU7vW3tHe0XNZbqtdxy7MYDpxtDLf0eUOzBTzGOCqpwOM+fZvQZMOwu\n1FnBVA44OcGJ8PmIuwHr82aZh9f5eCWQYdenVCvWMVgYGjkA1mH4H9pxmqPB\n6SJb+S80hL8Q/rvoQb6HWTu2NUtsuvzphiMgiqsH3gxUYfQFF2YRcbrNGTtv\nlfWocNJAamPRH/LtxQ/y+2xxds+ytfF1wDlgn+Myzmwy4ta/Os+bLpdbmXN4\nKgH8\r\n=qdrA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHplsKkOjZD7G9mT31LEcaU0NOJCtwPt7MAUtlXLWxP8AiEA2k0YhvvrUAHn2mwg+Rm6p62oq4KIFmSFBIfK4w265aA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.3_1587919966654_0.31633003893308853"},"_hasShrinkwrap":false},"2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.3","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"de51af16a7d8877fcb38b1116bbdd7d47b6a6c60","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xi3smMxdO/vidrOsw9zDoJSRf4HqA8LcasntZam3bzggO1BMHemjcoGs4/TFV2OqFQZRwLuSNYL5YMVurNiBpg==","shasum":"c3c5780394c837b17bbde9b4b8e8b7043fddf039","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0.tgz","fileCount":21,"unpackedSize":121084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepbyGCRA9TVsSAnZWagAA3AMQAIQglfEHMAPbLAn+yEdj\nqzL5WSn+737Ow2/z8N/2fKkfcjOqKDd6rWz59U8VJgGo2yM1/UerPFQNdNJo\nIU3cMr30XnPObL0Sek0oBrBNug7gtQedB04yekBx9qnP+FEmjSxLV0qTMEUC\net9L+4c+BneyHrPiqEhZTVoCVRG1YJKc+jt0/vP9MUbMHSjwrhfe8Maiw+co\nJJvMHO8aLBBoIIFMj80K5qUWKYb9QltDqFDkXlYTGEZC3KzdBCYwz2bwgAxw\nHFVdREtEVOgjFtkJ8MpWAsI1KQxYrgfypIvK9e4YuuToPYfM98WG+yOvIAcG\nePXlgBJJOFOHr5PaHPsEbf+8965ap8WSe21Omw/0p9TvLhJlU5FkW/Qw0kOY\nnlGp4XV9kpitG9F3mR0gGA3Lt+88Fam0nGV+j+O4hp/ztAZXXiLIb8jlklc3\nLM9WzTtJH4pjRshhNmiRKmBN2ymJj0CM2jUFHpCMg8BVK9bmNY0QPY0CZ1Pm\n9XrGUSSpyTt49hi8zta91hvfU1/IGrwYHjUsP3mJ068EnMItSniuR5GPg7CQ\nX2k2bdLu9GkrElKWPLC3FYixRa8osLTqNKY8TKIYFARnE48DPBTojvACprlf\nwa0fKdMu8NplC813M1nQo515HxrunbxAGm4sv5CLAjtgBl7SiJ3SdJOHkpfY\nFeQN\r\n=Sz2X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbkLs0p5Mmn0XU/aRNUEVhaWVSZztQurlTXPMDBzwbhgIgOaidLDaQcR682nSBMwQTtp1DWdZ8+x6JzZup5LRm8XM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0_1587920006167_0.6948072136889991"},"_hasShrinkwrap":false},"2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0","gitHead":"18d2a6a5db6fc5c9d8609c5227c5075804a64d30","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GjZmbZdD5h72iGiplSLneiuVcwQPbbTlPv0VLE38MZwdjhCHsQP1CtxhSMLSD1S4Rw7AmE+q1LWV8lNDEdgZtQ==","shasum":"d5737355c81528a34dcc2c1eccf06a3c275afaa7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0.tgz","fileCount":21,"unpackedSize":121084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepcwfCRA9TVsSAnZWagAAz1oP/RdVY3wAvZczluB0Q463\nFKardjjaDw4w3dudLFX2PsvNeZTxtIYVBS6wxQjuCFJVFHYK/87sqiAgjCWR\nDistkY8A58rO8JlAZEKsblucuDV0GboR/yiMpn/mB9N8MpIt243MsbVPTzvq\nKLy+vlE28aMQz8eOW1MIgKGZZoa9xggm97FTmc/TO+GfPBzzo5FUtPRZDbME\nk4d7+IQGAXf2tFypL2a5aa93RfWRw7b3/h3ys1HypsCflz3VooEgv1Bh96Jo\nFYnckxpHO/WQDu/xOfx/iGwe834A55acKkqcE7eyRk5sew7Ry6Vrdkr2Dliv\nt4t6CyKOWeVPzHmY7PwmEX8p6MT/1S0LQz8mBw+gWaK+oRYluSUdGur2rmLy\nhj4ym2lMT2Fd2D8n+wP1zbOk5KdgIOjdOQeGyN5HVATFslALZLls9jrJ6Whl\nWAfQkLBApaG7TL6TtRgz3aaycCjswBX3pjff8hypin5tmXYs9FUyShn5R96w\n8Ax4uZ5+KztTz/CzlAqcHPtR0bh5Np8ntl1ySeOpE4hItjVaKsxI6kTq8ikt\n3aJdUyWvQPAg2Pi+khhnGbF8S2RwdduWHSKBMpnnyVMP3V6xDkl8DbVw5y9z\nI4T4XKEgsgoqVH+u15J8zVLpVReHJMAgVR/g1QVzr4X36yf7LtdKBW90IzWA\na6RM\r\n=Ydjw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOodYiNlAo+/KT584q0VXOrrvL50zgRkO8NEgE+q9ZMAiBJJMIQize/umBfP6ntYgyllwRAvWKZ/SCr4ED+wV/0mg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0_1587923999034_0.3020887927141911"},"_hasShrinkwrap":false},"2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"45df00f32829b6631dc5a3da153e82c9d0ad1c8c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tptSJRrqhaCqgGdkrRZOnjayunaiZC5EpcYO20mEjp8mg0A8S58IB43Epl3v8blRgMXh+dp4akHft4Zr7byCsQ==","shasum":"9b5608f99a4fe4b1d14129c87b84c5793094d119","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0.tgz","fileCount":21,"unpackedSize":121084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepcxzCRA9TVsSAnZWagAAdhwP/jOiWk/fgQe3FnGu7sO+\nYYbJt0ftmGdNBvzgKo5DRN5cqRYWxMYW/gRDksDyqHqW1qqYxjFBg25iE9OT\nnFMUfKGfWgdBoS+1BlDzTeqjIZL0aKNMgiXLkiq/TA5x1hIvAkfdGKEG/nBu\nVmIp/L7n8dLMlJUePAzJE3swL7GeJB0tplE58AxffuqQ4ExVVbVQKdUzrfv8\nmYBe1dWRZTkl7SFDTtWNUyNkPWowJXRQIRc0buyH0jwLS+lM0QtGLjXbh9QS\nO9taSISdNc0k3c0RmWW116CiGnMustbIZ8xSsBGdfGLw7+djp8FAue4ClAuO\nhbESJK7BFCjR7V6AdDYePn3KraXO6sap6IR25an1FHZb426HzwiLZZ9A9TAQ\npvfAjjqWu7xl3RM75OPRd9JX1B6tqtvm2aeDX3TV4GaM7zipZXfmdkGnFxEb\n+a4pQ7jJg7zMUzf0csRfK20X1E/yxJKo3nQmREctqaKaxb9hJ6YuO8o2/qjr\nzXY29XC6hLxR82t5+Q/hj5UYWE58p7uhELIwmITe5bLaUroTwoZxLJfArRXO\nIgxULzyUXdbRJn3F97Z/lP0XvGfHjT7pQsGZrIKG4TOyyZPqbSlT8vs4Aehz\nn4pS3hzb9YIfSWuPiToxA6Og40l73IPdC8rW97ESORV4KU8JRI+MxOxJvVQV\n7heL\r\n=vEYX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXdzVMwPblkIA849dPSp8jiKNxz1S2dwH2FYfQFrgrMAiBIpDBpj5DIm8Iq6GPJjmbbq+t8PUZpO7S5XhlGaSl8eg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0_1587924082452_0.2356536954096613"},"_hasShrinkwrap":false},"2.0.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.4","gitHead":"a49e25c1d8624a009b756da28f1e4815988ce9c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.4","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-14D/wSfE6T3KxPTnJc3oDpIJvoNe4ClSfoEJOtAKByA46YQoI3KUT8tXZ6hAfsp6iKCaX3EWRMq4Fa0nVbxmnw==","shasum":"52aee9d7c56a3ff79aff6c499d9752e3d42c99e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.4.tgz","fileCount":21,"unpackedSize":121322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepcyQCRA9TVsSAnZWagAApRAP/3re3RoG7+nKexumaRN8\nXXhAbKxjKD1L5q3BZWKa2euRugBDkFssCpZ2nisz7c2uRrDMrY1ESvTP8tmg\nLTvVlxz3UfuMI5LHqdVLGlirMtq3k2VivuhS6jzRji2TSx/hPTv4QM+iqSy2\n1WJFHLYB3qQOBxwOIg/t7FVC9/JQq6R05GfwgdelU3gLWnhBI55ZWRQI3Ozc\nGy/mjQcYPJVuSDBRx4tB0d5UcyalleSaqBrIIagXXTPSKKl2pH1fgnO6L7sA\nlLd6rw6G8RztXqJeQc/bJY3SEwPAxWgEEbEt/+2YxSkQ1BwcjXe09C3UbuFN\n00W5mNzDD+gllrlzWtIPW5QQNsej7XST+kr5m3va1d3DuxSKkN6FdTvyO/XU\nWsZZ41EuNcDWKHyKmlm1AsILNHixKvgsbz+eI+/8PHOfnQMrfdOOmX3YijlA\nAkgA2FFllU6jTZtXPQ3egKp2xqkz+j6y72gCJpZ3NoQyWZjfp3Cc+6D0IAAp\nHHDEhIU+XGn+/EaqBv/eY8bqicFTkcuQbQmlwZXoabAQapRr3GmwT9ut7qC5\nU6Hta7uDntEwEYd3CxIGiWumRaZVSEt52M2CBLxumB+9gBLQ+JOxvVgFFZym\nHbTePtxiIQgLJJy1E744HOA+FHAp2SDucu4QUYieQTOMpeCRgznqcvzFT+Yr\nv5/t\r\n=iN1p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHhF+LUGs4e7IY6563nsRe2CxDYdJqN4DC3orhgxrApAIhAM3tuoWlZzF3hmXo5VdwaNVQMO39VMeekneCxdpCDfD9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.4_1587924112213_0.9598837774777642"},"_hasShrinkwrap":false},"2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a49e25c1d8624a009b756da28f1e4815988ce9c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-L5cvHGo+7yDb41sTT+jtKIKdxXMHTfKQIm4Zgm852QWUJRPGqXacJlqC3fHbUsa3nCS1lWjA9+xGv5VdwJ8/Ug==","shasum":"e821b4c41842cd775978c28664b34002d92ba1b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepcy1CRA9TVsSAnZWagAAmzQQAII/MhYzTCR+fHIFjHKP\n+ocMOCQb/9Jn/eupI5NXbtmYRcRI+LksW4RUFew8IqCrC9qx90YLEgQHGI6y\newqA6RrBoguAQaUkph5MI/+9etqXSD21HrjaRwK5SpnaoucLd2kj9F4g5L1N\nIIDVyViZ0n4kRWHYo+T76kldSgWhinTldT2uEskyrio3qYTq7gMKY+1/PbDM\n1jicq/BH+BQhZXh0quudB6S9PoViVJzrkDSbjasnHjpDB2xm5WRZdh4oruzm\nIXZwXjEFM6i7FA0+XO6GyNdkdLKGwuHO+uZZETAw8DSKA9HYBlYnb8YrqwAh\nhKqPU35E2zeMiVWHA/SYOmZwsghNpvQsLipRYsIUwO4e351aLUnjafAQ18Zv\nxYauqlSRoDuSWXoU5vZCjJOZcaISaJ9LNwxgXIivYgM2CDyR2hAQ7+CzKKqA\nV5tQnMjrZ1tZKdBiIE+3edmU39kfTwLTHvERESR7oKrZB2h5Tugs2IAFt60J\nyyV01SvVqQPcuf7/ra8bl9VAHd3FK0yTE1neH14Ge3zDVxUoyKxNaAMbD0ju\njnFfLMlOSutu51fFnYNQAj1RW1VBk3KlFC7Yp+ZShFVaJtFdvm2KGCg0CQGX\n3jRBrKHoSbY/i/qAp/URpQL69fXA8i3E4rIEhTQr7ui8f88+avJU22zAhXXN\nyQGZ\r\n=VYFF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQSBDPlf7lGKfrXIAq2Annt8a6pN+CTdCKOzDBCO5TAAiEA8etnyA3A/57Qog9kNgm3qcedASs+iHkqtsPWsU4T14A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0_1587924148673_0.39268505669006837"},"_hasShrinkwrap":false},"2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.15","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0","gitHead":"d0dfcd8228fb84676a4440196d6daac163527aa3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-cIahmCTNi3lB3IbRwnzyjF7DPe7pkw4SdUzCZXcV6aUZw/VtCRnBu9u6+iWUHtqZrhRv6KPcZpFkvLVkEwwuQA==","shasum":"77779d54298adbf19ae19902194cb67e827a68fd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepzbLCRA9TVsSAnZWagAA0UcP/iVIIM9sBQBB1VLWhTdx\nWJhFRaqPYCs9KdjlUuqli/OXb5gSpjKTPFv9FXjBVQg90EHpX1b7uL6HGYCr\n9meINDsDUwl0sglTeLMhADZNUyX/BkjRl/uqmmQdaUJypH9Xg0ISO1n8WSM7\nWZHAADZed5QPX39uCTvqXDI72s42oSJ1vcnxKTef5f9C5ry87ATp9KXPWlD/\nSwJRVOdMvX/gsXFlgr6/BVTGFdQUjFMZnARadmVPhGcJfiR1JzDHid39v4po\nZ4ni1XuB5QV4rx5hnf3BPSs5hOOl1PKFsRapKaSvxLiHVKusIKU4wXP7gCun\nxx2Jrvz3QhaWRYxUAeTSeQ+ByjffiV66AwqH3vqJmvH8fOyd893SfIz2JUfn\nyQsejfO5tusGGyiWSVEUMQd4DrkbtfE/HNRiigAmHNczcbNZasvRImwELOMm\nFm+jTdihcXH+jZ03yQvZkjQxWNM8CRJgpMmikNFzBCutuYMjzpdSGURG03/5\nThAWkz9xOzlgA2cPCfU51UFPfkfBdkFdMu7Jc5TfoknzAurb9TD+NgVHKh/A\nYLeko0tuLAvSqO7QKsLLfmic26sSxEioQ0uYa976vxH8v/8WHj8GfSF8Le9F\ngpf0L0B+SPEfQX5kcDXKEuMWc8zkhyghabwXEpyoD4WznfYvLBUHGdHsuaCk\nPsXf\r\n=gwJb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/ioLtMbhs0WS88BytAHoYvpm+E3Wa3oJX3PGm2uhtswIgS6vfeFjBjIixEL1Ka24V3L4Po5rMaycSSEtNXMr5vnQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0_1588016842732_0.7216326578016177"},"_hasShrinkwrap":false},"2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.16","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0","gitHead":"c2b33a19dbe9528ff97f11d46e3828046f68a08b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SvxfPz5r/nmZr0r+WCRRUM0QDp/CaWanIKfH/a2kV11jCpR7xEpZwmi0cjhvUCKQHs9LnqHQX9dFkKhOgsl/zw==","shasum":"b9e537e280847ddf5ecea46fc7da44b7f7bb438d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep0QFCRA9TVsSAnZWagAAjxwQAIyx6LvK6u6DFAWumeJz\nMvRtGmdqO//SomoFmh/iF4n5NSeK5dB1fAkp4OJ2uyI0UT32ms/N7MGzlut/\nczy42ztf9PZrPKCGjGeC9EwdIzG5ftTBOr8+B8wXsZYH3yZgtsGlp1sbPjMw\nTOvg2U3PXx1ZD+hbaB7zJ1ktLMVh6KkonHHokB81QBcYJrzJbH+kdwsDtd0l\n/o3RsRsgifxmBbubPfUO16E7tDSdbSiUshTRJ6gqMLrW64eI8soLGCSB/t+t\nTiQuU0tYNqgEAvd39zOf0TFaLhARuBh6zilVMIwJhKFszozu6CpiFfi6sDhf\nx7FPNZahGr8XezGH6naxLXHaFgQ7z8x6JUNgFspCGBmogOlHKkoQth2V0ALG\np/fqd4TqdKi9koKfVjM52LIxjDPzTHLlYnBDa27o6Hgzr+JzN1U+YVjTiJ+E\nT6XzMUHdy4TOe48k7gCxe/x87qHoyagcK6cQ8WrHmmAXpNNEuVO8VEQNhwHC\nKR9zrG1/wn4+++5woKWG7FCxIkvY1jfEtmwOQBvSKzjqLdHrBlQEKjFweCQ2\ndDHtlqa4GWWclR2xihZXScj4F3oIyjPUSvxuhBcwICEkNQYoK9hvU0RgGUQa\n3IXjAlYwUHi0LUgtJ3IHhg7kYhOXXQX2FHKLuzE+E9gGXcfsjypILrZ3/JFd\nFeyT\r\n=hdiX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcnxbiS+JfUGkKez2jvlD0h4o3iQ5/shQNK/XMO+EOpgIgA7yVfSa2ba88xjNH6YOlD8RipAkbg6NxUZJNMbc2RGE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0_1588020228985_0.6474921371607854"},"_hasShrinkwrap":false},"2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0","gitHead":"15aec9eece02b10807e5d4c2eaac4012e10fd6e3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-O2CfGV5ao1mL7U7LxNolHX62dRbKkj+gkmH06FwyQg8Zw7tUhh2/PhQ0l7OitbbW8Y1fnmqTHVdm2r38pkUUug==","shasum":"17aa6340881f8214903a559f8e7a75b4f0f7eafe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqDBYCRA9TVsSAnZWagAAzKAP/0v7kWAwrgX7JI2brkW0\nQv1Ce/0pW/aJJr+CRbi3fibGGqmVOjC2eCsZzS/BC21MROJH+ZJxgwx1q0Tc\nKVWMuvS+szNxegQKMUIrdwRjKBsnKLajikoiOk+29k/jaxfjBYOjnolwbEWC\nONo3y/CEZqYxmRIBivyAiJNIimqbAv6sSriTo5+k3BFvLKfEEuUw+0uifKMZ\niVBPeEmzLkiKlIS6dRm2YjWci+u+dNQP6MKBeRfsorUI2amCby/GIAg/fqiy\nD8en+moXAIizFjJ1zOBeTtAVGzj1b51p5xnU63sCSM4VUCKogJlsN3j74Shu\n/2jkXzBWXs4Yc8E3D3gkw74dh4H525Nu49IYnUgBwbgPn67DKvdx1l0sk3Eg\n1QaodBNy52JWCTS+cSuFGTCm6r+e+bWgdrqaqNHjmSuJxzeExqAfX6TUBkOd\nRo5xaPjoKgJj3fzqHijLmFzPZpN1nuGWqqoUzDW4jIOiMQhVbiB5yp09ZHU+\n+vTydl7ApRFLYEx5HjW7Irq/INTtujI86arekwqLnt/LSwzqw5hm57LIBhSo\n8H20SCkEhvTrVQ73S/qaHxazYltoBE6RvvjSD6xxnTsc9Gg4BcByrstza8w2\nWx1VWWy2JoTtleLhlJZljEuoFrQ8cPKLdxpo4AjbVDPs8Y/Ocw8K6M1YW/i+\nTory\r\n=kr6l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH99JxGySP6o/8nen3xyphrPeIpq29MaR/04LEQo/1iBAiEA235Q6lDj6hPC++kUjHa7UanEqV+hUJHCbc6v9omgOHo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0_1588080727573_0.047967750094957795"},"_hasShrinkwrap":false},"2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.4.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0","gitHead":"4878830d3373c569178abe502fc424ee02816ed1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gY0xnd7AhHnqiNv1ZBXI0PNH8ZvwXCReWu9UN2/JSLTSSB7w+N00plcJFV5NdGE8kYq+tNKgdAJPOTlf3ewZ8A==","shasum":"d2ee5256273808f471714683099fb4fc7dbb7e8d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqFQJCRA9TVsSAnZWagAA1qsP/3mLGVvBVmg2+gYzYREo\nGmyij3wSiM/mNKKP8UYGmTCwpoGCYEKeRvWWAqnlESy7KPTV8OLKT3cCY/n6\nhrk3Y/nlYVKx7zJKANzlL2ENUDtvEl+4fp27OzF2Z2IU3ujFmv3WwUEtu66o\nTjCW3Acjy1vvOCbFJLQ5KcUTzB67OfhRWhqfCtRtuiIyCNepovmGtlr8QmeH\nR5sfzNKu8bwZtL2WAnPGDx8HAaFBD4CmrMWEqDwp++TlWzI6NnmW8c1+79Zx\nR6EPNQof37w7KwKJ9gT5TrsQ5l+LS7OKtuHJQBWn5Fhy8pRMhPL7xNkyQUxz\nDmyYkmHeinjk3cSSr1ureDxrSI2IXTNDKTwC0BgBW0ikXPvzCH2rw1O4hGNx\n1VnTMK0DD1YvFQn5uQMvQv8f1hcwOnhJsRYeYqwSpFnI9EBoEacz/+ES+N9J\nlP7Kste9jGixHvUzELFD8+7D2ULSTXnudL71otDYlFTZkAv+h66RVEfI2xpo\nXio2Yp/PjPInoA+CULVBD8ehUbJKmq6DtPNrm2EuyCU3/qEpsLmkXE09atkV\ndDpMhagpLVn+eBqvEHSF1SjAHSKDrsMwRjljwDtAa8YtGASpZibrxqFkMKgF\nYbhVfKraeUVBBh9tZtz7xw68LhNDzl+5m5cZtKu9Jx++nGc0PPRv6HdjU2IL\nziBL\r\n=AHXl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvEblsMwsZIdm+W7zqhaC1errc+9eZ07YaZVod7+fVZAiBjuhV3SoegHyDqyhR6Z1EkyGWd2dpyB0Me7YdF5iCwAQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0_1588089856923_0.5828818406545817"},"_hasShrinkwrap":false},"2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0","gitHead":"a7423447009d24f2edc6c521686d88164890d0c9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hEUorxkSpXdB6q/l9LdPZA7nbnh+WVmkwORv4+TB5rTXea6QFZcgSlUkYxXbzn++n4dpKTP4wbihakOSoUrzxA==","shasum":"9231a2235a45ddeba7a63faf7633044500570d89","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqInlCRA9TVsSAnZWagAA+L4P/j8bPrLf9/ZPCbDT+8of\nz5wDOqFNog5D/+oM7Xwy0FFZQaPYwOUotkPjk+j3I6Yv57H1Fse5KWNDA+93\n/8VUsS6VtIEllQFKJGRQ79h98Z1WMgMIAaSP4JFeY4pDQAuhu4/nnEBqG9ZV\nmq7srb2ySu8eoxhzOIzjCXNSEaAFf5s5tW/r5OvPRY0dC8EKItQQ6UMWS1bo\n2PV9AVuS4CHPWpCTWZtGCxt1jJFAL0eC03l2DPDDNSI4X6HZZ9CzCBFqMjn2\n1hAj0a6haZvzEcVPPy1M1sVM4aHsjWXsCyiZio8U2u0eFaWLoC2OFIuRa7a+\nOaH32vmhp9kXh8dolKxNAJ4nNprUpjbQnvP5Hq5szI4Oi2ir2aSKnce3WEm3\nxPxwrkrMvP+NaSBiIQ/drAxyiy252MXy2CEjwXg0YkXIXlYlFZnbFBK3ZX2y\nTBeZjhSGKrTvvjiE1Z6+8KA6XVi+Vqd+DjnRsn+fQf0nHTkC4viwqmF1g2Ks\n5MO43PwncwNYo3Xx8Xtkb+4hWceM9M+BBQUkSYkh+/8Jx1xTUVz41pYTvMDq\n9BkR/huzR2G2BZv7ilwVyVpgzsn+DG7YAWBUR4FGIgIzZyK6ybbPbWjdxJ8i\npfMKep5a3yFdFSdOHIWih8swT62/h1xLFEDFVxI6dxbR+2G3MQWoJdGEJ2VT\nOW1M\r\n=+h5v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVuyY+xwT3SQTqDdNC9Lh9eiFnGUpUfKy82YqIdcD6YAiBafFIdE5TAXZL2s+FuxAO2tTxjH6mcf6t9v34UAPhIwA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0_1588103652632_0.5493220115072932"},"_hasShrinkwrap":false},"2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iSwAObBZDEQ2JBojv9vyYQbzL6BfU6/Md7jdTREtxB9yY1Eo+NlmmBvHYYUP57cYiqYKNRrt+p7r1zGxnmS3VA==","shasum":"18267b54fb77d478308266cc198e42b00d2b2909","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0.tgz","fileCount":21,"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIpOCRA9TVsSAnZWagAAPq4P/RNrOk/PhbdWezT0ogh8\nBx0Ap0n9Y9B66ugJDyrw3eCvPtX9woO2L59tTVNJhpA8uj0dMvZwud4SM3Xw\nGVxign3rNxyMdCBZmIWWvm3sSdxCdPTOMOV0R0Dmc52Sv1W8r4Yr4diE0zrs\n5W+n7hN4k1p88LQnx5TNAUmytXpgtAB/AwRvR8Oy2e/IqcBo/ysmOtbzYFyN\ne1haCvFYxU4SxJUCenINTyJ1RcT5wKHuX5FO5cFZ3HTxLvYBb8BY47T6HaJ3\n8mEq85fJHfMMun0aXdTLc8VX2AXbRK1VAr/nqiZiLgO34xn9VlQo2ZwOpXS1\npWARz6AYKTuNG5LabpzFwRtoxriOy573zdARJAnVmWObd7ENf2yENXif+USh\nSlmsiPNjQfaiSQEGAV+9B1mEUkvjZdevIdFwsh7ahVaofC3h1Z9N9kDkmdT+\nagm4xlhX5Npzpv1MssecvEi4HY7sYpjv82JqYWRjmPqScd1Unvcr/CDtMMhW\ntJU/pBbuqzZzUt6juVW5tlF1T5AXF8TsoN6N6Z75FAHedzUatqLV9IR7hdrc\nX1PYLfcA3KO4xGaglRsbXfcJdDPQGMXkt68JyZuyP6+V3eDBKuOr6Y9MCTDq\nPzCXThBCfS+MHX0jtnZYV4pv10G4XF0OtigiiDJ7qk0oMkacUQtyAW5xscER\nmbA6\r\n=+los\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Bhwrdryh/BJ1LNJKNHyMxgr6OJRIF16T91s0AuZ8uAIgI/YHXtywZR5DOMcLYN+jE42sHGNQywER8PNKp6IMnkI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0_1588103757590_0.3516636362435528"},"_hasShrinkwrap":false},"2.0.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.5","gitHead":"e15140334d84ca31904ac1381053154dffd881fb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.5","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-k09pLneOOqmUuOzr+FrpBUjd7CsL2eTcmlnG0wurXHupywI/iBcZfjIiOpRF2AShAi4xPeZd/qu/XmZC8I4p+g==","shasum":"367636ebc0d218a2efbcd6fb9b2746dafd9fa08c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.5.tgz","fileCount":21,"unpackedSize":121594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIpbCRA9TVsSAnZWagAAl4EQAIJDFpPG390+xCswAfZ8\nljbRbUN6obRQ9ChgOq0FKzI3Yv0BWUNzkx06ZR+1fIm7HBjG4jAAHRWvumhS\nTXBdC937YVftRnRizErSFudyUAGEJi7HCD0aE1Y9EoFC7oQRVjSICA5AxRX9\noxW4tkdIKBjf9UhCd2JXvfAkUrmrwnn1op65oeLZIY3z3EGwkv8uZlltV5Bq\npoJ1DCA9rshqe9bH1N3cSmEcvRiTizYVIIet8lHxdqyPUPl5a9acZFkxACmN\nWGIJenqFKTVuGRXkvLWi8YgToKPVQckDZIZn9WZlY2TcKA6x46K+N3nQIL6w\nepWQj9G3ErYn7fH4DPeBu7Zyl7WBWnCo3BDoXEm/Y25a80cV4q1QU/yI+ojk\n9ts+wHNwTZkUo3I4P4nNadjyN0OUABifWCFs9D36v6p/CUnQ9QGA1rfNII33\n6AK6zg3OQRhnDqF8icA/ie8YkXbSS5C0pDt+GZ1dnXC1Hzh/DYpjvCYoSYfI\n7CZH1UMmmn0TQEp5Z2KRX+aSrRce9s5V/UQrolXdc3Nma2UaPvR78aaQq6xP\nmwzfFKJ5lNfKkTM1vuhHXNKlFvi0DkjBb5Xo6yuUPV5042jpA5DncBJwb4f1\neaVv7Xy+VrfPI6t+iq0QKRCI+qjAzlWc+u39DoyyuxPmktCLjsnH1VKuTz6n\n+ZF4\r\n=hO0e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBtThvSmkBKdFJCfGsRG0cNkSWRHPBLGgbIycZ+fKl7AiAwNx2qjYqeoxv3AFCGZTRAaB9ak/RqfIGk7U3dQvKIXw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.5_1588103770792_0.5463109393996637"},"_hasShrinkwrap":false},"2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e15140334d84ca31904ac1381053154dffd881fb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xa+kg/YZJOcuMDXrg/OvdUaxJc1YM33jYicx0CEWt5KCYmU0DhTAris8F9gddOVydyUKPilovuveF75hFAOy9Q==","shasum":"88afbcc803202c3e8c4fa66392761616bc42c868","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0.tgz","fileCount":21,"unpackedSize":121637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIqCCRA9TVsSAnZWagAAEvQP/1pzdsEnkq4Fkog1F6Cl\nyuMxSUKugLWGsdF/6UFFVPscBIoD0q8wqfiKWaD/NiWDOdi5Jk2oDwjHyFjj\nqqmQOhOb9ciOHQ5HsbwIDYmjQeH97l0eMHx8DYTEQjeT8QdwN3foHdyaoUPn\nL9gWlmWhHI4X7movfMH+Ucsf77igVcbCezLs4ixZlZwzeY4qU392Gu07VN1W\n16bJyftuOX3pv9PNyDMSNJujIsXZiF5BG/O56vxhYRUNOWPTPjOonZ4UFh3f\njvD8aphQGCP0Gl8yvoH33ZhaJ4+95cVmg6vZdGXhFDk9j3mO3FWnoBFowTRt\nQk+pQYwtOtxnXX0uyu/NRzjGG9UpU4cmsrO2YpT3RMYdke1y2lSV5COGcpZY\n4eS8fbBPxNB6KrGw4c9jNtKHsHAVDQM5BZyFXEjQTJJ82o9MR8Iyjz0PyL6K\nDIAYpYIDbFdDNTisLnHi0AhTstXrurrD/ZmmN1fTeravzK1t49zKj2QOawW/\nFoLYqXYISzTgKw+JKPJKGYvyj21P0g8pj08ZH4Kdqy6YwpS99RcN3kJFiBq7\n/0vK2dlbalhwtsaMO+5AEvizzQmdKSa7m5/5YeYi4dH1bFD5c00kc7Z3ktNi\n2f4g/7hvJd3uleOVMLi8S1RZWimJZDDGQbd5trEl5v3/ZxS66YSjCDy4/CPv\ngxm1\r\n=gCbR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5kv1ks3JvVyWyk73BeIqiCI+lsoFu7VwmVKTgNZjAYgIhANOFOa9Ty8OKTBRwDPSIF2Oanpgcthpn+pC6Vmp3lZwi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0_1588103809916_0.7958065347532155"},"_hasShrinkwrap":false},"2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0","gitHead":"ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LnZ23cJ69fvxk2gF3zf7tR67TSRDYP0nhRxucNW0ZSm2MvfXnGj6j0ghsVprlHxNSNWRl1UOXO584RDzZFniCA==","shasum":"8084771966732bf5b42dbe76eae2199b2ac9ef17","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0.tgz","fileCount":21,"unpackedSize":121637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIrBCRA9TVsSAnZWagAAzm0P/1MXOdt5wkjyUBn8GH25\ncrw+FteV+slgVkUnYjrsmc9GzAGiEEBYyBr+pjhXmeHyr9FjE6TJbxLLj6aj\nOAZSehSEAn7o88dBDcAVzV0xL8UJkmXjxadeIk7tZvhRVLV0Qw0k/if6dfby\n3YQzZU16r0PufnkU0HyOCOi8v9aJjglpmusXAIHG43fYyqNElJf+gy8NZ43h\nmPXWzlH1h0qg00v2SS2Y1mNgTg1IgyobkW5/E+zjROfF9elh73SJ0XsD7zaG\ntTihflIYJrxWDKUsBi4OCsmvLgGJQKTHQ9UwHrTdEzgCDXEzXajN/nv3LNox\nfHr31MF4fZiKnSYtRZvzP3LjXphrhFj1wrEgMAFSetY0h/c2gaBT/H1s43V5\nEI6Ldj/1/3BXgX6f6ENeGM1IdeeBZrxBIiqAqwRRYgFO9eIOFYna5MBWmu6P\nEFOZi3lU+h0r8QOt1vDy82JSS7EdZN5pZNp0aqtdhpZ4/ZtW4Nswqts/CYNA\nojVxB6ApuUQJmkKgAh+pgec14MvoIVdAIEgZsnAgVAwXD01/AiPf9hcv7VnI\nJ5hdrrwKBi+IRuKOE5W10UqKL/7T3baFWY9/9q5UuYnMJMCpbq/RfISMOwxB\nFlcdP0GymioE2OFopPW76duuzjcwNxUSgdfTgpcNCF1+L+5v22ieUsdiJzXQ\nz/XN\r\n=l+84\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDTzsekfUqRmKGzZUXg12wRzKuxoHeq46BL68LkdhUR1AiArXuwawSQhulaGwjbabRchc6wQRGUf7Sr5eifO7iJ1Ug=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0_1588103872888_0.9394695225965819"},"_hasShrinkwrap":false},"2.0.6-175bc750c943abd58f87c6979e408b0962600842.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.1.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.6-175bc750c943abd58f87c6979e408b0962600842.0","gitHead":"175bc750c943abd58f87c6979e408b0962600842","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.6-175bc750c943abd58f87c6979e408b0962600842.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UJgUPq1HaDSPwdA0M4KmgjMjjaIkcssWwZFcvjKqUOXu3fAFKkManaAakTHk4VY4Js2y7ufYj8cngamlQqJv3Q==","shasum":"f2c4972e8297f0b961d9f0dd1501690a56ea07f6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.6-175bc750c943abd58f87c6979e408b0962600842.0.tgz","fileCount":21,"unpackedSize":121637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIrICRA9TVsSAnZWagAAlF4P/3cb2M3ZZfsM1DtczMZO\nYDf/x+iPzViuiplJawhdiMBk3mwXyq7ug2JQtjo/WCa08a/q4ELAJejeXfmG\nncOMY09ogV1PG9Dnx/iwS55ZRXtNcbky3VcYpAPhr5HRZAZoeQDnko/rmP1N\nMUhTkL/oSWhI0ejq+llsy2ZFRcIQ9Te90YiWqAJsIO4zuubrOdvD5ZL8mSmR\nou0oTCI1tDII7zfYistVUwTIuEhV1YBfonJktN2+IcoDnnANaBDGuD/H+9rC\nF1PZ9vbntNxHGvDbY5bOHzCoZpTI6xkoNyIrldbdxdSyIhB/Mt1gxUhHWpjE\ncA+9gid+fSrGH0HmOEpzgvvBq0AqAZQEUI6OpLbNmAkyJiB09TI7kCJUVcT6\ndkW9+gVlpygy7sXUBciRZdbX7NgHKxyS/vJvcahfAigeZHLQOHbvYbOSrqlO\ntprV8P0W/Et3U/4mczVFA+wQWSHFe2tfCA20tZt+362p705PzEDlGK6ozp0j\nMYMaN+bJZ2w00ZIjYJFpHx/V3nsdRnnIb6I0H+jOpmDpyq/fgjhWgIPa1bC2\nrb3Fewmt1uLeixczLw+QhY0cZ8vHh6UbzQEZIof9thU9h3vqbTNubf1tgqsL\nBTfBGDpFzIJTTmXaiwIOtcDZRKGs8civ6pxwA5G4XHmI+3Zh4DMQFNOtSsWN\nhiKs\r\n=mv7r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX6cry7kbyGc2eNWj6Jc2XFUsnhnYxWylWi//CTMTTlAiBFdn2CSeRzFAtYOvtQJVAaIYv3wL5ZV17achAEn3AFPg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.6-175bc750c943abd58f87c6979e408b0962600842.0_1588103879722_0.39829906820008865"},"_hasShrinkwrap":false},"2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6da5a3aedfa826c0688101b99ea58e00282221c9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WGJnTmdUqbTUm9dk038kv/35L1JLU0CbIq2P6dBaH8QqMSpwqW6lrtXYoVawKQqNykZf1G+YkvVquoCO3J6c6Q==","shasum":"b60ec29b4d91914c6052c0038782faee533e807b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0.tgz","fileCount":21,"unpackedSize":121637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIsPCRA9TVsSAnZWagAAhfQP/2VjUukJgahbpEuKKXlW\nkTFakJqHqgsALn1OB1txIOTw7emAQBV+KMU+tm+4cxUZ30KWa3nRAsSCzFs3\nyRQQ2nnF742fjlzZGN4HaMMbUw09WDYD+WhMXt/fwrLSrshKrnNkJAcF1v0p\n9O6K2mPJEEdRc8SIr9LAZbD9xEszOGmyuPcXiM/qaenyze3zrOfW/hq+R6d0\nzbZTfDqkVnOVvovEAvVRLkgGjCZsjL6kVsp3uoCxliOEIyMJbwmRe1nENTXw\nuMbMawSNVCeis+eW9eJcWK5gSQEjNKJVsXo07HgcJNpMGUK9PW5ThUhRwiUR\nhNfZgDGZ1AP9HQRNxBMwTXjdkpGntXFPnYePQpT95FgoMCpnWwSYqG3lTg/Z\nh+bp540jfGs5qqGA94dLxsO1cTAFOfxLtopIOe3khfEsqj5dBkqV+QvpQ3v8\ngm/I1kIOclabI3fSNZp650uc8ExGDv1I8EdXcZwOdtGFBGkHCQtAdutYE+Y1\nH+o9LImIhARtLQufugtm3AiLgB0zwKeBtuVwsO3VOtEYU8rD2nUXL/3UNOZW\n/8S0AugTjUykQxnEtm7N7DyDwu8mBfdR54z3wM0GLcAxr9t2B0DmLgSiQR2D\nPPnupEQlQ5BIA13Jg6B/O//vZTWOGV4ji3HCMr4jfhrDRtzAeHPLIP0U9RV+\ntnYA\r\n=aAms\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQONx5gVMlFR5jmLQChAmVQMYTpEwAoNtw1kGy8PZt8QIgY5QWm3rhH2uRCxWtOImA+YoUi4V10m1WVneDuJhraDU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0_1588103951194_0.4983624783552081"},"_hasShrinkwrap":false},"2.0.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.6","gitHead":"5b922f20ea4ae1fb5c790419c415c7966a27f2c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.6","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EHPn2ngzd5cn/AYOb+3mToxtQ6YOe/F92aGaBUbjOdaWM1NdmPsMv3CBgtE/+DNRSS9A5cUa6juWjdNA6xJRbA==","shasum":"1295385d7ac74ffb1a2611c54514311fcb9e0b2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.6.tgz","fileCount":21,"unpackedSize":121873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIsoCRA9TVsSAnZWagAA23cP/j9ftIgnYxL5VeByISgY\nVU3PfFOyqsQkIes7OAc/6dUEnr1VVQ1JkIAPns8yPWPLEpHHjQnpO97uOjgi\njQPiPvcxQjB1IGGokHFA7IXVxVzcfKYOC58MA2Zmy+zmAYIjRkAJQ9B7Cj5T\nBiy9COYRV4nr5GmHKreZ9Ym5tS2etUQMmLaN1QWuItFlPgGenSqaDfpEmsDD\nPgZnQvXo2bHojwNQeUmPUODsXqMBUaEjDagBWPRaCHkOAYIN5vqFjrjT2kXC\njxitBEQfw8HbWle3kuy9x4NOoSB+uZMhBML6g65HE8T0YtGPi91IUGjIhH6O\np/4dBc5GyXp86/URoWzIIamFnw6hM1mmN1uMftl7eoM3mrogZ6HJq45opFRY\nC5+NQKANSGkwynlSwWd2IGIwG+zvbCxlGBkNhCA4x0nISMo1ofA7PEWeJwTp\nS/QmYgYwSMD6EsIk9H7PJ2h8Ryn96sRikRhUeMB70OSyDhgWVF4GtmdEqKuq\nHB7e4YmGrwAv/oEpBHJ+Ex8zfg8CTSgPzmzIPwOqvNn1n6yHlql6NMMmJpV+\n3CD7pooHi2lJgHKPQN7kKB/l+G8LB32m2n5XjKCwn14Xk+pEZY9NV9pkIy0+\npeY1LDgUhmo1SAlOA+DVjS+E+X0rrhX7yYra8lyV9bTnw8cyhTf/aegaVvfB\npo9E\r\n=Ro63\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbSznU3r3mXw17v3bB1S/0yEzCQAQ5oBrJhdpuM0DXAAiAn7mA4KIaE8kWQqrofdnFh2TYJ6McLsC5BFG02n2UqOA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.6_1588103976061_0.287754024564739"},"_hasShrinkwrap":false},"2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5b922f20ea4ae1fb5c790419c415c7966a27f2c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7apr5pWt3Cj88eW4QqR8cCpyAyBrue+jr7SwsVzbsp3ikoJd7+G7o/AdR6x0kVf3oeNozsXMtsAeG+YB9XQHew==","shasum":"c7c637069f41a4707c031f3fd5c2b8b47b8bff58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0.tgz","fileCount":21,"unpackedSize":121916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqItKCRA9TVsSAnZWagAAgIQP/Rmbk7weWnb9Jcvxo0BN\nzKWEan8+64/QWFfDSLXeo+4K9TmMPugPDKBSvZxg4KlqiffkQb6sUpubtWkP\nBo+RwkNEiLlpvLmhOzFZTpdR/9yETnXgInPqI3pzpee0T9T3IVZl6ha7jGEI\nyy3W6v/uCulMqmTnGTcqOx3n4QVFP4nM1IlrrUMItheJY6FzRy37OILcvCua\n8URJXvB4y1u/CF427hgq06wjIi5riWrhDYUYQHaYDL1aRBqGoAE1gYYKG813\nEGldybvfO4flyLk3DQxx+Jg/i9HQqkXtoWofBwDjRYlTPxOJOKd/3xeQ6put\n3B7PlWuabiKK4l7bmVXw0ySJl2THnKH214Z1AGlwHKJsi7M+gdkXx8xbCIdF\nru6uZC1rlh3Xp6DuXnKTjCmTq4kraV7S7scfCpbqewsV8MeOUsQZRvYN4tZK\nzT6vq+BThrUGc5xoAOkM0XnlWNWg2+MAqGB7zFLU1+FEiQt69lbl4c/EBTL7\nchja04IuZiFfTW/DC1FfQlyprMHHMg6ZprCwCk2LoGic4z9pbIE9vryOmonq\nJkypIAOqWSHi1AGVsC4+xiQ6c/iIHx8tWWtVD6kUNA5WDMjuAMKXuu6+f/tH\nH5M5BrHQcYJojwz6KupBtTnOyin6lUkCnZu00Lu6uKrSIEmLSO6Li6JkcWbM\njVHP\r\n=+YOM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDniS0/PcPnxKeItzQlnLJbLZG5F9hf7OArAfiKIMCsKgIhAKsUMr140MmOpe9Uewalwi/6wTK/jgHD7FiPGPzWleMV"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0_1588104009992_0.9904065042217292"},"_hasShrinkwrap":false},"2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.0","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0","gitHead":"c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wTJtsbgO2xAePChaL8+XBUbFWnQTXWYLc7MV5sA1T/UjhmPRxJ5E3ec0p0BYpA/M6tpAjcWtjq7Oi6HuF50w/Q==","shasum":"9aad619dde3f40adbb806cbd1d6db4b86d28833b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0.tgz","fileCount":21,"unpackedSize":121916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqIuiCRA9TVsSAnZWagAAlw4P/3oGiNQW2kc2YAaYqv+n\neNEuIGiktRfw08HKYLiWeYJL5Aad+2DuxQIXMY50MAbmN6xgobG5BgICooEr\nvZRJxpj0gIYpr4fYuF3U8hGC6V+k1ieSpGXvQHgQzbQ7L5zy7SAvXInxvcRU\nTlccb1GEao1jLKIZT8S5BDX9kQwhs379XT44KYP5NWSxzcG9pJYZ5bmsxgjR\n4USTiKEP4p+hFLdJpn0gdDdvzkoPyN8s+vnsRjp5XNfLEYkANALgDHJA+hJO\njr3MfCBCEOe3ELNTkGdKf+1w8LS26rcweRsC8HnhaixYeWVMli1U2wFVBpsy\n2hy4Ccw5quRdHJ3rxKbsCzpplyx6rJYoCMzqTePQ0d1U4yeJhMy5HG9P5MCf\naDZI1lUqlUSyLk1HE1O1lp64XyZrgf68IDOUmcxxRMySj/R7smitogWHwZBz\n/P6kl2+cx4lRE48OEnlYZp41YK7DroX9lu5ND7BTbRK03Nnwwsc8d/NHO8CG\nIkNx38sWgTOnStvtPcmHj8+EnvWLQltgijemL8qyH7LbMjqnAP7z4gAk4+bD\nSrQrZtyvzHcnAb7NZ+BtO+DRBARxf4M3IiJVbtquOIHusk1GwpZt4InbbCNY\nk8fa8S6hCsD7r+3psV8pNn3LlsQuofBiVSR/N3CmVtlyp+dgvUhZc+ehviOm\nU802\r\n=DRzp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMP37r1wRS8M4D8p3w2qN9iN5wYFep1pau6z2Pe2KioAiBgT2A8lYor6RutiN/+Dl5R+lM9gX9drXGgWyBjU4Rb0Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0_1588104098117_0.3243990193677302"},"_hasShrinkwrap":false},"2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0","gitHead":"6bbf0e0c323ad895842c18622c46c415df61f934","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-A30XGLASujtfrZjYt7+YLjCJ8R8/85I06N6p+F0RmQtMvLxbyYWImovNZy9reWdYXiLmWc9xdSQcpT4+OZ4jgg==","shasum":"f6a1cb3724694eabb1601c59c664e398eb9a49c3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0.tgz","fileCount":21,"unpackedSize":121916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV6eCRA9TVsSAnZWagAAzpEQAIY72Wu85mgExGTkYXCU\nek2JxrHCf1o4lL7GPlLikbntt1hsGGQ8rw2gekcBicizMLKDHCjReka7OQfB\n/QumhTpn2a+Arr5FYBrfCJThGNbV3l90tSItBCD8INyAh7xfGY/TBKYoeq9S\n9TTFWiPCATRy9Rwviv7zVC6dESMmABw4yDTxlIlKLNCfH7AAllXvz9D/ujAz\nl46IXVvyxzO+d225I3+rxod3KnXizo88fDj9YlP47+TXZVxxtMZmfjmC4aGX\nZF2IldSL4+5QH6QSKQ7R/sjAKP8ZAAF1uzecSs2aeDW3PxOd4oMj4xQGkfOB\n2lPsNEr09rkLcjd5Mne3Ml1QKz2QBKmppTZeJ/ECaBC0cpa7zlZ+Rp/wNHGW\nxqnoqh0eFVi8j7ZOa4R36TpZQd8VLYhAkW6q+0Gi2AIrCsx70Ya7yPU6m8ni\nA5ZwY4Iq/8z3u6iJQfju/KWXq6stJ08ypIhIXPFD95xhCMn76QMfa0GmnVTv\nxNZI68hZeAIT9FgoKJi5mu3uGDZIgdmzT6qomR74fT7xpiZCQPHL0OdUKZYm\ntXYA/lqe6Hch/6W0j1YF8SggJ3mkZ5qNBCb7bRbAcHSyoKRb6KQkaIisNPf0\nfXDVsV+5FYbuaCBBu19wH87ngVn59d7qJ+OxP3Z7C4m0aP5ljCg8uKDxwBhO\nmTi5\r\n=cY9U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1JvfIJt57CJHIPgsWtRooyftiHALzUv0aowSw3yI0SAiAuIajLinpurGCgZXlcpLs/um4lcUhsCb84HfsGZsvtWQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0_1588158110035_0.976263346381238"},"_hasShrinkwrap":false},"2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"405c3ebd5456e94925daff4e7be9591a5caf0545","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZmIerTF/DEBj8nRAbwuU3l6YzJWqT4gc5DZEcdCckh58Mg//G05ci5h9zz9TOrfDup55cHZsnqm4iFQ217ttnw==","shasum":"3b925a093e1b347056d78a6e5d0d236115b68610","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0.tgz","fileCount":21,"unpackedSize":121916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV71CRA9TVsSAnZWagAABBcP/ieaPAdrqEqxQ/Pg0cYx\nlbw79aveHPdtXUDNj9TRMsj5Q/cy8kbenWmm1asVcBkGqtkBoQENUL5AgAAv\nJSopeOpGgcwICeyzKMjqb2gif6rrSHrvCqtceVpw3Ik98ZHBb6Ltu/rwGEcY\n8DbnCOuz7z0t+nYPfzjMhbaqKDYclinhmzQPzFFyo1t/Ap2s8RUGBUEO/E1G\n+KyO3wDGgG5eRwZUHMzDpeDze4QBaKeAT9aLjyN3kYzOakTbjKmrVP78rhix\nolX75NlZX/8ZUYZ8N+GM9or7geTNZ7HuYC9PXR1TXoltX6coPmId1MsPC1NH\nWC6EcG9gD7JUCd4+B2AF2m7i6n/DQ7m34oWJYIGubQlBsrf8PMZyhm8PeVmV\nUJFJXZPTXYCybAsqk2GwxXao/QmKAXGo7YxCeRYhjoAp5K0xuYU1MYHG6YS+\nBhheZv5r9kAHaGd9Kgyx17wxSqR/HBCwuQSbCsCRO2IvALggQTRoflk9nUhy\nLuBKOI2fTHnttMZUN0fWsTPdW21H/0eOuFFSX2KRLlTs8akw2mxOXSS+2ut5\nqXfJGhEFiXkCj1vz8ZX7wELaiGpUpllKakvE2+Nf98/tx5fIWEeXwcSsCAZU\nFObj7ny3LHCTQd/I06uyV5Ip3M4jAn6jbSitBZJUaXVljMCSk5d/kS4f8nlq\nHNLM\r\n=aiRF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkvVszxp796W7tlBIkmWBmE3/Aap0k9D2Nlx9w2INvKgIgW0mh0vjCwXF3WQYIIGQsbk+3xFXKyhbpWwjL4rdn5yM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0_1588158197452_0.08475008910408022"},"_hasShrinkwrap":false},"2.0.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.7","gitHead":"97d04290f93c8e5b4e61f0965ad8e34abf19f9a2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.7","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ELf0mOs+kkoY0bwRdKTErp2iZ8stb1Pquvi58u5qd0DmWwmbYKopEXxwb6ak4PpJTukrbpUlU96URne153wgDw==","shasum":"0205f664d6c9a3ffbbf9b6bd01ad0e82654d3699","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.7.tgz","fileCount":21,"unpackedSize":122145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV76CRA9TVsSAnZWagAAJZ0P+QG0JN2bcPwQ05qsefoB\noDBr14tFeKrDhpWc632MYaB41MLIkUQKPReBO0Rso0UAJnCqrD8+SltYsbgE\nugjDSBXalpvYg7A+Viog4K0+QHWUvbREqltSLLdKwnVTIamr3bEuGbF6uByB\nKC/ZAWR53Pcq2jhMrPJSDTBnvjOVqZe/39gmGiNEcm8rCHznXUggMzyUTm8c\nYF6RNKLLEhRjGC1pJ5627LIB3+YlRqWM5qpNO3EXeVSPgiwhEAiJhkmjHmQW\n+cSQCj5eKyTvWw7GEm+hZWTe1Xs186it5TQC1vqNXXG6GMwjgZBj/bF4c4gZ\n0K+qc6cKTCJYIfzd3Rzt8LXbajBU3tAhbU5nHTXyKZUJFVpGhfgT58iKTFkB\nC6wjBFRm5L7Fie/EYyWBXHPsM0hYURi2CVColk/ZuV1ZzKSq/Ya4bSsVpHZH\nOTzLvAIQ6/BqWx6phFSDMbqHLhzlb/dFlE7gf6uXRNDqJxZUvr9WVnCeOGsD\nsMpt7YdJ24JrtCTjPBNnHgDHUQTMmkyOXhx/BdB8XFbWo+uDd2SDPaox7p4c\nJ2ZmtmWNNJZ4G1wik2Z4L00gfVYK2sgrk7VwXq9o0634DZyC3nQHi9plVlPY\nfXY9IqIuNzjJwVs27gXEsaHJnfuJS1sF58Vf0fytHVGn51r/fVTKsf/7DNGw\nzEG/\r\n=xCjY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKhtU2sQw42MOcn2YIxbPPqMMmLtYE7r+Y/e9+ZZhzbAiBazLiO13We1F6g8gWn+3pZQUg2j73T3+y6b9vEwjukhw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.7_1588158201497_0.19668111382875364"},"_hasShrinkwrap":false},"2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"97d04290f93c8e5b4e61f0965ad8e34abf19f9a2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Y1stnI3a2n+fmisyeWiUAOcp5SLUv21yBFdtq6z9GODMUJ5WOvZYwyHmRsevPfzzarT/K3y++FsIOPedImRIfw==","shasum":"493f438c832aaa282ff08fa11557643be5e783dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0.tgz","fileCount":21,"unpackedSize":122188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV8eCRA9TVsSAnZWagAAcq0P/RLSqW4TqXgXNq17rsiQ\n1xp0GAlRVMXiNNyNFegJydsQaadExdtrhR7MkaZZNaCWanR6ru0hdoU3BDmR\n7low51Q8CjsoB6Tuwdqlucu0aAcVm3Qcc9qhDRtGsHeHxtleH8ifGvvSsPH/\ntufr5SJW3Mpz/7L32QjgZkqmczxCA49q3jyN89jjvP+qdl+IpA+KyUDn2aG6\na51fVsqyLEarUGNL2FTRQP4Nd+vIJvJv37CRTlStuZ8NYxx4ujrUbS4uI5ZJ\n2Afj/bsAeGhqD8lEm7OsCYjQbtcpYufC8WGs28OMtkwAHjPnPZ1GoBwu979j\nrG8AuBolHXPU8VFC/yVqPjzBta66eIowBxu23xrlkcgPzHuW/zAIc48+v27/\nKLSjJr6RjzzBHhVbJHljuYf9g5r1zVCMJr+I+uJyQcAMiNxvEFC1ASf7rQVQ\n86DwZUp8FBYrBwpOJ4I+lxPRx/ttoHDp1rgVproHnGl/S1YTOfrZ2ND/5A6x\nsJopEFej9KJpJfsZdB1ak8ySTwLdfVg3ZUAj64L1Wk0mJSQ/K1aPrgROW/Mh\nNPmBxzU3bmJ5LPfnHI+wX9DAXD6DLttAQzu9mduTR2P5iYp0rmccDXxPDqFu\nE6wvw4O7RG0f2tjrkn6NhdfYukay2Qcxd/dAAmawSmqvaiBFwxSRFFg1482C\n8Sso\r\n=/QwF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPnaiDY7AVT0dYdZJPKMY7gW3jn4jvk00JYe/karOLRQIgKnCyNjbXxwz/brzNp0qtjpAY7mJd3qfiD7w8Nv0+hrk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0_1588158238088_0.5626436737869633"},"_hasShrinkwrap":false},"2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0","gitHead":"c1e382a4a05fef862238ba19fdae066bfe0b6995","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-A6jBym4/X6pceHvmwSAuqOz4QqIjC9TlN8LE7kPovB8C8kGxmNKoca61tS6pE2HCzXDyy0RDLRXrUJ7FB7Rgmw==","shasum":"42f607b3ba48a414add890603a73584229a21ef0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0.tgz","fileCount":21,"unpackedSize":122188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV9oCRA9TVsSAnZWagAAWxkP/im1KmKhxnS5fYbO8EAb\nmGieP9zE4w0dVOSxL0SChps1FVhma35lP/m6XFbALyBWNRBalHGj1ebyClZB\nG5YBsIJGyuq2iM8zgOdBkF0qBGZ3BFc5o2tlWZnbXClU3IwjlL6BA19FWjHu\ns8p/cuSlUxlozu7aPt3Oh6eLZ4axXwybCY9sC2kAs/MRIDECFKRotzDr5uyc\ntN71w14OpajOL2bztN77Va4t4P/hwg9DpIjsU9Y0y7OeOoY4Hwv4A+78b0Uu\nEr/V3azzIdo52/SKNLHYBkE0WjPwibKaPLQfuT8oCP4YHdGc+m2nvXviiv0X\nB2NT+dI26RMhNEYPtN47c5kKMNWjHCm6/KyZuaiQFoKX9ynQgh9WAyj/MnpO\n2NdIl2Oxp4JpWCA+5EKKLRtfIVIvBAt6d9/D614kdocIe4oHoBT9TRea6gmD\nYtTnJHTHNUdWs5e7rn3pWgFWymM+y1Q6sfjVZlTHw+drn6azQJdBJv0ehln3\npZL0U0b4ysxEK3MQKf8baAK1qIN8MtnjXbVpqIYSfiOAjQbZeTlQEgs4ljNK\nh0QM768+BKicjvxFW8osOnckEMsBsveGUHYja36Tt8mB0aC5vTSe2OYCzkDc\n5rwEu8S5zoFDy6+re8WCohmVVMgA7TQSWkZahjTS3Eg/y0f6nc9nSkUVNuNW\nHe17\r\n=fFvS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFoPMfR4Og6nrA/7otldeon6q2E/+FvoKW9jBXulm/kAiBxX4Kdi2nwgjdVdZhvf5OIbkCSzJoMJROXeZuKxfJmdQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0_1588158312079_0.1572182574544203"},"_hasShrinkwrap":false},"2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","dependencies":{"@google-cloud/firestore":"^3.7.5","@types/ramda":"^0.27.4"},"devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0","gitHead":"bb388391e335bbe0990340c9ee1dc1678ea212a4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iQXdqybJLABnVi0INodmi/H4lNZL9xHEKK0O+4NXWHhIHxq77yQs8Z20DvhVaUHDeZEUIgLnIdj8c0NMGBd1Dg==","shasum":"97a6bb99c1468aa4f8ebbc7885753a69d12d8d06","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0.tgz","fileCount":28,"unpackedSize":127743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqaatCRA9TVsSAnZWagAADHMP/isvqpRKWAXGET3avGM8\nDRa2fdgo0WqGZ84cXNHZcxkeIrAF7WWSJjnWv23SUAkCbYb/yVHdIaB5LCxS\nrt1uLxLXQUOK+rfimnNt0OlVcPA5+Ck5T0wVoxjrpQKv9FO2U2TemKwj9fug\ngjxWQtsAiZis7Tsgdi4YHk75VhevxnExcObLFMR+SBqhqFXVW8L4MwDPghei\nLD5IzrWGNbmflEDDw/dKryVbehfTK+sRSbqbnaHPJP0xVyowOZzXiVgW2fMf\nZfSevJz1+gHxc9rE0Fgugl1VQ4WhSgyufmyjwHGiD9DQQVdE+Yd8uv6VGl6B\nZ0f3W59gdNBRq/tFEHE96aub8adGWD6mtrBRf+/ieHJ2dnoib/brCdeOtObp\nkudfDGYRaP/xrAzaYibhO0PTrWG119OsE8DSIQ4CsZXRdKYk/aEIDW/X7c18\nUuqeBry8pmNyc52yDBnmhtFBWaWy8CGg/rBeCGXhaY2eZI0kAkql1ZsY1gvY\nS82yCKZ8AyfRZ3yM55mBjNl7mGHADIHasvCv03tENV7cKn67FlTZSZ4wEfb0\nEkgZZL/InAE1t3WEmNPOjBjmbEuuJbSs9ukH9cyoGbhr+NWwvq3h9l+9r//+\nT5wyiMD25K+zxH+gUxvjPV8I9uZqMdLhLHvSYzeoqhOvrXw2saauqnSOuR86\ns1i/\r\n=QQ/a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0q6xe98FGku1oGi/rDBu1tAjolmbN4oGJXHoyQYLC5AiA9OZpwjxYfyr73OLrC0ljmf6fAuMqD3i0AlzILNqTMXA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0_1588176556683_0.3488308503887214"},"_hasShrinkwrap":false},"2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0","gitHead":"c4ebc95b639e31249d08b1f2268d1c31f0162466","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5PvMDLU+UF6D1IzUAOmjFyJX0DWArxQvNteXGSZilp+0IJyTKjr38DB60Hbpo9YZna4y9HAioNjg5eKQMnEFLg==","shasum":"b316512c43fc91382ade3d3816fbc150d8ab4504","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0.tgz","fileCount":28,"unpackedSize":127743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqaboCRA9TVsSAnZWagAAOkcP/23Cl1Hn3qgfMb9S9N2N\nJTNxzhYkhLO+aUP3YByaBHUzU78fbGEZDpH4ilY137hMTJh/JFW04e40KyAT\nEWVPM5czTI+UHkUFJ0+GgjzWmjw595iXT7jyL3Mm8yi3kxiAlPoHt/1ZwDFf\n3BN5n808bhsXvJVEQ+uKZpXRF8dTKZYZpM1tX6UISUOOmOCV9ZY45N2VfDah\nKGJebcMgLp6pm1WgVqXR+bQR5fdaBuPo61WvS0/aAlspWanjp6Hz/8ILcFF/\nFuDaLqXKpyqi4nvquTXInK9qJOpIbdxVKcis8knKZmgo/cYWjzDfq4OsID+L\nZ+p0XjWh5gzOVqBlsvqOnp/olKp0kFi6dWWQ6YYkALQL5e4prRsSbcq65XN3\nhz49Wq88vIXLIudmV2w6/CCtrJsywoAuYOhEHYvlTBJPTNLg2AVycLdLHHoq\nowE1gMNNiMJPLIXf1h5+AlG/bBs5w55IFYLxToys+d2JaFDkU0MLkqEXQQz6\nFHKsFC+IF5BJYDtoM0Zg9i8yQYoFzLrdYFVfDBlluFohgky0isS88VJqXTQ1\nb8dvt/bDkWYeNrcA671Jl6MxQWAAlduAm70Ma0AWzCbWoAODsiuALehWKNDm\nkVeqMJu0rOMrV2pBOdS4l6+9u7f9QxRWz2RmvhEw5cSIzcrU/HXycVdubPye\n9Ek3\r\n=8Tif\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbI5Fp8ajSTZxyxONoVPnD3nD3dqaiDGBUo105Eluh9AiArpuTtzqP/Fw+KBEz6sk0mO5+jGurenQEFVVxrh/GjXg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0_1588176615956_0.34748972832188607"},"_hasShrinkwrap":false},"2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cc2f29b7e4e3418ef4601736a52c6e43839ad2c0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Qz3Qs3oRlN7NnRb93SZS9799xjSVE5TFSaqS4koTWX0Gt9HyP2m05iPE6EDbfziA/2xfYiuFZA7EfPhUIS1KXw==","shasum":"8441596f23f544b46b20ea072c3f66a8c3e2ee99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0.tgz","fileCount":28,"unpackedSize":127719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqagHCRA9TVsSAnZWagAADFsP/iWLjKet7jLXdQgToycI\n0rVMQIZXyTezD3gS3rp8TM/eM77fw+WwRXoTsg1xAK3/YmuSJBPE5b00UdcE\nK3AXFGjxtC7ktIsvIyMIF30O8coYo16hjW2jD/iXyVbCqW54S1X68Ef2tNXG\nO3/WZwT3isW8jSuxd4h6mCl79lkBVc+SgQa0gGtIuI0UYKYSF/P/l6k2S436\nLo1Xb7cBr8+ZnY2jXYfqyP8wnH1nlbV3viLl9jWSSqx71N6xkGICAC6jt2eF\nYEaoQD18npEQTSHM8cBjpsZj/gUJwV2Llrwx3Wxtfvr/7YnNjJuVk8diztb1\ndDfn5SjIxbWRmerTRr0B08KPYW/9DA+MdKNslxcvop7vTkWqOXtkZcPtyq84\nsPJ8vkGmMyj2EddJY1CTTOnsXTW1PQpXE7FH9IEOLAF4dDFr5onopXoLxanE\n7l7ntBRjAWWgE3z/T63IHii3ZNQdgDXZhLRVqVQ/QIRtPFZSCAfZh5GGRco7\nTIPq3OlzLk+l/aRi7h54MgwQShGeGz01jQCFPR/HEeKkwE8TytZIk/SObzNa\nFgNlOEATlSi+PC1bthtaeywS9LUD5RpkyY9M2Ppl9bO2SoCDQ+s+R8gEbI6I\n4a1eb2bMynuArBBuZukA+YjLKJV8j6VZdpfQrck/uf+GK1r+TbWduaY7a2MG\n5ElB\r\n=H+AT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBVBfr15ff7eM38SXcqqtz/ywf82fmgrBscTmr2UWGLAiAjGCkZ3YqiM1RHBoGkUEgrl1Jj/2kx+xQHTmeonXze+w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0_1588176903151_0.19719756583111603"},"_hasShrinkwrap":false},"2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0","gitHead":"9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-H9M82yI0m8HDCvhN476TPmDsIKC3/f1PxU+kErLVyUwETzFwQK4JBfPRqhykgjagR3OvA7ljt2ci/ysn4nEOIQ==","shasum":"f1cf54528aa19cffca756daedb1cc1ece7c16548","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0.tgz","fileCount":28,"unpackedSize":127661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqahtCRA9TVsSAnZWagAAQtEP/0dseLjbJkmm9NwxMM1E\npGGNd8V+jjPlIjYKn3gPHIpgQCKL0Th2uLkvqDDt5wFA1+eg/e7gKnAARMh3\nB/V62n4MoUEBpyldh0r6qLkqTrjW0Tqc1Yb5niofk+FOFg3bUDFbFESs6BZG\nZkKp/M7ZWaybJKDqXQMkJ75mc76Bp+ZT5p0UtqpmcX75kYAHBn7z0MdXMzwf\nXq6a+piCDmpgvHoEvhjZTf80fWU3T50g6V84SSSUS/CvEULOytVMuduQAMmn\nfUQAurYTnftLN+ATBDTmAx/0PeuP/KdHg9pVnW79iPHJ7MfWmoxt8r+i5NqH\n6go5hkTazwOHO8orb3RNs/OKRvxnc2U6UfRS2jKQgOyImJvzjM0VpDLCCE/y\n6CXUKuKNjJVhsj3Hyv2+UxxoaD5XqRMFSitwVWzzyGtszH+HbhszkWX3NcJY\nUJaziyxOtyjx9d/U8FEYcJxhPxklocXqiOzYJCPKAJIfWQFelMvuhO48luoA\nTnx5BbUlhjJPoiHzYdeoMCtkNhQoF8DAXjnX5L36bZ7m6+sxOg8eqUz7GqGh\nMSNUPXuZrztHIuO0L529t4K5G33ePx1ej0lOLWYIgXPfT3+RubHtNPQYN2xH\nmhIMcRqkWuvwQ60pOpyAzrhXnu/etTA3ycX+PbEMw39k7n1Sz7cT2WqeqEgz\no+x2\r\n=XtNM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFcVfvWgi/rpD3POjCgnwYpWKaKNmtwUJXqng1sGGwyAiEAjxzIU5o+xF77qNPziqrGqpj9+OX9eBkqxDqoZMBjvvI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0_1588177005087_0.7237069794276465"},"_hasShrinkwrap":false},"2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8435ad5e8e6fbc761d29def61c31d4854a4b5d03","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TaW1Fm4Bm7lVfsCQwJP1iO9ItoCu9EVoi4P43D4UVMnQ3R/BksoB44OO3JQQKkxSyQpQ2iF8YG3QxoNi4w75Gw==","shasum":"28fc2e9668e09c8aefe08fdd2db73cacd9b3a4cd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0.tgz","fileCount":28,"unpackedSize":127661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqdCiCRA9TVsSAnZWagAAOIUP+wfkmHM9iLmiauRjotUs\nRrikb1qQd+GNPrY01nV7dWYIxNz/L6T6vhTDg2qykdUymZVpK3PbjFbaNeXW\nKLTJy4nBqRTsZn8yQAy2F8JqosRl0UAa501+j2ZqCEPcdH/G45eKMxIKImht\ndJD4ZYlXeX5Wmk7xRQR6McC/8tDKLKLThcfkCgD7/41cVtBOe/5ijfdwWtOf\n/8NsTAgXFHeJUoHz35HLjnHQ0AbMEBVFFDDBAbdB1ToivMHv0W0azNfQcp0n\nQyd5pkNt9agIp0BAwvTd/JbJSIz7PwgdVwojXbSe+v15Zi74t6TrD4k7D5Wc\nBD9kw5SBYzI51MkuGFCTX/QykGbOYlCvflNNgqJ3iCnqtoqNCk3sGgEUKw3o\nTvPuj5KWaM20leP6Twr6S1XtvHYo+v1SZfVrZhdodSPNkZmMkDiQ6soOqK+I\nlzu9C/jle07w9bG/u0tjobSAYSUMR4ZkKWaGrpLJFwo1lRZHL5aOCOg2WtsU\nXFDvKtSu3Te3ZL9116CoVKtRAdz7wi5J+s9umO4xl+D03DciiAkIq1KvQ6YG\nMnDn9kzGmtLqMDFv+TVn8Nf7UsP84rmc5Op6sZbmhXf2ywvMgPtE4xtf1yh2\nQeVOfluB8gubpme/QIfK39y90YZCJBhkTEhkt6TG+WQDZhUyJxdoAibMk8Al\nojcx\r\n=dyeg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWyzygJJqKvPC6ahdUvAx+zImX1+tgBxLOA44SzizuYAiA6Bz5Qm3mD5lfE5VwzxtAfMe408+UYADwnfzxDYHN3ag=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0_1588187298276_0.9265068308912154"},"_hasShrinkwrap":false},"2.0.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.8","gitHead":"1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.8","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BcWi/W1PvybzWR47DgbYRiblc/k9zdiDme1IYugGruzIdM7IqxQI3/Drv7x4337FsR0Y8gxBX38fScqrF5bcgQ==","shasum":"770aab0b6dcc14067e8426df4603b2421eacac36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.8.tgz","fileCount":28,"unpackedSize":127889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqdCpCRA9TVsSAnZWagAACA8P/RLL3GuiO91e8bUCkv1l\nUV7pAfg/madGzWxWaz6pwlsynmjwvZM537l+lkcJLRCAN4Wnuw25XsRGQRmk\nQIk/OBmHexpicWaiZIIb6uceopZNFBNZJtP06Zx1iMKaNCOWYmQc63KUfaT6\naU/ht76pKmEDVc+Gq72wpB0df7QAqtsNbpTareVBuAypu2MnburQ/lYuw6Yg\nRAltbkNnPbw0x2J3G5Jjreznsy1DeaNOTKu8a3KhEczXOMrUt00/5FdRWnu5\nsvpXFdRadQxFU9waEXchd63CkfTUNfyASkzdPtix5BRvz3AIQxE3wCYoFHRU\nCVoap5OS6FP48oXm/QSWPaKDCVCzB/g5jd9ZMZoY49iBPVJv97aCWuSazcN9\nPeWhvGYoJDltlAw9n9n1u9sVbereUN7x0G5HsPVp/OJq9VK6/XnB4fMxd/ck\nzuoj6hlvonJ7xI3lUN4Z/3nA3z2j8+HOMNgal7BcY5+im0C5TddUSXjs6XDR\nn5KMLiCdz18ERXxamx+dqK21q9SPeH5NJNzfqsg1JYP0lTPzTNWes+pSEK3L\nxSin4jC9IIW1m7FHSwwf0ne+bdMZgT4W5Ewvo1/BD5FJlwXLoa1++9abxI0I\nW9D6/EfjjVIn8KFTOnPODIQ+vB8SkqpSzBUZ2MWoA8fT7RQwrYjkLKpCdsvX\n3QGW\r\n=/Eml\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7aM5puUfWyUXOZb6vMsps7ZMqM3WOCy4kWDv9ILYI3AiBHTsRwT6fNIqp0NJwoxinudamu1Lhznde57X9vMKfKpw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.8_1588187304630_0.591479193768824"},"_hasShrinkwrap":false},"2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5O605jxBNs/IXfVNu3bEKHxSG9qGN8QhBmdZucnGNUZHUwCnwnO5v/IaVfiiz+Azjc3cy2CYAYKsvz5c3o1+cg==","shasum":"d8bbac6e89332e6e79689c4913d8c98c0a391eac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0.tgz","fileCount":28,"unpackedSize":127932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqdDOCRA9TVsSAnZWagAA0rUP/3utF5/TL6MZ1rQQfDud\ndJsi2mdWml6TYv+JRHmceP896sUUu9VdjkEEttHp8DLV6uej3kUoOWUQLB4u\nCWyV0GZwqqtrP+USmTi/4S0K0xqFym515F3dEtogUi2hw6yn6d42lk6qJgIt\ntm2DoiU22hQFl1A3abnthL1yc9RL/0aE5HX4JrfeDWiYrn8RMdHkxRZkMigt\nyLWVf9hIC9IduQjnUqjGOhtVhp7GxN8uLoeI5j6lwL+tgEYI1Wdiqbi98kSd\n8pGKJyiNYlV1wI8euiGraODTlHAPaou+9OWOwdcV2IrMkTdrNFL7vMUm2wkj\nDcQGzC5W0Tm2ffntc2jY8aiy5KhQwULVECGsNDouizvHo+QqxyH2BxFmvrNH\nUqIFENpOMH91V2ewSRhyveST9DT3b+dzdSzIYcKiIIlz3CHf5sXfbQhIo+zU\nKHx+Pv8zRqO8oLvEXdSEVW1soMabVukwlZNMdhGMxgqYhWBU6Fdpkeefhf+q\n8hvCiGdv5EVLnW21fTspFogP92d42OeMkRFRTE+YepT3RdRaymF0hkMsMGC5\nshJYDld6lIMXKkqxDwenxP1faGeySeRDAPgVLqER2lj758vmn7OrkZ6ur7cj\nxtUztS0Ds4zrTME5+pDGqLvelvBhjGxZZR1BS260ukYuqH1jpshfy+z4b+8O\nJ3SB\r\n=vji+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHKmFCwNCi/CvwPsWjHmWlrZqY+g0cCntBjHltyFc1NAiEArFvaEhk6AeIv2fMZPl5znAFaKTmZ3X0ySNyMdcels8s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0_1588187341843_0.6572250087335039"},"_hasShrinkwrap":false},"2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.1","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0","gitHead":"66baef64ef64ea1ab4dd0e526a44d90738683219","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jfHXQXmXJey9wV1Mki0JoJmintr2lFV577TJX1RAP3+XTOqE7CsSFiqKGrxpEK3xl1pW+0/8WgpzMQiVzDZhxA==","shasum":"ce31f9661eefacf272f4c739b8a67b460e02adab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0.tgz","fileCount":28,"unpackedSize":127932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqdESCRA9TVsSAnZWagAAtM8P/0qCkxf8O8P7mrEq80RB\nd8xKD4TRYeQU9Dmwyt0VtENUFdqAmt81J57/IsR8b7P5NVjbBblEMFoRQSwc\nVch0EFVGNuhmswasyiTpnNQD8qZayx9D7o5TkkpBAz4etyHKLuunS7DdzL1L\neNsgI9zz+fXteufto+2qJ/L5iU3zqYUsShRLxXUVAdWwNvwzJ+nChYIvtrmq\nX15oWpuUwmy/wIL8LgLdmsmK16R0XroQqeEwngZx1HPoyuFmjVM5IXovi/Ff\nZFhOLDLxLDhhH/hpuLpSYDhmhFd4zqP41kNxt19zIX7Mh+kRqWrRgVzon8PX\no+7Hg/pLbH6Z1wd240Dl5IxBWmTr3gTY2wg5+wrwtRxjFIgjeM/dLd0IxlUC\nmkA/qLus/Al/Z1MHKFPHsrJVoC8EX7zYAYEQdysCuStD7RCTHJB0mWCfDS1n\nSjST3SRIaXP5Z84Tb0WixSpOcEuv/4tuKiXvsFizQy6DQ7fAjcNyupxw6vUp\ncivME3Cd2kfvXG2jdDJ1gK0Tz9i3I5bblQT3WuozSotpOPP3n5/pD8grPt+F\nj2BCJoi/LB7R5DGaUKv5ExU5s1Dj5VryGXETLmSZIv7uBRWVWVUhEjWexxxV\npTYTvPqTrMr7ctR0UzZ1xUGcIDhLsxXBP9kPiyodHD9vzZKE3OaazCnuM8Um\nAsor\r\n=1Amn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4NQEI4lRggn3ZpUFK4QiCYRuq5NvoO6Bf5E46ltOAJAIgQqOSoBD9I0XILm5uMrLQvedVDLTsMpYWGgDBr1TTx+0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0_1588187409628_0.9407424336811829"},"_hasShrinkwrap":false},"2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0","gitHead":"e7118401ab4e1efb9d4acca06b194396bc30b573","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8rIsi6YP4YRiYQpu4NxKdb/aXySzauOKv8tXeV6mZPYidKJZVyl2h+vUK7HIF/PyRVgQH3dEHVcnmN/patI3gA==","shasum":"7d713e2d6d6f7bcf3cf3a3eddb98affdc6712a32","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0.tgz","fileCount":28,"unpackedSize":127932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfgECRA9TVsSAnZWagAAu7IP/0Q0MnsLq9nUIq1SQ7PX\nwVv9224IP9b5Esmlm2sKPFlre0vsZcrWaIEgSfHFl0ux7QSNRKdpXj9o0ylm\nn703mddiRTMcLHRPdhnwLH+4KgGLQLUCclpS6hIqz27vExo+sPsPCLQEAQWO\n1jrc6qbh0Kn9K+ZtoXI2MQ528jylaUyLNPpyeq6uBd+7RjeMtKc9xq+ax/dH\n/zjVFF9GaPp8Z/bzBlHZZHei6K7jU53bxz1kRDza9oWIujlqiSkxhq75pb3X\nj49hFlAvHC1OByUfAwf9JO4hif234HuA2mWeXlVL2A3kK18hsfsn8OkPA3or\nnE8tX2jGCZRB7DlH9a7rpf33sTFzYXEupS/6OnUEB+3pQ45Bi4yhB65gZItx\nLStgMOW7cJN5Beiwv8oEbQIY2CXhW6QAJx9MMFaBjR10HEJ/ZK843NpYHC5O\n6NcoSOvjv4KGxx6CoLhlKWcihYAydsJHc2ROvJx7XW8gPsI5tLoVtrcl6SoZ\nXgonzaeoJyjsApvc0w4vbDh9Wh/SwNuSZ77trTeiGcmTAvslw0WZZBfAQqnq\n1c+it7Q7ljzVKEUuvLuJzo5tSanmH3MLJM9+KSta0ZSETiK/+XIPxRITDvoS\nmcoXHvPmM/Gs53XMTe6jrNgoDbtsfMT2quXoqB8EJ4NvdYhwg0S53zTOwFAO\nZNkJ\r\n=bREx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLgzFwbP0nQFpOZ7CtdxhjkkNijEU8W6u3saQ2Do/umQIhALzCUm6bKRbklcp2oAEj6m5O7//3qFk+O/2aUaz9vi8w"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0_1588197379478_0.5455261247015979"},"_hasShrinkwrap":false},"2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5810567702b40ce66e9e929d4bd2760573434f8d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rGKAYJIMNQHioQqv3/ndjzGyt38I1PPKIR4spfBqFpqtKV6UcAv5FIAJrFTIJS7Zj6Ijt+N8Nwv07a/Yg4GaNA==","shasum":"3538fd1db20ac5b8bac584045cb20ad6e355c175","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0.tgz","fileCount":28,"unpackedSize":127932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfhfCRA9TVsSAnZWagAAHroP/3IgZqyaki1ZICuFfZ5d\nFHD/ovz6ifakgE6IUumfUkSnQKTYcVa34Xyi5nDaZ2Hsmi3GqBC6F9MqpdAY\nT+Fp5knFNgxrv1N2kdU0as8EytxsgySGUmKsaAG26vIr7AlROfHaQFeeCu9H\nOXYkl+ewzItS2lR8KZWXHlqiOdAg9C3P6+kJvxwKUhcd/kAyEcgPVlN5bhNx\no9nDMw4xGn9TkQyH366ZLRyZSZPYOovSQitNMRYXF6KeY73irtJlVFPy2eL5\nKPV8f1mZkE+WFl+afztfzCPQRUz6q/eRg+7VDGW40pUad7fa/oXica4+k/xp\nhgRP77ZCUfeV9OlXVPH9TX6ajhHfr7Wa9PCxp11gb0JDw767WC3LQCxF/UzX\nb49FhqAshH4Q8m60BL4RjK+8zvQtZFJuxO8MgVOG6Qrmn1Dc9vMDqI2dQlkH\nvnqWK93h4vM3sEhhdwCKvsD1mgmJ//niIP0YaaBAo5zwW6xq81J8UsyKZcY2\nAt0ND+98Uo+YnOWRzilm72VXGHCfjiMY495j5Uo2oow8T+D7Ipgz32XI4CcL\ntePz9tYJSCxAmrbcJs+goWesyqCXnSJdeJKSTl5jK8j/nNCuv16oXUqN5fON\nKI2bPX62r8Pa6FzwJk9bSIOg7kpoZgfJmuaROWtOk4ZDo3WhSBaSOmMP/vGZ\no4yU\r\n=1stu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/jzvKW8R+9X/F7pxqmzyBy61QDlfNYs2cjM901dIU0AiAbWldZS18upVza4KyQKrPS7ndviqzQYIn1EBTXpHnNAw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0_1588197471211_0.8001054737390374"},"_hasShrinkwrap":false},"2.0.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9","gitHead":"e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-lxPQlSTDgJzxo29hLy5M+v0+z2BGjYmPkZA2m11xjFcSsKHmvQoKULxhRMOkiH4oMHjW4MYIMgjcmhNz+pL+/A==","shasum":"747a3cf7e7000127dbc2d0ed2142f83c9a5ba146","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9.tgz","fileCount":28,"unpackedSize":128161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfi/CRA9TVsSAnZWagAAi4wP/3lwXXXyNUajHMpB38Uo\nNthqHzImjh7F12peVQ0nNCjs+wiG8f19FOx9JVzA5j0S7GoS5OA8SVStqul+\nijqeyFibMfU4Wo71/pP6HI/Rq3Ac6rMfX0wKszmCya3gmfpy/bW7QXtDx4Ll\nWyTPX2/tsIc0LlQFjcacV+yzObQMfnB9b4QpYqIU3TIIilLOBa99PmwCpX4K\n7sUZ/QzWgvssLfN2whBb16rPWHuq3QR8WPG3gg9yzde+KL5NVVcd93Dg5YlW\nyalOFQDhiqcxCvX4wf8Ekeu41IcWM52nbuKTs0JCA6VfQ5OH/Br1DnDnGspW\nnbR6ZTOXCac9U9BvkP6EWM9xNc3/KBD5N8OXzJ2RIhe4jVEnEWginbFG5DK+\n+su4aV4eHZ56cBDUCXDBiZgjAZuvCM8BuOT/NLkGNgNTVg1OlSlHGQ5Sm+M+\nd5XFicI9DMhrrJ0VDrBPo+ba/SmQ7D6zd/KMdz2fLytaRmFgCpEAf+rSISBh\nhfx8uWD65baRnsp/Q3eHC2Btq6Rsu2zRzUZLmBz57tjClUvQ8kH2Io7nKQPi\njkOnuclYpnaoKnB/DqTGhjf3dxU8dAuJcSIRrx/WHstQU5ZEAAY4ehLlh1zj\n6dgI4/paSHES2qCHGmsqDJDF6ZUNt11VvxrnCgkimB/5rDIY7D4lmp4NoWTf\nSq5o\r\n=j7rb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPcyh6Qcexq2g5X6t9yIKe297QL7n49dwLW4P2ea93lgIgdxEif3A1K7xYaS8laRveegh0M+hv9VQRGbUufeB7W0g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9_1588197566692_0.4794865996168107"},"_hasShrinkwrap":false},"2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-k9R87VW/iGNr0LkwUvtFnxxSFg09YAn204h7+YhEO8rkOgawzTFGtRvsvokX4kJGtPphw4f0cjC5SUKQwvCfZA==","shasum":"9bd26f06b0d57e3444300c83e35f088ef0facd8b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0.tgz","fileCount":28,"unpackedSize":128205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfjkCRA9TVsSAnZWagAAYNwP/A47fkLbWOwO37yAmZKt\n8A0fo4G2dAOzK8TZPw40ECsLf8GujdoO5mkFSd1HUqEo5CUD0Mnlzn4Oi7AO\n+hhMutiIc2Y6GQOz6e57Sk36fBii22nQ2FigbAp1H84tGr65S0uZRrUEBlr6\n5iml/jy/3Lmm+jbkrBzfcS4v4oZiasB43xhxzMierVcOjMUq2gqjRv49r1yC\nlNgF7xX7wbW7NBe46xiSs/e6Qaf66O7PpAglVIwkauuvVG7nLg4nWHYtwidv\nLf0WKi4Gc6QBtko//nn2hc4QJY1+2Zqt79KQgFEOkAznffQn9vQP2IoHdUiM\nGFqWp30156T79QDAXTEwCr+rIIWNStv+YSRtTkigtYD1CIkHsAwkL90xGgv6\nOxtwenI8S00P+2vi45jY3gU0RXo9qCAP8vRqGTaFoyMdMUP8p9PkDBbt87fU\nNR9Eh66lued2CEZUFIyTW69VaMIPk5PCo6Oanwh/3SsHQ4bjFAv1njdWp/HH\nZvhWj+vNOGw0fkegXKYFnGMl67XkW54ALX1dGvg0CFaAMyQ87iNnf5bEWF7J\nZi0IgxYO6Wrx+3kllNXCYRPfm5D+QqQtIIEupI9x0+HPTzmpnP4r8+k/v+fg\nxIU+NGZcAyt3rIlN49e5pVLGcuK2QZEEsbPBIFVO2I4pRNopy3vJY/dDgAFf\ngz+h\r\n=8+t2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5PfFF4B3/Wvi3N0zhv7XruAXujpaaTFRFufXLPUpfGAiATGqqJUvjnyhEHg8I/mu1tKHnxZl6OzvyQg2TEd3eP6A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0_1588197603940_0.7629275221551537"},"_hasShrinkwrap":false},"2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0","gitHead":"fd853343aec556daafe2fc96c278013d2231f30b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KqnWG4EeMQII8RWWvL0enLSXm/ExdJOPbbIvd3L8FzG/p5sj/HlL2XZMTkEaqPG+Rck9IfrG1g/b4pDFU3Rpow==","shasum":"cbd10eef56e548112e4b864326460129efb0daa1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0.tgz","fileCount":28,"unpackedSize":127932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfjpCRA9TVsSAnZWagAAsmgP/A6kO5TR6YI/j32pvng7\nTO3G0O2BeHAaAqF/EuG+7IdUE8xn6gI7Lc7oqKQUacIz2QaBFGnjyI+HrI53\nwPw3VLaPNd82NHkqpnq//UQQw9TY+uQzA+q6+eqlWWyeSLhSXJ5c9qIdKA80\ninT1TJQzUj8dcGcjcogNnuYBLDOjUEpU3VZtvHZ04Woj6SmKZd7dHIp/EcsS\no7b8NQ1TvU9C8vbU+2NfCWNgTHB52Qw1MiPWRKYahnkYomw0iI2ZDxrod4DH\nKz+90O676FhoURr/YEsX3wBKeN6zLEGHACJQ4/vvUcf1DVn3l9p/SX8b5v2B\n2rsDFgG2N8mECBYzeV4cSB8/amCkCXUePfWagDLrIzUZqvwaMI3WA8FkeLnM\negUBeGcO1+iq6jpEVjxcbM9wu+ws+J/2Re2N97j8P7fzS+Mahsw0XEf6U+U0\nG0Cp7lYPFEp4A0W2/z8r2yJHYetawgjcc2vFegFcz6z5rnm65rozwmvGutZ1\nqIC/zjf1uR/i9KWTlE5QJQY4yk6XnAAF8rNTKyWg868FrFXz0dL8xifupJ4O\nEPYen8BhO6D5+V4HiAk8EMVkBf1aSEhc4p0kW0bfoqAFPxq5JW0BqwVmNRPu\nALWi37388CWMAIzbdRcZa+nO1e1S44prG3WJuq7S+WpjLWtDSBBEwBmSKh3j\nGZtW\r\n=AfYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFm1iKvoV9oQ3TS6wD+z3Ib+Gukj3JoQIP2YiCzw1lPwIhAKgSiTmx7Jc4zzSUjE/7TRigoRIRWg622+Qvgh9hqS3I"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0_1588197608652_0.48890859420996846"},"_hasShrinkwrap":false},"2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.0","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0","gitHead":"3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PiaJI5kvSEDBDoaTYf75MF2jXQAzCSAfT4xCHIMiwSb7O0Cfe4e7zabgqDpUfatEQMm+cCN9y3s8orQ1c/3VZA==","shasum":"717a1c0b029892db558962445cbbbafc4a0828ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0.tgz","fileCount":28,"unpackedSize":128205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqflwCRA9TVsSAnZWagAAPcgP/1Fx79WqTFdnMVNbqIe9\nCyfC7rX02ujRFW/ylAbJQ+6hTyTH4Kh3YLioDY81Tvs9Zixthwu+Q1Ootp0V\nif5c5CjVcvBqZP/nDItv9TpvzIMlIwSLGl7ydCPqJ6oVpO1/Kvp8wrFjbL6N\nChzmGhflJ0YKtyD117+qqsEt3+9CQeKb43YXLsCftd/jWsl+uuh4mWZWcIIN\nqcEvGOsNNUvsyMYNAlNN8QNp1u1yu+vSzBmN6EJu53Y21t0jcB5x7SqHgJ0s\ngc5EFrSw8bMkrm81tidV2WL+MYdM4b4RR6mTSbeQVJZ4aUapvQjI8/Kj0N4l\nv9YUYMxRD2+njs7Cqyl45k2WMsztkkPhWO2VxD2pmtf0r6mlUgcyrebE61mT\n9tC+11sY97wD3AmIVXjfBTUuNWvm9jECnO5YPn+0k5+VWvR8wQfVMGoPARi5\nGAy/h34SAGw5cOn5JKCMLgswOdzPAMrVtXfwIwy8Ah8o1nNi2KWkH3MwOxE+\n4gkVyZrHpvfA4hp+iM/2EL4NtilGo6nHISenIgowGKfgrjKvG3fa2VmmUpWU\n72pKhNagqVfYDv3ZwdmqiMD6Yrlc30sKwuD8gTBOh5H5FJ0sdB3FG56X8UCM\nTgf9cBUatuBDhAUhNHEAvknd84SpjlFkaeaTCVRVjKV1AUQqvbrli08wrwyB\nV8W5\r\n=1nyW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICaCTxnBG1Uh8McwcpwPnz2ET5kKc85D+Fu+poigwUX5AiAeVt4OIFFtUiHpdlTtTWZVOu7+7Jiz7DhI9/NKw2VUyQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0_1588197743344_0.9655925856453165"},"_hasShrinkwrap":false},"2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0","gitHead":"8f3bc082808df4af078f161f7ca357429fe66aaf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t0yLDDSALYztdlxBgh0xHZSz7E01nLldPs1UzDra/WOt1hFQC+AyPfTmwl50erK20V/Btxd3uzeXD1SFRuq8vQ==","shasum":"9add7157a66127bb0cf9eebd147130855b2161f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0.tgz","fileCount":28,"unpackedSize":128205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrnsCRA9TVsSAnZWagAA+6YQAIqBgYkVLrGo9AI9/TTx\nkc3TsTCOG6zR/IX0hvVY4MrhvKW7vmC1vq5kLKCAZWxej6hiYpzS3LtjjEAR\ncSTjJUC6EYsp/68G88K0nuxiJ1Mh5ip69t9mSzobFwXasufKlscmTl9V5tYT\nup1g7tjsYPtpdz9LmTF9dRCIMdoGdMX/A7cjvwqYXA16hMk/cvStnJcNBzZw\nCwG/bpMFPvV5o7evnE6qqwkTUJMyt4bmw86E8t1Utr7PYPHACD719dxrdU89\nyMSg6YYekUVHAHJdeLWGNRvLuU75VTIl9OdAOk6l6lIcRt9xa5FVvBSNwEkT\nywN9HJytpI4xHLTeFcl8vraisTZ6KlLJZCWvAQhfrQwGQ9cZJ6YH1SiPbUxW\n5AT96Nryb8tNHBPR2JoX5s+mw9u927tURT+oYTsGoXzX060ori1JKFAXBRWp\nLtwImQc5mdaqM1SGyiqsuAqQ5a7fyAfsa67+Lp8IiF4+W5qFhlSDjU1uJpgC\nRR2zHnyOiBt2fdufd7QAiaMO2DCQh+XM5LpdLHeYCoC0za/1lFofAYKyY30Y\nxH6rtxxsgdJXZZwPSFYJixETQ/a/G50+et1cYwTpdxm3mcHJorHRoIZcnxtn\nzBR3uMJuPo5N9aIJq6I+mgCQubMQ5eIlrBWFEnhHl+S95sxwYQJ9gzWuSU3A\n4+px\r\n=71Bf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCewlAGFh98YcEavQEJCau+M59xe1A/RjmYB8brmIqg2QIhAJsxc3gUbFChFQfVOVq+se+XImGfFAY3fJ6z6I7eneEI"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0_1588247020346_0.5936908847638689"},"_hasShrinkwrap":false},"2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"010f1a36a93322a7e08e70908ff0774b6b563961","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VS2I6pLlu/UB6US4S5PWdsZtEvuKnx/SSNhYI6HEXB8T/V49wwgEjK25RkdrmUPqnVd3VcNsLAGVTdtolWdHuw==","shasum":"48b64b1bdcb641c776d42fcc0c31b704ec219a7e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0.tgz","fileCount":28,"unpackedSize":128205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrpbCRA9TVsSAnZWagAA+TwP/iw0Z52q8qIDBXZVPirG\nC3NsaGNDN3S0dYgfsipA5UzwOw9PyDe6dGvAg5UXieUqScENrTf6OzYduIrh\nY2d2qUt85n24DBeJGBRlnbrI5nPsvR1RBSRrlKN2uB4f8Z80g5w0S0kjKBbs\ncI0gogwQ/21uB21BGs4slb8wyYemlg74ZvRSb+m35x2ZaukBUngnfubYEuPt\n/eGRLFJp7TTJ4lXtWXH292KeW85JPXIOSgpmvbVZxN1Mw8UcGmxgESqOrwPg\nDAbyYfLeL2QOz7Ic6mm6nSHkcYgNaMrqMZM0sNownUgNY82oX2tfyQgR3m3t\nqR5aNSn9j8EHhkpQQB+xC2O78OFZf9DW1x5nTditRKiHSHqcb0UMb69NQ4Lp\nNc3GFZdmtAUmSY5X/bmUNm2O5yoY2hz3ckCv7q8hkF14E7z7mjbDdomiG6Ks\nkAdyioe6103ucuMU86QOluvGaBSUbajfuSqeiuFLEXHy93ps8KxG48rDdnx7\nsBo0zXZraZJIFtkPi6RBSL/MNBUERiRb7XSUgg9brXXGIhyIADVMsw64aZhg\nforZsDOsGBzdHJiLor4NEqZayHAEn7nAjK/PCq8j3lK8UtH7hjyf+HlorRKx\nu/PftSw33CysqVdynK0P0tLlzzZT0/kXFFztaIGG1u5NN3ajn0yoWOzHNXSU\nsYr1\r\n=RtrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpw3sSqLK7c2XzuF3Vr9Rem5TEmSpoxD5cPccc4y3+3AIgVgvaLTBUAjUsl5EddrJnX+Gjk1oRBqVwhKj/9KAwGjg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0_1588247130955_0.7983819742872771"},"_hasShrinkwrap":false},"2.0.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.10","gitHead":"357c2bfefb36e753fd41c75c0ae73830fe93cd1a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.10","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TndnfHLDX3J/xRFGTh8USigj9y1Rd3OpnO2R/E9Ak4VK+8J1v1A9A2doG51QFhJg4jNuB1ISbC0XiIRXw5vXUg==","shasum":"4592165452b98ce86efb77734c4dc8cb7f896193","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.10.tgz","fileCount":28,"unpackedSize":128443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrpvCRA9TVsSAnZWagAAfrAQAIytmtBX/60ybFKZPtWk\nftk8SNrpE7BjvJhDMyKeopcSVkf72KvDC2u8RZk269wJdRtIx6LbjqRDaDv9\nXyT+OoziFxV/9h2nbMKOBuygdJyamcfqF8yNyAIFYKLt9XXKQQfmhXWM+tzS\nOap9D2s1u2k1aXYzeiiH36kn2LK4LV/er7kfSTuXTXRc/1hNP0boBBZXKtr/\nG7VZQn5ec9pkb4QJWfIHXcQovPQkNdFAarNK6wmDYRybzSM+vtYRwDcr0BPK\nTa2B60jySCSmcRFzp+xeHLG7nWeVd/HffOmdSSBZBFoaE35qqZDTibfTF/R8\nAzHawp1GVWIgqKKnVDFpdWqO7A1tquO1frXGzpR1RaC4wg7VXkpCkwQOVoGC\ne0bQsOVUCR0ztHO/wUDWPJZYmfwKPl4x9r8b09S8lUZMvFiqJR6oyZyES5pQ\n3g7rHu5fA8Q+HKmug7P7fuSjD/JDHGGg0DevbwoMRI8JzjH8vKaLDPmO5XQh\niZHxKmbciwPQEpS1yo0pviEcQNUEhOfgW/cn4m9oPNWz7dkTNtujbR4JXTuT\n0CFMKvUm+J5pkY6m8vALxr4I+svdlxiFPOW0BefmISlrIXXdMPChVjyMjrJg\nqdrbFQPmtaPs1XttP8CPazs0dl6eeqJ9LQ7889PPbWFvOOPiGtcSqNlJUm0g\nwStD\r\n=E3bJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRdEoPib4+Uf9FGRuIixLfi4rtNz4weKJFS8MYtA+ZQAiEA47XzE2DVxOJX7q+RosJH21CoxzBZ5vs6gkfyqUT6IPg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.10_1588247151228_0.8969020288210114"},"_hasShrinkwrap":false},"2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"357c2bfefb36e753fd41c75c0ae73830fe93cd1a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hj8xZo0xDa2/foNsutDxBNzpdCU5tOIIPaVm2wOhrB4MgJVoKo/hquJfcMDqPUiADianHyAoa/OUf8xWGWszsw==","shasum":"532cc7267d46f58ab7db5a7bc0781753913deb6c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0.tgz","fileCount":28,"unpackedSize":128486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrqPCRA9TVsSAnZWagAAvYoP+gJACG0JYuuDmtioTF0u\nnr+gRkqu7H3Y/LUeBPcbPkCgltemQN3qvfEMii3s1c/VHD5lWzdHgIvdwpHZ\nPi9Bjrx3rkT93oY/d+zfrNRfA++MycJmLYSz+lFhxytnoNVWRbwRxgCPiACP\nC0uabRkwk6r49Y2aoMnn3bDaMXN6aFmcXsXKL3umk1HIdA9DKXeuy5HCLOZc\nXEOJr+xhZBD/6nYhBgllx8zj1c4w0xiWhbXNiK2mbV57krmnOIJSGVqYY8bV\nZ7yReXxZrtNiwNAWOEzrYQlycRHJEnzXaIGVqz/muIBZFDgmAPTSa/R0AUdZ\ntLnu+e+feb8m8HNnlDpd0AqTx0EetK5Tp74wraYayftcMj6O8UOujimoI9+N\n2bLN7UrGCks/6ZpKIuwQFnPepTp6uTif9ANyRfI+b+iLY7uco0ZAg64yYhbr\n7V0txnF9l/Ak0eHEOR9JkhztB6f23uhYP7s6rcfMHv2cbif+grx8Swo7IgUV\nB5JTXn6U4s6sDYfe4zNSTWNeo4c5d75w2kY0aQkGTL3sJ6SOEDlU9K1LJDyQ\nT7D1+Ug9vR5f/Efimc/58dOPYLfEXP0ySyZzJzvWujiztVNXlwE29DUC+g3R\ncvK6yEZH43JRUO7UeYIni1Zj0wuFrPEQ9d9cvzMJby9ofhs+KvyoKvebZ35L\noOi4\r\n=BXmj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsPrrK2RMupgXZgNLZ3/hFQ3bWjRFMZ3ZRT2EA/W2PBAIhAKmQYFXI9l5w+69TD71RXUFHgd7pYqluxLo9GTJ0kuRF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0_1588247183052_0.46598704076512143"},"_hasShrinkwrap":false},"2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.17","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0","gitHead":"f556a966b26e65c3d77fbc973891d6e41f2f506e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4Z4a7atmmelh6lVWGNJJKMh7qbT29B0MXak3VicS3+IsBmlSTrPOLWE9zAiRFiJmWEr2hpcRz+NiYuNpJaR3lQ==","shasum":"6716807c7682b8a6d29f3048c09d86a6a414a3b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0.tgz","fileCount":28,"unpackedSize":128486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrrjCRA9TVsSAnZWagAApTwP/0cSMzgYPAV5RFAD32n4\nG7R6k2mwqsV24qR5LRkwSQABcx5PwssmvArD8nDJ/sXcY+YWy37PR+A6EBTZ\nk0ZORTi3fDgoELd+C03+JfEJDvcaAu52GmdErACdEi8bA+/+KN7FTvawQP0l\nqNZYTt+TXWSzRWgvFwfr1ZIOpaIhyS6Nmq3nBrBPnVYVVBKm07AX939xktev\nkZDf/xSXiJ490/+CVC0tt1ZwHYUSI6pw003jk7+Mx3vbUye3Bfdk5qan3PrJ\nGP/SCOlhZOKlNMnweglMeawfpMAEPCI93ETQB5d1hu2uh4IOt6eyrZl5eysi\nnP01DMYuZE9/YGMcE4gG2kOXjyxS6Tmn3UBl4wob7At2CjPBwW+y1miMyoF3\nMDD63nKhXy1Tt2Ik+9XoZ/YY0otV5UcePHKJYiZaDydQz9cdidJXf32nJ0Q1\nF/L1z+gB7DOKIcEOHlxThbCv151De6ac0BDMbhpfMPEeKqCf2fQSqS5TWEsI\nC3LD0t+Q6W79rHIysBeNcWdlHKau99aY2UK7mKfVr7m5s8gkYkyuH4rRn3Fy\nhuZ6taBSVtmzehy0zb1kieY54MBlixyfsaUa4vE/wWzwQvFzf/3mosNIOlP+\ntuWyzxnrgnb7WCIU2ctiRjNv4FPQIVnwefINoTvJf/I1JInXJhdewVC4wEub\nGNbu\r\n=Wbe7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTcU2JRe6rAk4MHQNijjGXymd61BTu0sdryR4yFfVdqAIhAIb5UvzfxzJ3cZggPLq/sB/0VTo15rMHf+g3WLv/QS44"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0_1588247267223_0.6651063578635541"},"_hasShrinkwrap":false},"2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.18","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.4","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0","gitHead":"804c1af648e48e004b2e7ada2ca327a3bf2e73ac","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zGyA1eA51laUWvLUiK7la3RFLwHYMzZ+yINbKLwltcaDgnbuZydyFJU3ZTazE8L8JppIv2bUFhEF9qrOZqHppQ==","shasum":"bcde5f8eaf4c7628ac1c684c956beb3b203daeae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0.tgz","fileCount":28,"unpackedSize":128486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequjSCRA9TVsSAnZWagAADbIP/0oj/7IJcaR2eTyzj6EQ\nh3k91TGdVJLcrKT0AEvSQ6QOKOrBpYMmcHqv8C6oaS/kFgvSE3mCskVR0fCU\nicfEw9Olwoz4cqIGh1wDG9KpAEHRr3wb1Gj67wIFUhql1v1nfjMwRFa/20HG\noXW+ezjKfqFhDvWw5qt/vyP9Z66372efsX72aXKBCGNOsh0j/udg7MMO0Pdz\nRNjh8WdqB6wORODjYZ91Iz+BhXuE97P0QCdSCvFKhUZQcC8Uns+EMPbegSmH\nHIE2SC0i1FuOdXji9gCZmIgnOEWdoCpSvsmL9im2yqdbgNPoSVUfeRy/d8dM\ni23xpQyYz863QIi70kpd4xxvOrwfgaYI7aqNcCwebl/RMYsXhqkmNs71sgTh\nQM7Ciml6RqI/xesezw3g1NlxZd/Wh3NrgMx0yQG2Z0LNS+6UyebbDsmdyy2u\niqUgM5Yuo6OkZQ04kTUNk2AzKFdrJ3PH1iCa7GQ6OVs1s+maBWHJkWmOZG1O\nOU486xhfdfQYAqz5SHES/ZFxKyUDzyXTj/L9y2vSdTURpBhOahI/ngFtUh3Y\nVm5PL9CGC2SJ+g4lu920L5LTD4vixSQ2jOROIohFl1mBmKF2lZOv3FAgL0e0\nQ16OWCXESHj4OtRPkRMWHmfJu3JuYC9fOiJlNWlmU5stbEBym1dyo07zic4G\nkvcY\r\n=DmpQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIwy6yQ9IekBIanTFYO0auW6m3qOSfObGIEsO0rCj0VgIhALZ53CjTQfJLuEICbBRV687vGEZzijlRrs9zZnS1gNHP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0_1588259025704_0.5931021255469275"},"_hasShrinkwrap":false},"2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0","gitHead":"9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jHs1NxBIpAO841UztCCZ58xubVeQd+1y/UZUwjE51rbcZKh8ALG+R5FfUxhzPf1R9h0vIF/3Pn1OtUBrYSS35Q==","shasum":"98eef9966265bb998f8dadfa5844bcc46cef0dde","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0.tgz","fileCount":28,"unpackedSize":128486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxjpCRA9TVsSAnZWagAAPqIP/ifJ54A2PR0D4T5Osy5a\n8oDnI9uvJPi1gct7o9+t/inO6RFItJtkq+lH4nURbfEFoFqroIb+4pUIRqp2\nC2yUNYHbrCZhSTWIjMCwXBrRzKK8FIcYPKOSGwdfTOSHV+Kt2LH8HKjViC+p\nbLR1QV3RnxcMp9GQdkuV8V9rwgWZ+K4VKORjHl7RN8GL6AHEkbE9+Ddm43Mz\njeQQjwgj1yIJgtSoU667kf3tWzmLjAxIlqXoy4c0Ix6em0JY4IuIQd/Lndyq\nOep0TmS1GSLU8xXDrb5lY9xEcx1IoFnDmLewnOMNC0p4rLtxzpbtZWq8nHdA\nUs7EttzJEjsT6R/NhADzITaEYIBv2TpCxWodWbb2SZLIBsb9ncowp93HKYlw\nEwnf5ax3sMrdHWEEkHljnFRwgkXz0QYM5n7V218/rnGTfm9LA4iQT/CI7YTJ\naKtti2YkAi8rnzv3hk/FG/dIEf7z2RNgGK6AGY2eGmoFqmhyO2A6A3mrYAsp\n0kH+950ZAdTaNMnlGaTnGwDi8JUidBYI7eZfY5jH7vpbzIG8vMKjVCs3JXVj\n17hxR/HHVHMvXF2JzwhEoOu0hHoS29EyYdxg6s6A3VxCE3wst6XSpKZqobqH\nyKRU8cgaUZb6K0nzDSQMNddyYduDKNMgjK+O4k5fvqT9tF2Tx3sH0/D9dQCk\nMskL\r\n=n28X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuzcuxBr3MqkaQp3h3ZBsftYkLlQRefNA0cMeBDL+uwgIhAKBBZhmb1aL6jy/BQslfb8RW0XvL3r4ML42pmtht4oqY"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0_1588271336370_0.9873859551583453"},"_hasShrinkwrap":false},"2.0.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11","gitHead":"db9a06f7499073dece2cfa947b8d191e883c0e18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7n1nJqvM/oH3Hc/V5JT14F6GcFq0qdDUA1xRnPhlw2EaUMOs/HSbtq54n3KFZQfeFkrNycW/Rp842J5HF8Ph0Q==","shasum":"8b7fbf93158e29a410550df637ad246e953ed3a2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11.tgz","fileCount":28,"unpackedSize":128722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxlSCRA9TVsSAnZWagAAwGEQAJ8/JLmASV3hJyNEwwKN\nU4LiAGUdumKsR6RsiEsCkQEssYxx0HpaCppBlgzjoRQqvxsA04Fr2yaGTnB5\nbsmF7euWuAysDNVFO7ZuTKBUeu1TwuJij9Z4hlkHXPprjiwLMsA7jDRjIOPA\nd+skaVBuJg3hptiiMmAjxDWUzupEd2W+4XHgrnSyjCowRd4A/Ig9RoIMQThl\nzOj8o/SA2V6SGEyU7TXZxJsc9HjhYmjSPQQHybKzomQ/rybTafyNf5wUbAGu\nbtV4W4WawFGLssxxpb2FAVF4VhXQgjSX6ozNe+Sfhqt/wgqPZnstE5B96JHC\nzZuGBQWF1AVFDuZk9bExOPSacJYPhg29czPi7gS3N+v3ZRoBQH0piY/u0UzO\nJOGLtxDLhu/J0dChxNPWE7YDkARcoPRQONUhk/edJUIz6tTOgRgz6q8sasLN\n61Z8xFa1UN0QrYMZwQAQK2wtV1FX9WdxErZ+BuHAaMme5AFzC0L5D4ziZ2VQ\nQtQYaZQlWJzIDnHv/w8ddn4Xqmt/48j5t6/G5xtFEik7KNH04ePOFd6cWNOV\nCI+ADtJL52qQT6MvqHlVmrXzWvcMJ/I8U3F7SQgz3zd+JwlBTFFd6qIMPDfu\nJhU2OKlhNCwE6cfKklpYIlVgWp+i7TYqCqy51yz/U5I49QbMvT4qpxoCRZ9i\nZD3B\r\n=4+j2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwzQvVLHxjJ3AUPyPnuGFKibIrMS/oxlNlZce6U1rcigIhAM61lDSJxXSmKJyFGMOc76drAayIThKH1NDGWLZMM8rv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11_1588271441411_0.4295239415895977"},"_hasShrinkwrap":false},"2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"696dfb999803d57b9196b7db8b0515217988506c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7RFBGt5y6MfA2NgYIWkCN+trwPsbmc4Zw7N+6rqSunewDm2g9SIi1hPnzxXH9VQfhHGSTuMlxYWXkEdmUgJTuQ==","shasum":"7ea2a66f9dd1a601cca2218b6ec122523968e352","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0.tgz","fileCount":28,"unpackedSize":128486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxl8CRA9TVsSAnZWagAAO30P/0MuaghMkQnCPRzwAa+Z\nimXH0loBdmSaViiGe+4rVUxNI6DF3BarQNw9FVK9GDBqjIhdRCKZVFKAjcW3\nR/CM0gIc/EzwLKIpQtC1KrBv3tLQhXy4dcUsd1jYhIBzo+31KuNPorP/nNRM\nPP9yM0fSP6WIjnNdFLN2wqiBwpzxOfcGQFDP3bjmYDetIxLyO0Iw+qMMm4h2\nyzHuoEEWYqxaBMLccNA8QBRLLTmuOfhwFBGKzr7Taju7p1/lJ2WK3ZETyrh3\nCIHZBIKSmCwGByqjpLcTz3EMwBzqePBZ4brd+kyWkK/qC7leBvhnoe6AnQed\nlwBK4D3ld7WD6sSXlv4CHrPlL+0hTNMMpus9ni8FBgWNls/3qOk/KP7MxhNf\nJq2UpOquBWb4Lj9xNHZATrmg636sKa3wC1nruiI7Pe/Bpa7qZjuuMDo7e6nh\nAjDHlvP04e3mC84Dl/42qXGLdYHg0FyrOmLFX+TW6loQtCakIgyL1swMJ80B\nHB/Yx7xLNvSQ518gbFaTl9OjyaCq+iT4IMfC9XzOhtepX2Elyc2vKXT4hPsF\nXGRMKTAu0cE1gwxd6g/aFeUlhUC2ZcOOK0wk20K8xe7p4m/ykbrKsvG70ZaH\nl6070XKxHa5lXXNZuOY/XHP8mZBiheBlO64ljc0OGUIYyx3U9Y0ezpCcKsmC\n1GTt\r\n=0oId\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNNPPGyIaNxHe+OCCn8f3/PeHEtPa7ZUe4PqJQgd+QSAiEA+WQuXgUu5W29qefzQoDeAdAgsPRgyZHvU4jcu7EVXfc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0_1588271483596_0.1197492026954079"},"_hasShrinkwrap":false},"2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"db9a06f7499073dece2cfa947b8d191e883c0e18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LT1Nm9zkRnnOTeIPPy9Rb9BPN+xeAGi4oKZbv9CnSgZVdDKiFcATEh21TVBuPQ2GjOu4EcizSFE1g2Z0X2rUqQ==","shasum":"06b6eb230e6327e87cfc33edde830e5f91180ee4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0.tgz","fileCount":28,"unpackedSize":128765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxnkCRA9TVsSAnZWagAAQP0P/2KwTS1t7CN+YXKvuwQ0\nNlzwP8B+3IlXn9CdXpa6cSMQg4NSZBHpx+N0hEODGnQhY85UFx1ksz48VWpd\nk2LW/v8DWSMJ137++eWB2p/AneVu0ILIC4/ub2J2Yt4OipK2+yWjrk38NfC2\naqMDnpck56wVzBqdC9SradyDhPTHRvKYDOHo58mlMt4V85E3PKU8rEkxJPt7\nizf3vhx6zRjc6poeNBBtFX7bih1sfAX6DFGXFxvsVE6LJPueDc83CGVjc7Ti\ndWO+8x8nmj9e8ShIWm607NA/pksHxs4lpUYmgOajR6hERs0Pv4pz3j+iUQXs\nZp0x/NkoHbAjr6AD920nDNv5rl+08KpbVoqbsUYo//Vl0vkhOeiQ0TS1YILN\n65xmMzrsvthEeJjew8vRsKTSBSEicTvlr87HjBGqCOv/qNelcL8U+c7TMu/t\nIg6E5V0mdhwxYtF62iWPe/jmjjotiKrsI8ZU2+J3iUFcSljph3Y/Jq+8G83p\noDBrpUnZpFrjwkL43n/U566Qa0YSGpjrYAUnFFX5YA+rz3JBgo7ozO2i0m6o\nF5YjQNELexarLKOAFUTYSrnJ/3q4o3AXxVu09URcVQRSVw34H9s4Pkwqbdso\nwNaMU5uHsY1F88vGH3Md3o21GSStSMvTqujj1C1JXDjWG+sD90zUuljIo2Ra\npvNy\r\n=UbS0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSMq7iloqlIseXY/wXmULBcwYqi8JUe9RYAS7q1Og8xAiEAsPCxHvF24Tuq3RdRKDIwU/aXSBeiWXMbn1RMQUcIpWE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0_1588271587691_0.019719887852597706"},"_hasShrinkwrap":false},"2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.18","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0","gitHead":"f62f87293fc2edeafc1b53f124249b378be90444","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ryvMQHAC4Ivw2sHopX0bpzjLBzjsqzs1Lw7DUivAmtzD1RAhXDD3Nebl5A4eR0a8OCxIB9jUMsDI8vXVEGO0Lw==","shasum":"4ad23c41faa7f581e88582b1cf034a974237fadd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0.tgz","fileCount":28,"unpackedSize":128765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxo0CRA9TVsSAnZWagAAyW4QAIdkFtPTxHHLRJUm2M8L\nY8H7hAffN1Pdur3q+k7SxTOELm3c0FLZ0b1TZ3KotmDsezNN2GloZWdoAM11\n0CaTScqFNtelOhY+Pfbl3lXlJYQDSyq6bFEN0RLq2swQV/uASaK4YOm2wpJW\nqwNJ0lQST1u7P0miBZp65mM2GZQjTBtGyF6ovlnJKiS4dbD4wKGgB+qbdOow\nlL/7nMx1icnarnvsBCKVVH2OcsKc8DRppi2F2SflpVSyWNfk7Wu6q2HfE/7+\nvPvkh+Ovp9n0rd/xXjQTjHTjg8sWh87BvXm+xqKJtvCuRIUYQZxN069aCHvQ\nRy8coO/EXqPwVj3h3ZKVg/1zwWA50z2KEWQu+/4VqyxgwdhywT2Hd3bES7lD\nH4eceVtFI1xF2WsGmnk09vPkuplPNSw82MgIz+/AF9nRTJ+7JieKaZurrvFo\nmVLNYOXwSkVJhwV0JMQC+6Mk7KrZuTb+JfU0n5nLRdWZYDGTqN28pQl6NNOu\nB5d4OpNkAGMoVoQq0JSdfm8lSqY0gESe647eGSnERuNlqW+S1czihgvZ0Rm3\nh8qqHjpKY7kk7zoExnHTA6ruAr0ELms3AvxJm59sBkGTdPT74U1HxN0BtTBJ\nn1EMweBs/r72UT4RjFluIifhu0LM0zlcW6qWyLcihSPr7CephOjklGo9wk5B\n4fUX\r\n=Hhce\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqtwkzaBkMONxWfrejP14fPWcKYf7cP8ecFcYvY4V9gAiAMFnQ4otpG+yLKW3s3O0yKcxzmeojfUI9kWbAHXJZamQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0_1588271668287_0.2864383166321347"},"_hasShrinkwrap":false},"2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.19","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.2","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0","gitHead":"5ad039e719f8804d1800eed4b73a8de41e3259fd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-88vRtvY6CgnkSUHk/Us06R9KQ8Rvcw0MxtoW/yxhhPH3Vpnu8h9UpilhCUKEaA7ZwNlLAuOu054LGURfx2MSAQ==","shasum":"083e4096fbf6a0a66ada4a720daea25b204bbafe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0.tgz","fileCount":28,"unpackedSize":128765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqxp4CRA9TVsSAnZWagAAjDEP/2NAEkvKAXrDqqwLzIox\nq0GY4+dpC56Ivu0bnCgZcmqM6tMHpSfUvuOmQhNDOf2RGwW2navq1HUoRKFv\nQ+5RVgtrEzL+5wxtutFJoAqbz/yjNIDbus7BGW6CExvjR+tKETENwSIAdYTe\n/gR3Ayb+KkzkLDOz8OB32Gp3q9+mHYP1yU8UMnvRFjEjA+4L5k5ENpriveZ7\n99LUWw1fjfckMSppZFKiforRumjbOL3rjS1/tIDN+cpFoqWK4PcQPTBugcK5\n6agXbRi6HX8UtrIEWCREX1HKvTszRM65HSk0iZugNuQC6Q2L6fVfob3mflMM\nmfhDRydgCfOhcouekxInAnHy2AS077S1EBB6Qj5qVYGDIxtwLfZpE3D40N+D\n2MpVXDQKgr9EQazj0LXBRBVYo2NQgPcd9ll6OjVmek2U6IhmqIVg7daztftM\nsnXka1lDwhVu0QfWZjzbbipiMGLdMPFoog0kLjUMu0LDTUtafI6Lj3HSlyiV\nmIqvcZUJA9zmeTb9HmJy/cFbFAYzS6Wg5AV2fn3Okjwde8p8Q74WUaSaQ6TO\nEquJoZkM45C7R4zLY+GWPO5hAyRQR5OfobVKuhsEBsOGFzSb3qGTM8IILOAV\nTEI3vGLPKxD63ayuMF+l30Y4LqHe1bCffvVU1lhN/pszqHkDeQiZch4LJh3Z\nUEt0\r\n=2rBz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUlmQ2yotyspPMXWeHhxORbrHKZx4PUTElT4ulSlMFMAIhAMVZyTbg7q7q7EZlRwGybXzNAGBCrWBehCGsDKbneSfU"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0_1588271736225_0.5527931931130086"},"_hasShrinkwrap":false},"2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0","gitHead":"ff346aedd1e6596080831b01a5bc8a187d72ecd3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NQj4uAhMcZekc/UmTn9gUCMkvQZ63SAO0q4Y4/acb80EnKLfWrv3Pga+HJl6VvtrkzdcRMY5rlzpiBe79Gft4w==","shasum":"2e44071184961ec3dd7e8eeb76e94cfb12964d22","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0.tgz","fileCount":28,"unpackedSize":128765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq0/9CRA9TVsSAnZWagAAHfAP/imcp+husda5czzepee1\nqqk4bNVmd5u5tBPFIrv0uRZ0yw535eHwFuGPeCG4xyqtWhb7kHzy12OxpkUQ\nZ+iqv3WQVncuxzOy5V3vzswEOXXT1kfNKs5SUgCSec/53umAC/8gFq6Kdt7W\n+g+2DjJIEVlbeKUAYpumWSm6TZWfGRcAALFKzS4V1NlEVWJgQCV3XFCyXWaa\nau3jMkL1TDFzf3vZ49i1ZpZ0NiiGMCk0Wei9KbtVi9k/foPUxeBe4kiVsCPp\n5Gy4LKXVtUkn9fiFigpY9BZv9Z0kRRKlWlvbuh/W7N2SE2y5CZ0xodvNvLRc\ny8UotzXNxg7Suq8gBIYoV8Au+P9L5SH2SoS6u+30GaWjS5i6YURJl+XRfDbR\n1rT/EGHvCODZ6cpD3fw24v/zCQWXqqPslUpgHlzPkiyHdXvX6PzOvV4ye9zz\nLL86yDiReaTHsQ//uDdVLmSeVTnQDeBMVw1S/uexhqNN+ntcr6NYRrSKeFTh\n87sZSNy7JSHLOikXHXeZfOblcmJZNLjsyR1Xf09Vas8e5FnCSVPkTywfLUZt\nsIPLuCrZWQzxiWCZfzUmepNvWI1bq7K6lCMKheezhVzQpZwunQxlc94hSV3W\no1tGIvqGiXn3eHISUJhZ5ZCzumxszsWwSCaBaFkPBiQOvxQYVCdaFkxjDLhe\njP1l\r\n=eBVs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHJYn3m1FgY1EV7tSf5oCGY2jVdCkNXOCC3WWQ1UxxiAiEAkTHCaFTRe5k3O3y1xxGOXtETUxLsRqQL8gCrqx3ARWE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0_1588285437084_0.517915198033829"},"_hasShrinkwrap":false},"2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HevquAjXr+bQtPuOnh1oqzX7O/muycpvYIBFv/5sSAXvlvAQcEwXYHZ8iutTjo8J29iVok6DgoQ1cWgKFLgUYQ==","shasum":"07d08122957fab55f5c7a5afb55163a061216889","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0.tgz","fileCount":28,"unpackedSize":128765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq1BJCRA9TVsSAnZWagAAkqkP+gMCtut39R6Ror18Qs6s\nWKo4YY15Mn5Es4Z54aIPHTnDSHEF+Op3yA3R1/oPvlXaIkQG7rJT9pJj5jqP\n9P/7BffDlF9wYggtFx1l1rxpGrdNwwkvtdr6ZjhRzds3MU55+OWRLdNOj6XS\nB7nHg2henKv8JtNhsU6sQuRWu9hvSNh2qhDJv53QxKwu2JZ8smeMvoFpNvc0\nUIhyWczoLjhGftYEnyqdjdi5jw5Ur8Lm/8WCpCrxxbtDHZFj/tQDgWOi0lIB\nLf7et1Td7nvyxFOxwPKZoAFKCA4ZuAW9rBlx+Wg3QdOrADOGwjo50bEqyswN\nxUy36WkT+vfv3ZTRkOQF34ePmkKGI1G5djwzQOu3vjG7eDkd+NkQoSQ2gmr+\n8pKa6GVkkyLYg4ADPaKTRbYdL9wV41HgKOYrdVqh+Idh0DJBh6SvLQjbPtP/\nC1bxQulfuLjHjLQ5xcu6w/rlCxF0XppRDxW23RzXI3SiG2+jBTGe2LRdom0C\nzU41iJVw5RGVMPxepboB92h3PMnp0PsxoxFIYCMLibPowcLPXAFm3XKr+8Ve\n/bT8oNx+OxyF3q/pRGqePSmbru0m7MM18xtNkHs+Ut1MipIULVXC3elu2qRs\nbkctV+4qaPdPsnuHS5GvUZME403O30jFnzQCD6d/WROo0Pub0ZeRD4EiRDZd\npewv\r\n=ff5t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZsJziAschPhFcVURRgGKdzP4jfFsawqTZGlDTvzgO4AiEA69uHMhY96rYPs8VOQFiWywEvafhb1xZBUNvBhZvRawo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0_1588285513049_0.4507399207009912"},"_hasShrinkwrap":false},"2.0.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.12","gitHead":"23d295a95d5c8411b11cddc4f953452406e6d63b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.12","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ycNxAMsWJrF4O3oIRN5gW1V7Xv2x5kOuIN2kSdzYIsClREL0Qu1CO3Tws+7LyQewZNLCfNHPw9tMAekJmbtBOw==","shasum":"51932ec7cce2227a9677b1ec5f08c68ea3c49608","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.12.tgz","fileCount":28,"unpackedSize":128997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq1BfCRA9TVsSAnZWagAAFB8QAIm3faItaU2yMzxSVL06\nN3DcJXUd0aaziN1Lbby9Odz19wsxN5QUHK0xttS4Tn2xpN5VVnic8rhuyWeE\n69EpLPi3wXrnY6oQ6zDqzdi4SNCSlENOv2wo0nWUAKjMIlXh2gGgtEwpp7h4\ntVo7us1Jy/8wNpPGXD3pu3bFYKTTZGwHanewdTz+VQlOeVp0PsTcvQO+CnW/\ndz1/xEERp/5p0pTTj8eg2zJ7vVp/sP4OBUKKpDL/tzZyKZY4K2ZZ44iQ7TYa\nYKPvNmCD+4VYWAGXINaL7Ew2IbUPv364ZpIopFb+OrQOboh4HU3FM+Egnfi1\nwjWa89rF4Wdnu5erLuAaZfwdMtEjrk5RuH5s67rJBn0GEQ6eUMlTT0ABYnVY\n04cTAu55taZ3Zhc7/MUaLJFOE0Q7IikachEq1ZKlmut/8PWFamIsB3w08aq7\nz9j7rjvCTfaYQLWaWrNnVkehsM51ioIIDiZ6VvDcAEGkPWCEQ5eirVPU8ok/\n/jr3hTj4AVRIit9bNUWPpO3J9NOAGmYW9zNckggaO7jJAH3meXToJ0zU//pv\nfQVdM/kTCJtWo46XA5f/IdgiDW6tKwdFAJzVGdpHndOD6MWaA2R29p+21Aj8\n5xf0bp55micbFlmZIHEhKZcQ4z5PGIaOSoFMxqz7anaJVVDK2s+HmIzcUJ/a\nE0yh\r\n=/N9l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJ3OOqekQnaNnVjJE0XYnKScqg69eJv6ZZLdPIULlHGAiEAlbely0WuB1+veVKWpUsKAxYgQXrcG4foWUl4XIb7pqY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.12_1588285535076_0.9882618611389753"},"_hasShrinkwrap":false},"2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"23d295a95d5c8411b11cddc4f953452406e6d63b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-44gyYgQqo2dWhMi3v7ZnM/LUnVFCI9zovR/BLq/cnMAQBwIq8PYeJf4ztSA1m6tnM29HwMSxreSQNMYwQf2Acg==","shasum":"0afb7819e00a1de7cf98332ab78e8a24c0562650","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0.tgz","fileCount":28,"unpackedSize":129040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq1CCCRA9TVsSAnZWagAA0p0P/3dAXqPG3zy7wSj2ofca\n2pEAhiWbRVI2arwp3zH/wWt1wjZ1GLJ74MakKZNKz5k/oanKCPpvzf/2+cFI\nPjcxDKQusovOiP0HncojerICBT8Sf5wjnbG60mnXFNVR5eW7zQB2sHr+TgZP\nGk+xGS5c/PhEomH/FDo2D5twOQFmLW+BcUXfNKk+Ac5dyglbTun7bIIQfQbt\nwqvR02XU5gMAKMJnszTpfbgjSojqa7KvZZs20ATQGD+/UiSZWPaT8Dq611EY\nqjJpqYSDWPmvN6LqU7X3DdrcOpQHyq2OnH/k5U8R/ewOXbrqPTRYaLYDRE5x\nrloCN+5cT9pAX6mNH/XJ6x7zl7+/5j+wddXdwYzV4kr2HHSFebL0LC/sQBnu\ngIS5JyuGlsgPDRXs0Kcd7Gs5pxwt8qyVdjZpWw3dl3P/fbj1DDm1NA+fqRzk\nM05gKgAiE8l/MLQy53eJe4M/z20ahjyEHxhnt5A7j8AALfSgISk3hNuVCol0\n4bGs8JyHtoFxKGcxdig4PG8ZfsWpUrm4H0TPgyo68yZtzpIi66NAmUQQHLuI\n3WSsjcoWVwPHKCwQJzZCNqj0Pa4gUyPcyeLjY3bvITnJg9kIO/kTIg/llUd7\nczhPnOBKjdaL/YolxNys4pI42WU02nvHERRNel51kOHVK1lNNbvN0Ur323H6\nzn4g\r\n=ofUv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbjZ2uHbFzwPDc1b4HIrnaugwXCNFt9ZstuPQSD/1nGAiB0DXPEAsOL6mwHkejeurC8uBisaA15PCB+k8z54woojQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0_1588285570180_0.2746992916077753"},"_hasShrinkwrap":false},"2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.19","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.1","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0","gitHead":"8f41d45c936337678f08c3b7a82948d4a6d51cc4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AgK6EqaOQ69KqBNfMwMJpCelT6LF7Jh2IYPIDa9/I7blLMl3PExCX0cvIXlsv+4QEKcfbRz5wBVUOPhhJiRH9Q==","shasum":"8dc063a21feae79c11304c9c6a87f27d5edf9c74","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0.tgz","fileCount":28,"unpackedSize":129040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq1DKCRA9TVsSAnZWagAAOuUP/RiLOLHIf5zQ8/LmxR/S\noLxs3vvoSssO4O7QSSy+q8MF/eU+yWK86FgjZ1P6X/5t2fM2s5A1vi0O4hqH\n28v3QEURt17Mti43HNJSFUSkgVwfb1gvQ1SjmMShzLm6LlpLkmUIal9Dkrug\nYA9nmSK5odReMo8G6CPgxd9tV5ghnwzUVch6Xe4RAQY8JY6h80BxSbuSom3i\nw3421jfarVHgWJAdN+xoMvlqP33EJuhYc3+G0BEmqcaSJ1WmgRbD7hp5fVJ6\nG81t/7hGHkUjbTIcrGQ7A8GlecMHerYfbnxdBjsWG+QRQnfoj134cytnWg7g\nW0JMfbuF2BgVl9yF4s9s2WQBxltwpn5F10QdmZaH2JHWoFyxy7rkrGwT3yNV\noDlqX7EDy0EDJvvDH6sRMt8ZReWicER9AOy4ZMCBrALaLYDZL8WVj2SXc57H\ndorumkaqTuDQsUPE8xZvBRgYxMLQkiW0vfGfKDo5ibhktRDiFLOGH8NCd+z1\nn24Cy3an7vRr8vN8ZjIzBePP9byl5oL7tVx0TfiSdDv4kb8eUDgX2/uZbepi\nAevQkpiaSSh5UZJInibR5SxcANa/Qryfys5oCSlAacvCdmHsF7xapmQC2P3l\noiIJWr23q3jIv/Dn/t8m1QzK6zt7Fe8zJRX4fuBo/2EHhfIorl69qth3zoe3\nNoYy\r\n=0ISF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH25smVqAuNV8ko81XEFwRHVbp9LAkV53d5l8bq+/d+2AiBCzOs6ooNHsjrbQK8wrVbW4epjRQnOUdpyQ0bUXU0qGg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0_1588285641783_0.7790561585099722"},"_hasShrinkwrap":false},"2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0","gitHead":"21db087816385e29bd0f8b3e2ec06d5a5317ef86","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tckExlQQRRQGJU+2OsWw9Ic/+sR4NAAQ13RTaYFC8ALjuNwIRANyYykSxN+VgMkFXlo+qWsqPE1HbW4NMHlf3Q==","shasum":"4ad449fdb6614b899329fdfb6c1bdb338c5623ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0.tgz","fileCount":28,"unpackedSize":129040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6K4CRA9TVsSAnZWagAA8+0P/R6XT9CGIqXiJt6IY6R3\nI2dBtYK9AB+eCeCG7D2Gi2RN7L/X0Gm2hHcRI8SYWFq+Q+KK9/zp4nEoBkNw\nBw6/rcxIHH/qtS84RWu02OWzhQdatj1Bdm7OziaEoKLjm4vHoxau3g9WQjDj\n+Vvyy8ISrvm/+eWrqfsyIyKCFYiGlhRt7WKDuDjF/jIhM8Ct2eWufnw0vShJ\njg7ixXu+OrTXrEoLxcy/RkZOIfOUqISDBmK1tDYTrPOl6TmJ+CmBVG3UQ2uY\nYwyupK8N/r9cctCADuRfOvg/ly+W7X5UvPYs9VIKKAgX/B/jj4wV7AAbsG2c\nD6gnwoMqL5rxfI8UvTpNqRtEexxY7p6NZRZHOIcAZ8YThPod0poj3sQWgNcL\nep0qht5jrMZpOOXSE9bltuh/5uOXTgsqWmYMkPGcglmDUkxlZZcflMdOihWG\nrwn2EQ7HJ6g+sYdkNYMvR6Nw0QEJYwF2KEGI13Az1omh5A8kglGk1+3eASi6\nhJSJPMVt71w5txbEWZ5vMNqs4gqbipdArM4pJjGIR/TKrR4loKzQ1iu3RYxO\n7z3ApmpKa2aJWFSwBomJsBao3HpqGIIC8HXpq40frwUdt53Vk4ImkKQI24Fe\n7rOGGL/b/pZHVcMCbwKml7xYZlBw6LLYzunSIkl0VFp/qios6I9x7ZIN8ai1\nvX1k\r\n=1E7d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnjwsakeLmMQVYsIFsV7nMgqJdINmPLKbzGGKq6fbumAiEAoIci9AZFJJspjHaVgoZjDDSMnRxAUDXq75BsFmJtpbk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0_1588306615624_0.5577302924718992"},"_hasShrinkwrap":false},"2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4fdcf81a1d895589f9e4b3d77b5d810b356abc4e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vNQ3eszohFltgThbuc1yBpHQAMlWhlfwIJSiPAGRwtUgRBVaeStg2A7UZ6qkCnRj87xFPd0TM57fx8ddLKpvUQ==","shasum":"2e1e8efd5428846cfb001c9c92bf1ae22ab61923","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0.tgz","fileCount":28,"unpackedSize":129040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6MaCRA9TVsSAnZWagAA4ioP/RxWXC3uhl8t0CH+j2UB\nWlZfFC/s+xZaPV+MJgi+XYy5jT2MoBXsx17OWATwlHEStIHrr+SMeK1wbQVU\nBqHzCNYs653Ie5YG+Ek0Hapnz8dp/hRU64zNaMfC5uVgsuGyi+Z/r2X96EIB\n+sMwPxJUeQDhNgk4bAB4Qrq7RhDpy3Rj6CCOgh8p/P/SM3riAN7YtG8X2ttL\nQwimF34Vk0EZmDKPORzaVyCMi/unDha4GYk8kr3ZzeVhUslvK6eaxkenzfw8\nWYolEot+4M0ywRIEMM2O9arLfdUYMU7ahxX1aGk8j3E+FX8PnSSEI9RWK1C7\nei3gCoE/Z/MHZGvcqOy8223DUnx5EULkQKJqkos1tksK3oJzxe3ZqBfGF+gU\nDAhfyqIF4+fCem31Cavw3/lGhjftZV4mjKGaJKVy4fIMe1w6iMP9BDGhTA8A\nyBA+Jgmxiwr1Y+1UneLticUu/GM3OgwIE1rsjlWAhWeBIwVU3VZb075SygCi\n04+FpsKUjjxnTXHPnNL1qhlvKpw7m2l2aa2HOLZbGyzb0YBo5zr2MrpznW1+\nXbS4Gyv9qpDOV/GYt5GgUeq2lYCgY92Hg/+WgAJFxZiBFhfDf4XGUADXqvtG\nBvcdZM/VgkYzjSG5K7IsEkd++Ujg74y/5vrRwzMsAWQJ/Bkob67IZJXwqtLV\nUMwZ\r\n=UWOd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNdsE8/VlfLL5zkC+k3pkfMfXn13vYtov3mub72AumeAIgUC+CA3gx0BjnepzkClsSrIGCcacD3MnmyvABb91bkz8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0_1588306713935_0.04422261685435269"},"_hasShrinkwrap":false},"2.0.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.13","gitHead":"547488ee1d418e97884879edee4fd5650cc40501","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.13","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+FKkpwb+CKOvwld/RfsNM+hniKcmKNzPmOLwG1BnMCEBhN8kHR9IKgA9TH67VOZQxkEu5R8zrQzLgpGGckI3kg==","shasum":"0344443ad03be56e630adc9fa530a5fe02f80a15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.13.tgz","fileCount":28,"unpackedSize":129279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6MqCRA9TVsSAnZWagAALiIP/2fU8/ZK5ee9eQgw2phk\nXbaHYqdGBBm+bLYS3H5Mi0fMNptI6a6ziyEblsamoJqXNU59VfF+9bcg3nCr\nG3Y5GXxHbqYRCYng6D4slSyrva1axtPrpUKzLaqBwnsufUV17C2ydcgds3VB\nKlXNEsHoBxpJUyRVcAVpzdC48XH8vtT0Pvx+6Jt26nD2uhU9AA/ErzRjfvSL\nbpysC9Hj9gwbCLjfjKE+pb5KvetQfoahQO4sbDKlTSnCyZJ5tKGnE/vnqr7B\nMWtmO12BiVjflLLpVcPism85+OBt6aBV25Xv7LJV3nYf1C/aMDcHN3d6RUNQ\ngVlEOLLO0grhzPOxZKV4l1i5wPFss0RZBtnhpR5WEuL713kbnsp29jcKZ7Wg\nlQJf9PNXc/F3AZee2jpH2Md9Jt9oLPY4wcHkr736lJD3ALJ59qftEdzqnNqU\npr0jmg2AL/yksRCoYu40CWO0BOftyqckkK5urFgtEh6mSpTbz0vvpp2yrWL5\nsgX3WXDaVB1WJUyE9zb7cMpbndzQ+zVvsKFrAh9QVt9t2qHT6KFWPyCaNsEc\nCf3AR43+PtMSMceae7fwoSnvrWDmIASqz8Zq7vbNKfyMdCW9hOdafrEwOt8s\nIf7DBkbxYZmiEKTWgYlYJVyfmosZy6n4MHkJgL9CXDiEviaLy0kaly6VRWnT\noJqY\r\n=Xpev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAfQUvmFFxRf4/DjptLQbpxQaPT+Kk86fPePpzggSfo/AiAYpWMUh7armt2XzHOxQfNnQtAvmegIY3HhqJE0NfKuzA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.13_1588306729931_0.007557174801458899"},"_hasShrinkwrap":false},"2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"547488ee1d418e97884879edee4fd5650cc40501","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mVqBE9d9pNZ3YRKiZQH4pbuSKpqa0lhIhJ3l5ZOoFnJmPIgEl1fGqa4zNKh5HEa7EDvdJcbKZ2fmCsvb4+sZiw==","shasum":"fbb7d3f3ac96b217b4cada297df5710f695bc8bd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0.tgz","fileCount":28,"unpackedSize":129322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6NLCRA9TVsSAnZWagAAJgkQAI0IeyquMjzkt5HdHoZt\n6lOjtx6GQCo74jAj0mrgp5D9oz2XyaGi0Y/k/XYr91QuFIL213ERC6ptY7cL\nAhyqIGwriFcEaqbS/QWm/jJoYCFMP/acP1/OVqNTqUICivDD8IyQI14B0l9S\nr5qiCHdC9cDTFhtWQhsJ5YgpcBwK1SVMo6tlF43zIwAXqV/A7H/7+12eb4WY\nqy/rJBbsvCP+bo+if82nHHSa9kh6zN3WZFEIrmNfu7frwfc+cRAxNuRvM/Af\n6+GIdoFVrJiWCi5w/ar3y7D96Y91hRHauqdsssKYJiHb8IpptVJ680427pgV\nqlSBW3P+wRpxbc/tOojzbgw6EABlQM9zuQoRopwlWbA09EPe2Y9H17GG58s+\nHojGnzL8iHbQDMrRlPubcK2BDmI4haIkXONasgSuLUBVbYKB/qt+PzX6TSuX\nN3zyMrT5XZSS0JYNbzu0gdEPgyxmC5Dnl0p2QH5EROXOYlB4x+vjROUsRBAC\nQ6sHyYV6RHtNmTOzxQLI/BF/CUC1T6hdGO/J6INE77EEGRGHtJzsHEJmrZLP\njsaznD+vSJGmH/qpFJpZb/BnYM+EhP8rQ6UASJ3x0reAarbhxtHm7jCD5oTW\nJv10Gj7fuxZiUIQndAinE4fgn3IU/ypch/QASbuIPrylb4N/aq9nooGU1406\n4etH\r\n=bE8K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2sS43pN3EqnrRABEFNh1YpxFJ7WznxPpOB/uVTABabQIhAILL7O05CreGvTCy/0r6n5MKN4fPqbxNPewqWyn1XvvS"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0_1588306762412_0.4252421128250501"},"_hasShrinkwrap":false},"2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.19","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0","gitHead":"812eff788affffca89cca9b20e2031be46e5bf96","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Krhro3E3LlfG40UK6jtkBiIwo3vjiF/uElkqklEAxu9aBOFWypvILd+wpqVOL3ZOC5HkxXJ4EQDF1MXxy71pcw==","shasum":"2aea086bf4543d5154c8f6f54e9085c142149995","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0.tgz","fileCount":28,"unpackedSize":129322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6OVCRA9TVsSAnZWagAAmZIP/jGQ/vvqXVamg9Ks2Ag8\nHd8JNQZ60N56FtLPGDd5tvUBxOO38ESDYyqVkgBolaBTvKsz59KTse/siGV0\nKilZDJT0Zh0zLlN2bqBxSvf3EWgShUxSzwOwV9wxp1gfP7TefNzAMABlYs6v\nQlcVVjB/DHWlIpFlp/AxCeNH4v4RTtdgUb5Kg1cHAe4ro675H/c2hsqGbtQO\nbQat3fC87yYWucud+lj41/WECT9wSr77/3YuZfF224L7kl1qnqy9RqCLK8UM\n6J2ZwEI2guksf9e2Xee1Lj7/MJAvo7KoXtL2C1EPN56BrvBEiSRF2g5gYcOw\neDZTlAGoU/xrdNfnflkh5roiD6UFH1XzOCbRWe79JVtYDIfT4jmsoDFXAdn+\naBp4da/0rLQgNgzPbG2OlcSEjteW2uTzOkJmJLPk67HWXbz+t+pEh7HCyStv\nJNRWeKH0dTEdytpvc8NMlY7T30xBLwtYTqYQ1r6tKO6zBg4fF5tX2DlEbS++\nhIFbA/4exuOAGteP+3lKrV9dMl+gXsBg6HN+yBxiH/1sleXu8oUFHxHIkt08\nLIC/LMznzS1egaUwQZTDSHUEsQvtH3YddW54NRRicepj7IwrY1LtOfxzhG2B\n9NL/hX0nkw8RUIco7BiEIYuNVwSniPjsxgEMPG0lmBBLBO8gz1LGKV5cwN35\n5zS2\r\n=JbaS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3s5RREInCnmHu2pW/UeBY4U5ArG7TH/bXFpvpwG5opwIgB0hYxvwHzFAFba3DOKt6YFPVhegTlbQswvpC3vuxsOQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0_1588306837149_0.6154576133296712"},"_hasShrinkwrap":false},"2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.20","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0","gitHead":"922b926a62642263efaacf02c59a0c5930b9b86e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-40JTScoWDuG1Vzfb9j9C0A1uEdwzvfL+fOn2p8hkLfBfAwEh6kNloIVlDF2wYkpqR6TwfND4nSXm1EN2CJyxNQ==","shasum":"a085de2034ce4a2bde07e4e65e2904ec2b2ede64","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0.tgz","fileCount":28,"unpackedSize":129322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq7GzCRA9TVsSAnZWagAAv8UP/0LavyV8pGj85aqREmNK\n9BxU/SzyuOro08byUk16bAqWuW/V5J3nmqsfeQYdNAB/WHJRu1/yDfrbEbvb\n/Azoi5CgExYzkcTr4l128YjYNCOcUzZ9gwHUdqNN6pEiVp/opysOmMwn9sWj\nRbXaOXgPKiKA8Ej08O56USv1GuTAvNaeeTYxEIrv5Gh5LdaZsQBhyVBttHYW\nIFQqb+fwUN6NOPVu2uTY/dRDXJImrS9yxFisD+4ntG63t3zCHS8/PJLJcqcv\nxQbXKQ63kxhHBcJy6SguEpuydYs3BWOzlY4w+TUmTVA/AOK/bgLqohsX+5Ul\nIW/FSJvagHlUjfoF6q3jEUIudDZipBeuEpRSZMP7/+mOFgjAZcB4ifzHQW4P\n/A0kRx1Ooy+qIHzQBU1/NtR5tFaepLyB8yl+iEwPsfKyVqGWt35SIdNOPqny\nlt0sFszvfRzHThhlfkU7MohrNJBmRz892PJJZ7bwVsnSySmJ7g/ix7RxfXyO\nk3ToE8VgfgJg2Li1z/c4TBkCAtoaCecpuyC0g4VwVgx2hVZAeb1wDmWuELMB\no00lwq9D4EIrbQd9uPtcXnjgQdsjDNaRsaaD4SveBwtidfe4K+l2aE+URbn8\nZtXv9rC+2Sc2476FO4pk7zfyZW2aKHn51Pp06m6NrhdvY6k82HjAWnr04xGf\nnmzt\r\n=LkW3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQUHkqCPzP/KAIRdiAeGVSeApZbnhb+WmcOWlb0SosqQIhAOC65ewf4+wlnMbbWNXfgk+jH26MCcTPpapXTmbdQgRu"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0_1588310450946_0.7332694134541047"},"_hasShrinkwrap":false},"2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0","gitHead":"4cefb351abf7dc9effed1cf8c7826e432fde0e6c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4ls1a4FwuAkU61S41tEdPdMn+lgEMyvwG7V1MrOsWALhkFIb7V4P7e4QVEhPy1KOGdHnbma6yo2kHULoqDclag==","shasum":"7dfdb17857b21bd501b747eac63bee545663b734","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0.tgz","fileCount":28,"unpackedSize":132274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq/KJCRA9TVsSAnZWagAAkVsP/iflEt1wopStTjhuvu4K\niQuh1DGQOFe1+ni8L0BcK7qe67hYXkH5nVw0dQK9F+zG5+C+h5rPaaRMg6u1\nOXt8Miq97taYXYYEt01ooTtWdH3b2xek2roIyC7wIO/MH1y8g2qRVw9vjDB1\nsBoqYobpLn0JTWVuqwQgFL7QNMimwrA60f8cVuRpzeJ/FSl2Ep/w2XhbwruG\nLhJSCuHHXbP/D/tGXu6P+XU4HvfVCKM5i1i9E7vV5w/qj9Xqo/+Q0TKAViLY\nn0VQaRBDw7uqlE/T8r57aB3at4P9guiv3T2vK/gfvCZvoC2zEPSK2Y5RzCh0\ncajxa3w0Z7843+HjB4z3XunUhEInYzR6K7MFzBmdXXrEJS9qMIbMOGI2e2qi\nQviWKalJUKz831h8xesZLPvqiTby2EB9GX3q/QY2fLyrbUs2id7kaMyRZn7R\n9bGpZkstaqABsCy/4GAYsFXy6TB6ElKN/3RBRzmPigdt4CWQ9cUwcBn072h5\nPxSUcraqueSFSiIXrTod6HSEnVNg3hPutYwH5O1cuTyfSkt/dQRnFoDROpTr\n4Fwcnmo2p92ke9MLvdJAi4lf/Josw7sBsqPUl9NwlsL5QMPhMkcS+YxdvUjL\nALkOfpg06T7pmctk/A+HtUVCNR/a0KeFKJHBPRQWzfBlX0P1r2ZjEqpQxP0P\n447e\r\n=Z6FG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCURoWiqHiK66+v80K6q7x5ee7Za4aGaRRHNoFO43m3YgIgF+Wpv/V2Z9OVTCEVwABLG5qFLnnhwAkdLppUw9QQQmc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0_1588327048865_0.47564281899805483"},"_hasShrinkwrap":false},"2.0.14-fcff967928e991a325de2078be27d5440db8a995.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-fcff967928e991a325de2078be27d5440db8a995.0","gitHead":"fcff967928e991a325de2078be27d5440db8a995","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-fcff967928e991a325de2078be27d5440db8a995.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+UEfXkrZ7lp/3MmXHEQg5PxjaEO5BQH9Vlla+maK1kOlQKKgl2a3EY86vpLz7w6J7npvfab13mZSq6YVG1tj5A==","shasum":"fc5c55cf1aaad7e3d6b4e3b09b4f528994437428","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-fcff967928e991a325de2078be27d5440db8a995.0.tgz","fileCount":33,"unpackedSize":133930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerBe7CRA9TVsSAnZWagAARLcP/Rsd5sErwoEvdLMPcWXw\nXpLCWXY1kEKvxAP6053ecNZ1XFUuM2oz0xRSw0Ijwm6gUHz6f+Dri9QntOW8\n5eGsDoFMBlAcJqayvEeNx+dm9jC//wGi++ReRVMOrZXIKe2xm3q1TPMiADFE\ntzV66S8TBXbDLSStFXmFQvtdyyd8sh7rRt9PQSMGMrUiMYvNXfnefPOYzXWC\nJo8vNYx/1aMFruk8YkysWITAJMtEUs22WiaT6okuj/oG/nsOaK93CQ0+SO0k\ntxInVzxweM3C1ohrMlGU5QrPOXiXWCplgAouNxEAICrEu/r9CjSTpvGEJul+\nzvctnXUJIPkxYldCDZpg3o7AFnwv0DNqZ7UyvHuWmYHI0SrgXJtxwRFpbHZm\nOxxG1dP2PRSZ45Yf8MHZ3JMgymKnoPCSyTRCrhZ9LpryLDn2otxjsoFvHnmZ\nHl8EWOXYhQOe+5c8Y+fObdRDy8cSwjodLldvIDUUYuPi/xGiMF2IuuPKM2c7\nQzHsSKlXTJZyx2MFYXFf+ryPh8gHRdKFyZXb2lInfl/+zLX140wQxw0WbEFG\nwaen7hsF3cwC/mzM8w7kNw8q+XnfLqyOHI1OT1r9jKhfF6DQE3eGuUd5QWvr\nH7eaBDY/pQfoutGJhSZ36kOl+NvaAqDILhb0UJSCNy3tjd9GL6m7oedaRyFG\nX76Y\r\n=c2Co\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTTfBtAtHD6zVQHGmDmuXpdoDbAFmsC0a1yMhpdRlOyAiEAnQK3VuT2Eox2J5MzlXnpbX4c4PEYHA4aikGe7voGvm4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-fcff967928e991a325de2078be27d5440db8a995.0_1588336571194_0.46955269014939693"},"_hasShrinkwrap":false},"2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0","gitHead":"a57cdf5bfa49ecb4a21a1d353e841269b99fae82","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/1xYlNIvziqBP+GaGcoCNbs+UB6ltyc0B517gI7SqRRTsTwc4YlqXWYeUsOPSeY6GF85qt7ZBFAnxewe12JarA==","shasum":"7e28aa64b1a5f4497bb84f215c04f1e14f54dc9c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0.tgz","fileCount":33,"unpackedSize":134090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCUxCRA9TVsSAnZWagAABTMP/2Rpjf63viV9YlYVdmBX\nVkUR23N8FtJszsGVt7qGAZEPSu09bqG0wbKmPh1u+/YwqDz6khnGpI3dPZ/m\nmoy10rK02Kve4GQcJ/KLBabgnijI04q2A6TVvnHEveGqQO++QhIbW5UTAivp\ndPZCGNJICi5UKPg96XoCrlhuU+72Q0pHn3XBNUNKze+KXotwn/QLoGb3u9Pw\nvqajeKaKjm4QzH3DRrK+28IW/6wperIJ3UFFwHaQQ2wO1rvnmn9Hzzx2yzmy\nfvXGyWRs2JVKDzNBwz8lZMmm7WW+AeiN3Ye1iBxpyXEJTbsyhP2J1QFrsUY9\n+O2ZUTaf2xONbmHHZoyAPR0gIN2L+KJe22nteibvsj4rIrmAzsZiH6jkNo8z\nsA7g7gUTyhob2MPRRVw1Dr3ffbiXGvLn41VzlJF/KWLHQeDuA+uUIYgq9OwN\njr6iHODHmRP062aJczHoGRBASVZhO/H3Vv69uMcKG/A/Apc4FfG/Lp8HD98x\n10ZVsESMFbINZOk+QZqisqyXTkML0ftpQEj1OA65paLVbfa3k6YOcczXe0bB\nrq92W0JmrpImSCmp8Op1N/+arbDuQMJ/rQg3cK+jxiSj3m2wlMO3gEmp53+R\nE/vvKYu0lMbXrBK5HxVVY8EotI//gEdQeNXLPk2+fk8Q3koUybhTq4rO6ePb\nq6pw\r\n=D9kP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6+2MAF3O/HlfAqoKzTxjR/qG8DB+seCoN9W6oIAoVlAIgGl6XM5by5sQA1Wzm5Qfpl6CxrdqqR9B2PV33YeYa+hw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0_1588340016422_0.46201107106786066"},"_hasShrinkwrap":false},"2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0","gitHead":"1ff45add5afe2390be92a324ae4a117c8b1919d0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1kBVkO3gzYOxGQZ+j9ibpMnZZDBqxKShnp0Uz0fUlPy9FerMB/8eFV2k9tBtbIFsBUgGpjLwdRegcGhSRttPHQ==","shasum":"1cba591daf953e22981f203ee6b7441340b36651","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0.tgz","fileCount":33,"unpackedSize":134230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCkGCRA9TVsSAnZWagAAVT4P/0bzwYdjlBkIqLnQXO7z\nNA8CgOgogIWi0wZwSkpEVGabdeomWfThCPyno0VCzO26Fi+Xo9/82xTPoobv\n88Jzs5A9m+dyygw7DuGyP7axdPvY1cNDLZrUVHKAuDjc77i8ggQXEcK5Bq5B\nHgf4d1en0UwL2nr3wlcnHov1o2moCguJ4gf01P7UjNhfPJiAU/hFy7dFAvgh\n58j9HG8uOUT8jjFOaG3cA7Im57vyUVlt2kNDFcOJcPn3RNVXpNr4vNOn2Vb0\nhVHjuWByXmek2/O7tjZ0qiZEctUloqmd/E0D9msoz1JcGnHze/voZmUIh0Ru\n9+ohlSZAqsP5MuHaea32NKjcUaXE0iB4aPFHNUepwQlNfojfYuXLHND/4Wok\nzxE1JLy9XRVGbkixleUvjMCmoXzUOdFJaWf5qYw7h9yJvO2TgvD3hCof4/z9\nKtSuo0g9dTICH24Sw02YfBuX5VBSB5xFvJZnTizkBP/GAwgCvk6WR621d0LK\nBSxIIBYexuihuJtqjq8RKZ1Or/qOdnY3RhRcJ5skXmoVNI1qyxFMcu4u+Ztu\nkWqbJ6tMRctRXHw6MxWQsTxd4cf/19k/Yq4O8HTk7Jkqrgb3Ou9qsEFh/OQW\nISub/EouDCRK1mHBLjyYQmJHlFEf/xyL5iEeweMsMDxTH/1xEUhwZNOCUpBt\nkvab\r\n=4Qg3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9kDjG2bCxdzqD2q9Tvne9aVvgE7lt6MOB9nx5JVBfSgIhAMgW8KxqWHIwmgSI16dXhgmKg7hxodM/juo2FqQ+uK8c"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0_1588340998013_0.0749901900962493"},"_hasShrinkwrap":false},"2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5610bae6ec0238800fe96d9c6a2ea7946eb867cf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-x1wsYlx0+NR2zWhxiJmIMWIbdm1b5wX9GGrzr9967xs7hWzojfIwJc8DlWI1DtuqdxkMfjBzKDi2zuNbrhhwHg==","shasum":"83a3dbbaca53e06d25980b09680f6912719c75c1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0.tgz","fileCount":33,"unpackedSize":134230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCoxCRA9TVsSAnZWagAA+vIP/iZwhg+eKCzge4Ju1cA2\nlh/P0ixMCht0AmHeyXA33uW2x7axS7xna28AQ2rw7v3rijNoguLFxCiy0cKs\n6HV1oAxznnzQdK9n20slowKTC/cTqkgLBjSd7/smIfPujt/JCO47yrqXHRds\nezOGwpQO15vIYgDUYFKyx80HbMgouYmPrFQmNQTSPjIpvHKU54C4si52ubdE\nYeyWLjCLxr//l6UT1yonHNrHS06ARF/A3kpXvEXy3j9HM6CsuSSJHHk4M2bB\nHRCXyO9uG1C8JSZPPJKC9B1D8Jj3BlQi2d9yTEYtA6mrhbq5/WWyjnL+GyMI\nH3eLEkdE3iA2YJ6JfLg8xOa09RxgF2z/ZCsqxtZOf5pf3Fx/oZfODNFyRfTK\nH59s1TKxUsbReeYNC9f6X8u+vESKT5QJQQhMKYb3TBdrinpNA2s5PJPTmjLP\nBSkPzRI38CkXWMVe/1g8DZvOn8KZK4RYO9jdoyaVWnGOVUBs77HyveNUiDFR\nbTjr10ZGCOrt5u0muLp1JO0e3s0eAZpKDc2cgasfe52krL9okDivuDoNnJ2Q\nL028e862qJRfJyIYC+c5c6ba9Y7cfEgoUq7IUNwnRKVBy4Gp4d3EXqMiB0Em\np4sok88H2h8nuSlqj+bGx9pVHxjo5EeazLBtklDquWJtwef/L/k0bNEiLYMy\n4Zf1\r\n=yc7C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/p7LmS8xRVOrvPVv3ccvw3talikY/JdBrsMhOF1ulqAiA19MCK9esH8W9myWF4FhcBEVBztPM1EXbj2RaLS8AdXg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0_1588341296970_0.18290234215689138"},"_hasShrinkwrap":false},"2.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.0","gitHead":"b4d6271432c06e4838c69b464adf17a46a6375a2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PXvWL5KaVw+Hgx19dUYoE3jS6yAY6pVQ6W+gvpsYAE/Uqj2zIq5/AN++Ve4DPXxrd1B1VQYqB4nt426ozTajLQ==","shasum":"b53f619f6640c89ac9dfb5dca5b7ea3909c6b38c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.0.tgz","fileCount":33,"unpackedSize":134461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCpLCRA9TVsSAnZWagAA8kAP/inr+ONVvTvhY0T0DcmT\nXorgXr0F9CN8mb0Xsr9dHtfUFbxhQ5y6XGimvGkJEB/63t4iBfZkoHeoQN4H\nxLIA8qtLJjxLBWBRSwFVcN5TKI3ADU/h/siZCfrhW6DzQVGN3UDCzVwBArCj\n7j9xAwOY9jG7Ax92Alqcg8KRhjupWp4DQTj+FjGUSy0FnWvSq9mWyg9jfvI3\n4GDi7Uo2LFJgDXU2UGJ94unkc5swMH2Hwuzks9HazE14BWlYRPYhOn+8fAUM\no3TWHj1230wUeucEHmL/u0ibVOrI+KuWgyqErfMsea+57b6nMfyJK3jwB8Lr\nB4CdxtNnuJ/SbfOwBeAghBj2LQDgs7Oj9q9FG4hmofw2oCurgfiF+skMMwYo\nhCEoEkBJLD/9LZR7MkvpBGLTrvYlLvudyUR2Nm1iCd0iUFOBk9dl69WxBEm6\nz5NiC6J/wGz0SgvK2PcbFpVpfngVhFwcGl8qpZhkuuusYD04fZCXn4Arte1d\nGuHmJFKzhc6WXngyhuvCsN2NlqE3i+huA6a2cIRkjlcWfHGfHL5KxsuWMgNy\n+0m3P9+xfq3yx/CGVIZz2fjxg/6uEiBReCEt0c1PMcaJ528dv2NS6u6yR2de\n4cIokE7/jVw+cU7KbCBeVdVW1Jl/5yQumfS6czCxSul+YgA4Rx0P5QB2uzKz\nSUxc\r\n=p5sU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE3WUZUIS0pFMb/8xzBn3BpaGyP4NJX3fdycdz9KT36TAiA3/brwe9FCWtaOM//4UXtPU7U09bdBORyJ4SKXlFBQQA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.0_1588341323102_0.0401667494095046"},"_hasShrinkwrap":false},"2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b4d6271432c06e4838c69b464adf17a46a6375a2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-psq95ABVHcHZdYJotCY3RuqRlya8W55/RhvPz7o6C3+Flq9F2RmDRv5/SSo3XbPqJYLedlm18LAWpjsvcBpZjA==","shasum":"1c5444fa942278bf1008aa69df52e9621873fb72","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0.tgz","fileCount":33,"unpackedSize":134504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCprCRA9TVsSAnZWagAA5WAP/0ht3FKofxGV169us4I/\nMbuNw3rKW7H8o1fRGZh+fOTM8IdcelcDuxoLTMpdLsUtYhDcsTe+LjYc8YmG\nB862ivCuVKwZ05EjQI5x1SQpFe87BGq7c+zUsnsBYqltyNEOYPumeVtXrcoe\nVdHGGsSNnRo/bYRYg5F0Fq2Vzi20tqj0zJtmuSyfPxzKiyVFVYisGWvgtPGt\npIXsbwJrwnq1uvzrHLFizU8RFwEFP/QsVDzc0afkyIa7jxmzP9EPc/4GpM47\nYq0ozg0QXHKxLenp268SVccxz7ov5z3qGcrKfRNLGpmy08UkSNBG/ZSJPqlF\nHSZkBTNCUJe1wG65NmF1zBwGcrss12oKbr94ENgahYmtTKbm+HJNUzz+n2Qr\nb2Px3HVNF0tMwRniQ5Cn3meGg6p2gdNDsYmDnwYL7AhodwHLqdEbnY35Ox9V\nQeoI3+52S/f6DREvr8ssjfvswkQo6dGFpyDvKew4/YWiXYYDjg2T39V667K9\nWWa36O3ka0Np9oc5ATUNdomzi7zPLrsKRMqZ4aP2b+psozrmdVrl0kNMZHrZ\n6uSztxY8MLSxqH+hWhP6gvN0T5nqsjSY0w8cQDSdFAHXxfjyhr+zt73xwBNM\nlKR6EUWfKWr1GQtEfqfyOBHKwGsiCaOvLOkH+yr4f8pinYI+fsVseX95vCOe\nixkZ\r\n=0+M3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHjIhxnx14V6MTsyPr+r73fzsVNJOHA7PRayYaRzyszAiEA4a2j+22hNGp8qWn2N0tNEZP6CUXZ2Yr+9tI+EbdNkj4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0_1588341354666_0.2740247906382278"},"_hasShrinkwrap":false},"2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.20","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.3","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0","gitHead":"b1f7254237039bf696b1cf0136f87376f7420488","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UDKbR6a4/Ad6SXm9vUXI7M+8pnNy8PFyxsz4CeHoI6472kd5/W207FL1D9xbta+6wzTePdCgMrsDYchBiA2uXA==","shasum":"d754596fe9d35461d76af1b275bce4ddf2f5c0ac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0.tgz","fileCount":33,"unpackedSize":134504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerCsKCRA9TVsSAnZWagAA1bgP/A3vv1OcoDPidrcsydF9\nS8MIxOJNkZog9/HUZS/L3WZNK94Tckg3eI8+bIT2fyTl1rEA+jiB2SV601HJ\nZExq+FKuKcpPlRupZDBed/Qiw5e9oWvlfTmQUOJYjeVa3WHJoXrY/OuyL/H5\nEQCFZVBrH9tkLuYu9CYd8ogSR0wUD8h7iTTEkqoSag0JMhAbpuh63MKE5/RA\nBuhPwIeTjJ/6Bf7wPAhlTsZhsA+JEQXZHlqiav3BXJoecd6wDCsltczK9D6I\nY69g2UmbZVl7k1OG2ZhKCWp2lIS6Ha0k6iWAb66xeD/Xtc7HbQofq1aUwnb1\nGU/ltzqUL74xw1GtcE568I4DJDXAe91OadF32kkOWP/xzfI4FuLidZM72ULF\nKOKVIKV9x8PYC/CF89j5CSAhG1bvF5tyohnDVh/EKA+kDTcckVfHvnd2IO1h\n3qGDUvEEpNnZqlQEbvqzXVB4I4M3e/ZxIYF8iPpSXizCD/cWlIxZ8berT8mh\nUPnEj9RwBPryPPhxlzBAzFej9SELQf+PHJCu4gSIE7zyU3+aVRLW4piDZ/Ov\nQovmEGCQJnrXSDP6ciOJcVopkNvsPDGMY/bMdMwzUmfFmstKQfnpkXWiPgtG\n8TFCXkOGeOoy0GkqLoLNxfTeeuQ02DKdEBqGPvE0ijnEk61M5vUVBjjA1sM+\nva2X\r\n=y3us\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1rFXoTlbh3xHWTRCkz6qhRy2wXVe1KFntHzDi+W+PHAiEA67U3lOPe2I/lvNoTPQ1znsygfOBCBBNRDRwFqOfmJ7w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0_1588341514033_0.21134086284804798"},"_hasShrinkwrap":false},"2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0","gitHead":"bcd2f948298d29e161a06864e536d2e94d024e22","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mScfu0TJJ934KALqkP3gaSKPRHewMhlAfZS1ecR5vbi1jNJKkSqjjy7NXhryTp47AfhHkFEI12/7qhanxi4lxw==","shasum":"4f190731415c19f860398bfcec8bdfb1dbddd346","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0.tgz","fileCount":33,"unpackedSize":134504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerS84CRA9TVsSAnZWagAAZqoP/jfLIOHkyyceEBtOLAJd\nD0BQzKISPYAnQD+iNSizKBF0xwzgsWu2FhCrFWmCMWU2/Y+66JLaD3ja9LQR\nLCbfREsAN+UvALGIDGDU7YqqVjTceZHFWLQDOUvQR5hNLe8VE2eAsazCDJC8\nRfzLwnRTeILHu4qqNRe92x6nc5pkrzxKQsJHro9G2KDZe1a91v9REELG/soy\n5WfqYvk5KfsVHxFD3xMRsYDSnV7eKqK5i300aAS2ii5b8Pi9CxsWLXI7WV1h\nPyH785W5YhXdQe0V6XdQ52mCk6rzu/LoCxaBm+2lYnNHIRXyF1GMXESu95f1\nXR9qxH66amHm8PY96QpBGhTKNHMKSMlgeTwkwMZwI8uBimzdU0+nLEvVkCo2\nrnfn17JFcAkZTNxV6hMTtoaR7y1E/AlGb0PF9E3BaNRaUWma/mthE+445URu\nL9nz1paqdYBXcDwP0CCQnUFG846GF1XOP9RMwwIv1k3DPRbFCp97IxHfQe5q\n1FYE94eZN0KMuvDx8zyavSQ5B0uFviJCu1MOIzxigmyyU4lCMqKc40ACLJq+\nPIMFEWmpANPYchQ5CUQ6vzloVY4ZFGf6DQVNFPSOn70GE2nlI6q9mE40ZB3G\nXXZJwyuur66I8GdzH/MZG7AIPC71ww/he9CGzSAPuYHdq/X/7edZnxB+DN6p\n5hao\r\n=l9Xr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZY4f9bqr364RByQhwcgNePtfDe+hQp1dMGJ27dSs98AiEApYJDE4x3dpB534WPV1TUR9Yo/fPv1HkbamfN1QrMmOM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0_1588408119415_0.540668294255257"},"_hasShrinkwrap":false},"2.1.1-b3a836abd0cd35d47461095121017f9934007992.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.1-b3a836abd0cd35d47461095121017f9934007992.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b3a836abd0cd35d47461095121017f9934007992","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.1-b3a836abd0cd35d47461095121017f9934007992.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6ZOA6/MRmZIQMeCjX0KGWlDeJ+d0+CLbwCV1xv+AEbjZysPUYkCoHXTGIG+HjXP6uUYnuYAugy30Vo8wihOmzQ==","shasum":"0c70cee828fc840c9a137a4b9222a51b4d466b12","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.1-b3a836abd0cd35d47461095121017f9934007992.0.tgz","fileCount":33,"unpackedSize":134504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerS9+CRA9TVsSAnZWagAAMlkQAJHYz82yY4bOnjk29W7d\ndpNo/rJk7KRd+YYv0uwI2rA5hrNJUQ7OZXkDjkoSwhaLkwBKDvDy4s6PUirZ\nIwTeFd/oVI2HXKLBe387TnLQGJy8qfxnhv2yVmwtVp3Kfe9Fp7KbBS/xyb+X\npKv6eerAY/iXYLvVvtrYJkhHWEqmJEEoL5twQaJW+rN9CscXHKQHjHVdGN/4\nGwZtYC8S0we1nbfcgfHwFMxE8DyOW0gm/U877xWcDGjVZiX1jVdg5Its3RZ2\nA8h7pkN3kR4LYT3SoKffcIgm/S7pBFbQSXweBQvTsnBCpAEKEJvJ0hfDCa4D\ngPzysZbIAG7swUp8pPdbVq1sI8PpKVK7UfUG3ZEUERcZHfGGlUwhei2kyKfF\nkvGcGk7IcgZXjLjORrkgiUAJMU3b+I85Hr3Z1mANPMN1oq+WapX3BeeBbgbY\nP+pHCq+7y8ingkocHHasRc6+k11XCtX9nhePOWgb7Zki4wpmANUIx90QBxah\nSZo2gkIn48CjBJ15/IhBqG7LxJwXTld96SZpMMa8BBVQAHBbdGU7+I7qj3ys\nBdS/UYhoW2Custi2UTFdR1tBYIZ9WKsW926O3njwwZ3oQ/dwwG5SfFhnjHgu\np+Gha/AaWPhsPNzB7uiDVtp8o+p3xx4CZCRvxesZyeM4U9UdTG7f+tn9H3RD\nc8xS\r\n=19ld\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDakM82V1qs+Mjs18Y2WNZ/7Kt4lnAvhg5Y71B/MdV2kwIgVnd8EhqmOQGQWKMDGe88r48Rw+0iE8zTYgPR6Gb4igI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.1-b3a836abd0cd35d47461095121017f9934007992.0_1588408189451_0.2382521063769838"},"_hasShrinkwrap":false},"2.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.1","gitHead":"a0133e20e7ef0d07372d7983992fd1e1d89025b0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Vkn7Cl7bI/q1wtZq9QCYguEw4yroMBlPyabs6JbE+ATy6DtlCWViAkspcM+7CpDd7Rqrh3Dk+Wx+SUdgUmJURw==","shasum":"105cbc1a6b8c2acb2d62762ea86e45d3a96f5b6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.1.tgz","fileCount":33,"unpackedSize":134733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerS+CCRA9TVsSAnZWagAAXL4P/24NJuh5+aWB/6sSu2KE\nEClgoJm8hvn+4/g0gcduv6HZPKgF+DLHfmRUeg2df4dM49NY7ercbfSefEgi\nTHrlCK0Or2kXT0renicz3zoUJmNcJo4zIjkbxOmDEC3BKyqwL8dmvmzmhuXF\nezgJS0v7SZsQ43n8RiG3t4ZlwsD3YU1f1AHbgSNHLPMv4QXZ4YNR9kjjuISj\nkLRh9Yy76cZbtCUnm9AtFqZai67MRqvvSLMoXPobj5wSzv7kM7VuGmWxHE1I\nZaPEuAyVvuq0HKFngzVbOPEg9Jag6Hx7qqk4I8WlRB0qI9uGLvgFYtMNVrph\nwgMllkbrgwEW7kq7TLZFjXPmAbaDWt4uP39RG+Zisu4pCc+B7APDXKpOiTZW\nyhuE7ZUSc265wbBKPXPgptY4m/PEbRWXtVpTCPmKdx15a+M26TOJhI+HFRBx\n69Ptcedu9O+JsXh1/L9P0X251FfDfaXRcQgdUSPEq3lYS1OMPhWR2Q/mm+NC\nRPDn1mJQcd8iDY7o3UlTrxrAxs7rFhM8HrcfnTn4c0bMKRF+xYSfe+3qxApQ\nR34yuZemrcnsi+ZF60pvvd+114l0B5UdP5C0VA/G1b/7mlllNlQMd89ywihS\ne3pFOIgpMA5bQWesYkP+a1xjs9qwYEsoOzWJ5U3CVtehYol001I12bJYLPS7\nKpg0\r\n=UKdD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdVItH2wSMmyHfgasqO+N+6TQSF5/6M28cYu+POzmGWAIhANxgI7l8SSbya4r/ZQGzH/5gvNgqpwc3X3T1e6rbO8B3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.1_1588408193933_0.8663023425805443"},"_hasShrinkwrap":false},"2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a0133e20e7ef0d07372d7983992fd1e1d89025b0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OB7tGNchK8TA03fFY69cvAFBlmp3UfemCZHwKZ6lPto3kFiQGnn2bjEhWOjZP5AOs5EdPpwfnzOKtfNtS26/Ag==","shasum":"8e2131e3ede420f65dae15cf47d7e03eccde220f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0.tgz","fileCount":33,"unpackedSize":134776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerS+jCRA9TVsSAnZWagAABNUQAITgAzBqK5/T59GiawW+\nG44L1DsoiCY6tLzGC2DX8KjoIet4OekA1IkQAL7Hgsqa+3N8YyTbDbowCu9u\nlwMJ972ga1XEehJQigMc5+G1fV/TMGI/IqD/JRZ23Yx6HHPUjpaZ0jBt/Tc7\nO6BtGQ2SCuo6Sv/jSzNbN4JDXU1U75akUt1iCpNYM9BV0/7DLxfK/4vEAefw\nyZkVRI+Mu7qoRA+ptKhQYR5bpgmjzdHnVoTj9umILFwCirMuYotgFpSaKx2K\nHSlExoN6r91MQRtvxJO3YAj/S7py2a2HJK4j9he/uZriRV4IkRkzDXlU1dgr\nce6mRlIWBZxgIak7jD8w18EXFbb86FYQ5l3Qw4MnzGMQxo+VCUwygq9G/Zfs\nZ6lODfIdNba7mQEmjIPByvN/QW5HQSGFCQMWnweL/ha3H0dJz5C+FRRClmUq\nDeMa2LDY655xCPSr6e8tB6p51JJnUe4zWorifFtVtRn3kWpOiDz4ndQ/znCV\ngiRYqqkbQxzMHOkU6aqj2IaP/ZZpByMuwfZlKR+l5+x7sIf6gmJQnXlOrod+\nAAAJfgyKGgeiEl+l5svLMKzc9teIuoTEszOY1Un4Fu+sYvyEG/iwVIpmbGTd\n984FFs+IYBC7aXOeYIuHtaMaCMFhCyDwTSpb1ylL+T/OfInXg/WU5IEankb6\nkbot\r\n=FHgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHPAB/AvboDp7Xh4b/cFUjWcBQKLVfGSNKwua3lxUBAQIgZGVdY+ZGfXKaTPZO0v3UksIwNQQk6qqunV0bQ43hvLU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0_1588408226835_0.5851605749556759"},"_hasShrinkwrap":false},"2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.20","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0","gitHead":"e9f6d4d4a926248fe831c36e88d4d01f1522fe4e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-imt7GjHcDJWs0OoI4MH7nEz1MCpBQNe4rOuKepfZUPYBUeM3hqfLxMjWdn1mgZAf9vtx82M3fMByTZDh4jbmCw==","shasum":"ef9b0dc4c0610f5f1156b31af924e6590c62a4b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0.tgz","fileCount":33,"unpackedSize":134776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerS/5CRA9TVsSAnZWagAA6mEQAI39u9fRjIIbQa4AkFdp\nFReIjRhW8K4DUYDSTeBaNg4/BJFZwJ7oCCU4DJcUXz894/LGdOLfjqR6wNVl\n4FZ8rYuotmxRborxG6QJuNq13XEvncBcvyEYrWrIRxKm+CMhZaKREIH0m8nt\nQjJyGZBtdKvZ7UC/BcL6XZZKS30dUi/BIlY9/CUFP5q3e4xufcnB5r9maw8z\nRAxNjnTSj7wGR8I5aF+6p/LyvyhTM76dE7f24IVNZ+S5JWE6GTANkwBokbR1\no6xV4riP0u7HmOEE6fJWBHw3CPZHGXcFJVqTyNEieIsea+1Xxb7wfbCZ92DW\nhfx8zITyLzKoThdCMzclV0J+LVaoa4CPP4lTgX7i/CD32BNJ/ept1YRX7ITV\nxkMYHOPWX2/6lNpEvgZEugIt+aPtt7xY64GevZOpfA5CKOIC7NIbBBfwSpH+\ntGEBD7MmM608wBzcqYNcy4QVDy7dBYhjoeaPfH8B90ligciPzuer5k7FkkZu\nwZpuh1cbBZ96eEdATDg/f5K+djUfR1JpjBXo/+EIU1AIN9gvZx+8j3NdM8Oj\nuRhJRsbn3CnKFFwaPfQsGH6xPaP7qjehjhBVv67Z99G0MI6JIRjYyQ+EyHoV\nYxY0qyWVS6g0zvyVVIgVG8tC3sbVGIYxZay3ta8d/h+sWAKpLZ7WqHsiBHrB\nrOLa\r\n=67T6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB0uQN+rlPsm1sTle6Oy3ii+Vc2ZNdCu8IpfkMPYPiMwIhAOkIrNhdug4/Y18k55zUAP9WaLeKrIGEWzsg43aAr3J8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0_1588408312979_0.9548643893928184"},"_hasShrinkwrap":false},"2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0","gitHead":"7a094f47bc359fc7e95cb1f6fc7415356d48673a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sDtlNBg1LqoCWrIvGVPDWSifaU3CANJ0fe8dcEQlkH/l4MxXzxmyy+fNMRKmMjaaoHfk5OjkCw5BUig/5dFGMg==","shasum":"d21f2c3e1ce32ab72f0e5af4fa220a29813b16c2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0.tgz","fileCount":33,"unpackedSize":134777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerlNECRA9TVsSAnZWagAAdY4P/3+I1oBxlGt+8TuGBqIA\n+pspmG1twMUzc+DlaCDTkxAdombnJFCfXhnJ5ihfUbwOngj2w9XYporCUYJ8\nJRaWauJf5mT4jyHfQ94vfArULItAi/RL/YkDSuR8M9nOytbKDBOYPnnPUMMc\nnUWWLNx4LWof4vVxoe/YIlkAR4yoPyVG05UoxTguwS9xuW5P/hZnEnqr/BUY\nBDeSpOaZS2fw4SSrSZLWSatmC5opiMv/GwyCFcQhTHHw/j5XYRgYQkDTTOFs\n8y97ipjeTjsuRs62pBp2kIyNX1saskLmjJDt/cEwQqQN+IzaSvUtTY/VSmgV\nx97VWuvjIps7nqd5t/RWETmZL0veFUzDPDmb/H6P42UJv5YAu5bGQrDUT3p8\n/lH9Opc9Vj2ffsAT9zySPnpNRNz46YJ+OL1lo8cqA3g71wuqb/wCXSHVBuqD\nQSDtUiZuY5X6DTkg4ISFiqEYjbTlPhfNZ7SQadZyK0EwUTaW4aR94h7IxHsL\n6/h9FSlKn6TVdR8M1cHbzQKuH5A6vRJjyQ+imaHOYD3HmNz9IS2G9jAKDWII\nRmm9Cs4aFzx5H/VDuhwfOD5VSvvsyqEWEmr5sWEFaI9uVj86EkAzv9/mQFNU\n35/qvp9y8c1Z/8mxFxKNP0+ueNpeIAvBczw/MHgzW772SO9vdULdLzak3lYa\nGi+P\r\n=R3XI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEAawDhqMkLeEiZdSLjFADH6uic1eVJ3cK1x/jvnbd+4AiAdKZkmxTyT3y6qsMsXaJvoUwvND4XmjKZpx2V2Z67PpA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0_1588482884161_0.6792559888016199"},"_hasShrinkwrap":false},"2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"81b1eca5cbd095388ce687a632b00e279a0abcad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aGh33SkcnSnxzM/4zR3Gk2RJuvvXLqVf2US8B7XdtC8BQSDGqzQ7ba95x1/R3SA8bAgcDz2TiMTHX3K0gava3w==","shasum":"cb6f3e411022a24495896cfbb2b53c5ffdd8f10f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0.tgz","fileCount":33,"unpackedSize":134777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerlN4CRA9TVsSAnZWagAASsgP/1yNpzePxjQ0iHlyb5ik\ngfZSnhMbtzkRQXD+S7woJwK471QQrhEp85j4L4a6foMJQOEr+PFel+Bp7Ar+\nKFrOkTYEd7xTQ3yQ1WV6KX4R5a2mYlKU2E5PRP23+hkkZhD40wHNjois9Kxd\nhB1WnVznpOZyYg0YqS7QLHLSLQAyhm6ukBmDtTa1RXf5Dwv28ZYwM1f0IEoa\nNteIeT1pj+YvgD+oco4gp3CZXqWRJBY1JQBNM5T0tJuJ0VrAS+8e2hlRE5AZ\nmq0KLDXasj9skIozoR3SWE5WqTBYAUzvZuR0MCooR1G9g/ciGW/+GB8ES7PS\njbm171IYdjh0Srm93rU6KP4+YMv/DpZQxG5LWNr0xgDHRj0LTuF1fwckqekn\nKFkEGS9xN/K0+ziP6wEPzl3gnrmzwvxKFm3mpH4gEyb4p9C6X5NbKv9ViCYH\nXkRfwEsD5xWDJ08/2w4Qo16XSN8AFlnKl7WlUhTvCSCk81tzBji82ZpePeEf\nwDAOWkC45P5jun78H+gs3w+nVZGjnzeDQnEY2aPTxp8S2ryi3iy3O7mzZn4B\nU/OGtRjYMokI5eoMQufViJetXdoOQtqVYDTFQfRN6U0md/j5sEumDsG+9RaH\nB8PYHYuXTWN5tkGmZ7dCCzztV2/bIb8HDzx+/RcKxC9pLisSfa7BLZ7iYgec\nWk4Y\r\n=SfMH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiFSNb0qtIhuamUyg4ZPx+FJxaXAc9qBKal9lz3lLzpgIgdpPtNStPpmXlHFbp4GTuOrwDXxZukxTFqetqxh1JzMU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0_1588482936292_0.6445785904828087"},"_hasShrinkwrap":false},"2.1.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.2","gitHead":"8ab3b166b6a2cb829041410ae5bcd9219eb62080","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8c+6qnpId5WHb4I2DrYfmpV3tmyvsUx8WKIB78ACzZVKAuLjExTHjHO3keBAS4bNffMta/h3VWo43Q8I4KPwiQ==","shasum":"3c3f1faa39759004d33066321c558fb8aca0201c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.2.tgz","fileCount":33,"unpackedSize":135008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerlOoCRA9TVsSAnZWagAAVusP/1N0LkrRDrSN7S5bBdd8\nJ4OLZzWaLq2+wULcQzHi9KKATVC0qNnnY1vltH0zYtK0y7wLgg0HGQFW4T6p\nPM859z63eRszw/ulVNgWm+3GyrsS0kUXtzvPgl1Jcdjuc6rcbw0LboBnz9Xq\n3fMa/VpjoQJ5wCChf4k9+KVJibms+DZC/Py7wxHB6zLVoC/o6EZYzRlVefvs\nFnSB9BFP81h4tNm5jZv0DvfLim2TcLJe72vfdYjphJiDMCt1AXzpLpZb6sVS\n2cudqXfZEEtGJzY84kH6FmpGpxeF8JlsMamz2oRdjZqnBHLpsarWeDg/Bc1N\n00wF5uFeHs/YA3N0ywduAVpbo1heQMbs+6c87jy/XMZNLId5WHXBzSAGuP4h\ndLb8FvvBXQmYD17YtcjcC8Zj+e+BnR8Ad3d3vM0a408bDaAIWkaHydtHHCn3\nrgFw4mRZ6K+DqU48kJHXVW03qsegv9DjXWkIdgTxSyuQir/+Y/rK7pbb1zUK\na8BMyOnCb1Ju4X5gOMwdL+0OMDacQ++P2RClM8YsLJp5EYnrVQwdGfWhCFTM\nX61XiW7QF8VPDyXR2USuh5vX4pGrKVTEFOOrzjpnKybPRf7jCQCMgYv8ILaj\nvnLo0FsfX9RnjHCYiAYFMFi8VqHZYnvnB5UQSXBLWzv4pHvsmduAx4R6O6Fw\nWgrt\r\n=3qQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPmPwa6/RS6BKBVcDvsx99LpEM7qxz+jxRNCalXD0uEQIgOpLK+VM1cUD8DMfBqxFAZSfATvR1rTX6HkYq4NrmA1g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.2_1588482984447_0.08762642663388243"},"_hasShrinkwrap":false},"2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8ab3b166b6a2cb829041410ae5bcd9219eb62080","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-fL9IgDwaZSglGu9RY5ZL0rZbn900qp8PI/l7A2ZXveXQXTUi1a72/oI5nZFjDUikXNG1/445wQFkUmN94sJF/Q==","shasum":"bc73f187c162807178375bcef18c2798837727c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0.tgz","fileCount":33,"unpackedSize":135051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerlPMCRA9TVsSAnZWagAAKZQP+wR8BHAS6XG6ldzq+zqw\nmEqenj7OeTOueiWevEosGVq/+IKkUDXV/0S8o8xw1k2Zdh7DN6zfHYR9x/o9\n71rR+JIhsPG9ry4lCODT9K9Aa2XjHnpMCH0v/pDCF6UbWn0u+pkum5cDru91\npfK/26pgtTYI12e7hYafZWGohGnOGwdiK27o9opHpCUk3KykGBSMzIRnJAhg\nMRMDSS+EY1kZ/TrGcOzHEDftwBoTxqC3kO+OFuP9NTG1b6RnwkXZFBNnNEeF\njby+Ki7jH4TP8wmQOEjhLejGH2gZ8gh0JengSJ2XyULJ1CyPuV94plToZ//s\naxcEUW8UlPJTc7TelbanNpbEkrwXrmQg+VLYCa2bYzJlBwgXNsoyfE/lUKrY\nP7IQXyWzglXJqMH1833RZbn0z/V9Q+mmVXhxw5pkFLTWR97J5Ha6CN6mBoaP\na+T0l+I/91pS5SsEZfotKNBV3GLKHKJyp9p6hspI1F7WK5ENnxC02gkiZWNk\ncaH+H5QcnmiFf8VPJlegF1aLXdB2d5pQinvV+ml4shPltJ58ZQ4L9oxfbjeL\nJSxgcV//SCEVT4eXQnUKS+cGmRbFKfhQoH/zPsdd7z9Q9dzcgt/vvkTvWGIp\nbaLsyLIVXH3MlE85PPDAjEngCqJizLwIazI/yDuo7liUOLKL8VcTxHUr5dmO\nxmiz\r\n=Leq4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRqNDoBMu+ePQbynv3c0wFbjY6Oxg/gTfdVACxeLHK1gIgAMV2/km+ElFf1q1F6hJUbBbI3mXudIEOFPzan3idsdM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0_1588483020342_0.08836401991675502"},"_hasShrinkwrap":false},"2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.20","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.0","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0","gitHead":"d0a64668a4b7eb954c45afda5f270fad732ad962","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SDm2vG87+ZdtCouX8T7z9OxXPIdmO8rHp8sJOUImpJ+WRjkO+3+Mgs5LDOdgf1HBrImypgbg2Z/PYn1Af0Z6ug==","shasum":"8ea1f6bdc24f2a4afbb8888071cbe6690e2fc334","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0.tgz","fileCount":33,"unpackedSize":135051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerlQICRA9TVsSAnZWagAAGeUP/1Szjj/EFXBeJeY0mXDU\nZQfd8CKxdtnEqv1kuIk/SXHGBW/R5f8PT3BSIwRvbtOJ5t2/Qp8XoBqvi+s3\nw+L158LYrrJAdX+hGE49OLopudvDeh2rJqAxwRNBK8FukxGz/gDXd1BF3PHB\nOB7BptuNXDMVVQZnltVajGgfj9hj0mmlVnfRysY8ACAXNsRmTtXvR/etSpiK\nMWa4M0tXGjqGaEm0hsBn/kX+0iPstigjjZnU4McR/5FVSpMuWepURuuQIGrt\n5N6Pp4OxZoltf1L7ldlbb60V6bWJXB4At4prjVfzTwmbq8bbkgL7u25YuYu0\n15zduCwEtGuiC7IB7Vmn1fphUCLeCaAIIwwS5eyni8f+7K+OVUNIE2JazgjP\nDdrT86vmPguE1TEH7ZTqEMLjVOOkjLUOqeFueLb46FzLseXIdYcYMgiQgYK4\ngwx3vo0bR7NlklGib2llorY0nb3d9lr80Z/GB6BZG66Rd3WhZxsKU9Ow974N\n7FWjeC8f4+khKp19qyjf4ertmgMn0rXj6hNiVPijsCbNl/f34XGfPnjELZUS\n4Dilndm4TLVAigorFh/Oz4xLYT4F3I7ZKnukpjnvqfvdg2BftNQ2FHSCN+dc\nnHLiUmMAgJGC2WsjA8wvXOd9J3JvUf9mOOMbhstVOrdMujTjbhcC7E5fOfiA\nEqgL\r\n=0N9y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx7+mwUSDScwQ/Cw77zThXRyZktowykoQ/5k+A+F20iAIhAOLk2bD+sPvldNMtjqydc2jtIEGdKDRFvgEEvyec1omr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0_1588483079703_0.6486077363363352"},"_hasShrinkwrap":false},"2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0","gitHead":"06a4574bb53b7e322bafd42fdd5e43179ee94948","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6qApN2r4amHf2kFajJG4yZBILmu7AJsI+/+g2hWZx4Sqkhg94YwW3T4pBoBPVdp493LorhyuF3Hspw03fIAQgA==","shasum":"472350a05ff48b38c55c7d0d70f2656ce5b4d2ea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0.tgz","fileCount":33,"unpackedSize":135051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJermzCCRA9TVsSAnZWagAAORMP/33a0YT70A72V297HaTq\nDYzFfvzyiBARbnhZybmtvxFGrSbE9tmfgQ8Di1b106p1trbZgi0x2ao3rHuo\nezoC+nj/iT4kB6Rgou5NSxPL11evLJoqDf3zhrZx0rFPHQeRIO0qmwNf1rj0\nQGqBB2/1ER4MPxXPUmgSQDvXIVU4D++IdibYlqBoI6GHIV9bjenyBiezMLcP\nBO+xeb8KMyCg/X+XIyuzu7ej7C4u0gt9v7PZ9cbUiU2zKl8YfhuY89jUvZFS\nnqBQywO6P++YSoPHwIVmM80nYQ1yMQqXptoT48vvMB/DXWoidjWOKeOBLO12\nZ2LHQqHlb3pq14rvoyMub2hdaK0y9nXwe6ObyHeIDe+hiwJCrGXq5lEe+xRt\nEwPR2AvpEVPODutaxN/WFwijmBIh5Xt3Sg+6WVfxFOrQfR5DNMBMCx8dya9e\nzfWK94Zi9GagzHyiQ/EIuw1RAYNqVwGp8lX0hmXdhVCmIZlf19ps4wTgzyi1\nMf19eh7c8UwVz8+pOi2RnUldsltqvIbosibcuglOqDBZes/MZAiQmJQC7BY7\nSR/Zn/2LAu6oy1HunVVzDVCLeHbBCC4mPEMwwawAFa/yaD7GoLYaiT9MW9/2\nSdcE3VRtp6zTX9ExwTraSL4TuEN3GjYiHvRuGTJGs4Vc1LXF4oMM5uFhryQd\nPF+B\r\n=n8f0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaU8tL02IbaUj+L5+8RnkNCKMBAt0SGXKg376WJsqa9QIgQO4pyTd81JmjcTgogPPWu9jSCr+LvvkQH4WOupHvmOw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0_1588489410151_0.6608983898412786"},"_hasShrinkwrap":false},"2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aedad060e89780ae952cd12546d338d3555981ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8ngDeI39vqTRmRVO6Gfpn5/KbCm/6Jyqz5/i+4UNyho9I6qI0cBMCseKnFPNPl7cmsRVYeGmthOID1Ap5hqzrg==","shasum":"c10e8aeb20060974fdc3a448e87f0c42df2e3636","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0.tgz","fileCount":33,"unpackedSize":135051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerm0VCRA9TVsSAnZWagAA4KsP/3txZeesu9rye1IM/mC7\n17dep6f1gG8qS4lV0lWKHU3vLGjAXSuw1IBRKb43e61i4wRkORmCWklnj/7Z\nKJ8HQMGSbuhU/C24STTxMRzrKy+8vm385AXneIaJMjvuqpRcBhgHQPvN+R8i\nDxruZ9oGX8/BgUrU2fB+BWXCOyzLGp7LFPLA5Cxsrg3mjSvY9+eyeCDJnXtv\nil5daDrOYf+N0b+58XnxdGqZotBJg7CHCBpeMb43hEgw0IAo74L22G65BwD8\nQtmgD/Y2qeSHzKx/T/WFl/h3gKAhoGnqHTm6qFoZZTeSYLZYo06rD86Nd7O3\n7TIOzErm3eX5qMRkDkG2+E3mu0Dy0c2KMxOnvsZs4T6BQC8E008ot41Od2gu\nQsblsl/C3AU5PocmoeK1FxvyJ5WVv1J9rZDiVz/J0zhty4b5/bhv3/QeghTm\nLUXYtBE9I4IDMahvCb5pkPFDiU1nEDuARaOnPDJ76kaIqAsuZBbkS3ZLCXG4\n6hUz5J1orhdW8PLci2kgaB9KbQdRrENoyIJTJIz1M5M2sWvdm/ACAOy4EBiC\nmDBiShqUw4kfPdpcmO7jNbIGQ+w7kPDXdb355ZsKe2W+Y6w4nHo/vu5r2aKe\n5o3a812rvjWG6F5qNbGe5hRbHLL9k4/WFSNsxrSakOm4kODDKWTbohteg5FD\n9l35\r\n=0qnV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQsmtUntAmhS34JrYrZ9zW6TnJhTCkkcavYi/7P1fd7AiEA9o81OiO/NULAhGAeh7jpexfMd92yoCXi1J897Un5STE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0_1588489492998_0.9470287742548062"},"_hasShrinkwrap":false},"2.1.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.3","gitHead":"61afe38e31caa779910b7020cdc5aa373213fddd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.3","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9vMqz1+8XJRwn6PJVnJVMHyIKCOyQACRg0cXIcTTY5URvzOjJqgrh+30C2bwtEeKTP69Esqz2dzGz2zYMez3gw==","shasum":"56cb0c7054ec43f5bb616f58e7e000bcdfdea582","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.3.tgz","fileCount":33,"unpackedSize":135283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerm0nCRA9TVsSAnZWagAAZE8P/RxSuuDM/ssFFkQaeq+2\nQV9CmBLYqeHX2e/sAtWIqKFu7CDmjP39dNOkGR8MCwnugBLaxOGWnsE0Csx6\nUcFr1EpnGUGINBnJEgFmsSmfoIzll1eBU1oaIqkvu7l+/oMC996nAjw8kLfa\nev8IcpAxAtb50CYPfaBjHuR8zKUEfPpTq3lbQIXsMX9znmatexuNgrFCUtmy\ntLUtY88/4KArNXIHHHou2hI8H27XSUO/6WNj0lLBr7wZWUz9ZrcpQgTD/8+m\nZH5F/h7KSXkrB/mOEK/ULoSFTa88ktLPQ5obl7uTpq+aAz4cI17dNU88ewxu\nDdvk10TOb2CaQ/fah7eX8/A7MkhQRgZMA/Kw7UrbIuV1gq9W1EG9PWklFJPP\n+cX10PtAKa/Hu8dkp/NTcxI5EzhZdHIdmmNM09XJt0iYcfOJvhmGXmRMEoDZ\nvGJTpmPJ2uqvWPoPahetyXjn6gTtvllEjerlUK4Thp9yjmqNVQRbd0IRS/zv\nj+3ApHpMbCbne7JQKJRE5UMBaxYvlRaCOMzlpird+iJyukcwmY+CP8Zx5nSW\n5gDO6mTdg8Xub8PUoUKUY/sSUKMwyYDI02LhgP/G2DL05S3hjrkGnThetJKD\nVm2/yPtzNErDe6aAFYxOT8Uy9VaKdovnBDS52MuJPZ1u8XMsv4ztlmCC8Ag3\nTl0d\r\n=ROK/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFbD3SAR/n2gmTmcpk11Wp7gruUcqW05tB7VP4UOuSTAiASPOwuf81GIy1zYLYJ364wt/5y8YL1Qdu06Kig6kEflA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.3_1588489511044_0.8680155565806356"},"_hasShrinkwrap":false},"2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"61afe38e31caa779910b7020cdc5aa373213fddd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qYvqCIE6Udz1PXeX2YGfB1/VheePjGSIz3oVlQSMjJZN5dpQKcS4o7Lth6I0eOmIrTZ5yBqmz3l/wLxihkYgZg==","shasum":"2e3a14f7bd74bd371a68b9eceb5060bceb81cff4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerm1ICRA9TVsSAnZWagAANDQP/Aq4zbmnK2J2uftWdBL6\nWojihS4N4mUCDkjOwVcvoNo2jm94Len3lKR2rvoBvj1m+4wnJfcF1aO9XqHo\nLkPFRgn64sjQjIz01imZ0BITqdGJd/KysCRk9oXuiQvzPoY8CS4cuK9LEmul\nKkq7I3jqh3TMXfukBOJ/WYiLoBR/nhqdX+WNDIFXzfnebp9PtoLvn9IPPzye\nCp4hJJVl6aglQp5x1Sb+vKb9pJl7rsDvKaklqejtbS3M2LHB3/A5unEiVl8i\nLeyGSgDHq6QU9oECfWWFIw2Zf3pkjnqbHaQTZrh3big7EVgLBLBT1JTcfVcg\nl9HCgSEjyNl1qNb53qkRBD4GwUyHSTLSnxw835fgAgVwAItBJrY/+CWe2SYf\n0slZHdiX5ojkliS5OqXwdsEMYuq4Z1Py/5mXx5J9xI5S0BLjrR+NFPHjbkKS\nFVMNj0+d6UzC1KS/Y+RCvaHYj8A3Z3Sp5mEiQOuJUnnOqyslaiERIyt2TXaH\njMJwNGgxnlrzr0R3YtoTWaZsKnz5/W/XLspZAKIQBMxNyF17CQVYeKyQZOLB\nyWGw2iBy8wwpVbl68j/pPE/S+JDT7UslxLnVByXEGT5WmLvxEvfv5PvTB0gx\noN9zOvU0JLXflG5vXXWVvgHSN04MEfMDFwW/5evuwxoZ20GvQIyzsepQgRKW\nWyUA\r\n=cvXC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIhSSGr9o6LqkkKmQZBYaztchKuhnXsp+jn+mdtmtnBQIgVDsoNt2WwnilZClx5/WzAjIqm8twl5BwRmBmCMuZoiw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0_1588489544212_0.4075274520407186"},"_hasShrinkwrap":false},"2.1.4-53f5573753e0a46145c91826334277edf4955665.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.20","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-53f5573753e0a46145c91826334277edf4955665.0","gitHead":"53f5573753e0a46145c91826334277edf4955665","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-53f5573753e0a46145c91826334277edf4955665.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5iXlnfmlYB5ORJWeQxiVO+b4l19jnsunSSpDvM3/liH4NalgWEnfv/3zN70KyCIC9XmowerSnYDB8aP75tbzXg==","shasum":"fb751972631deb06b16c7a605e4adeb768a60027","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-53f5573753e0a46145c91826334277edf4955665.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerm2oCRA9TVsSAnZWagAAIssP/AuPlI9lX5Xs5+hJK6ny\nLAjZRK+7WRrvK9Iz6yQsmCECvmKgFZEVcHTdkmWgZ0Ot1zX0etLkso3uRhzr\nFehTHIZlQTAaFP6Ej1mSNGeIxbb0vN6uhiJY1+3BsidBqWfoXvnSf3vxl+IN\nMzFvtdpCGdMlUzS6gMXlpecIGw574uLS2+0FqpKehUbHDEjBQaC8121m5von\nNpVNbWDhmb/RtchGMaMO1caCB4I5REjTHSiJEtL8968t8D6/r1NzAU2PiSP7\nTXZ6SVzasZBtfK5dyVxugV7WqJJ0ilHVZGnUg0JRliI8x+RLdf/EZYcO0C++\nzMpOQNGu9cqU27XzvFoBIeo6bSxhY8U5MekaHtDruwploL+n6yHvPw8ig3wZ\nrn8MM0GAMPsiZ2m3rMDB9ek+hhT40eu6CV14+78W+X/GVLbZ7pC6z/dDbHVX\nv+U35pfz61i4KK3UDWDDzWO9USzOX0HGFeHEXbbqPoVcSnW/9KbCiuj7sz0Y\neJ+tzm65XgvdrEdawmk2at6VQhwwaWJL48054iZqinuMDuCl/+R6hsqqwWFb\nYhuoBaSZI7Ah1jjM5zEhW7pqXnal4Csld2rLb2pKlbrlQR06voiYUUHVYz4D\nNPi/NvbiVxom7gjOv26dxCRKN4EqNHXjAW4UIrdkMUD5YOYmj+8QUwQusTtk\nOeXp\r\n=TWVQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFPGUe9VNecaFNYHeS8kU1uwbLjRCZuc2bCqfuHT2NEnAiEAtkEJqoS/QURHA6/GaQcZ0hjleSSvuJE82yqm58ckNXk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-53f5573753e0a46145c91826334277edf4955665.0_1588489640179_0.5576360282281088"},"_hasShrinkwrap":false},"2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.21","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0","gitHead":"45920c4da16587bd0d124d53cc80a9f3be8e790a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xJGV3meX4H1vwqhYt9k3KFuDxTnDhAMNAKvmdPbsYo3r5boCyiSLNpsovzu64+ogirbgGAbElN0yPA6JrNNAiA==","shasum":"338792c914bb60d0902b836467994ad1383dff8c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJer+mxCRA9TVsSAnZWagAAH34QAKAuMfeRzLRgFNoDioiI\n+EUiHHsacs0eyLiWclu49xBS8bUhcN0XYxhUNMySQ6e6JtVvKavYRlqBVtl8\n5Rodf2yC9n4jM+Yr6daEu7zyzqBf2eAYsXGu4wgEvwWIkZe2ZCXwKvZ5Kc+I\nTqL6sAzY0uiTT1N/Q0Tb8XyDmNz/xfMNTZMlbV+wmms8d0bhpLDODRN0g85G\nn1kgE1xsawOFpGNN6fyRMQw7kI5QLsDGi8/KyEDJRwSJsGk6fDJBDLqYbmXl\nJEANU1mF71/kx3S9f8OL5l11hhH6g1xAzm8rbjO2lYPIH2MquHMUojW18rRA\nyZBIbtd0QkbsknpQjsNKqT2MbysR+eyR1VH5AryvS7Ww7MSj0vzpk3lvrkTX\nXYl/Y1SGE9t9bAd+gFqaAR+DVXHQm7rOKmUEByDeZbHVThVRB78WprBZv0rd\ndBPvLu9PJwTRk1me48QxV1unC3J3kVGN551qQCuZXVWs7qMWeSgIE6UCOmHk\n+5YO1u3QLliDB8nQYRoXtZlrOEE6KKP8x1WyGMNhHvnpPA09uhGmOCoe54fS\nDY6ieLEQoLIAvwxTAqtC6d3MCoa64VpfI43nBNUOKayZkLP3t6zZBG7gHa+l\n4eir37rtgsm4/rZhoj50yXh/FLZlLgXwOuIU1AKm72ZE+3aSOehYcQk23ThW\n3WSi\r\n=mnst\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0oL6eVGKJPZbu/1ZiaAtPuzvP6AlPFdcfPbvh01JxhQIhAKopkrZkJy9hodBvFDrgms6IEAVdaqFICgDfbqQl3WF4"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0_1588586928740_0.13046893076848098"},"_hasShrinkwrap":false},"2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.22","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.0.5","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0","gitHead":"5b617effac1243a659e58c51e564e2924861feb5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GAudUoEye/hsTWsQIhSu7umZ4niGF/Hdm2Y2Ochu3etivv2KaNeIZrGcDMDl5hi0k51n6Opk6quuU1KrWh+wtg==","shasum":"9f94439ef4ef9a1eda74fb364c76ac809a78bbbb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesIgZCRA9TVsSAnZWagAAx3EQAJvXbwuOR0ydHxTofERP\n9HcTH4Uhmjo89jfONvYylbzPBpI1Ywo2oYgWTMNmuSSukgDbi5I3itUaL3OZ\nDUSN8SBoe3ESzb0y5RGahrXtSfvBvjIX9XaiqeozPC0E+O1umdUSBKxVg8zD\n+UsPRzYO9bk4homBNVyV0Bgt/nknkKX/WRT+VHuEgOX4jtLPvV3kSS9pzkLi\nlKfMfYW/YZw0Rukxn1eCM0I//MMxrwAp3Tv09g80VZ8d2/p4hw9e37I3gF/c\nQ7R6XC7kUiFc1PbLruydA/TNFoK0EWGGLEJLBHabjXnHzO8gjsULSM9h+Czp\npl9zbWVKVEQELN08rD0xs1og6L6Xq+UpI0asSE9UEZ5pBxvM8ICiiyXtLFgM\nfprKDiwulWElDcWm+9Q3zRcsIqtUponiHMC9aP3886EBiRmXrjHe6JVHrKLw\n7WQ6d2zifvJ0lrSgUIDs/a+jgfJfZlB2vmOg0FQ2P8T7SKRolT1s/kd2vnf+\nfnDKr8vnTcNXOgOK4+3FVYoYOUX1Xhz/aYgySOr40XezlHhC0OuGweLQ0gif\nbb6q71wnK0FEvu+4goK4+UU5djvQvSiUfS8+TWkVd4XFv8aoRqMiRDhsHQSY\nLKcDSK3W5yUg+eAk8xmtSNzoi54VAjtdzd/6P0aLxAkHMCDPn03sw3w655LY\nEJM8\r\n=GU4y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeVlisKsJPqQYrDllN5vkCa/QaoIr+4aKn8G+8bjt0qAIgfOQR+KX9tHAUsKfi73Qn5LvM6weks5hD4Zv1L8Z8OZo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0_1588627480819_0.8275235481654777"},"_hasShrinkwrap":false},"2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0","gitHead":"37b68902a83fe19057887e2ee779e6c098faab26","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SpNH6JNQBqMyy0F0xvvChT6obhw8jrSbx9BdLm8W8l429kWGSRkQh25rbEm6vM6orFKfIOGh5AvvZSKcOtc6mw==","shasum":"6edbbaaf25b5752c651f65927433f4d3e0dfcfb6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJkoCRA9TVsSAnZWagAA3CUP/iUV9elgg6tO+E6443tY\nPY08ncKBvaocDR0Q2I4C3MQph4oa6N+MeSVqFi+pYDTLUYXWNTUD+oXc3Ipg\nUYYgC0yfg18uraZ1a85kOO4gFYxPWWOESh977Clv1yxZQ9MlGshqHwYblEMj\nFufowFPzH09qkfrtTRz20nbNxDlNt/ld1XLPVpGYr+Mm9ysip8jMLk48Td56\nh8aTIF6UB+7Rr9r1DxVP8F90xT5FpamVsZhttNuZEBAHEUKhoCH54Tm3k69J\nzT/2pD9IqqwF7dgn/N2c8haWWbsYO5bFaigZZHtnE7dprZ3fI/YMvIoG6HgO\nPgfEeioAFQ2H1ZjtbeBYLqgT7nglhcE6cv6P8VQUn8cHIhEpdSiXQ4krwmxV\nI8q0ftOuxsUvu2/rpLz6ODhoBNnbx4kbM4CCetZ62hWBg4wGvLx2DWzdzmNy\nIAdXSpRjujkkMSOjaIxFIcOjUUHay0xGSjKbLec7j782lYgUSIYaJH5k/ot1\nOEPopRAoJZXseFHkKPQcCyVau7IExhhIlbQfSqjysXVfi9rxlkMydY32WN9k\nYdWCWKbaPV/buoWbI+YUJcHQPlkacaLcVSX5ZzaG2m8NsKz8NSZ1xNe2DZ0f\nAxT/XveGTIZ9jGK/wLzOPHkQbQY5/v1dF/YDPlu0L+eg+pO/hQAqYbgFxkoL\n9iot\r\n=HxcX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGW78e3gEExqJCx2yl6mP10Kv7+7SgK30q3y8qQvflB+AiEAqipW3iUOSrvSy1bWRH/P/9QI5sY/UycRR7erXxwcypw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0_1588631847544_0.4084871189253445"},"_hasShrinkwrap":false},"2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8abe751af8b6e27320d4199125b25bd34b021111","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a+3E9jfL8UCvOANQH+klVkCF4faTAbvPDsDOYM4yE0Pl7RtTgkTGOuF+xji1u+S6Gi0u6d44XUV4hp2D15tHaw==","shasum":"f2e84029072becce7c7a6a8a8762b209bef2715d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0.tgz","fileCount":33,"unpackedSize":135326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJmBCRA9TVsSAnZWagAA2F4QAKMoTSRkg9h/ovYYm4Ya\nIV0naTHlYE4e8O3qZF6WdEvVkgX6nBDSURcnAoG3MHV7s2dEjKSt4l+fKvJ3\nEca1t7YNjUHMVzkI1EPLlIxbZVCwAfGIn3hzhPvLVMPr/Xeh3+BhTIRCOkFm\nUIFaCMu2dL5vZZ2q6BTnb1vt74b+5ADyd6sKZY1Ow1QNRddH6s5xHf9+xtSO\nkIqriOViVWtUzArHqoFQ9PWMX6LfBsSvObi3h4dTbBkq+ZIdy1CclTtjS/Ov\nMxu82Xx/lL1U3a2B/WMnrj/Qy0MvD5sx4J319px1CpAgFwABXeuyQxXr/S6/\nzISfbjWIDH/3Y9fWow+KZF+wESAmO/AOnoFK+HXjisW5c6d5XNgqZwxXQvj9\nF1eNSlrv9N+TzRj1UfzNCge1Hu4RSNmG3rmJ0/XTWXUQeyoTW+mSBWUnpmjO\nZ/TfPeAZ5/NHaixcUiz/zdpv9Aa9zIAJmgRsySEJqWgLQVkYVLshKKCpB/3y\nUuukxZE7UYuKO44oI67OyQXCez/jIGUmCz4cWPjCNkMJjjI55PB1CZKx6i+7\nj73GTSALlPViNo2tmU+DD/cAOATLzYN5eHNiypzC2bY2AOXlkGh03XE1jldF\nsRImIMJ6qVeisGiB+/vrlk09KosK1QG5mVH0wuwe8Ri6PKABaAuAIgnZADJk\nan56\r\n=rItI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaBRknm0tkWvPXLGyGiLDa14iiRpJSZNgsWMounmQdTAiEAqAJ62Gbraz4wqHs2Y89XEkJFBBaZvRfrMuxekDe8qFg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0_1588631937070_0.37566723926312884"},"_hasShrinkwrap":false},"2.1.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.4","gitHead":"3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.4","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AAuNMMxVIea4M0t5lcZ7VSbakJqoBwwxZdHQsIE56+F1gRpA/X09lCSoLwcKHO/b0iGzR/eOb+2Phk8x0UxSRQ==","shasum":"f656aa8b42b1676accb0e48169a5561ac0c4991f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.4.tgz","fileCount":33,"unpackedSize":135559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJmJCRA9TVsSAnZWagAA8fsP/0Tk6myj1dBRa+WOsSVv\nekIbVerFjlI71sI9NOfrt4kdJQE11Nx3lyGLvYCqkSLWZ027RUXFetpuvYAt\nMoyjWlEn49gAbRLzw+/Um5V6aFiXXa8IWbbbW3CLiVAT3pkCBDobvnvtm7aN\nPJ5s8rBIkZ0NHzsw4ShJn7m/H/ZKrc2BWI6103iPYPtfnPSSFLt3hUuz27qK\ni6xVBNQP03a5lWIwnHEU2UT7T8AFj4OFuCDukF76fXy5TEPyLCpZWcRNpFb9\nfRcArZ6mG0GmEy/PuM0G5gWrOBmIL+V/eJZV0pqgn5X3LatJjEWdCbuolBSd\n7Cb36uHkJBT09HL383B3P6Bv/mQOpEyVJF5WDuVI3SXRj8O/pl1D/kZdNn91\nUoBwUPVLoLPjggaDRxXqHjWnE430fElxyNCehnXFJVJD58DzFCx3qU+gY1wU\nnk7OKpkT+ZEI4a64AZJ7ARmjS1qIatLngn5/Nkp79uqlpx7GkpKSuWUyyHcv\nbSe9dkM9fPmVCTJM945c+NSHJbFLJh19mu1OBQnb/0hMto3CuNcZtvRO/5S7\nZItDRA04GpkzWOoOqvDTMrxARSGZuDg730UKvbvFf4bXKUnYrMmn4iFzuP29\nVNUFNxwE0IQRJdLzJil/7csykL+3lZOmO3P+Q+Cvn9tNq83FQRHquyyW6sFf\nEHZn\r\n=NM53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfWdc0mDNnaD5/pNrxLqlKuZxgKa4Ul7A1Ngu4s9iXOwIhAItMjsMCW2rlTttytE48wY3D9Hy6roe2UwmvyJA9b1O6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.4_1588631945024_0.6642397371146009"},"_hasShrinkwrap":false},"2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2WBKysvTDLWqtC3Ub3vFypGZIteQKx8czcUpzITatjBMmb6k7IXIReSu5YSuFg22t/FHw3vv7q7pbYt1ztQQWA==","shasum":"feeb12b5b81ad4d08d1e1cc51bc090c1e4c46f26","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0.tgz","fileCount":33,"unpackedSize":135602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJmrCRA9TVsSAnZWagAAb3kQAI0Y4jukYHgpDlaxbfmk\na89HAfwkyOtS9MQL09THNYAcHqL70XjYhDwZP+8lZ21STMomDExGzDP+JH4G\n9Oz8AyJ7ngo6h3pz7FRBc+kYh4FxO05sWrrFC3Jsb+EU0eNEykYDvGCNcn0e\nTLvkIusV1W8Igl/FkgeqEB/EyvXWf5qWvork3lhDpBx7LDIn80ILkEN9F47g\nOa55CYYaWVqZ7c0FMxcugqvCP7rZTca1V1RBQ9Xz2os23Ple/Ok5sBxnZmGQ\nnPQ5NipatwsEv+pFtIfhe1jifBxose0u6W8poWQO+Mt1qo7x42vsot7mtkW4\n0u6C9GRN6m72IPBcMAT1nF3LGEgqxlVj8jxmfTeGvFBQZ0gTrptBnoyUQM08\nR1n6rcqU+LxexV+Lj5KJV4MiIRyWoDbpMGXNPlYtQfLLfrXkIGPHTAFVjSEO\nBnoPUhXVda9EzfFNXdd8oX7/TkTj+YA6d/LHPmTih7+XZrDGy8QuDuETQSAp\n2YCiauYDFRMkiNAGMvjYDWvinnthSikXcCKwfWsaexu8111JDANy982bpn+/\nIgxawSzt24Lqt+dojoT+FrcW62HyVpcwUWDun1JT6kPq7Zhle0MjujifATpW\nDn1zI9BafWI3N/IILMa/NnpKnNq2yuYBrFe7l3+olfld1SbFJC/N/L75U3/x\nAtcB\r\n=8hkR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFu/zMT5antCdj44d3UJE3qo8BNvDRy+JrqdvKKTSvBuAiBuq+eB4b9v0m2pTFOwcu8l47MsOW/3QBQvyQG2M0gMMA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0_1588631978637_0.45636362769526095"},"_hasShrinkwrap":false},"2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.22","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0","gitHead":"f9910956e80fda5ec8640eaafbef70443c8402e8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LrHGDvZgQBHo4FgANlFI1waaORMmrkRkEqLpMmrEKDrfSMNkvDfICPqSsBhHVuO7aHCkKJRU0zVAfDkGSFuHwQ==","shasum":"025b9ea578314996949ba8f4c46ac73e0fe07843","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0.tgz","fileCount":33,"unpackedSize":135602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJoHCRA9TVsSAnZWagAAAUAP+wU6+4w93LN7B5ecM9LG\n9tY+Ac7A655O474n3wKUOQev2F9k6JEWs+A2sHMplOJp4Jb27Dmnfmv7lknU\nZs2BX8fs1PrImC+POVms31rw8DLUeHwch70akI1kof/mCb4tj9VPGqNhSomc\nduN3mQsQpv4aHGkzj+cPv+JgXIspOP4XbdUzUsPZEjfZ+HOCN7HuYxEFc4K2\nHs6gwWhmWxvuHJFrbKt0EV1Tjhz09XweCYKsLbPmapvjVMUXy9ITvM8ir/SY\nvAYN4f7dGk6RC0kyNh2EwEi6G6M4ADBdOvTq5hzSQLlPaOR3APyeBQ7Wsw6B\nWCK9vc0Fx1ixZ/JZpp4dofyE8tIycHw/e5qCGnMU/QKM9vqt99yr/dPBP6eP\nsQj6UOXALpP3++5QnV1ujcZUFHEgXRyU5IuExIGUSfeubh+jrM/1lGCFGUEQ\npzQogGquHq2qroEk8e526SzP+id7/lLDhhvQK5xgvfCBrZ5HGQo/tuZLayIO\nfOg1D9s65jQCRNI5reNivWZU1E50mkcQeKNMQD2Nc6gi7xLQq8BufChoUHYY\ndkEKAeywIiZ5CEyINWEQJplZqAqa9Ay6OjSCOnXI5PdJ+NgZoIgI9diLQCAd\nTE6592ZvymjghdA5WfOXZgdw7bwHoCYYCLf/Y9rW8MmxvLNyhE+7BuRadB5k\ngfwR\r\n=PwMl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwoyS6p84yv9f+LrmPgXQVn9mBBsqCakeN9mNKXWi12AiEAvcTb9BbfpT2Mkn7SjNWdlAug1nU5WnT2KCJtywS3G2c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0_1588632070742_0.5866795704832759"},"_hasShrinkwrap":false},"2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.23","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.0","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0","gitHead":"d5d0fb15bead23aa27433272f3360581a13ac920","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ir4MGRxsh+tEMoBtCSzWueaLDmlbeWGixOMXQ+845+gUc5U9fcNcvVWiePjOFX38KnA6pIRhK+25wCMIOhRgFg==","shasum":"a42fe12da6b621f4e6cfbab7a4c5bf5030a69589","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0.tgz","fileCount":33,"unpackedSize":135602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesSnMCRA9TVsSAnZWagAATrgP+gJglbJwTuDLhNErD2Gt\n09iW1ScgEcNzozlWvG93aJ3M3WHCbGxPpcNRrhyke5LKTtDJpMM/Wtrio+S8\ntbb46GTug2myG57/cvPMz8CyDrboLJZv0Od0oKwp0lD4EefgJ0awvjuAQnkx\nbKspwWs1xhhPcXIe0MDueAwqTImoSNqVn/5nY6efkpBtNuUSFr2A9q0Tpoor\n7qOKpEGPO0zwlieOG63EBFG0jE52fVxsRO/iUYyjg7tk2OpT8j+XUZ8bg0j4\nxM3c+SsxYQrFWX7GxDOGUoPcr+Bt/505EZWwGNrq/YmI5kbn3yhoUlZOqqs5\ndt2FNCbOh3lukMZjbhZd5k+0AYkGXCcq1g/2gtwbYGB25+qc9oDDOgDoFKhG\nPcM3FzGwYx1H6RnwNgnDw/vr9fHh8jn8m6JR/M5X1kiwb3Un8YIkjreVhDMy\nadF6dDKT6uGMGdkBGK1/g5SwXgweUNkQBP726u4gGBxDZeJHnVXQZLJOG5Yw\nbgDTBmDKbv4X8NiqRwp30i385QV+FMl7vcSD89+eGyik5+Axo2KUIeZ+qQ95\n/mNt2CoyKYtWM/TqjzhzPfXMFzu6o5N0woc1IKZfSMUjVYPezb2C596u86gd\nMT0/sJ8wk2ovtEt/Qo9fAZ1Pvyiz8e2Qqo2oL6w64uA9UdnZvCsOIcA1Cqyv\nq9VH\r\n=k4MM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJaHclGvXrtOmyGPsVFyAFOMayZ0uyVHZ2O39pVJ89dAiEAvUB2J2IiAfbmOGDSP9dKsFhXdhzGhUeFH9mdYsxTZ2c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0_1588668875250_0.749648415749546"},"_hasShrinkwrap":false},"2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0","gitHead":"4a36ba286144c8315730f9d87bebe673add2cc81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sinmG2cxfSnN+T6MQPS5gbYGWCaNgBUSfx09R2bRn7MUlvcovUmIzsGf8bkm47NIawGDuSsZ3alqUMFIEZQ7Pg==","shasum":"7ce7d71f37ed0ef50f97b2d781560ce3b8652b15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0.tgz","fileCount":33,"unpackedSize":135602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTUxCRA9TVsSAnZWagAA3jkP/3XCm33xhWv90kzbSv9s\na/Gwi7/5PaqIfBU6xeCzUnxF8CV5IPhrQm57C9tVSIngcx3A5nmqfmtiHJhO\nw1aEwBmfJnewxYsnDLR22WC+981ZMNwg7MrVSb0P28GHNG/RqrQTfmJMue6r\nOhyRgpBWA3OfIisN8WmCV9/C4jJgkey04SvKONjpgKS9vVDY6CFEwbLJyX9j\n2Uw8fIGnmpqoFSSeQ4cMSKojfsog43V9rkK+ohvKvDbE9ZC9be8DHA4A/hL5\nd8JfChWLZTLPL2//9tTpYeaz9I6c6aiIhUFyzEkJI8MOELrCElUImlG/JPcp\nMu0+Olit2SHMyvY15kkoyR1m21TPnrJeNS0RHmvQYeYprK7X8xkAZVSqjmot\nendwt+gz62NDeFk2yc2RQzoD/S7pw0d5qvjFa7FfcUPHPAZqq/x7X4jjfiZU\n8hrvj9jqvv9vYjJp52d2DJusgNE3GuT7ZxaFkxMIg2juCA3silBcGJVY5rwL\nUKfm8QwJu1IahF3Q+qC/XNLkq8pbZAOBAO+xBFPxE1IasgTKeIxklEGt7aJ9\nq9bBhL7C/l+8UStCOQ/vboLzEE9cA5i4uNtSIof9FVTI6ME/3NBuSv64qwF1\ntHaQy38ojjRLuHZkoawrSDzjo5DFFAEsX+0fbdxbzZJa37Yy5LEEiEdz0Xeu\nxj6h\r\n=/Sqb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+f+zx7dta1nybNL1X/R/DxPyKeSMp94aneYk0o5I+eQIhAKi9prN6/pHLiAiEOpt2vCSvWmAQq3ucYYjUnAWWfp8B"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0_1588671793322_0.308915407317099"},"_hasShrinkwrap":false},"2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7fd6cc88efa4158041e5a2264ea38aecc4bf77cb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-I/pJWmQWaa0cSOReKfRuW5ojTwuxWhCIzTBFl0qoUDPDLvxiMJP+S8i0tiAx3fqSuzJswpzNyTkYJRN146Tjlg==","shasum":"22c1a098425af5671796fde8618dc9aa45617cc5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0.tgz","fileCount":33,"unpackedSize":135602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTWmCRA9TVsSAnZWagAAzvIP/RqKcKhBowWQ2zKZu8WS\nAltRofAIE79yW+M/eVLj3tIh1ZOjqE4pO3GiW80jjcPbOGaaYkj7PZgHbCCI\nC0U9RalxcfnRweypSW8ybEu2ZrNAaNco6gmoN3lF4slVawAXu7Lt4my+vcc4\nw5UIqUKgfqmq8/4QUSHOwBWgwCTy7Al8zKcHCqge8+XEzSfWVt5tEzyivmiD\nF+h7B9ywfhWUxozCzJjbu1KnY54zw9v5XXxpAnB4q/dxZVVjDMYP/hOWap11\nFdcsoBIssx35IpxZqpd5fILFL6yFquigJrJnD8T9FlmdF6VeiKYsb5FfiVQD\nO3DUdBHHsV41SlvE8uON1nN/NHNyxzjQ6KwstYrvH5kB6hwHLvsRGxwvLf9n\nDK8cFPRVu4eB+7wqthAD5ravrmPmwUdc8TxuXrmNw3G8cFZs8ViTYBos05AD\ndIa3AYJq7yyBCwMOWvUQUF141ZK9q8B6BTRUxonMsTlpnsjSSMaRGqXKRiZ+\n1LbG/49Qp0xyNKGJuzyTTnxpD/AU82rpfEvXV964Z1z57D4FDoWh0z0ConN0\n6H7iY9+F1KqX7lp5oI9/nPMgRUUa4TRx/JkR6nhKuoI+DmAqre1NohHKCuvp\nUuSZrEKiN3VanpUk4oFN/bVtQ+StFeaX5j/PTws4HcWR1qZQts2YloJOBgWP\n8J3e\r\n=H2YT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRxP46ybYBFj/1dAy+1dwJf/nQpXIKuuppvUlQ+STagAiEAjfOrTZ5F+pJ8MlEASBvKqyXtEcV8SchOhThd/8C0824="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0_1588671909600_0.5467338522731582"},"_hasShrinkwrap":false},"2.1.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.5","gitHead":"57a1346203648ef99316d56f0c5eb0537bbdd3c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.5","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jmpFKA/pr+JKPMR9n1E3Na93D/obJlhwrn2ExgiFKEcylBIM5hf4TUfwFlFNE6ZVf950Y/hl6iQl0CjhkbvS0A==","shasum":"bf6cb4b6efa8a89114c09e02304fb1efb7c6501b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.5.tgz","fileCount":33,"unpackedSize":135835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTXBCRA9TVsSAnZWagAAD5cP/jPJoEkzFY6G5BaQfRZ/\n+MIlV8qav7yfl+Cemix0n9bydenNKrEan6hQWfR9SVJ5FT2oXFpgAE8XWLWh\nAlaSCbk16n7JudysUudTGJd+nvabTpkk52q6MNQqSchQZQp+xhe+DVtN09aI\nV78ApRc6NaMJa8arTT3Dvt0KWJ4zSOtEefGSftZVMiBbB69b4WUnewMCWvD3\n2OY+Vd9g47Ey2kUwkpBwHYhngl3c2i/oXdW5mlPkuzraqrsTz9zTU66JQM33\ntwg5/tW2GlNrNn4/Z4a4uoSMGOVkDY0uiqKM6PpBnx7W5udN6pBfjziyfL1A\nUDes1twYz8OWCsaha5c6ujjWYQ7qgnQRUjrYRMFmUh1ljuuI2lR/+jFamUfb\nndQNIepH/aty48/pXdFFHKKso7fpvQW5A6tpPdcPlg9VMZ9BWzsPtL8BYGsw\n9wWClBP6DN1DbnY5Gip/WoJlF5iDohz4lSsXf9JlEz+9kOEl6Nq2iXZ86YYM\n2T69+Vw+vbS++JUP1ry+YFZEFc/F+faHHPbMEmXPTzY4IEsjlbYp99ydEef4\nfYYSuuki855eblUPUNCag5FH/gLyy83EGrWtgTRaaTNESgHYemCD5cZQ8Idl\nZdUbEkGtm+vGZVDJEhRi6fg6o44YrsKBOrN/J1v+4Mm1igpcDIZxj6bI5dga\nhjrD\r\n=XygA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+eAJ7L+g8+Ps6KT7TBQ476LVjimEYiwCNRMgzYHNq9AiEAscDNUe5NBLEJR9W+4ddVb+8yu46EbpEYUK3bmOLtyWw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.5_1588671936810_0.11153161773919984"},"_hasShrinkwrap":false},"2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"57a1346203648ef99316d56f0c5eb0537bbdd3c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bvKNHjWlBiQ8ZixilPPLCB/+JI1aCtUIlAxFDevPBEU3LVPIkuOnxaG0idJoVTFFHuHLNGPdGe279+ECKVShPQ==","shasum":"ad24d61b9bcb9a0ee4267c4e422426c9b3a59c62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0.tgz","fileCount":33,"unpackedSize":135878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTXrCRA9TVsSAnZWagAA6nAP/0oQ3dov2sEYJuPe1J96\nzjl2vbAHOx+73gp/sslZS52s+zfhFRGHi5zk057/c8nBHAP67YyuFFeqZPoY\nrVQ2oPKvQK/4Su+qMSCXi0hhxLNMCwivkxXPPn9/mAkwcBKKmPLxY/OuDe9v\nVlk4TurIpXcIaYf6nKwNu+OZmPzWoZDHTUEmeJCr68M484MfyKLZzGxcU7lv\nL54dn/DwN3xlWNQYzMbyBOhMxS5UAMCaNyfkG+54A7WkCWPimTHMJazBRzw5\nnrdGqPcm6hhkjXMfnyhN6vdO3PmCFdMmNlhlqRm10o+PeljlWYjKE9UYSZlS\nR3ShyrE+uE3YvnIQh8mJBSkzUtyWR94um5ITQe443fJ1ZxLEbMzBJNTn2H/0\nOFWNyKy2jhRBxzSUxJ8L7W0J53PMbQ3J0zqrEXPILftq97IGLdnUU3Nhg0uY\n8Q8ksNA7ef+i+kbcH9ysDm3nEBGz2L4eekoPCEjTq9tMDGUHg7TQWq4Ls7qS\ncJqnVA6xVcbGVMOOixCWkGpXLQF8AG7Gt+/NzCHYCQaNxAOSdK9DOyivj2qA\nrXTu9OJ+MtQr2V7UPWcgy7PUjt4/yk99V2/RKJksGS4MHbuBXsQJa8GdxzUL\nwzHde/+YJRgdIiPevR/x7Mp23nmIvV5/MTki6F7wM7Bfb0nfiIjBGTCb3z4P\nC5b7\r\n=37bY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHLq/zb9hBJZNV498YSjbBYqnN+/kRmPJYSbOVhy7xGOAiEA1zr5MueVq02Va0kuYBq1LjbtUptb2gYvc2e6O7JF4U4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0_1588671979048_0.1986569267000997"},"_hasShrinkwrap":false},"2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.23","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0","gitHead":"1d4e464b81707d501446f594f4ebcf0d02987617","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-T0w3tLvY6o8JJIVwCVCyRT7WfE4dXqJkQW0GFaspHxG+INIux28cLJ6hjON7/B7TAEW4OHx7jjIIWMkob2pKxg==","shasum":"3ee4dba6d37a783ce196a33d6b15cbe04a70807b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0.tgz","fileCount":33,"unpackedSize":135878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTYqCRA9TVsSAnZWagAAWNsP/1qZRdaIGYHS/5S2Em/D\nO55AQq6DdgEJb7nH/TP4ESu/MB8YC3N8K9gS2cpU2z+yGLEV0Uk1kBZ8fk16\nMOh3qxjBusR0z7mYBY0/+BjIbaOzktxeYIklIBd9ekTAUGtLlc4e8LYtwLLb\n67U+oP27uuXFi5vPZ1e7AldTW0OYCS+stJv8LUyzEPL1Uk7fibupb/z69n6J\nXKtVWBnUOJSWs0Jns4GlZcyo3ICbYDdPK+b9h7iwbRs/GYgkpkNn3lh1h0dD\nwkTem9TL3fnOQvWAS7t+YDN826c774z6FdQ17iNynXDRYRaTAHt/hb33pHPd\n38Ih1dsrNqp8IpnYlyPxHhkA9kB3sCsixhsE4k5spIgBYVJAu/UbsbO5TpUb\nzwnYxFTbqHYt6+x3oleowVilFJPDQ5mZsCviZgGSp+iOaa+h1AJKXO26BWQ2\n2IIp341Eq+2f1enV5Hb5Gz0CkzI/8lakKsUMTXmIrXIseimfL13IDAtFZuwI\nh+zxe9tuDnBGbJdM4zANTHVPldCPTHibBzW4vBPmf3sD4eoi6jF+2ycJHgCu\n/loYRQR6p+ZBuvZFb8Aq59c1/REDmyDNDltY7QotxvkEA6W9Q3B3gk5iC3bP\nHR1tP3s5g6KYifiqxhRb2SM8I+RWnkLcQ0t+kkk6yrlcWa8O1DQpaNPxJ1uw\nywGP\r\n=vDgU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCYDIUYOtemiXsJONeqle0hULfdefaCmNc33peiweCZAIhAJB/o/3nWmcuV6bZBp/6l+JVX1I308hB8rQp7Nk0XTm8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0_1588672042104_0.9224725942611443"},"_hasShrinkwrap":false},"2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.23","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.1","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0","gitHead":"9ed284b74f7c0219b857d1b044fff0acc1e43e0c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZBbFzbfSNna8jgp3QLx2su4991djDcqWw4QQXV1nLV7w9sfohBURbVwScnhAUotvHPvLUVSw/Yg1iCjcyN+sMQ==","shasum":"aabe44b7a4f47a33c498bd24aa4187046c2b2938","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0.tgz","fileCount":33,"unpackedSize":135878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTalCRA9TVsSAnZWagAAM9sP/0T5/eC04Yu983Z1/D3Y\naOKJJCo1GgY8XmGlq61j2ApzvHzkpC3V/LSwBBAyifvhnMZKfwXR/mbZdm2O\nVg6FRXwW5izkaQYCYOqzu63VPALqNoUXdUuwTYZYTzu+OualD6Wm0XNfdhBh\noF5Wqm3d+c1+hdYyUNkFw7m7sYuSlOrZDb+eK988hqy6QuQ+zOm+kmDEdUwu\nWz8OnQC3u/E+HuI+IJIjrPEdlbNHxGiAFpSgdr0XzUs+27mXOwp/0d787U91\nfWGymCU+z9U/zMfxdGSKiIDfJevc+aOYMoiRZmKOMzuCeaGaxn60xDk4bCLt\nS3CDIcyPbIEPkXX08nzvQ7fVfX1Bl6Qcwkq5e1xNRhdCIfrDrARMcilhwRGs\n917b5/rCZuKoPoDXrYwFJ4nBVVMP7gao2MmwFCHHZnrM3PvC4vLPg4lbYoo5\ngn3D79s7ozFYgPoEH3wtN7vLz3liqAoSxKrZktI/EoiDB2GTn1wqYcRG3KfO\nLI3x7zFoW90mg6oqDEBV++/J+VmiyiQSQBBPyjy/IhCt78fIOri8Ogwxs9lw\nBUl6mgghNtPNR43102uZ2HkLHlz0LLft8gDKgplJl5hU+go0FoVyvKdDdujR\nSRDSJ8qAS1mqXuUyRttT0m18MXFIVK5oca82pM/UzlpzvJmzVwwuHvPbdaem\n6r4f\r\n=ChBu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzmVi4IZa4R/AmnQgt13bluN7Jyuzg8xv3gb/3eXWNYwIgNk89tus+vRRgzIgj5ij4RmQhqZ2jXrCXccMlz8db/m8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0_1588672165005_0.4765297586635484"},"_hasShrinkwrap":false},"2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0","gitHead":"23e94be2e704ada37ceb326a69473f9083840438","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kkpLKjI+8vbB7kFva9+0p/kADRrfxWiR3+2UuPKLv3v7odqmPyFzniI9QAA2l0chGKU+1Yga+6Tq14m7HfTHkQ==","shasum":"12e84d4520b2f7e4e4b1e6edfa842722a6835ab4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0.tgz","fileCount":33,"unpackedSize":135878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesVpxCRA9TVsSAnZWagAAWM4QAIyu/VvSbGCp3yyhqDR2\nVnH3fQZEnKEs0gHWRC5C4V1mOX71B6AbKVGjnCIiS85mCldUzdFxCxuBtQIf\nHo3/wOSsjkUys5XQAa6P5qJPyTNW4h8S/SycIzZI/mUnu+CRYRq+Z4acPmt6\n4pa3GZfeLnD0vrNpH2EUGO/x+s3wmX4p2wlhg1L8YNduzbEOzDVvsB4qp9vG\nnyZ0QwlYfy5zu/wzXqDnQPDHPmCTYmq4SX0irGGQVT1SmKmxzf+VVpQRgl9n\nuHzeYwabrWg37rd93j52HD4wm2Ijnn5fhw9aQQ4lzD079fV2RxGYxmzfCIdE\nEtNmfoGbsrUwUbEYExoGdFTJl6l9l8nYaVJnEuXwG9xwlzrKnicsMfRUx7T4\nREZL99+B9uLKIiZ5lebZtRG9j3VvTOu/uPz6+iyD3KzC6D3rvu9YdRiiVvSa\nVTrPG6qE49VGse3g0R12nZgt4liy7KZbh0IfRzO8E3TTj0GMms2z6QJzD5ql\n5uejO75RKpgSQ+xB/z5NR44hvRN13rBx4ytuqrFrkfru7KiT/6wSYriaVC3V\nHS2y5LHlvHJDNfFzwf9hS5VQqekZAsw6odTlrQdLXiRs4Kl0UeWTDoDLUnnT\nyXTPNXZEdVsRpzlBU2HR3KaMPeOZuWBEQcCtnmBahXwwpa0++Mj0S/EVhJRK\nvWlh\r\n=fAqD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMXLGn63cLQMNwBjX1rmLV10tQS+MsmXtElPQcD3yGTAiBFso4mNhk7OsOi1kMefwXzuSwUYSPCKYEkNywkKMd6Zg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0_1588681329038_0.2611856435863529"},"_hasShrinkwrap":false},"2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ffbb15a0f306f68b2229326e6d169f6a76d42334","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LMbYUP3UbgppekWfjm3yy5duHwA6d0exX/8JauuNTqZkcxXCkdbHaNYPf4O8wZDbQttpkhGsx8SW5sF3Xii9jw==","shasum":"5fc2412e18d15eb0bf2b23dca68ba72abebf71f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0.tgz","fileCount":33,"unpackedSize":135878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesVrDCRA9TVsSAnZWagAAwwUP/isyLYtpkf+B9GSbN5Q8\nvRMwj19Wb81iwHBffgW6yEBMTlJbYUE1GOFGdY+bulF8nmzkw6GRd1xWdFzc\nlswtp3CBuVg6TUBL/G6o6J9Id1dWPZ1CWsdtOJt4W16wrR7ZjHUbWN/xtMY9\nNRMeb4foqkWsSZIhavN1gURTlSlv6ORVLFL/tOZijWcHkilZaJizNPWoTlYo\n/LHq+kvEiNZf7w12jUAMQUYbGHwJflWB+AN92hd5IHf0kAz83NEpKQFRtiRJ\nIyoDVSuIpEpU9/tOYCvrU0MeBhxxkssK3R2efDTDH4WYiyQp2xvIVPo1IqHS\n+PlAkbAiSZk5KoSs1Nxstqd2G9No3mFQue4i05UBcVtX2FhWd9CryJcySfIM\nWsGoL2+LZ3feNWXJz11B35fAqeef6EbdmWwZh3EVAV9b+3xYTAIDicNtmMQo\nniAeMt05Mk7F5uxcwer/dUK6Vs64FU6Zff5AcuQwXVoEDVqH0IyLGzjhV9PB\nJwE5fzWKQKcBKQnQmpmcdNdvQeFqys2RtWEf98qtozwV6jLjHbWWncLm8KBr\nHZ1iyFyRnex7INSfkA0Qrw0o0GDGvKYwd7ctBsxN2ppXbybsYIVuIcKqZsYh\nDjvn6T63F+cXn7vjJtRhD7wMRErsFbEFypq3hUzitm2SCM21DvZZcs4FSmdG\nJ1rF\r\n=0cJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC81MKZaOJ0FkkkkBbbBmQ3p8Urxb2mgGwTz805mYvHCQIgegObtCOALMzQjyThC53WWm7991m0/ERW786+urNUKIA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0_1588681410885_0.731304385029873"},"_hasShrinkwrap":false},"2.1.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.6","gitHead":"49642b089de9b2bbfff1be8c060e242f01a125a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.6","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jl6rl5VwMOS9baOD5z7804bDyBSJUJg6ucAdMKtklsH8v3A3fgGgf3SXFx+nDw38UtNj87bnaBbX8BjkOvwDoA==","shasum":"b27ac3963923102feb84610b7e7f366256d44495","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.6.tgz","fileCount":33,"unpackedSize":136111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesVraCRA9TVsSAnZWagAADhkQAI3stRX92LuiwzeYfUsK\n5SpvCu1EqS7qo+IiAjJeVrXb5jQv57qkXHxMQQJlDsgmEzWYlfU+5U14Hu0o\n6yS17bTD9EW8NCxx/eEyMqMXRYJVKso388Qx/Zs7P+ORaO8LTTqwajdDvT1M\nsvd7uvENE4TukHkorr/zN7mgObfqjB4+ny8Bw6heOeu+ZQj4PLrLh8ib4KkV\nwCv974y08gAkjEMT05f6lfrVOFpB1nBJhgbm2FRv2ZdOg2/P1Qpfn1TkohqN\n7qe4+8xA+7dfacr/GPwgu8v7FEjFOVC7hFMhnAI4+/XVg1OhEu9S6cJ6+1Ck\n1/S+HPnnJFLw1WTD8oCnpkHyM4FCQYW5nOrlP2/WNc7MErEhepGVzVoEvt0z\nCCXHcV7tvGIao3m8JIw4I9ihC3Ec2eROjNvZ2kwfoB7xwdOst+1h3hgfxxKW\nww+2wmWc1wjTbVJQmCbQLd6hG0z14T35n05uQlgI+FYyRSBf+SAQ5pmU1KLt\nTvI8TM0/wC3SX93S7lJmtFBTKpZafwwPnu3u44i5ne5PDsLGFUVdm/n5LdxP\nHcfLCYdErPSPE7NCOyal2cJtUEfRUj9sT6RkebRjAAbo3SDtQMsAnfC9biCb\n1qSrSRDTB1ffpR6ifq1MZAbBj+hXYOGP+0h4sE7MFzflbYA/KwGIY+c3YejC\nx285\r\n=CRyL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9IWGpUSahHvyqckKpt41cxFActtHcB0BBavlfyBc2fAiEA62raxawpkDKG7rn/xi60JN51FF/IG5fbVkIXbdZf5E0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.6_1588681434085_0.7356375767918564"},"_hasShrinkwrap":false},"2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"49642b089de9b2bbfff1be8c060e242f01a125a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YqCpaEwn+oLVgsqqw1+9cub/t6geSMq22Djccx4O/DXvJQgj+ifznkOiU+voatGGQfPFbMBiDAaSPu7DNRV1Sw==","shasum":"4532cddf578049a5342fbac285e0045eb39f2c27","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0.tgz","fileCount":33,"unpackedSize":136154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesVsFCRA9TVsSAnZWagAAY+sP/jA+2x/ReXoEHlZ+y4VH\nSlKaA/gtbJsx1XCA8lebrnpxsg/xyr/MjF6lPBHX41hbFoxaERfi33i9tMpb\ngKF7uK8aN4FzLExZ2MfpDKfBQ0XaleHrjDUlTJaaoTLTfj+DpDLY40yKEq3t\n16VdMwPWU5gcuNUJxMr8at5pUQqxiuCbvTxReNaux1hkk4lJ1tcjc9xDrnLg\n0wvXVPgWQjGoffoIOWfK4+oA6uXDRmOdR55whc2S8HMYpGrtCIaOCNr6PdTH\n8mbmyep9Er/cRed0Pt7rOp6abBH1C6V/IBKIv2pHGMSxIFwK9b2H/AbnlnCM\nMMU54WpeFoMJYQm/g07QW1jQ6l+WxG10oQYG46wKUlA6DKiXBURnLTT3DCIA\nlhvS2vE6myo9yYB43zA2ZxWWLuCTaOn7ooQ7K/XmGdWKQkDFAmwDhzaqyl59\nsmfFxsemd9eukTL6YAf3j+VWgDybZLcC7c8zczF7/jn3FfA/Zlockey7iR7E\n6MaewN7IXeRQPxvjDQfpSo2rjpK0RsyCGGnlXSpy4T/g9vw9dFkfHit8pHv6\nQP0KuNIvbPsyrh3xr0FkJNfNDBUQ6NipgYnMs+uGxrd73G4shToSeBZph/4c\nAKBiTqhGiconhsTZUrAGVdHs2exhFeq1zTEeuSzOzhqxCE/W5g8B26NEPi49\nTMgz\r\n=gMnk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGgdjbagvfilgiLNwqeBNRG9+zBqw7fsNtM5fOESS8LAiEA53ODi/Io8DizSTxPr7Mxl1W5fLOE92kpSda5HmXv5V0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0_1588681476462_0.13902011396364755"},"_hasShrinkwrap":false},"2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.23","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0","gitHead":"5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t1NuTqRj1SSnglraewsqNqA81u8DKbLMHvODvSBrsqNb0W0LSMaw/yubmdqufwH2mLy+IrS2naa2pgjL/LIZRw==","shasum":"f5c1083dbf4a4c0fbf37f6935383e3f291466ea6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0.tgz","fileCount":33,"unpackedSize":136154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesVtTCRA9TVsSAnZWagAAaZwP/2Z4kQFEfoHraiOarSY1\nC6V28/Vq40d37MBsujwsSvt+g9it7fMZrbJqu8ORmpm+PKwUVybxKFaYRuD1\npQW9oUxfruGSdUzJlwQHoWtsbX3g87cf6zQsHue3I4Er4sOylkLQqVpDK8z7\nFj5JRagXdj5QMxmkLD7a8BLvEOUfcbj791F7H2tMoLYOAGeEt+Uh7Fqb9btl\n61O2kDIbYjqE8Z4PO/DbohtJ/9LtYRBMCI+Ike8nYra53rHcxTZ2gx1FkfAd\nLqKxAv4rVfSgRMlDaWzYpxUDs/AYq0SDaFNgZWVAYq8drsY2YdavZdwra4Mb\nixbBir5v72zCHUPiX0sdkkAEooMRJbXfvmVHkEDYV3/h9W0cRmlejI6S3xWE\n8Bn5DOnY2QkNCVZFloC6Ia+I9fMLvhWBgPf7dBt2zH7ZT8vYqKFWyF60uTmv\nhzDxNIZUJbgkJOiKUhdFCMDXpj9434U9SamtDQ6N4yD5FKwDPcMjeXIi92G/\nK45UtQ0s937brV/VO8flD7E1RZbT0mS3qm4KOBT/V9W60GVFsKvbFtQ4J8u2\nQZULIetIlRL16Ly1IIyPLyyMOErfJnxT1Z+6HgCyAMS13KqoBA2d0oyuntGC\nIof5+1rD/6K3z+OZFfcuFgxA6IYju7CtojglYykhHhmewdmni2W2kW+8piZx\ntapY\r\n=K8Sy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDNUq3n/PiYKi3NqWDWCFgBZy4r33MXD2w/ABBVO/dfTAiEAxy28gUDajkbsK0jT2JtaJTBFAxJJC04wc0ugf0bYGV4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0_1588681555376_0.3416181510950951"},"_hasShrinkwrap":false},"2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.24","@types/jest":"^25.2.1","@types/node":"^13.13.4","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0","gitHead":"e801c04a3862f4df9c16841b5041ce90a8384b43","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DnXtnGZffndDdsPXEBs/L/lbrKM5nqgrX0kQIR9T/GDYHG/GoWJRqkBd0gwPeZln/Zo6Mz4+HUIQo9H1MzgoTQ==","shasum":"1fec36ba849a746f424266b41cb9dc8c81c47f17","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0.tgz","fileCount":33,"unpackedSize":136154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesXDvCRA9TVsSAnZWagAAHGQP/3QKuEeXvVzi2rWEopDq\nvZxO7W40zQJocJMNm5OWq3hjHExKaNutwG1J/byOvaBQqMyZKOrjpfj5cLWw\n4vEM/ubbduCjFhlrBKRIAJsCqBoS3LL0/JSigQ+tk0KeUQNdYRmnpVG9FQeS\n3wQW0b+yZtccA00prX/Pxb4Ohjqk97GqNVZObqVIN2UWZD5cWXSVe82PhEGH\nQxHQ9Xb3ENhm0Yoo8YdxQplbOLrQ071Nbf3oDWdccHSdboDOMNNhKHhActd+\nOWtV7znGVPSOoYNaosU3ZPTvrnrWj2+z1cpVXfKXun9X6bVQNcmajqJ0IM8j\nV9Q0stsdl+tA2Ps40mxnpZ1r6/E1Lm/49nX2VNJNwcRiCZnwBEyJs5gfx7sK\ni0BZzPaVmHXJeLiH7QYdKCJsFpGX19CKlVKIgTSd2Als4Ock+sxdikD9IYg8\nAovzOhyWp3d0TRak7oabPorCJhRN8xUjlVNBN3HFsMERYjuYgKLyJSKO3MDJ\n3T56UInEQKREe/xZIjsBdKHfoTCXi+Q9h0lf4sQrnkB6KBgkdzAMAmXUIMjT\nd7XEHljtR+VDlfCRBa2OzrKl1Wc0SE4+dUQ3uphIdHbs3kXpseSpT2MHoy/w\n/QODwscqLz095Y0WtX8Ji2qbGX9O39fI5G/eEANwDOEFs1spbnGnSkuHDmyc\njh5P\r\n=HFP6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMAm1CGrQXbzWpBs0/mwl6bZIlsdUdxYLPyb54Pp85KgIhAO5PoKyH9yQi43MHLVUeOqbsmCDlvdxwIg1XqNwpm2AP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0_1588687086804_0.7678613642484806"},"_hasShrinkwrap":false},"2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0","gitHead":"5898f14f1b2e74df008716fbb69dd40c3aa6429d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GXjgd0UnOM/fmEciOVrAjv+JBSYgg+U50rTSNbzv8quM325RhspK7pU6CNWc0OmnDj/1RIsf4bU1k11wNMpqaw==","shasum":"78305899a65daef48158d4422b44963b08fdc4ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0.tgz","fileCount":33,"unpackedSize":136154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesbpzCRA9TVsSAnZWagAAgu8P/0YNzhD8UcxEXK/G0onz\nswVamYox6IXoYhXEeFZRYcbF3w2TXkaK7g51yxUTfKSa71j391YW+G3YLbHz\nANuha0m3OuCfXQFAOO1+vU11NSErG2G5e4SpifRW8PUqVzt+hPGom+QiiN/6\nOp5kQi/nGrR5B+mRTvUPNkeZ48gPNbs+q5O6TxIANVGaogHUZ0ILoDiJUbcf\nM/lFQy5Bhf3qBYd7MWl2Z5T8AYR/+YyWnUUj0jYo7FyeNSF2Fw7oxmx5WFxC\nTpTgHNJXKNOFca2T0Q5UGwraT5AwMWHZOKQnl7gATbG+loOxiZDeWPyqe9LK\n7kq9wIOw9Z4QEtCUsuDhnvAk26Y/L9croOgwMQxrMi/befhoUZJvN8Egfgm8\nrQtrT53/EXKZWIO3qcX82K2A42JwMc+zDzxh6aP9RewU4pyostLFQBXP928m\nOaEcbNtcThTwKuVxp2ty2xcR/PcgZ8j6F+SpRnVuHJBEnSqBXhycBRbf/ynO\nlNofHWJrWyToRKpHf47sqza7UnYMYU8+ZMlh0jssPHnlmWEFlkdLq77HegFQ\nZynvqCV1ZwAiHu2UBYPJGqvtu5wRC6M+5pKBwOmHo052wUAxpo+ErLmnkqE0\nboyP0Sreayt5QXjwEcheNLPiQpjoLl1m8rQ4HeAwApM/MQPhLg5FrSnVwVsf\nKUac\r\n=41UT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlZHwS75UyS1L0mB0VutVshC4gMAYh4TihZjkqje0qBAiAwtLAdwbM8gxLnkqXvuOXNDXOEnLLvUkNlhRj7FkqWTw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0_1588705906596_0.6080730900739311"},"_hasShrinkwrap":false},"2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"64ff60011bfdb68234d6d209016c40a77cf7e7f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7CY9l5i8nBgpLsV/TLjPwhvhxzErI5HW5lfJ8PXogWvdsoqEg/AMbH1OIUCEtkqQnTqJmX3DJUYsZRgwF5NEYw==","shasum":"13fd75be3438fcdae8c7bf2f736d8860e0013c40","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0.tgz","fileCount":33,"unpackedSize":136154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesbrCCRA9TVsSAnZWagAAHVsP/Ri/+gwNwCIedQmTQsna\nu5uCQsUnUAflAbda56AtWjb0fS4dmvj4C3w54u4/4xPMB9bBdhEktwW6vUQ4\ngJTePnQgpDLM8eFoOPYa4GmWCofkRoezJ7DWSL/Mj4SOvjx1TLH0Ndlhd0r4\nDJCVkRyUq7DHYsknKNNEgidZH9QUpizyidDivdXiFv/iqvyX5kIaMOPkCJCm\ndSPvuMf6o7dv7G6hWvWQRARsQPzlUPaLbTZLhlkP7muj2ugpAIwGdWis32am\nKnoPkgLGx8IqboBuhiU3ZwE1azPH09ikHxJB0VgAIeR4DjOtnHCulGDrMW6j\nMRalu8i79imXwHhOGNGGag56ZnYP89fFm/54hBHgxpe8OcB9ahNZ01lV4MyW\n/ARb4VEqgTRZ5AXR9eUBneZXSvSH3MgqKLytpt1ac8Cld6wGeFf7ZhZMVq4h\n3js5rlh3YWf03q1lGbhy5w700PDtWqrbTb1gtl0+2Wq6850tKAjUQZGiyOo0\nmZKnA7WsH+E/KZ1/R1bQ/JwPvNDdt6rydRwhggBIRYdIlx+O3KBBRiiHfpS/\nuCjELoThJ1kZyxiUB6rHUnHjYQLDP/Iran5RVhbUokiongEmoNi1WdzuKOC8\n3gJdmBY5imty/Smip8CZTfSpaAwekOVluTnQYeiVqHHt0L+sqfEQP0rrzdBC\n6Bte\r\n=kqO2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzDKQqWnan226GTa2QMRSw5lMCqGPHgz3bBTjG2lKVAQIgD8HtjUq86yxjSVlBWs0OLyxJAfpzpA5zAUI7l91bCvk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0_1588705985557_0.2824815174677411"},"_hasShrinkwrap":false},"2.1.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.7","gitHead":"3152ebd5da166b0aa6b37a282a82f49e243d66dd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.7","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NOkE+5xfGUhf7xljo4jHRntqlipKEbdVMLzfVgytVToOjU+U2DdrNknWY7mU/xX0eBJSwYSE8GeHDb5x92Icsw==","shasum":"e4677579935c3630d66f0590fb6abdfac40765b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.7.tgz","fileCount":33,"unpackedSize":136392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesbr2CRA9TVsSAnZWagAAQ1MP/2csiFyFFtPZ/6L6O2J0\n9n0oYVqkIks3xIyeFaIXdG2qOZZlDmYcwZQ1Llj+71hFOF5G1deuZ7L0m6kJ\nEzzGnIDpD3r30Hc1H899i6qS9f8a1vwEMe4sci42m0a2guJFwfAx6Q/Bshy+\nxpf5IXx+1I3JGJ3yCYW3S1t9NhINZdqlRlBK4EX+J4kj8eo8G6cMRqj5u3J/\n3gACd/JUICMHsWVjb782+lCAaIzGq+iypiQ2ZEYJBtLlOjvVAzpbmSLqi8u3\nyckVVwNHgvj05Y613k8/0jzZwSApPSmnrl4BUAa2r1ufoMp9QNr18eGO1sT3\nYMahqpKozF1pjeJO4mvAZ+glkR5HlVI3nR0vki0PNliV4jyIQegaphM5YmKX\n4LAerWNg0miRfN0FtJhYujtDxtXx//SjxrC7Z6ZsDISCI0X3OqJ9YdVmF4Sk\nKp9Puiup1DAAXsGKqg8p1MCxgi32Vvbz2rZTL+vSfSa5HCv6xvGuKccygSrn\nqhr8/vdp+W1CwqhIyWjVWAhJ4a91hMWlh/sImWHQsKLpcWrUIa3aL7wEzDiE\n/lPy1RON5pBU0pxRLFDw/NysfBpFzi8lLTR2IjyCYSA7JcfvGL/0kDRg22TL\nCVZjENZjJHVr2zxyhXuuaQtS6H4fDXGr8iRtzDuDVjaYq+JZysf/NCM2hxUp\ntiPE\r\n=zg4B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoe+jnNbNFQlO7AILGX8nQbNiVr53PWls2wSgDTl9ifQIgIN88o9pvxxujWZGldKm+l1nu1BS0i5opKcJ80u4ewkY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.7_1588706038365_0.5348596096731739"},"_hasShrinkwrap":false},"2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3152ebd5da166b0aa6b37a282a82f49e243d66dd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UpJXYH0WBBGFkaP5Q8JdupDc0Qu808wk7BQ49PKhRILnn3+DBNVFKL1F0ro8bkbFrr1ZI39LlcbzC6EHFyvokA==","shasum":"9813cd5c9143caedbd7629449e409695b56eeedc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0.tgz","fileCount":33,"unpackedSize":136435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesbsZCRA9TVsSAnZWagAAjroP/RfYuoBRj8SD2vJUBkzg\nkhW9Dzw0CmRGPhNhm03onr2qIZiK7IEJCYxEfsvB9oiUI91ugVVBWwFrlapA\nE1pSSe+cu+NuVeVl2ZVaCNo+yhOF5cE8YsRBXXvnFvoCv8SpXDMr4UBAZGk+\n8MFJW4Hw0mT8BjF96zWR8UdysY9cUdNtbVV0WEiDAe22qIvrdG0hG9gnYX2u\n1NB1R7qKTbIdwF6pQ2B0VcK5fVonjBRG5jNgGs5L9QQR+B2pTuwYvjECPfqA\npkyQKiC3d88eKPX891Wc9DVsOs+LXMPsbT8LY/LjbF3G+3ixyyA0i30MtZtk\nFdTG+nkw2yunfoYMxecOlPExZ6VcAJUi8Ou+7G+IJpQPnk2huyFtKsFbutpc\n8hO7Ps8g+tKjWQXviSSC4FRIsFCHEO930s5vuE3cDP6l+7kV26idoPvRu9xe\nw3Fvuou98buEV5iXcdPGGBtRylv3s5xN2lE8u98N02DF768G6M6DmmORkFYN\nm3T6adtlv022eKZCe3BE9FYsk9XY/iivD/OCM1xem7Wpa+P+5qTQcDQ+27xE\nCzClUBI4vLO50LVw+pBSit7h0LZe6Pk2QFt7AcHmFwTXgWh2H9qMeXGjQ7Je\nDj/SqkIwViauX/ub2g/wivUoBJbP7V5f2ui5FuFj+XQLozcwTVRD8HXUdRIq\ncEG8\r\n=id7Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCq3rkIxw96VZsY43L/QZORBYf1gnSO06BApr8uzKWwrQIga4yl1x4Z6aKsNkoUFXBan2mMIGFeyzHkai+OxyoKNnk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0_1588706072768_0.04438776042390069"},"_hasShrinkwrap":false},"2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.24","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.57","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0","gitHead":"fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-d6eq5aySEJ1AgWjvpRd4KapXcyyr/uLvkCkLhNC1S1DJtQjQE4SJ9uIJD8Tkehz47qOTJ3oYHGwM0yirR3al0w==","shasum":"e20a73f33c2abef527ce453e9cd57dfb3e9590d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0.tgz","fileCount":33,"unpackedSize":136435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesbtICRA9TVsSAnZWagAAhWIQAJnFtIMvX40O3Jbi915/\nXwM+hz58UB1pL/RRAsO9zgMj8X+pYjkSKxCw67cXpHBMwlOnOLqpAtrJkouP\nDSvvL4cEaVGsinHfX2hVKkc6c3D7+N8kbOCBA1O5dEBNdsGofwOPxTZbGr9q\ni3HsR8A1EsdXYiCCYD+EqATo/R51yy3DTl0gEjsQMfk1a8mVzpODbMyNYg7O\nopHfHMPqmdHj8Sf4+EJST2CTKUowGViuWRQ22jAIQRZ+Y4MSe1NpIR8W/1a2\nunajPjr+iG6XTd3Cm06bjML5/qOE3yNriha/fTcvV8ZB7mJnb+o7PNz2sBrJ\nxmvzNtPlUgkJ7DHKhO1iAqMi4YuM0+n4D/80aYmfCnND7QDe8T3eCBHv8Of6\n5HLzQ6ZzyxXJRisMjG3fAFR+2b8J8kQKTvTemSq1cccWFWhSOhjth+1AnWSz\n/Vr8zQLRzLAPWDoKDtM38X9mQrJIQ24al4Lk2i+JvvcdWRNFKN4sTFLs7xY+\n6+u7BsOlglr00eoxXfv6DlHkNV/IzSrFdf0KbJ3I1ZuDYZabLK4iil1caahz\nMH3qolmZMI37JnXWcSggYpxHsq6atGxg6s8mo3P0kFFH1x7LpGwWRuw3trUs\nFwPG2PBtTE1iOPaWYlB9vZfwnKLmXdwjgbbSF+fwQyicrRsa8k5J55rBrrpA\nSE2d\r\n=EAwo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqWinlAr/iIPPlCHQ0nWzuXfqGnvivMrlbPrMEIq8f+AiAt+21v9nOPJatc5O4PXS8jmFdLlryvMEXPMbGeojY8lg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0_1588706120059_0.46000456693625913"},"_hasShrinkwrap":false},"2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0","gitHead":"13cd163b661de9b186363a3ad72b3f5e97b6caf7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Q+Yj6wE/+EPchwScs1hdXl7wgrjFuit2DiQzgnUVy9bIUmTZ6d5guMof6vlPGkFjDANhrAiSi71s28NPFitw4Q==","shasum":"e75c70b3bff56a38ab5acca3370afb8f77524835","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0.tgz","fileCount":33,"unpackedSize":136435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdMUCRA9TVsSAnZWagAA3tsP/2DTBSwA2HgJElpg+8vo\ntAaygXMpy+KiKx/3gXy1Ypq3f95XedGYaM79vyOZdEs6Z0qAtZESqU+1YHnT\nY88CSltZk3KOgSNIpSEzLtL2unWaAPNl4ZQxwGScTW0SAYEuJqIB1JiK2ckG\nDmVizbr6yc88pLjS0JcVuSWxkWu/6hRavAtZ8U4CaI5cIL5VVo/mmyP8Q8NN\naAQtkD5iQauAdgYgC1gOWrvyvpEeys+KNqoum7MYZYAaYmh4twl1SUp4S/PJ\niNTcHZdpIaSGgLqBt9flhZJEqdNNCkdOdlHLkZNf1d/QtRQr2MnDcqru6PjE\nP5LYlyn3pqF/vVs2dzuCq44QnSVIFyC2vuVUNwrxl40LAOhWN/mdxAu7OzjZ\naW9mvG/KCE3uWewY44LmSSp/b4wLpL8Nspy+wolGQxG1sxRaLz6EnO5q2eNg\nhFW9xsS01FNsPaf0Vd9jFAT9m5yiQOmdzq2wXe/wBdblxf93cSccXtRu8qyN\nCMoM7q1pQx5bde3VsbQxNDEM5zPVxE8C6GSyVzQuptlHeaDDX5JWm6pQyzEO\nTxYf9vZltrdUv0Q/QRUSGE9ZJsU5K/kalJPEeP+nKHvf5BH0xLyIUxpZPrnG\nCwCYlI1EDUEbJ0WR16Qk/t+99wB0/JhFCqIldR80v9UI75rEX0C2bDJNzB23\nlGLu\r\n=nGQB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMblG1HggyPlZTVr66YdD5BpsO5M0TluwFVfbKF6kYDAiEAxa19EeUcRNVKHxUyOLn1XOBD/JN85hOM+/lO1usA7yg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0_1588712211825_0.39088637989945374"},"_hasShrinkwrap":false},"2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f4dadcc4d8bc3f818963571d1b8620e525ae99da","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-L3nxrb8AxGwYeJby8INPim/20Ts7Is7zh1hF4pE5am3lpXEVDMu7assbggpo0+XpJgjB7ZXHsNEDApPQRR244g==","shasum":"cf4fa69e2f415aa51ba2d1960a2bc22e60f4f412","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0.tgz","fileCount":33,"unpackedSize":136435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdNiCRA9TVsSAnZWagAAV6gP/A990Kw8VxxFMsN2Wl86\ngTpokgzNHZDEtbaje6oARoGIhIo8sj/hRgG563dwHMH/3Z8W/gj4u2EtoBpr\nTQjn45vTZoXr2ZkOxRbUAiUeTC3mxy3bRQbU0byJFTA7sjPhR7g9xIQaxU2m\npN7TfDaTvV0CQU39ZcS6DpgUMFSwN4CaCcPgG70xKJ382HL4qOKPO3Kr/4go\nKCKCvi5P4RlmEvb9fWgkjbYdmei6pJQaKPWvUqC2W/d3j5tWHMesmrba5LMA\niEr/IyLZsfTpaHxUFqWY2kVS8UFTQ9fmd6KY+aRXovZFpH5uZkFGpuWgn6Lk\ngb9B3HJWqNaenmTbE887OOLQx9hP5JWSTw6KdxIYuNI9SBBZ97ytR6GnFPTR\n0ryQZ3x7qMZvyehTbfHg4smMiV49meG2YlqMrAOWjvYof1irO4JWX2gavxeD\nz2bGRNw64Jm8Vur+Zb1BrVF0EkQDbrIsOJMWIcATi+iNDSvDJuLnciV3bPsf\nsOZd8g4FBvzIMR1uDvi7ttTtZ5aAFXx0i27nW3wK4w+SR2JqX8KVNGPKyBz9\nKMAO8Gy2xjyj+194g8d5zCO9hPlJwVe0T7Ir3bQIBLdp5/4lxn4v1whewT/k\nqxCeZVYqq5zulnNCXUb/8Qf+EOCbq8dRem9PHKWGr41/vUQuFHaKw9uorxKH\n3COf\r\n=F8fD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICirp8hHDSih9xCWl5uZSex47C6uCAg59oZsJ5DpKVYgAiEAtIHEkJO7nCzR1FoBVU9/6ST9rvXwJd2u4RTRkxZc+7k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0_1588712289620_0.5890419777240559"},"_hasShrinkwrap":false},"2.1.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.8","gitHead":"a22c36ad513270c6c6e21984b7cc7da9523bfde1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.8","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/gkszzVOZH5sBwv4/OWhoo2nF+E+nzmWVl7NlIsYKWjtin6n7N7FwPOpjkI2NgbJcBh/oaQoITBQkAYhdQlLLw==","shasum":"bd4f044948503826ccda190f1f9333926f74814f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.8.tgz","fileCount":33,"unpackedSize":136666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdN4CRA9TVsSAnZWagAAmLgQAILRIoI9ZD0FpBbT2zTV\nhX9LQvwSX7oXRuZZJNyaxI67PgyidfbJoV+QbIqNJkzaIR0jaFFmYnnvWYKi\nAhk0Z/VkxBV8unU7uyeU+UcP41Gk4NBNNqqIYrjUV+PIa8Up43BdEOiskyR7\nR4bz+C3eyyo2JEaMT566mz94AzDRslvlccwONqLA4cDWsjpyEVWHpJAP60Ce\nvBIz8h2ediG3qdJg6ErGZWAUxHBXU+bTzqw7FhpOXEXzlHnI3DxpUelTT4BK\nk0KFzXe+vvW4WCTzlGkk3tg+4fxNNmD5TbxoyWo/fo3rOXtAaX4mmowJbJBN\nwOlEzEJ9eiObgR25bhgB3JZDfNxmYrpfBQRikV/IJUO7rzpUYRkutw3mog+j\niHomcmHqiK3oWV4WwC8QqMsM1pV4ukM1HiE2+XNyWxfPNiFBPQtMGdRbQApd\nnEePEA5ihzSmbpjHHfm0x4/d8VCE84G1T1TQkz2xVzIQrygP0M+Mcbiod3l0\n6tejFjuBQawLP8HNIN9z0pyZcPgJA800Jd/vQtECFctB1dhKDFHWkbKxkLPh\nku3rbcY/8J7gKjjgbFSbIcczn2BZQw7eBcHtiqYHGjj24RDbaAtg6HSBBqSF\nrAd0XYwwBbEkhOCOtdXfCp4k2jVuQ1zZ99GXFTA9XSP4JgDFlIpfIyW1dYhV\nTUUF\r\n=Sk/9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCezXFebGXuxicmKj7EbHm29BM12RDBguL1bhIFNs2DJwIgI+r8XcKmOQmfNC2fbZ6fKHXO+ZXT9vce5GErCh8ZmXk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.8_1588712312200_0.9579803255509665"},"_hasShrinkwrap":false},"2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a22c36ad513270c6c6e21984b7cc7da9523bfde1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-lxwzl6dBMl0VTdml8a5v38iO+AdROMRelIIL6EHrQZaXHNCKaB6dZekqmUCO8DvW46kDrT0ndk+iEb87tCUG7w==","shasum":"bf55b8fc107cefd970cf4d3101ad0f64ed35ffab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0.tgz","fileCount":33,"unpackedSize":136709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdOeCRA9TVsSAnZWagAAnUcP/RcQojqIMu2s8K+ITXNR\nYTQSa1u7TlUcC4K4Dwvt6ne3/zuqcUWv/tYUr8jMURhHJrB1AomVkErnntkC\n9WBrO+MfpdpqmYMZZz8z9qRyF3Pg65unVIKBIx5m1zorNgzuiZ88Xs9Y+PvZ\njbvwCoWyVJOEO+3g61w8XcUFugZoYGewvkc0a0x6JpmBwQp/J96fR6FFzRsI\nufB6r1APZoJ1TDw8vUZZ8Do72LCCYgYfQlFN7JaW+EVl30a5/QHJIIYBNmSm\n+hiLMg2eojoTvc2hEb9LYhxH05rfQyKvM9xTcPd0XAX6WtxCco0duZY9ud1Z\nYnFQZ4A6VBUsgGvW19Yn9A8mdlOKuROfAxPs2s/cVbFT+WsVWL4ZigVsHqVF\nOfFQm6MJv2Uiy5WpMxsQFjB6nEFvXBkp+omCcyDbk1hJGdbtGt5JvJKaAB5n\nG6w4GXWvS2KwCTyN/q3fXy8AA+nw+ZsF5qFlBQmBEc6/qkujkSP7SMWXJy4t\nD8PfU/OB7hlqYBhWV/LRsxNk3x4926Y3mUSIodDS1dRkjcnBI4CGDG/erIrV\n+cqUch3YlC5arvnUi3OT7J9xaxQYxFYZqDql+DKRRDJI2Vx2oBIo8WAjtHp5\n8AjABbRW+gPJEQ/cEZ5Obw26u/Yrcj7Ju8JAmBggDHTRbcUQenRyEPqd/l5/\nomLH\r\n=nclE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1gvolVz0dIIZvvu8szDFd0Penw1QXWSu52Q4i0JCSaAiEAhrrx1eUtQk/z0JHJYcZTPVhZ6T5IXBqfuQHYnJJJoDQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0_1588712349952_0.7147672433385623"},"_hasShrinkwrap":false},"2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.24","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.4.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0","gitHead":"064ad8484f932b3456469cec3e815b067f75e54c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Ho3EEfEMF5nW5EAGwVNTIUMn5S1ilvqen/flxI3IWfIunMvAOH5QL5zV77aJtbUE2uJbkR7ftxowInHHpYU0XQ==","shasum":"5025feefa3f5f837936deb097a13d5102652bd53","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0.tgz","fileCount":33,"unpackedSize":136709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesdPqCRA9TVsSAnZWagAAw9EQAIeGWWXzE4hZjDtX1SJa\npo4gw/rcEaM/j1LjAFMti+f6j1EglzPPxMfDeGqG/7hzRH8y3QT5QzF62Etx\nsnqZms960gHy8VV9YAXGEpDFsF91XzHZ9IcbosDnk/EUmrfnFwUYprBSsV2x\nzEyJY+qqjtjRcj1ttwdPz55rF3P/7wYRcgJtYvaToExx8dPdCSbuVKIALhL4\nH/PFW16YpFLqik5DRyd+k6h5YSKq9xDRZODY4cWLPeCx+SC3n2SuaPiD8r8D\nqN7eOdogzTHxJOBN+EfK8ufzXGEsOj58pbBBnRG4/p7FjnxABR7BCS1YpCBk\ndRmQ9cwJ/CgCTgTvPDNPpAj+d+yMy7alLyI9FPcwGHQH+SJ3sNHgKVU6T5TH\ntmSJP2C5yhxnjXQBqMqRGXNyU50DUElR/9Qa3G4sI8ARNPzdjilpiZK5t6zt\nq/QHLlxHwBCusSqddIe2y33q+3PX5vvWjBi6gMQdsi954LL+GX8pdFszvq8o\n8XPgXAbsouCSer4ucUlL7BGgvEkUDmEHiTTrkTAt9GGTLtTfhVD5xdZ753u5\npcQhfeIllwGx1Eh4bR0UNRK4XCKRXObzSBAAzmBPPfLd+WaeBU64WKAVnWWi\nOQyphXphWYXuRyDFqTpu2oGGuD9hYVPQ7RSdVtCZ6z1qMYNPdob3f2g8N/6f\nyTTa\r\n=SgY2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqWNb0GmLktJJg12Z42Mvo3yeaedMkpfZ1FQckOu+YqwIhAKK61kbYVa7dLQGNuLwp2tVX8nMYEWagOvYaH4KL2aoj"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0_1588712426406_0.4089020978409461"},"_hasShrinkwrap":false},"2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0","gitHead":"e698fc51b7883642ac77c81118eaba57a8522cbd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7B/waq/jv0YZFFk7uQgIaHExxa4f8SBh0C0P0z1/xzfK68VNST29KJqBNrrsBiJ77ZYD9ele+YDp44QSobL7qA==","shasum":"1ca7309241ee9d70524d9ab773834a236dcc1f37","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0.tgz","fileCount":33,"unpackedSize":136709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn2MCRA9TVsSAnZWagAAqJgP/1W8LKl20PVNbdAgd9t8\nfYz0+cd4MszPYa44RoohU565MSxiLFgL0HmFaDaL2XhimaFfA1e18sNznJ3F\ny19NemwyuwmK+5lwl2hrjs+K6Sza1fitg+OT9ukJt/tT4m7u0j65APnu/70w\nbfoMtvHKJijwkh4dhE6SI2syy8xsQTnyAEuiXAiTYAyxyT/k8scyh7KS1K+O\nut0UWpEWNQoBYyAAA0LUnbHpRQkhF8ktDXXYDOn+ma4g+yvjIbCB8WhSrJgN\nkRmNrPDsyUg557Csv4drsFa2IKN0gLL6FMIduXsck3WvP8xTq3MkXF0F/7DT\n8lmmcO3XKTPhpqkaZRWj7FFZIzzszePRLu586TSeoFakOjxo2Sz6RQ1V0KfV\nWjdgiyjGu2joo8LpmlUQi3KorKptCl/FVf72nqpliMurij+Dj8811tos7DTR\nhhWmxrIVsYiILq3pWmh70Iu8szVh7F+8kkhWEjyV60W3RMDxRAde1rJjtZSZ\nEezqE6eiBfXpFoOUlh/8f1hhNOD+LSu5WX7LaY7axdK4dg2HKm0fquYRsX5h\npyqF2TiLYLHQfCT86G/cSzsaxKSd3cW+zUiMNqYEIILavoB6XBuRBfFv03os\nadV7ecF6J63r4dzN6/+BYDj/enigbtSaAUulR9GLwbdE5nMhl8++NJT7GXfX\ncfaS\r\n=MOj+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBuZC2vK/h8fElpRawWlFvZa9VeULpXOo+wN3IZ9JULAiBVnsg00VCQAZXuLLmdnGFIN/DYbE4IT4rLZ6nKbRvhKA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0_1588755851797_0.29764642115734086"},"_hasShrinkwrap":false},"2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"54847b8739f35df085be18b69fc7b4cc271efaeb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NBZXl0GdQkNlszP0mxOwJ8MjOvCHmIpSvv5/fw89jzq4hkEx4zGNOh1h1tHnqXaMep8vHGwW+qOlkxaT2c5U5g==","shasum":"72f3d67ae97e83851f2456a848045efe95fd5c36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0.tgz","fileCount":33,"unpackedSize":136709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn4oCRA9TVsSAnZWagAAl4AP/3wdj6JyfrI7YE6yM2l4\nk0AQjxTky800W0Q4QVgg8lYuxgSuIBALBB3oRQDWexTcPmMMyAg5cJwR6ona\nYKBS0SAK7d1VZ7k9lvORMvgzMtlW60r99ehX7uypV34Sa2gcaOa+ClEQGSQw\nNPagtsWqsPzQHR3ZGrjy2qC7qHgj8z7MdjcmRnfOuYuYjcBAlqrcXKz6FNcB\nisnkV9JsOmydd3910fDjQApQLVT9h7R0NGxJkKqQw91R+XjntS42BjnRalHQ\nayd4zAjFhzm6vx0nS0OYgp/9nYIsa0Fi+T2WpH1kBqO1OMCsWkC/hT5pPWuI\nMYD/ACwJTUYsNVwfU68wTBszROszLISfADWuUfRbnWiST7cK856PaCUOoDd1\nsnBEwLmC7wETwX/QQxMSmzSZWI88O9AhjOogI5NXhc1DR6vhMa7daeMVKS/a\nTpRdsi2McpYjDsloXHpoQFb1V1waG+yieVYZlERXcwG5Dsv6IVjCmZjcUK45\nwzycGJv1Cl9vLAQSU7OXm+4m3Yq3xpwBXRJlAzFBons9Ptpg4vrPjgB2AFXY\ncKVAhCmKoCz0Ynm02ZCLSfYgJPYp8//vfxJywU8bqkYDMM09gAbJzH+ajXy4\n6v5ihb+9WdT1M/okM/tPAymEGv2+w1n8yR7fktMz34UfRqcUwCU1yvjU1uHl\n8wI/\r\n=J57z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR55oZ6izK6KuTPVSAfJmkL7gJQA1lXHrxK/NPtsvxFQIhAOEVKy38PIRrDNr8Zy31tBsJxuhVe/2h0JeQkmzKr/F4"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0_1588756007510_0.0444379655898417"},"_hasShrinkwrap":false},"2.1.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.9","gitHead":"dc33612c23f2648f84436c5fd4e1bcc0de1cb052","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.9","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3WTDmAegeoYLy1p4DalYPyVTE/zsmaVIc8wMkOOyi+GdnPOVkoMbXs5FZ4eDLq2n2EF07hhHMQNZvKK9yCxbNA==","shasum":"99dd76d51e0f96faf35faab15ebcc056f00b3984","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.9.tgz","fileCount":33,"unpackedSize":136941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn46CRA9TVsSAnZWagAAmAgQAKNBpvh4n8NNgNZFDo4C\notYL0cEPwlPcwO1zCAMD8o+hKVlZxuZl+fRIXtBWUvfH9V60y3QL0TybemkE\nLP4gIDExGK0XI+iSYC4US09nxu5U6NntfghlUiYsJkKuozNeMnH6utdsFGqP\no/K3K9fqW1IW53J3thUIAXGunqZvTFIEYJjp3hMB7nM4OU+U5osfjqJmvRbZ\nbrOFHywgnBpsqj3TVopGCS28+vIjoTouHWKL02VpnJRew2O+fmJZY7Zr3H45\nHVCQczPHkC6SAi66lpPinQaJFWZVPuzNO97Go8PIBWIhHuFbOEwVvD0NxrQN\nOPJQP1lq4HUrEbmbZoiutUM9fHa+wf5vHmFtm9/r1UmoidTRFNTkkmuN9cpv\n+USE0293ujG++PEhPB7YqkpEZ5Dno7h15IXeFPdn+SSzJ/e2Se7ATWqQW8SR\nHF6k7MJ7QGZ4ZLCnY9g1oAp2n3oufaBEXxz5tH0FSh+LrTueeRetY9LzDU+c\nmXwSmj1JF7JkwLNXJkV0nEmf5s8KF34/OE3u9Eqkdro34I708UUx+nhaii/t\n9c40axN4f3JKjNa6bM0tSCwrEkA8POTmOH8CF9Qyzm4R5a0gs05WXoGcR/wW\ndsfHUbEN+NoqHDQvB1ZhqNcGOpcgZh+pWdmHp6cSYrZ8O9GY8zTGGZIgsR4L\nD+Pe\r\n=SPc4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGueHG7YUG0ReVZJd5UjaGFzpDf9Inis6Z6AyS+40qmRAiAeoY0W6/avb0m3HxE4DNYKm9ph/h6uvtIdi79+fkC6bA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.9_1588756025629_0.37958081236308816"},"_hasShrinkwrap":false},"2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dc33612c23f2648f84436c5fd4e1bcc0de1cb052","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vjXNQkF4VFVC4hfYJeqFVkSCFzgzUDXMTNxKrN8Nzyu+wcMQxAtuLo7QcpakNGPAAv85OjKkkDANT0agRxmiiw==","shasum":"9fd17d353e383628519f190e1e8d4344d8cf6fff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0.tgz","fileCount":33,"unpackedSize":136985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn5cCRA9TVsSAnZWagAAmJcP/1Kpi5dXH/eyWe6CiAtM\ngASSLgCRwPmIZN7elsOJrPp8yauf4eXl5gh6249te8SHT533xNJcNZC5H/gE\nXxS+jgnTEsYf/O69MdtUFwj0AldB9nqmft9vC/1Q24r1/2yxhDA2EgZsMkAy\na1hHr2WDCMwJB+fLeDofxKQxOVQ9rMsv0qQkr6LZeoyYk3eycKYMALXy9yVK\nUWo0CLUN6zpTSjKkhVpBt8iKXZGxiVRpviCdWASt+CI8eeFf1eLMkITK19Xf\nyQ3WeflOpQndjsFx4NDhRpnUo1pnayaIAgndYmSUH2jUuBqux4et37xdAL+/\n6qU2Z8w5IkOGGcSYwS0s6ob3mAMqi8lEAeSmG096Ky+NgmfQ6ZnMl7GokSj4\nJRp8mvMN47EtiKTl6XtT+h8xferdb5+QmvocIJ1VjvV7Kgpkqo8mveUG31fF\nrAubmTqSU5EY5GMdcwmTWPOCxs8GqqNaaY2ctCILFzr8NWuyjV1XVi03ZoYT\nwv+GVGyC3rPukInwxCo4YCuGbOeM/j4+wK4J690vr+0y23pzwk5WUvaOY2ye\nL45HYc3Dl1zR5fnRzPjtcL24CZCuR1IO5u6t0VmABpqQqO8nUe/4pnGFKakA\nG6qD2ndHdl+YjL2/QFihGi6Lnd1gHRHtml3Fam8SwoFjDcTJIet/gFxaLhWA\n5nNO\r\n=zCsh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCjlauytYG8RribZZ/vH1B7YX6D4JIckv1THtd/O1sYQIgYZIgeDfs3SwYZWrqssTMo/9a1lyrnWNpDAsCBYiBArU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0_1588756059454_0.5202064844213874"},"_hasShrinkwrap":false},"2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.24","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0","gitHead":"a7f163dd06580b4e0dac4c1adecc821e6451e1da","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SBoW6fI04LaXS/uCSREeAV5/ZJactkfcN+M5bahbhSxDwXDvGobfdmpAL5PVwwvsgGYhdavqn6eQa7+UVCMuBw==","shasum":"d830c1840f309cde06d6a79dec58b153764e3680","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0.tgz","fileCount":33,"unpackedSize":136985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesn6cCRA9TVsSAnZWagAAq74P/1vJoI+X2OLl2O9kWw3e\nTcGsWRGiDaXUh3qKvJRCJZpPWv5Nppqk2PF7RCWGjxaqAmrm3PNNWgE8cqRY\nIvNJxwAcd0R3FZ8+dkAme2Iu9+iN89r6Owu5v7YWiiWYomHZ1SKntFLBrG1V\nHEYEHGXjUtT8A9M72ndVhrK1g6s8uiQ8dTEqPooiBrzk6fmVqEogtK2YOFrA\njByCi/ICInoA8JhBR4MMUk/k5TxUEDZnTKF/5309iivuTmi1uwjrGlcCIl82\nCEY4qxq80vsNKcNHkGgVMZJC31klxAKRAycG7l9pfSNO+tEWLFjsDli6mxhs\n7YVMce5DRY+Smroprkz4QwAVkwhLthejRQSKton5M8xiWp5y5jonMzPx96R3\nlUMJlnLlH0VWQFM+DA/r45EjWdH+75t9B24SZ7aCzPq+Vkb8v+kFfIS4xenR\nJCs4VoYVNv9pX19+vDfJkol0uw1E/8ZPcLvUjvgZxibhzDpWF/tMYWRzCuTW\n364ugDEHIAAxUbUksJtl7BDaKV9U5b5AVNgshcvlMN6jWRwrDQHLL90Yt5WD\n8lj6HCanhwnyqP7owuOIVz8FCsNGoQ/BvKVACxPHkL9W0egCBaBZx20tFmhB\nehScUqzMkL1sHkZD+W7HqIPcUmNKm8C5hxJTSmmvZKEQkoFEFDBEjmM0weUh\n2zOl\r\n=ktvQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNyX6kzVYKyLrEx/13c+YQbH7neXsfZAjgmDvmPsEKPQIhAMST0Qwpzi5G0RBKgcnXIDoVVUOqIPPu11WYO78SLICu"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0_1588756123640_0.06223913405456161"},"_hasShrinkwrap":false},"2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.25","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.58","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0","gitHead":"9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Ce3L7NX+xpyoCTo3UOOl/z7s6d4THLxI+lR2kMakkGYjMaHCUqHlzoE/RDiUgvlIC+UiBuKD0A32bgUp7X97GQ==","shasum":"34bdc6a98e2a37f726fdf220fe985d2ff12b6211","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0.tgz","fileCount":33,"unpackedSize":136985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesrrGCRA9TVsSAnZWagAAGS4P/1Flco3jnRs+i5m9PXEh\nbKtpPRcY5KArCq8IgZMMOG8sqykNR1pz+6JCf3s4I0jArTdOPmyPepgBfrfu\nohdbUltvG1VZdqVo5hKhGPauIBytNLicr2XWnHxPueOMSQFqUC8WVait+hCV\nbZAnfqCy4L0xE/dlvjct00x1fTxeNI2mDbHEqJxXLwiWjXpDwzOhq3jpcm0g\nY0sZVxM/sCx7moRQWTEsIkdkTOwXowLwtnRs2dGxwJfPkiYp1/vmmCW1Q2fj\n8sB039dsGs8fnyp4Vt+ICOauBWy73upHByHVWerAbfyiBFKz0cOY0KgkH1Xm\nDkjZd1/w095xndmFQauUjhOp0PFq93zNSH4KsgPRoY/mAvVT0doFzx3vG9A2\nDvlcbsL1O/4M07R1bz8gEK+vYjSTyks+jQv9TmCG0aU7BeqV1e6hZ+umxP5f\nqItn3cqlHOyFhelGa4q6dxa0w8EsWb1OFYjmrs92C28UjXR1JaELnFPuFtrx\nJR+4qEqZvuCiz9Uap5FH2RojPvbWKjnJFdLhqdLr/JsDn+zOsUAqDnWvUoPJ\nSe9iasIvhypO0LkcYaWIaeKuf6XuAOV8lp6b5tK9vzXEn81bbJfCb7iNUhvz\nycxNnBLzjV6qe1wLbdVYmOI/fwQLkfr9eHIuirvg27iIF0/C6vi/vhwl45cO\nrLqO\r\n=OC7k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBpaiWjpM1Mn4NyDi28oj+upnnufICa3TE/XYoIWF+WWAiAR7CBbmxU0zqSglhK7mW+4AOcsuVDjnPvznCrYi3D8Zw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0_1588771525512_0.6925091043532503"},"_hasShrinkwrap":false},"2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.59","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0","gitHead":"d3945ea6a9462f9a021e90a3f804afb971f3388f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2pgstKqbAsDB0wg/jyWuMPHiw9c9qz6Pb7+r9pUJo4tQLaOilOOrnNF0ZC3JemUjSieFBQEJI5O/DDHSyu0y1g==","shasum":"acb7576ac242774f635e0891f7ca6e73969179aa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0.tgz","fileCount":33,"unpackedSize":136985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJestYUCRA9TVsSAnZWagAAitcP/0lexQIDytuXEe0luy36\nnLOZF7UfUvWUZBSIOhHcrnShOHQIv15EbB7cp7kUikG8VPPQ6cUj9arXElMe\nOQNWgkNu1l3ZNWGykkg4oCaI64l/XKzhDmWbzDGEB1yOykh/34RWKjhsI7Wo\n1D+Gc1AD6REm8GXkLL4RgaemTuetM/Rhe76arLNB/9Jy9/oMZeF2TDMp1jf+\nFnzeyrFkOWuH7XfmBNi0TZIA0LT4gz2YUfAq8toLyHUmR5TTx7VvteLhkstO\nJOLoJztZwRRce0v/SQznRLcvh2LsKDji7Bxrx0hS0kr3N6p7VOm7BArcuTXq\n8XPWdTDyHEnQMpBYMxYWR17Ft8PMpYXQ7De/MjyGHHwQuPriqbLhpIXfZdtg\nMxjCn8Mc9ASGGWwPpT6+4ytSZkOpgXpk0q1aJYjWQ8r+HE3J4WSysRvl3jIj\n9Qd/p6mOnOyvxZzZiuX56tXXssZkayM5rrZ4zE6FQt33VlyJd664AextY6hx\nmpdr+jyj0CDL2S8FPOnXPlWLhbGXuuJDgrembC3/50MdUIIF9H6pvxq/FVlN\n5JWCTOgncIloM1zPKJV+hPzMLrKV13IOZq4tO3quPhr1VD2LvowfhCD99kkS\nnGC/2Ei77ZG3x16E99AZ0T9/32+zK3l8FrKc+dKFnnzEI3a7cZj+f8QxVTB7\nSuy5\r\n=A7jo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRo1x5h3xCDc6cligrMh83sy8IuZnMfgf1xljM9rQRjAiEA/JMt+1JJsvaSQObbQjmgma/CPiTS+JfS8mSpCaKMfsY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0_1588778516247_0.24396594540596284"},"_hasShrinkwrap":false},"2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.59","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9733326839d315c20bc6bcfd25325944d7c832c9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HGesc2s6Bfc/1mexnnYBQl9BSKNJhNoo4AvkgcfrJL3O5UgSzEtc1yGw9PQpmHPh6aCGKU1/kETKYOde1bq1bg==","shasum":"66ede288391f3169582035aacb3d32a09e80ca12","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0.tgz","fileCount":33,"unpackedSize":136985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJestZoCRA9TVsSAnZWagAAMNoP/2op5iRpUunsVwp6sq4z\nXKhsOGrmzt5ocTnClxfsWd2Z0pHfGohbKNicCd1BJ7mxU83SF+lmuQ3BeKQk\nwJURxOyvvOH+rFNyzWVLkJi2JTI3dlicefR5+tu715+tjvkeMKkWDH2ex4nb\nbhNEnDF41rY1Gv37vPsS4yJSR6JzjsMuX7Pu3qmivdIwRdurFRRHskvMDUmR\n/jqse+sR74hUPK1QqGeDja3LwURceije+VgcivihNG5itabHwfN/ZZIH2BkC\n7oZbH4jXeuNoRgsqTKPifGDRtI+vLEphs45PSxKPtjL659omU/J2k8l66tbD\nmsBd/0Ee5m8sOUvNI/iWWk8kCrA8uB8PUnPbAx2BxlAIBBYmgN0gocTcZOSp\nVVaawKcRo0mXjSA/TV5QOLL7+WY+kMrcKeGWVuROLEakCmwZ4aL7RrfwUYMh\nCPR9BbDgiAwumE21G49oTFe5NF3QWSrQD/2cyIKgYxNCo0PGKrmt/SjRhbiy\nlYKKNknAd9Ck5oOml6JMFSUS0xs13TQw5ELf5J2g3eeEQ9fxO+9VYLQujH78\npeTjCyR9Zf93B1R1cRfKf+9C9FqL9V4iiC52uQD/mgVJmeYcUhOnWUGFfUPe\n69sNWcan0Xqkn0itQmrIRopyUDI5yn8vcAE+JklCBzVZqxX79UZxnBbXu0Be\na6UC\r\n=0+2z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUUt+KSYZ2B/mqzpboz5m1gSN7hwXALmzFf6ug/+ZArAiEArSupATvjVWvReSXjKXT9T7XUyscbU3XQuq7vlDfeNMU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0_1588778599695_0.979544322027921"},"_hasShrinkwrap":false},"2.1.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.59","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.10","gitHead":"388e86f779f1d18c8db05f8809d77d5deefcf409","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.10","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+/VXNuTBeJ0YD8+KkcZtkKLbTYZZj11Mzjom0uipSCnSD/yim8m+J9KpVlalCVkSvMzqh4n0DGT8Yj2JEJzPaA==","shasum":"eeb9f26f475fbfe87f4b9b7f3bfa112e6762d671","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.10.tgz","fileCount":33,"unpackedSize":137218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJestZ5CRA9TVsSAnZWagAAfOEP/jGVb8i3xemPN6A1K7oM\nIlo7Jr05VTm+3TqZsPWZYgEUL3+67Nd4vFwV044qQw9xEm4JuissdsoMytVz\nUh5vAok6uBRXAmKVVkZXlKLIZ6XzBSiVyelGXQZHLMC760GQ21oD1w4FsIO3\nI9GbjCk5x9Prw+jL7pmCbqKWx7Vv1Klz0SBqrAWI4KrXuHviIjS7etmmnwjw\n5d7P9wdOaPg5edGYwvhG4bfnS3lGzvuNiiDZEhdn1krKykp+vBw8SN9+9dNK\n1lOZS+oT6ctEGPeW5C+AmeCZ/M9/eBS48brlUVqcjxo7FZkq52dgQ0nSgBe1\n7329k+29NaIKRF5PPzzXoBgCA+bOopecPEsvQOlVqUUJ/aBtz4XaH666prS7\n8aSiBi2bZDMSnO76NvUGV9DR0+J+2luQ5VFQ24Ctz8aJqosHjH1QA2x7E0cN\nRJETttR7Tg1hZrjQs3SiyCXneW+CEuhVUXUmFeBqgTpJ0cQlU+5zHg1kS3KP\ns74okzZDmTsb64RoCz9VZlP4Ue973j8p/4EaMIOgI68iocUBl2dOVcyAVKin\nFEv/mUSbNVnCa0zZjkUO0tEOQtahdvqHPNkeywnmGYplbw2SbAcBsoKBei5W\nwDLivpFYh+PuYjIEECkunfwQsS8VPU0G9wRDIlxtE+FfqGQg6UvUh6y09Lc4\n+e8j\r\n=ybCm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuewPES0d1g9GCrU/NAc1j7IW90wFyPXEHOd76edezYAIgMErd/zjp3fJV9YuBv9Ci7f00a6AnMP2ejtSGKQhQHkM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.10_1588778616487_0.9043544221023001"},"_hasShrinkwrap":false},"2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.59","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"388e86f779f1d18c8db05f8809d77d5deefcf409","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Gdi7j2Tzee98W/9Xqg/SvIYMraWZNoRCFKfz3Q8DCZB1DUg5cadyij3Ji/cZOumTQ+6okn2UjzOj2i/FZlxltQ==","shasum":"a8a6fd21dd47fa046d46eab1020d63a149886859","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0.tgz","fileCount":33,"unpackedSize":137261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJestacCRA9TVsSAnZWagAAkNQQAJgn2ncPTF3MFpr3WFom\ntH912GaeItI2jGvyohuYclCeZyj5I5WyC6T0kRA07I2P57rOwujWyLvJspxp\nedQgJa1Qv7n5ZWKGGf7Gfjeq5n/yGny+6cgTwQwZQPkPrYuhvznw76X6OGI1\npLujFHkY+BVqEszpcc5arkcIQs0lPpB32aHd33AijQcZnFLiPZ9V/Wr7kDI5\npdL/ujgaqIyqyL1VTvM/zOb0DzRWtZGPn36fIyOWovQuB+Tu34O61j5Ho8Oj\n08sJcY/121YCEMCeUT1C+3K/RBtTOnqrSKqmHyKo/CUagW9A+3aycLAtOWtZ\nXOg2vEloXv0gM6zeGOq1mkZM7X3IUXYu1g3g5bZe9diVWrqB0brSXeDp/BNM\nw4f76rR8gpf+uvH0VbGfSTvC53QG80Ai181RIUdL8gdJy+IpTX8n4VPSaQfV\nrb7Us2M8bP53Kk5sh7kdHjC608MOEagC5mNlix/VmmTvtUMgMNCQW9A5AcPH\nddgxwrdJqakrMWg9VkrGT/Illu4kPlZXLn1M0fQIV83ASq4KdRPfzIR31IaV\nmiRORjFyfxeW8z7JK8elx9vqZTY0lNHQMX7zraYViqLzRkpszkL77/52jWjN\n7JEF02gU0keVD6dBuj66Yj5kcFXVYm87KQOHnHCq4t3e6bbtd49hnVoooVXb\nVkL5\r\n=kAnM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE69vbaTocwtnBZw9d8kc8H9A7eufOkVfj9z8oe8cTztAiEAruH+PXZ9UAySwxOMOp5h4IuasoVMwCeGVQ/uPeZUTgY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0_1588778651365_0.23219082982392303"},"_hasShrinkwrap":false},"2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.25","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.59","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0","gitHead":"8217a8ab7646de86fffa7c95129dd74ae02179de","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-q9DCZxedlI6dq35j0N9kfBOd0eKP93KTUdg5DQxWYWM0DNCHa1nE9ueQlmyqIl7NtgdDj07OcQnhs5dVzQNc1A==","shasum":"62a920c126f06f912cd707f631c72583c10ad74e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0.tgz","fileCount":33,"unpackedSize":137261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJestbpCRA9TVsSAnZWagAA9EEQAI+KPT+0sm/YAJxQKZ0a\nuGktiPde8wVy35OmQqpP6dNtj5eLqnfI2ONOWnhWFs1d4XxaSKbf3u2Jy6sn\n1iWMY/0Elo50RokWnf32EqhQZr/PjCjP4TXh1j4ZSSLegDe1rubIFf8sBt3C\nIo9ljmW0By6ZKXFvxwv9Z4/ejJdlinLMpAd3erPdYCtbhSdHavLbum/GDa2v\nXPutxAxPdwIoxzlY6TNhJ+IxX5xdSJzzZjKXLZeZTP55EfTEWFbLSzaNETgz\nVYze6yAGAatkP2N3sCvHK+SdF/lD1gKl4Sdiy1iioN1nQjN2WnQdusnU/PXM\ntVrT1f6MkI2pU4ysfKDQ+38sTJIqNFbTndu8qRTamTJwl8owVmleSWoIrXd3\nGS93/s3qLZFLuQZmuWp2p+tTVnQ8H4JLz5Sc7GxDPWNMtHaWxLIx2nuJ6bni\nUWu2yih6A3mLixrTFO81q8oJNxzxSAFTJfaLOCrVOEggaxXXllN5UD4XDNys\nRDOAEB+0EQN7W94PSEyxztL50gcP8bJY7G3tozqTBq2t26RFkyy99GiVqEdI\nFe8++fI0+3rD+TPdJ/pqmoAa/ZidSEfG68l4PxiUzLLElLVccavypgxkQp+C\npiH511Ecea0qu4wkDqudM2OOTq7j9wvvYTN72PPmifNd3aktA2QhrPgisqjG\nElw8\r\n=HU19\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpNJdy9jlK+IUrCHOlIAQpcUw45CT8YxV/fLT6bx3+oAiAk6LKYPWDbviFHEYn4a303kKupy0akmJVM29CtxDv0dg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0_1588778728965_0.016736080434906153"},"_hasShrinkwrap":false},"2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.60","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0","gitHead":"86aa3584a71166eb9299150c9dd2a46ba0897e59","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-muDm21Xt5dPOkpr+L87yDMqmlTD8Sz1wPYyL8VquGphOpIVRkDbqaMDM15nhASmBJlnqMgIJDw1v2Nf6JzVgEA==","shasum":"611723ced72248762967e8a073fe30f8da5cad45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0.tgz","fileCount":33,"unpackedSize":137261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesy4GCRA9TVsSAnZWagAAHC0P/3kk2aJ0j2M9Gcv/9E9F\nUgNIJHX5da7luGbi6wmbfUv+lANPn8j2eJwW1+JtDAppuP26XOiK6ipZ1S9I\nPL3DGAgSahTL/8EcOf/bxRdNjCpK9Visb8rDPw+QLazidjD9nD4LYSkPDEcG\nclxtFxHxCmUTfv2aK2M+6wyYhHbhZmBOOkTuzx/rDmVMmoXj+vBP6H9GAk4J\naaUGJplz33GchVq5UdASlr6ssFKCshH6d+j137gjHkPOURn/ugPMYK13tdre\nA61CmH42P0Ciu9AYmxFzS3SZdZFxnA+E3kNM+ltT/ePucOGzu8PYpl0ZchrO\nqmurLBaQ/6JgVko7vpa73rNqFjanPwbwM51NMjFxx029b9xkJHiwDNV0J+SD\nB8TcnkcS1ls6lAUmYOeVC3mYyNaTl1UEkXAh9K/wXG6j22quY9qpt7InaSRS\nt6pyJlWQ2iEdSxMFPCvo3aOJ1e+dOoh1C6mClL1+TwkH+gsf5yErlOBA0NrA\nX/Js3SNjVzAqvzGB5gXZtBdQaM/Ap9i4OUlGh49QSKyYRa2Tta+JP/S3b7IT\nvp9JsYdheZHHWjO/uzNFx3bDQ/cFxheWFEdRmCZTp6qEIzJgbNxuaL0v5LQj\nrNONJwCMxvjKP0sSicUJNsrtQcWy/MLPXjU0EThmwOAfUirlgbl/E/k9d+XR\nFgB+\r\n=UN9N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrcYzrePM32d6ro4uuTHP7Ln8MffrwUoUlBPPGFqO+YgIhALAVRnuBtptPa5skWYoj8GKIdrEiOETJ/F8+bEl98RQF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0_1588801030077_0.35710043595213947"},"_hasShrinkwrap":false},"2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.60","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5de1c79c51b236443842d04d2d1dbc40d4d3ad2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qBezdfxD5kxXhkanvUvPJTsYzk9bNU7ZabjgbREjXi1PBMgXix5e5YS2leMP59PHwu2papRXm3nh7ouYTanYog==","shasum":"732ae3de17fb3a1df753988219fb6a07fd02cb85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0.tgz","fileCount":33,"unpackedSize":137261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesy5bCRA9TVsSAnZWagAAl9cP/RlbyletFKTsKNioM7Eq\nCc9ujevi3yLB1kOiHfEBy+Y6gqByLRcOwqYY69GsUAsEStIKP1mD4bJfsvyB\nhSRTPjXITcZa8KZ328i3p2YaPHy+J3GRAN1f1H00+N5E54MsYLg1HjoBJk52\nxrR8zv+p+gP73Z9V1/kjmT8ZKYKSEikP61ud5oh/aHGly/+pdJYx2FWCvw1j\ni91IDO36choZ7FeCwGyfCrrbqPb6k/QxxtvnE5DKiZx+9vFs/oF0V2DLc+GG\nnJ/rbL7o5S2F14xtV/gJWCJf0bgLKYCvnIV74Np8K8WOntdrJjo3rXbfUZIo\nxb/C+fMFU+MG5Q2fhuXrb6ueFs/qT9XMTB6+tZwmP1qh7QbochRUOOSrPbK0\n24h7kmnGcAD2optlcwigkc/fkDqUpytTVfZS1ExGPO3fjx99fs5zopTgvanC\n3sTwbyNsuYWNDvxMziWVCHCQVLX4DRfrEHqwnkLezsbzGyZk6F4eLTQCZfbo\nBrHaWWp0d4AycXtVOZgUvVnOpw6Kci10Zd6z0UuJLnTV9+j60grRZJmgb3Qy\n1cqJxI133q8xR4GoPVfRAFIcO3QqPqn4VT8CsqLIfvqtkyw1KF6AI4GN06te\nBxLX5vBuYKafMmJCS4ifI2x7IsJAn4sbWEQMEAszF1aGA6r3CZkMESVnpnGP\nApB8\r\n=rXR2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPhwrybq7Mt8ySfPi4nBtFRqPAniUzT9tnPjvwDYNDPAIhAIiTWyBE1q9tGtH6fxRSIOg35mEbRjDo4ZahCc5ECkOF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0_1588801115142_0.6693127699219164"},"_hasShrinkwrap":false},"2.1.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.60","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.11","gitHead":"ced28a5e1af292e1594b9faa25ebddd8db846f26","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.11","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LhcOkuvbxBjBXx+UJXMTLFL2YjfGTy+NoHc2NYI6bbKoBv+od1FdHF03RwqALmTMQNBbz4295CFLvyfbJr/sqw==","shasum":"cb2c864700ebc619c09e27f6943fda2dbe4ff614","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.11.tgz","fileCount":33,"unpackedSize":137495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesy5rCRA9TVsSAnZWagAA/Q4QAJqAamJOX9frJkURmhYT\nIWYWdSm+9VDZ0XPZNs7QrSnUyt+jdHj5x8+9EZTveBiPWuP3WEh25V2NiTrW\nxVuEP6IHwyGKP6w/Z4JY8UdlF2Onb/HYMGVMn8Uon5wvzh+Oyx4c6YOMc2Vj\ndTDLwBgcRHAXqC4/nMykQhOy4wqXjH8GPrrbRTV0Hi2qcbN1KOTMxTRL9eFc\nbbaDJ7VNpalcJCjYgJjdB05bxu3Pyua4hdUDJMr1SLIDjMjuOqenZoPWj71G\n3QnJJMx0lvWtmCqni3v7Sai2+fplZLCmCu/uoFW2NwA1yVUK+x7l/vodLeqD\nPS+OMBNhrxV0kQdxBig+CNvM3kfmQHEegLEfrGf2CnlimJy1hBgwcPjyD632\nO/C/cA7rsgJhC7f8OXqUQE6g0DAA9vIQ2a/kcscZ01GmpF6UfZmW43S52cFx\nyFJ/zepsbSo5HVJE9Yktx3YMR4xUTv05LtXn66ctVkZfTgI2TvkexstEm0Ng\nOjI7Eq/qEdW/LV7F0dSXxsVsy65/aGUe7WdD/RUM6hgeUCVJYlsw+VraTLq3\nsU2nBrZa6TjlvL3np77RMBeHoXznUesPuBP/Nt/UfEUw/qdwxwG2Qse8eNu1\nncl4tjFy64llgdY5bwyW5lyNhwLSU8rY4dvLOLcFv90S4QWJ+1mylSPizsCA\nUuSf\r\n=bgy4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZfU5AYSxU4JKsmBSwuthgMjQa33AVq4FvQZJKDQBodQIgUKBQPiYOk6sEcC74n9Os9A6QXIY3RBXgHTM9H4SsYqc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.11_1588801130699_0.5890959835531946"},"_hasShrinkwrap":false},"2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.60","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ced28a5e1af292e1594b9faa25ebddd8db846f26","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-oeopf/uR21r1vo8aSdqUuppqXSSHLsDnFU9aI/1Gh/bkOViyYLaeJq1fscRoCVDkgAPNTWmD0JMUxJP0PqK6nA==","shasum":"46416fcf46364d72a6b83eea34bb0bd32aed155b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0.tgz","fileCount":33,"unpackedSize":137538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesy6LCRA9TVsSAnZWagAAITMP/iwpdluQ7vbiD9GOzNgv\nwQ3hru4+KaAL7llWBrCATL5wc0jY1dvbPGUIIVtyQQawoPcxWOJlUHPhJrGn\n1/LOGPzas8E5+98Gq92c/QrfoylGSKpLlodFFMfcjwcU+3vFW8j9DfJMBDM2\n0ikOkVDg2/KACeRfuSHy5y2ksXC7FZbTDyJrN6BZIvLh0U/Hq9I8o1CTvbVe\nFBn0Kl25MjCKCb1shmI5LSWuEYfccKIxciQ49GQilDi8/jiPJEUGr9oDkGFe\nDVr93MhtJkI0WsA+JuIsb/hCV0cJ4KVEZUjfAu4yaewHHZc0itIP1BMzasR+\n+ATkFFQGmiyJsvyvMXAZ4pUk7luGO+ao73DrGm7eEUiNij47dQzdXKiOUa4n\ntqoZGJjYm7PEQDIX7AApchNvprEoRdyBTexdS56Cs7YSKkboo7gGmREjKXfF\nrOGZafnGpCdd3MoycXhMi0wcX1xAPqHilMSnv9aKwfWpdN+8hPfJzqBsY1JS\nydEACo9TJ0EsoIOIdT1T8uTJUyqscqM22rOb7qbCtPO5STyhZmGOOYthlwGi\nkqKwAfyuiUdw1o3O38ON6YZ8GdU35Wa5+XIT4LSUktil35DcLlhoEjsoBGiT\nEpnVuSu7FcQo24Txu1LC020tJfTX2JW8rrFrlz64LrB0yv+rhayPo7jGv1zx\nmjc1\r\n=t/iD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEo0iG9PkuLOQ+4VFb9qlxJZJb3hzptro/yiYVp2mebDAiAlVPfb2Kxd7RA5wOO3n8pgwOnqmnL3FdIhSGFGIE445g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0_1588801162714_0.7212769564096175"},"_hasShrinkwrap":false},"2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.25","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.60","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0","gitHead":"6298a46232289b4953e58e7758c5d749588d2552","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5JpZ29mqA6/SWLGK0a7JPgRRgqAIbgNNsqXHP+jXfm+77KcOeFgZNIdQ/MgUuFLtA0tpCWXN67XT0SdzSaCiFg==","shasum":"1a02e3b0e81610078d1d6a557b847c666cce195d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0.tgz","fileCount":33,"unpackedSize":137538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesy7VCRA9TVsSAnZWagAA0IEP/imO6zDdVQ0eSRb2ynUb\nBlJVpe2wQ79JiqKFB1vlzm2c2Qz2MYck6YDxUmum0/h9kexxeILygXfSPcYx\najPRa2Z4Qln/ReFjTA2tZtsLdMV10ii+ut0Gd0FKdoQHq+NaYTQkmtNMwwDt\nOwe6vwrTpvCsejYQ7jWgjSx0nEn+PW97unuh7r2mfze7IZTFoikDYbSHyRGj\nRmobMtCAfoJf9PUcNLWnucoXfdRwZKDBKSNlhWTS6CO9WmW77aGdDwhSQnAM\n0dAz8laPYjnAWept6YH2PfVo3AEiLAwsHpYVFkapm0fNwiXmmMPFasFtFT+1\ncC/yarTsfM4lUygvepZyjEus5N5F0cATZGVXmG0pvzFeYp33wX2YwJAVHY6v\npgYpwr129bOWF/yJK0Udl8r6z2XRamMRicmlLjk+LUh05VhVmCC2oce+qYdi\n7/K+8ttcGILt5OpPWZTU5umm97Q8wV6JK95+qQ4L+tVBK/JB0jXT1R+W3lx5\nAAZVxRkRIdJ3+Fgq/cOZe8CXKppjYGCyDwV5he3NnChTNELI8SPXitOeJkdK\nkTMFE5miMtMwicJYouCX72vcbIfRZ0eZV2Hp9K5HXBd4VngHa3/b1z95GT0F\nJLV29KvDEF5H6U1PImQrwgNgAK9Z/myWqWFFmitMCLwhqQz0aJ4tTAOX2SOU\n/Tw9\r\n=BgQh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFq2bglLyWbpyAV5gMLf4itP6eIbSUb55VirKHRjaEMVAiEAvYG3Bg0nfRpKJvJBlj00hiKfzHwj0p8ZueQw42GSnE4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0_1588801237059_0.9514013526831415"},"_hasShrinkwrap":false},"2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0","gitHead":"bfdf3526e40cf13b13f63c810abd6ce8ba7bae83","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kTj2orSQ18Y1PFz2J5TjQafpwg18P29JbGqtWVtvP7On7WKa87a3mc1hDjl20/0zRFdv5rifI+IWT+0/v2xGpQ==","shasum":"0f23e9655dd115cadfa551b06c015a00d2fb3b29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0.tgz","fileCount":33,"unpackedSize":137538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetEeKCRA9TVsSAnZWagAADeIQAIdnXaMCSJO2LPQrtBZZ\n/wQk9UZnafRD3UQGAWlDdm8yW0bb0SyyVZpLTWbtNku1AVX3MHluA0QnxJbm\ni5Uj2/cxvPICZUb6635wmZQYtccZzIjs3QZUlvxR+kePRqJJnhv11wXxPzSL\nwFjv4E5Q2XqTewdPFsllJjFKhk5EDTog0u3agreydgqjig4EvHZQmo0vQzW4\nzohPqolyjwfOyC9hY9h12tPNUDe+Ix7972poCz+BPL5qEbxp3+zuCmzQ65sm\nXUMJ/ruLtnvQntIYL5oUTJi3zFrbTHLxzBs3vZI+er27ie7t4un7ctJtadoS\n4RYca22wBFj4ez4cOrc4wJlZbzitKyxxeICOZcvxsEi4AyhfRorztZBuNavT\nXm+UZ4IuJ9Bw0tkXldRxRzQEzQCovfqiJ0rsOxGzuuV0F8GWbcflRKnTCpyE\nJ2oYtgfdQVVL02d4v+apvEBosYSeE4k1Cr7gjTmT0lYoLS3rrz3Nri+fAZUV\nnETZv4zZCzWXq4tFpEjH0o84EEBDfacp7JITDkP9c62nUIjcAiv8RB6iuOxl\nBDsJ2zu3TR6GHAmH2HAmrx0gNsZBLsZJpL4D8FSN7gVffqKGLbu2NouxeUBk\n76oevHFgeyM81VgyE+w15hqcaS5VvxiHq/j/cSsWwO5ZoRLA53y2UB5vunXt\n/Wjv\r\n=7+st\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4n2066SBm/ErrfpFnUrWHlZvb7aHDKVrkN3osqxWYPgIhAKdpm8nnL/LxTETuwlAv85K812O+QOUSYo8V4TemsL0Z"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0_1588873097345_0.9310775793640682"},"_hasShrinkwrap":false},"2.1.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.12","gitHead":"e5c089df7a8ba52e8bdba33a7a765c85fb358a4f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.12","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-197UL42blH/pdMM8A5YVtt2xKqk9dGUC8S7vbT0QVNwWIWuqSa4llIFZoDExu7DmvQfp+jzHJvY/S9lEGNvWuQ==","shasum":"68dc5565f439e1d91b14664e8e65df04ea4cfd68","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.12.tgz","fileCount":33,"unpackedSize":137772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetEf2CRA9TVsSAnZWagAAm/8QAIFRssq3Mu0XGcNciufl\n5W7DcoBkwQ7TuxDhECoSCKUxwdDqKOUXHm2BA3MGDq0aWExEInTA2vzCv0RI\nZxOh2ZifivJM88i9byUmIKvXnfWR0rmFLklWmNiQyAkhIlfBjF9uIlwjc4Rg\n4ioUb5pJWfWB3uw6GAoA6ZuUejXH2lEZr/UVpCKRFEWJCANIJ0vOhtZvhG+G\nMJUzFZHyGVTOvoVZN8hnhVSyav2B684jKScJ1gS+TPUdqq1hFlSoiUtPJU57\n0OnvHomg2wqyP/FwOiTVDZyTpf5KWCSB7nA50EcMKcrBHMeOcgA8aN7sNRdL\nEYedhAggBU52MFuvYEG57uu7RJojD/5TfHwTPMxL6HEpnIdlOAUEXCCRFTXx\nk8wD69zIQDknBRvYF3VkFPs1MJAKvF4qPN+dQJeoj6Ba9+SDO1f+bkTjKrXV\n+qeuvmHG8KSkjIYLX2oQcfzpxSOdvyF/wZt2xYfTy6gt/tc/d0lrMHkoOvcz\nKPze3EqX2h4Fe2QfJSrRPTUkBzHvC4RGpftKcc+jSUG3MIM3YLv5/I9LATbN\nXOG/x9V3hKFi3Dw6ouSRrY7sAi+63oaPJgig5UXTA4rmuX7yebOE4UmPQ4gd\n9XBT6HKiAmMdIY21dIG4VB1LLedKI7x6vGUoqvqkPiY19JivJeD0RpTSExz/\ngKOI\r\n=FMw6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUMJJdpPt91ssAsh6Fd8/1JdNOPorfJtFGc4YJ7SYtoQIgG231NXFht1Ht93Wm1B1MW61yGR9e0nooPt3KsPIGnR4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.12_1588873206071_0.3730706054684405"},"_hasShrinkwrap":false},"2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e0366aa647f5ceb0f807cfb51736e1462cf1f579","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ByQoFMLcwDXBXw6V9kQMjQQiNPWpYtw/DmBC1O/B2ZWO6RGsID6PuWj5mCn0Qv+aZ1xa34Bwb7bP50QSHqDN4Q==","shasum":"ef88ffb9821b9ee2dca6d846570396d72a92408c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0.tgz","fileCount":33,"unpackedSize":137538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetEgxCRA9TVsSAnZWagAAaW8QAJk+ZOdziNUWMZ03y0fy\no1s0Qn/Fa+IQMSJOeFImXkEDlACl2Iy66oPe+De2lARJ74el6YrMy4OIp41L\n0ZsOoUzzX7NWzOB8ptzZ2scUjIGZydPeCC2d3MhkaY0OUqVoS89DYS0W1VHE\nbX/ceoU0WZcixHp95ELoYtYWXHUm/2+AdU9/CmDoM4jXOBB+HgghJlOi6sop\nrw7ClHHtxkZVAT3DcgqEZSndmOt75ijjmPIrP3UjkweHEoei6b2jbI/sCTLb\nKPuUuECNSGq2NJGq//5TxRWH7+06YpMTnD60pyEwXY8tqEK7MDiW9emMK7jR\nnt3sezEghUMN53KbVZWOgYIqLW30eCG/BSQof1N3V1Nqkvhw/cvOQmATffm+\nkyAeQxU25WO97C66/lYYyg/8To8FXzhXeMiNoN9iNbEnP4ZFzzguT0SJtvQC\nyrryMc3EVIDUn+sQ+/z/zbazYILHExV+TdnXmGNGE/xnG+vBDFRKqHir9IIN\n68zBCdGD1uixEWc9JaVZZseMb4xBhaWXy9wZb2uDarje1XZcH3t+2RmHSxZP\n8cR5jrEWpEwoeDXsIcgz3Z/MQUTtM80z9dYIIyLSWfmycME6Y+NNh2A6OU0E\nIPsY0f3x+yzQWwyz4nmhTu30tLwmdgyn0Lu6/l0L7K4Sxayc8vsrcl1gfdZ5\nowBf\r\n=29AP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3mywTJjV4SOJpjwhTZ6nvRjcNyDvlB6fRX+K/xhV3QAIhAJ2UoHnkff67Q93A8Y8A7Obq7aVl3lWOQE/YKrSa66KO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0_1588873264614_0.6030352819019074"},"_hasShrinkwrap":false},"2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e5c089df7a8ba52e8bdba33a7a765c85fb358a4f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jGhnJ7E0vE4vGhM0xqR9dMIT9Vyr2TTcEM7cxT4DaQ3DXALDDAQG3MZXBpOlebR50ON5vzA4Uw4vE70AoyqCJg==","shasum":"b9478c013688f8eee6caf1060917ce8b22486db0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0.tgz","fileCount":33,"unpackedSize":137815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetEh+CRA9TVsSAnZWagAA4VUP/3skgXnA7nvESqqlSZVX\nek3Kl4HzeUYFF1Q0UD5Q/pFoxwqdDmbHmq2huT811y1eGtGnv6HFiy9slmq9\nqrTQLJx04PSv/u2Gb918OLcmuMuk+R2Oy0k3bD5EoHJgqllXCmdPbBjFqaDp\n1HEAtHf1YFXtEqZwQRt/fGQc/S+lKlArxgLmT9RX1CdqSG5ra+wH2Erro7R9\nabo3/WbBKrZMUvYzY7r4vlQQVoIjTsyEmhqNPKsPL+7rEoN6qbkttUPxnZGp\nx/vQhetdiY5golIhrlqpl+MTvZqgGtvt50ZFcVI1vwUGzuwb6t/uXyUMnVyu\nOCKUcF93ghDK/8bEGIAJ12+zdj2bmUPXEhnx1nMG1jfCZL1o+KdMgvDd6aZf\n9cKfkZPbAybLBg1H7ImNGPuJPw6/65emJkPkj3k5n9/ucJ0BqBqiFkWUpEIw\n8X/w7uk93YUtqCwmAIj1J30BCeXSSdtyg21ejByUuRKnnrOJwKeiY6dLsYLQ\nnHIOx5pmnpQETNm5wx5701+9BXa/J+s7PEL0m/dqPIiyYto3R1UsC5n2Zpow\nTj8c2WIqg34tu1Kvs1vAtckkm5rGoePsJhlsGDl8la6ToYqhB/iRBnsYuxiz\nHlYCXPYFX4y4BHJ4+Zr6/mt0u4qmQQjnQhSX8/UETWYvTrgua09p94lrPXPM\n+TsP\r\n=aIxO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEY8I6dUR9QxqQ20suDK51nzVn+iAihBhcIeL67uxxCnAiEA/3E64Q9zqDc8PzZY3vFYT/VZom8+l/JXGpnKQqtK7PA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0_1588873341807_0.9249275662799243"},"_hasShrinkwrap":false},"2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.25","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0","gitHead":"01b1a4ce8b622c80eea4af94077ab99cbbcf2634","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-RD9w+GZXM5rNlwbN9/tcp3DoIYpgstJZf/Os/E7FeGm9/C+6cb+1CX1hcm2gEkpy5evA54mHX8mMYxm5TqYj2g==","shasum":"847faea86489a814590e0ea6d0df4191a514fef2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0.tgz","fileCount":33,"unpackedSize":137815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetEiuCRA9TVsSAnZWagAAncIP/ikn+1l6f/+Pktln1+ZR\nbd3SGcWfHi++oG+Jh+a22TzlJQA52BrVCMTNFCERcQA8WYzB/7JBiJOUp67p\nCIL1sgalBDA71qXn5iw+Gusq8+lRBOQGfkcXCO6K6cP5ypZHfp4gLxz1j9Go\nA3cS8TW51FYN2htJBMaP0USclTABHqA/RcJyNLyihANYIY2YYad+ep82GVW2\n6HT9FhbNNkOlQ87NQKR+h9zhHbY3FEo2Z53J8U2jg1WFEXATpsdNUMK4DkuL\nLcU9GMKNHbxC1DzL6UuracsTPKt0pTznFhSJNT861UmyILme+Rn37/+vZKlK\n7IX565Vk/EXhwxJbNH0xynyoFVNjxejJsF2IPs4gkWKB7wsJDbjhjh6QPtH5\nvlxb6ekes/s3AvPqXvimwxD2CtoHJ9Ghv9CAFug5e9LO82OaQu8Q8/8ezyUD\n+CXUVn0k2HokwD9RUnVbqlhvttEiBcRmXF/SQO6AsTdVTfU3n7s/ORinYhGn\neLy93pfdjqHNX60mz724iGvMMBMr6JQnkZZ8BtkoeFoRyn9MLITDmz/dDf0R\nzk5dCxI2eR+0d6Ez8XNrdpnPveCnK0kFnoaq2Fx5S+hITdFt/QmqFly63VjJ\nAYaGroOmxP2XozQD93jFPbpgslBVPG2gu6UbXYoslSbTBj+YM24gmZz1Rf+v\nqGsm\r\n=YyWz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMZDTHA2UwUqypo8XBjg9bKVLsS6M0RGsRSwAzjWcxuAiAQAi2b0G2nFsfRGv8L4LT2sxzmZxFQ3npOG6yMaJY/3Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0_1588873390080_0.5181427358107575"},"_hasShrinkwrap":false},"2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0","gitHead":"ef27bc5534a03944848b2631bf63e0b7193829ed","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c9Cth/aINVtPKQxxhE5kfXJN5OvoeGRvU9xhTqJKIt9QOcImO70EB5S0LEFZFrnGGnoac96a5MH7Ui4miFndhA==","shasum":"c233ac07a293d939fe148d020c601962205cb5d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0.tgz","fileCount":33,"unpackedSize":138330,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetQX+CRA9TVsSAnZWagAA6pcP/jX4Udl0FlED8hBe1oDh\nFPOlLELS+Z0EsBbOkMKA1uCNpldkibVkah2qaq+1YLjQMq/qnQQb6UgETb4O\nQXasiZydA2MjZ6GWqJIU+Te+dxwObNMnnE2GeMoLFNQgaLDYidLxBxt2uI2b\nPpM0YhztBO0qbitdX1n6w8c1+0FpW4bwOkyp6FSmHqjJT3CoAinD1j80H+zf\nlF5rsZW3/eeDvJ9qHeQI11dceA1cNugaBG1RJ9tm9VQwTH1CfDCORWaEX58n\nMRKL85XwBisCMRsjb8N2YlDuSzNhO/8nG4xrLiJP7E/UDXbuhb69Wawh+GOm\n5XsUiJ1asPVFUJNtNtAGvPdmm/gU6Fa3dMfODq6K8WgBCAj/3j/Iq7CMOGFh\n7nRCiC9+wMOBwoFPPGdzzAwOk2ve7qAFDTHBfHeay7Vn0Z1pZ9edI80YCvCR\n2Qs4kGYSrt0eEj86L2BPin0HqcpZfueVxU/HwQIukS/3ubmT+bUKtnhp06o9\n5ztrQpEkkZnVcullbdX9VWYtCFMagRRaa4GRhFylsbG3KyVVMGRgVOkmH1ws\n9cWyIQKqSV0wngn7ZVguaX5ZJ5dK5M4Uw/Fh8I8MG/FfjJ5/UC4b/8WakgFi\nrKR4VW4GvAsEF7gw9t6F0YMGhHeyKV5PZ1y1LEpKPf2laJLXlbQx5mFVyST9\nn5Vs\r\n=gxgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAo0dleMiw33WOoqEjPZVPbwkqPxYUCOrYqrXU/1no9xAiEA0Rc/PjsmE2Uia/TIb74DIUT27ozEUGPMaFKL5/4hSPM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0_1588921853982_0.824049525631958"},"_hasShrinkwrap":false},"2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"da18b3f772fd688e4267a0e58921144049613bc7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tyNwrlOsW10jMNnfL8B029CuFqY874dUv38pf23lqjN6hQZOEbRLWm6ulBv8gZHa4wufBoF89VX0fYmrP5NfCw==","shasum":"40e923112c657f21199eb74b1104488f8ef40065","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0.tgz","fileCount":33,"unpackedSize":138330,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetQjDCRA9TVsSAnZWagAAlI4P/3ZDAlVhw1rg23zZTU7k\nbLQ1075teWMhNAu3wAIdDgWdfApfosRf5V6iJcq+/71ZXgPNFZ34ox77Si5e\nAkxbShaKwJK1NKPFfypbkGPw15qz6XZ9+x2udQZSR3+foe/t4RYkAuKn066Y\n4m5f/9B6n3dHDPvBzGJyUe86NO9zAS+K1MOsCF4L3aeUzhMcvFuS8EuRho6N\nDA3mQf1+uCgL7s8FjYsibPq6VfQJaR+0b2yF0ftNeYmOzClw0OPfKcsmeUTW\nVCw79E6IPcy7rBD0Dq4huZHcA2YNHkWwqjTJ9IarChtxrktSYtXMtVqrrN7S\n1h23FfB3ssfyXFdO4sxBUJ3GVBx1+fTbGPMT2UM9MgKY8fT211uoUYUELWpm\nLil0oFB+7cZr9q92bcchgcJI/qdws/sbNsp016E3CUgMpDJVcZ60dG2NQPor\nVndO3qGrYMABy0iGSazFLmEdM9DRs5ckHu31szYMFQPth10Po3qTtezdv4eo\n2EnlGsUpmyEPtJxtzCjqry5D3nqvKPWvtOVeRLtXCrYcTHdQUB1+WhgQjjbP\nLzRdO6VsQuJ61PnNPtt81fg7pQpY8KM1CeS0mWkTFhIM95woDu/5n3tPy6Ro\nslcv+2ieUNAgcfkI4vkW0pO39hABHyaMaXx/Rncbz9sDFOu7gcFGqsrBRWO/\nUWj1\r\n=8dwc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZgut/PqJv+EVI9ra8IThGIEYuN90P1VDvDNfeckrN3AiEAhoRKzH22I/Pij8VR7xGokBF49EEQBlCFvhoeaoKWM7I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0_1588922562602_0.9779027575761681"},"_hasShrinkwrap":false},"2.2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.0","gitHead":"2f0f5382e19656fa6deb00953600450c0b6e1d82","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-RcolKuchi7suVxCelShw/jXfLdx02SGY0A1d2M/MuHaxdeDSzQ0oRlYlyVtNioszX2+6ePQgevDO1Yv7Wa1JNA==","shasum":"1845b1acef5dc646d1f1f47eff4c6a0b49f024fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.0.tgz","fileCount":33,"unpackedSize":138566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetQjkCRA9TVsSAnZWagAANrAP/Ag0ClaG2e6zy2qBujI+\nCm4aJX22TQU0r06ndm69XJHTgPpt2wcau4HwO+hD2BAbAXg/YgDzXVU5vA9h\nUnglUi8OK1DTul0ZJkGvFyBDH+BDJgMD7VotDHDOoFvXG6oYxWOQg04GTbC5\niQf1pWLvCXrqk8hIBl8Ino5hVFdAD0F/4lD85xfDmsPECQd1chR0YduapwZA\nFTfl556HWwTz9N/UDRAc5G7Ch7XEBAPhCQtayfrRgSXs7+VF/yiMA9AbDMwC\noK6V1g0AUfa0XibcNouDKxVDk+ZlW41/o3imO5a35KCJxwRvH8PPKz6gPGzn\nn11STg5kgOzM4IfuNNJp37XBKSScuZgzPxznDck56VfNYDbWF0t/3EtrFJGV\n7qR8BGxxcI9EJM0WUJNBEkOvvKcqB84hhs270oXGe8k3cRTsioHpvnF2HPfp\nE9K8THiZPt72deOYQAl+7WDAaxUQ+9VXOl3phx2bs9n7oibwjiz0UTDvvrJY\nZbFJsFheLtCqoKN1STDqiu17W3feQfAIX60Ux3HQznFZovYspjYgozdtlAMb\nLWFd73vFXeGVbhTYTB+ZEosmtje6Y0GYvKwCIwEibKGAxFHQUISPpoLGNKXP\nb9wamV3hsgOw8EfkoaIScNP0xJng2OwS2JwfJmv+6l61n9GY0hFz6JUYZ9y0\n8IQP\r\n=DRcV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyeUdmemCT4np3mmMtYS0XZjddW2Omogh+Y5WoCKLpWwIhAPhs4eFt1f0ZRjlTTNZy5lhZ1d5cWn9dwfu1K/sGX3kO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.0_1588922595638_0.16068955597339896"},"_hasShrinkwrap":false},"2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2f0f5382e19656fa6deb00953600450c0b6e1d82","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-01vPKTc6MU9c4/xXmFl5xP9yBj4UjOGinmLZCZ3pu5HNwsA3AAnEm1did0+4sL7z4JQrQq5ksmjPM3ha/1b0yQ==","shasum":"10b1c6976b3071382d6cda34d79b1c210892c526","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0.tgz","fileCount":33,"unpackedSize":138609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetQkDCRA9TVsSAnZWagAAgtAQAIIpw8WZjU+rBwtWplg8\nZOgU1m7n9pZankWwLPiL16dh3kY4HcQuxo49Rfn4ca5uvRUdwj/rmMpqo2N0\n/U/hx5gszZvyy2TYNZM/rdEjqHwpqaGR22GGJ44qFjQA/YU3sDmWDcVlkNaT\nC/85icQVpknJmnLLfM7ZcPdZ+uVH8qjIsJE8Coeus5Eyif9qQnpZTO0Dnco/\na75Qxa8bKjP1rGcEPFGGN+W4L+mXkkBko7PjKV2PgoxTUQudcEHB1Bu94YzM\nsP1VxcX2S0iY3IgRkgMNNHtNhrk3BR495EyZrug9jJxmK27lEZuuOPV9qM1i\nBy8w66HnWRKCpG1MTnCVddpaAVw8uphd65Hwpno5YyfWyD63IChDgEm8SiKj\nCYEJZFsgfDdZefzCg+cgWcL1FV5BWpim9IaO06fnXaBqsxw3rNdXv17H0lnB\nP4SWpqnL5KJYL4oArSn6RMmvEZOugKjejXAS78pnIKcBK6/BbA4gJqK6W6sy\nzZOKW7S5T2cGypX6Sbp/KrMcThrbRLXp6Dsj+Dpj/8RQXtWI4gDtwGybOfaO\n3zi1g2S8F8tq8M3mf+4MHTZhotkkNVa4hQKPCvTcaoncICeA2MxbhrKAcL2c\n+6FcAEOC3xGDu/Uwto8NZrjMbg64x0+1ffGGhDUhEziQuN9eo3qAACUMOk18\n554B\r\n=UTYB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbN7ihbqF6RVOxMpDGltGQzpS0YKk5jkdMKN4JkzLt3AiEA4n6IOr4w6+NqTamZEmQWkzrF9uFz16GPBjX+UL/9CrE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0_1588922627345_0.3389865295323713"},"_hasShrinkwrap":false},"2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.25","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0","gitHead":"3469337795a3cc5ffb85a6aebef5fee820a4110d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-86vwyoaPqBujEZYj/cx4bZ+ouMZh5+VylLayIxvAygCMlvZoYa8WIRD+66uz+5zDEWYjp9HUMWo56JFQsO0N2w==","shasum":"6c5f207478c3fd7546cd5eecc3115033e45d542d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0.tgz","fileCount":33,"unpackedSize":138609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetQmVCRA9TVsSAnZWagAAF1cQAI9oNoVVobIU28s5IBEC\n/tyS1mBrtHTs+CIMtvGb5FqghtjJi8zVeb+THudiXkKR7HYM6hfjDXJfzCCo\nz9x2wdVakGSVdaVUcwy7ims5z8E/8ygBnCJEOZnJHQw2CMxd3m60DZSF1tBS\n44slJ0YSnTMqj4377cIpml2+DpEunCCMHHxST8Yc1Ut44ahmn/XzG9vCwz6m\nTNa1SM8S4HdyfbIc0tGqVnjZv3HEI8DNU+5hhcGBDhvBrqTkU0Awg8+2p/jS\nAaZMz76MKO/wbwH/pVLCu24JSe+PDrrJt7YF1GjGXN2IosDXBFEPZU2Nvsj/\ndfCbW+uvYnCVOtwAvaxe/2PSbJ8PBnH2j6i+4gFVMvg1Eze4OisWdOb1a3ug\ndapHMN+D3m+7UG405h6IdgLRVo6jqD5r72osW5uwlRJRQwAcO+QKtsPn2Nbk\nl/rdEoHGyPDEWGKvWbWpX/JdgjD+fZvBfXkLwOwDymXyW+SI2ldxanMFScSJ\n9dVGSaV0s8DOtjFyvN6ItJhZn/Rym8xwCAjB8dFV5y1N8p+dOJMbPW+fFuyB\nKm+ZxOhq6psXl7nhahBvOwCNsZ325TqqceCY7+3lF7GbbUhXHuzY0jUtmWm/\nL4aUp7i/MKW1FAdlM0WB3aFePOqBt/3SoBFbVcRhnfkqvWAGk5Lux+aOE2wb\ndX15\r\n=yruv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDGsdX0XEMi5CeBHRTu17s5L+iITWrT97DBJ096WRFhAIgD6iSPm19EjrOwS7uCOHZoawwdmFmYZTcxyWTqvJDTHA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0_1588922773191_0.4833737483518237"},"_hasShrinkwrap":false},"2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.26","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.0","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0","gitHead":"73cb0f750f49fa9527964707bd158e585ccf1a07","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VSte54otDtNlgEUQ6JDbJgDYFeqXJbfGSf2ww0atLC/XPlAcjdl1KMziPUkCM9RHxRIgbuly+lSF2hupKj/R6g==","shasum":"23dc81d4c9d1e07fc861ba9dfffc9f34837c451e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0.tgz","fileCount":33,"unpackedSize":138609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetfXeCRA9TVsSAnZWagAAma0P/A5NHYNQ0uzbCUvNoAxu\nqDUZIXDhK5vSCmwJYSb0Pm3I9mxlsKoOR+uso7TJoDiu+UXwHLXgVRkRmqBv\nTPdRgD05bGRhTNmSFskfDmOQA1Lyq+K+5KOOZFDlphB0MKQ6sVgfK3CHabwf\nPne04ZwhHlnDBetbufnjVNckKVtTiDNeywvqK9aJmscFMOdi09iwnOWtf2bb\nRDvzMmcRjHJ4ZjVWg9sWPdnb60nG71zYLAvx6VIZXNXOzMeQ4QtEDbtO2G9o\nu4xB7HPSKsXnjCL4KYP+sJVTOQIpt7i7D3Cecjy3Jz8TGl3mWNud00M5H+ey\nqhu1/AbHcegBQI5kHdf5JPCw4F3Af0YlgGFft+8h9oFqF5Epb1UOG2dIy6HO\nFsmq3v/llFcuwZjnGy6CXd3I8f8edftndqq+8EbOYs8DnPBgZYe7osgdgQz6\n5pwezZ/xXPwXoMkdd7nhPF4MOVgY28VAoNvE37kyoLEuI+GxpEho5f66pMuF\n/ZMdiiY5qeZn6H0wXPmO6XLEZJgrzHJbFj8J3VqIFWL+4FBj+GsAzQgtrKCM\ntbgGALGNTBoFe4pIh4/atvSDRt090tBbEo1MS0JgM0QLXU4XvaDDy62jumR2\nMPn86FfMXtz3p8ig2MgWifYuazFDq2NMDNXdhTNMm2hrzye7azZBrHEdooP5\nmdWq\r\n=iqdg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFuZD7kdFLUC4z0LrDCTxWoyiC8dFicQsN8H8o6bWegAiEA06hwob0x2p2lSrIIrT0ZDKnG1Pbygz9XiG22s5eT55g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0_1588983261564_0.8355315064365474"},"_hasShrinkwrap":false},"2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0","gitHead":"33ed86cc9909ada93a05070f0cce19ac664da415","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7tWkLNuJw/i87DHx72y8YcD0JZdqsiLgWllXJp2/mRegcYKQvngdE3Lg5TH9rANk2ON3H+BxUkzh28iWmDBThw==","shasum":"b74b923c55f20e9e307e77fbe7c88b92f6e7387b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0.tgz","fileCount":33,"unpackedSize":138609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetnDfCRA9TVsSAnZWagAALdwP/28XQjzUMuv/cCp5217X\nd8sZ8vJkvL8R81tDQ+AEGiLMLJpm5K/j5I/HJkIv6gPxz4s1GH6deb+LEZuU\n88jPMR4/SiWWFV/8E5XGZG/HuBU7m/nLXmLsF8I0Lo/KSREvcfcBmI5zk6Gg\nRZoWCFJNyEtxm695DA2QsOPZHUEfN5NAyNtzj1Xk+y9EWjYuWCdZweXUxrlJ\nZO27UaOnl12+E1XnQ16YdkC6AsByp5w4UruifJYWK/Xc9uv/yStycIqa1SGL\nuAHsMoVmrIkxuzGRzum1brkJlzIOr1VIR7bMQBOYCgly7ZDia6FUBq6X2Iku\nRIBIhtV25UcKQQAjueyOM0JQDUgZZvIkymuhDqDso1ehUR7hko1u79EB8AFj\nHFCv1LxcGyoejnrXbgQZdxkrchZVcLYjOIzrgCPPY2OJLBVcn4BIi0UK5oxq\nV5lngAdbYQDJzAnzD9l8hdl9VK/+EKgOU5PvMLhJREM/qAN0pFAplncnfe/5\nr4C93IL/2IbzriLTwTq7MzPvGEykIYKtoHiOzgatGFMKwbFFtFnHpmZMaSDu\n31EU2EMwsyJHOYtqP/E5o29S2Q5KC9hZ41i1J20QlOhbbjbCHc/EDGuIy/S2\nS7kNYugd05IbulnR9z80Phnlg1L+afaCSIJQaipJOS8Jp6oR1S0Cu6SP2/g2\n8t0K\r\n=dNDp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLhgu5q0o7oJIq9m37C4Yph0VZsKfFnHELJ3RGcjCJ5QIhAKHiedcnNqIAwGINuwaVL002TZfr5x0JpjiFcUY2ByV0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0_1589014751026_0.5568810444515013"},"_hasShrinkwrap":false},"2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Gr0FihnHnASWLFpzvXqHBPnDtP2I2tr3f+E10bozCOluqN5PDc0nq/X/50bIHjapZng4121hOO+P/jBPITEJQQ==","shasum":"6123c97c4a41cb1bde1a5d73847b1d842f37f057","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0.tgz","fileCount":33,"unpackedSize":138609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetnE1CRA9TVsSAnZWagAAL0oP/AjnQ6dnAz9ovB/XaJaF\nDLLaTlipXCB/RrFC8IrC9GND1AAHchCOIZxpEYLMrTgiDTdDh5Kqbl6hl0Ax\nnq+CT4xxRFXHmXI1CMahry4jySSCmyH4sK3z/Z0Zk2J2rBopPPBrsBvU8pM7\nCvloSfX9/WsLjmoq3CNrx3Lx9WSRv6++N8ieyHyeyvI8zpbRPOHkgZGuHwVy\nN9uMPDLT9amiJzXCiaPL1aZ6gjDpXn6loMbon0jcWCuBGKBlrC5RJ6n/mOY/\n35YpBS4KVGywUB9DiCwhp0ELdz9ImP6AnZJyGQpuSFQSySYlmpgn6L3TaQU/\n/gH7ML6h5MsjtdJ2LRPKB46eQgUDdU6YWvXeOrIgvo8YTbIuI4sDeK3gz8OW\nAbz0VE2/UexJRl/3OLGJhSlCstkAy14NJolxztX6lS4HPZV/3ZJbUENBznTr\nm8nPNSJ8e+wNWqjq0o10t/K6tsGU3B2VWjTLUDPLPvcLXKOt5IX2w4ySd/5h\nzgqxvSpcAdevxBVbQK+RR9JX3hJKK0fSVzUlgs2HdRA7d8zfKaE+LvZ3dd+0\nlvnW1am6TXqzYkgImd/lbVKERfCKiNetXIBOTohvx7PBu0JuryT8tmeWkJXI\nXmBWJm6erJoS1Vetuf2p/1eJr55UyBJPum0N/bSJgjJssnmlL5No6IdqifJu\n6jM1\r\n=j3RM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICyNpWmf2/0In/VjGna66SElo6UBlZh5XgOvisAG5BpDAiBhnZwQSRR5vbAVkbyYexmK4NjybFz5VxnwJOFO3hxO4g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0_1589014837062_0.8257957892000583"},"_hasShrinkwrap":false},"2.2.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.1","gitHead":"df7e17c295b56a25f53eb5ca3daf33349b0a4dde","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OdkR1zcMy1OYQtw2C47eBIbykFV+Cs4jjGmvOM7Na7hwCUkyy0N1j9zwdXwtyc/QNTw4lPuUwu03G9eagE43VQ==","shasum":"ad01d0cc79055459f30d06b9a7f5c7d360f1166a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.1.tgz","fileCount":33,"unpackedSize":138841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetnFLCRA9TVsSAnZWagAARcgP/A9aLwFo+pOzOJaDHmu0\nAdiqhrh96VGWU1dD+ljpmAMMX/0wt9hVWOaCNRXElNn3WjNcBOQa9RbIxW7y\nxAkJUuRSz2BGC5ZRE/EImKqWs6znnEmh2BcTGmaJmZPl4mgIDUmgY0p0HPKa\nTvjlpeXA6LS9fo22Y9IfvdFUQ6Nj3wEmVfmGhpXvUzTCs2pRMrA9xNc8R04P\niP2RFAp0yzt4rDpZ9LAQzWvX0hJmxZvX8ar6/OccoTarDHB5TCmAG6t9Aycy\nvUx7clSCk9NSS0MjF75D+MXlznZo7CCU6WaK45Xo8dmLi+UGW5ei4mjKiB+v\n40x9tmsysg0f07nbnN1fq6VxWPHW4WdUHAGg5WXZay2LGmZ2ThFezgmPrHXn\nWEsCsPJXDf1XoGpZoGl577ZoHtXcFnBeqaWYNuPwRgRzRXz/Lwimv8/HldO0\nl/SwsKd9stAaog1tU9i1KyaqiH3JY1r4LG3JEPlcrXgdIDyq+GIKBNr9Iwi3\ntcNqVX3D5VjJeMl2HxZHaExahcVDtVId/V/DQ+ZByEvEpnyNkFwFNnKfu/t0\nb4/2znPzmYxEWLAmIB7EV6+5HJnXUeTTogzPr2umyYHFCHFQU7Dhg9khEo0j\nxl54C+pQR7VTgoOiyw6iccgK4w9Tf3y0qzHC1VvFF4KeQUE11O8r+s69HFOV\nsay0\r\n=l/qZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdrE0DAhuSpAD2EaTa9hQjp2+om5z784abgHucuiYVzAiBq+k/10pZWltMiHehqv9quFJV5ktWxBCYKl9koaepbkA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.1_1589014858590_0.14795450406040866"},"_hasShrinkwrap":false},"2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"df7e17c295b56a25f53eb5ca3daf33349b0a4dde","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a+nVjB8glFkeaNaRcjx05keTk0Jw1B5wS0fuaG9v1kj0es4h2nAo2/GfUYp8VSaoQKGaq3d5rXIJmG2nh7hipw==","shasum":"c1e69a743624400c85849a9abb67dc4643a459ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0.tgz","fileCount":33,"unpackedSize":138884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetnFwCRA9TVsSAnZWagAAbhYP/A4zglHNFgXXQzvoZLUW\nn/UD/gZ4tfK2/ZxvdgtXGKp8ISYnhQMLl7pvwlUxEt/H1faeZkHwu+RLSy3G\nh+yCLWtNzxHaIe4n2pC+EYJf7RFDfy/xggP+m+5hk36oLvGxYR2w50mHgQvA\nFlY26lxNru+accEZIcQb88mNOHG1sMlpPnSyEWH1O7IIUTwbkBB/+O4Y9KSv\nMnMyGneNS0AiYLNeBUytdk7x3R/qX32tXpqI1FgG0rB8eD62aMC8/grR7mHa\nH9Bk17f0R3ma633FZJ0LCCQtbQnN8gyo6uGXF9rrieY2Kwacd8x8WquxMnA5\nE+rEsyx2LRwNEmUX+wO7OUijpX136cvxmHtKLgPX62dbdmp+wXslfkk6V3MO\nN9dm7H5X1l8kw3t7DyZ2FkdCRbKqNK1QqBvfbRbtXHu15MJhHSVVlqeYb8ML\nrqFIvI+2UmBznMdja1DJ2D07EGnndQo93hMDtHoRuEFD+gwRwWF1CZlgV8X4\n8vT+vUGnsc0yDbETEWTWy0jDYSmdUWabkBV5xS8xJPlOFZ/T5T4TIPD3EfHi\nBgA86/YAEYoXMgHwm6wq7JdlLQv+ythZbE8i1ktfpnB28FeGhDhcC27Q21u5\nzUKF3bG5FBVCzVriznxT0fEePW5uoe35bYoJdvQJuZap4v3G2kePCOpSVhhR\ni68Y\r\n=8i3j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWZ7mTnFS6HOCWDHmzyZctcSPAcEACh0swuJGNY2/AoAiEA7xQoza0TMxpLxKKpNl6GFRJ+Q0rfPEeSG6sT37cTkDQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0_1589014896017_0.4750235734923596"},"_hasShrinkwrap":false},"2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.26","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0","gitHead":"4a80bb324559f56abf1baa0297d1470bebc2a1b2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XURt9/nZc4WPJT9uPEoYscEJWNj8tnM/UIv0snqoD4Vhx3VedKctRMuMjHadG8GEk0vRhfn+ghRkhiPlpfdaXA==","shasum":"492f94ec67c7f362b3ed26aa683ec858108984f8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0.tgz","fileCount":33,"unpackedSize":138884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetnGuCRA9TVsSAnZWagAAuRIQAI1DIy/TCDsYi1ID7DrL\nyPW4xHFkA0ft8DsOo+/E6oWKy9KjY1qRWjQdoJItpHcm//G7bBqF5/qmU3gZ\nNrOX+w4SGAOjW3xhUJuP68qlwqFCvrjuZK4VMcICIfgegFM32pSFQ4oqesiz\ndxzyA3dA1vSgUBLXr107kCAnv+QyWyVbiHkCL0UAolAnz7EwCQe30CDsuBH2\nnF4cbuZHtLAJmqYtf3VFbmFKtVdpoT9L6dkYIJYgQBPKtV7+aV+gQsBQoqu0\nrTDm12hIVGCgSi8avivcArJeanCUr+q77MMRLzyUE+CgoVOV+l+KR29/Z3Ih\nuuRPTLD133l8rWV2mbZ7AUpaSUoOGbuyhkBvrMdijYiooWh8++fNX43kS++r\nUjFOhEn8He0ZkYgWwLuKfWJrbcbabI456SK/D8CEqxO6SLDF9iiLIY953PWp\nrqTwb9BuYJmDiIoZI3nUEy0mH3Eq1tzterTgz4hAfMwDosPwx4iPXGOjEj4v\ncmFl3GXyHHZyeb0GuQvMmu9FIz0wmjQRwOHpBOUl6a7mIUB73v5a80T6F75n\nrxzkM1wipDQ31Zgz8CQ7zbNfMUhmjhktI0GD5ZRaJ7rZpUw8Udk1h3lu3x4A\nE9q2m683rvXzTRKcmAccKSrRP7iYkgvPYuQXaILvLDcKT0SceA5dWjDbjDsP\niK6i\r\n=PCCB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsw1YMIVt2VTndmGBT+tsoqMCeXOMDoEAKXZh3EMH+RwIhAMM7qiOVnjeqgWvLYUx3Iz2XjVA+ATJrnKwl2T0JusOh"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0_1589014957569_0.7618190009020329"},"_hasShrinkwrap":false},"2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.27","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0","gitHead":"5f807b4c157d57c07800b9cd2bf337d4fa873a3e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pkIl1VX9T9IGvhQFYWd9qNpyh02VQTvVRmoLi9ueSFvecsz5SlKq07ZaM4JThRqYudYCISOa7jU9XNDJv0PUFQ==","shasum":"5a8fdcbec3decc9710b34306ced700e36be27070","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0.tgz","fileCount":33,"unpackedSize":138884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuQnICRA9TVsSAnZWagAA/nYP/2/4VTds5isz9Dq6ejGA\nKU4RvegRxaNv7asF+KpznmF0MJhkTS0gnTjVZqaQz/ecSP5L0zB+55wu7SdG\nfaKArgsnDYKmrXEUkUpX3xnfg/jDS3mLe77lHvkZXJ43Nb+ZOGZZ0ZaoIXjg\nEsaCeDu2L9Gekf7QjWgN1vWLm+VzNrOOzqFGAoqYyiC+EKZRMzOTUhvoybS3\nZic/xfg+o6E/eq5QGiusyu/q46oMDsLaiNjjiDohbWbrovGbkDl/0Osa/9QS\niYoMKCSEefDR9Ft3KL3WgtYhv5fvWfrXogDg8La0olag64S5P2h/iVr47z+A\nFMFzhTdTRnXEKaEz0Q8oi6kWsT/Hy023o4qvOUxnwK0P48UEnqqXoQlZrMjY\n197LgAvWPlYEjOs2EeEc4A0skJQhl72oMgT436IMhAbuRguL929GpKg9NRde\n7zvksBShRh9UB/kjit5OFbswNRUGQPFHJ3UfDUEnxg2qphKOjkU03t/67qaX\n+Iih4H9i5GSt9GP2cwhKwEUFvTBF62+E099ZaKovNxCnJoRUoWqin70W6xxk\n51NaP/dThsl8+nM2jAfQoLCUUG2MTq73h/40nLlrYfs0cfDE9+raXdbew+pn\nDuNQHLQIVo6YDApKRDnZfC9LI/LM45885+lrN0tlDo1Gwe+hGYPXoHWQ6SIP\nRwct\r\n=7Oyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClrdbKan3U9hk+tuz/sBB9GVtz8xYKKNENBI5xBAxafgIhAKMGWbIp/a5izKqeyjuTZZcRbOXca9qTd/EQEe/9EkSi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0_1589184968231_0.2541368442878553"},"_hasShrinkwrap":false},"2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.28","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0","gitHead":"4c63e24e8186917a7abbf71551441dbe1bebcbd0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UQEHUjvV4xsjtHBPeJgkBYzgk476q2SElEgoYAW9I9qpX7ci9G53EEOkpOoipInjTLfkXVH3XJVqAE8oipq/4A==","shasum":"15a7827f2ebf66622139d3db0ab3c62fbb2a7bf3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0.tgz","fileCount":33,"unpackedSize":138884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeubphCRA9TVsSAnZWagAA7wwP/jvU1Ywl4OGXhxx28Ete\nUGvxljN/WZAGstrn6YHtmfbT4IXaVm2s3avoL6GiKOipFrO8NPPKbzz7nulc\n9dKQ2GTZQrtHsXuTEmq7766YqB6et4YI6YCaCdIxW6c49BaF16c9Hu2ocMga\nJMu8hWt2TYJqPcEWEGy/wxKy1RaE1uJ3l9jdTMwkhX1a0s+4F+/yGvBZjf4K\niJzB+dzamh5FVq3QDZWvAOWj0rA6T59N+mJuVURoGG1eHsWQJ1I4F8xemm8U\nop/wUoWhynpTC4zGZytmGgMyWqgPBrVE1a9PmaoaVuk27zEiwWI9e9cgj8c6\n3hhBqddSEdoZ6w/B1APhbPbbR/VmdqrpobEJ8w69/BsDoqAt7R3EIb4K0lDd\n+c2SJzGQpOz93cxxPIdM5ZFurOaI9t/Tidcld8SLG1dOPzUkFUy0b+glC9Lp\nvpLrS6kef/D12Nf2KHUmtV4SYUKq3y0B1Ma8VLfSfvWkFpN/vDB4yOUu+mEr\nkxWTmzzajLwKZHL4HlnQDbQ7ccCpIYk4hjwfjfveFc2Gha+0+ochhCv7wCYE\nxuL85DW4utw2RAw5VrHePXFA719EA2FrUhak6cfaCFkfHc+NphtjgMMF5F5h\n9w68hEvwcdaYISSlHmZps5uFt6FeOwxJ6WAmWI3atgwd6P+oLj156D2Niec0\nkCWh\r\n=d5qs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCY9imTAZ6SPOyh7XXZWuh7jmr6x8MJS8rnMgyYQd/TqwIhAPIfbpdHCOAzFMu+QjVppOaiwe3Qn5b3kT04AT6Z/f2T"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0_1589230177440_0.5650103967018423"},"_hasShrinkwrap":false},"2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.29","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.8.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0","gitHead":"2755e2d4260b7cfa692d0cf4039646d24ff4f09a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rgi5z2ZKIpYt9Ytwjm1dVZuuhr8GEk2+mvg7AqlrrrmzJhc5QoWEb96D140l9Q2L+8K1Y1oRPZ53KUnZImH2Ug==","shasum":"31f564faadc234d3fd95dfdc5b0c2794747c0fd2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0.tgz","fileCount":33,"unpackedSize":138884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuwq/CRA9TVsSAnZWagAAthgP/1vYbh96NvacJLd+lJdV\nHQfWFyhvquoYHvO9sNCL66tpP+amCAdu57bk5AD08TODBdhHw3TQV1ufJf3x\ncSABMsJiaIM+2AQKhNTtBOrPF1Jhvm4CI9q1AWrIZQW1DoM6hfeaSVcqrLj0\nIR+60N/NZR6b3wB450OjwWjL+iqQY7uHWLhSINqu+ldtckAv06RuBkAanmEq\n2BlUnMdxoHeHN90aLSSi/urF9S5XIPbdorJPcK+VYGQ7p9eirQjiNh3m0jE2\n5kKP8ISfim3Wf7JtiKRKt6E6JGoUxJmZGuinPWxVjukJSTbgEe5iPJ6/nNS2\ndAv//OOD+WKvdDDqMbUGUaG7W1WR44QekgkHVDF2T+J2MYk0OU9wcPS4IKKY\n4ZfbKIDgAVjyLR+BopJW8KpcfJVgP8LJ6yjrJAjDqIPWzs94tfmJArjRxX/h\nsYlvyQQSx1VQKl7Z76sAyiig5GhdIKNeZbB3fvkZkMXsGtPFteNtHExroegf\nklVaTRVbzA19vYkfTwht/WXAJGZQL4cvB3N99D3JKcX2MJAOG2tdSN3QiUMP\nWG0Hmb62l27AVH/718n1YUIDasUMDB0WSfIO5RvUxeR3UqTqTJkVY3K3OAGP\nXTWKe2Nid0ro1EgfKBO/bU8XFETjLTfIFP2UPXd8nlBW2Cr9vgV+eL8zW91F\n4A/I\r\n=UR+Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICWYHBiY6KP9z1b/ekwXUeb3pX6ZvIOu3GLVA7elah4uAiB34RTit0zrpbMj3Ft0WKbwGOZ9dq3k0SXBGfX00wINKQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0_1589316287219_0.2732064077619616"},"_hasShrinkwrap":false},"2.2.2-31993e694344574f93777a8510f721ce4692fc60.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-31993e694344574f93777a8510f721ce4692fc60.0","gitHead":"31993e694344574f93777a8510f721ce4692fc60","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-31993e694344574f93777a8510f721ce4692fc60.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-oUlvXz+BQUC8f6sCNnvkFejMLHdPs9dpRClSTby2pfUJf6mVDtmuSTilOMAPXFo/2pmCqbpVluRkwKstGqKZvw==","shasum":"f8e95df44f90e4df6ca4445ea45b135e684788ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-31993e694344574f93777a8510f721ce4692fc60.0.tgz","fileCount":33,"unpackedSize":139655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxS5CRA9TVsSAnZWagAAcSUP/jXQw0HvJqoobzI6k7ef\nbnAXbeiCcHzGvEDsKeqLLrlcUG1ywR35BERyMRGeFSE1LKHGQwhKeQwxxjaD\nbdiMnWieChoIP2Io+i9gaZi/0jVseWzu7maqU7Ffcp/jN5oq22f2x9gx7r95\n7BbAEldIw4pZy4IKirlpPHems9tkyW+5QkAGeQtYiKEqGS6mRmXg+SKu2v4j\nJjFYmHTLZLNaf3owNK/70fjoeDDjxU0kWVupy1q5KV2SCSuJzClCG9REq7RV\nHhCpeK2brJUTvyUhgwJYjPyL4rb0e5VjmX6MbYA0RpYcRyuYhHESEqCm7LDj\n1PHX6//94ALnONXwJVILRu1+GGLmj91tO6l5B40+6VOqGb2fLSo1yBUsyS9U\nU15WGN6/BPtrfbrQa8Udsyyibuvtmd8/1WAFkt5747wg/S71N8mIIueKOHo1\nZ/SC3W75y1/4lbFq2rodh6A+WGMU6QCDjnY/vKhjDZMataadtW3MTxox1fLQ\nwV8OIraPj+U9SUnODel46x4e/+pDExg8rjBiFJW7OYJhFuRXqn+9+kCtSy0n\n2I6E/GKkPULMQmu4e9D8SadNIC73fhBwPbHN5q+nu55X5aCsb/Pst/9Fns0g\n6dXG1vnBgwkiZSTZuwx4dfDYP/7T3CvExCj1DERBudlPi5i+kwDTfd4Wbaax\nHpBZ\r\n=mmi7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5TMtcQCR7lRGRMY6RZuExoNzbcShdz7TiOB2msIfyJAiEAqgLcrYWHYdXVSWZ7j2ApdxXAXjDlCQG8YZzEdOohyDQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-31993e694344574f93777a8510f721ce4692fc60.0_1589318840485_0.4899706497162688"},"_hasShrinkwrap":false},"2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ef0ef96ff1673979d2840712f374bf0d43b51734","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/2ceGlBwIIU87hG4FGqsi9vRuMASLrlVvmXkuXyUIOyd6BU2j0Ozelb381CpYQ4Ytb+/wnstUkFSfaB8y4HFHA==","shasum":"7114a5ee2fec3564f8787a76269dc08eeb801acf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0.tgz","fileCount":33,"unpackedSize":139655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxUGCRA9TVsSAnZWagAAV5AQAJow1XzpdjJYHX7E9ELa\nRGaW4DUhYmpLcntIwMhCo4A1PIeShWJosKOSd+UMPIsQhpXEHVINS4b1mAJr\n+V0bLqAbfe8hWOAfGORUjnei/RiILbGBWYnuuJsZGgFzW5AwIV/XnpKsKrGJ\n0TATB2f8bR4HW5DzJ45F2jQrOGVN9bq1ObpdMRb6e39H050Q/fZB7iX1sF63\nRooOT8pH2+7PlBNGsxza6c4dmFLynsmRtExEGRtKVpk1AEJCJ0eHzBgdl8r7\n+M6lRJkDst344vWQcorgPX9GplyTV1Z6mwoiPfbAOQMfbD58+cv0iO0id/2x\ngidcxPlpcPgGNiFZ9FQ5XRyK2ZFjjPfL7NxU0a6PvjS//7vyyXRfuCCFcgrb\n6L4eRXp9EHNr2jyzIFwyPHFwreIDjOH65NfH24razngRT/SkaUQtCszS3Vy3\nmSAkRQqMdl9kptiRyFQK3YBCllLIQhAfHBcm/nKABoxqPD+VG9ejb20r5Dab\nmKAhYFawG3Lki1ofMIZjUdt9LPnxMNE6wSg4sGTm+0KVW43fe7mJaOfSO99s\n8yfZDx2dg/oXhWzsdq1/fwHTJxNzdy9/57NB5QuNCTlkDAdsRqt5AGhgNVYi\nApIROyzd61jO7YQRe2goHeMaLnEfRdbZVijCrSdL3rpCahCHmbNldOTlGuBy\npj3o\r\n=KhTb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICG7A552kakHBmklKpu3tsqIOKHpG+piG7ozvOpvQKiwAiEAow/mFyeTLM0DO03yZojQMDd9LSJZYjhHPdudZ5/UfpE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0_1589318918140_0.19471940714041214"},"_hasShrinkwrap":false},"2.2.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.2","gitHead":"5c37b02942998f971c92f642922e29e988665164","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7pRp55Gbbtbz23XV5dtq4+xQAA2r1AehaeapvENsUuFQa+b0wGJn7eojqhnULIsDPhLw0e2B9J4ypifim+pkHg==","shasum":"ca528f18965629015df2a1a9f05e4c2f8500d68d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.2.tgz","fileCount":33,"unpackedSize":139888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxUZCRA9TVsSAnZWagAAD4cP/jOdUWuYDOl4Qem+5twT\nkSGALB2DEYt1fFvP2DINY7ICBusZMUlsKM7IHDbOlGyn08mH1+ZUnW+S63t2\nd8Wswb3t2KwzzCakPnvZ8YBdlfXtKtlnwWHDVPL2vZ6HjfXC7Q459bekTE8r\nGTRtZ+GSjzavMKvm1m+rkElVtkUzbzPsS20TC4jB8ZP8d0MsslIdpWB1UeaV\n4PmWjjqZ3OAKWKNA/vgTz/r6SIaP3eYqjIEBlWorpZKmo2on1uepfZNrRjQC\n7gVLLHf/Yif5J3rss1OK0uko8VX7kIl8tEJFPIRXXVFvFBXSpFeMVsqM13Hv\nEG4hIX4CEjgw+mj293bhZRvE2MYJQShXIXPUUwPqIIKC3CA739Nv2IfNVI9R\n2kQsQxg27n7m3/Y4D+mWu1ouQ6VolsOly8DsTLqCm08uvbmiMezoLBA+1DnG\nnvTzUNzaydY2quNSxN27ZsECxhnNm8b2N30Piz77VS1SNBHjnnWsnoiaaGtZ\nR33mcR8EubV0vL17E71LdQK8qiNefPOUtu8jSh34IvHszV4wZz+sYephCgJZ\nNPi+2ARNReI0p/SHFU1dc+0rDwBD+pY3dM0rvHD//JHJwcNEe4NTg7j2vYAt\nRQBvjh/QJ66MuHTDlGQ1TT2o6V5XtCzXwlU3Bq2S9fGRNEUAGZlu0fdeMG2S\nY3En\r\n=BijX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoaHN5aTkieOogg6CXkz6ogngZCNDPKwBeQpnPg2G8GAiB4e9qJcHS+EvjUUipHCCnZxUsW7T3xF+H9u8wLI2va4w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.2_1589318936558_0.4070176348127077"},"_hasShrinkwrap":false},"2.2.3-5c37b02942998f971c92f642922e29e988665164.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-5c37b02942998f971c92f642922e29e988665164.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5c37b02942998f971c92f642922e29e988665164","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-5c37b02942998f971c92f642922e29e988665164.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NM9iq1IeD/hNk1Rwe8kzNkgljyqRuYEHAqrhB1KHFqr9280EAqBd8eRciKoTqAwekt2b80dyE/VGhevvpCcpuA==","shasum":"854c6a6f38f4a583f6ddf04a372051cd94e1de69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-5c37b02942998f971c92f642922e29e988665164.0.tgz","fileCount":33,"unpackedSize":139931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxVFCRA9TVsSAnZWagAA4UkP/i0/K0RxBipZlfHn/rfU\nc+vAVJsTrZ7wM9SKJVmey68j33Tpd/ePQVzlVTEvcV7dJDfy2vWi3A+GAqhx\njzoubYKm4vbm1a3XZmt5l5Rv/8X8MKc2ex06yUntliGnLqOmvJEvKV2lm4C2\nSe3lbFLITf1U66nWPRUv2BP9occduajqts7AvFN/JiaYJL+UHLKdXjNEjW5q\naV5TKGxqmJsENMIBWCylb1XL20M1YsFnFX2a4wcxVkk98cWagd69MbgdRH66\nbj6HEr7g84bgN1FUU20hteiQGoTSHH5TYcb+vButABUNCTfTira4FShkEeeh\nXkwNIgfYgZf8PxNsyQ0L3HpSReKwpTfHomtML+tIaMr66jYgQdItuhNM9MQA\noiZJ5m+MzBi/oO4ou+8JAEN0FPPel8zx+8Jmrug04pW/Mb1canaRoEct1p7Z\nd51Adpv7yWu2EzKxvVxJpoiPl8fG4yZ80FTAv1eRWJOHPlyfU6ol+eOQtIGK\nflv+TyxPHAHOpYcIylEAruOeBvmptsT25jWK3wakpHukX1xdrZ9Y3njhO61l\nzitW72lpBR+Y/meod/JMN9p6erSZ06lXlEofGali85XJ4WkAVySuYfAXL0ZK\nGabTEMjoerUbSwawPKgBYa78mEj5sVcAN+A0kfGr2NZMwfjuds/MhfQ4bEhx\nII1c\r\n=+1Rf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrgQrcjpSmptDr18hcQ+u3mI4BVGWq/i9SPlZIi2vNOAIhANpSsDWK7/tjBjhrhmHCyvRIXg28rAdEq6qLBujRZOjz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-5c37b02942998f971c92f642922e29e988665164.0_1589318981135_0.4529956096972316"},"_hasShrinkwrap":false},"2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.29","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0","gitHead":"7e59761ba4f6238248aa3439e0519240435e103f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jqgP5zVeD/Ru6jbfnwhudfvp8kLAuP3JUfDYwugxttkoVsIeyJtN9DQ+RnqejJajgFdI+qxKjzkoL7cxpMGGvQ==","shasum":"74e23706315ead0fa118602ca422237a4054e629","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0.tgz","fileCount":33,"unpackedSize":139931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxWCCRA9TVsSAnZWagAAfVgQAJPiVN+P44gbzTi5FUcH\nMAh0eoa5IYjdISSYBDGnR8AiJF7oe9u0b+N3rZCkHxwAkKDC46CDKGz3B8t3\n2iiJIIA3A3RUzdtqHsEAASHt7TDOzkse+rSFgv73WwA8s+gaUhZ0MrDKhxcp\nwKxLma7KCd94s3ZqXMlpyzHuUEsOoS+RcfKpfOK1sK5VhESVUfQhklDVE7Lv\nAxDTJo2YFW/zyleJvQgMhCsMkTeDw42jKd5vRhtErfiyx6Ix9PpmEeOrxywR\nqVwjiVIj70/2syqSyqt+mFZDFD+DjKd8RH/w1jCerR6uHue4QeUxU6/KAShY\ni/pyuz3M17xKue0CAcXqtUzoveexYJAiU/3nXhfTLU5JUx7to40YV2nwEPFp\negrHybKB42jKAyMYogJjOOVgX+EibWmhZ0dG0+N9EU90Kmr3mM62x/jSdv/m\nknsOgXZj9DMTu6vPmQufJEgU7Ji0EGx6uIv3PAL4NcSqOsTA4qWKOGbREPYG\ndhNjquKbAGUH8truXREQfmna5BDs/Rg5llwR2XQqeT+a7uATEBtGlMRH5dtQ\noc7PBTjNgR1GGyUbW7gn8bo85ttd9i0lVxxjaDOD4GIkRqGtMW3h6qmcVa1g\nF8B5rcTmBP0yK6O1yxrcCuNofX+QZ8t56XewXCz5LR47MnPoUaUvzjS+QIAy\nRLlF\r\n=1cwL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs3HFqjE6Y8hYBmm1sXpBmaU8S41psQFP8OpldJPMD4gIgIgQZ0lBzisfMAkWAvn6FpgHZmcA60yE5ps4GXpGReL0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0_1589319038053_0.8137532607534548"},"_hasShrinkwrap":false},"2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.30","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0","gitHead":"71c9698cc105408ca332ceee94a22ed1429febc2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2f3rgykeeeO+yeMaVueofmGNGJw/uRMOL81heJ3UB2Xm4MH9xe2DpIljyqqFQlV8MWNhOoKA4ho71c+tQjFsqA==","shasum":"8f2b36971968987312cfcd70c706eb9fa52e7f0e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0.tgz","fileCount":33,"unpackedSize":139931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeux7mCRA9TVsSAnZWagAAznkP/1y7HBrT2wjLcdD5XM9w\nT0vfDS/UHymavkRSwgYSb/RdhQE05SkCuzNH9MGaZmw/2/YBOzD9wgX2oGF+\n9271Ze/jme97Wavnut48m9uMtoYIsC3lrTVw+E/2TvCuDymytFlkoggeh6Kq\nL8/bkZgGMEtIzmPFpE168mhujKO7B4B7n2EPM2aSqOoNpRrzJVKfIaj8aA6S\nuAesLE0AxU9S1yBuSqzpL0ZM1R8DjsDWRwZ1a2U5fsZEirOdCVRE1gJj0Ly2\nt7Fy2Rxy7LJeWQdMH1r+3jjTJde2qFyz5BJuoE3BjAjZyidSBvJrr8/Ay7HZ\nE+/KIKFCW5qzZvPbmdr9yI7NnFPUGyWORzOgt52O4awrUy+YthY4FNpGz/lj\nAd0Wdcgemt0ie9uV4aYliZyJ5my9y8cfXSqetDOlNpsfxSFPXaZst60fmb9i\n9OPDN3KEwu+xQVDKsqudcVorfkKPfndeA8letWmEvxCYD5jjIqjXgd0o9jIB\nozhoFvWbF7kGMEVtcNBFnVXinRSj2N8O4fWWw/a0VbUEZOy6zc2ZsXLThYC7\nOWKithglhL3i2Q4dQAfHIJe9RHRZz6slE4xm07kuvmtw0aLdfgOBgC46Nywx\nDuSRoFbD5RinYP8ucanL8IQZY5g2+T2+YAyrCkE2vpZGvpECuvetcFDM9VGQ\n1474\r\n=Y8HH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxbrwXRaAbdPgtrQN53nhDWN6Z3bQ0FEcjT/U8K8OoNAIhANLVjNYRFMHvN0Dq0e8AnAXC6G27e1F5nIKecyF2EAd7"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0_1589321446213_0.35443054775259997"},"_hasShrinkwrap":false},"2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.1","@types/node":"^13.13.5","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0","gitHead":"e30f5757785ead2b6d1ee26c7e362656cc0b3782","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-b/Wg59fz1ifZLE3qbVMRyTCrkBzrSDyZlHLoIzzxzUHrqqM6gvSHPyGS3yxarQQDzdbuEwsVUvtMRpnscjQU8g==","shasum":"d54ec877e2b193cfd8ee4d2cde97babdbde71818","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0.tgz","fileCount":33,"unpackedSize":139931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuywPCRA9TVsSAnZWagAAVSsP/0asBrlqEetbzToG8o3B\npg1UVaDDuOssnXyp0JBU4V9ZPjj16s3rQeEDP48wnbsZ9eRTefAObPemfua4\n57euAUddrJtFJZ/JHqOezvyj1bYL9pdhWgk041FQko5uk5AWz3HiF3arhVxb\nKQm0IEG4YpuHbL3YYggYvYCIzMPawtr7Vu0vmsqh7Wex62rVZQ30u/B8QlhF\nzCETyvPiJgsHbCniq3OK5hIfl6HjKXQoNpLbbQW3fGG5bo9Yz4IusR3Fx+Yq\nM/+6dwRZkmX5M/nR725k4tkUePEF1iUbe4wOCs2JpWnM+GpdbUtp2ZoqIRE3\nVrSHrxnpThsOyXnXG176tGyNi9swiB1e2NNS7YFufCLtq5CotzYthbK7Es6U\njAeDJ5ONFVh0QvbdYS7VFWlRWTKyqOoIDa4u90AewceA0ML3EdbW2swfFPF8\nCIWHXdfB55mDwelgNTwf0jhpVYciwqf9djLjyMj0e9SNIkAYcGLyC73Ip2Vf\n3XG2Bb5F0Izq/f2zsBAwHDNAp8GjhLdbbNcrS4+O83K7b8c4VJd1jTTpM5n7\nlZZdZ2veb7Q9auWoX4JJWQZHx5iz/fwt7+kuG95fu4v2xD5i9e8kulSJJz0h\nC4YYIEBGM0uACIGn85aZf2ZW/YSca5zHI1JdDmqUOIlS6RGcs1CGaFFme9NC\nk3iV\r\n=dJHd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRptVicsQ1sLcSStpVFA7BJFSng4pZFREeUYbOkQAdSgIgXIs3oV4Cf+xZSXCeNmv3Jcio6wfGWl66ZCJHQUmvgcU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0_1589324814610_0.4244786458925598"},"_hasShrinkwrap":false},"2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.0","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0","gitHead":"fd18c41e93cc6ef39020f70089605de162d7fcf1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IKoLTa/5WZZXQQf0/nLSoUrLCX8Dfpib+r1UaQmKosJCLmwA1CwumNt1yRZJ2FHuzHtJTZ5Hw4rxV4g4nO6CIg==","shasum":"9694ebd63cce17821209d31f645d25c16a38217c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0.tgz","fileCount":33,"unpackedSize":139930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuzjcCRA9TVsSAnZWagAAWBUQAKKE+H6FXn/T/MNSJSSj\nPdSz4U+/WoYudg6dRP5bDqQWenS9a9Ngj6z8Jq6k3AX0/DVx/nW08eIlCKWs\nb9JxmgXkckinmbY37McsSKkRY7Akz0Ru7slyKzYvsJGLW59aZS4k1zTydGTz\neUMqquGy3wnN/7wVFF8FJjov5esq9nCPPE3F8idaLMRR7XXeux8VmznXLZN+\nXb78V1don1SdASvcj5ayLqHaSoDyygM07B2Hu5/8tZg3QKYwTg9h4KOEQwN6\nzw2yOTFG41U3sKJ1Pr5lTRygPFXQ1UZjcC6n5+sEiAhh04VPKGqZy68TCc8G\nTUctLwxyCPjcNLEykhV/g/fdxiyK6Vv5kIqoZHlWCsPMgQSHNSpsVicrikqy\nmGpsgif235pWCiOx5f6aI/As1zH84HjKlzrg58ZBddRPjHfxbkC4l2r11EER\nXtNfH8tio2JbdPQpslK5W6XsOmHwMAE5cZwFTm7gL8MpD5sBeZLsQ6fgEdoe\nK42lIKXc9kxN/IvkqHXfrb27oEaB+zYm3sulp/mYcOBia7u2o895rj64H27E\ngklVamVWfpOu8/5Yb657S7JBFVbso8bII8ifJ6w0Fi5WM7yoPkCciBluklt9\nIukzFe+4iLLX9VinQyEduFT0S3RCF4T3OyFbZsh/S21e7YbNeIRIMzobTWot\n+mrX\r\n=o/KI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnglzDYdCLWDmLeEqisqg3vgp3tguSBoH7anpvPj8xAAiAsjvECrfQ+yfOpg+sRDhpL6K1cWIC4/lfIA/dZqq028w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0_1589328090585_0.24400361453346453"},"_hasShrinkwrap":false},"2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.0","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"51764c2bb42b506d5f815616939d62af740eec9d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Lkw9IdKVS/sKjsgxCcg54eKMg8HI83wSTeJfpWPKQya1QmOf9MFisVy78MyX3BcZsLfuc2yJDCvVE0fblh4ITA==","shasum":"b49e83a37fe093d9edd886743eb40b44c71e2b99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0.tgz","fileCount":33,"unpackedSize":139930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuzktCRA9TVsSAnZWagAAzKkP/00ECijDaeB6pXazu/zH\nKn7p/OI2y6sbjipNtO43Pg0f1zUaGhyBuEQxAtTmsRuuWFqdgLoNIgx79wh0\nSInbO/Wo1TpBpA5ynXrbEJFFBgH0HgcTEAOueVTAc9G4KSc1jwNtog+HWs8z\nB4KkztsxVjsrMnnZcyIninmnYvEfpGD4D6C0zZXJPK5zbLKmgkVTofPJJPZR\nTBlUxtZ5H5numCtrUD69WGmdusZhRLPwgo7I65NY52sgKEpL5gzq2cTMXfQv\nj0l95qhUKf06WxPyk7MZXgcr5s0MCnzWCTU44M7hxbPtWk4xx5IB9nt1uMom\nUOZI7JXrvlvnV6H33CBHTiJSdUfgWV/A9cHQ1GWrU6zt6M4YwPHqKY9zQvnZ\ns8WwYH7fvao+1vMFVgTaAlzSIggDbIyjW2YoupOfFqoxWYqjdPiyaDAddGLg\nEJRYet/bvJ1u88LERkrn0rSZw4JoTA6V+coaP0Zup+Bpcmcl2BlSDlGiWXDw\nXzQFpnn3TBIXKzK0o6iCNYMKe3AmcOyxUO05HaG7T9+sETxBJKCeREeWs1QA\nMCxJSEoa32KZivDjelFz/UhI7qU9jifR0/VbKa6GrQLTxaK7QEqPjwubp3fi\nnedrWccdjtuf+yamh9OOB83BP3INjzKczeXqBxXzjzgpURN3pjpSrYwRRrfz\neLzG\r\n=Vtyl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBzslVN/w9LQgPMMIunR76gRk9jT8zHUEL0A5kVVVSxRAiEAg6T/W1/a7k4HCLwqd14I9gl0ARXePXCuT7g2Is5uBKg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0_1589328172793_0.4620152251665426"},"_hasShrinkwrap":false},"2.2.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.0","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.3","gitHead":"370d9897153c847499054c76bfaa5aa6e27c73ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.3","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-0vB6GdZ/nS5jQcM8jmSd2BEGAgqZrz17zyXoLfPNYkCypY1R7dprxWaxBIaD7gg2ruUamtvpM7hnsnHiYGDrYg==","shasum":"67ac33c3ebf764547acbfc83c9a53cfcd9a67759","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.3.tgz","fileCount":33,"unpackedSize":140167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuzk/CRA9TVsSAnZWagAAF+QQAIAd76LguXh3SIuAAxYk\nGVwB7peNpNx+Ta+0+mvZ6STBZCONL3zaDpZwgBq+AdjevwFglWRWrXjJ3HMU\nlvPraPHs9Imj39QjiBsvLWkul6nWZIjIiySunsAq1Kr4BE1xirtD8VK7O0v6\nAxX0Yvh6oTylmThUE3w4dgwn+inJoXAP4Lrl1F06GnnP6APM3PRh1L5s29fi\nlxw6F3zwYbvheTXznVt8HFoMaSOEyC7/m86FD7LN5hLQFgZgasUQruAS7WCu\nsQ9Ep8Wm0ndRkMJiw9GGFGfg49ygdZCI5DhTIUsOSsMxeBTHjouXw/kyppjB\ngl3BZj/uNQnH2BpMoHWG27Ej7NN3+EpLBakvz2iVvpWOeifNik6BP73dZUAS\nFMByL2UcvKBEosad0N+Rnlv3V+Ta+PDGIVAY9Xr4isMpwKQmGEKJPGSTWgea\nC84Ey8hz24gbLoC2qF6DqjvpZypPdQeNv8bfszSa+8kYeoUV0veMhc6prTn2\nBppzRBP4AH5tDoWnBjNbV1voz+3eC2DWLcU8Ma5hZL6IJIysWIi8QJvf9Ac1\n6+/lV0XkMlYGd8/79j9OW5mrBrmm/4lrmsxFcoR0bdfPR0DWQKXPmdkGGic0\nrE2QldnlMKSpDjew+QvMDSdRLsrMQx7MYX7NIvKfDfPHmNvy0el8JtU5C/BO\nm9Kt\r\n=QToL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUThbCKeald6rtrgVzELF0akT4LztIuUPNqWfhxyIwYAiBB+i/PPAn/dCxKp9XIdfxo8rjXuvg7h7gXmH4s7yBW+g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.3_1589328190536_0.9484662326061555"},"_hasShrinkwrap":false},"2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.0","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"370d9897153c847499054c76bfaa5aa6e27c73ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YauvGhdNxpZpoF7tjEhE9VHUXq8CEaY6UOli+SaiUe++BZVsFULB3gKcSxln5WFitB9F7dxjiqjYFj3pwXSlzg==","shasum":"2d1d7954257fbbff149c878b343e8ccc972f8937","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0.tgz","fileCount":33,"unpackedSize":140210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuzloCRA9TVsSAnZWagAAptAP/0dH0f9pc4ECwIX+YNzm\nYixj0MbO+JaGd7fc+nMbOKDi8coCDAQkh1BWr0AoDeqh6KJpekBaH2sPYKVa\nBqpTMwmQeXaQnUPLyEuZTAh3m6LyLP/Ms0SC3fHGxXVkvx9PWXcoRkLtgvke\nAFqOPvvAYtMhb+KfDLAyH1OODHfKxAhFneTEa4IF64ItdNRhfchWsSg/l2vF\ntND9R+HMh8zegIjOHYrj9FNxBz2//4wq6MW0GmV581wb6YWnj79Rp7KrwDSv\nkfG7qBszW9exgUDZ8g3elWN8MAZ5Jk57W+z9jvpZR9BJr1zJXov6FwDXP5sc\nbCptkJ9DKFyrfJ8dR2AdsnPzINTGWcVamMYUisdDeeY0B+BlEb7KDqRA8nk4\nasYlIrx7afc9I7+iNA7K0lWxY8UgrLJmtxEkKTBO61BNSJxZ0L/jbt2g7ykG\nDSv6SAYlCecIxu4X6BHBFl3hjFtf0MZ6z39Z5QLQtus+9HwScNmmpvERI0wm\n+ztOgRvPQn3/gIXvkI5nq7IncSBElwgG27AF4Cp9pJFS+Pt32IFERqBYwysJ\nuN1HhTMa1DAAHVVoM1u2Gw8evpzEmJLl317vtZJtys6pSqjra3VaJxXqqKAF\np224uYhrW+fjiB8tMKaT9GEY8R6A618Zx7ilDMSCQ3gqzYh3DEPrIYHqTzHn\nGFkb\r\n=zNnG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE43JfhmHzJkJP0ZzrHEOM8F8WfWwTGqKcJroBtUMv8WAiEAgGcVbGCTn28yMQacOMy11Heql/RPMUZDKuZ5NbzQrTo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0_1589328228955_0.5191011831940029"},"_hasShrinkwrap":false},"2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.1","@types/node":"^14.0.0","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0","gitHead":"5040a3440f20a3dac98a29210a3e3e51f311860d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-b2g6YKYx37bnZ6GLyfK47uI27vwklPQVen0wdTrBnWfSPM5Gb1wz5xSBczM1UnEbMWgMPzhye0CcNinn+k5hyA==","shasum":"88ee7ce99bc6c06b51c43cc22ff5298d40c93ca8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0.tgz","fileCount":33,"unpackedSize":140210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuzm2CRA9TVsSAnZWagAAjv8QAIuQRkHxH1HXzvrzuy4A\npcWtlid2dx6lFXRezfQGPH0SFpGq+MUIWMVWc7P3YaFsYxHdpVERXc6y3Q0u\nB242bHPcfCGqBeu4YewxDXM+bU9zAaQ10I3gLM6WdYTOOeanup2HEgkq4vhk\nTmUVMfdMwerAWfTwbTIPrZxELbEPsJGOLU6jkvEeEjnh1pAzrhk6yUCMTPEf\n688a4nlX/a7H/KgWQGi7/PWm2FeE+QZVpctmOJlral6L/RB4qgSfSRgORPZq\npDpIUWcN2E3NIznO+WgohduVRjCCuiTTLg2fRgdNQbQ3LbFAPz5EmqpCsnxX\nnFoBE05dpKmGKDNV/a3vtoUFMFjj+Dt7rnE3zvJf40BLfOsyF6NBrvvS7sU3\ncWpsi3e1/IKn2jEthE2EUQ9nfD0dIMb+DDW4L9pHd4K7qZxDI2/ZfTCjM8sX\nYnuSszO9PuuDoY8T4ZyyfnEntKGS3ZH/0QdQRRuZ4a2ufickbyKIGo+FgNSJ\nNixDaVbG9FRCp/vM1L1sWliBeiF36MelMTU1fOIBgn7X9sqDmE9xX4UUBTd7\n93vMIcW315GeVxfBpRpdo45CZU87o34+g0Andqk8rsU4jaBw4yqEmh/xgtLV\n1+Btc6i+2VFUtCXr+bWkl1+lhtFZNeqyUuAMh02jAKAwVQUqs7fwC7LXuP4H\ni2J9\r\n=om0R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMuQr0qGG5t836+AK0k77f6ZwQmel5m9dbxxOftGqhbgIhAOls+xSleb/sg64/IApJRNcicUffU72qhw7deZr1zlk+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0_1589328309930_0.8102552701065349"},"_hasShrinkwrap":false},"2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0","gitHead":"769ebe6e97900e80d1b1f9f2bf4121974620af81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1ng1fkApRHp/uEgJHeBS4lECp4MwixwA4/irSClA46EyX+8HQBMSm6Iw4bvqmHe2UaDksW7fikge3gUfln4ZIQ==","shasum":"df71d792f092f826297875e6b142ef75d5a52fb5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0.tgz","fileCount":33,"unpackedSize":140210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0HUCRA9TVsSAnZWagAA8mMP/3wPk3kwDRRgmr6vme5j\ndOOvUXG0fD+kwm3O8h/D47DeIX5jWkM5eN6L33soZzkEmOpbQfGRlrEGM6BM\nM17yxV8M4qFtyTKXDqq2xzvFTgZZEG+m9xTiNIA0lbL4AwYcx7slekE6Lu/p\nrPcx/kXbaafnhpoSBTH1sMZ7K/njpdlyqaRotoxrc9x4NTcY7Hjyj/SSU3tq\nVgHl38twX5RJWA1OcPAF+QUFYYUO8K3UmyKNg2Q3AFdqCQIeZgb3doAKcx3W\nYt4RsAjpWY1YPnLGCUTOR9NFIqTpE+BQDHozARhkqIAly4u0RUCWiadxLkCW\nEJndeRJWX9SniDZ/a3vPiLPb0H33lW4XaJNyt+GegYQrS3XqySssQEreJlZS\n7ZzqnjdKdYwgujpEKrmyOR7CGwb4EfgC2ViB4Gqo1KUj+BHGHUrarlV0a65A\nQDawD0FrvIsTYBF3Pa2DY6hzFsf/gCtzj2r+HZc/3cxrYBWofvhbVVdmCQCp\nj6lGDRq9VvRWv1u2Gm7+eRw98FTr+Xkixg6ZjIIMyZBEMmxBLUXnLbMy9/Nx\nc7bQRozfnXscv8hpDoEPtuJF686QGfHLg28iJR/OHlretRfKUy0tmayahgnx\nudsrjyAL8Ig8v/x3cRnRtMBFpmx4Wg29WKQWj7rxgTbjlU1INDwSGhHCRAxm\nFqES\r\n=gZWx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBk9VzwLSB6+g3Ds78mJJABjfY6pTnCeA6hsTX6jRQQ8AiEAlmFiTi5vuP8NIsrsmNEjjLVu8FcdO9ao0vlWueiWnUA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0_1589330387894_0.6776193561097372"},"_hasShrinkwrap":false},"2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Khf7djDYdj7SKK69ilr+T/OjdoSpAISW+N1tl/eANjGFo/iRZSQWTJsL/oQ2OcL2KO6fCc+QkT0T8PFpBW1ntA==","shasum":"7a0507efcd015b025c70ea37a0d4acc8f59e7040","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0.tgz","fileCount":33,"unpackedSize":140210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0IkCRA9TVsSAnZWagAAs9sP/RNkzzZbks3xapaS0QLS\nzfv6rKW3IZIR5pJBEyiOebsk7i+9pB9BS4ZCS8xkOeocdxX8EsxRz7MzlBSf\nDYlUPbEfqmaCkUCfNLgAohAXEZEYpo7xomTrBn6Sor69aEXI4mPwBlwZcd6K\nm+k8JFcs3lMQ9joOu7u7HFE4NDo7Wrkd5a7KPHbJ2zyn/kc1EU/nNCSE+VVr\nuKKeslHGyjy7oAeX9OQKRYqTlaVrJS96FleAf4ZeDUnc9eyMgJF58tU+pujg\nw+o//2LHv84XOh4bCDK2ZG4eLN8GKSEvaW3MtTWqed/PxVyi3XsDoJgYvJs+\nf8vQHa+hqtjkpCTZykwMVN9fqzULPC1xCfqVFGMus3P6ttFAOL886LqVX4NM\nMco/6HC7xbnB1JNjNrUXs7hOHJvgFhMDoJNrRJ9n+BUAfr7a8oGdSNokKHbW\nHPt9zSwkkax5CQCCc3CJnpQ4uSNf3S46p0ppSxlyHq2ii5axDqhr7tGlEfLs\ny7rD4J5Gsv9FV4/rnUAPhQ8dKo2aLCfqQET0NZK2BsjsNvHk/tjZSumst8W1\nnbb4VOYLcQCrN7Wj/KXVwamjAhJlhPCynjpv948oXvDJY6s+FXJ+/7/DBL2i\n1tGhxZM3yg3PxlCO0rW/ahMhiAiHGLZYQdXZuiptukop1CMCs9hEXU4NK8Ge\nSWJA\r\n=c90/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuwgFzIvXHQFoxNz3nDz8yV1xRBzNxw9tvCpi9An4+OAiEAtHJ69OiZNFueh6kVTvMEY0oeyMLVkp5wtnjaWjJcrKM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0_1589330468426_0.6936142329628188"},"_hasShrinkwrap":false},"2.2.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.4","gitHead":"8c27af05f0a55404e405b1e702c915e8b41e05c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.4","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JG/nbGWJQhmHTTlOUeN6s2/zrrws80+ISIUpDzFJ5MjHszi9FWnCVCPg4EMJxiOe2NIdhuRs+AV2BUjdiGJkRQ==","shasum":"65df9a8e57278c2497c72f20444f029b0587c0ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.4.tgz","fileCount":33,"unpackedSize":140446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0IvCRA9TVsSAnZWagAA1QEP/263HHzRGIacZL0TydG8\njZBDnS+Hofmg/D/WDX2gAiD1B76bE0KpsmQKUiDQ2S/h3Et+4OpvW2eRjiDZ\nw2O1TmMNJ1v1drbvUfyavRH3eul6iG8vU+kN5+Z/rseW9do0UQ2nVojewjjY\nJgtfyp2y77tb2tLFvx7X3zl9U2zCEqFOi7OpM86IXfMEOo+enbC+wFkdJkXr\nSjRgzqYkmCBvf/MPmx10FP4uz5qDy9rpTfNobNyZI8OovrK1s51B3WVlNCFt\nV31vZv36utZFzQHRXy7K2KhxfdZO6RPbMiNKgUuS9BrbyABVGg5YnJqzG3D0\nFs7C/bbDV12faXkdcHiA47rBOmTBHfjprtzA39ObWHGYKP3mY1I8G39kq7Tq\nY1XPNBW1bK3LtlBbrqr/iR2SqSG4wcboUxCpTdUHKRUMg3PNA6uQQIY75ZS0\nBe24Z/Jt3PsuNTLOdW381bLl+6jIvvL90MlTRW8z4OiMLDnzlCjZbBpjAcIt\nKMqRDn0TVNlxF8mkCvJxcuRoXZgW5ya1nnAqgIS8Y/7Axo0MC9TpyLYOF/Wd\nXumbOK2+5oZN7eYT7tbS2MJ+ACjAMirOkHcErNygpHOVrDLtit/7jeq/RDhb\n6rGp2SNi1FC96KmnFpLsodzhopVyARo0n6DikFDnHW2wItyvT74he2cl2vEd\nmd90\r\n=YhVd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4pVt7BtMXwE8Gw9jhHpgjYAw7w5Eg7/4UO3p/Mp4NjgIgRQA5GMmcjjn2ZFLEpCp34DZngMZC2pMJ6anq1iTYSrU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.4_1589330478996_0.6988286002270969"},"_hasShrinkwrap":false},"2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8c27af05f0a55404e405b1e702c915e8b41e05c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qm3VyF0Ui1AxSmI/zLivuGeXvh/NF/5p3t/ELVtj5Hvoim1ovxLV3IfEIX67cq0UgG5mOI2HDB6ahGV6puLzOQ==","shasum":"56ec4a15895aa217154cc713c1970a364f7c2a86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0.tgz","fileCount":33,"unpackedSize":140489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0JbCRA9TVsSAnZWagAApI4P/1nquXIOCq4EcfPdFrd4\niPovn9Z0C8w8J4hl1zoo3SBDnS2Ra/uDRmo/4MtzlRVh2idRxSGAgCmY0syY\nCLXiXD09bhfhzbqrjJYNvnGW/W3RG8TuZkWJW0pRXNEKVr7d0DL5BcV36/rV\nIAfOOCOGZRyXvYdsM+qFV39hV9zAl6eKoSsibifYg87P3oPhkh5+0ulgn2vH\nllHotAG2gUBcTEo0ku2sTDyw/QkoJnbjQLnf/uaQVT4Wy16VluSw6dyk8KSS\nhsXLhI48qQqcZQWKfC9Ae254XtvuG71quug3rVd/iOVE8fPiMRBIOHVohTfs\naJQHlXV0bIqDNZoXLSvq+ElQGQa0omA5c9fn8Qye2dJHipiCj/dTRnyGYTb8\nUmx+dyvuQECMyVVSAgjO/4cX9JF0N9FJFhRwsf9S/Oe1bSIKvvKXdUIFyuw7\nFT1MlusVzlKAuWrQAbxEdNreD7Mbet4VSj0bbz6Pqx2LWNp4AFOMG0KK03T4\nYFphAMmgFrd9BR95I9ZY4KdLIT6DhPxk5ggh5usLM9CSWGY5LyugRpG/vS6B\nf/jnqKE2XMZn0bkkfd8hAU1/HRaOvv+CuNSuxfHR+cq30+LP+QyZPws+HWsu\n1cvio+mRGciekQpFqaT39deEMILrVNMv3dHsaiJ4qlBp2fdE4xE9k+sPa/2+\nv/4t\r\n=9NAJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEa+5/Dl35ViWA8ozizr5NFNn35YRnAnJ6+xuuRZc4DOAiBIuvb3CqHy75/ZA+Wtq8N11BSakoPGgiRDP3XW1jUpdg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0_1589330522534_0.5068836880296737"},"_hasShrinkwrap":false},"2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.7.5"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0","gitHead":"a6aba05191f40beadd8459e2ed9000a2b41a38ae","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XtqgDOEkhPmag0UgW1jrtsEQFeFUaWeAP/utya2uNkGc1Kv1vu+MuJP7XYEf+R30fAG7T6Q6eTdrcv02TcQ6+w==","shasum":"f568a4554894c34c3b00011ba8836c51b14a0d89","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0.tgz","fileCount":33,"unpackedSize":140489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0KjCRA9TVsSAnZWagAAllgP/jMjOTrIxIwKVup4NsHE\ng1md4vHKqd0WzOf4poAaYebDe2ZQzbOlDAvEqY3kmxzD8lblcdBNQEHqMPOW\nfxXOJdRuDxEJTCrwlA61iik/ywLNdoLUBRCzdlO8YzekYkMUcWoeULjhmJEj\nBlPNBvJElEY4vDqA/5h6h72foCD3lHhixIS6dnVV3tgJuOSWmfutseauuajq\nLibFxV4kNzScggLgFQF0+6E6iE8pukLYeQffNBpaVHJk+nbRs7lnwYSnsQ80\n5cAxIi2MH2AMCb7x3Y/9volsGyjtgPk4RKVGxn/g5xufZ7B7cjvLBY+u41n7\nBEKLczwgNHrYSr4ZwWkVhJypaemfQtu/sDdkT9YRlpDXPk7+HJj69l83UWmc\nQ2HwQbrSJ/A64VEUjOGJg5AOmInFR8w2CVTUQ+T22aay8BpT4tC2wBB/FTEz\ndW29cfU9OZefV9sL1I9nViPN/ghiEGU5YsrXfSqimp7KYtvf2ysIQp1vMjd1\nbLY/Wq+qetz3fK2ySBDJ4PbR8yix/xhK6mKCuXJl84jGwWsfPC9ALVvIZR/F\nPMfcOkbAlRi61rS9jd3+Bv/rxZCeHLi35WKGhUoRa7xxcdpuPhKCDrNEEv91\nxAm5yR0p7qWFkxOav2HS7dQmcxQr95hxGaMxVSYxCQLs1dXkRjOGyJBxXbi3\ni2lJ\r\n=8JwA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDepskXrHap2iwT6iIJG0UpZUmNrvazvEx/JtMfcNKiBAIgWxjQTa0/pKKGmjprlALq5GVlI8GNBA0CO8YWGdir82Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0_1589330594920_0.19287162043919204"},"_hasShrinkwrap":false},"2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0","gitHead":"c536bc45210ca5aca87e8dcb8675a0b481f1bc34","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-eeHyWIs38MPlpli+XbSMqRV8UIN2x08De2tdJ5oD0f22NCEdXpDpVoBBJWMm08JqxOeDT8DgoC8WluRJaJtjLA==","shasum":"b91d092fa1b90fb8bf9829dbec1b49032911e3c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0.tgz","fileCount":33,"unpackedSize":140489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu4YECRA9TVsSAnZWagAA8U8P+wZUyDTAmyWPvMa5sARb\nsNd1PC2POThDeGz/Zne6ItJprMNdziXTK8gyAJP39I1F7w699+IZNBFYUpn0\nE02ejIszhTawtOuSUi7Lwmbz/K9/FqPzjx8PP7v0oj9AVUdFWuxDxIpQLlN4\n5t/5YTeh95sDe+ol62ZH6SGhFUBOpYJmV7Sai7lF1RoX1cTHICh1d1JKGQM4\nRXh+cGnXNrs7fNNh3Gx5WyfFm+uDnqw8FmFBv9KUZ5IfKzFof1DGcmhce76S\nOIHSEXbLJltGtDqCZUIbWe46HuHNkpT3+fr3GhwsG6ooIAaz2Gfq5cYIrq9q\na5/2Msc/Br0j16id+BMUOTl6bxAXYt4w6keQlAPv/+ZQc4zD9/LeAVv4T+Gx\n2n3SYzE285oX5RMaogb4e9tyiXyEEtVsRdnwW7kIf6oRQv9bJk4zzpbYSzWC\ntmd8KNKM8EciM3vglvHFg4GasCIMFhaFwv0mpTc5olJtQMpcZuxKk2H8XwBr\nPgxGWD0lIvZp1fSu3d7OA5FruQHf2HjOUXyN36GacJwOeiRDXqfOZ29R7Wcc\nZn6kKpG1SohdFADwpGsNGYOhL2URnESJAl3FmcLV0D/5VsmOSGj7mIZ2D2Kb\ny7Pr3d8IGlVXxjhYbfttmxdAt+NWx/jB9P6FXA+o99/AVwV1S7FDJd1GyUv3\nTfTc\r\n=zDR8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfICZCz81659HbApAxixB1ehxM6VBWDThupwqt0jshOwIgCbEjoWrkgix61waCQraewq+RRyAVDxlUBmKbRPNY89A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0_1589347843805_0.5881947249402817"},"_hasShrinkwrap":false},"2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4d196d6231a2ea98a1da82bda9feb2de1ced6bf4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HovV8OlS+cohhOGocfvYjudbfmhcffC3QEHXz9c6PTrZF6CPwWBiEQF0uasQD8SFg7cyrv6LZJwkhviFmHwIcg==","shasum":"a368400acbd1f8eca5795491556969439eb1ea7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0.tgz","fileCount":33,"unpackedSize":140489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu4ZDCRA9TVsSAnZWagAA+/UP+wX3zW+/vfWM9J0dFygj\ng635ima76XPdO1PAmOjqnH3cpTGjvyF3/8YQ5zwkfRYRTe9jId09332EeVRb\nnyI3NbRjJLie/nozpUUkZy80eXB5yCUPRr2yw/Dxosp0N9jtFZjdrGoSdCT3\ns6ChzxnXURamHpU5UI+geChRArP2QfgL1r55D+yu0f5qHnqRBowkVWm+yfW2\n6AsJylko9+TkevHqQUkKGRj9p4LLZ6llUoRQ+ugj5Gol7FAWVpmCiHMVrAsr\n41SW0o7AcN2RAmYbBhXwgazS16z3nmpv0kT1dZn+VvB8T9wMl19/icyoMUn9\nJ+YcX1lRV0D4cJAFfKhblO2naO90GTK5P6+z/j0CI7pK2j9z0PNTqFDV/IVn\n/mFcMfYd/Uzi8V0yY6ChjKfFJg02jOAHTEWvpkThP6cPOtEIXhEnBnETr1Jr\nUS4iE9JgryA8yRFJP84HraIP0IDltMn6bSkBKmElkC3jDKkC7AH04jVNKFfP\nzzyBTK2nsJ0CwVeQIqkaa4mqgh9iCf0YDim0deLBdF6xRtaNHDHotOW7yt7w\ndAqSw0meedvKvmO8AtCicd1QnM8NjPWvcX96pLhZhMYTcT8on1EsYde8poY7\nOo+joy96bmoXktmg42sKY0Ru4yhB7lhlSp1rJT+66c3UmkX2GuzWS08ZdDAX\nEx0c\r\n=g2Sw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3C352ptYP+2ZzvPYYboxR2Kha0ea9FFi4iyF7+wUHxAIhAMHA4nGXG55SmOoujMhxSjZexqlqjszdloUwM6opJ1sX"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0_1589347907216_0.39246293666796817"},"_hasShrinkwrap":false},"2.2.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.5","gitHead":"663fd77dd6ddcf1d68fa6232c5ffdd26106239aa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.5","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-d5KnsYSpsmyAaE5o7NvA9upFa3bJjCBFsVS15sEyrhRz2KphRIysy0K+1qD9HvNA9hKVdraqQ+87tfTqn/MfFA==","shasum":"6a06dc44b2451365b387e66f49699377feb27e4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.5.tgz","fileCount":33,"unpackedSize":140731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu4ZWCRA9TVsSAnZWagAAh3MP/iXTPRnU43yrzDQZZVIh\nu49efFy05atH9UKXSeVj3/5emeswQSBr6aTjsAKJQbjidItE5/hk+T4fXt9s\nfPn7bmDhjZJxTf2euB0m9O2ofh6hnfj/jleeDqLehPyBQLOINKlZsiVjAljx\nGivgHtwYuL2SRrQksyV9bxx1wTaV5KrxUVI1FEJ/EQKigkoJGUJQCzsd1XxU\nNbjFBe0zaoXUm6iVN835VNIkuxhMjd3gFbMwpcpwAYSyEaKyh9iZ/R/mo7wL\ncCfYmY/gaBfypFomsWQNJieXHtkCcFnYDtJKptSkOTHbash7i06uR+aaJgH8\nRKJY/XKCuu7h2wFbqco6j5ktHuD4OFfDPhSy6vYF5OdK1XnFsA2FhrnVd07E\nRXVLfaMkWXG8URQzQ5VbK8ErPenQivElaSmtjnycCvvcNnas2iFuwhp9jewA\nMA8suulvivRlW0evGP8MBI+nnK3q+H98dOH03gJAFSQzamFZaLt8V0l76ay8\n68hMTEXoqYeN5VsF09USiYNsHBHRUIOki8kxCKnmJL+gWwaiZ9Cs4jx29PPo\nMDwSQSszm9B6JusaQATeEa69hRoN0+Y9hn98HblZEYuBaktH/utXG3Nao6Xr\nZdgdN4L3I8D3BLJVzygQOj1JhZfyTjvRoRGO4BpWNOId5RgvhPyVM+4933Xk\nSGta\r\n=/YKW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQm02htMDvrWJuf7PdgVZSY0EHhYBTB6mQJpX7K5TJrwIgOJ6v7luAN6d8qmaA8Y6v8UwWmYfLZVTE5FbOsoFkoIg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.5_1589347925905_0.3773653060015323"},"_hasShrinkwrap":false},"2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"663fd77dd6ddcf1d68fa6232c5ffdd26106239aa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6gchOrBO6bIsR1PHr+9U+TTDUGqO3MuwgSxv4q3H8vzIc9xS+FrNi9hbzc/XYn3O8QdMk6wuRkynLjHrzchPXQ==","shasum":"4425622c99e53f9f5257d901f7fffc13bd994f56","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0.tgz","fileCount":33,"unpackedSize":140774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu4aECRA9TVsSAnZWagAAwUcP/A17VIR3DmGqRCHaYHW3\ngZY8FoKPAhPy8qPMOuGEIIpfb3uRRE2U6QYBdBAHzB8D+mMCOcFsKOuvrq+T\nuCWOl23EiGlp9HH4cPJaPaov9ZAkJ1mFE/RDraxOR4dsokxzLNSoS9X97JMo\ngzrMsgz8MYGloCVXW++5UEMPGfFkX0jq9ygeeYzJC9m2msY4zwpk8GHqUbRt\nNyjQFScnNe7hMRVbzT5wgvpbvdCR3e0AfE5nEG8JqX9RuzkAGrHWQF5O00vp\nHn0eOgNeXY5VyHjfl8nDSQ15FY5DzOtoXdPW8k/gkfZGq2HHuIqUf1fV74S+\nGB9ZkZKp/g0O1CaciE2smBOPK2DoiRD8op20t4VuyN+UtHruRrauF72ZDtkP\nGtY3HOdTNSwqPXKbWNcqTgg7wReWIcuVAfEN9iGmzWRQgAD7W4joOYBJlile\npxWk4lvfKe0r+ydaftv1Q8NwYdZ+Fryp5PMR/sRvNqCqezTjvxHyYTen2mvx\nZK+pYH1BzE8zRLaf0UeLRbsMTtfDNuhKqYDI6YzOC1co5cEOq4gAppggPnPv\nlqRb9GSkv67wyyqTy6Gq3O21g81O/hxowkjBGqQ9BJvFHFpp8QxR3cQkVNJ9\n/tW/u/t9AGQHj8c0APCblyy0lVMlt5PX9/55xV+qiLrDUSRtkaJT0cyGtPfw\nJK91\r\n=AsAo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZIPxmOU+izQlf8nNnUxu8GaG1tWE09orgui4Eg4YeAAiEAnnXfUT0WoV5qJnFQX1F0ZwYV3s/zP7vwS/m5S/E2BNI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0_1589347971671_0.8232673288719676"},"_hasShrinkwrap":false},"2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0","gitHead":"a60572e45661d94398f89068f1dcb84b765c565f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PR++S3KQlUVq/9f+H9ZHca+oCgw+LCt7QZn36O0R6NQZB7HurOXbtXqTB/AL7EqRE02lBVpO2n4BdeVDPDy9Gw==","shasum":"cb806532ffdb08ef792e4aacb38ba2a6517b6c6b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0.tgz","fileCount":33,"unpackedSize":140774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu4bMCRA9TVsSAnZWagAA+woP+gPqDqakjnyJRIRKis+M\nOgxql2r38mPeKA8ZDE5xdcxt1DzZ8dRh9tiwV+kJk+brVB99jTddOWy6uOUu\n5t4pc8b8hYB5py6AhFJhS4Nh4BlEcgnIFlBHD1Zdn7kMQMoNiPYWcITGi0iT\njAwmd+DWzd8AXIkISbSrfaPnkhW9TW7ZVHCKgHpP01ibdfd/O4epnN3GlBUq\n+yr5sa+6QOnkszyWfHefwTelACArdNaUklcCr521A/kM1uEg2ZxU1c4FGk9i\nTAKYEZxU8usb1iWwK400/533jUmArJ1pdviwLMrgDS8Wqy8J9x6/QtPuLWD7\nGV+1Cr2k8zkj/bkKyZrfxLQ6nV1at0mzaczmhPfeEgVO21Yg7lwzkmv366fp\n2qMc7oPwLMeMcygnSbT3IpfwyF6JKDcOenNjvALkZcV0OoIL3MKLYHBdlVGK\n3MRe35uJ9vRh7LIP3gJII9FomDXJ//coLeV9liF1bz4x3yshvJkwneBFsmV+\nmUbdcGvnufNvoCEtdtwd0eD3ljUJsRR5iXvyNZjCcO/pxnIe5YA/Z6TUS3ua\nr5yT2T3TCirdwguEE43ZMYXMsKo8Kx2UGO9N9oNXqjIIURejqiUgCAoYmJW/\nt5DNisn/TcNgUtU99lfF45pUhcs1xufP4M02Hdfjr46/s6Q8kSHnuVZCukN2\n17Q3\r\n=O3KQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxzd357TVdbLkOnsBa7bjCFkO5IcG48rv7qzdJWgQB6QIhANDQxM9/LvUPtGJu3loy8jeRhKZWU9mQfFcvila0C/Nb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0_1589348043844_0.4470564415826135"},"_hasShrinkwrap":false},"2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0","gitHead":"0888ff28c81c050415469343ec2cf434e37c3400","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+rz61BDY2VqeVJUmeUsd4eyRimXXg1faVp4wqET47/L5jsLd74L8ByxeLSEkvxlIiqZtK7Kv/Z/hOekCk8ZPhQ==","shasum":"6b012522758564805c5b8067626d7ffeafd57b6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0.tgz","fileCount":33,"unpackedSize":140964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu6P9CRA9TVsSAnZWagAAQQ0P/jp6RpHEX/J4PltlKw47\nw+5LlDgc1tMSQHqqfRKfYrHyxACHGmbSlwFIdH4zraTL1iRu1M6k/jRFL74K\nmes/+7Nej7IAKS4VRN02luTdv4BV1L+s0Vy/QlWbW5rAjPbJgw9vOZ19O2GA\nSixhsxkvVD74N6sU4woMf58n0TiFbnoIuy35ajfT/TLgSZTrh8G0AMJM0Pxf\njfX8ffR1aXnRQ7RAxFdNgX+FSJi2W4+gTYQ3G1+DKFYSZNgaWJ35UwtKT5np\nKdr7/QySs0afUhTYQYh61mWczB8saerm29NfqU4LYQVA0a5eXuhSA1fCUEnS\nEPtshSJdRJko0hjEv33QYGnOd8PeCAKrzqQEWmN01cz7tyYTfy7GJydcLV+d\nH/Zf0p5FTsph9enTvJZ1TbBAlUuwLdwnLlu90wT4CbPtmJ1PXzNsaIHKq2NT\nDKZWJaWZVrEPO3Vl4H7t8TA4RXo84GXMNG2wAU/752VjcGsZfwAw6EGp4qXK\nUD7M09+MHQ964JSoYY4WVJ1CW7LbhlZP/nWiOdq0U/DluFxHE9YsxVk1x3X4\nRVGZJXy4WlhmugN5+/UbEdsdz3bQTt7nKgyIOEY2fCv0Gc2BHQFod6ZZb4AU\nUIYenv+1AM3Hi6eYsom8sAjMC72EmdnFQ2ES7y78rXMI4+Bo2M3NoBo7FRBC\naLmo\r\n=iCMw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMA8RO7MgXhyF1unYAdjrcuLYVvuSwNXqhDja823fNZAIhALUsfkpFbBJlpgCB5RlJSP9oAz9lvE3UpJTeem7UF4HI"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0_1589355517006_0.020425155576018428"},"_hasShrinkwrap":false},"2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0","gitHead":"0f6372d5f9e302c0169e749573ed957f529d7a71","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vsWboy/QJzD73RJcTCoOQKi82xsyjDpx9quPCDv94B3FdwJAknR7rtdbXvOnz8uk/xOpcy6mTD6DzSLfiOyo9Q==","shasum":"a8347aa1d4cf27948f1c6cb8f71910dbc9da6b79","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0.tgz","fileCount":33,"unpackedSize":141004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu6dACRA9TVsSAnZWagAA3BUP/2AU/t7YqUikxwD6Zj71\n+bllrdPRsDUQKJJLxqxQA/E3pBLFLhFjN1m07dDUx2rvKvV5ajF1qnHzohFi\nCInCefeMR2RBOZtIGTBR4s0kWpecse4wNC38NdVV8yp/FB8aluT85m6wIM10\nlH11uqJ7vk2vUEVIgsFr0tedO6qjT9OZ6436bZJOYWUYVmGInBY2EWBla31Q\nWrE12KJAj/AVeug1GbAvpjc3rUuQv/+DR9FhBzLcJSoi0MgvR7kB1HrXlYKM\nNXhtutUp8b1+bCn9c1XwOKFuG5rkUhN6lXOaRWLtK3IAz+aTtcUH9eUp+BDg\n9RP3RZdJctEJ5RbATK8v4jh6MVzWBqwzjyjm9lZ6UZG9tfhmqKXf13Z9Cpf1\n1mrOYFo8cQ5itenhq2vE6gTFbyPA1+xCFsrW0qqGSL78GOQFeFkFj/l9lpU6\nlNtdTez3Nun0epGqFv+bvAf3GuR1T+fSU2L9hO/Jukvd2aQpI0y/7eHu7q1i\nvqRQlR7yLONP8VYI3EZq7rrurWguDIGiO/5hPkiIuvWUP29LzMfPI5AT7/o4\nFnd0HupgESE7V/V38k6FVbMFERKzK9VvwSzX7p5sonbU556huof+VREvDqyb\nohuldnpVv6spyQ4FQ+Wp5rJc0LcuIspkNlIbx6H8ImYJ4Zg73GpLWDSP9fyw\nkq9Y\r\n=l5b9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHSPR/NOvTEIuRBT+Yt4V7+IkIqPkUsNw7EM5s3IXFRAiAuPqNKtI9OlM1WdN7/bV6k1PqdaOXjw8UwzEl3n3/0sQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0_1589356352120_0.35861739720692776"},"_hasShrinkwrap":false},"2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ecec3bfb03f6ea71449c59cdd687db32d957f203","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ekFqH7BBxu++uP9OnUDVdmDCosnQ/JT4tmYpHCUZnEnDAUE2j9LzRigrzpDnA3xt51A1RSYgUsMxC22ym/HiJA==","shasum":"7c07cb549b3b131c8dcf7005009ff0269390474b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0.tgz","fileCount":33,"unpackedSize":141004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu6frCRA9TVsSAnZWagAA58cP/iwfVbDRBueAvSkzo9Ll\nLSlO0k5TwC7a5ZrFScuFYwhQaY3O3YppSHOio0UJ64AipO8m1FVrPW/Bt/yl\nBueVbUVd72JTWfharw+5plLlMNEJABb7Z+82G9VHt20wVd0N2mEvtpTdZ5QW\nL2SqjybsEmjYe6WlAwCHGlNTJfLYf2SzblTs75hT9UUwZz28eL5X0u7rtzAC\nkXsJvAtP65IvNegcooTPu7Elu0/R+V30Jj7PMIMAaSEgMXLFJe8tQu5qflxT\nBSrXOZ2nDDB6wuewtxwEQqT+ebXOzxnF577KLNhBz/6kUZTYVjXv+Svl4wi0\nlG6ozCRIKIy+65RALJ2k+DN8A4k837euNgKYW7/YZQ7OuzFuxRoogRjw2/lb\nEjmRtI57rwFhtcJ0MwVKZoKtUkOU4FWWHCt8mWoTH7FHjRIngyBO4I3gXkqx\nTKG0/Xn9DmtnCJAEIwSp8lfErPInH/Z0fMXdL+/xegsVd/eUgu6wn4L6E8Iv\nlGrcv/kPdBW1vsjBFxKGprpBWdwd7saXd1DKg3G0svHmKbHLzaXJc3O7FxUY\nhNPoqBMT19Tc1n+TQtHIw2maZUBEnpXEeKzrH2A9nWy1etfqiGTpOhcN8Nlq\nS3aoxtTpMOqpfJ7ZGnuDya1WrFUnIPCiyv+ipZJ0RsuOOEHmDRlQH8Ke+ekc\nip0I\r\n=yoGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcftJO/P1hDzmPVohefWk1BQajGY5PKickM3q7LXtt8AiBoV6oBEd2gkJN6dKkg+72hszYL2ciD2NypfsWEnqKCAg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0_1589356523455_0.19962218398878484"},"_hasShrinkwrap":false},"2.3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"@google-cloud/firestore":"^3.8.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"2.3.0","gitHead":"44b5c636942cb0a5a80e521b219ef42b212e5357","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@2.3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-eePrOD4bMU0ZOJ2IQ7qrqB6HacSWIhsU2FAhy322TmWpwPDQuhUIcv0Udrq+0YVW5GpLinLhHPfcFtRIdFUiJg==","shasum":"cce654a873c0699f36b3679246cacfc508060cec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-2.3.0.tgz","fileCount":33,"unpackedSize":141233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu6gGCRA9TVsSAnZWagAAVuEQAJL1momHIF/jfc7Tp3Ut\n/Ids8vEDWSAO4t2C3u3Wmwnly37jGKTtrCLc9+nnNJiCeZH5MwNxRtGKCNxz\nmZWqLXXFSUQNN4DN3KB0JP3As2zQ+i/n1mVHFAA6WV4szAYL6Cq3EsGqzNWT\ng/5ffK5eXtigWDJFP+/NWjpw/T57z1Op4ewRmwyxn8buAeael/00DAakQPJd\nEXaIzsyS51gLKs6UetDby1qRhJCsiseZYHnmgMan+F4+yGGd57WRFcUpmfSm\nDknOcpAAXQreUMVpW8iUbI67mdrrawdR3MaPWYgb/k7ZiZAfbvVBCMG7wvS9\nhj82buj7hvBO4tqXLa9jI65SQbKud3aBDxG7q2u1Aeo0f/jthAPmNTi7mQS2\nhRV/tyylPIFg3TYsYAofn3WQgcz+Fo4xcx9i7q9loS4PxhkbfD2OMKVeqeLd\nQTg8SeLmOP6ADzH3OvlvaUnzT7KA6YnGXfW7mTcaEmQMb4SvcXzF3M3r8ujg\n/kfgI5Etx7WEXWPLqHzBRFvLoAzhO9o26KRZrtWM3cXh/T61LPpge7hFtz1x\niFq4ZEadhyO5H7h4K61BpLFATcIbmJdCVNVHgnmHJukjPDshDsTiL4uebfob\nKIQN83CG0JyjenvZsX5qaYriz07SISUWz5mHyMcXL/PlNWx/bWtihwtUyxjZ\nawBF\r\n=5w3m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCy/2oZniB4z6es4+UKk8oj4FjZTg9F4HhHcdTmyPLZrwIhAJJNLWwbI0jNolynmplmq1OwxR8g0CwaKUszbp0MxAW0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_2.3.0_1589356550239_0.8982528258973357"},"_hasShrinkwrap":false},"3.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.0","gitHead":"33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-F8yOqKRW8Z5n32R1O1h+W4NQzQiUTPf57iqYkzWnO5sOJapNLHaMP2TYCjGpmlS4CMgdM2iQL3yINgb01LEyVg==","shasum":"208fa1d8aef2eb7c10340aa81a3b3406d1df0dce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.0.tgz","fileCount":33,"unpackedSize":141865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu8TGCRA9TVsSAnZWagAA4UsP/AqZvUf3eqP4tG5VU9Xh\nJmBwEHgTMQPQNRIZtoJkaVVLNYZxqlbVGY5xtsZssn9b4JaskHcVuescELFO\nCbjLI4yllwQgwLqbNO/MLG2MTcJg40NYeQ/In7r7SC9lAsPgsGjO4kDMcefI\nUKFiSD/EIL3hkc/WA6BWYPxxRzNWTomm5h/oexYS7VOuiRangFHSp9rUa3gO\n9WPOrsyZJCOsnbE+YdGIh642nJthBdCy3AELY9fojpFmZM4eYYXzKdV5vXE9\nXwkO1i99rfjuOLoa+zdNwC7auaQWgUFTplxFURDgIH4i9678aK0BC2IE2w6H\nzi+4JcN6SL/DSyXiVSEJfMkuN5yw3hcyFtFoH3u23G0nF4FMPJIT/tO+k0d0\nPLMqIcpmpkK7uZmh5aPkU7r5cG/OTqij3EBfmmL4MxFm3rRWx4ENUr3+/fdI\nDKErTYbTXgtdpvxOXP2ZkDD6drt2ORe3OlK8w/RX9utNPoq6jBz2JQn7aNNs\n002h57d5ihXh3PFKvo29iZKmILzkIUjDhsiLr8m4Ov2lwV42D1wfFu0AYMWL\n0VJz2w9q7+A+YyP0u7BPVqMHhDbLx31b5CfvesJe8CTF5tDJB9+kstOXqxw/\nrXFSAEu7QNqGPFitb8zrjYJeW3zAf+QYEC4oSTLP8KgpzswnPwsLbspLxOwo\n9QBe\r\n=V9wV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA+BWEGHHYTRUQ5hd36TsAy79QOKZxJxw+m5a7+LEZ6xAiAXz21naUb0cJ2VkENliL4NArw2atnIRJxamDSOrHNasQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.0_1589363910023_0.35426787302137686"},"_hasShrinkwrap":false},"3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2hx2Z60AXSfSvw9ljCmUi2PErqInbz5I8/KoUzIYJao84ylQqYU+S9/bt2tBhayaU8iXZvrW9BftAlz0jsRdeQ==","shasum":"9d3a0ca62f58cb93b8be6984640c69f9521ef587","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0.tgz","fileCount":33,"unpackedSize":141908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu8TsCRA9TVsSAnZWagAAymUP/jSh5VCteYyoky9Cxcho\nLymnYyFrij8vpeRtDBCU9D9S55pUylK0jjOmdSmCGdubrwWVR3Ylm2QvUOHK\nh7IFR2IYcc9TaALVwbGNEczNDvtppwwCqHbywIdBKgJr4fkkujDMLZiW2dMN\nIsPW+Lh1QBOo7/9hnOwdZJwtGm+sOBDsegqLhFtwkrI3ddNCirvGcnkzv5tg\nVAmi68qdrv8tW2odcMHg1d1cgeoQwt7NT6rWq+HHmBzFZcKMeEpWOM0zhie0\nDl3iiORNSFL64+8YNntK/UW/KyDmdRWItT5y8cKz9G8d/EHDj902UooEjE+b\nC2wIOaKLz0aAIjpuZPcIpyGCFlWt6KPUQ08eXPUPfwDaLtICxAtPRJeh32Da\nvRfm3vyKWmT9bkLnfTDFWRyF5KcCVadd+bBml11iz2LpPtyQcb4VKG7lRFcA\nUSVt053bqDhwrJ7HyIajOk37Ndq1Lg82QsP7eYIElcP4lAjBPX4ZQUAtqqif\nnD2Bhj3M+rgOfJV9jSHSYEgqirKSkAyQyunmUe7hRxj642GrBiEks1Fq+QPZ\nGqxh50gGYsCEJ5B4Wrcm6EcEWbDTK+bDvZISgYa1+5O4k0tN4mfIXHFLgXL+\ntL89qmZft4qWjajyURaTg5n72sRjcZsZIbb/oy+mqzld/ix4QutCLks9ZRG8\nX/4d\r\n=y5Ju\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjl6slHAt+AizRHXcwwRgX1k/P90BzbVVdew2x8296/AIhAOIE/vMSQTWInrHMIKVVjCj/kD/NKplNJtBK56cYHdU3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0_1589363947896_0.8759037073388674"},"_hasShrinkwrap":false},"3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.1","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0","gitHead":"9baa925518a8643c7b61398c6db1048f053100e2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-whFKf6YmGhEuTvQIcnSt8+ZPUlsOPq0xgCIDFs//ggk7RYc2asTEbf9J+ZojxB2FbyjhLaHp6ndtOZPi0eOCXQ==","shasum":"af4fa367f94f23acaf2086aa8672a673113b1bcd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0.tgz","fileCount":33,"unpackedSize":141908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu8p5CRA9TVsSAnZWagAAd7sP/1U0ErMuPbM20SJvRfI2\nvviHbwHX/Bc4zpqmLn3ZapuIcVRL25Y5bDNJ+I3wGkMMhkXNXAD56aqxGat9\nSmOk2siKamZYDEUXsuCVkDpcQFZSBMxegP0X7pS1BGDl8WUCtJzIbyXt3Ga7\n9Zs+yI9dy9+SLgVZmsWEv4MlMp6pmWy0Vvkd4IBplSsTzgshe0RZgEmfbt+1\ng4FBj79UR+3YUBYoVer7B7Zt8quh2AyStWK0NzV0LSLaTM3ZFLFchqFKpvKi\nvpb4y33qLouU2dQe8RzgjAffEVWz9gwK1OvouW0xTcoDkY1Zoy+oyzXghQyZ\nl7COH0RM3U7EzDR9R2yGnPSVYR2AuIqJ5ZzQv03mLpAiq6WcZLMF6YzOgxfN\n0RNvzBIDKiYhbe9B2wR2eTZioDKEj4vTelzPqTH4g5mMIoSPF9TIgJ7ZqJlt\nKqlt+P91+cPEknmkli1lNQhcF+MK9QxCiXqn4ibWO0NQsdka5N8cGPumMMHy\ndetgDxqa8JbC8do8TQoi8Qc1edXz+pxIoPyGZb7zMQeFgAXdZ4d2n1t5Sf0c\nM0j7LLF0jDVgY9BdqnUYSyWb7VpRAqQkNXyy2UgOTvcuckl4ofMiVt5Lxope\n2br8S1jcQwrfob6CHPLs3NpJ0ZiKTEG+bB3J8kqWMKgubu3rvDHBt72tGY1G\nu1OP\r\n=ilpo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNg49qzeg7xevE2hcDhmCKn1xJnH7VaMBqPal6UP1gvgIgKto5gk5h0PTouUNrbOC8Z9H59DV/1/ClD0WHFd9t6ug="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0_1589365368953_0.09802668919952229"},"_hasShrinkwrap":false},"3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9475b467c964c5f90f8d49b812a45f851547b168","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ILMmd/KlaBt9xJRnb7ijijiZqvQ79ZIPTciv82nKLkNQwb7/rUiatVT1fje7J9t9cl45rt9/JGA1fF0C/sPlDA==","shasum":"c3af25c4b7682ee77c990ccab2417841ed09d412","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0.tgz","fileCount":33,"unpackedSize":141908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevEKYCRA9TVsSAnZWagAA4D8P/1QCTnF9LQq0fFgAUDNM\n/Eg0yMETQTTkGS3wG2baKnXBROOvcFDHY5ePCSSRsTAvG1+X08M3uWYF3aKr\nf6ak8Nx1gT2oqJXxr5JCmYYcAHkYXc6yDH2+JxHI7XJsFh3lwP1GcoGFrMnx\nffoQaATzfZGXF8AehYeVeQmWXU7Au+32fO4iyXbrqBZQN9k3CzsIPzx5aNFJ\nHW38TZFOore1rC4+3wLDsldVSOwPo9EELb8NJrJ023INqZBccaYQIIc5po7z\nZxr0M3/SBrXJXWhzMs+NsOWqf6HVtmrjWgcwVkv0EUqBB3gBw89QaAYW3l2Q\nhVf7GaF5Ugw0d5bgmOeLVeIy+oTw1Sr454hdW1sh5asjwHjU/8PxgeoRLJlf\nZUmZttq7NTs2knx49S8VOHE6cKFOceNu/eW/e+oQme0UGI8p+QvqvPE7bHOT\nogVoGeVirxZzjoom6JS7wzc5gPsUdp0MmOvBE5Ilu4NGxsV8meqJ3DRAt21F\ne2o5Yv1Sya59Fjgkt/l2QnplajpI1D2I4CKMKerjqDHkUEYgakRwnZMEMyTP\nCw7EDsKh7y0BqTiWvXfNH9wTYOXDXwQDtxpyL6UpNIQcMLAjxBdGTrqt3Ruy\nig2hw5xXP3UUV87XRJZY7rTA1DkUvjLjzIE710fl+ENG05FUbQx2aW9cCYj8\n8nmO\r\n=e+n6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpAyOMqBJ3uNg3Y5Q08W5yNxs4tAOJBY1mspdJIgb1vwIhAJ3B7Q8ybHI39qCEWGVSUHRYUHvxA1MxEgD/J9tVSBBf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0_1589396119329_0.4145777181458301"},"_hasShrinkwrap":false},"3.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.1","gitHead":"7697acc5e02c20de071c567e1cb233d4511e8b13","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-cmJoYYvS76NjeNwnlFJz1xAUWV2oDPksfQajwbVH3BZk3veiSETGbC/qlKdQObGWX0Paujynjueo+P/SZALV0Q==","shasum":"c014936ae85746576c7443ee480a35c240ce716f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.1.tgz","fileCount":33,"unpackedSize":142144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevEKzCRA9TVsSAnZWagAAhK4QAI8jEhlSdDgoFGi1TcF7\nM/GM3claEJ9z+DEoZGq7SY7anW/ePCUv/rYKR50xYJfFHKlqXzuNxBXAxMMm\nZs1YO1jIszHozUvIxmoWYxu9QVM4OxLXRf1CGGdLPALiv7UJk9Kt8E7yokTs\nogZthjFWDE9hlvwjwDqAcZQZOBlfO06Ckeaf3u/iF2Xln/mtEURSfy+G0GYA\nmW5nEPOdVYq7NBbF0oBk38O4T1aX3QBIOQWHEEn5j7tt3A4GvRrQQAeu2LVi\n7Mzp7TwQYNLnMJoU8mCASXkEnxJxgEruDT8cJBh9UpU9D5wo4mNrjX03/C2P\nQ/So4KhjDPpT5icEokccGsLcgfqZ6s5zjO7QIrGGupKV7dW8M+jBuQnSqWQ5\nxrFYzXGCG40Dz7HH78dzS1ZgECv+iumHK0GhFXZFYHdnctuFjex/Jkm5CC0M\njo7fHpQPtbRRTfXoZRVHYozXfNQiGoA60AFNt8LBg5XKt23vkr3COAdB5iG0\n2NUJUJgaHfKWHO6V1sAoI0c/v0zvSmQr1HRl7fblnX8gA1yejKAzqfjxTyMW\nRRx0Gx4ht499n/KvkKJ/E/c6RBfwTIDH+e6XnDyyuEEx7JWHaWRxIhqNXCcQ\nGObn65zIuV0zkx6+CdZuh6WKALHCuMRRxcbUmaN/YHpMfDa2N7qS6QjF79Fx\nohiF\r\n=3sBf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7vO8VpTcK2VfZD4RgbRNHgDy6KCH+KlnaJg4pJgkpJwIhAPqUSgNU9XqjKBBpybD7LpefW6ZI7NhadAachvpI5qYk"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.1_1589396146118_0.83995021609563"},"_hasShrinkwrap":false},"3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0","gitHead":"e842aaa2b9ff6f831391b17bae5f90550e7a0a0e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yQAjGgJ6njv+aBbUq5foY4d4S5luNJNBYqOjfg7SguEMn60FpXi8L5poDITq/Vn3K+fDlfqpHAwDT9jzU2+thw==","shasum":"a8b2eee9969b639b4ae1944dd32044d3dba5ca9c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0.tgz","fileCount":33,"unpackedSize":141908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevELzCRA9TVsSAnZWagAA1ikQAIV0vpqO7zgqQbQJC2Ns\n7YGMtQjOHzOVWSm1kOC4za8Vpb3ShQtAUuLoTNcIO/9qY+JSgE3nfPU9MMhi\nsd2UHmuuVlbxY7kAFsMmGp9qijbj0JmMUgoOkh6fAvz9xwo7dxam2LNu+4BR\n622xKEDPLXOog2zbz4WCt/25sA6sqlkKIYFpER776oJOLoQbnmAcLoM183Cs\nZueejCirwwA+qpPaWmmpS4Wn0flVkkwrQZh2D2sn+1toS6tBXYWRmnn4tqnJ\nfHE0v62tV7FBvRFBjP1srTMKNWW+mDdw/KZ/FScCqClQPnvsYNKL7A79rbl1\ns0dgygk8kXDj6PGUheoZG5GAx5ZHNBm4WikzfCOy1xrbcBQCbhz7hvHVETcP\nO0IQyDI/pK9GUs8YgHRoF5mZrEPI9Xq2+zUyc4d4kiQoLKweumBvsIpEF0yO\ndqwY+T+w/ECGYMR2HUAiZBJR+G6W/3SnAovBVFL3wGKWyR3RI1cF5HR5kA5c\nvDGGN0Rhl9k+zF27NGKAyi+l4VdpN7ZLeu2/WmsVA+dP6es3/BPrst/11fXz\nIyl9UUXPSg1UeFeokvW2DhenfcZ180lk5rqy7g9ns7U8TOH2P05J/s8BwlZU\n754r3G+y/rcmDimVnRMwWmRpX9lSTXJx0PKFRH/XWkFQ3V5u6CbfGTYbrNYI\ntGUd\r\n=7F0s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvmGWyLgVI4GOracz21LGkR+3VgARJ5l7QA7efK9U2twIgCYH/qUIagqBm+F7zMA9yug6oZYRF6J2d26Jl5FdpQiI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0_1589396211225_0.31461841375797595"},"_hasShrinkwrap":false},"3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.31","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0","gitHead":"cc90e06c3687749534c97bc61a128de5f10625a5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-cyHAp1M3AzYa5pCCnhl33JHDnYbMnuy1rB3belImmO3l51OhvfxtycByB8/4BfvWUK8YIFTASwhGnTgGKVLueQ==","shasum":"4df91519940c00312bdd47abb009df4f55f610b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0.tgz","fileCount":33,"unpackedSize":142187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevEMmCRA9TVsSAnZWagAAOEkP/jBl9z7Q4q0fkSX7FWfm\ndtYO0Q8p/OkJltGX0t2qc68yx3pM1eFFgBVjmVs/BtNmoWuG4Tv+rQRVAhSO\nAOBaOT1Vv9sjEO9c0Mof2CB5BdYj0IgIJjUuNBjkwbEmK5zG/HmcTsik3F+h\ntY4l4mtUyKZ7mXCukRXfi6aa9lcwbcGz2DaLdevCDCDpdU9GEVK/wAL3Hxr+\ngtFcnm4g+IXEIFYy9N1T0ieupukRoXeC3qfnFVA4gw/3nDNeTXnQBiC4ETL0\nkYhsm8h1BQlQOPZlVE4860v6UbwAJPhZ08SECiYubVuMOIS8gpH7nne9H8Wd\ngKTEBJCvCNjDR4AeJXG0L0heeGhOgKc49KesWEFJaLvNGzFsX5bYAAohY6Nn\nuw1Z0/S/XSg83+2t/+WA0A/bgHLgARlBjlTGYf4BXaP6TIFivVW66HHgBTXi\nLbTOydtByZZHF4gBbBx1wM/r8Sb0LhiSI+DImcpRX8Ly4/J552QUKB7JzLK5\n3ujZQVZrbX4YSOiL9YuRQZ+rnvYog8srwilG1iiKqc9moiUXo1LGGyEtkFJ4\nJGp1fr1ibv61LIn4QVysDXuMrHKjlVp2Cti9SRF/TOYvPVbS9i4IOVqVkPwu\ntscpVDXqf/R4ULF3EVojXKszUfy33B8r/SS7Gk9yPneZ6Djh/muI2gNpMzR/\nlrYs\r\n=pKfG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGdLlQIABPIr9NZZ6DyLUK/TuBaEI1lKU+sgMeU0L8KTAiAvOKZ+21puAaYrOs83Q0njhS7TRI6mQgc+cWfHHxnFCg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0_1589396262348_0.4540367955347886"},"_hasShrinkwrap":false},"3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7697acc5e02c20de071c567e1cb233d4511e8b13","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-dMKeE5n+JbIJqdkKXt1+rH09nGEaiRuKuSw4X8+JLVfUWFXEyI0us0Md1I+diAEaBLtmMPmwRglam3lYErrihg==","shasum":"d6bab63b85469de9be7cfa7137916e71bbc17e59","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0.tgz","fileCount":33,"unpackedSize":142187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevENRCRA9TVsSAnZWagAAp64P/2NJZgrvWKu1TxkR679j\nWYmmMxUxCLFQTSmph4xAuxauP5WYFz9hCLcwI1mlvwrmJATqX7AbZBmZITD7\nd5r0+FGGrOjiDmqkdJdP1tOm5V8CTbmKlA85NYF549MI4wF8m1ZtlokQaB8Q\nryjar3nc2Huh52QXx/ylAhkKYpvEFJSeIXa0kmQLjBKfYUcOHbzvwuGQzglN\naLo+II5QNVhVPIMe25wLxkNRY+n1eQ2I6TgNPzyXiV5onagfL6xsK2QIqW7c\nJhgW0Uc8KFErv0o5uol+XwOqM2qahdGMPHRSkIZKsOHnNxtqNifnEBPwdwB/\n8+rY3yepQuKfB31KM6Hcfcrgh7dSSe/YhacBGexZfeylEo+qvrpHwxnXAbLj\nJvZ8vFVrrK30kDRrcao7DRjZTFbTr+AAhx5+W0kHHYJUNG2zL6sU7alCiett\np/ql27JETmiAasvodaC6WU0DHFEBDl7Eon+JJxQ8ZjAPjPMWVzrSDx4+y9L5\nsr31TJoh29SH7/xlngMZ/HAEuZRRG09qXHe5XYUw9O549qhKZXScaB2gvDb1\nAxDNNu+iu9PEX7sS+0RX81vw2LQFCg0fKbNkRR4IX0HUGB36VYhgycF1dHcU\np8q0L1HXYxGToGID1oVjKtTUaNqhYcE7llg1FMg1QRfe5WBOOF9KD5nPHZIH\n5XAW\r\n=OHVa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC324hFnHKf5Wh8xMr7/xsswlO/wmhaZQX7H8O7I8cx/wIgRFdH8S67pHrQGHlFkPRdNzSzelfqIrdVmSJRwTsyAv4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0_1589396304614_0.3814294279411752"},"_hasShrinkwrap":false},"3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.32","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0","gitHead":"54873ce35e3a12eae288e0d3839eb6804f379d40","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BUjibVEOK3SYDvpePfqiYBonZk34L2RNQtxdBFRgyiWi2f7fGHkI4SF6/+9rSGNZ+kVfb+G6gPZXdTx240vS7g==","shasum":"bb1b148558db2083392205be5ffea4151f62df48","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0.tgz","fileCount":33,"unpackedSize":142187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevEcmCRA9TVsSAnZWagAAFOwP/jCMGli/eZgZ2W0EX8sD\n1N6PwnxUdR3WeK3lKjXabXbtzP7GJGdJN2pcNi/kQh00l8ZzDIDOS4CT3Wl4\nEZ3k9JoS1OHDrtnpai5Xngc6JnEvGlhB9Wr9Syw+EwymNSJbCpvA6KwiNcX7\nhZD8is36Vt7SEwWVYCvPjQO+6SfZ4GULBgFcbTZbxR9DahHdwGoPvz+2dCtU\nUuJUiPGOCV+YMPyyZTfyqW2INevIQkUwNSoZIbwqYl0XjtnOcXtklPq4XmI2\nxwDHrTwNjCJPF8wrHhlet04PJpyfQpMaDuzVRiJ/X7ltp7HJcPxfAk03ODCC\np2/YAqqo/+STE1maiJIRX4AFNBPq+govAn4oU9STpIsYthXq/Sl7c18DDKf8\nTob1lhH4aV6tWRKVAXDIAtljYkXutOFCFY8IJp3fIXOk81uccGS9vMhelYMx\nXq/E2RDRSGnPKUurkR/X6RN+1adJ8VjArA98N8mNeptegbH2dBi9QnfVT6JG\nOvHjUy4ww3+PjWUxmcUI6ESJ2pCxPFb3OgeJn8jwED0WQd58vlduiJ06FEmS\nCnxk1NTJNtBPNiZh/saoEx/8GQf6ht5zpFDbd9Ti67PncSyjQXndUtGSfQPH\n8gUsGbzhEJ+OoNCRoAHEs2NeVEgtWiJFC6GbrWY3Q6VY5Ybkyv8RCDPwqx50\nYJN6\r\n=6OeY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRpbetyKby5zEenaMFB2s728/KpBzo8pgOZeNoCrXmOQIgQegOJOvS3QLigx3G3a3UacuZaQejt5Gn+3NXHmg4XGQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0_1589397285878_0.029900089906806038"},"_hasShrinkwrap":false},"3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0","gitHead":"ee6a4a90050cd3af7b4c65863132c8a861f726c9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zSSnyrm098pCnESWNIsd66Hje0t6wgRFisuiTspsG/BQOjeHmOAvrjCk5yE2Ct1hu28y3k7QRISRkxkTl4jqpw==","shasum":"6e029f354407f54fbb74380db7edfc644bfcf222","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0.tgz","fileCount":33,"unpackedSize":144368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevQnVCRA9TVsSAnZWagAAdkYP/1XqUv1jmRpXMB8wbSSI\nHLRbjwuBlFaBgq050ODBWX9ZwMZ49vWm+iGIGSo0bnBMuofpGyImbPzVq4WR\nlbZqt7aGa7JJOvEAyZmU91C19VKE5q3oTjcZNbIPoO3wyagBDzcMtVH5qll3\n9S7RWxYH+mmDfamG6LUOvmFC/VHNPaXOAhGktgjvQMbRRGhgNf0qiBvntIQR\n3Y+2oqXsdwuMuNa1nrqstCwf25gw/FYD3EjHJi2vf30uItash44oc1q8RnDW\n+s3AwDiUCpAnlrTBIn8UKZf8F08UJBs5s6nz84+c1qmB8ajpmQdUX0MVnBfN\nCTR/o0LfDa/MuGAFjoBMGvxHqX5xvENDtHZM9P7nsAcsFIZninTzuVDcuq9r\nSKHSggZgj4QooMHKehlYeYgQYnxD9ri+AWSx5k+pNXHm6OW9gzWCnyVIqDUN\nMOqGsVJZLKB2+8PxlzckR/1WkP+iEbby1jdcYWyCv5iWGvDE2nPytgh4dA9z\nJejXiZGkictUyatfF3wlHFl6roESg8P08i0Myr8BmLK1tY83JMB/SCkzE/iV\nAKyyPFdzVEbd9xBcmks8ZVoqvxVrNfUyH8LPbyjfFSN6oW4VspeztGscyEVN\njHt7Z8p7RKbRRnKlKkdx6S5ypt3XS+t1MN21nAskJhjgq2FFXRRf/I5/CUtI\n7MKn\r\n=z9Kp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHj5ZZJri5eJuTenhfLyA2326h8RQZbNSp1w8A5wRy37AiBTsrZZUFJjUvgxOuSv++wFk8sD+GLIzbSKbpJTcF/1kA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0_1589447124619_0.6006752836217564"},"_hasShrinkwrap":false},"3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0","gitHead":"0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DaM0IM96TIxfHGZhXQps2dyZbMPZPzcDm0HxBHaRUWhG6Nd1+rqUeLAKnP+S8W2JK3lEwbBsRAMd1kha8Fg2Tw==","shasum":"a7325e00e79d6f19b459cec402b870f752d18321","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0.tgz","fileCount":33,"unpackedSize":144237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevQ3jCRA9TVsSAnZWagAALRwP/3jZWgF9EGb8U0TjrcYF\nVRpm7ZIoN2GqKaoCnu9weIeZHC8g335kh7vDWby/v3webliQHV+/wguHsgOh\n92BPXicTEPfCv8HWua34v/AlnnyDCFZQdqhwWJ3dgjX/ZVpaCCFFIOgiBnU1\nJ1Q93B8LRTVGBrtF4n7uhsP7soLB5cca43igCFZS0ehFeWc5hRAoTQwG9ETx\nf1IG9BtZhmyGsZT551JZYHahzGtbMFpskGPqZ1SsaJrOo6pVegPA2oMA01qi\nR5QPkt+OOz9GPn2JW3Mik8SnbnGOt8O4SyXyQS/IkxqmlhaSo1yCxrCXuKW0\nYmmYplJbdueYvOZLNyPfW5zVI8ogMFYbkkTQ92B/rWX7iX5ItzjCvIf/YEgf\nNAx2SAYKWeOJ0bw9pIHuzDXXmXwTaZTPeQOEoXdo4uGpsGLxrn9hZQltIrh6\nY55YWdJIBSw2WoM7W+TEPkdV2fDfkSOgQhWDwDR11zOA0qgZdDn0WjX2gdaI\nVmayYhmQYl3kclOKv+sJMkByNFEs+LMg29ht45OEkctDDLM7sFgi39PFx62Y\n3W5H1EOTBsuPjfyoleGqVk/8Cp15gNdCicoyJyeKkNBG2gu5rYSEGSoWxg2k\ng4OS1HGuqLEcCaAeN6LtzJEavjl07oeYv8AFNetpMTLvUEbLZZoUcOWvxV2m\nYY4v\r\n=t4Tg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDurs6x4xEKS7OkPYLrHPzqR3zGb1BSImgyf+RX/h6f+gIgMISVxKTq34LoLYKa1v7t1YnEG7ofmRnoF2mEcHFpA5M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0_1589448163325_0.27184767731995985"},"_hasShrinkwrap":false},"3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0","gitHead":"1fc86030e1c320a58a9b6d19eda1b1a29252ec0c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uf04We43z1CsrXGwFolsRAAen49fpxJZ2l+ekqGygg5xDJvDZhunFmwSLOdLpI9h+r2iPWOXetkdzBDDR1fyJQ==","shasum":"e9dc2c29cc4469b475a51ef4c2ef9fcf68a34f69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0.tgz","fileCount":33,"unpackedSize":144233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevRvtCRA9TVsSAnZWagAAcogP/0rdSlGAQ+ao/DwDH/wJ\nyc46CyZJlb+IOLCU4u5YGAm6VRrN1gmN+Ep5uJ0t5p4PsDkGqRZAlApC3EU0\nVZgM2G+V1rjY7QwKbxmpgIK1E2h/UK6vpiONYlrVvIUd8pPEQa7wQKn2csOi\nnt5nroXlQHwwnjSaSGyJxMnEhmWtXz6H9YNAq8LvDRIgyJxL0p+o5PPE+Eor\nWOnaRA2VsZS9XZajfciXLujl8CPk2/negM44IN6quAv8iQJIyVEReRDPyC23\ncuU4PF5NQUVQQZxcRYlR/MWNGbC/J9zCrGY6yA0pk+auIa1TvcWoSJO//Swo\noTudiS1OT2/rciYN+U72KaLf9as/ZW7m2KfmV7gX80EjnCyzfrcF6myJyn63\nuXvH2JdQRwrnIn+OzHUcj1Hj94g0j+/iZ5Y5eolipuJjvzU5Vj8SetMvoTiz\nTy1DDKJtTDnYeRMGLWauVQA6qPJbWKHGyHFFIPT8b7rAncm/sQH5DL5svKOy\nkD+VpXox1K5QZhvLRVQT3k9n6gapMAJqrazp680P3Y0XiKwd//umbogqNYW3\nAkCNARbwtw0EFxODgD5757wdADXC1Aupo9w9pNoYQAjfTx8vhsrM18uRX0fB\nJ5HfH2dZiDm0oAmJOyRUf0q2LoPLlnQOtKbE5RWSqR2VMxrOAByaT7Z0pRWn\njIh4\r\n=VvmT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzTDB2w/gDzho5Xv0rZJI6HJveHKb1bHWethx+zZXTwgIgMXdbvXGLkj5f3Aqecl5r93Qnfkro7AxdzsxM6MXXbvo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0_1589451756441_0.26513799545460137"},"_hasShrinkwrap":false},"3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0","gitHead":"888c2c1910f6f15f7eb5cc60a365830f7d65e250","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1Ozch2CSG7bqsTbuHHbd87pO42ozSeCBfL/2Y9+L1EjW9PRF/9tHKMcPY9sAts6TtXhlAnN9ahKGClxOI7oEMA==","shasum":"1f4db56fe11b3cf5f5185f18fee2311ab33caadc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0.tgz","fileCount":33,"unpackedSize":145163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevR9hCRA9TVsSAnZWagAAHFwP/1XvYwBicnV8SjGXtZIH\nregS9ODCsR4A6m1PvjIsQdWUTn52w23vJZNUjLYH/zG74WlkYhn2w/lwlFNX\nWT7WNHzhmEOC0QYUPe9gNMfn8HfyrkqMLEa5k2nJ7A5hvbS8orovdGTvk67G\nYe6SG/PNCb6IbiuUnc4+gaswLqvFvRsU/7utu76HejxVM7OMKt+6ZF3SACYP\nw/w/T7JLkwnNu8Rgq9Z34uQv0Y+7qegsx4f4X5TUTQCTs+X64wTsk788H/PV\nbqto2BOCM5HLoDmkoG8tzGQnw6b8RH52Jrb2GO3aJOfd3B1orbgt7u7WaAcl\nfHt/OQyEhxq7ZehrkC7JyCk6E8kKpTh/35pJ7xezJBSEawSgXg1+HXsbAcgq\noXl0I6TuDnXjz4KH012MvIaw9mqRlGohWWdzL0dFhhdegkUH20G8JSIh453d\nh2ANKuMADYPwqGsBeufMvh8DInn4UJ3qBi1EjFLl6gAtANlhyZGZSvjb6aRM\nZlnpaQbha8HVDtIwL/vLYXvFupZF/z2Xxl+9YIOoVtE5AlhyLOPVtA/s0fd7\nQ32GKLWbsJaWSVkw16tC/e53Yfi1jzZ0KD+ToD8wDoNkSiWhOavojVjOxR0T\ngqbeyWeKXP3aZ/tixQvX2fkAFG9m53qIJe8IuCGpioskH3WNmK+Wz21D0zQ0\n02ZG\r\n=EbNH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/jUB2ZFcmX/qec9c2dmKFIMCQOdrhYs85pRVurq1AWQIhAOnOy3HV5fyABbvSdJeRgKzEqHucRBEl+1AxaS9mpvMv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0_1589452641244_0.5988740820014518"},"_hasShrinkwrap":false},"3.0.2-335c2178000c35b0f98336687066faec928e59c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-335c2178000c35b0f98336687066faec928e59c7.0","gitHead":"335c2178000c35b0f98336687066faec928e59c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-335c2178000c35b0f98336687066faec928e59c7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hTty0L4ResTPLAbiqwXfyz2OebQDZWabRh5eORBR790rHI1PP3tI7nFFRe6BQraimNXfDtyi2ZUS7eBXNU1HxQ==","shasum":"f7765ef669139208331208620ed91392fa84ff10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-335c2178000c35b0f98336687066faec928e59c7.0.tgz","fileCount":33,"unpackedSize":144959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevR/ZCRA9TVsSAnZWagAAAeMP/ip7C0Fn6l3q2wIuechM\nINskLgSlhn0jxXoVffszoa/ZP/ObAnXIJj34Ibh0z9aK9zgSjqkW0er8aAp6\nabn+oncC5DbbBuxn4a9ADiEg7PHJzaVUsVNz3nc8ZznfIQaDE3y7ZJvLZE9v\n/EPbMhI8FkW3wnURm8IlSj2nYeTQVQWHmpC89NUX+/a07NsR7wY/dHf9S78R\nEVbcR8IxeZBvR/WX5DGzA7z3+OJi19D8YQmk1R2yNfqj8RJAjYZEDpnWQHSF\nB3lztqj8Dv2Krsf1Rlfjs27U5JWZm3iX7jfdHDzangIPMljvyWc30NNLCyf1\ncRMLr+P0d+lOWnwQjmfg2Q4aQlwwR+9f/ghxzVPL4Sr05l1QNqmjJ5I85+kd\nE+fb709Udizb6oxHstoTR8S9CniLhxWt1bb7sT7l5/Tw4g2PxtvFLlQrDdwA\ncQ9oiA2a27wwUAecRRpZWWh9jXGj6viWtYLcBis48o5JjX2WNqcC4NZTq+sw\nS1kVziUiJUOBUN6JzBacrecAMMCEjM8EfZFVEAQwUsSjnzTVAOakW5mo/WIN\n92j1O2sXbb1aNMXFWfKKD09NUbydqa5j2CrhRjlHjR0+fg9WuLTCuRY8n17N\njtKPhzuQjGSnnZwK1cZS9yTy41lCrvganmLJC8MPLaVMrzxGPg0axRO0gZ2g\ntfmA\r\n=lOjg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaTd+W0Tt0Rx/viBd3qeRFy84aCuZXR6oEN0BPVppYxAIhAMOgw5LgJqjwrDhW5Ru84EAxI1D+gMAHwDLoS+mAWHMs"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-335c2178000c35b0f98336687066faec928e59c7.0_1589452761211_0.4785136740029752"},"_hasShrinkwrap":false},"3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0","gitHead":"28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nCCSeMZeFDSlUptxD2E5f7R9KW4Omt01PUKk88anrcLC30MEfwFObCsqGJ2nj3f359jvUJ+zViP+W6KoqXKa0Q==","shasum":"5c8cc54fff5f907b0b997d9491618f2aee519b94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0.tgz","fileCount":33,"unpackedSize":145940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVUWCRA9TVsSAnZWagAAPYIP/3LOVWy/8TyMMcShnYon\n2SO4sMb2GyX2HVRbiy+SWpc+ePKF72wfC+QU3RwX/VxWevRMSXtwroB0CZd+\n5IJsfBDfRsMPBAlvc+Q3tP0GLYAogz76psblZRrZzD12DuFuua/G5s96LTO8\nLr5btAyS/pU8lLKNF26R8+7195DUpe6OAIur4YHlFQPXRwoRGAp8nvaiQkob\n8Ynn1U0zOHASFB2TDJUDMmD9Pgba5vf7XUGHkg35lUh1aVoqkr/6A1ojEJXi\nF1i/mhrIg3Te7HvKJQuuX4OMW2sbb+ymbh/HMdnSXWOLV6iSw30PQrFTr49P\neIKLqmraePAmi8aBXwMo9+OHpFfaFyxqdIwm7lHBOIOgVn7BFFiepVu8wuja\nP48KJ1RfRCN9kU+mT4sS/kUcvTEsHXIr4NNMllv6LAha913cb2tpqqFOy5r0\nxxivB3ifQgcD1AIz88WQQEvPwoNGIypHxHbKmeyXKw+oldCZxb4pbdBmjeGf\n/olujiFStSMspbKwnNVZug5fQRhPOoNxImz2zKFYUp605q92y4BKJULjKEef\n2jfmvg8tbDUbDkUs6Zq8ObH2ezFXzYtwnBFSSnBdNh1FiI8q8ouQX4tVMAYM\nAiJcW29LzNYQ20hR1dQUlxKK/toL5LrjCiNwnU8waU0HCnvaL/858vD4fP5T\nKpL0\r\n=oVDz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbfjgi7yY5uSc76fDOB0f4/FoIX5798yLicAKSacj1KQIgK3EGrqwodRFwKNULxblOfRRF8vSz3vyT5LY9rCScdjI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0_1589466389865_0.09550402928852253"},"_hasShrinkwrap":false},"3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0","gitHead":"6c9e72d85c6389275a257755f0edc9db5199723e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qy7qjCosVqnTZXET1BohO6LfMlwE61WYLJL0sMAQ56MeeUQWE14u6T2hNdSPKR2WxW9H7sgg5CAuuQQ9JF2fbw==","shasum":"ac7668476494a0ea6d76f98d3d1d86fa1d83f2ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0.tgz","fileCount":33,"unpackedSize":145940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVd6CRA9TVsSAnZWagAAIBEP/2dYbvcWtNxMNaxRaLbW\n+Yho3ek5a5RtLnmKljXIu28U7rnhOZ0aEIB3vDrX09N4FBUODOOjl/VnfRwF\n6lzso/+iX2LyWiaiGsg56KH0hkuwtxZDgg3fA3JbIxGSqI6ReqBH5rVe8Ak3\ne9y+sCI6iyi+vQ5+DD3qkuQXqgQLyA/xCObpyUqxW5h0dSHDNEsD/oFuAX+7\nPwbNuPDFDUXIDRSV0tvfNBzpZP8hY7eqtEA0B1jglG1poJvWvFOw/0tOLqyP\nP0rMZAMz39AJUydqbGy2KOMHureqLSbaUotl5ULkS16vuBTuv95ppaofFgbW\nq4RyfC3mSRQz2E+javCdIYkfeXNgAkgAyL4mEzJJDNvZFj0JAPQp935bHAmw\noRJo2GNkXfR9ibJZN/kyYT7HjOfCSNczslTqddcmsoGjy2ZT4MyA96ieZz2M\nj0sytMAUUeTpy1b81p+sg4+ShEzLVoCmCakRLwLd2Fexn0n0QOpzB+NkXruV\nDropSGpcMExU2sQ040uRp9zz2+IynP+2UfDyEx88+HcCKLNqasQV2U94RVu7\noqs4LKLCqFfUGoegvFTDMh6RGS5myQVKcAj3SNZ7zai/3807iofFbr7gRvrj\nuv72ZA7YwgABtWrJ7lsNr6GFWA/Vjwrw/JWesrhZSYiYPmYQ3xAZP5Dw0Ht9\nUHDh\r\n=4phD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqK00SDk/I/RLhLQNcAT1uF7rIjdBRHD8j1Ll+4kBhmgIgbkVsku+pBsjcWC9Og2ZCgYgur9UI7R6LgngF9aQi9qQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0_1589467001966_0.830043829923558"},"_hasShrinkwrap":false},"3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aa966ce2817078c0c2c307f12cc68782eb7d66e3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-R4SkVbPYiR75zk0M6vogavEdxVxg4sb5Ve2bcIQzbNjFqz/eYJgjGl79EXdyHFbweCuSyqOvcVeIntejcCxUIw==","shasum":"79f1a3e7e89dc4e3208f8cdbb652b000cbc023fc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0.tgz","fileCount":33,"unpackedSize":145940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVfeCRA9TVsSAnZWagAAkj0P/jimFlC5Un36HSqGUYwW\nNS2waYud7Na5tx/BvcHIeKfx2RXhc7CHCcSj67qdGU8fBuOx00Pg77Jqnp2S\nFvXAjtnMY71x87HoMNJISsEs2Z/+pbuWAlR//l0/tsBqFeJOVIaZZuPBaMhV\n5YfiBajiTxVfXmF/LS+lr2WSWGNn9OhynSAU98KLCxt/+zNOFb8vzZCj3+u/\n05QdG6ZsascnYjycHV3NW5zK55nI/SXUbLm0eeR0HkUp7x+qcXEDpPCSabUX\nOM5QWpzJ5fqMCZrdSsamnvXuv1dbrD50GNGTl1gsBTNAyubSKNZPEyhjrb5z\nQqjafrylQCvR1P9zATesK6MleU27h6XsLH2UGndUQeYOWPokSAc1Ipwh7C+r\nG76I4lWFEvi3ZmE2AuYp/APuvT9hTsQxlfyAXzWhkWjMUVbg2MSkZkaL4rT4\npC/fFaeqslbQOylUcduUG/eSeSi+h0kJahG6rkXYLyQq/sldrF7t3HcUA9q2\nXjFHsFapRxcQcnGhibpCUaf/ZqOdk2YputPj+++82emfRL+EQ9M/kp5B3P0L\nYCPDlICwSCFbolgGfd02Dy8eebM4H3WWyV7Zil6rb1fjF7xQN1D3HY1enj7a\nD2yP0oFgWeuZvEUioVR5w2BfoYqgoRWXAX/dZmL+BLRIigXkjQLFq1X1lxSr\nugzw\r\n=nHxE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARgtS/hvDkkCPI3m1M61BAKY7Kj2jyBkfzFGeTIFHSXAiBpcZ5djqUDF1MRvpPMCJT8j0b6zdBoFKiOaPnH5O6yWQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0_1589467101982_0.31029670762923844"},"_hasShrinkwrap":false},"3.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.2","gitHead":"7c8eef260c5947cf0118b91dd4d0f8c8e7be6684","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xlEhxu/xLgey76OmucSSAyZ9+rv4ZcfQe8dG6g7rQDUrKi4ZUExozHkQESRedsvH8UjkYAvLKY3BDJthND3V2A==","shasum":"a9e00a1f7a84ffa81daf6f2692cb2bbc11c880c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.2.tgz","fileCount":33,"unpackedSize":146186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVfzCRA9TVsSAnZWagAAWAkP/1XXGR7BxLedTFG2YTWV\nEBabQXDLTuqvqde1ALH6X11UVsf5hfitNIABuc/jPj9HVKaxzpQW2A69WGLv\ncxHaXht8g86TJE0nRXXMZ6+wrdA8QpkYqwT2AS+azY38VL5u+JBwYyPkYWs7\nI+VWJ6TFgfsNt8W27VMn2XIhZrOBdrHmEfcp+9rVQrbzStNcqoO52IqUctHe\n+l5WvjcvVJmhKDYVEJtOgNUJHUysJ/ID1BMFVR3fKCBkPYaNcUeQCrRc11cb\ntivIsAkoWFvyespngonxRLjXIb6agC3/1FEtOF8oooQiAeBdjbXAvB09XKtg\nbcutDKQG4h+CCTePK/cQGhY1iEI1hAXUPCwpEjKiLXYdulsKGQMx4AxrZbYG\nQCKA+WH8vzinxoW3QJ3S7Wj/RYB0C6Z4p0l8lgRbRt/Y2Yn82aqITxY4Oqae\nYEPT/n7W8gfSCWenx4mFqg+9/hx5DYfSMRZmmwDK0rr/LyfxmK67rF/0Iu5J\ntdevtxGlUFqCvVLDZy/V6StAY2MZkGCz+5Yv/brKz6rex/WTwaguv3X2BeJj\nyB/aFy9yscyhduKStvYNOlH6ajvtEdrPsiQxjh2tEpGoXG+beUvR4Nc4iESq\nIMVN0tMXvyPif+klKYbXICmghxdHmwFjVHvPZF9KqzrrX7JDzyAC3yZHNThe\n1yQ2\r\n=KfkR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxqkeQgPhizbF376qi1/tCpl+dKklDSIsoBoCsFOHNeAiEA+2UYg+l312eTR7qILgN1rbzVn6OYhDyR3b8NacKmOic="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.2_1589467122916_0.2802722567437208"},"_hasShrinkwrap":false},"3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7c8eef260c5947cf0118b91dd4d0f8c8e7be6684","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-dVei5ZzbY2g2x7Ax4vomYJDG8cta93HZbaQXCLdA5eWrS/QykutoJV4nYc9ca4v5tyagS7UdN43nB1w1G/BgGA==","shasum":"9909b9525bc34b073208d54ae78fc9322ed6d719","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0.tgz","fileCount":33,"unpackedSize":146229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVgbCRA9TVsSAnZWagAAZLwP/12XhfmocrB2BQfVEk+h\nGshy1xA9Crg+4IxvoTX8p7ZdvU5izgzBN0MoJqOkPYydjHhLV4wJcEPFqxav\nIVG8t5ihqhWVUPKCuZ3yBLtA8I9qnSBNdefbw8KfQmu3fpP9AuO2WVKiBXd7\nLuh6RSGH76VC5JHDc6YUaCvakZU/ZETjT67eUdBxCmbn/mKPFi4ZtTR2lSj7\ngubccz99wfSOCCg8m8mYj+i3rcQQxBvRvJPhRsJ8y4MV4xDhrsRpQZ0xPehN\nMo02OYRQAFb7M+gGY7zsEcH3BVYaOGOEFjCBo/g9SAToGStS27J8f4Ms7WQW\nISzNvsTdYPQNL0p7qMkRUDjBwJP0knjefk9CGsdQnh1dfF5l+iro7tnby+hx\nZ0TI+VB2hMHd1PPAVD5ZdH9gk2497QtAr7fU1tkWG+uQRrM4KHvFctfl/AdT\nFXEUvaGWIxFCSuyoHfcOjc9CX2KUqiUbJcrxLp4uhRYOnbO+8dqw05xlKCvW\ned+4C0Kg0VU253+D8U33tnclUSk7/W+b7RV6xkn/rFQXw3s/drk0XhY753oX\nXxQVKHuzmSfQMIp2d2suciLd7NSjqYnHxWplUnWj4zlaGLSE3PAG5bn2g3Sr\nZlIVh60QaKuEMQTdW4d5EjPwax7WE9TU8T4DssUiLKO0NJYgtFIUF9PoWWMm\niARg\r\n=ILoE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtDfp+aMcba2ljMKFEI9l/EZ9bnasS+o2i6FRFBfiUJAIgcU2bSXiLSY3sx7V2+1RvrswqTj6oPRVi6HTtVv2xRcY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0_1589467163324_0.6620966087273481"},"_hasShrinkwrap":false},"3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.32","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.4","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0","gitHead":"080e11a2c8c0a5c8876fe87c15429a81ea4e6016","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QH96/R2k+JmuveElvyfU5wkeEhzxQPnmSGPkLdcXFWdmYC5SPm6mYYPhhAbz3CfJ6LQGDQ5U436Ul48U8sDnoQ==","shasum":"bd89aaf58ea0da0c188e0309b2fe1cb6d7a4468b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0.tgz","fileCount":33,"unpackedSize":146229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevVhmCRA9TVsSAnZWagAA4t8P/3pR54pNOXekCBjghn3J\no9qk5EZfVfziT5mv5UbrpcoIWp0oKTf3Y3OC6RGPV/msKyX9Xce48lYLp73H\najm2+75nN6UC37Z5nELm1Efk2Y+o4qlSQwGxPVTC8p08v0FybujP3lRIV3fV\njCyHqNltV1pbo4foym0ZvRa+cfHCqt0090R/CM8acKe7mWI7GmNvuygfTMfN\nt5uDeLzmsisKW0J8rkANsyWmlbB0mfyCPRg7oU0tVhx/YyyHrsOhvGE9n0Sk\nJ/lw93Y36Nh2HgGJOC+qx7a6ob9Ymn+6x//rEQrDOKWLszOKLpviQdPYAHRq\ns2cSeeOFjHK6gngi2MCtZPsxnTuyouw8wiYNG00JFM4q8Q2f6CXdSao2OSrE\nFgVvnnlQfCjgftvE0o08BEzDbRVB2qJ/aX3W06ET8VsTTKDzbx1ev3L36mPw\ndg0pRiy0cz+fJWD6kZIg2eVDW9dhBzfyYeZ7dsBnZX4teEZqp5aU5ailDepa\nmrkExCBFZwIiVK80X25nQr5W/EPy8RNgWjvX1QdtSSofhHbPsJWjKB1iBpqt\n/DH7F1nXWJAqPhGKGW+8SYoVQrcFNRKPuPEc3v38n+11Ta5Qlfgvyrh4uUUU\nROUQxM+b2HiAU2Bw7Ek02/7shMYaDm5KbWa0vNZdvzr4ImVjgrHM4vTSsVFU\nLLEh\r\n=JCXg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICa8wlmSfl1XIEcj7n5Z6kpSfEX7nZce9glUE8w+u3DoAiAyqQdYmw5qE+DkRSwmCLJiNtGyjhg5Dt4o1CpsqzjYWg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0_1589467238077_0.5017279954403853"},"_hasShrinkwrap":false},"3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0","gitHead":"27a7c1d70b9899d350e0b2b88ba1f532fe0ae189","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-y+UM1VdwMMGA+UGtIxkmrBc1gyAaeHZ/VcQZHS9lYsuveYdYV2/PpDHYfZPMi+v4C36jOL/yGABk/KJdXCCqVA==","shasum":"137263bce6d861c140722568cb2c45df96cdde88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0.tgz","fileCount":33,"unpackedSize":146229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrwcCRA9TVsSAnZWagAAXsoQAIDG3kjkUgBOkAHCCHf8\nHmw/IznD5oAfvYQN4wY+yqgocyX/N+u+ghHeHceicA1R1i0suSZhHrIsMilM\nKsbzv8RNwN5BtozxEYIM7jow68QgQIrhiKQNItkgF5hsySt4SxuPTFyMfZJh\n10U4id7U23fFyChCIy57ucrEB0HBMvcFM9raRgnxtDH743R22Zyxpus+l3Ce\nSHwm7laQY/DTrNnRHKeRWld+SVj3Z0vqM7TJoAmDJgLEogBdq6xczKWKm/0r\nJHaFc8SaKctrnB9DKTRN9uCmDdgnSyVSlkN1HZXeq9uckMJxrfJnVU9TcuyZ\nQhm2wnC6GIuVS7XoReAlv/fWVKlgRZyXCbWzyZoIjrDYWLtmRh14nf9gnUX4\nV2nDPtb5Qa3Pu03rLtwhkCslOE1McQ+2Ncl41iQGOgAXmvFLjkBF38jW7OCr\no0Y2DWn8ZFi8++sLKV4uSWNEDWhBcZH8QuA8sIevpoQMv93zBZFkVh28Q9oV\ngsND+Qru1iOnqFRxAu4xtfGVi3LX+41oVoP4YjTZm+rsbein3Jdd//ecHV8I\nnQF/rC95JLtfA7Y1zz3PX1lHdZkchm7TYDmH3EOImAGPkPQ0GQrfcsfXcg7O\nCAbk5TBocFvhmEDL/xT+dcQW4vhZLPGgwKeRYfCoZAYm1m5ErfqAAdYHzcx9\n8f9C\r\n=A4nV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3099IiNEiiKx/I/O9weodYkWQQTFRy6vGikHBEQ5g3AiEAgmaq5j0KaoJXY9F/xd4e4YfLqhDUCIeuG2ONydpjXQY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0_1589558299806_0.7182635260945558"},"_hasShrinkwrap":false},"3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6dc32d8a061841fa34814b5b4e2d9cbdf7f27781","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FrOxyneb2CoJM9MhrWQfr2fA/c8zjnJLo4i6eWqUKPjuOmt9TNcZSMlVetnjKq/sFo0E+QrP+1Fiel+8MOWxtA==","shasum":"9ff74dab473716cb3bd5d20d3d5fa11d7e7193a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0.tgz","fileCount":33,"unpackedSize":146229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrxyCRA9TVsSAnZWagAARfIQAJfIBgm1lWUb8Y+2WxCz\nJH0suzx6zAW1S+NsTp8lwJRtyWHGmRTahDvcR84vgZ21/tPT99Fm19K63vEd\n0V4drmRa6Dbzjk5HStag6kHralTxwhvoZup812oPlE2PigpD1xOiTYQW59pC\nPDNiMk2UHe3bRLGiES0jvFlFjudWxP4/v2t2+wo9jeqxQJU96g0GDcZPGgdA\nRmXRWTp60YiBEkb7xHNIvG6UjkFLi+k3h/DiJbhxQ9lcLUY6FpQSs0U7Ipoq\nmw3UUB4W/IGLNhxYEnFZI+cN8S2C4pZVz1OIWMTa3u6qMKKbbIs+ceKPudni\nDF25TtLt8OtA9ULDQSQO+Eabr4i0DpPzk6Rw8PbpxjPSUxhXXOGdgF46rGAG\nbhf+dQbxEBCgJlRBE/jVrCIxFJQbkMdZ5inac4wcAI23O6VhAopBZl+7CJly\nBS6gUWj2rwpnkDlHCMfCfuUsDKrCRsgn2dpZb61BDYxIrYXPvgcFc1RSeT5c\nLurv3Vp0XvThsy3WbjznNqVFwk60iOFa+1jGNoPfdHN0ogahZwXJ6QMdJhfX\nzr/jVHL6AGzgv0YeM/fNEhTRGoeIctzxXmI1jDvwmLcY6TdP5mi2a/ZUqtFn\nQnI08iDzbPg+desZSiXgpWX0VJ+FgtmXok2TroCOTnSssJworwXVc/MVG52e\nImod\r\n=3lek\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/smTxTwC4OO/0u58WiPLmii87B0+zBp6jTxViYteKkAiBVEJKvGZ9GdRzJRB+hYuTTqQqE6Pz2Ybki+ZrNcGxeDw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0_1589558386035_0.12388601478928818"},"_hasShrinkwrap":false},"3.0.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.3","gitHead":"326508a52f8a8f7701f19618988c97b310dfeb18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.3","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-M9Lqk4AUoXMHvZtZOwAebgRb/BJVcf+XEouXLEu6XUWLJEg1r3/g22PXcWGGaCJHUXTp2lTEc9jAQx4ERiPNiA==","shasum":"38dc80589a5816f2a55fc3ba60318b11c3fe1c3d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.3.tgz","fileCount":33,"unpackedSize":146466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrycCRA9TVsSAnZWagAAaJ4P/2cyGkMq2Bk3z0/qOv6i\nibovjiJUXPme2zrbnmTo1VLENJt/ooRXIcANbiaCI+orZDWOAY3rEDBaxtTM\n4GkgPxBoKnHizM86pBHJFcoz6dHgpzrW6sfRJoKJtJWqjesA7vJxuxigejqt\necx47TAUWqdHehruQF3bkUXxaikXZQesNhXFpaIAjqecs3g2T7bNIPVGaWab\nBmwon/xLeoTLD8q79LYX5WNU0BI8sQTuc5nwIHXNKORsQ5pfn581dHYhdjSd\nE48q14i+8DbUxVck1TcknbD10kE6GfztEk23Gz+zgRZGIjm4i1LP6mY7xNY0\nmPaeIMHdpyd1LD3xeIbyTOsYFoosd+O2eUFk+HF1gQBkoIjqsIQ4wL00LxXP\n3VCL7KJlqLQvxwoaTwmlcwpdJT1fkXIX6xJgm2CPbnkzw3xYNyIit8zTC9Mm\ngoG8uoII1/Nf12gkbGDxvokT6U+rn52DvWmi29mEAutIOX+v9VjWP1ukmHyl\nbDWAL6sNlA9EsM7N7sKSwd3cdm51yQYbQkSphkWBJ9NpQNuOBP6Hn8PF/OvR\ntyjJtA98HWL++njxq7lPh59I1V08itnXpAI+6RZaZACXksB/MoMk2Bq3u0Uq\nj+IEUYrvqHRkEhbrR8otcDu2b0vryDZfgV6RFs5VKfY3cxAnukScdcFycB4C\nZZWU\r\n=73r/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADmRzedxz72eFtBlm1/SsupgpGTYsWvwx4olOi5rBgpAiBDfpfIkdlgSNFFye7qUappTtb2JQFB3OLzU7ii7UTk+w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.3_1589558427476_0.5075763275902188"},"_hasShrinkwrap":false},"3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"326508a52f8a8f7701f19618988c97b310dfeb18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6YGcdK4x9JNZOVu8HtDyMK7NfQFveG1eDX+KPRhTo5rzrCeYI2mlaSeHyKLecgEsIXW3U/tZJn7GqMRctwkFmg==","shasum":"97848b770a27fc3d5726b78bf8b591fc9a4a3e2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrzECRA9TVsSAnZWagAAlXMQAKOIfSOn3yrijKg1pPIu\ndqL0wuJ8TaL1tIpjwenDpGbzFoEd8KJPVhWfV0eO6rzmk5V/pFM/dLChdIGE\nuOO1efwBDUVrCRcVVsgYHx3zmAVJwcNcEBsAbjicj1jd9DiBQZ1Nm0UfGtlV\nh2+8U6IO/HiqG6wdO+R25VRpBggLLayumSsgkqqh02ZiXJjVO6FLBNEIett6\nkhd0NGemUmV5bt3Aynyms276fTsPPmQK/qEkb12WbEJ6Onhw88WeR7amoFWc\nHs+vaK8BZXP5NqQNXIXMJkPGn2nzde1TONAPFDOilzPVihkL1pLi9JUeIpKu\np139iFYgjAFa7vlVaZPnM4jjOIXNzrytIh3Q6x1J5Ue23N/bifFD2ximl9rV\nDiGRetNg7U5ar5k75aJFZYRMjZvmdYvY/VSiPhg0StL0gkyPYv7wxHHwkPLL\nHXxGB/hGEtCQLQTzkLt6i/g6NdO5169huiQAxwpdcFdsuv2u4ZgYBrOsDzyD\nCa3FaQox9y5/wukoNW/zmJ8z8leYmTHIV/o5XGrtDHGY6xU2+p9fOTLOlN+X\n6Ltv12mHLJJ1qO2nLcqAEkaHlV++zdzfjqmvv/KtlZiJ5T6dsYbOKPEMqbEj\nunpO9M8dpicAo2nE7W5AwlHTP9uuNfMjmFuaIzB/PO7PKC5KbKWzFiqeP3at\nVCh3\r\n=ffd9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+o7srE2k6Yo+q8TYzVZiJdraOuwdpO7/Sy662C4sAXgIgSSOvecx3ppZeX63stLu0QZQir/qNGKknKDRIaF9Zm/o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0_1589558468087_0.37964598945281436"},"_hasShrinkwrap":false},"3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.32","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0","gitHead":"f80533087b14c1f0aa8a687a417188f979567935","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZZO3SBzSW/5yY8pu5S3Moupoqo86nz+RzAlaKtTYOOvV0xN9rY1QBN+tGNZIBDwQekWV1pldK/a/biTSQGZV5A==","shasum":"a578f2032e8127524a115619f24af70890c33cca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrz4CRA9TVsSAnZWagAA8EoP/3WpAtmAoHHVCVWl6B9D\nN+U0fHItSW4xB5NSMGWFn1VMQUvxaj7iYx4YTEd6P0qqV+LwDOPxvHMhh4eF\n3Ip7sZ0SE+D3R2kFqnAeazs62Ggei2p5kSy4o4OnRnJ2hNaelMOI98Hr4sL8\nlz393Bx+LsidK9NnBmXJvN127xNQNU0K9XkYGZyl00acxWJlQQN57Ljxt0TE\nxXRCa7mQh+eidDZLYm860xpqIgpgZDVa+nLp+bcFWJzhJzO0+RCdFXrXSgo0\neBjxjYg4PwO6gZeoCI+zbKY+Xfwwu1vpygzQ8EnzM3MM/B8i2ySVYgtYvORL\neGQKhQCz1AKyiaiz4nBcjsyCMkhA1iPrqfi79Xt/keNqRLdG0/gZUryqnEBe\nBQUhy9fDjESE+Sk3/PTPEc57ptOJlaMGWTTuTXgOK9ePn+RmQvNymRX7NgLV\nNYjsY3aF48ECzBqFsstunEcFp2JxxrbToGN4zuE7WDG/SLKaR6gCGkNG2Vtr\nXSxkQ0+PgrVpc9Brk1wJ3XKaoA73e52Nr30b/fwVXDqPLOdtqwwqeG8oqr74\nfzMxxYxmQgwsoTM50aurrLiteW40j2e2fDH790VsmKB1zZaQThWTb2+fyvc4\n8kOv+RaMcX/yoZGRmP6633XPStuK6tJhNGMX/A5cWYmfZ7waOVk9J/hDy2LW\nIJ+0\r\n=ivsf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeHokNGciEDAYWKNGc5jb5uHGTOQOhCvmDlxJ5FJ0R5wIgEWFiWXY1WsEowyuZzWwzoJt+yFIO4E1VsJEKXyjv+4M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0_1589558520454_0.7750368002767067"},"_hasShrinkwrap":false},"3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.33","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0","gitHead":"e1d644f49685252d8153ab414f46430e5a4ea1cc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ClmdHHS1owB+5eowQIEEFWBj+EFBiV9Zznjd9lKF9cMUX0szNg5rh+P4rBgKhorZL3idTi/Af5JsngqkTAgiqA==","shasum":"47867d15bfe1c54c8b31eb056c87098c4ff9af86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev6xSCRA9TVsSAnZWagAA9FgP/ir94h7fNDHACED5CIj3\nPrDdClIGjLKGtL7U88gAv6or+nEFyffc7o06GGmoMgtMieuOXIyuAX8BgV/j\njL3fgpyjkvj+IyxiJthmQ8dnb5Sb/p3p99QSc4R2T3TTZ2ny9jMbot7LHWV5\n3U+ARxoc/L2Z7Iw1TqUDnxuG8KMTOuY+GJ0YZ1UeTch7MjI1Q1u5kJiY5GzW\nv92RakqF7t8ETTc/8/Y+ydGZPBNpmDdQqffsPHbN9Ig4RnLa8+r3rgTcrSRY\nV/P3cB16ymLs/7edthMAI9bUhvezW0JN7huitVyQAu4juAgKUJV2ueg9bIIJ\n6aJ/aK4ROK72JGAeQZ3mdlsQBIoGO1ufIYMryy261NGOK/TNRJIvaITALB73\nHyzrygDu9FLKVa17yxFo43+ctA3Git7enoqHBAWob8Jej0A4UZTSZDGO/e5/\n41QcRmFEYQUH16eIqS3oyVbNiKk8FO2qf5Vm5Hp48RsHzkxQPzas2ZFdYrIq\nKmOvV7nbuBm7BP0rn1o6GYh76wWJFVGwvWjjBHd11cTb0ZnUnN0MAc5CDkpl\nZVNPgZ+/lninHunHSFWgTw8tBmZWTb2zcCiMV1IHLbwEchRWUAfJbzRUS5GE\n2LpWPBNi3obClHiglPoLjW5xNqIZpuVid8fayCVrsObxJDhhVkUIzY1rGqh4\nWVwx\r\n=YM8U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT9eWGs5BcsU6217YnZoaPrLPNZlnnULiPwxI8ZGQimQIhAJHx4iof1e9hyXPVvVxVG2bxNvM/x5H6eQgey0fWqDDA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0_1589619793798_0.4898103067405668"},"_hasShrinkwrap":false},"3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.34","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.61","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0","gitHead":"34b29eb235e5a8374932ee65873a0f7c824bd11c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZRfkaBWVnYzD0GQK12lWr0X4cFP259FtPwr+JwnNhjlXpVt9csyE2qi0iEIQus0IV1ZseCN2fFj0VmT6TIPlOg==","shasum":"cf2e4030df7f52814d144bab6d601dcea08086b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev70pCRA9TVsSAnZWagAARGsQAIu2lagVect3DsaEVESN\nbzIC2t1K01PoiE7JpjSvXnoocnVijuymSHJgiKoy+Z56NOlBT7PfzsS0wGvd\nli+2UIAnrFMIjMxjhWjt9V4GEg8Bog6eWZ/xwPM4WRU8AtfqYRrU+3Kp17ZG\nVz7DTL2WcqWU6CDsmjOtPf+k6j5xaMQTh2CPz8oaNI6CRzq6tk2H055x8zkc\neT/ud0etYQaN35qC5HwKAXeTnL2apJT4YreTFS3P+tyH1l2pk/1uEGLTQSPv\nDtNVkxO0WVXMRluLdFQ+CBqWAswIX7Te1Osp4yqX555B4NavoAXVuapwqSGM\nHVpM6+JOhLQPy6OywoCQoZKPghhDRFTjVFhWmNGR3hUtuYkQbGXNYsEPjREd\nHAJkcmYvHITo+S89mH2rTl69a0SqgwgXaNWoMw8x4xH4vDxAlbZrtYujztGy\nLWGHxWR5/g0yrDdGEIVG6AFCDgrDXl4CC9T0w686ZCHCMjaUes0rg8mG1cEE\nFJkT2btRQNAAqPCCVzuFKQNFIYUTQQU5z+/kZVgvdTJkuIl79gsFktXCnZp0\n+vPIUItQSGHa8e8ry5ckTOSiVhRGIP7d0E6DMK+MozOOmdFW2lM+XiqQsude\n0KQA0Xz5Pbi+5OWbD3li95K/k8JdvaZtHzo6viRkj3lfAxHDSlY5StkH6UVM\nosVs\r\n=qA6V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEDyx7wIVUVnGPQnfr0rReWO4tZ1FSUGfBqyLikzVgVuAiAHabkx66G6uL8IdZNSG52s8PmSsYNKEmY0YIBJCt8u8Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0_1589624105454_0.15968711969867755"},"_hasShrinkwrap":false},"3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.62","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0","gitHead":"24527a376a7f5102c353d4512ed3e1d51e1ace6a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7iWpntVhmCT59lC56hEil1PgWhfi4mr7Bo8UurfRrFiiK/eFJaAXLfTsHOnGeJLY2a9SrWAf/6pKvf9HJBz+ZQ==","shasum":"5845c57faf0518e94e52169f01d496228bcfd6be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev8d2CRA9TVsSAnZWagAACJMP/ROfq7RhmcTtwKfUwpgz\ncTOPenVMSQ4AlhD1icjklAcM40okJihnXTS4ew9AR1xqdk4qPIgWtZAjHaja\nK7DI3rR6K0vXl10l0JboGKXzg4Q7FiytH4GJxoBh3Cdcj0fqY/wkjAf7qMAy\n8z1rN35Fbkpf4B2sy4acP9cA5o9T3pZgbl+5888Z4q48vNcxW58zuM5bj8I1\nQyDCJquEnDZWwPiDikquJs0nukh98ujT0xHppmP0POaGXBdL4+eqQBVYjedr\njg5MzeEs66l54Kd66HS7WKz0CTEv2Gw5v/x9wE2J8qk84ng8BjCSO4P0IKcI\nsTJsk7yxtsRNQa8BcJXIFDAZeoIUrzvQqh6dz3NtxhCTo66tQnVcc8KuNmoE\nrXr96oA5UypB+Q253dOW1mOjTzq7mhyVqY75hsjoN8TUKAod1tEKLpSDV8TO\nT9S1paSTD6FpqMHUQjVT+I05Aoo0z2rpoHVhbcPX/L5lA0UInmzn3Nng0+tR\nA2+j5UBka0Vze1cPcOXX6ipkcb888QFWK9ajwbnNb1ZJRmHIh5Mb3rQmCPh4\nGOuE7pvPaknqGYnCKz7WPYOJJGzF45Nwjq5eiXuQxzZA6cZ8QJXdUYDoQh+k\nnvX41H6w6+poYFGnNdO/2spg3Svs0BssZL8bS6y5cNI5zAtLCFfbCucKLOym\nRHad\r\n=AeeT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLQLxftxAiIChCeUOZfJko4PQZXbb2kcR/pI3yB4NjzQIhAMxzzL/7p1TrvbRgFujshwZfiuxMEzRT9h9Ea1bi55Kv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0_1589626742345_0.5756437613406595"},"_hasShrinkwrap":false},"3.0.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.62","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4","gitHead":"60804d357b0f6da07268c5791c569292068442b5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EptvCx8EndNdPULN3zD9DSkuiaWJ83Uo/APwWHo5j47Yd2qcIKFg6FvHYZkLyAB2P+bcfewMslLodPrZ0XATug==","shasum":"4b3bbd2a5d0913a119c7274ea2d05444118c81d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4.tgz","fileCount":33,"unpackedSize":146740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev8f6CRA9TVsSAnZWagAAAh4P/2Pjxo5zRfmZyKN6EUi8\nW/+xcSjNBIZm3e6rvTXAvsNA1zKo/h0O8PHDi5DV6Fpb+oaaGT+0jqImKQaS\nloBDZMmujtetAMMrDEiwTglfHTymLm4EBUI0iN2ablTVx3BJtKIecVbAk3eW\n3v+FaPau8oWyjijgyLMQndC/yX/lJ8bnnNwAXHQ56lbIHo90OqSjRptKtUrX\nGQxY4m/d2Z6qaHsoRo+bS4J0EXgh+G9N0FK16kMymA86GLuvG8gwMzXo8d0/\nzZ9YPxwolXOBqVL1lcobJRXkNpohf6NDu4O6I4dhzrHBngT61/Sx1qpEgyTb\nl7LyF8R0/zT8cn+3OF+/aJWDQL1g6mRkADlJhIebr/pInfHEM7C8vgHx9npd\nW3Gg2IBQgfc6qgjxXGllSI4msgMzUMfGo0g3gpwBdkwnxyV0G2omdM/wbs2P\nNo9TcCnBm884Joq9jWPWqpq9HMhJDnv+2vKw4X18YqULAUMIQ9+5XulKTsIJ\nWneK4QuGcfUGc0YMUspt/euwqtCs90n0Uk8N2btvCGAVnUy7biwyyk6hp2xA\nMexETyNFGUHcBYEOGRPiylWWB2ej2FCrv4CZ/4eKFcnUasg40yw69K6EzX+B\nKW+59Ie0fJqxCqFDgllxTUHFh76Af58w52JScy3CQyBqn5spMlYjAHujndSd\nSoJ2\r\n=JQ2r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/hf+GTxvb87RbMuBAiBtUzHDdGFGDyQxqiYCWiXu+RwIhAL0Mltgw/BgTyAABOgTi2HBcISOxNgzZQ6qeZdrqI+mk"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4_1589626873822_0.5385762892529904"},"_hasShrinkwrap":false},"3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.62","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7f5f9ff60f93d9cb0699d40479ad77ec02fcab95","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GHJSMGoXl7wNmfeHKWcckeoRvbEudouLXj/4nuhNnRm8e8lOsHGRHOrAt8yEvFtYZQpwsv/pZIQSHqe4+bGoBg==","shasum":"129ff24c7a4d02cbda49aa27d80db025073ddda6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0.tgz","fileCount":33,"unpackedSize":146509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev8gOCRA9TVsSAnZWagAAk2IP/1vWNQGm4yfzHdAJyvGk\nAp829V9Gz3ek0SZu5g1y+MtDPJLDCWaiRXmNsnTFllc4WKulUgSn98tYQe8x\nMJ89+LBLUL6mtkWsXXST/ZkHwguBTgjcLT67r2+eZlJ7UNwa4gnNh7+mRCdi\nlWc8asWmUi8sxqfl85waYyEM5oafbzem2PAA9M24KLDKlAD1fGGZe/K68aQt\nK4UCF6TGQ0j7jp14Lz3sbu6cNvtco33CgAu1DTBWpLaxB/2xIuUJeJ15CPqB\nH5tkkDl0VDraN6DdsAZqEaDTkIdDBtMrw9rW8qRpYk6llmmmCXinJYDVzARM\n3NfAt7ud2+FEt2KNlEOzCf7psdwZXGxJlVoh0QCYK85ki+kwSnTOWTc9mnd/\nt7IsW/nJhbz389fGhZxu+2bwROq+szCIrhFO2FTrWrzkCoabpBTKjcgHAOoP\nnm8i9/CZI/YJ+VcQQKNSOav9IRs5yerMOseOSwUSwn7hLL6QCQkYeH4aXISE\nXhqcXi/wN5H3JPW6K8nwUXmn7nps2uunCfQPyIvZSynD562k6G6naUp+xIXQ\nfgnoJ3h+BcJA2wGxBHijRxHTSESzIzwX8WvK2oDbOWE8eQkI6syqRJ1qG6vr\n0nI++uH0WD6JV7/5JIDhCIeJB9A2WUPuJseiGSmuho51ZW9V9dPDmKR5pG9l\nTgC1\r\n=+ipQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDsLOw1bLy0z0rNvT5fEbRgqVCwTuXys+oErqPjnM10RAiEA6sX1Ri4TVrVZmO7IoofoUm1QpXIXJAQRyCz7gU1hsAw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0_1589626894048_0.8210480206646178"},"_hasShrinkwrap":false},"3.0.5-60804d357b0f6da07268c5791c569292068442b5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.62","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.5-60804d357b0f6da07268c5791c569292068442b5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"60804d357b0f6da07268c5791c569292068442b5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.5-60804d357b0f6da07268c5791c569292068442b5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-efgw1HWX/pzGniC4Z7p3hG7BYTJevh2tyCyTZ5pNeJDWoWUTjhgIqfexCpdRHED+BNw3Sgg2cDjvYYIYQmdvZQ==","shasum":"ffc2316826423f4384de1e72eab23f82aea9dd98","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.5-60804d357b0f6da07268c5791c569292068442b5.0.tgz","fileCount":33,"unpackedSize":146783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev8hpCRA9TVsSAnZWagAA+PUQAITRLx+dEhM+MNx7Q0xE\nIAArsrtcUxSOQOr0LLdbBQbB3rCTTiSxRVJcFwiRMSuZ0x/xDAxhjjphz5yq\ntevjQJnv6JzEnAIfN04UyBxOIYXImVaqP/g7VftAhTa4o3hdWkt6Kloq35bc\n4vyCfT5bt8J3Re9d4QyfE8K598dITNygr9NGM1b6HadEFVfTX18LLw8Hz/MZ\nXcTvBiWPn7oO2XSeXEk1uQjBfvkz3MxLTrcYQ687wlCuENOayCLuSsUfgBVE\nlmMNPua+L5TwC7idXKokqjZe5EPmQZmoRMlmAubNXpqIfXdULUEggoB0G87X\ntYDU2Nnauj2s8UCEZVpktcezazAz6XNfruUt1FcaSPQ92TcIWQ4OzHt1hDHK\n/t/kYBu+VxWVidA3tdus7qpE4zbe3OJkZRYLE0KlrE1iiTgltv1IXKu91mbI\niyc8Q9WbxMHoExsSuIDPvARbfyLeHoczKse57kGUmnB5coP8eioy8bAtpphn\n21d4Dsexf+18qQxts83puFzHQzp8SWdJC6yowQ/BsMibo1Fqi2BRiWJHJuJ1\n8dGIZLlLtyfWTcw8al/8fNj3t8YN+dkno6mnCMcWO2u6BRyn6F+JmEiLxF6Q\n/I/T4ZHJx+gQwnV7ZpyWC8qzdhTNaycSyWsMTMpBmVFVnmhqpjuWkE4swP9p\n37yI\r\n=8vju\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEoviLIsuBPN/eeTagqPaZSN3U6UlPOZqK7NLjxHPmFIAiEAolXawBJjUejcY5l/QdGDsh9bJa3F7YkxL2rWxbw70Kg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.5-60804d357b0f6da07268c5791c569292068442b5.0_1589626984523_0.5849484450490918"},"_hasShrinkwrap":false},"3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.34","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.62","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0","gitHead":"0a62018e554f2729cc0e750f34b437a2fc55842b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nHkzy9Brm2LbvXREgVew8oirNGLfqXxZFikRv9mM1LW+Zs3yck1CLOxPWhWHeXdIGxLC3YINaL1jApOd8lUHQg==","shasum":"80f2f02b3a5592a0a10021f65ea5a73f8ab53721","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0.tgz","fileCount":33,"unpackedSize":146783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev8ikCRA9TVsSAnZWagAAO30P/jkGLbCm+uT+t9NelZjo\nvz9DxPe/xwtlscjoiRh8HpBqiKZAAN8AUwkCEviYbOWIiXta5OnBSQ1Jmg5D\nx/QmRDR6tREKmuLTaJb5lzm9dm6nXqjbYmKFjCfFcNeQjBPbaXZhvmsL2/ax\nl4lbYKyTXRJqEda580C1BgIa/acmV4QTV851AsQ8RSorNVBWC/8/0zpcmXjw\nPMWW/a7mrm1331PdA1IiVzemDz2VHrzJQdX4gOR2D9Arzu/+rNtUtcdNYVLG\nE6150PCqLiQEjhHs8UUJvF0h0ER0bcw8RaILa+r7hGg5ftSIHmuV6lZKJ52y\nu3ogFvT/o+nI8aRe6yUm/9GNqV/DoqvG1xjPV71CKyQXgew9S4hM1sidyWih\nJEAW+kQKLI1FH+kQupLr6SypOh4gecGdl4Yl5VpyIzE3jzHOR01AF0WF8MNp\ncgW03M5MML0tMTnDwDFRVxPXxaxfrxx4M8T+DjZ5/w2+4o85uq9FR0ZXROMB\nlWJOrQG/ujSbwAc/0ZVXc8QnDLLyy6NexursoTw6KT5U/Er2+AzrGvUhcOab\ndIluq5uFDEIHk+FJh6DiQp+L9yFA3d7ZE2JaX9n5vOmUJZAK9zoy3o8Ko/A8\nb/ON8E1X3xH8njO9DanhNRTGhfuFwAQzxyIuXb+CENVUCZZir1jiaKzdtALa\ncFc6\r\n=yXv2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiAytO75UIWKG0ZR0LHkzT++VJWMLOaH0RKSLViyt8PAiEAo2TKAZ5V2MO6JQwdH2XLH2cbpha+y5l6QvWbppz64iI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0_1589627043883_0.7933556273171671"},"_hasShrinkwrap":false},"3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0","gitHead":"c064d86841c2226cd098a5fe6a9680db3b860ce0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-C5XCCzEdS/w3X+zzv3Mhd+t12XpZOSZIFr6/zektes/bXjVk1k20J0hfC2cFUn5e929XIQpUCrSo5NjAWv56OQ==","shasum":"98a06f111993b347b65691798ec273f083ccac64","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0.tgz","fileCount":33,"unpackedSize":146783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewGDdCRA9TVsSAnZWagAA1DAP/iuNekDS4H1kKg3dywmR\nzHm+pNgsDEl8aZxcCNav4A01Nn1gDEHoZFTAE5i1kV/bpeK6UfqvWQld4jCi\nTvrLoulbHtWjhpIISY6qKQ9iKcwkvEHlqQiYWz+oAVrB5l8sT3QyBqHwf8D+\nWpAKGBiwiPnRyjXXh2e5L6tR3h5IXbD/KcILvpggSGOLZUAkf2lorfQ5cZdH\nXQOzcFHhyGg1ZCFja+aT8ilm9x8K807bgQUPZQbqlIoMfdLqHLrC/DO6n1MY\nh7UAmjvNXvBg2ry7nQ9fVyjGyLfgTU56vXBJBtLnrtCNwZL1nljn3qCagcZV\nFmnZU+xdxod7I1PV2IVgZJ8E++UZ5z0vORskTV9F7DjFqWMOeI40+syvcLIs\n/UOrUiw2+lAB4B+Z7cO7QUIAiyoesZVMaZD+Pu1LRay6bXvzfqvpxwj84+Ff\nKkzI0JmmFSKtvBQpS2Sd8CV5cN8ae3mXspsf6pF0rOMwGXDBP3irV5tgPQGt\n+G8/imEwhYncyNyA5oV7+amWCryaMS9AmLUHMDvFhmIgAw3/yUznePEJg6Zy\nIpAgG8QWLtR8VkGT3D/x9pRdqoti/jFRyBcifhhPOPc0y84VnbqvQ7CN/FRt\nLrjyB2f1+oigl0GBymuctTheSkjXhCDZzAPpNXTImG1I0vw69iHyDj/SwcFd\nWQhL\r\n=c+S9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFi7onzl2vLmFKVFeFVySsu4wj+bsbpyOiSHWePISuKsAiEA6OJzoMSGHSyp5aBpWG5cjxdrvvRmWUUYz8ZslqV74YM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0_1589666012607_0.24163251399445773"},"_hasShrinkwrap":false},"3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"86e43d5346cb96704514607356cdba59a516f4ad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7XtgFSJzyuq+WUcRu3+7d5lDtAWJSEk9XVw3bmKykcFqXGQfPckyq0xiAExmPsB1x1PxGBBINMeUCT8FwwN0/g==","shasum":"f5062dbb8a4017fa2e19714c8b9986181a1ef96f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0.tgz","fileCount":33,"unpackedSize":146783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewGE2CRA9TVsSAnZWagAAv/0P/3u3phDb/Vb5idLzx4lb\njEeXzk7ABeZJWp6hD3XGYu1ilia2h5CcVFDb7tUKqa8tWp61YvISJHCC/A/N\n/1rf+g1g69HyfZOT8V3oNE5AzbEaeoan9nLWsAvX+GpdVFpLyOses75660rt\n7wvAKanjzLhP49GXuygQXXeNG4LXajzrJcLz0WP0z2FYXaHngyIhYdwTzlAT\nq8o2NcIinUqkLhQj2h7TVQarGuiolM5WHA20zs0XCpHH16AhvJ7+0MX/wHgZ\nhGnqkoQreZEzBZ/eKOSV79uRoPBmWl5zxBoXvIk56xDgue+VIkwFrq3oOrDA\nHxmUs4JzIGR+gyYHN36Z1rHoAGdz4ANKU+4MtEjzJsOLQ9W7JiLMe4ltU3oY\n5N+MOaMlQUNfBWfHIyEYWs+FHzEQWc0esFckNWfqrfuxkmg8q79qtR07q6RQ\nkklDRIDLY4QtdOKRJb9JY6IiFvUZsZOKkRfJnsgQV+gT6kfN5nLPkt/QNsSM\nfbLCN7UHbFlxjkZU8aMMS6JrA2KCia1sWJVHA+P+d+bKc6r/I0rY7p0M5YKJ\n7dMe4s0WIXzAdSMUZgMUFYZbls7ZG9/IQ2neEUqVQ8cJASa/h0ZMs4GLVKz7\n0qcGhntXzAWdruAOQm/MXiTQlKXResWBFxGlnNVEHGulepOK2OHmZ23oucVr\nX5jx\r\n=DgR6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzITV4jtHGPDFGJDZeUk+A6aSifsJx4RMsN7oCryxuxAiEApQ8dIWehDxZKQ+PUpyZ5f4OzfEVIo7shjES7mvtkLK8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0_1589666102087_0.7595851470012056"},"_hasShrinkwrap":false},"3.0.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.5","gitHead":"1ec5805ab0798e45ba836f43b407e8e8d2e71254","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.5","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-af/V8MI3nUT4Dz8aEqfesD+tDXmy4xtKASWoDxYfd4k9ShlIXU6KXzSLUcw4oqcly88r7dNePjra+o9hsXpqRg==","shasum":"b2e04d80ad77145721388459c20216c46d115469","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.5.tgz","fileCount":33,"unpackedSize":147014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewGFWCRA9TVsSAnZWagAAlYsP/3K88wfLey9C2YvBlrB5\nPvBwyOxgWBpGXDrU9Iu6QER/xYYWLpHp2ebLdL8QNrm/k/1bqSZUzHHn2CrW\nps1HGn+3za1cAMjxy8++EKdfFP8GnUnrfjf1CWOkogHcGLdlKjNyp0Q8Psol\n7WDbUmkjnkTtgxCtXus4cydcznX+9q053bVK/7Q9MLmttIxe71QvKENHifxq\nZ312JKdmxAGiKJVPg0WGLtkC3Odf4pSBaA5QIFFSCH9hD1zdSd3BV6FQFOxS\n/83y63/HRBprM5sgz0ul0M7ZwocdLcjgv5+xlne5AMk3L9lH6sW1upftbATn\nH5PN/3mqP0O4ynxObruIb7J2UxDlIgFhugeTjhkL53xkq8a6upaU3g63zWe/\nbmHijU8evv6M592DSQ8xIH/HHawitWuM7eF7jEgcKJhyf5+nRnUU2rEoWPgA\nhUYYV3Elk9g13fSvu86wWXF4aQDSp+oz7X2rExiy8VA2YwCRa6PkGKj6dlCI\ng54VY6K8nQtPCO42o1SAvEyHaG4GQ1yKhfDIrcE0/NOiE45bhYXSMy5cEOwo\nyeRjudpAxjupzWwaT0Pb+f0DOvRMmbAgMuxTNbN1sX/0HgSDGW5z3A5RT7CO\nRh+VyL+01hg/j59SIOYWal0l8d2IUufeArHioyu+XqHpSneyt775wtmlAVmb\n/qle\r\n=XP4j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3hPKbdS/jofZQXT2irkJ0wsP1xBw8Ds24WtlJza+s8AIgE2IROdzcGr5tzHirIf8quUiZxTIvyzAgnEySfaGeGro="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.5_1589666134129_0.8681468318851915"},"_hasShrinkwrap":false},"3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1ec5805ab0798e45ba836f43b407e8e8d2e71254","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jP//152r95+OT/ZiHKWa1sX5HFxMaMF0CeCYrfoFHIIdc4N+kewW6jDbdup28eD7c/hENObknrLKz9gbi4A7lw==","shasum":"34e3180e2576ed2777128954b40e2d7b7f78a294","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0.tgz","fileCount":33,"unpackedSize":147057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewGGWCRA9TVsSAnZWagAA7IcP/13rZW4wglgbKk4fQqM2\nj4TCvTagAjXYPXJe7Sew7XdcfH7xTIJogYxVv/+ICB6fRx4pO4o506CU1R3Q\ncpp4l/whnOEai6mp+SCowCyS8Lc53H27nMa/skeDhR0ResvJAuUdq587JZP7\n9oW3a/5OqwTVje2J2hNnHzwPZ3Hcg8UDOcuiohBQAPOTcYCuFR86y9rlxDf4\nlQk4z70lQBeBnzd1Zm3kT7PAv3oTDgLgnEvDzwYn+g2EMo3QdhmJJhgVPNvM\nRH6ykv64slCTK2qJdMGfuyDEBBZg+C4drPxse92qnEeGJS+8y9bPVYjcHqSH\nMgxZ10JdeG6YgfclM1OuekBvYYoRpXmZ8z/v/Qwpggnw7a21k6k6Mo8f+TKm\njlA6MgoLAGvFZltw9sGyEs3nGlVxaUcvfdhSl2vVqR4eWRIKJgbboaN1imu9\n8Y9apT4P1n9jZwd8DRY3zvpeNTphJAU25ZOPZPRFFxc5ICGMoix5Vnubn7M5\n0DJIFpcP6Jihm1VaQre6zWZpNiumaXGaKNya0AB4BfXP/d2rWqPMBT5xEhqX\nGxfhLAHpzmuL8xWxpMjlmt+Iu2UQJoJrFON3AWTcDNMyTeU4JFJYHuQhD3V3\ngeC7L8FNW7V1Db1ssPe2iv/G58TYgcQrfvYxhxfCWijKZUjEWsmB5+6NWzDO\nmXXO\r\n=8mKw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwyAK1OqfOFcaadEO/QN4h31mLyPst/cdD23FUGBIZ9AiEAphTcnLkPvW/fb7r++MKleVjnJlEuRFdbXqZ/8dctAB4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0_1589666197591_0.8834404211289326"},"_hasShrinkwrap":false},"3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.34","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0","gitHead":"83b21fcae932e46539a853fb9dfb568d3fea656f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f7SEigiihzE1Jko8KlKfyrlE9Hrkx3HCRrc/Poin3NoFqVkbcos37W7+YyVckvfHTziiP7yFDWBKXBwvsufweg==","shasum":"296bcb6ed0fd563a037d97389c614dcc1fb9c5f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0.tgz","fileCount":33,"unpackedSize":147057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewGG5CRA9TVsSAnZWagAAoAcP/iHU8FsYN8mubMTdpDt6\nfxrRevggbx0fqyaIO6RKFUMG0OElSRwCLa+BRO0UDkCrrgwKICl0E5UiBsC+\nN1C5MF+q/zorz+hFxp3GP6f3kNnctfp9yglbfK/77Z0kF3MunkGiW3PyFcOa\nKTnKgFeCt5RndEz/11U/gfCWarHKTKMw1oBJBrhB0sFTCoJnCjndRZW5ByHJ\nEdbNpTgJxdHL3LgDSooTs+4zOIE/PJ5fOrLdR6QhlFbIbjyZy7yEJYxEUGmI\nKX/9YiBdDl1ynknul+TYTOYBtrjFg5y1sRTtjAypjTamj6ioTYbFI6r4pA8j\nUdL+uNXBWaFwceNXBW+EYSnOZEy9Y7yvRG7u88+bJ7hWzA+dGeurBK2E1K9A\nHQHsWrGwDJKzfpEqJaCh1PfIywEqyU1p7fegSlRDesajGtfD2FYGDAN1be+1\nvUXBqs3ZcH+jjuV3XKLvzPx5MTpSeBbiKbtt8JkAyqpZsyXCRTrEyRWdcxQw\n02XTL7B3ieab6XfMMroPMrSnPYiw15ObuOEYZO0SrdL5jASz80Lc/5KvAxEP\nTyd5UN/lbdBnJ1I3KFi4xd7saO1MQYC/PARacNbha99giimE/CGMXOZNeltD\neQoYRVkL7g1bPj0jqOkf+85pticNwhByeo0wJgZt1l6RHTh3u2qByIYwbr8H\nd2C8\r\n=TzfX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/8y8FG0bxM2i99qU/fScK4fmcVrqzlZG1KkMeLLegvQIhALTHzd0DfL+Jlg0x7D4fiMqApR0oRoNXdMk28e3hAnLA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0_1589666232825_0.6308387036871688"},"_hasShrinkwrap":false},"3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.35","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.2","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0","gitHead":"7525a30d71ac85782e23bab0bce0e6a1cb7abb65","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2p5y89XWzAwffY40A0c7FMYT48jNdKdCn5PmDT78c3OmmVXSfJOpnVRxWc94UfPcznDSt1OAwXipfo2heFgH3Q==","shasum":"aff67a298754648cbb6ea6314e51cd7c5b61dbe9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0.tgz","fileCount":33,"unpackedSize":147057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewQSICRA9TVsSAnZWagAAPLkP/1JYjwRL9+jNbvmgq//6\nfWp/Ds0wvGf8uJ28shAnocnuAJcfotc0UFBGRJAqpzWhVWlXqwTMrECh8982\nnrCkyzLwsHtBGZ5jqWhgEamPLbz+mlWEeZj+Tom82QUYtGH6yzcDDsw8d5v7\nmkPgI+rImb27n7/5Zon0UNQAX2JGVFyQDzp0/7Agu0W/mrQ0CzMOu7gJW00o\ny6d/LKLHaHnwjghCSm+J/+b/0eyNvaqu9+KfA/lCLTt7hfFn5RTv2TfarZlY\n2c9bZXyGFdWIvai3ue+PBEwoepmeyn+YQ3iaY7E90B7+yoHYn5TWZc7PeNF4\nng6DWtny+cMum9bGlPYUQ6lZk9BhZt66yU03V1LtJqxvm6Hk8WTatRc3UNlN\nTaaDZY8/b7nR2MtDpYqq82tAVh6NxOriWLS/QRI5wBA3dBS8h1gRg94Kru6g\nv9ag0arFDPjkbM783NELwyq45YQMn1DGUTAKhw3fa885mB4KCUGgtUxiM63J\nHLQQ9Z/iegLAPNDGAGEqugMnXT1DwoRU8jM34Lt44Ogwc9lowp14UTxMQTxn\nBELjhjG2FosJuNegOW7HikN99n2o6zRh9E1VWTST0OVdzkoCqJNXsKvtI+Q+\nNrjeAAptac5lJPLWCPMzkyet9kwbx9giqH4nsberolfoCo7bptgXFNmpGRCO\nG3pv\r\n=sGv0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvivnigscaSCkrky+arF/yMo4b/oO1HrS+tu+wF1/hOAIgA0Pf9YS5oHdCplVWvZUjQNR5ydBvZtnWTi14nxkUoIk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0_1589707911766_0.06637808517152455"},"_hasShrinkwrap":false},"3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0","gitHead":"217d955502511cc2725abf7e4a8e443e85c2b4ab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-0NCXJ4HEGGYM9YAlsD74Mfxa40y3wG/jraQAw98j+TfMOqkOi6kUkGPjTkd+7WdLNiF1A/rgRNWp427C6b3Ojw==","shasum":"5eeaa91d070361ab1349166c650da54b6ff742ed","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0.tgz","fileCount":33,"unpackedSize":147057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtJZCRA9TVsSAnZWagAAte0P/RIsydpBhjUn9hD9ZXLU\nCLH359OzR6ig+gb6W773fZSTRH5edh+dN2oRDK1523xCBw6o8ab/7JDSSeNg\n3OCN4YxTQwAhlFT2p8tuDle2qZIubH506kAweAckzTjqxJD2mab6wP99dc2k\nDn5ovjATsu3Z8S6kqsYDnBSUiGMoReEuk2JG6KUOvNHGtBPhbY8IxfNWU3fU\nBlzI6nMQn9KCmfwrTt8FO22sJUycGHeXRLq0p+Vl6cgSG55pzRYmYW3JTC72\nzbyxXg1HHKkoH3K/9XOVn6TFDwSqxxS+Sd7AksCERCyT77G38TwvFOF2Pf+O\niPgBpQZj4ToyPIqhpRy6UmfvjXOAco+j5jfU9OMdfsA4uV+fRRIWP9PRZhJw\naUcrXrIYPjzMjv0vGpQ3IaBeCwmNOQVFxeWdsfc9hxLi4gYw0QuQlzHgTjOt\n7C6ysUiE3WQyfEYcTcmfD7iLiuYumv+ozS44kiC1FaeGoKYHGEQtnL1yAkxw\n0tcYpKyhjEDiXUh+M/PKKw4wUVCVISHwYsX6uF6RJtVc1D35bDUNw07OmWed\nxVy9XZgLJQVLItSiIVHpUaQP+lroJtFokmfwan0bL3M7evWQjPAZLIMdZXY1\n54DXubQFf7me3JXIwRGEHurJBnFe6TiTKIbiIyjdMO1DNeZ5gIkuY7pUn+2h\ntZhW\r\n=c0bL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIp25I8J7bfxybenbipd6Uv1akLATavzcoR78rm07xQAIga0ocgbIeXN2zZ8jTuoAH4/s1PwI69VaUGvmhnYtvKsI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0_1589826136919_0.9142508213466916"},"_hasShrinkwrap":false},"3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"62fbe12b82739d29ddaf12a122553448bc63a75a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kWSFMDr1F+e7C6pTaaQZdAvsRHyibLbgpn332/9KeTP/xT4m2rtyFTPBKgX4RCpty5CiYGGmMG1AiqeDYhRs+Q==","shasum":"41d6b0513a502794ff1c821b14518d80f52690d5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0.tgz","fileCount":33,"unpackedSize":147057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtLRCRA9TVsSAnZWagAA35AP/AkVTOdDwk6tgGdAAw9c\n2Ad7e9jxzbuZ5u5XjkQd2XRwpSiAlQLHcr/N+kmOCLDFP1OAW8lqcrdOlDjK\nMiEjeLSGKQfLizF7mcVg/LC0uWw96IVLqkdYYH/U0Z6tPMQ3MsEqJdx19tY3\n/Pkb0FJkDf3FN8uhHrCx9YmdOE74mtpww3LyL6RlG15unsGut9l+/uX/8R+B\nUjRA+fuKxCgy7/mNNspi5U4FhOINugoUcI+wpPFSpjoQp0nmzerPgUYw9kFx\nPUgHaWO9fMrkeNY79lnEpDiXK1UF8pKhYOS7nyQFJhiuFuuPNIUSavbxHx9P\nuajmp2EW2zW5g3C/agl8lTnj4/+zgFw3zd2/owz37OWIryOv69w+0VcU8PZs\nRGBbGt0FeeHnARKM9ggk6cXf6OT+1cZ0jaUt86xAaaCFkOlc7fzRjBlnGb6Y\nIbNSeNBrsSfyBCKseGf5zyGEno6cp+J9mxwzl5rtdBuhMaEd6427qbRXFdfe\nyEA8nJPJdhhQjALjArxJBfAQGM7ZiCAslISMgi0Ha1JxoD5i8apnmMoBjX7Z\n2vnFZ6M5bXS1eSM+JxmJZy8qSGIcYjg/kDhSwauqYwQ3RnYc1ynmOoC8y4uY\n8J/KSwTRSUETpMYtXtCOY/7qHanLVUnd+W42ZfEu+9NJCc51+RYX8aAtLKlF\nU0Kh\r\n=t/Nj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb1hlzUBb9zmFF40JnhpYmJ87yRC3KadzIZfUn+pQ2cwIhAPxpiqHkalcSB1ECu9LRowKE2a9RHp48oLDQXFHcCRQx"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0_1589826256910_0.9690777763126792"},"_hasShrinkwrap":false},"3.0.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.6","gitHead":"5b01cf55697d7bb3d9a757204c732d3b5624a511","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.6","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4Ctmp9Vk+J4XDejwiMkSMZC9MAtRgQet8x8NIGi2mWF2UjEvw12/n+p35yTK4l7VKMAFKtWEXj6IXVufz7w6ZQ==","shasum":"871e61fdd80203c2417bdf54614613f0a7d8aa60","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.6.tgz","fileCount":33,"unpackedSize":147293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtLnCRA9TVsSAnZWagAAT7sP/1A+BphgYj5MYTAL5dFh\nGjl9y+gQ91Pe6e2XXiTM1/f5N/3SIK4VgwOA+sL1hf1tkcxVdKeCpXKiZbr+\noy+1BBDMvz/5jIUa4lFpQU84MiNjD92MB/hWcPrhUnf8nd6ugm9teb1JRXrf\n9tgBkBEUt0enMmiLW+OXGlRCZspAkEW8xhjHisVG/qR1gbPGdXmvJnk2oZb9\nb7o+kdXCvptxxXyHFFDEeREc0jdlmRxrRWfLWLmu+r9Y5FFn3ZhH5Nyqv5+5\nav/7ptLYhcqunllwNXyqISMDk2J0EztOmABDJBgYAOujsfxh5AHIP2N6NNl5\nDFmsRkKhMWi7WS6HLpi7xLjd81bV5kutAQ4kjUyqOVECaL3CzN4lI9qu9E2g\niZxyXa/8D0PZwzVHaNoHgsUszvNJNeJkjVnKFyUKG8dNMv7dvjdsbBhh9D8t\nee5s/UyrpkjLbhxO6A0HxroL8tw2awBLEneLiLBaGQOb7eZ8e0GD60mcCdYL\nD8RKURe/8wSlLqWFujHr9Z0ShGUeOYJyn72/pJBdrfV5DLZpIX2KV5O+mwfa\nPkfa2gkNejh++CIoMbqpkDFyvUD86/uZ6dsyqAHLoKgdCA5TVjTENSM5Y2BE\nSRYAyhWEUSKsS4P40I53RTgTYjhNBHsTtzW7ap5ULZZLTjHHEalrgtGsde+0\nRK4M\r\n=Wd4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSlxAnMUQ/QkBwkYLDaInVxAz1ME8IZ8xKb431S4Y7UQIhANfVudhO0q3gjdc/ZlFYMOh2af2m9LDt0wlzwibCj9XW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.6_1589826278511_0.3476304989884973"},"_hasShrinkwrap":false},"3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.14","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5b01cf55697d7bb3d9a757204c732d3b5624a511","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QdZLRRi/Fb5IfEhykwHuKDR/qtwZK3dugjrbgJ/yu5D4EGKuatTO1aXihzicIG01ZHoLmD/fDBDFNPIOGX/KqQ==","shasum":"d22dc49e3bb9360929edc9f55a00fcaccf708395","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0.tgz","fileCount":33,"unpackedSize":147336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtMTCRA9TVsSAnZWagAARYEQAIsQ/xp5nljVyPOUp984\n7e2YiYhm1h7ggWY0qgoTv1l3EEwWNF6oXMdnjwVLgBdwoBhDP40BLiS3WlnQ\nfsg/Xv7TO+5t3AZ8QSeoDrg0xySw0NddlMXv336w4VXUS3etuLBlH/xPnMLb\nhXez7+Oe476ecRvKQ017B0YXdVCxU8ngvqPD7WN5t5UZUe3XwqqYxEcTSjZ8\nav+GOnN1+uAHWWSeHzFZJjcPJGl3X1p7jdLsQF73RqkqE/B82LW75A2RqHwp\n98BqzpHl1A4S/CL4blgxtWXGeIf3sNyxqkAkbYgL7BtcoLVGFGFGUTmTJHTf\nY1iAPWQrPZKg67Ln3N/wE+uaBKGzuROiP6mF8AK3g9UztW99xy/ByRTpXder\nI74cIY71aDXZTOjuYUJNuvgchWUjopZ+1lZCsoCcC0IuXpiF8PSm2zSrUDWH\nm20NXQ9fD8NEMJCOXCb+n0KMV9uwLbOZzRxA+UQ9O/z0lhQr7rv/LfTgnfCd\n7TeL6IiVoQ7drqYvFsebhyOusyuVbwYSyC7rKW3MtLSR8Z5YOYmVm6+q4Kig\n8BnNlkuxB+s/K8kmbC/9vhhQQ3b1YbUXShWvEmNXN2MtlG8A7wU0gwdvlrd6\n/86UhbqpwkFnonfoYXE8FR7lmYNyxzF/y0pxkyJHjtN9XHdttCCm3MfLdlCE\nQV7t\r\n=2TE3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHYuv0Yz9mGt91tcMSpBncUFp84YOQGp5dSj8Oix9kxLAiANsU7mo3vL4JZlnuTa4nvBf5WIJkFiF/vTv7XVmap8gw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0_1589826322421_0.31998567913713494"},"_hasShrinkwrap":false},"3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.35","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0","gitHead":"a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-N3BbxQMvFLzRCb5+xru/okZzZwIPbLDFRqZ53Jj08dt74E1mCnaJlBrrkbBC/hckGKbEqFKqDO95LaJkhvZniQ==","shasum":"987a1c05bd91e5ac374b7d0905c8c891852f5bfa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0.tgz","fileCount":33,"unpackedSize":147336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtNXCRA9TVsSAnZWagAAwhkP/2UxqUk7YBtPu6YpPXlF\nwnBnvtjOYpsell9Vcched1A/AIlZAFTNUuuFgdIJARvPHEqRNWOeHQYkSAu+\nCnU583A5O71PDSKdGUApPi9yrMz21z4kxzUKAyZagyi80gX1nenHwM/rnDgT\nVnt8zr5FqbK16dH3O/UXUPiQLl0VWB4vDb3V/QF8asUaQ8Ny6UDcxIgTnsNc\njMfRJVIKegaZ8/BB1HYA8Ie4cni6US54rtd0dPmy9uARCE5Shsa24oAc3IpI\n0GxXe4uyiSpu8CVE9Y9TeHjWK9afj5rqQEVFRwmVHIPydJHaGj6DZXwDVs8Q\nw13WDOJY4C7uLQtXKjSoF2aewW39RhNluRd6WZjUYdNhWJhw2RXc20a4rQwS\niIv5QN2wEc6wTA0NND3MjufmjDHKYPk9gYFHU9IO91qtnCtmezFvNCzHG0E1\nNL13cZcPSOndq7FRjbUskSD0OJIF7KJ6bmV5chALwRqo02NAh5khrGHZi6sY\n+ErdmeTN3nYnrZekl9vhVp7oT1ZOAxYQGqI7YcHvSmUkFqEoVS9FlEUIpcnP\nRHqIjX3kWNmpPgwKYayTNc/zBsIbwCr8BR+HhNFntBq12SF+lvuRayKvJ0RO\nA0G4+rwIjdKKDKgD5jggK/HBPyvH7PE+9qzY87BuSImmDBkSzJVHpLlnQ8WD\nSjra\r\n=o/bH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBvKh9F0SjYwqs8u647YyQAAS2BUZUzy3BeE6YYCuV1BAiBua7ot0p+MMqwvh8TEnqVQpjMn9p147PiY5F7U7fxwtw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0_1589826391154_0.9093741415355592"},"_hasShrinkwrap":false},"3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.35","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"87987dc4a4d1c661c00425608c979c07ce8c9a55","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wZ53kfNc+BlFTfgLBQC/qptC3G50NCcL2PknrZbLOSiyTfnjVEgGi40HPkZyn8f0YB8AyOrXCAxQ2ALC70d01A==","shasum":"d62c97b8c168224d31df86b011226adefe4d3fce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0.tgz","fileCount":33,"unpackedSize":147336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtOsCRA9TVsSAnZWagAAjQcQAKD6g/33U2UbFQaMBJ+j\nJauA/33ybUdqtw8ofq0BAzWlVZFxU3j5Y74vsKNmUkL04KqSsL76K4EGwOfm\neu/gOTYKCvWic7o251yR+mhilfYUMlv18zd9ITnaQYHpnblBZxcqu61Bkyw9\niHm2IZQdkCG7tuPslm1xPJLO/5nop2QNZqbHKgykRndXiKpkNJ96WWSlOvGO\nPCNRpXs78h0QguXZnZiVQoOvu1cf9T8o/e/scxYL1ZciyHSODo3TcR9SDJKO\nJNXHiFetx5gw7YfrG7qbKmXakXd5y2Kzp/q6seIELikf87kqwOLxyfu1T8YG\nvkeEc49lTzz8s4ioC81xiW1l8wrJr0wukCt9v323Q0AS7uPZKrLZz5v7yGML\nyXxDsyYl2dJv66zLkN4DjnR0R/fjXy85fUyYh2/t1xHqyR5qA9aNG0ffkCJQ\nY00KsoMl/J6smv0j/3A+PB7EJ2EWGV7XufFjZUjPCrIoxeL2Gd/C9PsBvTeI\nuK6enBmtTx78PJjObipGTr1nwSuYZHPC28ym8UZV6MwPTC81h4bIYrpcXgiX\nGfmqBVnJl9b38Y8x988Yjfpo58E4hQGcq51KBtRZgHIZ4ICcQ8cjyXBYMcjg\nI1U/shLfCKKOivG4GjV9PJmEJdXbg4HUD8hnxgcck9ZXW3xN34ejtxk6gjvJ\n/jEv\r\n=ICeE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAnW3yTvjCWltxNjP4q0XuoQv+KFjnANLtRbzXFgTpUtAiBOD+g9VyjNR8OUFvDIqnMS2zLDCaahH97YZ6Jp1bNUNA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0_1589826475308_0.22238993217964054"},"_hasShrinkwrap":false},"3.0.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.35","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.7","gitHead":"dc531815d1d12b8c97f905afd1cc9f2ac6a39019","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.7","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7yjkUvbia5EJiNnYgZ9ScISDRTFan9d9K2hoUJUr5LZNhFq+Zn2rZ75Y2g1JrFbNbmqybM8sWOGf9AmDOnMLgQ==","shasum":"95f046993a617b22b33331db808d92fb6cb020af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.7.tgz","fileCount":33,"unpackedSize":147584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtPJCRA9TVsSAnZWagAAPmkP/1VT1DYOImd45RWIR2i4\nhrQW3o7fFDiK0eUcn9GIHKVSXArs5osQCGdhs0HFy8uZi2n7P6LR90KVscgQ\n/+c5mgDWE1ZL2JB6IcFrXcBMBmXUFOSzhUo0sYhguZ4A7sYpBm1pCsupUJGI\nj0zxlW1gINNqTYLho/bmzm+lR1Mgbwgs5nXJHlXSREZ40vFNfv8CTsKJ/Of/\nq/Yj9IGzgurE0gazxF9MZJoHwFxVIPDC0oIxeVTRYo5/DhXKQMXMIQO3qixR\nSqW2/Cea0uLT8pwDafQl7I8dWbpYRU0/Q9EdZetlmfHMt7JqpxMj9ZZ1ufK/\nm6q/K60w24hw5794MZgTe9ePn5WZyU+NlabrlRlhmikgbV8NEC+4OFANU1B6\nuwZGof30vUWUdVetKB553UTWk/fpo3i166N+z+ScWF71qg4oqjdK+/QEJIAc\noRSUIObbL3Y0DeJ9QkQg5M7UF2BOzWlKx+QYO70/fKF8oPMK2a4OOuAFXbwO\nGb6KrFOENjccGy37Vg9r3q68s+0l5TfKQALuMe9/F8dinLOJdj3x2dDSk6cu\n9kdp13FWO3Fb2M/M0fzEcrONE34+TgCERI06MXMnSO3mh5s8iPbu/e2AUTsn\nMqJmRaaMK1Z6roadxjdKnXeBI0CiInYXUd9JwPTawiQXhweYJUfRLYA3B83Y\njqdS\r\n=Ml2n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/GY9GmqHUtxEY0BgXSGKKOf7y6dZofv9zl1puHh7D7wIgOQgPLQXXmXBuJHVcPmupdL8FjmKw+XpA94Hd4DZB3c4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.7_1589826504565_0.9566970888617239"},"_hasShrinkwrap":false},"3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.35","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dc531815d1d12b8c97f905afd1cc9f2ac6a39019","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-dCYDtWBFcHvmJJIJ00RXYhdHkbitwcOXf9jnr+x+Y6pJ04ABxQM2c3h6FGoD8ClmfltNYomJR53pdyjr3HPquA==","shasum":"87c7c7ef93e2bc81ec044482883a74461bae0357","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0.tgz","fileCount":33,"unpackedSize":147627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtPjCRA9TVsSAnZWagAAdkkP+QEvTViKr9H51K0KuweV\nDg42pCxOBiRwhoUH1XsOoYu5ucGfdc+uf5sRPSkabkt5cm01hKrgAERMuH1c\nrUDjz71qmfC5mlxEG9fXAdQq9S9QNlcudr+uo1WJuvZMG96gt5oGgeRdYAfn\nZUMfQsOV6vtorhnzvNWPVBvTCPxRPimJ8uL8OKUfgsMzKs/KrvAepoey6kW2\niOdgzfNfAH8UWObfboKEP2LP4w392pZESENBq3saTZT9LhzGGlhCHmrbM3R6\n6syHOaR0dGnEWN1DIgaORtIPSHcouNFQCF6OKhZZXYk2jH7h4wq4KX6XBWpM\nfz7OADyOS+Bxmt2FoDu5wLT6iGk+Md31mG2wcN2Jvq3rr/vDzuuWm27r/jFe\njEvvWQdS4fw5ViKVgonj5GIXmYxfYraYjNalQDGDtE+KtJScBLS3jo2z5RWt\nKVLQ7QdA9Hh/xCu1y2m0TzRx1RzkgM63HUngnuQ/ztQ8+yLrocmAclTYZHRG\nFJozY5bbplulmesjUHAfsDC8lwn1yN/oMr2n2YSL7ae4HYYu8cFd95vAmWSD\nTMNz34gMvVa5ZYI4b0C/2uEethGzS22x/FbX/MlcQFimwTBgn1E8JezztKan\nxnJszhB73iRI7NtrvAVLn81tXj8Y95rR3SVK2rlOQ9Qz7XMKt+vXUnylhJho\nibTW\r\n=aPo2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIUVdeQpvhy9CCTM7TbVt+77uQwQgS5Qcyjv3Cdo3p6AiEAsRmvfFrxheuazI9FIFoH/4KeCMAgg7TmQItr1I4hXhY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0_1589826531115_0.8844971469902532"},"_hasShrinkwrap":false},"3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0","gitHead":"f981c2ba793515a6a5ef891ca925eb6c033b32f7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TuDupHvwQU5dxgOBP8YlMjOGmEGZZARXC0AEXHSpKykRO19AqyxA+HMycSzUqGHOpvS68wriqXabTcuGEwx/lg==","shasum":"cf196a0447a58af6702b0592f40b33a6bcb36fa9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0.tgz","fileCount":33,"unpackedSize":147627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewxF1CRA9TVsSAnZWagAAJGsP/28J6Lnq3B9hEG6iKl4X\nh12CD10xzXtA5hSVODgL5twxB79vEimEwVkEWVZDyQbc+LlY8fwajnqVerXM\n+LEov8Jb31PQ3Fw+PfYI90qgr3Ghc2Y+x53Cpf2uawAgKRomh+5SKsKMma5G\no1OyCrj6577gYBX9j8L3cvan1O0y+PBjbPbES/OgaU4d4XYJ15ejTDNVfDAv\nxLRwe1r0YPb9b6TWfNjKsoN/qWNer2kKr4ZK2vGAiWjy8TXdNqcE/w1RS6y/\nc9lCKCzs0/e6QXGFbH0TyGbpz4WDx2njgIM5YPToQs7+1i+X0OAuG1YcNQzX\ndmYOAreAn7kkalrWcoIPiqF3dBKJHSjTWaBnniy3NR3RppT7/qGJ4j2hFlvZ\nsZN4GYMEfwZx7theVeIFrFLJicVPh5kqJf6hg0oCMQi6EQNMjJXgUxLG0qbt\n/Cu2DEgGKffm34Wd3HEGSKMmZN5ZJM0H50QiqbjEW/SGRVpnPG+CqYkJ+TYs\nSOOKKH3b3ujk5lHa3liJ8DfcdPU+aw/7whqLST3+dUdX7aaunAHIfT2DIWUn\nympCtqxSplZy7jR4eeGYZZ1/CQT+keOZZH6vgwWGG9TkGLAFkxokB2fYflxY\ngRFtUjEKqKaCmmn2iIaytaYRh/iDqOdh5U7dUqla+H1esZPeSPYOC1sopXAQ\noBDV\r\n=cTDZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyQCuwge1buNuAs38ekkN9AvPbNjJHPFA1mJmnpdRo5QIhANQH2Y0+bBO/SIwkyA6HZe56HzZJuImkQSZcVsb2vdRV"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0_1589842293273_0.7622318377547894"},"_hasShrinkwrap":false},"3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2fe65981da88adeedb63265e16055190e0b9fd3a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OyT/tNdm8bEelIQfr6lzkf5NmpDER31yS+qcGwRzw3SCL5I6oRTCLcJakOPiNf+4uUmmY/WxTdCg6FmdxMHFaA==","shasum":"cc3c3eed09bffd9fb6f49473132d6818036d940c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0.tgz","fileCount":33,"unpackedSize":147627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewxGuCRA9TVsSAnZWagAAK2MP/3gNKA/NXjXP7BRgsPOB\nUWYb1bO8AfFZZRy7S2NXH3aZQjCOZp54rBoWwUwcUlfPnvNTaJ4b19jLHdeA\ngmHRi92eP1qQ2cxwd/jZcG+XvENt14+xwR6EZk6OHHGnuR+S5yxo6oHsTqj3\nsA/VURXfUwzYTBGe/fW/PgHs0gQvyF/GhEK1RaDzGfg6vC2u4dHMuReBSxTb\nlLcH3v3EsF8EvU+sn1Ba/L5S33gj2nRBb4VyzqQsN8cmXq6MV6zF/zkOfLoL\nmYmAK8GJ4gCnjDgtPP1vDumXy3ecdSb1NJ4ln8wkPddwecXW7IND/AiFyt6D\nUtjSkvBT2vZWLdDquE4yMQww0ib2/rNYIUVCOZzXjNj7ftfWnOYlfGKvZkoX\na3pgYMT26CQ5UabDnu0v4FghegYdL/bBONYnUe637HldHb3F4xWY8pq3EOLC\nMiig9xIN4ZgCfeasAK9QMIMaJem24FV+PSQUIrcC6f7pG9oHSTf8Y5b5jAVt\n/vWeLQagyXfVzvTmpQIe3b1sC15OTy2JgD8mCSiMhjzGJmXHlR6B/uXjGPs2\nY2aOxo/FxRiIQg1ljitPZLSc9PJiRxbmnT8+x7E0BtUCNtlSVwZRW8FhSnwL\n12NjgiTEAd0F87NYJJFe5b9IZPdyKQUrzAhDd8RpLGet4BOAVj/s1Zqx/W2r\npZvf\r\n=8Ro3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFXZNyU3k1N7OpX5warUtzwAI2yaUaeIKbTwTjY9kCRAiBCBGRaaJ5c/TTIaofy8BLPPP0oCV7LNJrFSfExCUTt5Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0_1589842350342_0.30823163666869413"},"_hasShrinkwrap":false},"3.0.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.8","gitHead":"592924bfcd582acdb9bf541752479f60c3474b14","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.8","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6w2gGNr/kFzccWdFTobBcHoc6fxrMSq9+Kwgs/r++4NB6xpnxWPoFV6bVD+hruk9hLhrlR9SPvvKIRjHwzU1oA==","shasum":"848271f5df25802d95e1d9b9eb582af03b59588c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.8.tgz","fileCount":33,"unpackedSize":147875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewxHBCRA9TVsSAnZWagAALNkQAIdWOmLsynCCt/SzPbL/\nGG/YAyRuLtvXPwgtD+JNn4HG89W/p4M6dCSplEAf3tA/4jEWQd+oxTEZxMHa\nlVnv9tuIGgg1pzBUI7z8kicBRsDjZ/jt6tEABsaQpsWl7mz1Ta3TS8D0t9SY\n5WDpBymlDWjfBktLeGNSCsyxRSd732hYuhrPrCGIglNxEfltIKlPW5B/+ucY\nYZSPdoEV7OqoJOT8I3Te0zdqiO/gHw9Vxsy6kxlsICai581l2242ywUnFCZS\nmnyzLAmIEmyBvWfPg+jR7jhtVTJuXtGORDreJxHKLmqFDLOTyCIqv+KFN7qd\nV3lLMk21L2Pfg9uAbDQJIXyH8JZAuZ9xcHtXitIgpTTgUn59EtlCc1/r5ioF\n/WigtFBVON42WrmMGmJ+o008WUG3Pj1u9OrQoQJA5rvmouhpYVFluj0zqhwB\nhgBWSineTOxZKkvUvYKP8Y50ragdNwEVkjKHDzuNIjQslCk4PwormI3NhRXg\nqL8JxmO7iDrQ1buk9M673NPwxjIH3DehBHpe+KiT3ZTDAZ0okunTXatPWa/E\nIEV35FuluJAnb15+GVNZrXGtK3oR1ASZVMpxw8acNU2Di34wQzDmgh9LjIXa\niGndsiwsBKjVwGmCZTSWN9C++dy9ir9RBzPu3OcMafwVCjLzQ5yx5RUY5561\nVbz0\r\n=N1uv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/LOspCrX34q/5FX6Etjky1HkkLZHIJbSnOC6DnqgX8AiAlDtjxkRUsaGshD5ZxxmdOgbmMLRQV+1ztWgE0Wi6laQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.8_1589842368665_0.8106380245875744"},"_hasShrinkwrap":false},"3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.2","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"592924bfcd582acdb9bf541752479f60c3474b14","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jJDAj0M43LOr/jS5wDL1zcphYn3oUmFRYztlMlbi/cvRjHVTlCJ9iQRBt5gkE6FiW5SkBinspXqcEU8sDRezig==","shasum":"6c6f3689e41330c6fd8b7482eece45bfa0e21b62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0.tgz","fileCount":33,"unpackedSize":147918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewxHnCRA9TVsSAnZWagAAfsAP/2y65HOSWFGRYr2ykP7Y\n3p1wQOPfC+PJZGB3rkXZWqpQIOXttg3iIDhp+DGmgPuVH8eJiuruD7QBhKcT\n6pmsS+Vx7CzBCsGNGmV82a+4Ka+LWT1WGq96TGxn13fxZIyKZObw3yCTgEgr\n04sMYLLvJ5AoiEEiMo4zI7UpoUIs5IbUpDF9eViUrfJAvFWs0yZq5uw+r6mo\nczsE+WxaAxTPONVhDXzNJJ9VO8ge9PgkVF92cOp/KHgWZynzNaEdE35xQ11I\nO4l0I8B09lp9NzAs4nVHfjvBdmssjQVVka2zWtHgOagTJr3Y+PqGKMf6QIyn\npWZO/lPn7lThO2V1PSgqBGij9z0YQh/9MgQKkG/oLIXrJKQVLzu4ofI2tesn\nVksQp6532+SDmMMfo89NjJiZlmBTlyWYfBidkg9ZPt77xMd9uvKtU2YZ0nII\n1kBW/9PrU4kUmuEglthIzwAs3Xfla4cyaUWKNrQoQgbCV5DA4pXMH2Q7yzj7\nht4bl9Wg7mv5w/TjUfTqY6X/d2vD0MsVk8M7XzJ5G150tgNLAfTe6ZeyKXEq\nnepyQw/SSaPQpRdjUfKUZCihqHVErWgonhLbsg5MRzV5zT7l/muDzgIHh7ev\nKIRO2otuKoKLc5ZTUkfiyFmWpgt0LkOUQzLfuWqSJElMwADD5NhUuHo9seeG\naq9c\r\n=ebdG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP8IYMHkRTznfmGB/KDrIVD8Wy0JOFhZNS1NmRYR1wPgIhAJ2elBn83xd+L3pNuV8u81CZC8VzkqNN53nEFAB2WK0u"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0_1589842406605_0.5873768750666006"},"_hasShrinkwrap":false},"3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0","gitHead":"f9d4ba313ebbb7feed1fb141aa745a3c6db954c4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+G5WIg3CB44qByrcdbi41mgCVjzKgRVN38sFU3uqBsP1F/inQCtgMyahz4/dAO3hlQm5q7RMVc85mWRIG6Go3w==","shasum":"c7d6dd083d9ac1fe1b7369bbe0ec3f39530c21bc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0.tgz","fileCount":33,"unpackedSize":147918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewyOGCRA9TVsSAnZWagAAccgP/j8p88M2jO6WysOiBK+r\nkku8x2GDCapthZoeDZLLleINC3jKd6yCk7J418lhrJJXR2U8jbFxgHTC1syu\nCdCPT0iJJS+TH/1IQoHZyJl2Dal6XmG5LO5Q4E7Z1LAZMC0oJBCctYi6neIJ\nUPNYwbFiLKzhKWl8P7qhbQS7zFQIQeHP/Eobc0rcUDgpxGMqE0JAzL3o52/7\nJ/PA0F3vsjF0Mmfhx/J/VIHPq5Ra3g+eFHbE0Qa9iF/WZCpi0oERhk9/uWax\n1eeJw9GAfLtwKkvNADlS4tGTtdow6NQGfniLCQrxzr0BYOc4eOnAxorcaQMw\nJzXqu9J5DW57E8EAW0AeWhCTwJVjhTTfPkKGzr7q0Jn9Q1RvxXq5rNegfZ0q\nqMr5BPqm0MSEOLAHXSpC6IT/WOV33X3l3tBmKjXEpRYTJXzFaZN0NlS9Y2jS\n0WrUu9YG8YikVjjR8q5jKD2SEcvYDNkl/FxSfcBg7mh8tV2dJ4jQcbDUri6W\nHWq1koY/T27KFWLFtW3t8+izzFrKmrb36bS6/t4PQhT4R71Fc5NoxM3FNaL6\n+zOOWOTS+D0FthkkpVbFiLGlyspkAr1XsmUq4kbXCs5l7F2vw29qrhTUm025\nTaM8/yt4Y8t4s8CzX6B4apgdI9yfO6H1rWyV2OWyRDwpqx36AK6gv6VoDEVZ\nSgoj\r\n=6/e/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA8PvMNKxjvD1SBhmXrw8lAIq8ZTRB3bX4du4HlSfv2ZAiBJ46Vfnkqc061hqxKL9NHtoz8yC7xTZBShSjU22Ax+RQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0_1589846915477_0.863523079022833"},"_hasShrinkwrap":false},"3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bfc1310687339547afc4324c41f9cb2fd3dad9f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MedVQThEf8KKuvCNCSLRvtODaFUxHJPlKLXGtEAjdzBBUYxqlq+09AWU7RDtRlIAXmU6E91oVYgkgtgmCgFzSQ==","shasum":"36a78c0c0c7f35b1af67b4156d52f2abbe88044b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0.tgz","fileCount":33,"unpackedSize":147918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewyPOCRA9TVsSAnZWagAA/n4P/R4ZimA5mjRKjQhDt3EI\nGac7jWXWGAc7GF+pV9KXqKADx+PRUpNmAfXq1zI6RZwxNlKe6bSDLHVrKt2x\nEEqFw36xcKMffbm4rLfLYtdbwJRwSf4/rTq8754BXECzg3EnKxEGEq8BGJpI\nQWGfrF7w4Y0dv3LAqWGh6hyqFzi/Xe2rRKC7Wo8cPbmHiPQawHn1L4Gw9OJ+\nMtm9HQG7I7vTM2eH1XiHlKMIDD8TS3mgBAjCUkqKBZQjZu8aG++vXALLOSm6\nfoVJKuqRK24Y+Lie9Bt8LLid7QLF74EIt5sH1rAcd2mZgDpXgtnTPtY9OXd9\n/CMJpdU2RBcp/FXU/4NX/HNH9tkXaeAirjWELfVbULS16tvliOEPc/1I+QiD\nSYDM2pw8uFe6wE47L9saLqF2IMNr2JTu2jS1okfVlkcU5q7ox4elI52F+gpE\noetBFj5a+MwkpUx1EdBxOq2iZ2XtqmrcwB54pcGqp0N/I/m+h0yMSXDaGZoI\nlXRmaMhV9VmsHCNZS1aPNMjC4Fteddye/eJsRwG1A005y0gAUPGskVRdb7Kd\nZiGsbh29vogj4x0xHXq7h1ggcQwEHS4u2o61NMbFyb0G+pO0fZNtaN1P5mWU\ndeikE8abvd+54gv7HL7g4LRn0MzRl4k1Y5ZmHpzqECJ8f628Gw/MVGDeEUJ/\nQbi1\r\n=jCye\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfkeAxXggA7MJJNQ0UmSnBLQBHTLffyiXgf1DaHzrOqAiEA+fQ9jIa0MFTkZWhYFiUmdTFMk8eYHNnvdoOVY1sF1/k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0_1589846990014_0.8304520639674426"},"_hasShrinkwrap":false},"3.0.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.9","gitHead":"936e5e80672b855810bc598d47c207a9db1d3968","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.9","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-U31avMrjQh38xiNF3I6ECJLfQ+VViBR6IxIuhAj2HuTktamO9INR7AL9CMj3CYk133L2gS33ywWlh4R/FT+U0Q==","shasum":"57091038b39330d785c50783f80282d3eaf8b668","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.9.tgz","fileCount":33,"unpackedSize":148154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewyPvCRA9TVsSAnZWagAAHEIP/RkB0g6IEhM9dp2o/UOE\nq1LFzB/ddkw1EYnQfAtrmmRE6cmyCFxpCzNskK/SFLFqifRs5DTnJ4qDN3ec\nLfbxLov8HgsH0Z6JL4OoPDURcwchgL/rlGmCGxoqcjrfjEa+9mKhvWzX+jrN\nw4EF3kkKCryP3jyD/ex3Dxk9fW5lDz9o7hng8/BJlKQJtKu43FGGyIwl8iq8\nmNMfHXviLx+rSGaQ7bPMD7zJNBMtBTUuZjelr1qIBqkFKL4+eRligkylBtw2\nj5PQKoLAYufnNBFKoERB5EvJfwY/KHDaeQfa1bSfQt8534NmC/SCiDeMPoOG\n9zxarOAghMAUyd/Qf78Qd1OO82gilfQ6kxQKnNJjpTxdyuNiPjaCWz5zfbn6\nQ5tgrjObG1WCteayUta7PKqQ2czXqmP36bHSTRUAKVggyGQ7GOU65f/iql6S\nTJgTllzA0GJohGa92lorX+LLfK0n4OY7+AHs0m3o/DC+EXs2rc8/RqpY6HiN\nrzknoFg7l/ov7FynoHwEWJAgumvRay9Jj3ielFzrFR4fnsGs1m8Qn3quvO2O\nEbpQbqp45zm8sOrKcaPF4F9l8O+1WQ6yv0TZtNFV5ieCZaRQ360K8BB2s7Q2\n332LBKN0lme78Op2iSl9Zv3CQ+42YLq1FI5kO7Gk+WoEwLg5SehukYhIQcaM\nnLz8\r\n=TCPM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7TBXJmcoc3/15Wg/DRbr0nzWC91apr9NX2v7QiEsGigIgeLi4/Ya73M22kWH48pLCiyuZn2dMccbyGzze5HogL5I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.9_1589847022911_0.33876980352011765"},"_hasShrinkwrap":false},"3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.37","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"936e5e80672b855810bc598d47c207a9db1d3968","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-C9HlKFXAI2VYe/P6B7tRRmgtXyNTV536tf+FNzh/3Eqh0vtvU47GXwoFYRY0eriiOtafLLoC969t2GxjjjNznQ==","shasum":"9236cbcebbadf0c1d924d1911d7fb7bb713d80b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0.tgz","fileCount":33,"unpackedSize":148198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewyQkCRA9TVsSAnZWagAAIPwP/0Yr4xA3vFWu8c0QtNqL\nem5EQ/zLxiX2Bb49RwKLnWvTzb3GQ9Uo4AYyAUxLwsXflUqti/KQb8nc1XoP\nm8ewCOAWoEFkYneavpnPFOR7DHPulc9xlOMQ5Gh2za90UoCgfEsDHdWh6PLA\nIF185w3ZmPimgQMreXkajANszCIDafOhfOJU4gzGS0f6DVrRnDMRfsErtHYw\nQ9M39nKVef+boYD8UF8JQG0s2atf2fce/Z26afdshHKeQUB4KpxTcSYPWW1+\ndE8sCPe8LXoafLINLFeRvCUWf+2Jo+Z1KZlS+oFTVHDIHq1ohSScGJ2uFtfE\nickfJt41IT45GiFY5XaHMFT7wyJnrPtuid3093qCn/tn47vH2hcDKWgBTGx4\nP3WPCOTrFPz1Vq3f8nCq3Zqs8K4ck901PqP1alvikr45/7Sl8xnY3mv0M1gF\ng5+upgYEF0lyDKgIfE3FdHbVp/NDXQiKPde75rPFUq8egg02mlfRvaoXo+4G\nJHFCPsSe58I9gRQ8rmLDXTsYOhmtd+Sru//99mVkqRrOsdiLOgHJu7qHK6Hn\n/vY3Z2nR7smMRrD+pV4pX6hWziS2+/7YGgbn1ast/WSVrbLKUm13d9NJVIhN\ntjO4QC9NuBWmUeaYLgjxCXRIENVWygclWlf8/BhQmPWjxzzv8TUZ0YOhcOxD\nWyA8\r\n=6Gfa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5MSberCfZfszLb44Y49oE3VNMpzOFPfFBwpzE/k8RjAiEAp4JR9qBrMtK+ZfkoVVEpJV7hJI5YVivmcJE/S43wk/Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0_1589847076160_0.4020401995114651"},"_hasShrinkwrap":false},"3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0","gitHead":"bc6669ce34f5736610e9a9013379c20758dd5b5f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Klk99/n0jyTE1/p2cpG+ohOqvWGIp0SKNx7c7Lq9Mh/M1eaBt8Xgj85Y8Nma9vVCkOYlbYedqWA+rjCFPyujpA==","shasum":"95704837a7296aeebde4b7d29432de766ee9a1f7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0.tgz","fileCount":33,"unpackedSize":148198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewzuACRA9TVsSAnZWagAARUEP/iPMAvy0feMrCejjYMsm\nGAI91OQHwTDGIKV2y8Job5S2f8qxM8neIQtwNYGdWf0OQ+TrrdsnQYzLEBuF\nVkj5fyU5NhCojmFQ8jnW/moZY9s9eYP+nUNwO4z/kcsEVNtLQq7uoOJZQ8FA\nji55CLJYVdwjKPFWEJgJv161aChwVzBVj1qd+KkhosKeJuqNX153O+WE2vBh\nor+aqbMdAPo2WlnxM3vVdS29xuxgwk6nnVIvOuy8/uWDeLz4G8EHz0YmDHKu\nVSLgThB0blgx/EjuSa56G8wojjOlqqayXNqL/TUMMkNmZZue7kDnhrdncU+8\nTDyPjy2v/2zmNpLrd0o9T8J4u4V5jVm4BpuAIlIU/az0/gOzQa7OZ0yTh8Tw\n3ppJrsPcXdXeV8X3/IiRG6AsyCthmQklu1v1EEHJLghrb7PKZ4lqZtQG8JCj\nIpSKd0aKSS1aAL8uz5z05RH7evcedHqobug2gpXq04nHZM25OjNBCLc7Ms1S\n2KsFXHk6PIX40zINrXO0XCiq1tqAuKiogPS3QS6Zgqbv4gilSr7i6QEFf8Lb\n7Upv3VPM36O6hw7gSRNDtlRSFIuW0ShYpgLdckXriwD3ef5QB2/Qd00H5Z0j\n8ZbNuzw9C85/6hz0z1kaPPz4HmHlqE7ZpoT3VgmltVn96fNE200F+P8nuG4/\nLpGj\r\n=6f9g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJ6PuJeL0Qn6f9YsD+TNvBZdl6fhKQTiTrJvW/dCQ7yAiEAsHe9Rirn/QR/b5vucO83JHLyKvdL3tuL7WwVnfx47lA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0_1589853055575_0.02859356921925804"},"_hasShrinkwrap":false},"3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3078f4b9e68559a64f46cc5651683b9783848dae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PenbYMYLASOC2bLByyd79Ss7I7g/WDHigkH2kBfxUpS0W4AlZO5K8i+1JvARt30Lz2/rKD7NtpcLu546iflTLQ==","shasum":"6ca293fa14000448390bf45d42856c354dc75b3a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0.tgz","fileCount":33,"unpackedSize":148198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewzvSCRA9TVsSAnZWagAAGmIP/1LaykTrZCcPhhwOxXjR\nGEqB/aHfRbZx2ucB36FpKZmPUS2DKtWzAd68YCbpVVdJLNYHoRunlEGzIWIv\na8BDPu8Y8LDKmqMxMsm4RKEzYbGk5R4+VWSrPyHo7zpvRYIGNfppvb+rUu+N\nXu62+cefMrbP2Ok/idIvtHk+iYn7jeSggqAahaH6irxj1my7QtnBrAlnxVfA\nNT7e2KYHzxn+54kpp/OF5vqtBS153Zvt1PWVg4AOLXWFITaOzUvd65NoFrLc\nXXB3aUd1CWol36WbT7ZDUfx24b10fCuXksVMlgFtkUxNNGEHuB2TEBRjghNa\nVNhzdq5JWjMdK1+alTayQGNidDCeDJMEdtKTUOLPCom6pqNd3jlNbZMTKSMg\nbfTsWev7CtwqhyNLksj5yx5wSo3q2xPjPoVg6myPuJzwhB26gzjkNfVuYN2d\nUXmEAy7w2H+1PDWSi0pWuyNNJXOjrV2zKjDsdsHlKjnlovl3yIXA0uFrrDya\n+aI/wn1BhnjNnZR7EspXhFfhunWGURSAqKTJbAnT46e6preT4hS79ZWBcFxU\nUStLrlN+6eoKij9LPUR+9EsikJc/LMZRnlmJxuAO3YL3GwFjXdI4Q9QpyaQn\nD43S3rzJsaU+QJp1pLP7EH64u/KNB+Ub7Wt9W4YARXv9tb1bsxDWhWHJMLoz\ndHmQ\r\n=B8ew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMQo1O1ZHUjkB4j4Df+43T3L0WjS+S0WkkmGcQQON95AiASWsQFacIyLWOoQBnDGRnV1xJ1ZyxLz9xF5hkNLy1FKA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0_1589853138325_0.9416843635505103"},"_hasShrinkwrap":false},"3.0.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.10","gitHead":"263c4635353f78770c768fa8e766578baaa2805d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.10","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tR0rA13Ud2QhIq632w3ihiitWa30Ae6YKRjLOOQGb5wrh8RrN/2MN81MyUp0bzVx5b86fVMQ1KmBy/SZfz0bdw==","shasum":"0a64b09bb487c700ceecacdeebafddba7838c29b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.10.tgz","fileCount":33,"unpackedSize":148448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewzwiCRA9TVsSAnZWagAAwHgP/0gD/1O3GG9kcdS8+tdQ\nEr4RL8Q6BBxbtNvsl0kHL8c1BVvxs9SD7i9zL07ebMZNczmm3yPU+wVAGhse\nFFEZcF5gkr+fV5WluNaHd/U4fg7lX49hHFgh4YLC8f9VRea4QwaRopbku0xS\nHJ2jPdwWCg5el9VpVZNuUwKgQpz6Mdm4QV9ybAmrBgjh95EvIx4oxjlfbkBE\n+M4CrVq096GE7q24l1BYS7HycylWJWIDMG4kBOaERXgNmIeayQy3k7cBDtaX\nVCOsy7K54LlR3AWRWrZKzlYNzq0QjdQC0D6xuvDhEvo7OYifGkIjXp/Z+Sfl\nJ2T5XK+m3llDX1sVQ2l9CeZEDdR/dbyVujKq22FJ9iK1v1pRT/svK5RrP0Ez\nSea3bqGEN7eSpBxItM4+PJTvZMIywAFNZXni13ZlOkHPNMrF57wGgU003sdc\n8G92NNQBh8zBlDk1fWi7juP+a0V3xfYCfdQ/vGMCHoQCBbIg9ioaFbpV3LzN\nssOPOrkkzAxPf4qHifdPgDN5DGUp6L7esUnj+GDEB3T/wzdx2rZ3uWaDsyu5\nc7fap+qToC9kaRr4TkPMmXahu/ZViaTxLQQ1rlHEoSKlfgoMUyKWrLVf5ysE\nE85NLVkpipFwIWc/G1FhApeYhgJgybz0pckFn+8Bl2nHNIuYK4kYPNEQXwL/\n44/Y\r\n=Zms3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnMoVlGnNmjBnou9fWhKvX+scBzW8V/u2qrIhrwakW1wIgNJ26xMNA4PZNID3fXKbyNsAmmAOu8bi9bYyOyQEiDMc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.10_1589853217690_0.33515244058626537"},"_hasShrinkwrap":false},"3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.1","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"263c4635353f78770c768fa8e766578baaa2805d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bXm9MZQcEJt2Ru9gnBY5+nuiJUlbQSPuSRKQcI0Tvtp5IDms4zj5k0UD0kbH87KITCpLeFQkgU88e0+HwZ2XsQ==","shasum":"682bf21ff4f811960031e1a3d30e82b3fe607e76","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0.tgz","fileCount":33,"unpackedSize":148491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewzxNCRA9TVsSAnZWagAAa3wQAJ2bjuLqUA1MU6lhoDCz\ntRw7+EmynVwNneEft5lZR2Yk//r5N+DU183zrab7eDN1BsQ/1hWvFB3vdwzQ\npkOgvPsakJKGxxRXnJafSe+N+g6mEsFVW2nHna8Hsq+XTKl85cfAF85qG9Lw\n7Twd57/PLNgBSZ7/HgMguGwtcMnl43lnTXwoufwpkv6tskFHYvRRxKTKnBwr\nKl/vVxLfSXW4/zjkhOZv78I7pVa2q0nrS+iF6HBIdw8exXsq0uh4Hj79dPzn\nx8/b20w16HEmM7cOiX1lOATfrAmAgUgR0CUIToCYKzYhzOyvPClaSOzeJtgc\n3N9z9aeCfzUwSwXQEd84VqdwLwZ42kZxxxxJaMXsMk7woyL03q91m0hE6Pe8\ny4tshXXOxxXJk/Am32c6ursyR5GhScJ3pH5PwWv1CJolFp/Ap/KWDjfmAhd3\nzJFxVphTPHia2gnZnQryBBH+Rdtfwzj782WiVp3VRxJQOKqR8UFXRf35BxIb\nHMkqWNuN+YjaHLkoq1yqdNfzddNXoyJ4PxgjasWcqKnlzojH/Cxxf3tr3J6Y\n3hDUYxQgbt+O80F9cDfH9mACuJ54JVcQn2U/M75ZKQuxR/l/h16D55CMDtGU\nTU/t/rxSU+Nrady8FQ8e3AJ8JV58QqNbS4zbjX86OVgEzuBZqnVr2DRAmCAL\nbcyf\r\n=CHv1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8llx2IK74lKUHDnVqQg7fp6QYh9WH0Bn1+D2mP7PXKwIgd23rtvbFzWDRNP9IhxghUsgXQwewyAwlr6yBxc2qpbA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0_1589853260535_0.4686985175301128"},"_hasShrinkwrap":false},"3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0","gitHead":"de92bac5bdfddf3ac79c627d795b47325d390156","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nKLV1Vk3QTscFO0SVd0yKgbHbwIhJ0rIhDnDP8ffy7YFg79ws2FGxLLfWk/KU7f5aHTkIG4iy2SBoRzVqt+XJg==","shasum":"e87e93d9b9da4428c2b1f633758d11aab06004f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0.tgz","fileCount":33,"unpackedSize":148491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDegCRA9TVsSAnZWagAApdcQAJogjRhPZIMa0Jxx7aSd\nKMPD4nNF5xn1G5WHAhA6Et0MVuXrOvkaKYaK4IW7NdtUG5odXHVn1wFUgY//\n9h0NmCgTU5SO++SD5vv+QbD9/NgJ3kf7rdrln87J/L0aBc6Nc4wg/xZpIuaP\n/EAtOnzP4C6HVEp/FgJodJ2KzvJh069A/a8ufrxp04WcXMizqt4wGbLTZjj8\nHw2NYf+6nBN3bPZ/5wYqleSE6dWTl1M4obBRwNoAuCwLImXtNN/6dNeC8J+p\nrV4BU0jHcGoepZ9g+jyjUShSSlD9zDtPHTqrR1qWFVyElqXy9bpC0qUM+JlL\n5xd/ozRYmU3B4r0uvTLfB9B84U29Vr2l867DypcnQc0GLkd74d04kYh56jIm\n7R2cgEvQz/ZHQSsIUYYkXHbChK19zWykxUCore7A8ZaS14cqwv7/LJcEmkP1\n4CGi3XWPyXy3k9DuBCKCfR4juqxlJWkXun0+yLDLFnfl4ClQbtbzSuSN4rfZ\nCCNaue+GzPbbWXgHnMi9D9z+OTGM/qbrehSSsfiA/ynfzWzHAULH7z55zEWA\nYG7xi4I/APFuX2qCL4IHJ4sOhpWL9uLmXVZHm3gxseouUGC/bK3r5Jmg5Sqs\nt6HT9FMxLCVc9viSTxPDuzAJs+xbubRuoaeRpNBtxDqMhjbC1OY1GREbcN/D\nJil+\r\n=2z6c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLsy8Bo33ULnOYs/lpEs/NK6nZ0V8gEhFzyWWSoc0sxAiAEQQ9cYLiBdvcECBAnRPzV7R6vNFXU6LM4yhMBzAuwYA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0_1589917599925_0.0441973131965685"},"_hasShrinkwrap":false},"3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"de3fb65e0157647752d98397ab67e420da68b597","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c3XSG4M0/xD+qM55Xif7tKAyaI+xlDxL6H8fdQkMf1EyUlzn7DQ/IGaiOa9v0FBFb/klksGmTb8n+UMAOhz1Rg==","shasum":"159b9ba8e7b8293f41a5b71d3316ad78c8287188","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0.tgz","fileCount":33,"unpackedSize":148491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDf3CRA9TVsSAnZWagAAztYP/A+LwL2Q21oxchPpignY\n0dSrZNM+4hDofMSgZFjJjwlsD/IJrRk+bfoaHKPtOEKDYJvGxEuKcBvPHvKU\nRA65r3QaUM8AomY7riMOjCfriYl1HZ2BTI4IecufqfYUetbsSMkJwnBql7AN\nioh3jA24vUAbw4WCW5/jkW43X2B+8YU/hrZU1++/GnmopHuBsKM9v7osgA+B\nfXXvQgTZC73Izqafhz8g7DiKNxKhY/KgyFKinuoDzMsB7kzZZxQJKI215/n9\nGRYGdowcy97rBmBnW7mNmMopnsPYHt1wgkYE8KnNcbL2EluqzqeyKMG1NmMj\nxaXw7CX/oeRO+DkGhYLutNPTh08LNh8Vyocswibiog7TxZDmT6qmj95xNPbZ\nhKnpE6ISDgKMDIl2lcMxEXn4sJ7UB1LtuRJ6cS6I6M8utyhJ5c03tuC9pHCd\nkwkuqj65WM/zioGtq+gSb52IPWtlLUSc3QiNXqNSe7mgLHQvUCDoJEQIzRak\n6OabUYc3pJmYeGLq38BrvQHpfl+m1FH6pTzDbPWEkNOGTZxuNugEdnGDzCgS\nZpsN6IOLbqe1E40GjIuDfCTG2445UBWVxVmoHI2jvB6eRPtAdDd1cupWjJj4\nwFzXi968ml2pmuw03gZII47ObELUPd9F4XQAa4CzWsgfEKhYXO73QPj5bmzx\ntFjS\r\n=Is9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfSkmKt3djyAtgWgWbfvmD+ru03e/l+MfvZ76F2cKKngIgNVYc/w/hlAHqcpgR4habM/C9LfirqT0xf7yv5ikK14g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0_1589917686873_0.44928365006339144"},"_hasShrinkwrap":false},"3.0.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.11","gitHead":"4a299a8091e14af01be52f5af6acc21ed5ae15fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.11","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ihUUr8r/f7feK2sFEGjjmWovQpNkoKIR8pjzQeSL+mPvEgNHJJAL0rclGOXbhJY4W1z/JXRH9DwUIxI+oBHvQQ==","shasum":"5ef276cce3fbadb834c4e020fae1eceafb47628c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.11.tgz","fileCount":33,"unpackedSize":148730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDgMCRA9TVsSAnZWagAAHd4P/1exFbRttNsZ2QZYz88C\nqK0IN2Nt2Gr2+8Ea3M5pSEGy1wOVDXQ7/N0k20DLD+YihiqoD1xpPV6bxqBf\nUJt0bdryA6XqcRJxkxIekNWMn3Of8cox49QWftWupF8BZUwlWzU5nOJ+vi6Z\n8SVyuks2d/H5S++aprJnfpcRvYVTXLr/Thirmf5F9OnaVndK1QJIvfq5jTEG\ntp08l0Z90dLghHg5uP49ZXeRuadKZ91Lu4aI5fr5kA6C19P/U0U8yDz1zMG7\naH54HVlVSt5K+6uPkwrKeCW9l1/LBnLErU57xpY56agS26m6dh1CpvuraQJK\nqbHwU+o7ZbRywq0et1ucSAbaVCU+2xTv5yF2P1eBCNoWHyANDZgw79aAlad2\n2RXnL9QH9ZxVxMcOQ58D/gn92W9kmhjr5dhNkv0VoIkwSKsSR6YeRDK7243A\nSg68AG3bOa3lwHfm+hVUOt1worbCEZbZcVp6UyvhmXQFXiZbZq2i26B1nCv+\nuYf57Gzbx+Re1LSAU6tCuJ2KKc6z2ki4U9SBfJicQu/3ZYepTtN6j7+Dui5b\nf8e6lJI3WR4ECrXzGpD9+6OLKbqY0cKo0vHEB/WUaUjcC1/kAizE3CwqAzVL\nLl15UId5fz+/P1pHFShVZVxrBcHc5z1LYKI29KkBUKhrMbr2QaKRJlwQSLkW\nxPAI\r\n=KXty\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm/c5qR61JpXsw0tV8xRbXeeK8AySd7qDV+9BjBvD4LwIhAIfBteQUuokySyR4zec+kSnfgfK4OyZab19Cx5vhEUtW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.11_1589917707895_0.906062576911451"},"_hasShrinkwrap":false},"3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.5","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4a299a8091e14af01be52f5af6acc21ed5ae15fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-StBksDgniEmKRSbrk2yfbw2EqHQG7gtf/9UWp7B27DRJUKe5KqUUU0wWaW9mbZ20KYNcCl6bAmdmPU7A3MiOCg==","shasum":"b25bbb3bfb7583a5d9ce0f715ec5f590e18ca0f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0.tgz","fileCount":33,"unpackedSize":148773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDg2CRA9TVsSAnZWagAA4akQAI2y3H6QQq2aFpqiAZS3\nDfzshA2gUjoleu7jyA2YuNF046pWmJKRLMkSmJsGuzbiczsWVv9F4f3YFSm5\nccHDHec6obdipL8SdZcgMUKodGLUnQLFzQNFXaQPoB++TRnMSUy/+6oN/6Ik\n2DGV7WlZMnv7YEWdB9GOpE1lqgW5n1+W9B4snmr9jFy8pfQISpm54aZwhYyq\nDUwAO5RL6yA6pCTMfltfY1IJYr+D4VHNXHRtvT4Xr0/E73UVxm72yltvgjeH\n9rU7NSF/vk5Hs8IvlbM9tP0UHlUZr8YC+owYvE4svNi1wFa2De8C6rfGvscD\nV5Hrwn7SdPUvzpCaadtdn9byShkpoWehR9VEKKc3K3F6CTY+mlygM4yEjOO0\nApb6AZWvJOnydPMbWZARM7fOz/fJi9ms+xAgpGXujjP5crZwUwh+6ipAvEgT\ndGBy8DurrFb16KpHbTuPK9TPgd1vSHiSeovQWgrJXLKpMIRR2IQe2ZIowZUR\n1vw2ltIC8nOmI9GnROauIRnJ00g2b6J9KeGPxntVwgIpCZDKoXDp74Vjh5KZ\nUcYarRt/hf3Nw7TxYgOggaTO8/4OzqYxX3E5L+7BQfG+CgQKTRk52AKHaOsk\nVr8NOv2DmU5gjZjsowGmna3AadkWO6TPjtXGG9vlA8TrSo0qB25oZEbh53dz\nteP2\r\n=Fc2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGwaw1rCNkrYo3n3WBwhqV87V1gYkTuPjIsommr+W9ieAiAktR7P9nmY+U3HhUsw6VdNdHtNZ2Fn1Hpp+JMUDTOusQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0_1589917750407_0.3443400121809881"},"_hasShrinkwrap":false},"3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0","gitHead":"057e701d4b053695af852661a42daca111eaa2ce","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-K9KtG7RvAqDgm+uOgiCyaJjxARhBQ0fF5WELlg4ukLo8nKV31IiXmSN08pCftYx+K/qoB1vbPPybxFrRohZyPw==","shasum":"7e78b62d80784cae73e93124cafe3342258ae8ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0.tgz","fileCount":33,"unpackedSize":148773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexEZCCRA9TVsSAnZWagAAsh0P/2/xjZRtkIzh797wNEGA\nwDFGWCwtMqQ8oBxbXWhtHJ0epS5/jIF0Yis1KqwNbi4XmeEuILSNWtHzKSPw\niwiA4hWzA1ok2a12r05rLSB2SM68ndL6CMUTBM2C0+bBI05jh3KiTt5l8dsv\nmEQHZc2+s967/xsbnYOdCBCNrVkuaD+9LuuIOATOx6umEz7EkQYiqtHjDCEE\nPPT6REp1gUmlmfs4bPQgTYDUoO8P1WnF4NXXznquHfktGYK77J1yAs7cXYf/\nXl0zzKPtzT6EK1mogX/xWt11ojAstL3zpQeoGgR84/docwK8pdeGlsHPCCEz\nVXJXIQXdA5eV5Z2i7s0+AzGF6dhAQXAXGZXLPCmMB3wzoEwQexCgqGqEB/x8\nknquJOUjvAPFxZfOZtxNUqStzQDMnqTWGiSUiiVa34OQkW3wi1PFRTV9vnIl\ncag8kqkoJfs+f/k6pGGTU48A04mpcWTonj/6TcUIVcPQpQcTyWvqYAKHh3An\nfkX24tO8PFvEJwXZNH/LOAymPXItFrWunvnjkz+oYDFt42u/PGp2a4ZuKXmM\nJD+MkTIeIEF1cIB3jWBn+v2uNhFq6MrqFJNgZwEjgiwIny2MuP60JOZI/Rxv\nhZ3hEjSvUDPXJq2U1YqQF4MyVyiobxBaw4/GsKqVPDEjxi+0R4QTj20sGYuq\nULZJ\r\n=EWV0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFJMJkuVUW9BU+JGOf4ObmjjHrbcSAjgZbG/uC8kYL6AiEAsY8LLNIOvRpNJjcRku1/CkuQfyYnnHKYteakiNSs6q8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0_1589921345361_0.08072047227422252"},"_hasShrinkwrap":false},"3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1d07a86f0d049fefd822f8d7fef4e36a304b5605","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aqF9pOBwy+VXiD0QWGU/OllWUNTf8GR21U6IIn5VPGvaGr1wZWlNyHuVUmINQfUybSs+WOoCoi9fWJgI5ttDrA==","shasum":"6819515214f08bba4f0dc87718f8e521cf5d2154","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0.tgz","fileCount":33,"unpackedSize":148773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexEZ6CRA9TVsSAnZWagAAFIwP/3zMNUumzfPh/Mjd9lqW\nQ2C5Jq37RU2ThTZ74Kwj1cFleTNUm+rgC9/yhYUbT2e2Gh8SSlOR7l2tu+pv\nrg7qxUjn52543kPZeiYgaFfl/3Z4Xq/9uBm02Ttah2oaoyLTHQyc6v56s8+g\ngyoDcQpZyzyQIl/nhwdGZQfj62+BwAdfqswelvt451PPAQS1UJLyku6CVXtA\nUVi25B5BJT1iqSFWCWQh6v6O2U6MjVtg3huSW48V9as6A6QL/NzXBgBqA6WX\npwWRaQ4V+Dr6fhwbRlyUF1qv3fE+9RO1w/jS5q2UTBHBuMn7c6NBOwdR2hKO\n0gjihTcBbOvTWPuYE8G5hR3o0ZaYu9PQy3tYbRIs0o8LoA06jesjHBhjHgkZ\nCEAqBxIobrGQuOdgzQ7btz+6l260CpdXtJ4Gyk5Ui5P1HUsVDDxdc5NMA57p\nHqdac8P2kS15zAUG0AElxnlE99KE0GJkQ26VJJn67ZFKjoj1e/dbAf+3ooZ3\nUAfGPcbRXJCw6zoOR9vm5F3luHvxqlKwnvtr0cZYjeQH9lPpw1NmhIjG2wLt\nubzF300LRND8tz2B4AaUGnPxhdErO19qE/F1Z/lWpxnjgTLrgQEHk2+5hRLx\nCrqtnclbPd4TXAq1armtalsHo3tO1LHIMt1YnwEKnWR1N1GIW1K/Cj1ud5PH\n8yfa\r\n=tyHN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcObiISYwL4qgT7Mifg1+gjM+0a80QP9pUvc1WYWX0IAIhALDxJxvkD5fck8gfJQdiElJ1huMTkt0U0i2grU24sxck"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0_1589921401870_0.6094799361999355"},"_hasShrinkwrap":false},"3.0.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.12","gitHead":"e012040e8f800ca9c989c23e68cc107c4ac41915","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.12","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/aypfBrEaqkYRkYukRkK35DSd4TsDiNR+Jd0baRnBWQwkqmVKFvxwjlkiGSIwQdfhYGf9zE9wURP0ej3B88y4g==","shasum":"8afdd7c9fba88872d618fe0400dfa6624a7aec4b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.12.tgz","fileCount":33,"unpackedSize":149013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexEaKCRA9TVsSAnZWagAATJYP/0lrxhpGdfiyQ7PcWzAC\ndNA1CCdM7+OoLXOQwqIdf9ZuzbDh27uFeZd7moaRYbIhN6WmcUXLBbgeKbx9\nJXjnSZZ0c34fkS94HuTaSo43eG3ExzS+ZuDXEL9Ay9bn9BQ6qNx5R22ClgfT\n2rrR3FoO2Dd7H1Z0CRcPNoiFwA4qAAJ6txWzTFdDL1d5J3CVRAPfJwicc3uo\nAt6XHpBtvzxflg03JxNguIYGI5U61u4IkU5EougpE8KbKVy3xJfjkSl8wSTj\nUYgSTqIVQIokiwSDwH5MS6XoRCuQPLeFzKwxaJsLUJt1gGpUz0RXeIU1NIhB\nFb9uBHzXmxlZgbNgJxBrYUWZ2jSUqd9q8y/u5qPyy5LjAYgPIZE7oMYt05YA\n/T4yqZ7k4NRQH95UbLoVg1NskRC9eaIQyGE0sHfbJUOSfaPNUJuoZoOAyd+v\nzFYRepLziWaaGDu/VNjXwATZ2QiVGcX+DwBFcLti0YJboaLdGU1rz0fPc0NR\nl0Web9o+7SODX+GtV5ZPMTmYFe0UIl1Y4hxjJJQX0kgGigFuAi7PNv4wMFNQ\naYoNzivYhZywEAijZjUD8mfOumDnfaEfP43Io2qNIGyn1JuD82sqOjgVSNVi\nzcAfhHqBdEOuoaEq3lLb4JTKVY2KYpflBDa6uekd5kAS21h57wFbBFAkZuHc\nnCao\r\n=/ErK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3sL330o9/nugLKESGARc0t+6a6uoqA8CLralztC+kTAiB3N+ReYTdM9e/VkfLOcu/swohWaMHdBQ+WhwN9VGGGWA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.12_1589921417785_0.7846998565838541"},"_hasShrinkwrap":false},"3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.38","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e012040e8f800ca9c989c23e68cc107c4ac41915","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aNYRKv/K/4PuRrBhNB3OVF54y6U2y/xr7ARfYtFU0/kYHjb/N/4vKq+f03NLfTO9FycZAWOGwGphmgE9Q4MRjg==","shasum":"c8be1c9702c5f5bd50a240790c939f485d6f93c2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0.tgz","fileCount":33,"unpackedSize":149056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexEa3CRA9TVsSAnZWagAAaX4QAIZ+9+/z2rqtwYGUN6vF\ncNGx+4vEmjYOYOaf6im5GFnz58tZtqf93pNW7aloompqo201TPxvFiysOjnW\nU9DUpzh4dyDLi7e8bN8RWSmFbl6bjeLqRd3Fy4jS3pibLUw77K54zwswsM3X\n5sCRzRQ1DjMtIwYeivrr/3hITgc7N3CIHQ7YiNnhbwwzBQEDskGmb4x2b7fP\nlnZjEuGUI9DeIsxR05XEdGdcHavl9AuklQlWKFZ/qIDg17wLWrXc7cty1Jf/\nZN/hB1N4EzqpI+dSBM2JSyhcY1Tts/kJtf00OndffBQfm64W8Y8nacr4DDKt\nE+zAUNdXj1kA2vazLBFzxJjU+9AJI4zguFq4xcLcSpQV90rI22hQlakL97yI\nX6dwq10W+FJfmVTHp6HdLAXH4CMa8n8nVAzAjgTHLEUAIAk3SoY/WaEj3vgK\n/ogdtHQMsRK2lHBLgFK3T/zwjEDETXQ3SyU9c1L5toTx43OUrX6tDfqeK3vd\n/k3Aife29PhNqxaggXEH/0vy98FIE/srwCfwzhBhBiyPj59ireDa0xBOfPVl\nPaPQBnBn7xNEs+tXFJBFjbMI66ZnqyuHKAyeDYZgjVN5NSfomoKcHGUVaf34\n2UhmyR7clQ4vm98rnUS42U54kIlHZ4vZ9Wo4lFG2doJrwDmI+72D/wykIN/V\nEl9+\r\n=zY4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0bSs1/EwfP2KIwH+xAfbkYYTRYr2BwqRGlo1cQffltAIgV8o9MqCKQkwVmhe/T0tZV2aq95fePATqyAF4/UvVIxc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0_1589921462635_0.2909223066504327"},"_hasShrinkwrap":false},"3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0","gitHead":"b49ded39b4d84a2cc10fa809795be021eaa228bd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-x4wwBw8LjuK7QO57wccVY9N+UfkR8uekhhRVmGh61JIzV4RjvopauPys8CAEBRlgmkxocnAsxRfPEMXwbdwIHA==","shasum":"7a780e9d3fb3d94587229616afd1f0ff38165b11","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0.tgz","fileCount":33,"unpackedSize":149056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexFxeCRA9TVsSAnZWagAAC3IP/1W4dKrgWTtccHTN167C\nthCUXigTqxcQH8lXp1iY2KwNRWjzGy1tZLnyJOY+Z83xbNuSWNCGnai01hm+\n253NZJ3GjXXhnwwN0GHrEfaNhBRxAeJQmQL6JKwhtB3cctr0UAoL8fhvbK1C\nXFgPiYesavw22iw2sNIPLGOU1nAEKTJlfPuATDqIgCW4pTX+v4hWNCh3K+6M\nHSbDZA5lVjYiOix3dGQXKMDjcOgufteRZif+y4i4GYUD0nszPJCN9gZvyxAL\ngKzMXOrI5nQc9FojPP5J0KJIe6+/2ZGEVOkKLq9csff+6fvmxXkqDm/ehUvc\nVlv3H7moo5XfAO9nChwaHAPsXBkrDMNuPv/LKK6FzVRYYGBZXwgqQ5qX+/+W\n1mXl+Gpclrj8S3jRH22kCIHZyNIU8MXGVk7iIyTvycSQ+4y/nKmch662mgbl\nELgEt/UwVxDzSRtJGW/ynFc3yrTu9CMZyna0Vqg3z3JcdCVs8+1T2ekUyR+M\nALjZTqFgwvrVBd550iJ5BnyyApTQ7sUZo8bPPNto2RcT8hb3X0qY5HJ4k2ji\nukp9Il3YqwQN/uakNshqv5olcMOK5pbEYlfQRvZ0Ze6shqYLNbkwR2p71qK1\nocu/dYLwdse4BlfZ6Ag6LhqvDNc9ZJZ1uRqx54pYNK2FAM6N1U2Ec/9WROuz\nO7CV\r\n=BiRl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCS5ufxsIYIDETppiFp1Sy+wxBITSQ2dtJFB6Kew+DexQIgFv7R8j0t+0DB4pyy1hSEhfEKNyUo/eNBYfiKi1EJDtg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0_1589927005270_0.03476107325692945"},"_hasShrinkwrap":false},"3.0.13-e678f5cac18252054196c2fffe590445979d7890.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.13-e678f5cac18252054196c2fffe590445979d7890.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e678f5cac18252054196c2fffe590445979d7890","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.13-e678f5cac18252054196c2fffe590445979d7890.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-j88ln6jnque9V0Pf7QWvrtKecFZwOWJKXET2uzJT/tNLtB+J/7BDJ/oltr5Nv+ohvd2orwHFKZEdY7R+MXtfqA==","shasum":"e39eebadd2fbdf0d5d1f533411e323aa3d68d3b7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.13-e678f5cac18252054196c2fffe590445979d7890.0.tgz","fileCount":33,"unpackedSize":149056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexFysCRA9TVsSAnZWagAAm5YP/0SF0NEXOpENu7hOtx07\n1PNbD8czT1ZpRDcYrp+lb8GuEHQLvuR/8VV4aNSUg8UMj+Y88RQT3LKTeyBb\nOx/4fo58352EsQRerVhRtid3I17MWyApvpdSr7BWiY/2e6Q0VSvcKLAFH1Je\nd5LFSja+WrQxM3tclRazBTwDnvRR2POFMDzQb124j0YT5Wy7i3qTzt+wZmBF\n9Ff5NsrhhtyG6rUQ5m38XKCZtkTi7grGSAWum4gw+uLdW7bSg5Di9exe2m5w\nfFuYKwDyZ5P6Xtn+oAn/btTmkQU5F3hwLdQHj2yO7eiAO+Rgtm/3/LZXBQHu\nLG8cp6vNfr2A0RIECutPJmSnfVZDF6ylF1qD243mSTvomWqib2N9JH5xyAbS\neR8kT5wbGIU+IoCXg4ker4z0qg4NklZT0gNco9Cnvx0RqAnfJPOK3VpZ/zRV\nwpYNoDu5sp74ycqG3V8u3BKhagah85r5gchknf8Mxs9ZaIfm7IRzYyEbnN1o\n79CoLRmOTryTQpbl70NW/k/l4HiYWKSayxOiP5SKXjDs+kmX9b2iF/hJqonU\ne8I0A/OOrjww1noOv2H+WLA0zyaMxDzgQofE6ybdx1KSHWvVkXubm8Y5BJqg\nq5mkRZdG2mBCueaNpUNqo+ltj+qI1ok88JM3hJctt3ZFY6qRKIuuuPwgiw4g\nEPBz\r\n=M7kk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQTNq4/37qwsamK1IYal5xxrZ18RWByClUuwtKHoIZcAiEA2aWDo3UtDgf5xgxDyQPey5Qn7mHKmnZWAlxQ47Gq46Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.13-e678f5cac18252054196c2fffe590445979d7890.0_1589927084032_0.8701754517793441"},"_hasShrinkwrap":false},"3.0.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.13","gitHead":"3c8de9e6c13e87e79f3f4a70f021ae454b7b3443","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.13","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5xCdcHpHzW7/QInrdj4W3jnMzSt58C7GupKg6Fh047Qad9kJ8SM7YjN2xyky8ZTRH8eXYteCc3jg+8fbnl7xKg==","shasum":"33fdce83dd90e2516b4ffcfd80b6de1b608a6367","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.13.tgz","fileCount":33,"unpackedSize":149307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexFzmCRA9TVsSAnZWagAAeWsP/1G1sICubc/p5AeHt5mI\nBLjiPsNeLJczBB+CAlyIqKlEIr2FAgUW8CAGR9QPjK5I3oZP9NqkLEUtMLDW\nY9xhX6i4rEzOa32/Z5dzihyre3duSlwZYN8y1YUx5ZaTPOP5h1FYF1l5Rjgt\nE4CSUJQSxbaURh8B0UYRGmqfqxDD1ZoVe6Q/5W9a1C/lrlCIRkLDuAR4V43L\n6QIos4WiZYyXzcFvMKbcWklNRwFpzpLEDhlsL/sFmeipXgTTtczc/emo9Hs3\nFenviWmCzq7zNypHqAy8j5TGx0LxDdAURKtRNoGSi7R2Au8CnfaTT7qIldws\n7XJNhN73N4UXBENQsxTm8UIiPj4k4ot/rytRcMefBAExJQUi7MYnvqBU9y4E\nidMV3AVRA9PX0Ykgj5mtgHUQKyXNAVR1xri4K2a8N1EeLyEsXOhkPe6WJ5SD\ndO59vBp3VZqviPN+4PpwftWVgGppctxCjgI+VjK+mZWaZqVx1QdBGv70vR0o\nzbJXv04Z/wUA7ZOpSFLutVv6UGfBNECneamEm7MNJsjcjNE43Gb3C8z4XfZq\nHq3RVohUSwAO3UF6D2hU9Z2qEHHJoqvtlmEUTOR+yyj3KrQrrbfaKnYA9AHE\njalZ12W0g7Fx+qvO8Kg+dZsooEu7PSYMqnbLSUi0NLssK5V0jgYeDxZ5q01U\n6dO8\r\n=0Pip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGC5XERJA+WNNXTouUt4UGYH5o9TvJGvhNQlMlGbUqTUAiBZADYniPniaTSUG+7EwlcQK3VtIXZOUTPQ1nBdrVg3iA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.13_1589927141843_0.9092583262288441"},"_hasShrinkwrap":false},"3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3c8de9e6c13e87e79f3f4a70f021ae454b7b3443","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-cbMngquvZNfY/sOS8sijZNP/0n3ecodUed6P/eQJXbX1spVYfzTBiheZx71yz99BFze7JF94OtWLrtVZAAHomg==","shasum":"b175158eba2646aaf886feab0d66f86930f46e44","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0.tgz","fileCount":33,"unpackedSize":149350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexF0ICRA9TVsSAnZWagAAqpsP/3VKUUlMknn0EYuHh9BE\nbDtu8I2sp9bruBGWWl4j9muHapYRqhzoKPhr0ugVUfKw+vcowy0OuBKAGaPL\nMPohlrmi/D009I3UfRuJMid8X1DHYgTzi/lJbJrINeSP/a0sR6yMYffQdOGz\nCoupzFQ5qXoKEhwZDOWYRNMEgCqQ3zaQjjbHeq0go3K3FeJF8IJwsyiylt/g\n8yabJuc+lK7jlUKVwY/5GapOmvDaKEuTxcdXudbbkb6co18R3xbZe/saZWeC\n3JvZsHJhMUJDzO3/ZwEItY/RAWA4d7JU0/9+RcasnLKOsUfpILCrEF6xDlBR\nMRDEHex5z4eDelmhVZM17Ri/yiRrxNSqsw/XuCF3rbpsZbwyB4/FuTcFHsC7\nQ1W8UY/Esy5tI3IPk/10RatQCufCNMR9frNaU30oD0TDHPRIPSbAqNy4T4Ox\nfPFcfR5dX2eR7f4W1qDWETQMrcC3fdStxoAFU2yN6E0bLz2IFvWVYtd+fBdl\npB77cgiuFpUg5mRCt6QnwU5ou93/L/OoLrd/U4V4/GmlU/ALICtSyIUZWmPL\nYicvFttmFh+wcTJn5g4x/pWo0m5nWnplv1GH9tzH5mSJeKfDa1nRSH2Dg+xV\nwGVZMMa2r6r0/4MWPL2XbsCCshDpM9wRKKMebavQB4gMtrBoHA1xGgtpz2Qq\nBRlg\r\n=m+ew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKhKRtGPqaU4YH60Vn8ce0SCl/4X7mvs7MG08dPMA4aAiEAmkrESUag9I/Y+lmicZxEcR2hqMv3RgKfxKDTjPB05mM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0_1589927176263_0.10164765999451264"},"_hasShrinkwrap":false},"3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0","gitHead":"73bad6842e96f88fab35e563d2edbb4508fcba31","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JU6Ax+K2gHAmoTji58DLswhNXbh+mQ38HewBMKj/Eb+4XjXkgxRvBBe1FLAJbQby+M5V10LUfkozThNI6TcLfQ==","shasum":"2f364fdac0d16b54db580431049a1b1bc3873053","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0.tgz","fileCount":33,"unpackedSize":149351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHFECRA9TVsSAnZWagAAnNQP/RgMBR7z85TvQbk5M4ab\nE31xmUavLxS5XZVeGzzcRjkZK9CIHeqP4CbNjvgGYvHaX2sHVM5gECrjG38l\n/CfgMUYVSugcSVxVZ8ugwtKCc09xT58Sr58wQNygde38Igt0ZABzdgtPv7sb\nSZbMSDuWbBA8AT2oyT+WBSod81GbT7JyVY/JYjQ1vFUfbiP3uP0JDEaE63BE\npmeImSx940CnIkjO9rf6QxYEvYiPSR4OS8uo8U1pkan9UJRz6Uzq9/nKWxDE\nwbBmNmDWmqIMZVrWrh9oue13pGKsg6U2faI2hDu54tGKzM1VBDSvUAB/+B4Y\n1G2u96SSFwpGA0D62hVgAf8vrIVdyp5ZYhIbtFpBRvEJxx9NlJn3ZE+8cU4X\nHXtWEZSgGlrBmNPaSHGHO76XcHjcJudLZYHK/4vubP8b7GDZPyvHK6w4TYyF\nyoR1CyrlY2VpO726/06AkGvJsmDhCdDJ5MqJVnup2/mLmxNmNsPrI2WwruPQ\nZFfqfCdor3BMn14biZAm6/6fqxHSgXKnEAW+9O+S8EHVftzdet569pxNd75f\nMR+EEdLyPP63vbk+pbwPMyGVodPQ5YBH0uXu035rNOKl3e0grqqm9LFD46Ne\nuuQtHmaPv5WCaDkfWajfbG1GEjL1zSImsbPJ6YlSGmnSarSsP2/KJndk0Wrz\ny9mu\r\n=Ob0C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvz1PEevwgR025RdCPkLA2JENqvTbtapId7arvJkZJFQIgWwX/aiYBcig6cc3OBSRdw4ht4b7k3zI9IU1rqG5Xhm4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0_1589932356381_0.306618411832561"},"_hasShrinkwrap":false},"3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cbc5b9fb2f94f804142219d19f279d79988c9c3b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NxAO52SGpXsnKgBTYPzzkUESqytQkD7U46Q7vFLYWkHGO8JU1PQ03L22RHmh6nf77QIQk5ozTmbFwZSGT5PbGw==","shasum":"8e9536adbd46c3e4f2393f396b5608ee31e3c2cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0.tgz","fileCount":33,"unpackedSize":149351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHGpCRA9TVsSAnZWagAAk3cP+wRw373cv8zey3nM8Sje\nfQj5EPrx5DM0O2vyeMcXRsSi8hcUtTv2b/JzKLvR5AmBYQNtL8SY0r/xPs5n\nDyEX4bVI4lTCxtjmNX1SKXaP3/chYFThZEix3TKE74YYEG1a2tBRZbwafmPT\nqTDxztDVmlfPo9yYazO2sh//YJL6m9MevAmEZRD6jMU3ltiq4lhpcv/MK6p9\nAK8TOsU//c1Rs3WlDVOND0m+zlWbJtRVbei+U3wAjEN0PHAj3JvURwOvG/xE\nXEfdRiotBmx8Jrgu7vaVFpFX8TY5A7gYpmCi2aIGcoKErNTNkedq2ZanuaQq\n4RAH7ljwGLF/jOxubifEnuyXBx75oJH0p6eQ24VtYrlxTbzkSv8I9dD3MG5L\n+Pvz9JNG72eGCzwO5zmuvNjGBnrxLY2UHC7iW+0MapevvGPZm2h1OLhcoOeK\nDBQtNTnBrwByzGSpGy/6StZ49JeHP0ozMVdbow9sCEQAtqVTKe1G+p43omuu\nXpchkyOYX3rCDgJ56RE/BXxRQ+QA4IJsDniW3an6LNi7TO27JkLSUAb55uFe\nYwF2Y89Uekk4p9h/SyJTEFNqotu84qaPolIumJBpAb4lED6fPAW2PFGjXyeP\nCeh+KlSbtvd3SlUJwqXqRUu+/66+bf1Ly2veiHzGyQ9jdrF6Pj2crBTFzSiz\n5pjO\r\n=zidI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJSHkYtACzt6gDqZMmH5jj+gOmK7pWS8YLTsy257ZTtQIhAIZml6pGVzUC+/cQPkBilin1syxzK1kwf3GLDw4NpWbS"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0_1589932454088_0.05296697080000379"},"_hasShrinkwrap":false},"3.0.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.14","gitHead":"92091b2e4dacbd3effd153de3ee8bd05fefc4a6e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.14","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pGn30lUXLx6H5P5r4UA5XDNmakSicJfYfQT6kTv+OBpyhol1cV1zNkpCDpwTYN02oVWskFOHjxH9OSAQzLy2rA==","shasum":"6c375dc501e0ad98eecc73f821bd6cc9b2bd15ac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.14.tgz","fileCount":33,"unpackedSize":149587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHG9CRA9TVsSAnZWagAANywP/iP08jjT338FRlY+Wekc\nkigOgFGdaNPWsvZriv8nfKSef3AWM4VOLim+08BC6oIxoqTMuG2Vin34mJN1\nPqkupp5lIa2MZolBsySlNCHuGLepbiuy4klIVVKDI4o5ifld++EN5i9rz239\nFSuXUGAY6Wtasw4ZqehbQ4svAkRw8vYuARmzLfhF+8itxq6xklZApE874xsJ\nARToSJjl//y9WQMpWBXKDgnilY+EZWRZy9IM+zDUZMMzS3Ieu1zKqLvMCeVI\nGHwM+XDB+zLncdz6PCzHT2PCJQWGtB9epV8CdQiLbU8pXK+80tMQGco19e10\ncCH+k+fc3snlvrnyk53VNNRZgyZh1h8W3Ncz557qXpVJI6CtrfpMWonoDbcg\nvTGyhRQV+YYYsCS6nMQc7F7Lersg1Zl76sfRfRfkpl/VE78nXxeDUSZv+9Xc\nhKWFM3wzqjdWR3q/j091Bpa++09/vDxnLYfVnREe76qDamy798cpgNpZPDQN\nJUKAszzibpd9KVX6YcIrifD0cohgONjADrYfCRuneMdlFBVJafgeoIfaESQj\nZH+FUKn6Exc0XYF4qN51EplPdVh9H3pHDux7PjxgoM/qed4t3s0jIvfG1Oqq\nLkJKLAt1z5WX4iigCTJCmqaGelm/mu0PxhIC/T6uUSz3jflt871Icj60c5VB\nV9MS\r\n=ZEqK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmAcBPXqnsIrm0f7+yGJpjtmW6tR11fCyHd8EeQBTVnAiA0xnVdc3uJXkK03vtyjCm1jyYF4WGwp/3IEXpA9tMmjA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.14_1589932476641_0.6982823408743506"},"_hasShrinkwrap":false},"3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.3","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"92091b2e4dacbd3effd153de3ee8bd05fefc4a6e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-n9fGGYvylh1ZO0s+px2SN8BNXZ1WwIHJJZ+o92oN1iPNzOEdUnrFmqb8kcAi5SSxhB+7IWf+xe4fMLC0rm3r0Q==","shasum":"8be053f831957dcc1f23da963128fcbffb65d890","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0.tgz","fileCount":33,"unpackedSize":149630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHHpCRA9TVsSAnZWagAAIBEP/1RfY4UVTIB9FOz7BxJC\n1aAY2P0HLwL1/XlvZ6ZTP86JD3FR4/LdXgwnmUmHYdIELQAAN2fBtJ46Lp9z\nWrk6IyUI3Si5qRnNAaZDMUxz+BARQo7rZYc3s7CGlzCdjGcNfqtiMrmUk4FP\nftFiHVs7fu8Stnp0fnD/puIJpTKF/qxnskavgLGDb8MuZu0nEiG5lmOCf0UH\n68g+3W4WfvQFzvFMmmZoW+m9VlFDbPJzx/fNMi9R47b02aQmMfGWgpXmyTqY\nu8EJsZE4qpRgfCjT5eDznBdePKZ9CQw5BPX7Pu+BXu87Hb85WdU1Nc4m5xdK\n43LCTpL9WZgKHn9DWnyO59mi5iNC4Xk53o8lcdmyAVMJBvC/ebwXmZlXafaD\n+IcsqE5ZRuK1OBULaNfXOnUj7XA+UZ8HzwAIBG4jUrc2o2h/kKBEUHkb1dE7\ndaFRSLVJ4XXwwXnaGK8YXTTLYFvGS+o4YVi0EeuXYwWV6hS3doWUVf/WMqHG\nEMEGNHE5ZHdSlF4jgVqnTFStFomItspn5+zboTI8no4s8EOnHIQ92C2MMg5D\nWO+mRg4HwnEqS0qvHGDecgEcLPl3o5sD3Z6JtwQw0BjyGX7nU3mOiNtN61Xz\nN1svs4uo0kjToud12u2QU3xvNbAdunOUFqDyng02UpX/q7UL58wLgaoqIu3O\n2dHl\r\n=v0Kb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxn2qpHAh17gCI1Fe4+95GBc1Th8RVwD3i9tX9keYryAIhAI56NuvyNfO8HihkPJXg4XzV6p8f6OFuLZkDnJzmcRWN"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0_1589932521278_0.7305933210916999"},"_hasShrinkwrap":false},"3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0","gitHead":"f3038a9474ec13d1870ecb9e4c9841d3cd64460e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Aj1bLM7ftWyd83BqrHxlGZthUUxx5VNrtcpV4fykiqV5DOuYCNjRWN94Y/MoTZUk4o01RSDry9jQa8m9gKsYlw==","shasum":"73e1e6c419175bc82cccb768c598a546aa477c24","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0.tgz","fileCount":33,"unpackedSize":149630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexH2ZCRA9TVsSAnZWagAAGE0P/31viWOyKC5V74aVA1DG\nYZcmB15/C84Z4mcU+IKB23dIBz9GRm8xuvH//sCITzm5XE+FXgdO1SPRoBM6\nlfLiKKMRHZEOH1nR9s0SD7EAM85tPzSSVHSGMj2bz6tKzVV/nGZxzFiF2tWQ\nuvwH0ARhmuvoDEeq0hWJIoJEgfmYBOAjfmBKyxS21IPaiSVjZFfSbtwEPPXf\nzj4iVCP1m29vxHSAtDWnyI/O2w35LceQmpk4bIuF+vQUeiMQwDygsieU0x0B\n/+c67QWuM8tMAL/0QpZH9FoyFn1Di64loxqhQ4FqJPglamyWfuEl/fJPFVV7\nxbos7HSiXmk07gw2RQjhubFy1kR3oo0GdN7jEROJfY8mIBN4VQg9QQVne2RG\nc9lBecMcDkUxbXDywspajY1J7GBNw8PKLYRT92uvcuAwrzh7nRCJudXNmXK7\nBYHcOXcZHEW8CeS/+RdHpGmL9PFQ0lgsK9Gfs69l+YwJlWgwqpupJ1AvqzDl\natK7n3qBchTblVZCNY7XHUdwalljlAAT+JXVE1wT/MOuqx4iIQQQ5T7+4ZNP\nyHOfhxxLB6HQGWOO8r1fzR/7hUa6GqQ0NLuJdCoqhMgBR/SucNCRnsOUuXYm\nOqfn317wWukIwUW3pWCVg3+RlYbuYu7ZrV9vvyiF9gmVf5ZYGT3NBaihqrej\ndX6P\r\n=IDqo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDveDUyGcrlKBezJJ69noJBzK4oWRBY+OfsQ9A2B1cecQIhAMduapRHVN2N89mMYBAY5c/eylsvxp7SpqT7ye7H0BCi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0_1589935512894_0.9310127682647606"},"_hasShrinkwrap":false},"3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8f65c05be854ebaf5a421e51675cc93b2fc2fdac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uWUUkcZ3qNmrHhGacuLyWTjOqgTbs5arC4HZTNqkc6f/4ktB2QNnxI+0oP2P1YUnC4J+SKx/jkpx78No05YS1A==","shasum":"df7678e7acc68b3372d77ce9b9c66b3266b6b069","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0.tgz","fileCount":33,"unpackedSize":149630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexH3kCRA9TVsSAnZWagAA8dwP/imcb5Z4pAyqX23EyZX2\ncirc3CHfVNiyIrm5r4VW8GftZaLWoRS7oZaRnpiMyHLjfS+TSC5SX6gNutBJ\n8eyU1wSa+cUQjjQ4nsHXNZHvftKgXP05gKR5aqZel38KBS8RXmd0Xvfew0jO\n6O3GEwHBbHCPZWhnEONYtWA8cR5fvLseBZsjjwwqc7AJbHge20LmmIrnoCYS\nhX86H88/Iwn6XrAkm8zhtWYv6NzG3gapU9eFxCb8IY0nHRY2i+1y/HEh0Rvv\nnE23ZcKaoI1FHa1hP4vX8lWIabQbJyPF6NvfnDQJJIKVFWkaUPfb0lZbWsmH\nCW9wSRC+E6vpuIMV2AQFlNeyLZiDBY7XO4FChnuQIvr+AwDgxmPF57RybIjJ\n1MtrU3npPJvMwmfhXY11EanEjjn0JJ3FK3zuL4W9Xmr5BmdDrMwo0fSjNNDi\ncSzwuXKz+aLYYSNh/Vu/e/yWGgJAum0OMBLsFAqZdlZ5CY9LiapbdvXp+G70\nJaMLq4FO9wAE8Dr/dBT1C8NGvjGaef4NYsjOjffGaqHi4ZjG0d1H+HlChmdh\nwhRN5VAD31yCderrQ+smDSaWin/9eMTcF6bLC7bIX01I0VVZKejQbxUSXCNO\ndc8whGlxyiC5o7cQFPYde/4eEg+d/BEOM30sSeIcsPyCgxnU/oWKfdAN8jz6\nSYpW\r\n=GXbA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFSs3KKhlXno3gLs2l2C4uwzvXkDC9pnK/dWlmwzHhzTAiAi30jBPIdPz6ogKYGeDLx/ogRlKd+nfCQTCYk/pXZHXg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0_1589935588076_0.8016403249176887"},"_hasShrinkwrap":false},"3.0.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.15","gitHead":"d68fcb4377046cae97179558685c192fc4afdd36","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.15","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vYwtUtlAsLQr+jxOPDxh0XLbYn3JdZO5U4BuDgWl3AzcP0hNeX4P8tWFURx4Fanx/ddP9WKGBqxXgQubiURxUQ==","shasum":"99d140bdc8695b9dfaa1acdfa997087f0023c599","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.15.tgz","fileCount":33,"unpackedSize":149869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexH3vCRA9TVsSAnZWagAAkqcP/iqFDiTeZh/6mvNWucCa\ntHvyuV/nxtEx9dVBqp8kSPvPio/a3yU01P/Xt7xAx//F3TcLakBAg4fh2gQW\noHD/S6riiXqfUhvxR/Ty+oxjKfPxTaljxfjyX5ANvzeUdQe8ml5qmlsc/RLz\nzn76dgDbU++6ivOV92829dyiazpFxyO+f/f3+7dLPyVD20L2DWpqMZYW1aBr\n1zeIHguhE4b41k8VbSdfMedx8dVXGKDrjjVXBbWQHTsbXT0nZQMSnAf4IJd+\nBaxFKCdwVUhzApNJL4GBRAlhNBaeL11X+EhNJxZDC/irx7mBfTZtlv3jnvmm\nA4oXFXJMr6rSQafjI4ccIK6w41pmiPDp1PW1l85xSC7ZKVmFWO7rufbgwiUw\nUqJgze+g8Zxrnp1lqZJgl3qw9w6BTh3c5lhuYyqByWBCHAbFXzKuH+aAZNND\nUVdYW0OaICL0OZZx1fiHnYgShjs1CyUgFxl3MQTalrnzqEM+A4oss0IiLix5\nWGgyBYcZx3nwAo0NoLpPnuOUl+dLZY6oryGSrk4yGwHsQcELo+Kxvao0RZCk\nLUVftE9JdRRcoVPK65YPw6/juXzhNa5M+/C4f3I6pS4r/i9wbKFdNS5j4S5k\nvX9QjheQVvCuc2fLk28jK3csSquKZ8q/ojvYBueyxmK6i76/75rCz3YkWfIO\nmrIf\r\n=PiEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrxkofnR2eoxWi1gDfPtm+lqyxkdEZi9KHz/gK0uKIOwIhAMlhZPUAMHlkvwbzhtQ5mz0uNBUHeqqfVGwVPcfdHmPi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.15_1589935598762_0.8436839239589724"},"_hasShrinkwrap":false},"3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.39","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d68fcb4377046cae97179558685c192fc4afdd36","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xc9VEYyz4VBlZVcvkyg5tPGF1/J5BZZ/lnGCeTwGyeViTPHT9ESywLj30XIyZ/xi/LQTKwTpqAzI/ZbWv8K0yg==","shasum":"6659d06bea72cca89a346bed9e405705bae08e85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0.tgz","fileCount":33,"unpackedSize":149912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexH4yCRA9TVsSAnZWagAARIkP/RboryQQsBKxS8nq5JGb\n9tHPUfj8H1UGb5UI8eNm9IvYfYbYRcvFNtKIn/gzLEg5qHB9v5pm8AJ8n+w2\nq0JFf07ycfhC8KMXV7yly5ywbPZLuykQw9AZ51y0IXlYVKaFUeKGf6cSS15q\n/mapJOOpaMG2V4YbePNrV6+TGtau1um4OD5FL9QumSTP28F6mr7QrapEvzO7\nt1TiAx05VOXCNJ9FFE7sh8D/g3D2is6GtrRII+dUwk/a2jrw5c9fb5MvrKz7\nZBqsWNvDPXLSwPTKQNqTgw2N3pvQwbHrcUQiF3G3Kj2bC1CvSza1X34uEQtv\n0ygPvSlb395rT4mAvB+YysylqbFKUhNrz7SMmuUiGf+dDCh5RKEQeY9eriPT\n+RcbaObRtZyhkhYuvIGM7N6gE+RQUL4DMJ5AP5XuFZVTx8UsAWxLIW4WJI0C\n083WRdardvsqPWm036JCobdyaoXRoXeLaHBa2QoPYqoieRqeKx+hs+TcD4+L\nqOyn/lSj3IkIgIdkrqYNWVY51RnjFavGZGs6cEsCMZhEnfBusoQeGyEHw8hk\n9czKciFoHquCnKYz20CtvyRC6EBusNZ0E5GVmh8z75v4zUckFm/z6NZCtJZd\n1+OPCehrG4ljx1eb0OS/m/c3O4R+l1NlgSwQFxH9gD99iy4+6NOyae08ziyR\n4k8A\r\n=G5Bm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsufc69j2dp/6BRez4uT3ii1ut0ah4MEcpZjckNt5E8AiB1tm8FIjAobO29lC4u1JDf+cFPjljgPM+s9ouDIloe3g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0_1589935666043_0.5858563568532724"},"_hasShrinkwrap":false},"3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0","gitHead":"7e93095265b5388f4e74b7d2e6a96ab1164fdda7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-B6ZIdbSxCReKEYaa1DPITC0OjabKekbi2xot5fAHeWtReVBAeFSM9soxJio1zbwbsmySOZViMLQ4bnKLknwZwA==","shasum":"95cbd4fdec980d1f5b3290a787477a335cc94a0b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0.tgz","fileCount":33,"unpackedSize":149912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexIIvCRA9TVsSAnZWagAATT8P/0u/60Cnq3iWIUgMcLml\n47s/sCMgTEz5Vgrj5SBIGlNSqTyA6mCDwhRQvoJ/zApKcQswcHzItFrGA5HN\nbawfIu6UBKyQPjQW0i3xMRs8T4/OeTvbNhId8mwsnXhLD3atTw+F4yR6l9e1\nASfzLGUfFZkNHps1uDjuGXb/aoCCC7aBCLR/MeJLJG19qUnTDk2KrxV9CrE8\nWokM33jmcULIhYdUUDM140ZDdj+t7EUMNQ+XUllWojkIr6YFovuGTiH1RepH\nIYqq/9zQNAzhKCjx3utuiwV2i+5ZttdaHEMTNdqnsCHmAOvgfs+hKNOYd+sc\nkF3gXUxf3hMDrQ2cv2KeiPycVP9+gSC+W0SL/Q+Ql6KKwNA1nYIKMA8eFfvX\nTe6LwIYYsfuRmEDt5243WasDa7St65G6gL1Nv30++Y2Vpr8ltEKqrzQ/eIwB\nUEoKp/+OhrYxRBcaheISd2MbTQeL+aveab2ELz1VTfAIaDOSz7ImRRcrhWrC\nhKE9QXLvcc4WQXZDj30pEYzuInKJVhafP1qE7WuWskjZlEt1Hlrt80utgkyQ\nikX8UOth19yE8so0jW0KyietKmANCDheybCFDe8zMBQ8X0ty88JPxfuQDn21\n8ijUmiTmpUoFxpaME+gQqdKKnsHvFz4tQ5MUpaBr895MtHAYkqzEqQEyqmpD\n2COz\r\n=gmZL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDopXrj2m96qK+5475w6O1IlshiLl1N9NYu1mNRCU/TkgIhANKmZA4Pu5GTC4abcUIqvlJHZIIbV5rRgcbklpIi4anM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0_1589936686842_0.6926248873939986"},"_hasShrinkwrap":false},"3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"78174ae085a080ba1068902ae9640bade3e8bf54","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vFHAl9q3PUbeWKMB+YmNgXHDDhauXbIlkaqFS1pJtPzyxn9/Iwl4Fz6Tz8D+aildtY2CJw15x4a2AJx99KF6yA==","shasum":"99ddca6caf2c691cd6019fd95aeae852b5af1cd4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0.tgz","fileCount":33,"unpackedSize":149912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexIJCCRA9TVsSAnZWagAAtLUP/3vwt6mFbCdpIrxtAkX7\nKqMI7ccVrRAvSqXWtdMhlHn/Zb82EBR33Rwnkn2IRLB/Yit4mdkYsD3BYoJN\nQv2lEtX+ogJvufHFkgSeNuzgMYNztbwQ5/t8BBEOL2PubRg3hRTg/Xyyogfm\nEse+GsyXt0MNS01bspnBGB8fJSbOgNjNBB0X6GRxLgHex0D2RmcPz7tHO+Ue\nVOd2Z0VMZznsINJ31cs6mzaaJ4uFnLDzabA4bec6XDkfmafoePvG+jSJD05h\nAPF/etPR1qqhq/45xRIJSMkr5PAqbhEZv3YUSoygkortiS/AWZWERiSp/GIi\nRp6pL89GMFCbFsGicN7QMe96B6gWrvStYkMMLwgcW4aieJiuOQE+OLfaA9yd\nreF4UaNxfWGRTvc6XiTkotf2VqYh5HC12Le3M1C5mSRn40T01BsGGZWNDqEz\nHqUxCSVos46/s1O6z6mMCpi/Hcu/xVLkXjUtfiCp6SOakZV/5qpCEDM0nrls\nyrTFR0UnhBJkMJYCAKxV76Rx8OnHHZUKsiywOPKulFKhmUd0s+2Td+8kFX/e\nTz1uVhFP6ORs0jLLP59H6xjXVKDun4b+bkOHlMBxs0jFbYFTJaze239nYsyo\niScK77vWPpzpfS8pYNRX1xKug8G7arfgAY4CcM2P8u6MAXArKMNo3df2bA0i\n0DVB\r\n=qp6J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCn3eAPa7tEW/DOHR9GsLxWVk30ENfsiH5pxxwQTqA7iAIgTSpmC0l7G73t7nk+ZfYNSdQKSaMW5uW2TJ074QRIHFg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0_1589936705902_0.6972682356663236"},"_hasShrinkwrap":false},"3.0.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.16","gitHead":"b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.16","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gjgY46qpigKBpXKZOeCY1HdO+hWSm6kWYUqEVNnsWIJoz+vt1ZmD28U1Cbv5Mf9dXtSMlBoDwyUFcEZttmsxlA==","shasum":"57bc63398909d719b045ff73f677735890d8d016","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.16.tgz","fileCount":33,"unpackedSize":150163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexIJeCRA9TVsSAnZWagAAOcMP/irzgB9M8Se5j3gh3gPw\nZ224c4u9LSEQm9tPu2NMW9+bC0XINIv0oKZlZ3fO4XlHD/TqsOWbjdUOEmAW\nlB4/eqbauUHds6W7hWD+4DeM5tZdelSZQGyAmvO1tUAQrIgpkIBEShhyTS4J\nGVwCqpibhwVtgvXLsUadzp5DkQHS+Kei3MjHJnseKhHYJEPDRTmWheFGJ5In\nY/zUPHGU1+1IYKgraepBZllou6ZP+703JvNwHUFTgHH+5BPecXF/3Z1rTngp\nibHbvGysgDcBhpZSY31ISbs4hR/WTSWNIVfdZBkFRmfMxNbiloO6p4++xa+8\naJUPZpQJUQW76uTi4vlNiIwSrNH0NBBrWZqadhjDIO48Nm8x3gDbAzYUuuRU\nm49NU7TEX0okHJQnaVzf3nwa/pjkwKqFSrFvH5NVnGNvvEgN+xjf8zI0dooD\nKjBeQTADkuXUqnd2tFPelUMatZXFJM9ZcFjvtAIETUpoObl6Ezx3Cp4aOc18\nOIW7P2RC4XPjkuvwG1SD9EgQnCU/6Zn/wPo0U78NFwOK0rZeAvkAgxmg+NFi\nFBhfbcswJBRMMLPEcpVaZoS1/fJx15tyMBL3cN0GQ/kjyXpMlLWNJKNKfaf+\nx20e+VIb+ennI5TjYo6RhMeERhUTFx68d80KyfJv0NC5Lgk+hAtqXTc8J1SJ\nCFZu\r\n=Q3J+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4N1FPgNm6NQ0ocl5viJnFGU+DHNtCj/S7ozIY5Kt39AIgLzTy++F9c2BQRZlB4BfPXFL3Hq98JbHiFZpXxXeMyeQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.16_1589936733956_0.5241332072747651"},"_hasShrinkwrap":false},"3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AVWqcQN+HjQIkVnQswv+El3MqCqkt55K31xtESAPSmcA2DMuYS4Vq+DKiM25HvIijFMBSJI4YKIm8CytRqjafQ==","shasum":"7f586d69765552c956905e3a1c18053513aa2d7d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0.tgz","fileCount":33,"unpackedSize":150206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexIKECRA9TVsSAnZWagAAMMQP/08K2SiObnoa/Z3uyUFQ\nyCz2eRd+ylw/yBx/5ymFAAj9zuz+6vfZYWpFJ99yYE6JlTTr1sOzA5X7F6OV\nvWNBvE7+zVXBp/BVR5eW0wgaPuvEl+YjxEuJezqPz9vGJYkKqjnFasgNVCeu\nNQsihmJs5R4iX297QJW5bE7bptfMSxm99ZBRxSZENo3P3zw6uVpvogRSkXOJ\nYjt9+acMTEOUI3+1Ev8hKbIK9nL2yRX06DYR2um33vXFDZ+XmhqM8XYYV2AK\nQLed/KyNqxinrp1LJ0Q6mgoo9tWWkIEKCV6BG0GJ90w0tgb9n/MbH5l+hYsA\ntpOK8F4Gy9rfKRVZpG0u/wLnW+nuI1r2g2089nBzyL/e20NUpNIiQQBTv2Or\nD0SrWibjJ2d74iR3JvKtUJqXFuFztqn4whDHYbxC5B6Z997qiZL/MKUhVZtv\n0GH/jZ1zaqVS56nucVP0+2Vu6LvG9facGNvyHWvO07QJiAFXWmlPGrx6EXyT\n6L0XA4Rf25oteXPhuuJqz9YPDAVNTkY3+3a0ERE0YUvS/Z+e6EgagJf3hdfF\nSHj9tvTVcqXPuSspiJzQJRHc2Mew2Cv/AMxrEnQeEJ2e/NsVC+mYau2SUG4S\n2XJ0UFc/hg8aW7EMAT73Qaq+7Ehav2+i344zcpEC0H/PcHOykHGOTVZuGyWf\nE/MS\r\n=mERq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICTmtzkAhjNvg/t4dD0uBYllUF9kNryT1waB4WLTgD8GAiAi4RQ2jcujYIMuRp0j8w8D5U5h01HoNeGfpHD03KzlrA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0_1589936771556_0.8936328344274771"},"_hasShrinkwrap":false},"3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0","dependencies":{},"gitHead":"e4a98b18ee6c5b253dbea4253c332d25767101b2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-px2oFPS9fW0ba+pxP/nuZW8GxTfTD1qJDaoHPnyuGqT3KYH6YAGsVCPiGjHe1rCKP5AbvZU3GrumGLnCPfuMEA==","shasum":"28b219af078ffbd3042e0ec2d3d7c82dd659ac22","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0.tgz","fileCount":39,"unpackedSize":165752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexZ3nCRA9TVsSAnZWagAA1tsP/0IR68yeMvSITRRX+yd8\nociadwxq1VrH0xMWa+465GTVO1GgozW/hdmQ6UhxKRJidw+J2zn2gFjHMj73\nogaby4VhoOwTYIjwDjMVw3pCneCXfxzsK7Z5zxkaAiKIB9pT2ksoryJZoBJo\nKy0DIoYVMoDixgilVAxmBbhJiDVIyVY2FN7Hp0qJTFLt3HXhKQCzVCXfap33\nqT9+vsVaQGVaYv2ptp8oTfxAqFiHwY31RBdJfYdPwPS4c+sLRjOU/PVyH7RK\nVmU1Gkjktda9u6pctVF8LA/aLz5cIbeGxoMsiKU9pRiBts5IBKr23V9/EsLb\nF4RcNpISaISRmVQcW4i9T5T789HB5QPuLbAXgQmNsK6CKj9+SEzShIQOqsND\nX93JCPq98CC+JzVdAMaPqEXpk7fKBwoQZSZ1dQVGzItkxjzZYVCv+P1OlVF3\nkojNIrBi1eqy0gLruwV4LFyVKPv79L2fVCfZQnGzef6w5LAv9Js5JBS5VHNF\nQGlwGdnXXEvcJBtOL2Y5tAcvSzxn+LtzDh64C1Qs9/yFolIMpxuDFWZAus1p\nggs+ZRb0Q90KPI6lhx1IiYni73zNIW3jMLRtQn9pfZP879h/KycJOUtfXC07\nnJ6EWbvT2Z63fV5BABojRD6xeyQ9OCbIgUEUxY3GCSdPkKyH7ubEo+AAmbAw\noW6U\r\n=nXjg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYPqjT1yHCHpPLH4g/cATE7trf0pWPK9GC9q549DxtTgIgPbNEIoMa2ZUc1OnybDYx//is889+RpY1YUcWGg+gAwQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0_1590009318500_0.4863397015177271"},"_hasShrinkwrap":false},"3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0","dependencies":{},"gitHead":"247842669e11488ff6927183c9ec2aa1726445ef","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID convertor\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\nAn artificial radix is used for of the Firestore ID translation.\n\nAlthough the actual alphabet is of length 62, it becomes more complex (both in\nterms of the implementation and the number of computations) when an arbitrary\nbase is used, instead of a power of two. Therefore the smallest power of two\ngreater than the actual base is used. It is small enough so that it can be\nrepresented in less than 122 bytes, which is a limitation of UUID v4.\n\n<!-- cspell: disable -->\n\n```javascript\nconst {\n  firestoreIdToUuid,\n  uuidToFirestoreId,\n} = require('@ridedott/firestore-extensions');\nconst uuid = firestoreIdToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToFirestoreId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-L+r0bzw/cpmlTg0sYrCDS/B6U69cGmOORbh995dudg5n1pd8ajzOWcALrp8xvYObenvhBWXO7N2uMeZtZcQM6w==","shasum":"21192bc00e6d284de25b4a1d3da9e24a420a9da2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0.tgz","fileCount":39,"unpackedSize":166677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexaOgCRA9TVsSAnZWagAA4ogQAImezf2hc4L9rJNgYk49\nnSPwtiCEq8cyVccE87ZRCgf9KUs0xfYVKzyL4CtSju7nCmHg34yc9RoaH+3/\nfMdSXocXRRPR6XaKYFi5PGhJBDvwGhpRT+qyzMqEm8EXrTgeu/+wWE0Q9tGK\nhqv9wbrm4tDXUTii9Ah9GToMwQt7+5bill/f8wv5ZGSxl+m4PJ4Uy4JHQvVP\nlqxtZ8hQFIJYPxGB332GS1Px/A0/eXvlFd6LC2V2BgKTWyOu9gHq8B418ezt\nIDap9vFwmZL2kxATVnBPmr/gNEkBuEQt7QXYuhiWAHKs/3J+kp/BejoAW20Y\nCAKdMMYH/VLeO+Q5GhQsF5CHbaKGgEwvIHJ617E/WejP5xdQ9As6Fy2uPJVF\nv8JeHHvHWAsdJLpYGoMcLxeWAg6D7XtZr6vDW85CMIL+IlvNQvsZqwHB/HY1\nnjONy1JUEy6RKlJT52OhbI6cdtgTelcgT45bdd+Lmq/4X4y+UklKvyhT19ta\n0Wd3bhO02zlK2jJj6nv+eN0Axol+QivWU6Mzi6APBvfHzKHJQEquysSvnnyf\naM2gKg+122w1MN2g56OSG5U+NCt7lRztWvtTy3U6eZ2rklhb6ZAzwwT8e2ub\nPJpuSwTHHzIPOvP+vJkII8c/VbvSUIej4JAxTTcwm57VRaXmehgSgDeWFUs4\nl/Ep\r\n=R7a7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDc/Rs7IWvJ9NXYEU9kXlK3iT8no4EeZDtRB4FciGieZAIgTyqet/foly+28TwcdbCwu+jzB1VAp3SLeOLztIwJ++I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0_1590010783811_0.15528927795713687"},"_hasShrinkwrap":false},"3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ramda":"^0.27.0","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0","dependencies":{},"gitHead":"aa8ac966dcdcb576c3c8c70aad2605ded2c86866","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\nAn artificial radix is used for of the Firestore ID translation.\n\nAlthough the actual alphabet is of length 62, it becomes more complex (both in\nterms of the implementation and the number of computations) when an arbitrary\nbase is used, instead of a power of two. Therefore the smallest power of two\ngreater than the actual base is used. It is small enough so that it can be\nrepresented in less than 122 bytes, which is a limitation of UUID v4.\n\n<!-- cspell: disable -->\n\n```javascript\nconst {\n  firestoreIdToUuid,\n  uuidToFirestoreId,\n} = require('@ridedott/firestore-extensions');\nconst uuid = firestoreIdToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToFirestoreId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zcX11MK9B8hBwJyWkHIsn/40S4bgjBDKnEQshm08pwrPAumItLYSmbG3VzSp68t5snViUApmO5ZGw/soNcNj+A==","shasum":"bf1dbabf60a7136ac23ccb6e672883a092e20990","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0.tgz","fileCount":39,"unpackedSize":166677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi1LCRA9TVsSAnZWagAAS2gP/0FD6LU+PzRAHt4Uszpv\nu+erIhoUN00Q32tYDhMqh6EwqmsuiCJZOtr+CuvFIXiCfNOSIdilPNnQCOoC\njrnksrQucMavgyTAkVHo6bFeT5RxgmDmSy6Q/niTWvzJhItzQW2i41HxHk0V\nL87lY/we1ua56yvUTG3NMO2ZNDQwN4GvWmtSX4RGS2g1o8NvTS8X2lNricKv\nwK8bhP8/sYsOoxGBZo/eVfIyp54sKFOiJ934i+74jSxHAJ668ce2fdASDwzK\nJD5WHcaIej+3UkDLvTv+0MhBHSpMBKtHap20EPic8XdEPUfmsUwgeqm2IDPt\niGVPsDbbFhFWdEPMwdHnkY6LRDKmWpiTjfhGGt/iy9gV/XXimGyDLGIJDDJ4\nJyAjuYzaozBxeXtGXSQ98lX1GcHENtc8XniPlVBqeFgtTJEafsi+a0h/wp/h\n7sHJGSF8kDuwejYjfsZDzw/uqMBZjOKhcx+lIh42e+Mqpmp2jPskZSEN7VAG\n8R7M871C+G5l4qHLGmUGeabnyMNp4aVTEdcx4UbbpoZvc4jZjgkwJNWEGLjG\nSyWD0xJufqVcTU70/GC4pAG2v1vr0pbyX2+HXzo8gAc5EV4kcfybu4QAfxYq\nd2PzuBq9eNWmXdrutS6ljXX/P02xUzgs0TYO5ftegYa0B7yRXKLmrsgEINWu\nAqz6\r\n=SWM5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDF/cBe/SN91Km5hRyTmsnCb0sIxXqw2ah5ym8qw1ATlAiAp0wyU0qL04rn//05FHt+yFOmauMyUixnv/1RyoyoxkA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0_1590046025960_0.5407508570159565"},"_hasShrinkwrap":false},"3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0","gitHead":"45440216462f5f6c5e9dd8b58205be6ae4688870","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst {\n  firestoreIdToUuid,\n  uuidToFirestoreId,\n} = require('@ridedott/firestore-extensions');\nconst uuid = firestoreIdToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToFirestoreId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TWytsnw2JU0zojmlJI3/oQFLqxss226cE40bgC906T7dWRJpNqBskfsz5+JHk9p8ACl66zzBSMHSIQEXFN9nXA==","shasum":"2cc563a9ee4ce3c295234a042cfa7ac9cb2b82d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0.tgz","fileCount":39,"unpackedSize":166089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi4LCRA9TVsSAnZWagAADxwP/2UZGL6IctUvtFcLilt6\njl6VsCqtT93eEjXSvCAMK/+HTaQ59WQ/Ams6DTbtIjPVoQ5Vr8kssX+SisW1\nziwmkwQwJXBu0hcbBs07DPjYYt3KeqMlVtqXuxgqGQSkw1c9DJG1187La6So\nYyVCAsFJ6VGjewDENcNCPZdwNTo99H4s4G5KWM5wF6zEcWI9B36IoTBz61f4\nYF5X6u4d1rwYkWPPbqP2oFYBs/vIO7+VrhM+veqK1DdTwBPrrPLt8MogbNZT\n0OlIfwCqsHypOirPZNqpmrORqQBWc51T921E50Zu3nufffu4xXWkrZhqKxat\nrotMGnQt3xwH0FXl6MWGwKG5Uo8Ms9zIsxzyV34Srq74Ob7p/M1EwGpnbpLs\n9Tpvrq23a2OnZtB2QOWg9raEItYgLvYH7N6UBUNs94/Oqor4AqjsfMnhPkJl\nHpzyFOvsYrA1Pb/rB3ACo4ASEb5/XPlXz5n/k3kbx7P4JmdhkbrAG/qRDdAX\nQIhVyrgvDZ0/DxudBpV2yy44BkLqz5JQQ33OKxuDAfSg5hVfPyDvaH4MS7Ms\nP/WCl1WzXUiLQpj9JzilDI5wX5Z02aR/xyWADKia1byCKfH7j45rMKGY7XxZ\n/OaO54eGlFCvJnPfsUhSNjn5W2GvN2o8jGAMdy6W9udgrsq01jDmC7wOtd8A\n6ih5\r\n=QOC9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbPhr+sRO7U3XsXNhxVTg2rGCcAJ6IYZeihaRkkAZpWgIhALx6lGbjcPyyCp8EV/Qb4FqmSwtLJaUZYav/vg2d/vE6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0_1590046219405_0.29648918669272994"},"_hasShrinkwrap":false},"3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0","gitHead":"41d88d356a71acfb6c8f50af15e64e3f61e0d201","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wBz2u40LTD6vToCvuh7/iCsAQB4zsg5Hh/GZAdedbs/HxZVu1041qNCZrIMK+ITMMvkKE6PAk6ApkgKu0f7YHQ==","shasum":"1f83f4933ae1d0ea2fdf3cda079067d117ee9e51","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0.tgz","fileCount":39,"unpackedSize":166048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi63CRA9TVsSAnZWagAAbMQP/ipnW755oRvc6lpRRRt7\nv7IAPh7VEivM3A2NOvwzBmOwemdPwyQ5sn8aJbl2NP7tGpWFVLCH+bAGAdT9\nYM/9Ml+8nYXeiGUye7e8G7NvUpZ3Ni8UNqxqsAa2RDQmZ/QpgwqXrMKAG9lY\nzyntLHxNJh5900beFqK5QJfhAqnuuG1MDhioQr1MftxxXkelEJm6HbqWDVpq\nZjbg3bN6uahzwCUIk7sc7zjukhMg2kCN4bAzw4QRAKThTUXUtXjSgKKjW0qE\nrH1MNsfKfBeg/EqVoRzpYU2POTSqPsk+yBGpcUiWJKN65fXqghuV8KlX1SdL\nOSIiNozT18jpgsIXwzHEt8+8JFIxcfbLv0/fI5IM/hPdEnKis4ObOySvrc2T\nd7NG3uTtiL9benLV2NgU8mwwYJeKHFH4XcCIG/Zc/SPdFtNKftn+eUvKCh7J\nDHMsxQslsW/prM4QhD2S7LQUMKzoL4pivLBIPP2Rcc9sxf52vjp6ONd+YZXN\nHSteXfADZ51pmOiUlcHUVcSc4AVIGEIbmEoDOcob9QDHQhEu6RqYuw7VMCmf\njERAuChMGtV5Gf5yWPT6EkWeqqBuq+z8NiNO7GY9cLEJXZcNkEXZcO9dcDaF\najvfKa3PbWQLWVnCLxgf+kRTCDWvY2rIJtpW/7j4uCMowqVc+K77i+K3u8w4\n+dkm\r\n=fqyu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUsUw1PnjJhM2Xy8dtcPH/gGGJ1gt528STKKNawbpeKAiADZmgQUMJ1327RgSdcSMNoDhdIbsusTVUIaSIIruymQg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0_1590046391481_0.2145728825215809"},"_hasShrinkwrap":false},"3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a670c397895755821a0828e926f1d39b7dc4f6d2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uQKlo8jSVxWA/knfa5Z8Y4mL2gOB4LQrEFpQM0UAO813yAsbSLjgOrW4BC4EeV7qEiQYGh12dYWNmitjqj6P+g==","shasum":"fbda0496aa368e758ba3a709933ef95bb925cbbf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0.tgz","fileCount":39,"unpackedSize":166048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi8mCRA9TVsSAnZWagAAVj4QAI/HkT3zFqXJVgFDw2eT\niDdzN4xT7KWn+vf9f+6H83a398SpohDGogJtm/ycTsuNrnw4XjB3EzaVusnR\nhiucQbbYy3Y7j5ymOd2l5qQBxa+y2sNJRkjAeDl0pmxebkFDpfokdawnUKWD\nMOEwm3MlsaDWB8ImrCB50LDstMDNQwrP1y7DMlI0eHR5WFL0LtUv6fYAM2x1\n/JCS41NqHgEt1gNTb2Tx6T0pdk1rDSrZl2aK75Z+Tqn1F9n3lnNGWilV8bT0\nQ20kfIdtC++5GKZZGUPjUo1poEL+IzBVvZl46MZlxq2h7F/OuBJ+4JZMpiVY\nGCTf+0TZGLRIFV5x6laCFReNsDKcam7BRyk9mQ1LUYExPQJSzTOub80Ig6Ga\nY5s1bydFHvw6ndVSPaiaHYs3l2HH9RR8u0zBttCbV1WfbMBpl/Hth/0G1wDe\nhPy/jhx1LP9FX8h63wbNfiTlDg4kA6PRQy2Atq25SqOqI0h8rHT0N4nNldb8\nklBv++euqj9J7gHbUD3UBryw6B+/SkAYhO0Ka0z/MS/aanEbaaWYb2+N9OK7\n2zykngdera890m5oNQVISAu+Krcjw0o4grZY1B4MyfePSc3j2PYsrLIOFp83\nJ+nC3RtKshCgmc6/jZYY0dfHoLlOmFYleabgmqReooXZDw+6QHMoJ4DEkP/f\nPrVf\r\n=Y3/r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhITmpx9IIwJBwFehU5dZdcYaIJT1JvZ/UOqzngU6rzAiALZBryJp9a5W2Q+WQ1syRXWExXEnJqlQWCg3Fsj5d3YQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0_1590046501943_0.8790056999702851"},"_hasShrinkwrap":false},"3.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.0","gitHead":"11ca8327bccfbf998091f1d8ebe53eb5782e2fb1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GG6QXrH1/80CFXYT+WX/uOPC2LU472u7ufmDN/w5ee3rdubhJEikkqpl/JKcw0odjDlXFxXU3wKHNAgKYnxh2Q==","shasum":"29e34df935dbcb09c6987c1710ced89119d847c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.0.tgz","fileCount":39,"unpackedSize":166267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi9DCRA9TVsSAnZWagAAtF0P/i/JNrK/oMejlp9HphEN\nCik6PB30WkNShUqXmX7yqw3+QXFNVUe8p8VJA9twaHn/0zEMA3kddyc6mTkr\n1V22O5x99M7h76Y+YoP1JxMJexrKBZ+io4N5poicdgYj4khQQHTQFjSc15Vy\nPnSIW1lUgYWKzLzJAVbYMcPbvFeFfK3c5H1JIOAQhVgO5NCYo/Fw0rtlxMuT\nQK+hkQ+Lmp4MyYmGS5d+FaxslEEUbbhT6P/rIS6bCbpTBAB9W+xVXQRFgbQa\njtMLE8dyVW1PvQMGLBkUR7WPR8FsLn5VVWmdHmaeX0LrwM+mAbq8uRe+zxrV\n9/Kdw0c9bzBBU4FssaO0LiV4nTqMY0tG8yDIYoySjl6B0OM3lk352Z4eRobx\n4oDoxCBh4mTBLha+VfsUaoLUompkOyAYFAD7gRkBCzRsnuEM9eerX76BSoeZ\nnu1bp11BzZ2amyUKGDD8Sh7dC2KbY+OrTdQDHJqlPs3djNdpydt7pCIYS2Vd\nLgA7Q3rgb4Kg1W0RSIMEw0S1vjAes+GZI1JiYaPrrJLAQNz/oM2ubM7t3/sL\nGZJ6sbaJU5BDGYduWaNtd5saiYRz3T1kg92hSZipp33FjH/+IrnRwWhuHO0k\nGXwYId0UVTHNfr3frmxshXEE3KIbkQDHWvSu7DimLDW8Zo9S9lLtpTgAvTi4\n+LpZ\r\n=Rioe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEPBbqp7HuwyYDdZ2vPpMpoyOVRSk5Vc/iT9EqnZe3knAiBYVjRx1YKip3efV4iUcRQfiG4sk6CCux3i+kHsvsiRLg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.0_1590046525020_0.3350542810355275"},"_hasShrinkwrap":false},"3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.4","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"11ca8327bccfbf998091f1d8ebe53eb5782e2fb1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Mv7Cb6kZs45VsifreD0b6gTq+G4KwsSccoFHidledSKnpKNUoU3S4gguqC7u/axLFcel6aEkV9u3gflgJ7Wg4A==","shasum":"6d6a36372f2d209ed0d91f6871f79c6ce10b1fa0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0.tgz","fileCount":39,"unpackedSize":166310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexi9ZCRA9TVsSAnZWagAA6cQP/jE9zVh+ZYuLjbzw0HK0\nVPH2VzAoU0PDMUJUiPgQ0cwYhqcjAzR4HAyMSX4JNhdKIEBcqQKJEMWAo/O5\nXWNMjC7AD+PGwEZ5CASTKsXZJfzPQKThCUqEAorJv39bFSc/sjDvdei7C/mz\ncKqEh2EzfnTZNdORnZ2sDJTWVMCxNZ+5WP1Q3dcJAT7x4wuhA9T7pXI27Rrh\nUnlR5CdMPqxeU+GQvqw++NqfhknsCMObxrYJDIQLdtLQNbc40IoPDzagyxlY\nnJyxamS6J/4SMR8sTVDMr0A2otAJuH+XK/L1UUVcw14zrqOYqg9IeubwXr9w\nGT0cC+jtb8QvBvgDRJsx7hdnnn8cCCOvhyV9eDbu71T/8UZUTktC/BNAp8NJ\n7u5A33Hs96d8lghNuAM++e92/k2evqa0PcLCc7cEYrfRBrPAvL2AgtoCwA4R\nB31wk7PpPvxqi5M1IptNzZro4yAF5wgWaFalmD7g4TLpO3ZPxgMKnz78Pjke\naCaXoAMs/K6Pbi9Ak3Qbrst0rCuCcJmMmxRs4uKYqmIcAd4paAdVV4cFX2eg\nee0XHexVrPrgaF4BtufH9WtnQoIkb3rKbsZFDvarlMRHT0hipKgEG5fRPs3Z\nZfUDtzP1tjbarIjWqqLDhtbrQ2lQtIIX5xmH4bPmqZBJlhRiCnsx9LNc3B+l\nluJC\r\n=i/VG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZk3TFjdwPNlX9awv7LwPMV/9OTWmDzw5C2T/aNL69OAiEAo9SvVA3FH6WFjOrOGLfpti74o0uCrlPW75V48AtQiQ4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0_1590046552946_0.1673476297745098"},"_hasShrinkwrap":false},"3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0","gitHead":"3b8c7006229dd832a47c629b1ce03508abc07723","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KfWSFTfKc0HSEPqVmCqLzjARrhlSFAbBfRv7YKSAr6YU5t8s6yRzlX0puimWYasxlNNXr7r/2pw3ydSSVdvVcQ==","shasum":"d82911666c7aef72cbdb98be4607901e5a8b46c3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0.tgz","fileCount":39,"unpackedSize":166310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexuylCRA9TVsSAnZWagAAgcgP/31YYSPg+OpfxtPABUTm\nCcc57xsuf8apjQ4TAE4CEzqwjNyjByAYHkZ+qF6E61AQKtaUBkP1WcgFPE1g\n6nZ6UAI5cAyobqdItRc7l13pKm5r0k6FFzZNQxKkja2BsLEhDvwNylmiXZeG\nghdyJZUyGxvAgriiQry3CCprKjrtPoIBKHeqd8TOauV0gy0b/m/FnwrAWCk9\nRPQdQvUQ6GhlNTWHgfxqV/c2KiQOSU5rT9A/kP7HBHpHq3rg6I84A3A608Wo\nhJXg/1sHHFv8mG1AYSnZH5OOZFnkUao4gxmarekUZXcLkkzX3asYWe4IxzhG\nj1BYDTmTYfKUWzmZWgJyCrPq5s5aJpxJFzyMKu+XpDE4xgSPHVKGjkNB9wEp\n+gpRbGQutHmt3HT0dLvEyBNzO/upUOYEjgJTdn1SVWxIoDdxHqVFkxFn6ySh\n4JD+sU8EYZ484H6sNloyr0H7/C6O39ADcin4m/s49lGM33uaxBfIwYMAIAEy\nwNnMahEiRAmiyI5tKchlZ/T+jIHNkLYmmGjS5MVRpTv8cCk6J6j/YZ855Hpr\nVTIluC6V8PnLuOrh5EaW+I8D4C7MxUUtetUhaGpvRcrinpd+9w0ypzzbS+/+\nO9oVb1npjpoqG3FD/kKlnFJOfQTVC9XAOf3N525DIs7qldJbiqwsWNKc/ewS\nDxZT\r\n=dh/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDy3ITWWc+s8lsW9gbz7ig3DnDcH26ZW46t3zSkMHztagIgUbICOCZqks4VJXALLJJqSFzbUslVuYo712aA9kTcPOc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0_1590095012602_0.938771100176381"},"_hasShrinkwrap":false},"3.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.1","gitHead":"069698fb926dc4dc149d1938cba24748c930659e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MdK6DX9/fxVkjs1XGZ+ujSZli5AZ1fZ+sIj2bWDIsbnT7+B+PHIYInbXMtaveEv0uRM1Ih7LR44Ogp+NqEyisA==","shasum":"e247dee21e0df0d742d1c5273f1abb42aeb3cc8c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.1.tgz","fileCount":39,"unpackedSize":166546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexu0YCRA9TVsSAnZWagAAZYoQAIJRmJG7pbCbkYAHY7ai\nDO6YDMn6zt5EzxQv1w41Cmr+G8l3z7n/IzYUxtfxyrXHJscYKsMjp+7akSNF\nQf8v4wLJI+M6GbmYWeQM7uovOcQ/dKhVATkrviFF+g792ayhyVPElPP3WomC\nC8tN4436tGUa8DNgOMb9l8z7qSBe8tLSKQgi0/vtwV/GziGuLLHPnuDR4GL9\n2sP8r2eZXj0qIfMCzksE7L6Y2lJhymOJSUUY592nlP2D2siJ9tYfS0Koioo5\neGMSRtHsP2KbgTtXFStQ3II0JjLdUQ18jQuz7OJaCE40PrOeFEjkKleaV8rh\nYAJTylfeRlMmR2eEFd8oqE/hOAy2oYfWLAWieFYD8LBEcLwi5JRrRYP5jn4f\nBDNrcS729Ua6zGDqBRoDW/KtFBU+zEC483G4X/NhCdlz3GKCy3BS/ILEB4GU\nJb0EqtW3JTIzddBRWs+Moe1TacPMRKiLwxFVtcRpc7bGIFZvyedLICOfUtMW\nFCnJYHzbYzDhBhuRp5DQTu42Dpt2G3SasUjPA4TlaO5nyVjQxrLDOKEoKqOI\nKWVD2e75TO+KG64oeNNBlk5TLa/jtv2baJ+fadb/DfINMq/fcSA7tvF04UUj\nja7soDpnCNNd1awN0iNnx41EKecr8XynSBSR60QxRfp1Q9o9qEK5nV7ggIKc\nmOQN\r\n=CSMC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMSR5nnVjynzVvcKd+3uIOTh9NY92KWfT32FfVUVHbNAiEAttAWGJk4HJh08iRVFkUEonGwH1Nj8ETQ5RSjk0GOt78="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.1_1590095128108_0.39802477058558616"},"_hasShrinkwrap":false},"3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b38b558f07ee5d39049e14198a4b5a1ba05a6acb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f+BwlSNMxkGbyh+5bjC+BKHrQp0YWfyV4TeJjMr67OCPGWL18yNoQfDNP4L8VLBSVJ0dZF077rq3WgiOGZeLYg==","shasum":"82eb1a8e538bd02dea9786985aa85d84833567d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0.tgz","fileCount":39,"unpackedSize":166310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexu0eCRA9TVsSAnZWagAA6LsP/2T+G7L1DucreyVfXL94\nO5sVThjoOiP44afIfDphCygPzXtlqCfze3QMYClZ2ezLnQuYZxIQHJysPlnR\n7NOL3enBRaCV0nBdTHlydpC/7DFFOkOXG+AsYcghpEX1ef3y+t1h68YeWYoH\n9VPB6MWjgElTRUR1AXP4ZNt6LpfAd/SdFxfzsMT66YCR16eqRgJLe/mUHxse\nYE994uUvEVMLrgQ1ZwfbdF2uS7fWd37pbEcRVMBh2wwFsXf0ILIhGyflJ045\n/EagSVk11KRFgjaVElpWPfqxWsjRY3W2QSnvJzcCtLNFqSEfizeOAkzXVH9y\nO/M7yQ28MtVa5297Du/QfVxMQS/BdvOLCKMODGbc0EmWJ47DsDksNnipYhlI\nzuuuZnxccyqW8fj4yuozZw2ZO7xbWP7OOw0d0FpMrHqHl7F348/NG5yR1vWA\nzoXNr5QzfM6ZypY/r8vV86lB83vYTztYQe6GEurw0wWhACmaq71mAnDapPzq\n3e+5vzoe4hpYqcxg9mtyc474s651sDlq3CVlCbZqPlNdgrgUTH+Hb2xapFKe\nQKurLj6ThWvB/Toi/pJyCHvh3zzyMD8zyj1AI2P/vexQXmzD/irjJ9BeULvj\nMgiSza2xJ/ghoaPHY4GkGaqaJh3bIiPa7/Q8v+4rmziQ6h8lXfyhlM1vrlDc\noXJF\r\n=dzQA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSuy8HENxRRbN4AVIQT7Lo8hg2InNqQH/pjzStFqqF/wIgHqZ5S5U+3B+VyKP+UvN4o94Rfj4xp6g+e4GiflJBYEk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0_1590095134419_0.21904748140958685"},"_hasShrinkwrap":false},"3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"069698fb926dc4dc149d1938cba24748c930659e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9fG8hloyPecoL8Ld1cOwKY63dNZT1Sn7QWngz7oSOsrPUUePw0HppJqBtAgh6sW9lDp90byAJBgzgzUPEc6VrQ==","shasum":"6db79e4dcd6ff7e68319bfba08bbdc3e99e7a288","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0.tgz","fileCount":39,"unpackedSize":166589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexu1RCRA9TVsSAnZWagAAwPEQAKQHUUBgGk6bWRLMt+qo\nR+/vJ2StGMbxKjyT0f7HWtJFyQfZL+7CF/t5KMJTc95FjTjWBfUa6OeYaCnO\nCMeuiimobF0TbROgDhwRMYa+4rGbBYEA35Bt5oAFM+44KD2tLPXwMNuYFk7Y\nBmrZEXfJEQgDOiF8Ze0+dYYuIB6K4+Rr9dui8u+cCjwMM04ZgdD1an9f50o1\nlh9jJDSalP9E78C90IQ/rwtDN3bJR4NMLgFnA72UU+l4koSRY9t5mIX48R3B\nLxkOiJcpid7XdR43XvUif/VA60F03rsp7fqVPWAtEZapAkDdl5ojI1kXjsVJ\ns0M9+rEiM/bLVFCTuWK2SYDcESiapBW12T8Tuw2iy2tGewtAktVqK5B5cekg\nFqOH2GLTYuhVA3YebF0aikrHK0+MoEEIBzkluSPzjm8MTEfHtVfetBlONt/g\n/5M4TIPKaylC9qwDZiTuilAHj3lT001DzgXaf6VvaOJ2zcXVph6cDAZwRhSJ\nCIanlgdbbqHw90cM6rdWr+iheljx9SHXDPjT6OPZCj64xLP/MWJHr0AZX/Ym\neCkdKtrkExuSuTmYJyC7JWvjjcWGyvZHDpoJj0629i/Ip71mw9IBPlvyR2BM\nr0NbdORaakHz70woGle7/BwQS8YoXsuFm5mFxdR1q+VlWyuQDh/VOEKirkG1\nuGou\r\n=KN4y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/pnbbGE5f8rVXPJf92iJiNA+crujRGs3JuEL9QYHOuAIhALq4uQhvATnpAdYKr6yUnIylXQxFuN0pqrRcSSpouiay"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0_1590095185324_0.48398489287810564"},"_hasShrinkwrap":false},"3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0","gitHead":"6563eec5080a83da42866c6a22e635b275ea025a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8Wr6hmYbSFbbF2jI1fFIZR7lEAr/OJO9nOSfC49YD0uGDYEPTTwuuZVj7hmNa/uFDiTkg1m+e7RBLWvLKdXz/w==","shasum":"617066a249bf5ef632ba68abea1571c76bf5a7f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0.tgz","fileCount":39,"unpackedSize":166589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6noCRA9TVsSAnZWagAACqkP/39kMbp6GaH2BLDVfvpE\nGAm5UzHHrypdpuhHF3L1GZ4XFKWJl1cnV2RIFBqHxzc/MD4XZpKOLzYS2wcN\n7wAjJSLEgkB861X7csOKgDiie6/kEknTuIh7sG1BuktOe1tJiUH77G+nI44O\nZToHKsY06+V9uly0tdfocr3Y1EhBkCiwQDmJV6caCzQoENE744+GAREyxazL\ndfqxdik+/iy5E9XeFUxexgPheX2aVPQLTMmZbD1uscPDQ5/FG9RALSdOe9mk\nn2yj55yHsMeh+PePvBVvi91V/XS5kNukRazS72ksT1p+CU8OjdR5cfuA5aUT\neZiY12FpbV42GgnHNfqCIdLS1b7goXFEGi1hm3LW6ZEj0bNoOH/Kl/80YfPB\nGUtXnfaAfTDTFntPv+TpgJUoq55nMG6zP5SIEG3jT5ZfMu1tpAd7EBxv3x19\n5xPeRacvT4lBscNoqsrhbZC6do5hqSG1PavfKF/IVUGtcmsLPMZSr2NzTPjy\nlRk4zuZ7zXRwarH23TvqEmbJPnqLrxXhE17MsG419ZtqPDv2zWuzJ2l52hF4\nJoqMC9+3A63tw6BbWgMRSreI/lpuEVil4x/2o54L3a0OrvfdrOvloRABUdnL\n5oQI2x1L566zZoZC3kgPHPuVpm6l+xN8fOP8gtkkZWWRps8KqCenrlflIiu5\nmrXm\r\n=ta1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQe5Uba5iU9QUAR3SReTJqZxCA+m9DYfd6GJoXea/wJAiAqGxkAazCl5RT40ydHrLlXsuUono7k2lDYoOsFvoR5BA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0_1590143463954_0.08553611004760264"},"_hasShrinkwrap":false},"3.1.2-036b74ee870a314122fe32d1c910480c216101db.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.4","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2-036b74ee870a314122fe32d1c910480c216101db.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"036b74ee870a314122fe32d1c910480c216101db","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2-036b74ee870a314122fe32d1c910480c216101db.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-i0JuS2VaMztkTiH9Z6nYbfn376Wump+5WdSjCMm3aJooAw/PIS1Gh0DI1n+tDdJWCdPywGJfaQP61FT1FuoFjw==","shasum":"f5aec0c1e4b9c1507d6b36af435bd66bea061f69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2-036b74ee870a314122fe32d1c910480c216101db.0.tgz","fileCount":39,"unpackedSize":166589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6pDCRA9TVsSAnZWagAAhYkP/1h27+lO5LJZr4dSCIj1\nctXj5F91nc7Lh6inHkylbRUA8aAEKvHleN0+Lngf9Y+rJZj3+k4aK4brRqp6\nxsb/5MbGVSJqQRXIolKBGfoSqWg9jCwE9bYmg6Psb4ZqxYmq1U+UlbIK1foO\nthAy4Dm7yc0QcCirBmYPB1DqbKesiVO+C8t5Wwam3uIhzwJG/cHqXdOBE8EH\n+m2X0GRR/0n0Fu+QAUX6qIlutt8t2qK0nqh0B9boV0qdVhe48Fy8mJVaIS51\nD+m0ke3DLe1BoUv+RZip3NK6EXP8z3OzmcCvUnwuK54nootfutXE9liLLIMn\nj88Yun2ZOd22K3/lFfez7EAVq6MEkxnYBuJCYIG08qp4QLuAhM6hP9A/szDd\nGaRIO0eF8CL3iXlsLLlBKfTFLnB+n/4hIHguu463Lvh7ZmJNgdFe3IvhfC2G\nZ2584jfKPKKN2oxU4RBAdyKuwtJ++3sg21tsEtXgaTrKyQ56fysyNhenVOys\n/gCMs+3ukbcbur1xQegtB1KM9FXV1IcrRSJo9s8F7IRpjbZ8cyHlkkPimS27\nA8n3YMC91mIaRxHMnj439IgZlczBQ5V5AYH33OTWnqOU7QhyILgdxXtrHzYK\nLrVBxIfnoavQaZKEI7nX+Py58766uPkVnUUWN9N7x21Vzzco0JN+ZmgLKAfS\nCPAe\r\n=aaBy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMRoESMjDJmFSavcY0SJx1V3PWXu2Qx4BeHXhV6W1PgAiEAwQRmXHH/BuMlXMSytNE9kQfBv1jeMQc041Yog40wPUI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2-036b74ee870a314122fe32d1c910480c216101db.0_1590143555065_0.6637267243226028"},"_hasShrinkwrap":false},"3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.40","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0","gitHead":"a63b3fef5726dfe6ef7dd202f5088b21036ce740","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rjMypjGUTVUUGh75WUAfICY/fM9alJtt78q5k2B46+5StGjVFzkbQdmfz2T62j2vzgX30AuIENWnXne3UjBHdQ==","shasum":"e362b5e2a6233aa08a4ad76cc703e78e6c4d3109","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0.tgz","fileCount":39,"unpackedSize":166589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6pUCRA9TVsSAnZWagAABtUQAIGEPGuYw0RSf7TEGvMm\n9KwbqOSn6Xp0zfoqAGJU1/qTEGrdvQaYUcbKF0r9YmCEMpbOzTTgOICSmWsD\nusy2dbNBP5+Rltb515Tcq45y9CNuHlfTxP//lqrayPwzkDGotX1XE3nz3vjD\n9LogYIBxi/zLxSAN2n9i960NoAHm8OhK+k6w57rugHeFz4iPg7BLY1xMl1rJ\nleVbRLK7bZu0Pf4AWTHrUWT16RhA25e3qcxxGg9WGTTkl/1zZ5C6rsLDiOEd\nxZfmLW14niPSWVEzaZVtyY/TecjM2LK6sCcoHV4v1FWyXI8Oks1iZLYgXWG7\nJ4h9hLE1dMuKwmBKnRHZHBP/OkNGDakqmBOUc62oA9NMdB8AFD4YtEmm1eCh\n6wNnPcXiEaOqQEGAAvMRcjl39BAzUTljEBIwO1sLrJj3PwYEF86/v5ljr8bA\nW0Pyi0dWf7YG+2lY8OahsTOn7J6fJzErSkOQRyxEH4dDiLqWOhf5kMybkfQK\n68j7SUL3u0Wsx47CFK6n/kcTFCCLEoMXRYp1FuCDbbbqO8z9tnReV8CtBPBc\n/fa5dcC5B184YUQmQ3MR5rxExT8kcAog75Fb6XY2LGzeb71fARFIx5vhu81X\n03kazKSASQvdHoW+axwzwtcxAceYD+K4tCUFhUwWodzov8deEefnsY1nCwe1\n8vxQ\r\n=9z4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjbbw4bOXNIAB7SH4LhICcOmEbpathf3Cx9V1wa2tKowIhANzoX+H60dVSEt5JlOOXmfNRJrjBFoTCsUFKGAD8xOMf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0_1590143571700_0.9092125514937328"},"_hasShrinkwrap":false},"3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7171e5a0ddf554e849d9b46f24cbcf5fa5521143","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jcDlNDj54f4U5ZoxUEj+gDFK839stGD7FToj25XyhZknVbFZwH5ryKzf9FFYWHEMga58pUyur//GlRUakr6EwA==","shasum":"37d5e362d95e881a77575abec6d9e2db6c04b4e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0.tgz","fileCount":39,"unpackedSize":166589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6pqCRA9TVsSAnZWagAAep0P/i0kV20xMFP/oRRGkQ2i\nrsE8rsAM9IT/BVKtEydGyV1/962v1TqY2A37T3xfKiLB0anDTVR6dAtbgmt9\ndvVsIIOuKYq/mgae2pIPz4qqtm9Hv39pAvGB8xnLQ51+o/D7vWu5yBazVlsh\nyt8PLQTVa/GU2gmSL4T/Vemkx9NeRJFvED8FFLsZF81GbzfWm3QCd8yIMhQn\n4YAUra49GUuzEIwpOlInJs98QkQWJORhVJYfMSwcidiqVfkuz+oU5dsZ6drm\ncN7o3+xRamj4Dmm7rSWVh6p++Rku4qlY5+KpAWDrUpdh02wPhDQfH1DLqvI7\nnmd4SfS//AI+3VrEkiHO6q9CsRh8Stj37zglgzJam0tDdym54sHAjfuINf0S\nGTZKTtFn+tsyw0oJOwkSZPm9sDefbbIZFhfCZUNskDhbvHF+M9yXweq0FnAp\nxhk7QfvpsT5cjw8PWqaqBER4T/HL47hPZ0NX6ZopwrwCL/ccHSsX53EYi7X9\n4Z6GsmNV1xUYkdEPgW0nJaD7v7dNFaAGuV/lRm8ek8g4nO0hUftP324LDDpq\nrp796afsX094wJWOjyZdR3KpZ8maCuICpAl9psFuLipF9dI6lNeAPEtT/TDt\nvz+UPDni+8KH3sjOKCTD+mVvJ54FGvUtAbgLxVOnVBOWeIK6wb9OF8XOs5Xj\nsUSw\r\n=Ye80\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWF7fTLg5Ox0Vd03H0fkzv3+NAAMBWwEKCD5LF2ofmBgIhALqTPJXnbqUD/z/Rx9gvBZcM8H1s+XLHpZG/nkpRjJTm"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0_1590143593543_0.5762608819417085"},"_hasShrinkwrap":false},"3.1.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.2","gitHead":"1895046c6d567de5243af4e2df9efbddfebbfc1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tzt/v//XxtZ3b2OitcvcXVEIIEAC4pd6nIyl/PstYC6D1bPCGBauy5jSU4GWPVxrRDm1IDVqPQ0K23keKWo69Q==","shasum":"e85fe2f7abc1678c1863316416d268845137e9c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.2.tgz","fileCount":39,"unpackedSize":167004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6p3CRA9TVsSAnZWagAAZFkP/069XPIoJMU+WOUywiTU\n3RHez7rXn6QPo0SXjOBr0mjWTSFlt5pT2k3dx7w0P4gWMOsCvbV+ANcCeSoS\njm+tqQ6OKUp5eDmgJMbAW/IS4XxSnz9LxVEz6aWuG5pCb7K9QY2FlnUwI10j\n62JWkaMsYsFACbzJConPpsyADdyfMqoBXLxASFL8+BB8PKeFQX5ygkt5CCpi\nvPY3IGf0md+fHk1OQdoDUFt0FCrweJ7xDnnTU4fb51eIsbIYnOTKkX4DpVuP\np6mH6dFyfQrYmPGFsWDyJepnAGspRhnwAZkuk8cssXjBpfjeAfw8Ax9eDX32\nVfLEoOgbACe5K/cDP+b/y7VyHP+WGtBRws2vq0zkKr6CLuTELmfUKGTzB6la\nxCCszk5GYL3cxGds2P2VoDbtLW/nZB0RcmnYA3GYBbxPZwfu7ydDLfrkw/q9\nT1hTyUfVNSbHtWFdmqgu84FkGttO5+bYV5/nPV++U1YEwPUKwxl4taILQrAV\nYS5N2Ok6h7doS/fUxkZylFksXbGjocZ/pDnYblraBOpTtXozZTCNFc1uXGu8\n8tZ5RI5toPQ7+j+xezT5jJvj4HywIzpE3N4SNju6x896mRmuM/1DUOx2Rpe9\nBlTfzpYY0ZoYR9J2HWOxVgxK7QwqRGq6W53ZsgHBq1Rm/zbg7Ce5l4cGs778\nuJJn\r\n=UWWL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDKPsPCWp7P46UONr0V0bpekYPMHULFAOV/9NzdWn1LgIhAKhbwHbiRwL8YZmZPlgA6gUnyIlRtLisCsjAgxO0VOzy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.2_1590143606682_0.19663542962044422"},"_hasShrinkwrap":false},"3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1895046c6d567de5243af4e2df9efbddfebbfc1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AYCsxs5Dx7LYIoZx11zsFzUnFE2aYDNNDgsnIHuvlTVe5G90TG9Iq1zvfXFaiN1IRC6VurQ/Pzuf6Z26aJghWw==","shasum":"7bd1d5192bb51bec1011ddbe75a055fae3f90dce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0.tgz","fileCount":39,"unpackedSize":167047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex6qrCRA9TVsSAnZWagAAHuQQAIcP/Iy7tJcJ9Cto7HJL\nWdHe9ArRLhIpRXrlwX20rQ6B3iHMm+su8NCNEbweHhyUnZdxZzc7fG//ClCK\n6UW7iU18PA4pnU+3jOWwPsIRfTCuddSG5gEWmNWHTt1rIYwrw63tQZw6M3z1\nHxhJObQteiPp9c9ZE7dB0XOu7010q6k/6w5fBOCwT95imPHvzRKc7ViX0iIN\nf2ay/jQUomFDkTOAOYD1Wxu5hskBx9Khar8H4UzLILYCO+FnHE1aR9VaLwVW\npmPepTs8GDH56JnqNbdeW03gJEgBXBFSeJGGWdBrZo/7NbTCDPWc88s+xegb\nIDhqD+MQseG8nrfSgWn6HrPXRH3Apk2JedrUUsZJFgemciXmYIEMtpMnnDuS\n5b27wpalEGmlVfdFAI16OImNtyddwtFyK68abWuorEe/JKziMLO7lJ/a65qk\nO4RSgdmK9veEOD2kySPhaGNnCAwuHaIlrQ5UW0ADzHhbfodZeFig4JShSnIH\nigJ55GGprMEQLgn6V+LQIGWDN3uCPCjoegWOlv0AiWG6wO5431f/l1/UjAyL\nUVxwl0aD3lPKI8583eGRNUbPtB9myGrWKmKlb1Tcayoam5GcrQzbI5KVeKdM\nG2WPhoylSxI1Vs40eWrbC6Yy8VQXc/WBqdPTZFtBUx1mPr4HHL4eX7KSvvUr\n6dCW\r\n=Vxqq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7mhJxH+3IsKC2SPRujpP61o61nedS4oBHgVF77TFe6AiA4gX3PlWJ8obGWXg6WW2bDoEaHQsrWy7g1OSLct+VRKg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0_1590143658677_0.4789854015699555"},"_hasShrinkwrap":false},"3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0","gitHead":"2251903324bc68d50da48df59a074f3e57c88162","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yoHTUTvOCyc5Gk6bQixZnaEpw1Tp2oyv1W/QcQLmz0UpMzgCFrIPsWvBnBRm0ClMfvM5hL7M5uybyBFEJ/0t9g==","shasum":"41d9e991659f74b6e8ecf193b0a599e62eb70b3d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0.tgz","fileCount":39,"unpackedSize":169849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey2WBCRA9TVsSAnZWagAAu84QAJIMd0Gpbl7gRDq22her\ndoD7b3XeMSBjah8Fl9n5Ov6vQ5puMMPNuyB8EdS1YbPYbAWXmvoYszR8rWcp\nh+RJ5WC7u0O8yh/eu+CFFDO1V6Lm5K+PXeuWCD81nrYPugjrGS1rD5tnZrDE\nvzcY2Zv99zBOUqBqsLBodl4Pck3qeuUj+1zPJUnHZRG+pb5ESiH9rP8cGz03\nJxglTn4ZgszH1GSSKvSQjZyMV4tZC+8iZg005LhvxQGWG/o1qnsKhhNZH1ap\nUiz9ZgnWNn5pDme8X9JXw4o+QtNDwLVE+j6tPhnlO4iOCw3QHsPWDvXRL1Ru\nIYIBKbt5pOtoxZlGBbMTu6VQ8PDku1ovS1KFeUFgjv8hTwdj+ImlhgV2LljO\n4yxR6F7oZV4to1pHR3PWZW7mxTiqP0w/dq4r5QAFHwTmY6YGHeH6ZcWQPA20\nVT10I1shFRqMjY7Y2wE9h7bHCorF1N82roRmwh667eWF60JXHHp2ALlLDgAF\n3uc6nw921yXRorXGFZrnipF0HxMVY1bnEBhAodvSIG/+Xb7ZoLaZkloPKSqz\nogsWzMlm0bdOCg48ujVBQa2IWMI6J3iXYwkNtumybjAHDvLrAcGuUQbnw4KR\n0rPGEE4OrLeVr3GaDRxiXYupnFb6e6QfY3JETGG6zwy4+MsXuUP9ZJD3uUVU\ntA7M\r\n=Ui0z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5M7G8s1YXDWcLc+BeEXvWRbQFffW1YjvQHLS7Ks1ItwIhAJtzu1bPz5Dm/6sLCPAoy0drc/wWXZOb+fsKwQ1JsnDl"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0_1590388097168_0.8024970766945294"},"_hasShrinkwrap":false},"3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0","gitHead":"85ea16fef7552d7cfa8b1902636908907a4f83aa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ohl7wcJOmCjPjGm0/9M8Mf3enXV7AaMy53cuzOTp8RSWqTyPEqpqTWiKWmE6FLo7rLJ32DyZBGOejoL1/rvxDA==","shasum":"c2d5a772372442b5bdcae7c300147a9145ba06d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0.tgz","fileCount":39,"unpackedSize":170863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey2YFCRA9TVsSAnZWagAAxsAP/jXB5YUNlI/wJM6vgL3c\nSO9OaALI3+fxL0IsPPYVNYQVPiQiOk8jOWSkQihB4+GNmP+i/8NgFP3F5atm\neDhQ1Wml8tC4gu2Xe9oR8AvBQCbNiwE42xdLzN/qVAgPGaL7YUB9Op86UQ83\naXuwxrYiRjsiFQr8e9hvHj62bwwTHLz7ALHUuT0p++eRsFtkiETTJPFW4SrZ\nGtnbS4TH8KQcY8C+C6GkrPpKGfehqP7ckXVrEc55/VwB2GciI+RFFVf7DJaD\nwdn4/xY4Q6JLavXCTnpKwZOlzBfpU+E9fqq9yvbPC4xfC3PIW1pG5wsH+sCS\n6izymS3fh5CSiICMv1CL9fo2myAzrGJID6yTt7g8rbbL/5oKa6kCDHauPR58\n0TJ15SNzfbZhiO7jymbDRr9X4B1oQkxoi1RECzk759zYWU6pf4oa46q2dkjI\n9PaCv95zhPOyRsR/f1eDEqvFDL+uweZlrWIOCSM7QoeO2S1lbuh0Sd6Hg3dT\ne80BnolxO2aNsphXuBpWLHBct2I+6bUmooIVys4/iTm97ysKBg/74t6W7uLU\n33+Zx3hUNw2qdegrwi2TO+3+MbjnfIe0ML4NxnUsTALLvzB6NgEJ4Qp+b6wZ\n0SwbJHarvLDPo8Eg8xsNbs8uRr5En6IGWTG0oyFSkkWcnwFzhLXISSD20Gs7\n3Ad5\r\n=OwvJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVraetwevNFVf0KqQw4F+ngjIpcWOJqnlB8YXPHUEzuAIhAO1U7umMr4tkbnx5+QTzFELKo0O1gvMckzK4Mt+DbLHX"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0_1590388229375_0.9210099116628738"},"_hasShrinkwrap":false},"3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0","gitHead":"2259eea1876534dff478830ebac5a96161a490d3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Sgl3N41nCPZzNT/e3bittM8sxHHlIEhuIhzGQvEdLLGL69j02zfjSoPJ+JqwDxE/qF0uJjIFR5EBgAvFu8eS9A==","shasum":"b06234f7eda621643dfa9be13a218fd102009b02","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0.tgz","fileCount":39,"unpackedSize":170694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey3sVCRA9TVsSAnZWagAAxQ8P/0xMgYohULTxya+aQuYj\n+b7oDjHPU+ullnRdKl4LNP1TYmayQ8IdHllDZgmgXn9vxX6dJjBHgZ2wFsb4\nozkZ2c+Y9htKtCRBAaq6wvaVdo/wj8xDxof9ooC+5jG/yMva2JNBxEZpcl8B\n0/SMgyHKNzakm8ZXeAtlgpfq1MO39qF6XRqHJHfVkkEsjvlYJsxde21s7Drs\ntNzw/X8Khis/fPKr6ZStjvosHoO2UvOMkcReUR19ZVK57vPzmvv0BI1zJ5md\nraiDsEqVMBBSDVWyn3LUenSWGfu0Nn5DZAL9UsT6DRrWm+zNMhNUa4BHmsRD\nJPSSslCXK9GhSpbs/SOZAd/+YYkwH8RRQFbZ6e8lcW44OCYfs9fWeGcXS7dn\nsLIUREHE8pJZ69zt9CwomENJGx/I+v5Ro07znCDJqkt0GKbZ2pQ8ZqutKVJW\nWo0v2e51D8LAVuS1PlBdOhtH/uyVBU5iqAvvyqGZJPZ/jvE1sIjBLA5gmXoT\ncW3va+0Z/3+HXObeFzVvYii8LQDByBTmjHVbFjPSxnqqCn/wMfeuqR7hMtY6\nz3Z0eZSsZza9vTzariQNFHAAhsp19xmGROJ6+EGAoyxGXIjUwEblLKHmIDt7\nfTJEWii1Xy4RroOgq7D71fHxC+SFRv2Pxa4MZAXC0GKu4nSVu/4nfzOqg00u\nKh8l\r\n=z95X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHm0aKRN1gY9Rej2rgyH6CAqSRwpWK4x8VyM9IHtvyxwAiEAzNUP/B+vsffmw51T66MK51iHwFEE3B69Hrn2TExHwcw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0_1590393621107_0.7223003956490603"},"_hasShrinkwrap":false},"3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OIrCYiF9rUQ/KoOuGLQ5k9Eg0lec6r2xzDAfoq9IlieiRJB+Qfp2RzyGvW15YCmVfZnZxRv/RDeLGADPHOjt0Q==","shasum":"b292a9bdc3ee977bca8875ca76df8cacd79f3583","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0.tgz","fileCount":39,"unpackedSize":170694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey3whCRA9TVsSAnZWagAARScP/RWnPX/Ihqnj2kGhfI3Y\ntVTo7ocK+LPlAQescTGoI6SKW4R5f+84ZFqSsThVfc3XgahSJlLXEtQAGLY4\n1bZwEriNeEQtERB8FJHWnG8Cm9YDiE/9VisZuIkJ4M9h4YmSz6RXvO7nkxJi\naG7YdJk9E2QEEKTx0Gdmd3/xcEFU5YwGn53La6chUwXzn7CldpMuWa2ypJMg\nS1I0GB6aUt0+cSAPvCK4GjQoL55j1kx5IcL38foXbX3ES5M6Wu7oSp2XQpES\nDY7bWOMi97FnmwasxPFmrJ5fgcEHtdO21wLBTBpzPBpOWP87iohUSzMocGRa\nCS46YrWUL22OkRQtngqcDovBjFJQgm46Ptj4mvCs6JIQ/gRRXYZJn268v04Q\nVzCWajcWrJZ6dUwHvr4WHxJ5qLaooPz7PQYbsBT5IK+v/XCeje6EDHOhGuyT\nrHz/OludKp+mS2omVmA7LbQ/9x+rQlNJ7VtoDY6P5TUXFpMGUhphdTtFGG1B\nKBxMTDijv8G5JlltfcxXnPxMD1RP9UNCpBB6IA+bPZx6+ynKXZcS5u4qvZ+f\nHvy37ydCPYxO5+mCf2FtmEJArlN2iwZY4Riwz+a7qxfV0n5ThH17Mvss0DNL\nRRP1BEW1aopB1wEzd1SbrzzHXQUKktkGPIHQyQyZhiK1CSJJ2Jd96syMK4Jv\nM3hu\r\n=6+tW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwptiD8QkSbWuFPf5gp+mHZJcj9545JHqWz6tQPEdD2AiEAh1NP0XmuT7ySLhdMj2+rQtT08xFqBSSmpnUoPxtXygU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0_1590393889143_0.7486715635946566"},"_hasShrinkwrap":false},"3.2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.0","gitHead":"85d5404762c29c1553e496b22eb2c8ba3455876b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UNZzzatUSabuVvEAl7r37EfDrU3rpL5zIwLJdUMx/toJq0AgoBoeFuehiPJ/oHd0dzesjvva0HDrwDIb7dTQAg==","shasum":"13abc52d88ab1ea5aae2878875188ca266f18609","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.0.tgz","fileCount":39,"unpackedSize":170928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey3wzCRA9TVsSAnZWagAAkOgP/2oNCj8oVIw1bDncvbmO\nEeX2fLen62V3y3NCidYF0CHVGrcWKfZSEF0T03ctuGhUTXN1uyiN+MYf7r50\nj9zFzt/jASta6EiLYj3cmgnJhGLS+JzDRCC4qK6tABMvtOVWNQoUDh7iM4La\nk6a9DkHxoklmKyBMXoKAUwiyRRvMeE/Lc+2IZYsHIGrvmjrzaA/f8AcGh4w+\nrJeN75PUQBwBLDcejVmnl5iVI9v+YqedRvLPFrmRQZzdgdrOZK02VsF9nJuw\nSG1gYunGla+k9CzpAu7xAOtBvCOuwa/br0erMRLhHgSdkPXkGnL40odRvGy7\ny5lqHM5VeDO0ho2joLWAAX8pMX2hQ/agQrOQiJirp+0zVZ1kGVh/Ok9gzvoG\nt/d7o+sxS4tFOltJCmcFhzJWSnF6/BNbBBJzPbWQ8GIxHOKGcRSVwu/KmuXZ\nqua47XnEBqOcr7CgILbTXK5sycc/1iMBe9swZoVYkyfVNGhRPqT/InqB9vrc\nUVkvxIv6i4zk2ymyAhoBG73Wufq4Mgct5iS1ZiJq555C0QKy+CUhm5xJJ4Cw\nM3MALa1G0x5l6ixSFlEA4QUOvFGQtGdfLCLpvzwGmk/HTT4Io0X/Uj7ZOVqj\npgVnGYZXLuyrRV0rxTGwmWf/OaDTkJv2yIHK1QICm30sruQRvDklML5hyc5W\naYY1\r\n=TQpO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIHYvcsK4FzQxAtayQuaJR+JBVEsgs2WHZ+QLsl7eqrAiEAs1VpkCb9ttDVvb5gVUAl9vVo6txfVk5ZkjfKdgwGCM0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.0_1590393907089_0.597057692268131"},"_hasShrinkwrap":false},"3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"85d5404762c29c1553e496b22eb2c8ba3455876b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-I/sTSQZu5d1LolIsJlQzmkgOqFSvBrzZz2OvKT/hphSjjVXkHX8frKEe4teHAXalyUuU+LPTSBGifuxtp0HEFw==","shasum":"5cda4fb33a4ff342ff10aaa66f4ed00581994e40","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0.tgz","fileCount":39,"unpackedSize":170971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey3x1CRA9TVsSAnZWagAAEX4P/RXdikdQpVUxbjHS5BCn\nw51A/kuEBs4ZhVqrOggxgcwBLpUnwyEGxiRj2CaIeiY4vgyIGKqaZo/k4gEM\nHdNV9DAkmSjUsii132lOgZJDUSUSAmqrajf1cdzzHoa1atEPVTOqZESbHPfN\nH3Xm8+wmt+J2sBIlwdZkImcP6X91xkIp1BuV1NcWUjc8O3WyUk55WpCN4T6+\ne7/RZPCnGj/VxJcxUHnzoXn9iOJ56UYxjAiElbcbEwQVUWofjCYtSW0Kh3jV\nBdq23Z+pQXPQHdksN6TKsKPO5L68Wy58pBBlx5JtqEjj53SNIZj93dTqeF29\nVi1vnf0gLNiQU4p7DzpqhL3XoNiD6f3QEHtQNX2ibMdK1yZ/FpIsUW9Ne0Gh\nekf7urXeqqZXhuSQi1Y63pI4C48jj7VIJ/6t5TPGyEqP6zUYw1vRlVeyhNyi\ntwLwtdLNtymFSAjsOYyhc2hZtZPzLqPuIu3nr6op9pY8/O2E2iWcXzLw1uwn\nCR3fadt6TXrPrdnBQkbYjZk6LModvnHtg05EmmOj1BLtK1I4BBn+/GRu3dTM\nSxlvf8f4vToa+E1cFGEKmbT7WxF0yv8CRsreGzIVZ5Hbj+SC/WAFQ2vlDp3Y\nHbGsRH6+ID0pN02+V4H6z/KLSIM9Q5nY7k4UcPXo7T1iyNeInI9ueo2lqMYm\nMO5/\r\n=uSHH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTglH+CHuwPglMf+kIdr9QkMwtD73rjmtMKsI/BrrATQIgDw/9j1J1oBZCfCS5LtCZ3qM6XruKqoqg+3M98uM7rdw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0_1590393973105_0.9628106468011008"},"_hasShrinkwrap":false},"3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0","gitHead":"aea34863eb542e9eb9974610cac9a9fe4b1716da","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-B3KGFsPMGSIspvdUWFX36gIivXecZrja0j97Yy2s+nSDiDg4D/BWMGkOtZTYk0WaWVXc7r/x33N6JqP56KAVXQ==","shasum":"6e5bef0ad3a76d17318074060ac54f0b472143e7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0.tgz","fileCount":39,"unpackedSize":173579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey4vECRA9TVsSAnZWagAAdgkQAJejR780ZEBzFmVUh9+G\n7GZ4gJ37s5jspSEQJvzcQTk5nMZiuhhPQE7UCjwxvvnzQlgVn/cWd+FxV3+x\nE+e3WibFp/CGfd9Z/pSg12cv7Cg3s8t0bazpXx3PP+Fnn1SgJcBxaO4FJRSe\nohpy+KtX8Ok762pa+81JEFX34iFUmDNKO/719h2bVqdZE0elLjF7hbgke8DN\n2moRMWKf4CN/cZgqLKEDF/zSpKEEgXncNVMNAz7fmp1nYFrhWrpAX6vG72am\nwB4xo6i2UKfcyf//DmPIOp17ZnfmGRbNlEXe8ev7NCbmQNUn6gWL2AK9m7je\nHxEJpqKLnfQ1avCqXqobpXQPJlmQ9T5vJO74BzbGypUE/ndE6h3ZfSbpuKeL\n+swFeL4OSbnf7hpyvBSajkLFQ6bgh0Q5Gg26l5W58VfCwNUcblu6NjYlrYyE\n3ztmkMFa2jDr2xphEBkpsouYLW9C1m08C0u7vv9gO5XWYgApwQNOuRctcBQ+\nWP2M3nBa+tTB2yORoYyDNNQFe4EwhTqbRd6lMrkG91w/vgr8pkoMYp/h0DRJ\nsgWbzDgz3+mlU7i6TKxqbPAfyZ7Fzdw0d9vRCS/0HC3gDYcVCEMh0Ur8kv9q\nbT22xj9B8PpyrUm8m+98yvsl3HlZfrk3MeHUTnPtuiSFF3zOSjhKC9WYYfpF\ni14u\r\n=7cwI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZY0qRRe+vdEJjc8lUQnLk2Xm093XirAF+2YaACd/43AiARwrChxPdShGEdamIM2VMKSZr0lC7gGluTRBgWKM/EBw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0_1590397892064_0.3745702069455987"},"_hasShrinkwrap":false},"3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0","gitHead":"60fd30d35cec04533458d68f1e479889e5bf9556","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KSoo+FjIF+tuA5b0Ky+dzG9sZ4cfJSf7RsMAXXU1xUoVBSCsh2KOPTbIs+QMRfkGVWvEoFMGLGknk1ULygOilA==","shasum":"cf8d51b7ec1045a1b026581484337a0a41f4e8e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0.tgz","fileCount":39,"unpackedSize":174290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOTyCRA9TVsSAnZWagAANVAP/ixLBMxMS4cjMvCqGyBB\n9dBsYhA6ztBecPLGACX+3O+iDC8m0E3zdZCvPaPB2ilSVszPG875IkjfPI42\nVhZQFzx8VE7V9fcM5W8OHMqjpnAd0GywSo7H+Fg7+WwaqcYzVeODG/O9kqJp\n3vRj/OGSEwwpg016eUr4CMRQh52u5L64RsiH4mLUs+aFocL6gxhahq8IBDG2\nQPtGqlW0ODZeTortvFwzuvleHh75dXILapibl8VV0MNnF0L3Y5IFAUxVqkaJ\njuSoo2dhgN0gcST50A/NAJ26P1SropVGTvhjqMQKXevv75u+RsceXtZczKyP\nOeaPVkW/dP/FSKBTbtGtXxFSpM8olKnK/7cPFWeZS8zfo9OJ/e4ArYCg+Xxi\nR3Y2sPSD1Hwpjybk59wnq7OxZ6TlON35dRXcun2eYjceLGb7EsQzkWzU9O6I\nR9z0OS2pGUfx6nD7eZfr6TyiAIDE0QYy8HmqXHs3psOxhPkp803nn5GBOPVO\ntx9ESlALSQe62G3okO+44IqYZUPm5PqzMQfnTpxoCVtDIgyxg/btQ1eyn+1o\n2wZJpP8DRgyoGlWKQWR0QKN/S5tQgITIykntpeYnZA98fLlPKlG/oxq/m+pp\n0EzB66ycJX+vobgOEXdK1Uf5BRyVKZGM0qIUhAqVzunrmMqRuF2g37D3LZXq\nvvQC\r\n=ficY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmSbfU16wHBg64otykvP9t2A6dKe2j3EOjiC8edwPTZAiEAqjeAlHFpYcTcW7s4sL0CjLGQq2HEXxScAhcYYm1QaqY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0_1590486258282_0.30319935560774414"},"_hasShrinkwrap":false},"3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0","gitHead":"f3233bd9885126a7509b607c7f0a1a200074e7b7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f6EK+eEWD5zePA+PCSXJAHeAymIu5xZzu0eDgD6JD1jix54IeUPnpccqhjIRkG03oEDPbMhYUWz+2uaFX2FDag==","shasum":"1e9842be4bebe07dd30fc2268291bbb0ca3adf00","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0.tgz","fileCount":39,"unpackedSize":174292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOp4CRA9TVsSAnZWagAAoRwQAImeZKVkalolwD9+EdRT\n0Os7eNoRLCs73JpK/mgJyBirCzwmKBVsn7clTHKR3tJn7lKDf1hrmGcPPRYK\nsDSZ6Tse0W1d31NAC/DdyTgWA6I4+8FhKhIlnFh05PXnJO7sue309Axn4Kfq\n6XPEhNH9BgpljGTh9lmNbbFiVc8ZRj7tz4fpU1dtzjJm+WhZFfslCssD+lRc\nRZrU0w+uIuQomaZlX0UQ2/oBebB+/1k//u070XCEWraRptS2Je7Z2cdpvNLf\nD867aH8mRZMPsjg3GqvFtE8BWAL0Wi0tCdmGnS9lCFBLhsotg02QzYhZZvp5\npxsy++RQDM4qDxHbWvvAKfr+OAUDpwp5Sq5shKcGjPcyHSijYx325DXCeiuC\nE5HdpqBpenkeGtXvYpdpG8V5obpAZd7Is30+XiwcIBqxk+iRB9xElVfOlB/r\nqGXRuEikkwJcx2fWXpfbJ0lMupC0LR3uHl8fAZ0/rAhJhQfP8CMeDwai1qvR\nvuWUGRGWv1NaPKb30K3T0P8fuM93kbtLpjlfxMUtH60uR47qP5tSkNR5X3rJ\nYs81EhOXwMLDKZ0PW6AQyA3GWj2Ixt63KlrG9EG6Tc9L1+qcaBwj3AwCIIJ1\nH/WEHBczctY+eC9iGkNT3sMlVHgHhsw4zruiy4UwVUxvPETu7tmqVWUJ/LO+\nJIub\r\n=FBGS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7CNdULS5bjVcWwoIjh/PQ0curhKatXfcc8xIxT4syDAiEAilyCr0vtJnmWFIMTU5cRs6knqLZp9wpt1psKtdpxWm8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0_1590487672193_0.8709914407650154"},"_hasShrinkwrap":false},"3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0e5e361a449f133754ee3d6bf9c75f7fda2bf634","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ih9O/4WdrkfJ0hFxvQnK+N8yWN9h+puZ+80COpkPiRvtN9m2ks/knJxeRXIppJKeyKp5SzoiTYsE6yyAg0xCQQ==","shasum":"d22eed0c4de2ad59b33e54e97450831030519add","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0.tgz","fileCount":39,"unpackedSize":174292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOsCCRA9TVsSAnZWagAA8WMP/RzMLfWK5YGVmdybc9X+\ndgIhxPCnGymFY0eT3ZGdVYotXhr/qBfb72MmeV035HG3d4h/fgjOXosg58j0\naSpwYgPbuqbB85XsLN5PHYH4EBXvT7P6EDOxgd/OZA2NWQ6T/d/oqRaXEivS\nLzuX0VeqMgIaWk47BIts4VMonAUwDSw/nlPuPxbEKcf0IVaSFFGrWn5Gqjbz\no8krZs7WKu4QEyZ4e4SEHm7fsnsGKcXtuJPBU6chQa+38bPlC8hYpvNK+6LI\nZwSVw7vgHAnf2xLhmEf9bGdVHGPng81P7yKXzQDcy5PrkmBPF/x2FOBqa74t\niFgpOP8b1d7Nv8jpV1ox7nUGADbITHhflsFnyQvFUP7Sj7rWY8enxy5PYmJT\nP3UOnjdMnXEkPToO5pq3YL0tjaXG3rrTlAXO1DVVDocEcdlejqvsjIpVLYh1\nJJ0LfO2nbtojw0ii9ia+r99T27mw0bftbPj2MBiTz8LAfTy7OT5eRUnNpZ/4\n7yK1bvVGBmm6OpV1hy4IA+HqxeFwsNxTZBVsfddFR4O4UgEaGiuJuBMVtUsR\nmU/F540ueHRWRsRUcscvFTeDsy9yrJepLWzZtasoD067LqHJ43Kpp88VrjLC\nCe3EA5a2e796Mlx/F1uuFHPVakftgbGx0AOWJ2ZJICxtqczIcacifRzcaVjO\nofe+\r\n=ZyO5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiqY73UrlBNz34QHH3OqZsT7lHTkkWPUD8RRBUlEqpJAIgRg+s7Aq59Gv/Bbgsg/f9QDq5n7lHXWmmAoEgFjlDG/Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0_1590487810290_0.6851914393084486"},"_hasShrinkwrap":false},"3.3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.0","gitHead":"f2f1b821295a65be14b4659b40024b91d6353875","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Grgahxt4mOklJE13aXJ8WFHk0rHrCdQDkGhsgHwXfsodAg3uN4LaWjONbWMkMF5vd/HYJWDoLrYFolLYMoUEWw==","shasum":"653f6f150a380846729a13b9e0c8ffc90e2939a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.0.tgz","fileCount":39,"unpackedSize":174513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOsSCRA9TVsSAnZWagAAFRAQAKT9JtpHUPANzFJdICgO\n5aqRAFUg3OHQBDFCewH5O2pXxeT8mECQCuMq3mSKctLz6p3D5O2NA67hBYO/\nVT1BeiOEaQ7XLKZPaFlOD96rEIUHavhDzg8GfLjmtUGyTfAR5AEKaFC/A/wm\n2gRL91H29ly5fEJLVJWwKsWK0N7GLp1zU24O13XfK3DkBxa8i8+6kN9H1mj4\nRf5kXLmuOODc/j4+ENLriAExUv/Z2f0qvm5kKn3NrysKWRzEvikwJkjSCh52\nsxWlqKv13JUcYdYmKVNi+KdYPjycAtrOZZxSsBUzW/O9Vp9q/2UzPvc1Lg6+\nlEEOLkT6mIfwyxk8m4CxHrVMoSS2SSGhVfXAd1VKIub5D8jc2XyRBniHBA/o\nvwxz9LbkWUdlDwN1rPxyq5KvtdJrqVUj25DPESmYAQjgTNwcE7txOOIFSOFn\nf6mLBzo46R/ZrthF2xy1+7zrS7BCyNR7qUCmLgNL4nm0UqALRDuuZFG1M0Lu\nU3xVO2iSa//9jrCrquRaov0X3GfukGnU4vDZsYyfkRTbl7rEe5XBxnK67Z+A\nvwL0ZFQoCPBbC24pfMw/3vlUcn1MKEgHTpjU3WMJJRGO0nHsLN85Uu0Jg7zm\nfKgS8UHlIaNKUnQY8QRJSgcAiTKgb97aMqVw5R+0wSFAJG5FdKuQF4Ipl+J8\nftr5\r\n=kyY5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDU9msD7bPnRNrv0AbZ8VHHD2Ihl13LEv7ejIOJK1LkzAiEAwFXjEbXJ56HRkQ8dBBIsYgPpUVdx5rjvqR185mdRMHU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.0_1590487826148_0.4194083383301699"},"_hasShrinkwrap":false},"3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f2f1b821295a65be14b4659b40024b91d6353875","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HELmRixwTXDDFgMTNY90eIduz44HRwMRrf/cozx+po2drQIoJhCL1j0RNY6HM5ByaNtHGtKjWVr7+M5z6aAlQA==","shasum":"eb8bdbf1e02287b82b662c7007e08c878939913e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0.tgz","fileCount":39,"unpackedSize":174556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezOtWCRA9TVsSAnZWagAAPIwQAIC67cWA8RKePXrWP1AW\naSsE+j9o2WTbMgdnHeBH26qtyroBSHC0F2cVVoda6DqLtSCCIH5CBKGZFC0P\nWy3DTcmUPTiNuhDuO5W3orVNoMsVPomw9wfB79QqbJH6EUR2KaegcV+36nES\noTsdgstEzvpNupklpy6apB756Q9JHaxTx7jo3SwGiUeBhoCDemXD+SJTIBmu\nCHPZB+Jv7+DBpESThtMQrGXYGATg3bk0ygY3fuL4V4KV+rZxNPSOpGJLA5+S\n7kvOrNY9PmUMtitqmgI3QBGkg//BTX8lrr/VuA0niD0dXorSwaEl5IIr3olR\n8aRXIbms9h85G6kcUZpof1pArvTylCgpyCtgRt1Qls6QQEs0tgl7LQYHg4D+\nLnnf0QcyB29JP2FWKDDUyU8sCXARNFQXjlIFdlKcMhKovAPFeauEiMSk3Q7r\nVsKK1BpdvT4fVsUvdE6akaeEI+Oasq87Jjzwm+8/UXtjsLvKXySaKCWSOoDy\n3x/lwj3adw1DK6757/4URcY+4Xa39SnwnY4ncgzys2W+itJDS8pwL3hBvNep\njIl/34mYCjOx0fCiZgxGUsUPeJuNkh1OxV9e2OaAoGDh1CbH9ywAFZspWZZx\nP4sGKO0k1JZgQCQ5JYUzJDXFXm8D+hOzJ3c2KfkZ0cUO1I7MVSzV+qiKrv9c\nh7FD\r\n=yA6t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKJ9QUNXhYdGPGbWHokdAcaMFmEqWupOPNKLxsSDf0JAiAnVoPBY/Q0ktxeVaZ6kHBAtAWUmMPUqp+q9WiPEUcK+A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0_1590487893214_0.4992283025061941"},"_hasShrinkwrap":false},"3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0","gitHead":"b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tjeLrFwMNrX751LrLsijkqRqR+naKJJcX6gSGHqdklv+v9XgrYeojCv16HGYLNRUdaGqjVF+fJlpUr3Oc1VeUg==","shasum":"6b08d7b5fddf779c41cb0127236d239954f21194","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0.tgz","fileCount":39,"unpackedSize":175769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezjbWCRA9TVsSAnZWagAABKUQAIw+vT8fKGEbr8UNyyfA\namxrikcvw29RS7B8zzNaC4rsvuH/8NuhPDwlMzs5cMzW5eWoEHebq2iXE2cJ\nd0hhYPgAbm9jQ65QJw8gHX4zUFYllZBaH7egY4/x+AQsk4GSw7Mz8w1AgaHs\nw8n6jbB51NjygtShisAobCOa7x6zoWplO2JB8HQoGKYX3JoM0DR4YhSXXwMe\nxToIHhuEVI04q4iZBWJaAGi1DRSOTcwVXgvsTzx7tKcvsKmiUy6oxUFLC+2s\nwoiYJpEk2Itz06ev3kQ2UgY7Qp5/5OGbnd/IHkTWKtg4UaUxGZTXoiU9QBij\nLUbTFDlgenx1Z2mX0Xg0GYYW/jN3cER2zX1STU98LxDPni04kkFkROUXvJwZ\nK1U9IFNgG477awRwlh1CensZ8cktwjjN11PeOj3qdnBqd8spDv/252FCX4vd\nW+h9HG7myDVUbe143sKIXYqEbGstA6iMvsI3muLDA18x8CBQWIPhGO8KcekD\nB6KlhjjlVYrDAr21ZJ5gpTyVZnatB74m1OAklQ6wSg9P0+r+WWwQ2XqkHAnf\nH1tfpkvihBEFRzAOyn2Tre7fhkGiVIDWZQKqdiYRqLgpF9HdO1IsZ/KZgCR6\nKdMPl7JjS4hW2Rf1LGG6S98lo01JltKijEOlZUlTrtePo99tG/G4+8KYtEkn\nB6EI\r\n=7l6M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgmQrt0DjErNCOSlhIrp2iy/LQIBwf8iA+kO8n0vkjjQIgWxMJnwrzL+7ww7Wm20sK175I7L1X5/GM1r4XRCv5p10="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0_1590572757976_0.22034485664376424"},"_hasShrinkwrap":false},"3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0","gitHead":"e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xuEgm14XMC76THe/B6IDOJdQlOiah9PiOJw4lFptG7kCnc2ih58qd0WgVuH1GE/leodofqV6tpG/nQEEqbhlLw==","shasum":"06ab32d2e8d4f943e58cc7ecc9600cea91b9d619","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0.tgz","fileCount":39,"unpackedSize":173485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezmnDCRA9TVsSAnZWagAAa9kQAIWiN/dTkD+7Up8Em4ir\nurByzW1SxneC9GLStwb6iIy89To4leUAKhTTtz9aFL45ZYOg1QGF4t+vFxzM\nlbGIn1dDdf1hejm7weCOBtWP+UGa3mBD773ruSFzWSj7U6crxZKsn9KErrvw\n0ds7beFUPruqzEvK4+jpkmLzzb71kQV4buwU2lEA3Sv6kQG8P6MM8E5bbNDk\nwdWUSjoy8TISUcRpFWUC9Rcy1xu2U+7Yj6n2rADrFrxHa0fJR/PGnFi+0mhS\nnLZ01Xq7DMkjmW80oinXB4WQkGUdbb89rPnoMK1KHM9LKfgim1Y1GJDfwDOV\nzLOQkqGB+tmt6G5vcrJz+vr5ncuZzvexuF818TDHcN8G0/7MUGa2zPg7emHR\n1mim2TJGzEtoSfJlaaYLJUBebVYrP0rAT3ezc87kO/k6e6zlr3VC+B7zwNz+\naUMqfgl5duQ3NkHx9RFk5c4kjUnU6lFEQVQMqRcB0zKt5G8SPaAfHpOPDAoY\nw2PKpOcaq1TeCE3isnt9xWRjRFxsnmRKareWFwEgyuORBxXiAe0mF5xyzu3w\nFdfFTEkTwdizpE2E33vvPdGirTOFtQB4UqBHCj+/VPM0SIkweIWkfx57TqKo\ngahUnQE+AUknmxKMCmQegYpHshhIBwDMa/kRu3o5CZhRqZDmflRn1nhrvemp\nGkLv\r\n=HUZO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOfOxe5JqSbUi63cRJJGqGXH8nR6y7wRXS/3aBI3LkHwIhAJsw7Ho9FvbU8qr5Nx+9dpNVYDkeQ4+94HvPH/8Lyd+u"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0_1590585795179_0.029794767664952593"},"_hasShrinkwrap":false},"3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0","gitHead":"c640eef375b06e18f1c7945d8068a74b070c0788","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-olk2WO97EnsGxGmcfVQInbe7Xcu2JKiNBT7SvoQ6zOJRtT/l5KbNU0zOh65RxsKCNddnz+Dr9/D4hIQ9eA/4Zw==","shasum":"bb4c0abf8f26b897d1b35a2c19a48cf5c9dd3c20","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0.tgz","fileCount":39,"unpackedSize":173477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznFsCRA9TVsSAnZWagAA26kP/3omNNpoZO0iiEQRjhyS\n52NsLC6XNFCe29briVUgHWdYSeOHZz3WAoypd9yk98yJOjbNClOynl0+l4Ok\nQ2Fr0g5XpEtOR69jzRPLbwYhn4PMOA9AcqdHoiG/mp6QMjs0DWIg554jt1oa\nL4xVgmFzK27bh0hMVTOW5TbbaIIDwTRZ/QCMtI6CNLJGPjgprYTdoXZZZkqM\n4lGlYJp4KZ8m8PQJPw6wsFnSRqb9Yg6YXE96eDIuZr0O2Sm5pzmFnAVWorCO\nNuLVZl3fZsV4QyZbld2xNy+fz1eyKwhExx2yTiGeqQlAmkbmlE/8l+vELe/o\nLrAbQz5D7TlsOtmUSlPTRpSBp6ZWYZfuHVAOHfxpKJGPilWQ6Jy+5cvKWavX\n+9F1e1dyzUfv6XUkyhD6BxPvGLu905CGj/aMeNa2ofI7D8V0f/DSqeYkdqon\n7epZw9ekZmALt08a/+PlN0eW/nLu+rXTp0ddi9q42RQ4OQ7g7+fCIqlIB8YU\nOqwkDR9JkkbBHwR78VMO98KEAc4/NpnFb4Ka5g341iooDclB5GMYq8JmMK4E\nLChJGbw/LtsVqiSV47riWA/WlzTOvUOlPKAU1UY+PPxPXudEnXkSBaEy4kga\nh7UfoGkXtqpnwUotFx0mz4GLybEazY3vUBPSdA4imMV7VCsGlzLsvE8vV6SA\nGe1L\r\n=5Sv8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBgyzOanV2KLj5RG1k1d0YUCqhxoKujqAx+vdDiVratgIhAPHtM229V4IvLkHs62nyoSfa8iVUYT6TYRzIC0cOdVUn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0_1590587756399_0.22685010856534316"},"_hasShrinkwrap":false},"3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"720c147737bf5ee6359c232633cecf2ae99462a6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ng5A0wVg+S4kOIh8m/I0nXGuhtn31Qje+3yWNGKQzoguig4wQTmZkJEwNl1xaztmxM9YU991o+QkEAue5uiVxQ==","shasum":"c0eaecf73991a8a672e0f633a8bb33999a1abf6c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0.tgz","fileCount":39,"unpackedSize":173477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznLpCRA9TVsSAnZWagAAJw8P/1m9ycBZ1/B1lErk7Zd+\nDSAHAUtXw5f2d5P3k+n7y1c0uQepqWVbAVlgYflClKbOVVyRqb9zJrByhDLF\nEJCScN8I5ngBnuG+/1SiooRNeHJldSJKHlpOGSRYTsnf6OYIWUQuusHJ0AUP\n4l+EoS89R8PUxgG/c7/Cbo+p0Cs+NfDVtBe5XtTu+/pwy76LzFfBQ04aSKB0\nB6zRPtS1tKDq9i0p8IZaVjGQoCxplUbwfGXifQuhmE7PK4R4LE673DHSpq41\nTPQECiZRGBxpFeoD6Motg82Q/EHQinDfGMe3UHJ8cBBQ/8YNzzjqUBj5WqfK\nFiMpfyOobf9SjlWv99C+SzPhTftFHhk4JsDDtLaFTNoiB+QJeyivhZV8A2SM\nxTL7aNKYfuSrEfZk3j0DPNYiBQknrcck3VQVFESAtJsBspU9KYTcE3yj2fPR\nzwOD/EdGOLQ6ZYYv2d0+s8jpF58BWkwLFsXQ+EeVpaljR4X1V2VT4DvxVF9+\nVULKsxk9hF8tTyxefixoCB4WZ9BpenjK6YJgbJi+TUzw0shoE8xCntY1ati5\nx14Vyxh4NKZTa0RAD2WLEXMygiJtprdLda/OnnyLB+FN4wu7WA/wRckWVzdF\ngDqGuuzXZAqdEh52VFQtumVUjs61RzLyx8+Io7rgj6u2otbMlDyO6q1Hh1i4\nvoNp\r\n=BEmD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSE9Xo1Jr0iC1mUGOVEVScXztRZs10oFf6+xXe+VvCswIhAJVqwRdD1jeEGEO+HiSUa6bv74FU+XeBf6deWXs/QKMf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0_1590588136639_0.9814886283288096"},"_hasShrinkwrap":false},"3.3.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.1","gitHead":"03324b2111f6481f05b0a25207daddaef87395f8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-M2K2IhAANVXIu42pNzPI/EcstNVJC9d/wQZdePuiAhrzRUXqNvvz/JCSilqvwptsOlJi3kFj2S82lumWq8m7HQ==","shasum":"e577e61ed6a86113f8f32bf7176a395366d8b728","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.1.tgz","fileCount":39,"unpackedSize":173721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznL1CRA9TVsSAnZWagAAx2UP/jbx5f8eYbdHgUYYzC2o\nvqcLXwN5z3GZxEQfgBjwkY8cfywEMr4lKyGOAfJjqgoMY8ALSGfhnlCDlfRY\nOwzAyljcr2kONMm+ZwR5HveuigdKNCx4V158WQHz+Y9595XtQMjqNBsLjNzg\n51nra/Us+IqYpz/awK90zxo2i4U9D6VZHKmMphGDfft9O2VH7xYeTGHN56Da\nw4LBV23syaCKzKNkDzqOEBVQiZ2Qg8ciPdwrt+fl2003qZT6gi3jiPxL5dgd\nHAURSx/aZfa6Vc2cg2m2eId/IElk+rVsLxKZ90887W6tlV6GtdHrLLS56cSe\nBmvKNLaQJODDtk5C8nVKOgHl7SYobjZJ7c41kUKWaiA61gQrdpDadVVsKflW\naKzhvz/wH17wxeywh/YgwIR8ugw+N5PJ5DjjnWpkIjnIaEn6AMZVz/z8BV2K\n1KP3Ef/8t/WBOJURuVVzT3YsNcol2+MEX0fkJokQsKeyFnPfE7YTViF5vtZL\nUxtQrCSLYEVTEVbwZtgwoIE06OI2aPXfVrzGAI7z6Ny/eKBllsBS3txZyjpe\nwk50KIEi8LONMmF3KfGP+5iVI3iWVD1AWtO/TpOsRoY66wzTXzScW0HHjvgb\n+ztyLTlgQHEwf4xyxL9xejH0w7tE5uy4yqLsbB8QOSzW8ytus/rjuw1brYh8\nHcf9\r\n=UmUJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCo6mrRgvIZ2HAZWQGIEFExr2cwcXvWgu0k+FNcUtBbAiBVcJX0k8HM/vhv2p059b3pujwe4+BGvbtTMvBNJTKdYg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.1_1590588148530_0.18175546233319118"},"_hasShrinkwrap":false},"3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"03324b2111f6481f05b0a25207daddaef87395f8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Xfynu5cjuX7t7uZ2rmb68CDRjg9klieA6hND2MSxpG2tGqxQsK855vmrySGsG5QyVjIWHReWLCPU71ROkiIkVQ==","shasum":"61856a625e35c508974c737a4ca9d4655cb49619","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0.tgz","fileCount":39,"unpackedSize":173764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznM1CRA9TVsSAnZWagAATXoP/2gVJcMn0iSG16vRC2KF\n0bDM/C2O1at5sGvJI2BtLCDvf2yz5XGJLEK9dF7NgBPvntqzxyTP+FpxM8ji\n8Vs4IOPb11mjE+LrmzeesKD+hlWMWO3Jjs1TF01NoViU0VCq2IQqsjBpHOhp\n+LovCysCvHKGvZBHjrcOBcO5VeZAqNy++Do+954zaZcl0tfSOvHSFRUtecgo\njjFbL/QtlgyxuRVb4nvpJlAUYnPDLaDa8gkeaY9oiIWIzYXBmm7xZNxvs9yS\nxquq0ob/FeiYERn8U8MXm3vXA7whagLHGIGnLj09CJfI+aH7AFK3CYGi6QvJ\nkt7OhEHQRMGA5iXT9ok90TZBNk2xusg15q3WObyiFKEXAGRtsqcmJJNsdRIB\nTDFFcwU6YCOc1OEM7FqSq3iXzjPQeB+ppqIZSc4THHScFl769IpTOxeA+0CS\naid508Q6r0WegEAfQ+SsRyJ/0iF5dV4F5MIKVvWfGi/GEdXgQtKaEohASvAo\nuCDJj7EC+xROC0k+YJlE/ieepADIMKcEOPfzCNKW7Zg6yIJu7k9sEglRBiqu\nG0BKQdelaQKtEbvO454tib3qqlwmdZU/QyAidarPABdMZaUXO0ZQ0d9DNucK\nl80zMavcxVt/deQHdigDB1gzmvLmRKGWPRZGHAhI/7/4F31GL1H6CwOT1BWi\nWCXh\r\n=uynI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4O+MSLdZ+RMHN7ZlHLLQZ8TVjEfrNEVACfLJp4IExewIhAOqTGJCEdXSzbKcWhrClezffiP2ml3gEU2khekbeAXfz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0_1590588213449_0.9057144579450411"},"_hasShrinkwrap":false},"3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0","gitHead":"2d755b49e496f5679ce76bf89797b198308c8dfc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JSIjPiLaW+jPoO6I6YrN67y3uFHMXKez01NVj46hk7n/t75vH+9gf94akWKSn6lTYKifVoR2SQF8hJspHKytEw==","shasum":"298b6c9a9d86111f11415d2fec36deae99e3068e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0.tgz","fileCount":39,"unpackedSize":172082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznQcCRA9TVsSAnZWagAAOqIP/ROeD7t3IZWBIfLXsho3\nDssIHBAHhejhJA1hpnwEYUqvQhHSoxM5WlfaUtYgWEw0qb5EtOK/zspDu85R\nS0xH3L7mAztA3NCDyXIQ6rnzhN9sJ7nsuETYTlndwtivZhUXMOo5KWuygi8E\n0AnWWvb3q0Iqk+TBJ1fWS76iBA8/xGwn4HpERr9e2dfQYJgfzLq+/Feksf+w\npEn0YbLfdvbbLFf5GlXY1u/4CDRMkWS/5mKKleigO+DKSBBbnexmzeLlPjdA\nPlMn5g7nRZPoEzYnouqADEHK0lrBdf3WUeCmR1rzyDTSDikmZCanmgSDXcCv\nKKV7zbNlRbofGWRsxrSsHiIAT4gokeKneuoVl5ckcan0Zsq0LTs6ksOIctY8\nwXKnhp/BUHGEVxPLyMtFnvByaLCClTvdutWLrFHXiW1GFaQwlQ6ZoZJkL4iW\nZuR/IGM2PevAxkYTqyV2qd8k+Sn+naSxO4Bv8Fenu2wAEU4V5q8u7K9wBMXd\nbW4kkvCc9fZobe9Kvj67aBxYjuP1v/pfAdtvDyEZTFko61TpbDY5ArN9wdKv\neg1N+M2YJShps/SsSbNTUz96AyipO3HPznO02Kv2XzBbKebs/T9B9pUEynvR\nmsC2rZ7+cyJvkzEsZpbjwyuNDZI9oixX1YP7hep0mVsw7EIjFWWGr55v1Bdu\n9u9V\r\n=PGhB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCal8N2pFEreoCASw7okqYxIH2x/X7hnZclB0PRBfwekgIgSRDkilXln+rSYWeAznBDoL3z4hZsr3eBw8eqEUtSI3w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0_1590588443982_0.9857263758265862"},"_hasShrinkwrap":false},"3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0","gitHead":"82256032456f2917e0d82c3b28c3ac9408c0adce","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ewzYFkOo+rgU4gEQBl2ysnVcW9gy5W2hkfHTFYiBxpCMA5luimyKLGHVFjGaIsnhhcoSVcHIUBJakQ027Ejm5g==","shasum":"c02c401595ab55d4cba70526d0a64e7b2a37c225","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0.tgz","fileCount":39,"unpackedSize":172082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznRcCRA9TVsSAnZWagAAPu8QAJD8+oF2caQF+WBnDwwz\nfjo4OG6TNIqdKvIl1LiE3OAgGrDZpRm0DTQ/SHht4nMQxm0c2vE7kgKp5cMu\nrl3ydqFsUOfb9NvTJsziLYhU47ZBp4qlSxTpIrGS9sQbYI5WDxt3gUpm5M7u\nZJ95exwIIaYZJx0ZA8WLvUdmLrqD0wT7F4dbAjJBaWRZKTf2azWlG5lcK52o\nuwZ+ypxnpP5lolmrDkEEcwFD7YBgQ97l+NnhY5x+Htgy6359l4akgFhgJhMb\nobMhWrlpEB6Iwhetm+TXgvkHMaBBVQKa4ADu2MkUroat2WkZdqyOK8G34bvg\ngSlLozHLdbGhli/Dyk0QCBk1W55gRMb795N6UFSOmuh1sRffP3z/2Gn8oCi0\nuuhfkTgJFboxPLEx5eR7UN4Y0gFvP8oNwyCJucg4nqrZMUbZAx1FPmxgFFdk\niraljqsiesVKmZZRvKnhTW+9b+564MFCmGKmqHBVlwCs6mem5LeEowqMtXv0\nz9wh6S1yBSxW18lqEYxI9YtEt1XOR1c36MPTvUuzVHDcc/Plfn1/Z8lHJLNT\nZbjHUhtr5DTj8TrMLAaVBVCmVuo06F1yFWr8MOtRfZjIxGDq01+k5jPlf5DC\nAhus+ax5vyXrsXN7/UMeBBx79DWjez7xqzBA4WX0xJWPJmvQqBxHt3Et59qF\noUzY\r\n=Fk8j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVRk1qBdc+jHoIaX5BZ9ccDHqvKYJmSM+Bub5JL4+drQIhAKTj64TEONRigskek4ihPponnsbADSSBgyDweJ2zr8VS"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0_1590588508154_0.7239473540972132"},"_hasShrinkwrap":false},"4.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.0","gitHead":"e2dd4cd7d6aedd661982695d9b5d126b65bcbb30","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+BHGIQhp62MW6YE/dvSWmTnSb6F6aOTJ4RFnkcYMbJ9gTn/hvEzWrnIjv6BELGCILupPdHWyaAI9booDoU+IwA==","shasum":"ae785d628dd0d043e741188c04ea4607d24fb956","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.0.tgz","fileCount":39,"unpackedSize":172372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznYPCRA9TVsSAnZWagAA+8kP/RrGYZsQVgNeN2wK+fzn\nwA2s/nd1tq960tkKoxTrp2ekLRSunl1CFuvUNlurqJCqtj/3DRC6YExK1OjM\nw/MNhOZDzZ2sV+Q9DlQT0+4kLVdUCICgJNAnECtuF9VLuJGzIQ1A6//ItLD5\nYpxm/FidyanAgKChfGQqDms4hW97clF3bBXvLIx0RySbYXlhL5lttx0V9knR\nKY9jtZVuZP3uqsDyiWI47uKlAcnGdqg981GVq+rPqFFL7vgY29z9QdnuAmqB\n+wY7ujwLanGH5wCx2X7wpLHMpXCbj3jla4FBSa2+mTDAoPxEoJ2kGNoc985R\nezRBnWNndtVP6k/TmZemOrwyxWO6R5NFlH7loAayu3q+68DnAPKf70+HelTi\nuGQu0ZifNtGE/pPEbZzNZpywQ7794tnTfNrs68+VksskrHFowbUc7Ka0DkKi\nDK/wxjJSCj8Kj/aGvZpJws62zqpb9R3k1snGwp7PMrsQ1wriycmBFoKPrtps\nkw7X/KPiQu6RdubunASNjmyDRBCSADBTsa+Mm9AaxNsC5JaIA95sxlr6E5zW\nRirr5EC/Xw4GuetlqflAdGoboFZPi7MCRG7DhgXfDSn0lFZyiohB0HPVmUHp\nYKV3ZQzHscN9jVNto64+fueLxHs8Py0KZt2L+kJp59j+jy/4aR6XxgGnjpUu\nnyUA\r\n=Veo9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeSr+CqS2kLoZOoMTsUmRR+lGiROd67AaXveC5A+rDjAiEAwZsBpYVKZd5a9VBjTOadE+TqWgMrFFc5Sb4htYAuN9E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.0_1590588942478_0.8229525354362761"},"_hasShrinkwrap":false},"3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6a9426863b1e9a26d3e57817425aaf14ad007f01","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vwtiTLnOd8Ohyn2YdNBUn6qJeJviYY7xuArU4NiC4O8GaNoobq+l7wukesSd37O1TQqo20FZFqXtcHVyJS2C1g==","shasum":"6f35272449d9cd85a245db90ed4baf2a94dea4d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0.tgz","fileCount":39,"unpackedSize":172082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznYWCRA9TVsSAnZWagAAgI4P/Rl363V6YVuZ2YtWqyK1\nKS8uJPUOZWjy9puMemD0jx7MxIlljBt/GfiDLT655BvmXzbakKcSys16hD7w\nUAdD5zKv85kDCH81cO0HbGFlyNOhbs9sf8KEsBkwCJdI4uFjM0Amcy4J7U27\nLvHk9wOFC8eRBytYO1xcX444zW8g4aOQiZYAnsN2Ix1CeomOF1C+KsRpC/IM\nnEUSOv4paUhHASgVEXRA9Gi+62bRkDNsOIjo0d3Po5K1OMXPobKN+9/wcLUl\nA7gRKtOMwzYK1ZXVsRA1pBSVBnhHl70irXabskuY4pgGy+4IxYSVljUHvfK/\n3976YcTQi3cyLyZF2JGIMbrBUIDzP5A8SaOo1X78ulP81dEHm/fv+yr44TXh\n4BBZq86hILJDtLaa2E2+25IrlyeyqpNwRi5guTODLMdtFBO1fdy8JZnCsvmJ\nr8DyF1fergBQ5PQo6OXuBqZxXnR3lLIXJbgOriXzC0Jt1eVP96AWVwYDtSu1\nAIdpCQoP1dLh6gYtgkzQNthvltPi1DKSVv/NVTiqif+/0/XklaDVlZHYIgXK\nECoqunx2ja/frE6/uMdvTwxTY5hiKf8h/p+fqEEoaAPfCvX3vKkuqKpPXMc+\nEvFbqHqSiWopXjrCMmB8NITPpaHwuihIVh9hIGsI03Jdnap0Vr+G2xJucv2v\nDKBd\r\n=VKmc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7fLtlff50z4aQjbJDv39MoYDA0on/x+rMUul0lyDfWAiEA0RZSn5BlTss7CbSk61A2KYamlGlKuAYPDLAUFwA0I7k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0_1590588949743_0.9326913839934794"},"_hasShrinkwrap":false},"4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e2dd4cd7d6aedd661982695d9b5d126b65bcbb30","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-o5IKdE9nEBzpDA+zjy28d1PC77dSnz0dkfDfEgzhmA1ug92wt2Dj2ud5ZE9zQufEOMfnGctMiaCoW+W9Vz9Bdw==","shasum":"efb11f36ffaca1b1f6adc43465612bcfa27db36c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0.tgz","fileCount":39,"unpackedSize":172415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeznZOCRA9TVsSAnZWagAAc6EP+wVb+dwpkMZcV+DGCPnk\nx0SQa45QqmFByJMTaFE5OiWHoS/3nlEwz/toOdPUBrldY00H+Yq8vrF8lmEy\nXEUAFfoCbUU/lhCkZ2V0shoDRPSJQ9OqYQ9QRNvw6KDY0Ev4hkIT6lnCVPzs\n6O1wkwWjyliD3OGJPLvwSbbljgtqHCIbTdI1/Gmu2jLqP0xDPMFOz/Ivy/VN\nWKRRmwCBCv4ZD3REVECe+X52Ztt3zLEY/TNX9+Gy7lYSp89fwaHWYZrbc9IP\nh1281QwUGyq2wptKUOWe9COK3kIqCGCE+G9dBhqqFVlQWgGjtHf7fzrHXLpv\nxA/r6lm8xWy3iBcCcYik2XXezW36QPmtDHqgwj5UESCvtWteF9N4wj7X8AL6\nVcCwlsCxwjt3fyQFA3xsJsvXorSNgBph6NMNAERtIhUJ2bjyFx9IUcO6ObNI\n0P/WZWywBYqL2PJcd81x+kxh0ABPXk7OzpbxaC4oMAdoa/buPSsv3PaqwOWD\n5sMiDdDhwPxieU0fQIhy/AjVvYgfpoGep+uDTXIVJS+Z3mFTifseeOh10IGJ\n8YkhmqMvbRlqAQIOYpiSbQb5EErLJhqFKvoCSKShciAuXOp+AlJT+bk1zWtj\njzsmxZCUJ9NS7Cu5AtUIK6fxqu5RGh/i7L/FD2zpAtDztoPmXGRYZvvFdOxV\nKaT0\r\n=BLe4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPnviHGqkLoaQ9Ng2nqzlgyrSF/D/XRQbDhMXNe/uCXAiEAj1Hj/kNY45TwZRwYlROIrPawoJjBbVI6ub6eRjbfw7c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0_1590589005483_0.09925831101277782"},"_hasShrinkwrap":false},"4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0","gitHead":"839d1c664e4da4d7b2d2f966b08d4eb619ad4f45","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BC+XBYqj72qTeNVB7AO5tlee9w9vOE2ggsUwSlyXvdHeTpENGDQRK7pWHjMyMRbDVZl4HCnD8f7BxOXwR576eQ==","shasum":"803f9c4779795d9625db684dab9cd26a05cf91fc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0.tgz","fileCount":39,"unpackedSize":172415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezxHaCRA9TVsSAnZWagAARe0P/2yYKQwtbCC5Y8bryvOG\nllMEjl+PnXNJbfDoLpDPWFC1iwVirVyc/KVIj0OhB+pJ0AytMy3n2TVsrvSl\n7192hbXPtgdpzJdIlIrik8hGZFVT96v/Fz0+kIcM7dEOmhLIXeUqKZDWHGWJ\nzV3Y3wUTCCT1uGvBR+joWJhppqejUgINrOsLegeYdZgfS/EhtKfRxvYZ5QHy\nhVLtkk+pTqEddKwseYd59aufbckv43WPW9v+bKJRR8WOxCgBWjsw/crEOIg4\nr1plezj8lYvhYmN6O3JaGy0TLxDKOtbn55aV5za8V4PPRd07mMl60BheOF2X\ngvPinRoVnuvLeXLBq+NwcMWyQW6eM/UNpBRzEwgwL2qXOKJwIryuahxbYxoX\nMBq+gcWWhT9V70rlNtk5Nke9PuzsdvHETilXPOYZ0rs9SSVmFlII0W0cqRt/\now898fVmb3YK4m3duT2yr6GJjt30+oQrz8RVlRMN0E75orOQlUKI09qi+zZe\nhc21TFRFLWEOHeJlknoY33LhQr7ytpH74Nrr9mvXq7nx7B5C2jgcIgwDFJfG\nyz+DKAy7VArbocYjLxLGC/TgnAeJq4CnZfG4gpY+fMesLOBtlGbjDnxWH448\nHl/Qt50yTBdlgaypG3saLRG0ws2O3gYDKvBE1CMw1+wYFH+ZxrHg6aEMzLZ1\ni9ox\r\n=AOqf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC61+dVO6uz2y60029bPg3qbWTl4X45Fd79LlAWlrbg3wIhAOK5Ox67lIb2GrDH2VG4E93Qf0W55DQzNBhThYgJlDo6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0_1590628826253_0.4532010978157188"},"_hasShrinkwrap":false},"4.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.1","gitHead":"21c255bf57ce1b119b9912db7c94bafafc330d2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6KOycw+JZzG/fZ19GZECG2xDRXRt2jgML8bBChgnWhqmrISRHPW3mGmQG13CsjpQYLKUNv0AeYl1fJwRwlSiEA==","shasum":"beee82008a398ae446372b01ba21e21ea1ded2a2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.1.tgz","fileCount":39,"unpackedSize":172661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezxI2CRA9TVsSAnZWagAADUUP/jmVCtZxAUCFt+Ex/1FU\nuPJ5quUfdVI+KYkPbStejHLthIVbgUlaTqjLBrrMbC65UwFXT+8Gjkgs5xEs\nPfZFZg78iW2PcXbJgHCawmDu0zVOv7b5BOfXZRn12WBHrcuNf0SKNYonOh52\n61JQOEQZZlBNGPfMU6PcyCeKgUy3WEBdPfczNK08syjwTbDKChgvUIB30QJz\nu9kzdtG8IH8vMtYPCrlhr764pO00gqgfgWScCFvgehW5cciyPI5sstH5fuqQ\nJE/RZhKcREnudgK6+dcDorDuRpvnbCG7CLVK4L1fC4NRTmR5n/G/4SaFqKZV\nwBPjtnHNUw7QlEE5Xap0dLgq2uS791N7+4IftXVU6YykBB+7QTnh+oMN62qV\npxpisPirt7Opm+oVL3pCCVmKla1yFIyYLKh2MwZ6zI56bv8bJmwp7eoIo2Uf\ngmVbcTXNXxngfWmQhIPVJxUdOtWN51g937r4bqqswhMlSOcusU+ox9L4lxcp\n3iOUnvKMfnJUC+VkGZ/s99kpHkkp8LYjkYL+u3NY/fV7em889d3KMRfgKa97\nkO8dJblJqGFFGDhShRmK1NAIqDtXORps2UVNERVn6y/F0PXSek1y7oEt48No\nvrIU/8XoCLIiuC/Ral25+5e5EORKqX6f8fRLhkG3LjlFwg3AARfWTEEycE3t\nB2/E\r\n=zrLA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5zuKUCrwwpy47400RRmrkjjb38rztJ5gphDgfQvOESAiBzQ/qX0tYHqqEK65g/HFzh1zW2peKCsgGaNJMqrkwc8g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.1_1590628918251_0.03593152417579293"},"_hasShrinkwrap":false},"4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c085cdb9735082bba7484a81f19a0e7f5eda7fbf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-g3fMjwVrWfI7uDlNK+rsqdNVYRZFxQBz4RZ/sDxRexNd1ENuQ94LSHs8sMH90IYk7JIG/a4P8iC+5yHLwavcTQ==","shasum":"2b636a26e2ffcb32868f14f162be359fcbeb985b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0.tgz","fileCount":39,"unpackedSize":172415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezxJJCRA9TVsSAnZWagAAmT4QAIy738IO4itMMTT0Z/5Q\nxV1rGHJCOtluN/QSUwyjUJ+9iATFMMFiDZMnKisQpfqDxbHPdhQtINwIQsTa\nkvBmi2wQsT/ydhHKIrSMZc4jfWW0IEXSjz0Ojztr/tPVhZ794McdPphpEQug\nS7ZnyP2Q8HogdpIJ508+Wo9mG4JmpFzjowdX7D+XS5vX2st78NQ5MaUlE2rE\nxx1bD+xVLhaBNyYQqyLWBoe8EDci+g6waA9u4Paij5nwu8k0spoRoedve9KE\noVshUZZjwXJ7/Ixaxlz3tpY6c+jRALiSDEwO4iBJMz29zR6fbFAtnyuw3L61\nywzuRO5gRz2YZFFA7iNDkJipxIsckU9fDK3QlQgE3UKKCTCdKKms3GdJCqAF\nS1YYitw8LZcLZfBgwo/2MX1pMVqaYCZxAbSBbLlF4VbdHoxW2S3LrYkzsUir\nY83k7+dkHI85+RJrLwmoFMIzeWmmHATURUFMPs006x7PolewAvMt3OuLTIMb\nr4wK81jQbG+lcP/aGISccXzu+g+TTRNLzUEBZeWnS9FzijPhaNHfk8v9roGa\nHeJQmHwORtTNT/RzOHax/o4pbrQwlRMkblVuSBkBFRsw00Bks/YkTY6fcHMa\n3ert8prj46w+UHI33gqorEQR84Sgay2DueYg/VayzO3oVY/egHLZFXJSZ0Uv\nRL0U\r\n=5WSO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVbrk9RZJZ7X4mli5pCp+H2CBdJkCQgnp5eI14pghGtAIgbGeoC72fsacFsSYJXR+sDZDOFRjjipkjNrS232xdtXg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0_1590628936805_0.5621800215291162"},"_hasShrinkwrap":false},"4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.1","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"21c255bf57ce1b119b9912db7c94bafafc330d2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-drEwLsiIZKC5eWyjOV32YlI475zZhCt9eKDPbYohzGmrtKOaF6omoT1+IR9ElJgOHBaH1UlPi7vYKycwKO65gQ==","shasum":"b0aacf644d1424927400ca3f42f312b6cc30f89f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0.tgz","fileCount":39,"unpackedSize":172704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezxJdCRA9TVsSAnZWagAAJQEP/jbtTxbo4PYTrr6YLkip\nWPsfvqJXiq5uNfI5wb5bbDMJzxBsTZ11ZwN7kGDBPiQdjoNWQGO+o1it8PD7\nFdDVZVRKlI3CBxBEZ36tOv52yY2npCvJCF4J3xRWIEFoYQUdMPJ4vCiYhiec\n3VYEWb2xSXXd+CYsD+QEzTLSezj7OmrCV/+L0XzjFyMy/ZaUvWZKL343u1Gd\nq4R+MWVJCZT8BhkX3k6LLuheMEezX1CDIvm1MzRKHD5v7Q757BhLxtOR4bI9\nTNa7ldFBcp6dh1vX2jjlsmPZwYQRgHYEc+nmKHTp9JA+/nIF5TixRmErmr8m\nLPY8dIvgyrARo7BXVhXme9L9SY/uJzueUwrMc6IZOXKNPAdZbsTCs0Unammj\n87UUE7t1p/peimF58Jk+I1jF5MAV8mO09G8pSO9CQzm4Cz1gzHaCIrBGZVyd\nSgcX3K7hKrP+ufpQKUwD/W3JU7qCNL5wmYGck+rYIvR2W3An4i2fC1NVBrDC\nqc5yQNAuyzbFlIAaSV00RfNoDipiqk6g4oRYWDUANbtPD2VyHVbmqbaivnJu\nxb0eL0Kxhv1x6MHkJ0rGRIlrC7Dz05X9UNLPOS/NJNnmJeZkBOJPVKcFLKuF\nUG0NkH83A8EO6f5zt0pSR3qdZqyguQt/7PPqRSNbgqo9OVWAct7zwI97RPRZ\nffJZ\r\n=0Cux\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGxhHSdEW5fbhWeJ+gjfuSIGcqzI5OXcLscNTw/7cpInAiEAvZzhnLOGjQ5XUCTmTox3XFr3++tDBReMRHkFNjapzb4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0_1590628956688_0.6181076933888712"},"_hasShrinkwrap":false},"4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0","gitHead":"10dd663eed2f461a7b9942011b1ad72d8d6b57ea","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-stJTKmN71gc8DTW1ntOq7dEZzsmMImoXG/t0X9A1e4H+mBC8Z8mQUIBqCj9qIoMFzqUxh8dOwKb4V9ZqQPG/vw==","shasum":"cbcab8d506db32a3c4c7b23d2fbc476acd41a92a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0.tgz","fileCount":39,"unpackedSize":172704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0Ai7CRA9TVsSAnZWagAAKj8QAJTgy3qZWxfR6LD8/ait\nFEJObFjRYvfpZiv3qZDZG4AodkZkxzFwK5nnkQrLSpU3ERKalv4tZnZUox0x\n1dvgf3iyLyBdlFhn/zM/CaMq0fg+rh3k35WNngTBcZ4CSraiYun9kMWk8DeL\nYQz5ZcPorSBaeMbr7pDqZ5NLGYmwatnKGxG9CbVgyAXgfetHufmy2SrdA5TO\ndtCQ/y3eqlAJj4poo3E7Iqq4TIUCaVmYEnJ7ClztFA+L+ekNOe+N3iP5ZtAf\n3FSylCCsABCXsQvimeabiZuI9KyoVz7KlrOnGEAuJYGO1wNwZIqwd9T5PZhG\n0s9gQ/AhwocA2cc0vsSYzLT88gCWQ0GVCcgDvzO83GSZg5ZLtuUeYbsH0q/D\nBvWODuiSvzst9DOgXI6+Y8HENFivFIBBkFmO64egeKDLnHa84n6hVO1ZfTVe\n4Wb4PKxXXaVAUQF5j1ssKcC4TJsP4CxSASajQtG/XSIOoQVkuBtywd5ft/pe\nK/SUf+Y3iJxKeJxKBNj/thhZKWUTsWIm+mzpfMlcDnfbiMs5/O+NOI8CvG1N\nKOJ+Tc4quBFZBhwPztv94J/j2uqyYWcJwZVclt+dGTderHX0Mvq+O8Havyr/\nG+7pH3Gyg5weiYWvcgmQnkVbhFzMXxkeW759Y6t7ujyxqHUCutU4QANmklSj\nwFku\r\n=0VFs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1msNfGpJCBDZsLVJoCSjxLoGQYgccfrQ4eV33fjxLhgIgO+LiYPn2zJFEV5MWBvfdP+ITXrI5vdx2AvFHJrCvY+Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0_1590692026809_0.054151920387967456"},"_hasShrinkwrap":false},"4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"adf9ff9854526a9f14a0a32efdebf6ad6785ab95","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LH4+k7byA+QuBesT6k2heK5xZrp8gMXxX1Ebp2TEE3gLmeVIrl58/cwn3jm+cAsZQtCPtl1D4GJSkIWZhEtong==","shasum":"40515593044731d12b179dfcba35d9319cb68065","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0.tgz","fileCount":39,"unpackedSize":172704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0AnUCRA9TVsSAnZWagAA9K8P/RgicAuBDidM5n9MbCUS\nSjsOV6VgtxPFLdfIOwprrq4uh+bzcThxuozHYJBVN4nvxLoLkOklwKRgK6mC\ntQhhLatcLVfJAS4TLP2SqiDQk+Tb274Yi3XSallXex6ccP6DaM3SOIiLiZ+y\n4Aa8RZqFVXWzFekbDNJDkmv8KGbb8eJzpoG5o/TvgUp7bWhKHAimXBk+u3SX\nViPglqDZb7tZLwtPPZGk35UuP1uNItTtGKXIl1xTEzC/DrDvTBSnBkpAXehQ\nc1HO8GAKbiSS+jBENwQw3VKmBb/ynpBO9KSzKa6nt3usvK/h14YCtQuUNRjT\nP+YVlSa1rPbAreuLOmSZacaHspPw6NU+TxaJekGrCf1+GIjkLTmXFFih5sew\njltoSu9L9RrtCyewwdPO1QoYIhE+MffxcXiy2prctOtrq2MQeOLe/LSFMBR4\njXxOpHDzInJG8OLxpFJmMYZA/GwQSfrvSxdwTYwlI19WO5bfr9NTxfZyGYK7\nnNuUbMqwR8L5GU94DQY1/G38k5P6PNkr96r/x3OB60Lh4M8zRYbeHn057CcO\ntPfa7naxhtLsxMWWxPob2G0SvPmi5a2cTI6W6RoR1JLo957OZRctsYN9gKFb\nkD2QzkOqwrsTn40qDSokcyeV8iYUsVPdHQdqaVsDM485XZbs9pu1w3j8zAr9\nThQr\r\n=plKM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnO3eKzle2N7osO8HeVd8Utj0CTRJk43mOcVdX/TFo8gIhAMU2Lrq2j1xHpFNDaXuSGIbTSGxAGqSvTRHMjuK+NC7/"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0_1590692307658_0.5286304642661932"},"_hasShrinkwrap":false},"4.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.2","gitHead":"b33efb531408c82bcf3e95e66926b06b97aad8ed","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MQtyGf4gNqFtdh2g18TjDaLODzShKnZhVY4E6IRFIdGRy7fKjFJTtvp02ttXfAzb0/OgV1fBf+x2R83tfGdeJw==","shasum":"1326540792d048fa4e2c77ecba88009e007e4909","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.2.tgz","fileCount":39,"unpackedSize":172936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0AncCRA9TVsSAnZWagAAueEP/AkdDL0oMVr0q93dHJ/d\nK8Qtlve9Oc+eXy6JYtHU6y/PGeV6ezoxXBh8Aap/LL7lKm4OT4FUUQ/YfSBQ\nhHJCR5rlI7Z0OosfPQW9vEcxC+zr82tf0ug1rOg5uB3UYlvDLWrBNsguuLN0\nUsMdH39/POciiSklJJVVhUY8H5GLuIpa7f8vGdPE4af07+6rhj6lZCh2v34d\npE+dFoWBcWIt2tEYX6tqivFs1l3YT9GQZBh9yKwmEur/tmspqiXteKrDvNZ7\nPZ5sqh4P7rcvVsjQd7TAGZqwHbQ3qDvAzUHqKZ9w4tkH1UoZKoXukuG4IXZE\nJA/NkmoeoKaPrhdeL11Ld6wpebCqJCkjf/Un1+CQQ4ta4ACJ0Cufs8AFrvNq\nZ4r7lElf5ufi5dlBheUVwBq4eN/Mum63EeYECRcO+StEHx9Dlp7QgEst7san\nujTVmsUHymZ9OnXhOBe8OvZp3O38h40MqaeKzeXWqiTVvOrLRRkYf/uAsaD6\n5oaHr+hDo9ZAxvmB/HmpBqJq7Ujocy9lhpkpEtGx++riljvP/z73mCZekd0z\nHWkEasPfZqNwROpkI93uNncH4tLSeypDhS0vFo8VqEBBXTpF+3KSEW+Czn/T\nnSMvf2o5jztPSGwOwFq73ZNe5TwRmfMpxiukc047Ux1AELGmFYFGLp5WAXyn\n/ylA\r\n=HSkz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATOwYN6w9w2wihpsX5IlhIv5pQeiWiHHD4VfnVPwVLgAiANFwx1EPUKcJF1TXHSWRLFz+kuJJm3UxETFD5ThKyKqQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.2_1590692315411_0.23312941261928444"},"_hasShrinkwrap":false},"4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.6","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b33efb531408c82bcf3e95e66926b06b97aad8ed","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-y01ugRYXbvTvg1lHSQ25Iv6PyjwIM6LLAJ+6CtYoHYU6bC97CPR9bVlX2bc4PhO7Q8vBbrOFXS79I1ixjluKAQ==","shasum":"cbafd9c6ca219f78509b39e77c8c4a814062dce3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0.tgz","fileCount":39,"unpackedSize":172979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0AoKCRA9TVsSAnZWagAAedUP/3+AWWOr6ZAmJbhgzZ+j\nTBuYYcsdteoZalixTaU5CQey/jpFqTMCSR8lfW5HFoHJjM1xRQLLkg30WAfG\nd3JqyEfKg/6i/DbDfoQf2ximjV60lNmGQAveL2lDbnTuncKYeTqrRnHh5CaR\n+fobg3B93SkBkqpU5YMeiTae9VeVHdhvaFCZBjQ6/3C+B9aBeORs9uVuaQqH\nKwA+tpOKseBZtixbgKEHUiXBrmw8YSLrIWeQlRpJAhQ+ydtiAOGBRetEoKgm\nXJWWA/QJZkW3QptKK0svQgrPBlexZipVB5qLJ1Jsn9EtzRqYoBEv+xIeRp9+\nTOBdGrD0NnFSSy15Y9r21g357XP8EU2IOiueIxrhZoOi1vn8xyVzAGl5A8uJ\njeD19O00PT9OBN5rcVzL30UbkM68X1YWkhhvtxKl7YlAPDgML0feWW202ZsE\nv8o2QAsmpTS+/1gQAskJR7i4ITFNB9Ckl7TFWdTJA4DbvzX927Ba8qoz8VkJ\nG78Df5+q0xnhFjfFYDNSrLPWU0nIv4W48X9yuiVKG1fto/li+DbFPa6gIdmd\nvAEK8XiBt8x9CoifEORFWKcE+JXM5/IVN9VBeZZhKEC9agahXPQSB1fhzuPt\nYLpcdFGB4Yp1XsALLiMKzI81807xozVYb8i9aNQqbgdiUZj2njuAj6SQHMBi\nP5/q\r\n=4Xwn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFr2V9ix/o9woUak7phP/MsSNqZ0XdB8/G+gePI/clBBAiEAnQA0s5GbyASzhYzDh/QOYhkfwx2a1msLVXUy5+yYtvc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0_1590692361560_0.9417507558194143"},"_hasShrinkwrap":false},"4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0","gitHead":"548187ede3e7da5dc35f23e0630a18231757870c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-J5tqMES60JHGd25J52jPwk7AWwOS2cLtsucJR7Qh9aYLoZMsenW+G23hFPzB1kAWfdd3nkvyLiOFOHeuxY76ow==","shasum":"0270f6398f60e0565fccccbf20f97f9bec108a99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0.tgz","fileCount":39,"unpackedSize":172979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0KhPCRA9TVsSAnZWagAAjj8P/1YBCoVhxU6Lu2tjsQNs\nBXir/k8pIa3pG4/emW9FRTuUQDHPrWWiAHapRIiMHR36iY9hs9lW0FI2Yno+\nk8eAB9fgbeZO1b2MldNlBDzFFAnYIvgz1fxRWj9jkBLRZkgwk7foDj6NyBRT\nGIbQL1LQWTLDbOYA0L7JbZSGb5nrJgnaima3HGIJ103EDhdxnDdXbWHsOhx2\nVx5bq1NBw59R9Scvac842I6H0E9MNGvj4e+C9sm3aSJcQoTECZn+yOBtQIE6\nQqsvTFWEpdkFblEM333JPxiEpdIKpWC6TaRP8sDzhMQ6jKx4THRXwPNLNrve\n5KBcwAezmS3pzawsMMq8dx3UvBEKyX+uQUn+NuElqVlIZl6PWw0qQBv0cEKc\nISK97ra3ImAr6XO9H72IXZBauMi7vvjOPUUEGCJsEqWIp//Grq0ogHxoavDS\nZwUFCoVrAy3Wc8Q7Yozuc6edw8HYQEF+ZnoTcsJX+XLDNdaDK4HfZkAN2Ksq\n79xx/2nrYc0TRtn+EM5BrYQX2RHiXk6UmzREMzhnsUtjxSTrNLWwbK2OvJsJ\nJIRtrC8Nn9+ks/tTniwJB74GEHe3js+FwSS7PdRTsiay82C/C1AzyA2r/nvj\nhKHvEpe9Hef/4NsGIJoVMudYXNc0Ull2TNMIsgO+eZW3IsqzJYioT1RDmXt1\nBHjJ\r\n=Cj0H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWbIYUi/eAR4PygoeloRFz4UcIKw4VWLRuNEcC0alRaQIgEut7EDtxbH5EUz4P3V2oVN2GHMKi8jNK2vZNifKJjsQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0_1590732879242_0.7675445363505586"},"_hasShrinkwrap":false},"4.0.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.3","gitHead":"7c64dd1685d284b57d835cb079116916054076f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.3","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-28mx6CMJTz3ug+r17LhbmfWGq/ghJ11wUmuFsKFkc1wSWLhLy14dYiEa99LBMqdBrBVTRgTu8QKKNoRvpUj1qA==","shasum":"2494431c385de225b6bcb432a95ed344fb44ad7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.3.tgz","fileCount":39,"unpackedSize":173215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0Ki2CRA9TVsSAnZWagAAwb4P/iazNXReU8ucJnDckIIy\nTogHTOYX6+ehAYMq9RTUalJyyS17aAwNLD9Y3oXpjIE/eKzJy47jdG3rrkD3\n2abz1VOHsLQnsHCIvp1nk1/5xFVeEyHNbzkPyoyQcOv0cCoFVWTkzkvNVTQL\nbOfcZJHf1+J5+cUDkxU2t/Jm4NIu/YGCV3zSmu0/gI+rL0NfhwSUJQ/7CShM\nugY0krAvf9RSCdDsoP0MfIexZ10qnBw8iI7WdlODbje0W+ciOxQEoEG5z/53\n/YGxFXzr+74yPzCOwLfDJmRKgqAQybVQ5q4ZgCOJpbKWEfdqm47ohdojaabQ\nCp/mlsTLRUHW+jG6qhfiVNSA/Ybx8+4BCAq/wt/JC+SNWGEYyPx2qKB3kDwk\n61BMYSBhOQ77TGpmnzQSxaR4wMQU6sANVj/ePcvdvJN2utIVrBX+aIrhCVKu\n/z3RmqpiaCEU4dGegzqzlgsUQi7TAmERa+tjFJfj278XmZw8Ycfkl/wEH6DZ\nz5T5Dfd//zh6+Fw+f7VD7USR2Vq+mpYe7pfrFZeFxfWdmP21+uVfhhcV3VmN\nADjuDUPB7WTkrW5kuseN7RfvboMgU+qhhdIHe5jNVHzlemPuux88/ED1WWx5\njlAPX8oc2Vg2r84PQTtEXEd5z1TDEuV6vjYjr+KgopyWyVvVfhnxwsmR752W\naQv3\r\n=Jc/O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoF/okf20INwfRdNdy05ybu1ukuy2izUdK3h+t6zIdqAIgZy33ytoNNOeWBZM0mu+RVwfP7qnhMld1IKRSBNbGglk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.3_1590732981716_0.31975708184413465"},"_hasShrinkwrap":false},"4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d9e4ed6a48396933207fa096487c3405eef66e79","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+wAr9Bq0uTMRwUSPChommFFcjqivLbb2BSO98/c64Xg2eTCq4wl53+iCbyiKIiK17jP44zcyevKjW1r2AyBC9w==","shasum":"6dfd233b0efa4541521894a93671b7d98382de56","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0.tgz","fileCount":39,"unpackedSize":172979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0KjOCRA9TVsSAnZWagAA1nMP/1PgMKK5qUNyi9PhpYie\nw/7l9Z6fjNVSQ/Z/eaYT9Nny6k/A4W7AHxhSnCzBXOpHzc/H0H9shMSiy93X\n92bm/pWPsW0PD+GGx8XN16TleghjPe+M5h58QSN+EheGIYsQZk/SKLvH7coH\nnOcUjBSzn6NOnevizbX//i9YsjiO8T2vYhukZSB7k3/kNpZARHppj7l4FmBv\nG8KBIe8ZlZkYpaA+fj7h+DSMCs18ThuiKZUz6sdqWJMLkeLDN+/DT6XoB0vh\noKmFV3Sjno6VJMvOS49z35xoYWBVlPYDFSa3y566PDlCQPm/ZoAMIZBPPEY6\nYH9XJzGy/glHKvLkwfCKS3UmzzrDfZO0A2+ud2umZen2JeM4hgZJ5tegGwKY\nK+Bm1fVXQvHItM/ZyJp+/06UvI7Y50VfVdPrG0Z0ItUxbtCDvai/6Ds/4aMI\nBI9LW68h6OM3G+7VP3weYLJWKkNeDGio6MvoxCgewsZGuBdH2wiT4lVRhA5h\nR3vZCkgHR+DKajEkqpkkw3tDgp72/W831TaVFNpGfSc81ets1AkdsNDSKJq1\nexghnbvhozaCWgj676kj9VnyiMOtrPIbjjIDeCF/B/AVWtmW4J8jciM1KJXN\nu0YLsFJkgyCAr6kUGQ+dlvQ6Oxwapx2D0cSK5tcrajsJYowwmBy3JoR1TtZ0\nAbww\r\n=TLY5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFdrFml/ykz9iuOZVEZOsTn7id3u10Zy2Hm2nv1du8ZcAiAnTf0yvMAsxSdU9YclxFzjYUGGA1FbWclBgvDmSF37iw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0_1590733006035_0.7752375231079831"},"_hasShrinkwrap":false},"4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.5","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7c64dd1685d284b57d835cb079116916054076f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-M9aa1E8n1cHbrh0GqKyk9sm7GH7cNhKgC0JxbJPT+oeCW0Du0rPt3uAum9Lanhb9MjBvNB+IWxHh8xJyxsABvw==","shasum":"d9db6e5dbc1f3d36e33bf1284b1a0595e6411170","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0.tgz","fileCount":39,"unpackedSize":173258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0KjjCRA9TVsSAnZWagAAAW8P/R3VWINsftSNNyQbAaBj\nBMW731UDAZciIVaSG8yk2MeVFhc/R9x+4WuE71YIjJx5D6dwyjtv5/nqGSWP\nh5PXgWndrvZZXPkYh9dQ7WikMKW8lWpVF3zRr2B4FMuzNgEcEA9ERqrPzazP\ntL6Mfc5Nu4yiOKS5554oB7mzIFgpxbbesPIdbyFll+YtBsP0kup9IQhiLruZ\nzXkV8Nq/zMknYGuS6qsAQy1v50I+B7ol3HGxvEx8g9S+UxG4ByEkyli4lfPW\nkLnCokjoShzO3GzdmR82kTZ2P6SWaNZdUYOBM2cPi3iaU1/6DWF7rN+gl5k8\ntaI6CyqR7jVryjDnLBqySlKg/YS2Axi5vziTuzkrdhMFDtsnrdIFRIODjksy\nWZgqslV+RypRqnsI/Vd+dOaDNRppYfXSmgJ8Emnc9p19SzIuLQUUkehOpFXk\nwKc2/ZY5WXplisc+PPEWiGPoGo1ncspGjQhxvN3jGAak1EiALWPvoa4LihMg\nAgpHQo9t4dF6c9mMDCUUFN14CcsYqqAhL4Pwtq29eoNx90FGvcvSvBvCJRro\n1gHsTfhBLsjmBjmU0KmzlOic37F5LwyiphDMjspiMurENqOemmn/oAa3mcGj\n7VSfDH2XO9MW9c5upqwmFxEnUQWAdbH4AkyzH98dKS+tHAda0tJQy2NCE8F5\nSOtW\r\n=/0si\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDttbEdT7tqW3cTtY3OdOMkAB5c1WHCM3uIZp0rYhEWPQIgasS5oHSdAW5cOVqXGg0gOPPUDc+x8hLBk6a7jN+eVKk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0_1590733027457_0.38580583594924245"},"_hasShrinkwrap":false},"4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0","gitHead":"5041526839201845a568cc0c618f111bb25cdc86","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-P+MFa5OLgyoOLSKNj/cyuvvLSJoZUoMlZDFSl5di2WAsvUKe/sH71POwuJ1/dPmooLnkvZFlXmnBmmw/QNdmRg==","shasum":"dc3713eb22fcd14d6c82eb62de1446ab05664589","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0.tgz","fileCount":39,"unpackedSize":173258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0bg3CRA9TVsSAnZWagAA3G0QAJTC+DDMxNiQW9TjH4fK\nZ/ycdpCMfG2lswKMoJMSXpyUmdmcL37NrHenEvnuh4BGimhNVFyFo7KqV4NM\n7FtQk08bFxXKV5uRA/HQ8XC3NUMa7IctHSWaNME2LPwlsPeVsUIHmVcrTwle\nm9lVXjaJpxpgeaEP8tJZ/OAjMLhOhHzP9W0Faoq0lyzGW1N8NN9yURfRRLQR\nOEWFgJJw1ox1uWML45oywhLUuUEs9oDLI0SmAkw/C2vQ+U8CzkToiStX57EY\nfu58OlXSm20c3oijzQILm/73GzV0XO0jj/NA6R/thUwyfPOGzPXMCO+wjeVI\nQGwR8YJ1yd+TIdXaQTcGnlDh11sUIyVR9ejXwuKi9jpLDpGrdod8jm1Ccp28\nJso4MALGFjhhqlZSA2axUYJ0mbveWsI0F7FBlWsTyGsQPpQqmd8TqirMNtGk\n7Vw9oYoubEBsdIYoMsS8VTui5SCpVQtjN+QaBIHbzp093B3KfrSoIWSMmRew\nIBaC5vhlOkus40zaplQd7o51z8nlgTw7AftkRrKwJJ9cUC6WoTBEWsx19yNo\npd13TKTtRA/XlJZnivp10Oj36yIYGcxnlZFRcuGADNR1/dXF3DJ4bkECNWDo\n1SC089Mto76xgG0L7Elxn7was4RGwVUxayYUIpC1DULx522nDlCMTLAkMzX8\nzdou\r\n=obTS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAC1mJKGeHVl2wH1AEPbgrZhdOpwLOY47IkjclrZN0ygIhAOFkT0R6ueb341+uWzdXNkSalXvTjZE75WjDmx6jWsKN"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0_1590802487134_0.12141665554094061"},"_hasShrinkwrap":false},"4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b589f47c9941b73b0536b35fa4de39b3af94fe57","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bRegHZb91TpNnwlTwGNEjthXPjWZlB4XyAFiCwmz74aoZpzXrglVmNY49w+b3YFu+hAo31k3mkLvM2ahgHzXBw==","shasum":"650844427822dad990dfacc7369e9b2cde6cb43a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0.tgz","fileCount":39,"unpackedSize":173258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0biWCRA9TVsSAnZWagAAsLIP/1qEtOP7PXKKj7k6WL9m\nXVf2DnSgYAfegWPjZ49JEUjXDdkz36Y/T72H1F9sb2s6veFWUS5ioUhGeqVs\nSrDO855T4AIM4w/YqE8z7jnCZi1lVeHNYPReJ/VR5Bvq3HILzheOfkQl/MKo\nst5PXr+Hx7dX2RbC6SyvDgdno/KafmY0CDmtT8uTZuNCuJopUsRzGwds3lxT\nCOBbfJ93F2OmR1l+yZ1qRX8YU8nMl1bCXJAJRD4MkN+HNDcNl3dZLaNSTB0d\nnGAOUoLt9yGStfIRdDxmCqeJDmaovSTZIdefOyvl19RsjZa80s9XjzbuSsQJ\nOa5L+o3RH9exT9QhxoFDteUerVfEwjnT6EQXyyuYDSEpYgqYXAfg0MihqgBw\ncuzsiMGziPCPIO7Tq6EXtM+q2lHPCav45bV030PvV5O/L117WFP/JVW441BK\nAi0kkBTj/9kq/jX3h5uPKP9j7n3tU7y23a0uJwMcUmRsy/LHPZTgLGY5WdW6\nTJ700l/Qu447u8tiUxNFgv+5+xZ+wfD5ME9uJrYHNEJwiMLFG30KmvQps0/L\nWTrTl4CXhOpzf67olhemOXCSCok820ovJhEeYdJp0TA29ZyrX0uNiK4EsX5v\np0clc9q7l6/B83ZHOY1kefPbm4tYZ715D/Uwj281zMzNcgNtUKhwolcb5PxK\n7qAe\r\n=mM5R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCy2DsYXdKbimiqta+wYcHo+e022POhRI4xGGYS8gTbzwIhALEPUmo/iEIkKbs6YdkB84TQoOmQWUWBja4nXOWTtdkO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0_1590802581578_0.19629861072604826"},"_hasShrinkwrap":false},"4.0.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.4","gitHead":"7082a5bf247be297d44c565ae1202de49740ea92","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.4","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6uLlbVAg8J3W9nd21LCeni5zsz9399oVbjaqDfiKvoHQt9WfDUz+UUXdi13oz4MVS+3pCYkBV7B8taHdGmnNVQ==","shasum":"2b6b1d51ed9306861fa5513d0556022366fd2ca0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.4.tgz","fileCount":39,"unpackedSize":173494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0binCRA9TVsSAnZWagAASZQP/jI01FpyrVeSdrt69tY7\nwZfTU9hsoAeqgL1ZpiozlpZiDDGI/D/wzMiJAGPoHycrguulrYzePpLHlAcz\naO8svs55NbL4bQJUbcDdyQefq700BpeSOolqmYuraeAm+F4x1hVsI+3nYgpA\nt+Tvh5pEkXqEKMEkM1KO+ulgWWHIrqtkwdLiNRuue6EDdcFkSrF3qy/ZcdYS\nhDbzZ5HqgQ071azVVmiLwU78PbNKsSQhhopJP7IzOgwhuZ3sfTjf3iWN/brx\nIYL1/urV3DBPUGu6R9v7x4jAH0U3H1ugrTpZvQZ11BAdFq9q7nNYhzKGDoc7\nK9eO2SZYqTZaqsNXN5nvlg0rs2GJ2PyfDRGFR+zH2LrxInCnJoi+WIX/bS1g\n183w6D+iyPveCNrRZ0aeU4IsqMw7UvE4Bqc84S3Koloq49rtd6gDtzV9hu8z\nZfkpHde0TuqHBLZ3QXP5jInh7iyZzF7XSWKRjZ0fF3gbhWfvSZC2eR7Fw+IT\ncqPvbFeoEsaguxYKQK66Nnuo7RX9qZddXe+qzoJOUExpHL9p54dtP7nC7g9j\nDiyf2sIFFdxWbVashfDuaNwoQWN6iQ1898neXUSTAJOiJCvdKPLTZOJXSoZV\nnoMIzG2q0p8PgCNLmzR2cQRlOi38Ir8dJlNz30wNTGNi93e1+rdZCTLBs/Gb\nxHqB\r\n=c+kl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3Sb/PNiJYadQllp8VCt3NSpYVQldWM+k38sXGb37pYAiB0LHvy+xObQTRzuupS2jTJTvqDq7sRqAm5ZC3r1EUYBg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.4_1590802599057_0.0787176028423413"},"_hasShrinkwrap":false},"4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7082a5bf247be297d44c565ae1202de49740ea92","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Fooh/mWQ0DAEQXBRhTWYzxLFqLWzgJyeJKAPz5QCdsQTisf7Nnwp5t/HLh3E813oSJFy8dVWGGysxO8I6TYO9w==","shasum":"c7de17b2f718d61f9e8f54cb914a00d6aa6c68d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0.tgz","fileCount":39,"unpackedSize":173537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0bjLCRA9TVsSAnZWagAAM5kP/2jxxdwO3WMMD3lSdigm\nyrtE4ymlGEs1J33m2kzNmaEBSGUy8zQ/RfvvWNDb/qnszIF8vBV98UDwyurk\nUf0iFDmeW8f8vPcwC9InoemSCTocYRjYSOYtChSXS4T8aGeotHyEXj3bNIwS\nXh3a3r30tUlF1fEWyRNsZx+DEK1dBNSPNT+YGmQr3mXRFstrqaDt6vQ/wvKw\n3zVWtIT1ai6VC1tO7Q6KgWZFNP+ntFoSEreA8/Y7R41Wy0FQ3awZu4WwzM1u\nn3z2JxkkCWH8MJH0/dp7YpdiaPy426EKMQvq8TZpOAzqfkuje9sIo0imw8JE\nGB6lBv+kk2401ZtBEhxW+vcwJAhruG3jFnts1Z7Ags/x0khiMpz5R6ojtzuU\nABUPFzzX48zxONmLkLBm04zZKz31VHGjnz18X24jSjo+3rFs2NjWQlk7m6LU\nnLdsdRgkLV469rz4N9rE5XBQbm5lOUOrhrvF53rJ70u5aa4oePruSfiIq8xk\nE/ZuHA8v15BWZdtpcgaP/WlsDz+yM34yFVjNEOrbwcs3K6hmyOaaudJIgvTm\nKrR9+Mbj7gcbTAFCdrKzNuPdf2vqeZxOdNzNx97HUQOGr/6uscrSYhVci1D+\noaN0zz+sVRmCvqkjwIoQSJ3Uco63HoGegvIIN3xx9DWF5BDcpD7J2QQlppZE\nXr3v\r\n=hzgl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOj6aYCVD5wUZ9rn82SfrQK11sp894V1UOI/0S7M9rRwIgNEcHaPZXBis32Md3CfeHwUiyXMBwHqWptnXgNYpCWu8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0_1590802635354_0.10428579747208433"},"_hasShrinkwrap":false},"4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0","gitHead":"8309b41c7b9df91dfe3ed6ad505eba594ca6a418","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xI0DIVE+SGXdibpM2Ft5F47zK2AhjARLGteDYWJvk8edJW1NrROFlVUWrRfwcdXJ7WuGOE579fClwXknuh49BQ==","shasum":"60bbe3f8cc315ba38549d0ed7d06887a99c8c653","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0.tgz","fileCount":39,"unpackedSize":173537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0fiWCRA9TVsSAnZWagAAkdMP/j7aB6T+TqXgqdG517AB\nzgFczi4vnQGZWF3hnelxBgvjg2jTx28Bc4Hrmrar0CXHumMDByiDaSLf2U49\nb0cABNWd52kZKleIo2o7SBFWb4KbhA08ol9IJ3PUsUT4IYiL3OIp3YxK042j\ndJLp3oqdM1XelfdZ/zKgRITHtpfAlNkHUAJIGMqzFSSMaDT9lkRJNCj+a+U3\njcQl/5RGC+sW0WfJPkfZHyqLih/ZHGf7PUvG17rfknqoT9coacUMHwwtI06q\n875CoviE7vsg59L8nkJ+q51iN8AQ/NCwu+tzJO6Vi2EZjXSUOYtbFnXvU5k+\n1o2xZI/yiGtVO7ibBmVsOimtwpw74VHD8Fvc7QyT44d+wyj5nItDQrRztRQ0\nFxybBU7H+Y2c8hHU8VOGGrNZmKi2P/1Rxa7HPNMVSNu62zVz4a18NcgyxyBC\nbNqqv+ZYileiC0cFvpg2IoMkU1yuT0LOmgW+YYJV7hJMztsLQOg+iIuRsERY\n+Cu6xgy2lw/AzsHfpqvJ29zFNGzgRKQM10d4WYqpcl545eoGE6MsNE6RZZ6k\nHFGVQdbfPn/Od9W+BY93RsCY5vj1vcKSwZdKx4ci6BfvTucHf6HIxj1WNgwZ\nVImGtWW6cKGjGuT4Ldk/V1W5DFWqT0Yb4THYeLskUxkWv7LP47uIsLB3ElEs\nPnvJ\r\n=RWFr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvkiYC0wmcQaVx+eYY8jzNWIfYMSOLJ8GM0xlZCk6+NAiEA4RRzb74WE+HGKFJRtTbobOmhE98QSY10cjYQLPoq9wo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0_1590818966262_0.10225496008381851"},"_hasShrinkwrap":false},"4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-66UNIV/nC3Tn4iollH13P3oirXwAvVLXdqfgSaSzMIRDPFY0MCCdBiXY7HjG8LQCPKv3LHkgt+f/XYeGr8on/Q==","shasum":"8ca6c54a0f9c1793ecff1cc9e9bb29fcdaae03e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0.tgz","fileCount":39,"unpackedSize":173537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0fjVCRA9TVsSAnZWagAAu9EP/1/qJ0m5GLkUHNknfJMb\nlrkYPkFgAWAl2IEWrk1NQ3i9zYI09mMzdZfPqTiHqy5pOmHsxPoC+43xRSrw\nBE4qaDV/pHx/GvH8g7ek9VNuy9/5JQTZMO83BpbcZbi4Jb5sIlPNQw4cI+IL\n2TjW0C7PAkWmnhGvDZx4uLli8ECTJBI/uisPBSBtMJs2luSMF9v6TmSTKc+4\nVgvg8VtxKigiMj2H9k3KcPIuXJdGHvJXgR44RwrurqOE5s1oSAr08lhXV7Az\ncEBBoULzMPFmSuSw+QiBd97Ul1Yc3jRXnh95XN0OX7Q155YvNdhrqRjIyiWk\nft+O8RiAMdnhr4HepGcy8/CyETIV9TPJOY4qc/G2KdnH5KLGrngHKdTLYrln\nvgJAQsqElEuJ9KNNFCH0iqdy5pgaLX9Mcoz+1GTFYM0jYcDl8ql+A++O5aL1\nBrlg+BQ8+I6OgHu6Ya1XZQM7GR+o4/e7iJqfQCyHyCsHvMZ6yks2i1bF+eF3\nNCCCcm5tdjAkflBzrnUfT96lOtsg2tLQrGkScK9TvQjUvhbyo76DkDaPs24E\n36IDJ7OlOObIFIbRQTcJ3y/XyCVV8f637pibsV59sg/dzvzkDWNg+GHp4OxL\nixdRHWCDiUFU1Vzv8nC2hKpA63zWi+9ioUz1HRK/lHLQJYVgZcr/gwpabKyZ\nM0vb\r\n=FSbe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3g6x9kK8NjgZuXU+ARfKmP5kOSjw1aXPtz6xasj5YOAiBo6E320d4lz7EfICQXdMNrq4o254m/925FSe36VsvnMw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0_1590819028697_0.2365012847886907"},"_hasShrinkwrap":false},"4.0.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.5","gitHead":"32d5de493553da6fc3f41b1c7ddeefd6b66679e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.5","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+nhlorJfns6lbMCyFYVDxc80ULeiZ0HJJOZQzkXqxVnD5M/Y+DhbM4WwIaSP1YOIbvnThoWD57eYcYbVS1RisQ==","shasum":"856eaf7ce6ee464b6bed0eb4e831897bc3f0cc45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.5.tgz","fileCount":39,"unpackedSize":173783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0fkmCRA9TVsSAnZWagAA6xoQAId0OZH7pmIjp48JxeMI\nmnjU1UpX8bPj/SaXxEw/h8DJJ0xNOWI13XjtwFkBKWAQAkUIUWgmVuefZABn\n197olC/4h7u5TlhlMXnKeuLkhuFx5IZ0R0PHjLevyFBHNeM7W2G1zV7SUC7g\nYnzyhaHhhXc1MNRj3HPdlgh/BZcrbjFFqjXhtZhHJ/vbeJA+fLnrkzlBxSIh\nD94nsCPwnwU2vN9uehMYpA1aIZWMR48YuaBKO8pOGAFJ6OiulLiu/fkzTC8K\n7i2PSMFUKnUG2mIQdvU8/e3vqMUJ46G6P0ZxzzuBgp6BBes9mxrHzVu9TmDT\nx6hOwLaKREaQaHCjcwZhs505WOkHo3wyZuhdhaVA0UV3Uls6NTXDKk89zxzG\nse4p5RckCocV7KqOCWYDy/f50cdHulIJfzpRmFyavbWrjUaHg1Jx9MW0LKuA\nHsw0JjkZ1mC7gXsOp6JwRwxsWR5dSGZTBaDTisRdsGs1JJ4w0AnDI2osmbwF\npn+U/M8Atz43d/dIb24DoaixQ/Vlep3x0nv02Ngaa+LWQBGtyIReSZI0aoVF\nYCg9RYzS890BQPpMxo5vMLywn+WZQs8XgUYnmhDqbsS94jCWlilesLWWaACi\n5nhRgDzQD8eHUeN9q0aI/DmEXs1pV44fDrNhzmbajF6wTBqZPj7XG4Sd3E7O\nkzAh\r\n=wP2K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeFC+xTHwd3PgVAoBVbk12NVhTNz15o1oCcraA+6i+VAIgAyQoJ7sAjPLdNkjMOk+9JqVtG7VHCyP4hDUNweteZYE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.5_1590819110153_0.4144169108673901"},"_hasShrinkwrap":false},"4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"32d5de493553da6fc3f41b1c7ddeefd6b66679e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-749pW7SGBkQep5pt+8cgoxcDBiEaEmBffcasCyeJpgioIdRIw2tdESGg3+XxiQxociqTyzWKOt1o22H79EbNiA==","shasum":"f654a21a33816baed292f5aad9808a32076c9b86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0.tgz","fileCount":39,"unpackedSize":173826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0floCRA9TVsSAnZWagAAsOIP/1M/kGL94jUNsfP9yJga\nTgIZg4jW3GDcIn6TEHemOQltg/q0g/1bxvWONbEmozDqQIPcQ/M4jPTDGJw7\nCs30PNdg+4x3dXG1TROVbHzg+WhgPOx/mgu9bMOMLAfqNBRW88F20V3Xu6Mo\nokSwZfotjcsJZg328nx6s0XqEJfB926tCQ1eusR8C6+YcLR0WDBPVITnIMFT\nqataYuMFbGlG+fryAVS44khi1+Da2TfBqcba2LqzvTVmO07V6XZvVhnMaXP8\nkCoCfeR9lbI/vf6mWXsXp43JqWMIXUpELE3R1iBFbE0FJdgINsbv7SWlYevL\nvttSqWPryhK+MbUE0weDPeX69UvOUg1MudmDbVCKkksgMXIk67dkci3Ypx8D\nJIqg1dWCyjhhC3MfuVHSc5eMvCyM/txCRczE0+Di6369EUubjSvqvyfQOmpi\n8N55fSDhzOxQqh7mzAdtcm/D4Ls0LKonjbd2WMriLAc+blfQhuOwKWIYjt0D\nKU+Q4B0EE6NklsEniKm5XIea7ifZaFptGMWMkGZjtvmyWcid1+v/aI3dbvAc\nOkjLx3R6mYgcEcIBWxnrUT5ZxO5AwDOxUaCyJzUQOcllQRmsmkT51PjXioE0\nekRi/Wyyl4CoDvscuJ0yCJ5cZ+F4OobW9c27T0yDIux+G0AWA5KYHUHHKMks\nudFY\r\n=wp8C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7E87QiVg40cFjt2RYaI9l3/h8J1j5KjRQc/yb+NNtnQIhAK9I+PGHBCrwH2ADz3qopr37RSDmFExKgMy0jTIJnCiG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0_1590819176402_0.3544462756136073"},"_hasShrinkwrap":false},"4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.3","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0","gitHead":"239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ThabNYP9IRF44RK2BFKbkUMfHW0Xtw0I52C51j/ptxvIi3D1z/SEZCGDFSWPz8qfU/vyg+oRGd30YoXZtfvV8g==","shasum":"c44a1848fc8753a57fb34edb6fec41a16bc96e96","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0.tgz","fileCount":39,"unpackedSize":173826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1OQRCRA9TVsSAnZWagAAqqYP/2wjf/KaQ7qDKyYrTd2+\nYYd8PXUIEXiUT/VEw6ujYV/JNuBPtj54ftOP7JBl+II82sbE7ejvlcUqb8og\nOcP0BVfew5oZGJ+PyjkPJXx7QOWs5x5O955QTrGhzhePvFiePYYeYYiUdDnt\nK4cRszVPxgWvQno5aogPOkgNAXRJa3l4n9V1yqgRXwjAoE5c5qiJmTsteIY5\n3Sb+q9Kh6aHfgDj15JcEgmMSc7fTgFm52hCdxs1JySCw+Qb7T6uW6EnZ2BuL\nU7RLRYKxgxGAL/11ZAbO+OOkKAPdXrsEjsfT2YhSNh6VMIWL7e8H9JJ4/5Pk\ntQVe/Tk6MzakPLOhn5kNnwXgnfjzdRa4upWV66ntpfhpU0Wrd52SM4yAmC9S\ngYYtuZ0I5cY7teHCr/XI7Ye4EpwIhlwDgM47dFA7ct5maP3PfTk4IPFpBrup\nX18HalwGyS91liXEnd9SPnBI/kGjVzbxRnkqwaIy8zB1z8OmVhyd3A9tycaw\np0dRp+4TRo6xRveaO3mgGEuVYiC1Z+hTtroLZLzwajz9p19CJxt3Mn2rCpJv\np2xNAsByzL9gTW1IxITK724VmgzskkGwU7hzJckD8uxVso280ASWTwn88ntv\nhKIV1qvRfBlH1eEMzoW5ry4PKqZJRDfWEn56vkcw/hfiIhwjJyQ6P87gbBpq\nO+bT\r\n=Fkez\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCig3Zxrh0IVYaCkqGXXNOVpeRF5Zh4RnmZEu8Wc2G8tgIgQc1mpRZ71U/VEbBARg8DqpN9T+cXtoecLYmHQuGenqE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0_1591010321067_0.5982096008804854"},"_hasShrinkwrap":false},"4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.3","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"816fcc560b66193da59418f1edf0ddea4cc57f04","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-G1ws2Pn9WysEKJTz09YqjbRuw88quJFrsj7v37CWmKEPEjhYCY3lPgSCmuL7J2QBemybv+0+KVQ6Kf/5TCs6pQ==","shasum":"841772d5fd075e3eae7151074ac9d32e063405d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0.tgz","fileCount":39,"unpackedSize":173826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1OSCCRA9TVsSAnZWagAA2l0QAI1G0022g5g9lDEvDa/P\n6BVDWFk/IELelOt1/HrzxvxlxQKj3GWbuHoiIeazcscmNTZWhsMoD5xX1jcd\nIRDU7YpYBfwjBovHxcvauU/szkGw1veCByV7doLO4caTetFYDQBZK87uRaVv\nCw9IHYqyM4TYcRJJydwXgdla2UwglUVAaeBfyVyTGo8pGuX0uGXgiXsjMgTa\nz7P76qy8kRZulHJgpqWxOVtvWxfmPSwk5gCqMTxqN5bxTVqb8jM698kLFD23\nyxSAktfvluN+ANwKfKqT4lxGvsudebpEU6KwBF5C5pxZaMBlurXi5oqyTy2h\nOWfn1eUPCdiUemfJguSO8d9aqfxC3gQnJr5lgVoZ329+QCL/I/ZjOMA6/Axu\nXZ3wAjMdQsVoX23NVNSUFMwa4nvcg40IXu8YmB9uGpiKwy1SqtHI7VkLDmNu\nQsDsDOMhB1QQM8QsAc+1o4O/fROuaDG0GG9OsEQucZVPA3qAmTpogcIEiyAT\nkeXP8We5/l+9iINTq18pBsvK2VEfSM/3sHjrQWMOOxQ2qShXiew18tkshzIA\n7W49+J8XFPtkWBns+7fgPqIrkNV1IaKg58jCjo0BWWz3jydbQRUAIKNGOLdo\nt2RTxO4AR9Iaz56n1xi3A++cAAtm3JdyXeZ1VRKyKIX6m+Ptb0PnCGmKzkFQ\nkxuG\r\n=S3pO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiEfnj9jBsfGPxwGB7UnIDVnRM+WlltbN2RXfBRguSawIhAJwfNst6hpUQl2exJJsEZZuAgLbj6AYMYRbiioJjh6G5"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0_1591010433736_0.5291464974003766"},"_hasShrinkwrap":false},"4.0.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.3","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.6","gitHead":"15762236af1402e36abbfcee59f79b599daf4fbc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.6","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/z+xdp7U5B43dZTgTxtwWvhoFTBNFRJOrMELZR7r9ExiexuV/lCNLZ2zr3x13qfico3GF7WTpt2aXBw+09FEdQ==","shasum":"f3eebf2375085bf409eb55bf50b8f74654baa0b4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.6.tgz","fileCount":39,"unpackedSize":174072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1OSUCRA9TVsSAnZWagAAvXoP/iRZkfKh13+itOKfNFJG\nvo0cBASK3l25DORyXYBZQbMAm6p7MY5V1UdQVc1y6f6t1dnZKGYyaCtaNyXX\nLFkrAIzlHb7nyAEGLx0rqoyaMnYkIl/WdduOOV/BZEuK2UVwjowQkVv14Mma\nnk1LUcvc8YqXFy5dSeT2yCpyrD6/ayCqnAaSi+KwD/n9okR5YrdBzPoCBOhp\nJmNSj/rYJcrV35H8tG/c9Un1cv9XzyEJY9Svgqxc0Qy7EvNhGYSt3vx+nPt3\nsYffYRzdHPwt8HaWIPOAjuA5DtU+GrT98nhBtUuVQfB7d9orusZjJf1h6VEr\nnBSktHjKHK8qdisNqd5wegqhmLpgd07QU0kGBtAX1iJvULWZT9vYwJ9+LE1x\nrK8yAaAmFKjKrvtGy+WHSROX363sWyAZ5biSqLmfTtI1bqtzRRZp7AD8+/Aw\nKAbULKgCcMbn8L9nnR3ISNALyi6usjXS1vNpGkevHvtl9cL69RWVQbmsPjnX\n3EOsy58wxDzBQdy+XtKd25gSsYT8oZ1c+vGSQnoC8fUWWmv4Rwro53/JZUm4\nDUU8UGSFD5bG0FBDz2Fkr00RscplObbCe2Rwo1sB/JN/FRBLBcuYUC+pddWU\nbgPA9ByqE9oLrRwVK/kOvzUIaf6bIgf/DzPiTNgIVU9+Gm0EhR4qDHEI1VPZ\nRyAt\r\n=1czp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDptzqf1ZxxLFDyrZv+nvzxZaCdPFxzZhSgKjol3o/sLAiB+2/gTVk8S60bAWrjNGvg08tKLr4wUQMJz7ioQI9ZDDw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.6_1591010452488_0.8605217283963771"},"_hasShrinkwrap":false},"4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.3","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"15762236af1402e36abbfcee59f79b599daf4fbc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vM0s4+UlTqJP2Bf1vcI7icIN73XdJzDakmsItPhE70ppOTsS67V4DDjbdKv4aB+bqIRtPma041wwi6ZoL2bXQg==","shasum":"9ff11f2ae87ef6fbc0fa33b22fed56205f7bb0cf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0.tgz","fileCount":39,"unpackedSize":174115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1OSxCRA9TVsSAnZWagAAao4P/1s/URh0bKeY6AIKPtp0\n5IT8ke05/k3mH1AY3pwIaBEqOQegk4dRa2qW7/P+urmsypKZuxEjO1cj7cTi\ndZdUIC6vJnVM15ULb12vxBZsbPBvqI0El74jZnnIE7tWap0U1u/K7dOJTUGH\nLTHBdV4epZPowg0g61lEZJ2BPX4URb14MYfeJf5YHa9P5EqKvSjfScxlfcpk\nCeXekcvnvvcCkwLza72kXQ4Vf8N7vIZ/sZNFyQ23+gEUrYracHl7gU5omtOK\nfCQ5AqK17SaeDeJCWkO4j6KWzuqdACYvy+U+f/p4lqpzDAEUuOP/kWfCbLpX\n9uVdAZX9oIvncvKk4sLTaqQMZv39c6hQi7TsYm3O0nedT7/r5c5Nvw+4qWOJ\nZiNCMnx76bfwE1LnZcg3boDAXFTEATkhrdb8td1xjZiMfulvH58beKJdFI1C\nXsArWLngXdtbW9QBDKhuUcPiVzAy2s8KvwIFN3hUe1lFFVbxxa9JwTJFnuLH\nn+M+Ls3FQKnAWPoofYBwsoD4TcU+4Fy0o3Z6aedQ81X1FgYlcl60lzZ7jMZt\nuxhKDoFbQe22NRB6rfLEqMs6Gbfmv1pxWmafy5jEc+AfYpYGjEqswf2ydlp0\n6yypYu6oZB4XQdV3dNWI+zJ4Tv3ujTL597dCxyakToDHy9bK6OjgeP1cxruP\nXvLe\r\n=m44u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR5yln+cguk9JIvqRHVal3DgBZq3iFpUzaSOkxyZ01pgIhAMvOFEmWaiXX05vCKvy0cjpwYKi9j+i+zmfJnNMFvLOp"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0_1591010480919_0.7161502063370959"},"_hasShrinkwrap":false},"4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0","gitHead":"a7c8b4109425f0311c52c6c0c144ecf4f4559c28","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rUvXv0UvLgbEp8L+rO7ApoR1C4P4cRIsPHLXa+nayoKjDII9AW27mhGtueg+rQgI0YllLSXaaeoiwZwdMCoTTw==","shasum":"3d21c4c03d1cd2046ab058463c7328b21be4e684","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0.tgz","fileCount":39,"unpackedSize":174115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZfuCRA9TVsSAnZWagAAIvIP/jVHVd9arlgAB9/uhI+G\n5+GErUCnhVXTRwQmybKQjKthxur4DQXHihmzLK8OZz/G7iwJHhU1KSSS6olM\nPP9Cgt4E9qzc1e7nx3sXVy2QnIx3QBedxkcM7Ruy6GBMFuPvNh1Ji/9lUgPw\ncOWtFnSLVl+/TakuItsTcJTOjtI5zPuHrc/Y78kl3U77WlgYCC37zGXioceZ\npRZQZe57Zwa1rLcOZgxQmxc6WfiWPPko5XDvHyJxNoMgXPdxMg91F+Rkpnyj\nMhRElYnMicfZ1v8H/FoL0GP0A2VQpl6W9kAWIKBFrMZ8xFDW3HWSh482/+v4\nQKmC/+v2kP7pGKxNIoSFrasyr/ExEDjPp4PgOunzXjE6+/p82SDl9jSn1B7h\nxK0UL6dyLI4Wrs3vz8sRmXqCVXPA613guTirArA+5thUSURQ4el00nVVcWpv\n2LmPUYkexi8fMFsGtObuVx09MPWhF47Ny5TnsxX62yiqWvChLAkrAXTFjm1R\nWzgHDHCIDDc4VimuYbDURvS7cuI4pPbGOE/5ACHNI7H3xVl6Ro4Q75twuol7\nxEPpLZPLXLtehz4AcI1LqD2LSDxiz0lyl0VHRNRfvbC7tTuGTR+6gu7SWfi/\ne1giE6TASbZr7Au0b/xMZLpizx9FAD56gVfktZ9tvbISy/W7YN0ANJsuiJvX\nEnAu\r\n=s0iT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA42cw/9QihVhbNVbYGFLzFLt6xs2MWDWsk5PcYFXyHTAiEA+EOHb8o0DNlAXYxZ3znVjFpvOlYr87Nl/U7vSWF3bE0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0_1591056365477_0.7466786353815402"},"_hasShrinkwrap":false},"4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5e39b223576cbc6e2890b386a713147ae9d5c05d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-S+n78Y+jXBUv7U5OgLbyvpUY9xp3qyEu7RSxH71JRR0YGUpgZ+E7tG5MW56FzwvUPo+/HC+EyHJROiCDmW1FVQ==","shasum":"a6ac05b85399016fa6c952d862b8a8f693aeedbd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0.tgz","fileCount":39,"unpackedSize":174115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZjvCRA9TVsSAnZWagAAyqUP/1NZklR5k0K0vTWDE9D4\n4NpQ5MPN0CoIVR+MStj2DApVSVDmCyrMFc6BlWdoTo6pmB3dybfM3NKu4wWp\nXPwsVyQxHdfE84hWy8Fd4i/9u9VwmHAItD6SMgB//tzUP0z12hSBqlW1EdjU\noWcSu9BceAeXAh2Z7zwCa8VLyTYEyjMlRmSpLI4NA5mg6yTeD0L2nwo1Y8yc\nmUnilaezTIJdl6htvNsGlhh7lkfSAstcIO3go0rlTkyQzRQbhtAotaUKV7H8\npbwTkl1ZGw0DjZbQjC9zfcy4iDFf8XFFotaX5lMuLj4G06xXqQryZsLAsRMl\nRcfvre4/HQKWlneB0ciUA6BFUBuemtA5jpaQW4sqrxOSm+mD3Xibpqkg9U3n\nGrzy/Lu2mKgQWhngQHneJCcxy7EwEOCveptHYJFlJDePPP4Ym6so+r/eklaX\no/FfQ2oHU9d1EGKtiUdy59PcyuUvRGlAUJocVhOKYZJ4+ivSFLqzVhAiOqxP\ngYCZzUC28K7H4y9ZNNPlAu0ASob1rCn3F0LRjkhoymKnqiJYcAANYecMCnPL\nzDMG1SGqjMU0P8l1s6mwtH/HEIveHcNFCGe76guvmbQhx7TKmIEJq5OcwFzS\nTqNesxBfeqL+6S17D/Jokd1TTVaTEdxnmedxlTs3hJKF0VQnDgi8DO8tLNOG\nmCkJ\r\n=e4Mp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJrfa+w6a+XqEdEpviUNItZKjQ8+fJz5Duc6SNru0wOgIgBJvF2dILltz13stCz2ObJfQK2vDih+H6WgFAnH6vU/Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0_1591056623198_0.4272649720990458"},"_hasShrinkwrap":false},"4.0.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.7","gitHead":"fe3275dbae0b318aea4688f4afb0ff933f5c225e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.7","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Nb+ng58qw2j6FxW6fzPSUnTI7id3TnJirWh/HNUDS6OHPctWfQwVD0xA3vC1Ymw9oxv8odFooeTUQ9aSG1bJYQ==","shasum":"8fa6ee116bef2fdb3af30951ea421cfe1d96a83f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.7.tgz","fileCount":39,"unpackedSize":174361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZkPCRA9TVsSAnZWagAAOCUP/ivoCT4GUr7L6DixfggW\nvLb/Hzyk7EobbCGQUs6k/c/T48B6HwTgFnynMzo4tpMKoS8YNtChGl7bdU/+\n3+9Rp8CstdIOsTu7yeBuiQOtvf4JSCUSw7o4/1taBXBehI+zEFI2UHE5cca/\nyA9/VI8Jfgo7k3YXoxsyeCYCcTHsQzu7UW9qP+LiVhwkKIC0jtnH906XjJPU\nodzOf3rsTllslwexoPpPLHQZosr+weoJUhxAjMik0cgOJ0EnrVNKFyhLfK0R\nWwtcnx14ZaORyOajYks4pPnpOHTQLXk6+rJiU0lh9U2Ie/AEO3CUVgdsaISH\nA/nHEKSepthftfdGGfCEhiX7kQKdU5m86BLiLkSNzCX2DT3JH4k8n0GfwVWZ\n+jp/OIlpMlfDL+dCsKK63n2GjNutqJYOZHwu8cCarusQVA4/NhZnR7iITPFe\nHEdp+1P9kRf5XpIFeuF3Rp7/M7wvBIm9q7ulB1NzXCoKb7Ar3zmlbO3xVwuj\n/iFZtscUticYeYc30z5rQt/2kZGlUwXthc9QQXHGSReSidKFIxQMT/g1nsae\nlmBw5F2IMuxw07KAieTysZpcfryEyqVxIWm2X46DK8RBf+zjD7eIcwYFrbLD\nxerv6aQNG/brbFr7xyaQUzUuVkzwR5oBo4W9rrZKoWKpqlyHQpgHbq8cxrsG\nX5mE\r\n=dNtM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOulakVo23Ho0ITdzX9qa0QGiwklQserYpGwILfHynqAiEAqKKzjxso1ymzKn0Y+x7iTRn2ljXs6wPzxQG2OLE1bxk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.7_1591056654874_0.3402407574928277"},"_hasShrinkwrap":false},"4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fe3275dbae0b318aea4688f4afb0ff933f5c225e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gcixk5Yvo3/hQsiYYalqqLX2ioULbyD7ojh2QoqO1UaRP1L0meHiyPThUrVVos/1kHViE+OohD477xf08v9eDw==","shasum":"aae5a4e565827727454cf71de32f417d6ea68e4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0.tgz","fileCount":39,"unpackedSize":174404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZlDCRA9TVsSAnZWagAAXJ0P/RXf+REAAp3xE2JmzNDO\n2Of/YjRhZD1VgOgC0dseOOZTkfFtwZBzK2KPznMYkCl9JSCssKdhEZCJn195\nBQo0nCAzPfgOjn/iALOsEp6knF3WcN0qTyWCRz2Ikzg9ookxbO/WoN/MJdJS\ncGsHm9/PtG82VZXPUji3LhxCFKbcLsHorWvvh/cqZAQmG5nfpJhrhwxUGshv\nI3SDsGXLjqw4MQWHFkhF/DrMil6lNHgb5nyfTko+oYhltYV3caaGM1aGxUDM\n5n042I5IO4fZ1jAMrmk5Ea7Q/Abd5t4IH0GXLDlQtQAU+mSuaSQOSTez4m96\nNfaZkZzxaxMKKOjabUmhokVbpNCCWQjGZX2NS1kUCJx0Qt/+6e/4h8ZRbn4i\nQmJqtuV4SG83FrnQn71zn7WSRp+LCbS9UR4wBMAqTCCaq+G6A6VVCR0n8gLe\n8I/soEEWE1G5hcMFV1yFFn1JIi/fK1aMvWUtHcVMasqaD2uwL0Bi5TsXjnqT\ndC8mWpmXrxbJF8Ec06uHs4dfnuIYTuPnXASWFUPCd/BJVvJA0329zBz4/0M3\nixwrP15IBm66DccM5t/0f/pLEYcUeDNcc3TGxnmuL9MFCdVjK7AfJJPpeTxX\n8msfflzswRbAJdYRE4+ij8nhlA57ooS2KiTTVBwkh2LBNpI07xw/TwwihVSz\nRceh\r\n=hO8p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBBvslD1LGTdUIJ5rAuvfF3PLUHylGpbzx2wPer8E50AiEAr7BBD1G6YQvmWotq9S/JTWx10GWpeFpFztNMTwnWxqI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0_1591056707032_0.8401710456354345"},"_hasShrinkwrap":false},"4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0","gitHead":"ce201114893b3c091018a990ce8ffde95af9f6e8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gPWchGBIWk9VGF8crlc+u2jym1QunXL2+kN/foZZGABFQGBOCQpa2BU1whE+3yRI+tAS1l7IikxIVmpYvADhFQ==","shasum":"df7f128abd316c7fbe599999e161f3abb1590f72","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0.tgz","fileCount":39,"unpackedSize":174404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1bdOCRA9TVsSAnZWagAAyoEP/RYnSg2XDLjd2DO9h0cY\nPTWwO2mFJ5+DuI1PPVzJWPsDi6NXpMhoExdetkYg2OyIXz4UgVXjDb5YKLFI\nPbCKVrmhEHorX572ZODfZyBvUzdRjJWBd2zUTsi9G9dnyDymXXsp8uNOyPKk\nhHEu4VVOtnszbqzaOtFov2z7eD3xLZleDRQn+0DWJXfHpoaTNRc2Om40TKYq\nI6kbeYxpiNSeJyS4C3PSr4sDinfoW5pAb/PIA1OgYjqPkDTDUdP+FUnSxMI9\n0nCBIHew9XIvPO95SsAeW9oKUViWDvIJbYB9WgDvw0wkcKwLW75Ka5JVTS9h\n5Lt+JRM7LD60GFjQnTF71zvVRCeb9DkVOJP3BbAJI3O+GvxDz/KLK9tVSIt5\n19Hx8mJGHhiqBZInhZFz4Y66DaDMtoxb0BY9VezBp7rfiPOlDfTHNXRte38G\naaNCYr+4LhSmXLuPVTOm+oFLc1k0O1SgIJrsYWF2ImLh7E3Qzry3LGvigWf/\nLV3pY0WebG8mLcnv/eobGAFsizWB6FAx+KWGo/J1G0z0bRUHZ5NEpwaxN+nT\nbmOKIDy4kw8cPTAMG5oRzQQtsDgXCvcUI/hTTm4CckEBWWDbJEPMfXpkgc1J\nVoDhaAtiaPs6Co7AnaKUKkyyiwmG5vxo9ueFTPedB/sYt0pKyUYG8O7iOYZ+\n1dP2\r\n=QW3O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFRE6kwmpnAQDMxQGVqBPjs17Wcv2N6Xl8yTHGBNTl6AiEAu1Hkjh2kZbslchEZqwmV0wHeNkICiPrEnA5720OR5Y0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0_1591064397569_0.041887133360452466"},"_hasShrinkwrap":false},"4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8806fa8cd0012dcd2580b36f11d04405b73dfeaa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mgE34Acdf9sMbt/q/+dnkqHqyRZIKyfyLqUnM5A9X/dwTze/AQUmZfzzWYv5k7ltf0WbHPqAZ3BCsq2nVd64DA==","shasum":"652c91259ca3ad763fddf3bab3c3df377ec143a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0.tgz","fileCount":39,"unpackedSize":174404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1bd+CRA9TVsSAnZWagAAfrMP/jVHd70omM3KuZ/RsSHw\nEV7atCrZjuSgwe8oP2dHkbmI0sAyzBlGIxOdTMZUgv+/1KnWJub3XrdLmxsY\ny5cm69tR0XZQwwTkl5VsexZLX2Y/2sjKWe47R6TBI2Oc9BkBPerrxFa2Gwwa\ndxZRw6wRw5q56/cPcgwPsOjS/Od4HGMY/NI+KCPQJH8gUyExCv1bkLNcs+qs\n3+xkNTcIZ6uwqPtWaEeKfSmgylyEYGrR72/4g94fpoxPjthDWIC+fb8v8tZQ\nhuH/WlQ/iUE80o/wOMe08QjZknNytzaBqo2QG5G8qMNgyZv0tzCysfPFeFFF\nYlWF57snEXBEl/m8849NCIpPVPuKtgO0PdxRGLvpCoeD0bY+HvH7aq6xre5j\n7eEU+YmNoxx0kSK6ehCQ3cMzHlu+4/xKr9j7PKZYKMFmynw9bSuJi5TDKxNW\nYo+9Cut03h/Ya5lFBL3PX2dm6cuxllb9DUmHvwEXLmgZVCC1McHPhDqW1zP7\ncg+b47nTkgP1ijTIurB1GCQuwvK7GhkHWGIF6stRQBDuDNCb2c4uLFwtZdfk\nnbJwyJZJyG7c1QYqm4GfYonfuRdz6Juje7ZRqZrYgMqegsg810pQyoUbYSRl\nqD9DlzkvT74huJNPUKA+vdXSDCmPoN2LNzHzD4ZTWDcCwwjiXgmaS3bwT0sC\nk7V4\r\n=WtZB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqmd8pzcOCoi9a+aulYyayPcoSMWGyyLSNshBIAhYzwgIgYSCutI88lLSQEjWMYQrBGxZy/r3G5lxTctk5gcRW/eo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0_1591064445463_0.8053351051168782"},"_hasShrinkwrap":false},"4.0.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.8","gitHead":"82e4c55207c528b74a8f4c32c4aa6062605885c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.8","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-O3bJcMtOslaTExEEYjgSwGyaKxhRrS5tbcmKvy79frF+zaRgQBZVCXPL6+iwcQJTrXrTDyt6POO/9aiEqT+BnA==","shasum":"4c1cd73e82bce93c368ac3808813089c9d0f5b2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.8.tgz","fileCount":39,"unpackedSize":174640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1beSCRA9TVsSAnZWagAA+xYP/3wnd9yxulN/zCRkcv4p\nc5xlg+hZ5VpiDNmBrIhMYpIi0QM/j/nsc1Ro0wWH76GUgyx7SDE1o9HrTB3X\nSkjlcmVtWFpFGf4jeCpdAlqWqqLJYUxN8HMgWDghm1aW/AkgXg+xM7i/nupK\nTNO7rbZTstbPWwte2XfW61u2500oQrYsQXoKA2p1ngSKqN7zVlqF1EEPF+yb\nHFzQ91mWmDCAV8BC8R+MmE1WmTVUr18LkAfPLvow1ls265J+Oj0n4gh0cZ11\njbFwbmWU7e3vm6lJlirW7gtcS4WOptIE8uqjoRch9B9IssEyX8BJUSsevriD\nh1EQejInmZC0eNUPtqdmeOcQvV9AEoJTSqA3R4Ylh2TG8HbQGVg980Z2Watn\nyTff3caRb3sl5ZhfUT87lg3Vm9/y6LOrRKNjDdjNDD7ewYWqdxRawL9chaJr\n+4oiLRhyh28YuZPwJ6hO3qGtksEnJDxtGtCw4XU1EDFoKUBvA0bNWx1ktJc3\nYxcGSyaEic70E4WEPDYx2n9BntF93SVAjVp6uxEnnHZfq2nRIhkHKvwsJ4YM\n95a1C+RTa9AeS90Brx0PuwtX6zm2qgmoAqG7XWQui3wTIMrCXMb4jOLK2ugS\n+QKlGkh2saOgDUIrWj0+arywlZK3reI/I3/hg3WiciQoS+2oyEMM1SdFrljM\nzXYb\r\n=2P4h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCT1OYBU0TPs++7h//GURUey6EKRMLfJxGGzDtnCj743wIgHgXXoBNbz8qTr1ziGyjJ07+r8TmGCJCQm0hJass51TI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.8_1591064466191_0.5076730119893149"},"_hasShrinkwrap":false},"4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.7","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"82e4c55207c528b74a8f4c32c4aa6062605885c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-P9zcDEJNKMglqdMil23RsmHLrUAq2gCC24TZw1YkJyHab99qsr8a+3WhCrba9EstE6YxHtZViU7FKi04VNh5EQ==","shasum":"6bda61ce3ac1ed55c371b64bd2f5594710b00a29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0.tgz","fileCount":39,"unpackedSize":174683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1be+CRA9TVsSAnZWagAACWMP+QCtmN0q772o1HY0KcIn\nh3LvHdrV8dHRFwvXHpIzkcHqJE3oT529ctEvD/eoiX5vrWiwnPybAl9qs821\nyYQCycqDP6xD9KZ1scxvh3lmsHMr7cZM1TALR1V+D2lA0L47cGIatmZZspH5\nzhW63wp0UA2iUWaUNlOk07/GIvPVHHFpIU8Y4jhqHNRTzmWc0QpAmd/X4YbR\nqcPSvyB4x/6/QUixzLZHaMb51uRPkHrtwQUl1m47Esznhs18kwVCdY/VWgZo\nuXYJQlQ2RlqIZ4RXUYTGFZ76mU1qse43hfnddBJYw+y8LncGYNoejY86LdJy\nXmgts0cnnVHr/9RZ0ThBIvEFPsXK6ADEmQkp2jhMz2HeTY6UBGVnX3kvyx6u\n9Y6z7C5qk7UnPWvLIy2WYU32jTLcvF/X/nrFILjwkHDCTFZ32aUx+m/9CvTt\ncU1pp2dzqNsX/65oLcmtsov30/KN/5XBzMOhXdWofPHaRsNv9fLcfTYblcRT\n9CXWGKXySogEG0LVgprHyc6rrY+VxThjWGIrnFfHLpjz6+0uUZsMwDkVso7+\nODG0CUGUBjlRL5gNIjLh+fDuENA7UAOMHVvccPWm4nHxInjbBdMC9Rsu69W6\nIuTuUPGvlkQzeKYnCmiCUaSxtTyRqG17gmkhyGQqtJSEYRZU7JMaBmhEoe92\nlFbi\r\n=yNVO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKsVuDJiC0IPvFTkaNa8VsCkdPpcxMTF7T94UtEXxxTAiEAnyPDkL0kJHKAw2nJLYcEIwAvfXvdq0DEorwyQGFexn4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0_1591064510028_0.21416176160031863"},"_hasShrinkwrap":false},"4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0","gitHead":"61b8ee84b003a248e8ae805b42c6c000dd994f34","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7FN52D3cRyu8ketyq16Pl+Rw4UYwiQ5e6bCFngA3MQKyGqFFBl/38JssiPJSRIH+R9OmSSobCsYYVGGS1xbGVw==","shasum":"bdf2ce88edd40769931add86f27fadcf7b1dfa55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0.tgz","fileCount":39,"unpackedSize":174683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1+kWCRA9TVsSAnZWagAAulQP/Rk4mzl6fCYkZgVb78Y9\nYO/RvK7lS6sgrIdGilpRHOA8CYqmPhqxhJOsEnz4BBGxUchQX1iDHwoqqVD6\neyVPSiylUZUBClTjG3liR+hAO5jT5cxsOoXxYb/QrEl7DBXHpTmNRQXS/Srp\nVAefwZY7dqccfTTCyjt14bl9g6jsXBV5rGYZiwdacVBpQ30bMC24E4E9kg3T\npjuAVbU+RARUUyAmnB+tSuwwnjUb2hu7yU2QgjXGkxm9jVl+/jh4cumyvpUG\n4ptnd/5dF5ThEGj7AbIvCwt6aOAuvUqIlSH6Z6iQ066JdHkgL0oZ/0OR7Io5\ng10Ja3rGE6RYc7krAp7xMbV4nlSFwLBmEbjJeVJKOHwgjuLtFzzEH1LXcdZS\nnfuSFvQ7r84Gr2hDgXClFQeXeIclIgYIORQuFSUmEXr4RwE481CxiXdnYbJf\nwIYzEILfZboIkq2kPu9fSMGv3zvQx2dmxwS4tMnDrPm9R3ccQVrYwI4rki6g\nnEXjWLIGbKaNR769w5FkSEwkgPaIbMPZDQLWKswMYb5jlOgCdguoSmt0WB8j\ny1S04GkVAVPRLrMZZLFmAiqCH4OJil661MMB/HhuWDbCRilbQQaXOKPOWo6e\n8T/Zd5UhZwabxLYuhaQDI5JP+FUs9epmXbHiIYkREdagO9GA2081aO3SiM4m\nPk3n\r\n=nSEb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6K9xemtLEkTI2SU15M98yRJw3TJy7ZMqo8HbHR8hzfAiEArsEUOT84gsz0/m6lm/S7vuelE95VEh6YVYZVSFwljVQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0_1591208214422_0.473004746330268"},"_hasShrinkwrap":false},"4.0.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.9","gitHead":"41e1333116c708e2728caa706c220f3bf583bb78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.9","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IfNrw1EMJvODNHhbiEaFV+E4lp5kQph2blfglKAGa9aj02A9zbO9dvSYKeLN0n8OsSfu9W2ZaPkDi/cgurcn6w==","shasum":"fdb64e9a5898cba8c09f59e73122dcf61a2f7531","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.9.tgz","fileCount":39,"unpackedSize":174919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1+mcCRA9TVsSAnZWagAAksYQAIJqmi9Bhou0zID9leAm\nSjmvTaos35W0IssF8qNB0f2B0VgTskiqopih0KAu3E3RkncmlA1pNe60P2Nl\nuf1KZnBCpLwNeCVRJlFsSfEFpu6USEMzBEBj9SZpqTNvy9p7UZ10lzTPVyrh\ndn2tKSM9VP/ZDtlp1RqEpmUx1Tq2tMSaAlrm3RyJ78rob5NPW7XsCt2qbyhu\nb4WG+HNRw1gkBYrQuKq9BOA4pYyFWINdHqWBWgDFw2IF7v1sMpchF6LvE+Df\n7Mhy6HXCUFuYur5qBTyzp38oR99AXytAwSljiENHZtSCy4c85OcA81VVYcIU\nlvdS20A+W0QC7MYG6LPYZ0Sgznghkej/bIVq5PBSI1xXDhipGz58tObSWRZa\nJw86j7lhX8B6h5nvnnkNOuv0CPwaxyOlTaBQtykqVnBOAX05FTdOMG41pW3p\nRob73Qo5N4C0jT+/sPtuOjzUSzcE5PACkIEee6MFWR1SPJN8+1r13aDkB9Uo\nxyCmA7t2uMLf1ER9XX66uj7P/vaZbVidM68lLz/fDNOlexWNCaQLvflOSDQa\n4t9MJQnSPpZoX1zOtvxnQGvYfCc8GyIbo8cKfWvHXLMbA5XjQ4TXKnRk9F6Y\nDx0dLwJ21QEtki12Mn1CytyU4zdpv/w7SslnGHIEC5dtB4JLN5bV44Fye3IJ\nkf7q\r\n=dBpv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEvn3du10ypRC5+NTjuwLb2u800j2VHjvhVlMNc5TM8zAiEAh3/6YqEsPKvmndT46u+7jwlCSRpbd7iJH/YeACoYrxk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.9_1591208348071_0.7430544083001687"},"_hasShrinkwrap":false},"4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"41e1333116c708e2728caa706c220f3bf583bb78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Kj+m2Mm/trYHgHP5CmOAYAYvTRmPyDJe8O+zIgpo94PelYcUreEfAKg7ihJ0ay2G5dUZCJ6Skv76ZvEMcl1Hlg==","shasum":"e91dd11f440af7c8e605efd9b5cce3cd1c20cb13","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0.tgz","fileCount":39,"unpackedSize":174963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1+nMCRA9TVsSAnZWagAAqjgP/jnbgj+VmsZPrzw2I/o2\n1ozFEaiy8ePhYEtwzHBXyLDFF21nl2aOh0VKuupsL44aPcpA4M7O2qGEG8Id\nRCsggpefgNSKW+Qi/Z1f62BIwYfFz0/+4uAYcJ5348FPGogHQUSW49ZMeHf7\nlomB8V1nEiL1ipLZdVK0mFk6OO8VRuqNFnQARTUaKPhHY9nY2t530OygHaxr\n4qEpyZMdIacejJGKO3t7QrAULybx0pGXwjYF3C0b+MJre22OXVOqlm/P4ApH\n6zxPrLJUe/tpQZm+5xSBxVdQ1Hju7Ml/AIkMGg8V+pvaVpIPfdxIFMkb/6la\n7B60+B+bBDKJ26gxG91MyzRgiQsVV6R0nmr32MMbhRDjuT9E9BbE7hUiMHPn\nvCRGrvjVnCVTLs8LRrXuRbE8qMryyfmV7DV3oMF4/+xd16Y5JV2TWPybubUr\nQqaSqhfkEQynbc/hI8ayTGUv9tIwbFaQIWcFwjbXTxtfEk2REHeH/ETBXCFU\n6IcGK5eZlWgcxC9KpAEcxWry6ThfvKOJZWwkFLzmZcTOHs2HY26Cph1ZG1jY\nOgCYYgNFQ+bG2BnfKbaYGRYuNII3UkS/Lb79q6+nMTp6CgkryjTlmpvvQkDN\nqVHqpzWQchaV1c/Flgw8NuxLlOe/kU764NsgCUkwWB5zw5Ez+3uY0Hr5/G4r\nOeUw\r\n=V96K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJwT4RoI9KEdbO5Gc9P2ATI8/536cngbW8kW92DpEtMAIgLB3/4fFtHO1/dre23mDAPn9mSBgmNXjVQO8IFT/1TbQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0_1591208395624_0.739460830589667"},"_hasShrinkwrap":false},"4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.9","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e2963a5c7e1862db8f3059fe793c4124a4316127","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-S3bglDoIskjJx64gESxBlt98KL6R9w60Ehd3YJEYalabV/V2WpRgyKv3smacNpYRVU3sVqAI13NMB3otw+C6JA==","shasum":"128d17337c34bd02a1268768f0a7c40d75ff79af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0.tgz","fileCount":39,"unpackedSize":174683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1+osCRA9TVsSAnZWagAAHLsP/35eTf+2zhC/w0yB8Gtz\n2/5gB4nMvT6Awz92VmQGE6pVqYN1rMZ4Jd2i70cf+yf7CVTQ2SGGaHVlTsmh\nyCQa4fRQsF6/SFmn5IJ4wQRZKgWkwi6ZvI1ogp2VrLcGV+zZASxybjVA6mpl\nTZosL7rlEqsIpkN/gh3vZTIPx9GHpy7ImqAbZCQPjORXotphJj9RTEvBF1+y\nx3GI2gWqvhWS7JLIvTWExNL5F2aCAH8GoHSIyAsnVXYGlLx/w/9XSRW3uxAT\noUWrufuw5EQ4exd8YhFaODP32LjeWsC2Paj/wKqm5AFSf0nW4VzjYYlFyP+E\noB0eAaCIsqUSLUGoAZIaAnRz4+izHeQCce1lLpDcD0NjEEci0ozbnAGYyaBw\nyNkU49iMPQZJ2udKekLjMwG6oqe8dRVAjkMJxvFDdjGVUyz+lnjXCDCAX9TF\nLz8KLvGEZ2CbCHFJwU3mAh69HCfQVlgx7G99iughxTPACkEkoZ+IveiGGMqh\n/XA/5HRVsrMJTd9WzLq38UYqGypZJ7DGQNOlcVnul3JfI9Y1/Xu4Kty9M7nD\nPchfKyrqARQhDWywe6GjBs1433mMarcTjatOwe35mS3gXHx38LT4trkR3/Mq\nMghW3Il9xCd5blCc0ceBjKymn6IEDjmnLIf/ojrKFXrl9cYBKyvp8G+UVSH3\nHIQY\r\n=4pfB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEwP2omg0K1qKNuMLaFN70YpU5Sk7PaGh6+ESmurUVDAiAZ452W2Ex6gtEppPNyDJb1fcNP4YnvcF3zj9m0C1+zag=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0_1591208491341_0.20108704151873136"},"_hasShrinkwrap":false},"4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0","gitHead":"6f2e8f3680885be3462c7f9b93ff1e19e6e6957c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EGpxmoW6x0GLvNXCQsUuDJEiWrgIs6QEWcotFbsEQGopR3iAyugi8TyuirXQHoN+oWiVE3jpQ4e9ds7z1VfeLg==","shasum":"32886b36a6f6bde639dd191c223780c34fa23269","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0.tgz","fileCount":39,"unpackedSize":174964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2EvvCRA9TVsSAnZWagAAFJgP/1hzSJ6ciFXpU3C9zemJ\nu+NSd5eAL8mG4EPSgYIOof57MhnUKtbRnjMEEoPYIaZsp5JlVqmxdzmjZa6l\neMOUokShOeIWIt1+3vpg503M1jop1JT+sClQeUB2YeTK1Cu+bGBo5h7Zkd7W\noWFG+8wbB6uxuYlpea9JjeNXKLBb8nm57lYIYWarqXmnYK+Nsh8i5OB+5Ed2\nDHN14PC5tGL3z44pSzyXAkkZZtTtGIRkjHlDTnMjEmozk+WOkMhLw2bl00QU\nmBOUdxxHFZVCcBB3kfmd7B40kVIfdQ4vw/D2Tkdpr6e9xt8Cw/a+CSu06I1O\ns6Al9weInkSyyCW/pWYD4zmOVdFdunXC2oFCO68bbyvqIPdwjwp2pv49VPGs\nvX7uf/HouPPh0yZCVIIcrLmfaL1+7/7SBCEsNMKIn3ObLYF5EM0CEtedhw0C\nBNwhUDQ0q4mOXkKgsrNGdT6TLjnZRAJpSi+URW4kDuDu3+i1eonlKc4roJQh\n4UcUyr8hP+wJLOlrEER7ric0L1lnYCffuHn4zgurug9Thv1MhcbAS4A3SPxu\npg/C5sWJo9/nQHbXgjI/Ceh7tSCz6uUoIrD/d78QJGnfLFWo0IpE+tBCgSR6\nq+lfXtOc/TvvQKFLzs8el3ahswHgf6aiX2OkdSlIVbIz7+A9/+sz1hSBX+PJ\nKOC+\r\n=gSbS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhz+zXuIizJc1lUtVAKQwYXRUQFBz0b2jfCmXn+WiiiAIgXTx/mU2CMrsZWhkvo4pS86FwxviklgcYvMIyZDXy2eI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0_1591233518072_0.8630598058212755"},"_hasShrinkwrap":false},"4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"766d133bd82f8a257197a2a2c0f506d2a47bd5fb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rhAr8h4D8cFSIev340gKbd0nXNKzlsNviK152i/Ny//nXqdRNfqVsyn8oNJbn78suzRWueFLct3/XpDirkbI2g==","shasum":"1dba7d0374b1bc8f0d7a99a41086963e18caa1b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0.tgz","fileCount":39,"unpackedSize":174964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2Ex7CRA9TVsSAnZWagAAmlwP/jlzK61sCshxRIMypGDn\nvqMl5BJCZklKO2fHoKRWLBsCEt5Sr3OkelgcO5Lq3FFzzTUUIZMB/2H9u9nQ\niS1pWv0Rrz9TwKabMPlCLd1VWY9KQLEqzIOY4dpwsdmmr0Vj+V9+XmtJcHxu\nWst6n4CMH4yaTfpRX3V7TIMW5S+XSLjLeXe7rcpQSKmoqbxdQAl+5aMHMpv9\njHidyuf8l2WG2PNFolOzTYRSXr8/ncRypGlityN/cOUh9kmf7fQ5Suvu2531\n9idD/M8JjuU+ZlSHuccZgp25Av8CFCj0xGCx2EGjPKmtjD0b/HHoJbHPqU9l\nFT1rFMyj+5DkXloxY/Md+RrWonSOKkPRB/PC05dipQCF9rWwq+WLLf7v5obo\ng+OrKDmaoMMRiZoKOSEbO6ZjDrQsJAgO4WTgzoHtCjBOUDF6bo9Nzy5g5ZCe\nT9L9egeMTqa2jTzAgpv4sjOMjUeq/Ft1u+f4eOQIyRWCeXAcGEsVZWKudzM+\niHXSb68dYe+Il1Cv/rkn+CmOn2wvks1yP31MU+KHDA8Ouwgt0CIY07S7W6DK\nS8a7a1/yzDAZFycvtR4nnjmAp8slip91ftsQR/gMWT2dgPZ/c6GzPl70Wl3B\nUF30jafmm785hrGUVRHL8qXziCpwivoxiW8/lt7woALp7TaGpRsdyrsJ8trf\nbNi9\r\n=DTOM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAo7LAgDUv/rTiy/G9eNZdrBbI9ygaQL0ddTj0nEYGwzAiEAiJ95HaeJtwSxbUUJw9tJZm2BaVG0jQop8A8SGhAcx64="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0_1591233658872_0.20430846156424987"},"_hasShrinkwrap":false},"4.0.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.10","gitHead":"c5de7a82b9de951fc58b96ee4205303622270de1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.10","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TLtP7DvGZUjFIEpV4mG8SLbg9U0OtGIKttcA7Pp31aiC72d2TBuIrKvIeuLRk3+ZgRKWUzJHplouwitsyNPtXQ==","shasum":"c04dcf6638f1133151619a51401ca5ced70da099","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.10.tgz","fileCount":39,"unpackedSize":175203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2EyJCRA9TVsSAnZWagAA824QAJ9OD+6+7LQODJFk7fls\ncFKyy/FASEQW7dnqytp4zndu4DghN/JFmSb7/LL4uy1Mbjqpa5oxfMkKmyFD\nmOiOCMl0BgTutuSdFZvU+qB9bWbmfMDmZKG88JC3OT8L8CjOB+cgVWR/gTF2\ny4P/Wgcc++Ir982ZwORePWjK7Ebn8ezc0OmVMS26UTOSJlvN5f8osNndHWQL\nSqPD0imZqz2tsrbKzduM7Ul/vPZYkkcEDUKw5RzNikVvzA017NgkNJTZAKfV\nJT9OkG+HnopmSEVLP9CTYPegjeoKni3I6+DxHFntpVBhvSXxOllLtcvimJVz\nxIIxe7NyLOwOhJyS5KuP2I2x4gGwSXb7jY4UobPepdPi+f9X2WbMAXuf21XF\n1pnhv68LC9B9RnuoJCElfKx+znskAom82pD06hhZeGOcAy4jlQdUSlDtX/0T\nqnGifRM0TGwhm8sPt4RZJ7jrjEkJiMHZgOYCuUMIVIq6cSecC2YGv+cVetlK\nOcAh5A1llsWNZ+RfYHAhCtywCaEQnTM/fa5LWm9jyZsoJB6FfteHFh3hN48G\n4+TzpQLH+JCJPFtO+ZpSrsmcbNW+sg9M8qg03Resa5g8AlBqOjc1/M/+uzCt\n/9Z9gdP0fQhccL3MLM3254YFyuScQtotW9xB4dNr5lSCHf+TppDQzJSDUiYJ\n4p69\r\n=U6c/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+eXTMetX/bie26hEbp90wo0Tn+W1m0iAP+Cq3h3MuEgIhAJk1XlKH0Y9XEc1mwDW8xw16QcUaHZaLY2F7vK8KyXRJ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.10_1591233672929_0.03784962994131891"},"_hasShrinkwrap":false},"4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.8","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c5de7a82b9de951fc58b96ee4205303622270de1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-A718QaCJnvxZVI1G6YifQLzroPQo9ofF1d7RQQ86puipv/N9zHFpffRBx5JZIEt5lXdBzyIZG0/NhFO1i2KkWQ==","shasum":"26c9c83d9cc987a997abd67e82530b99d0db5533","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0.tgz","fileCount":39,"unpackedSize":175246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2Ey/CRA9TVsSAnZWagAAqS8P/RVuhheizuesyqwMAEQx\nCNeBo2c7mRBdQREk9GqjPxsAJ9WnUa61jbEoJfiX0G9sTDjMpclpYrdFI82n\nQR+mUbL/8giX3uNykqINHnhurPiVKVMUXOajYVQcN+CUQaCZaY6PXm1m8sSr\nO1NUsnT6v6PQpHGXrOgd+YRiy/45Q0ZlGThVgXzdloKShNB4wUsy94gd4S3J\nR/StApZsr1mJCsoynmQ3E2uPe0oOIGdkv65CEoSDpLrGLH9iZlbjYkQzrDS6\nQ0ImHdbFlWrgrb82C9C+4EaGdMXYuZdDPhi5uFKpHY9Mg1DIVGprLttlQdBI\nXTUZYJtdLdVWcFnSfy0twe6JuYbqT4c4H49JxGGYmeBn2ZJUyIPOkeZVdUgV\nxGUU8WZ7xA00DGJ/VY835E0nqofjZEKN7oRlGza2CHup+DD/Pu2uF39R9aBJ\nazFrild5IWgX5pXMrDKXN7ewAob6ycFTNiaShqVGYyKaff4J9j1e8wm5PRRP\nlNQUhvgy1efa1llkPY6QHfv2OwY2z3fcUIKUalMO04k+VluaiFFiVaNBwyBW\nElrGKLSAcHR2Ih+ElYH4Xad1Oto7DsmDH3YK4Y5aFNoq7fQfs8J9xYXUQsUg\n3S362nKXKGaFlhrMERe777rHZ0Utc4FREWANjs1Nt5FlV11wZ+aENEsEC4Qb\nesEn\r\n=FE3E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoaG5qOZXN0ExKHDlabRKknb0ed4e8uUrW1ns8s2KqOAIgN5mljhnzngaRZpXVvwQQEoVO8yjodkUFngZO3BvIzQo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0_1591233726752_0.6978353095160128"},"_hasShrinkwrap":false},"4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0","gitHead":"ebffce3fcf12ed082811fdf32557b9e597141fc6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-33i/fme/rYOSUtVSTVLwpvWXY2bUEhud5fWGX3qVJHaLCJzZiqr0i+SlgDKiMJ4Ii/NYQWBoB9BC7lJ/4oktgA==","shasum":"8e23b2feaa9ad0aa5b06c51d0398f9cf647c439b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0.tgz","fileCount":39,"unpackedSize":175246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2SA1CRA9TVsSAnZWagAA+p8P/05tBvq/Ew/HCxqoywi+\nzDffGjqgfSzUL8saxW4BXCzUdK91Vbpbq2m6M8SuSSyRYLI/idSA10x/VaPP\nsu+jBhp0Vb3ype8tGGDw/3EzyAYVQTagI2WnCcGXoBti9PbP1uQu/HcE3MKP\nljX/wUOqNhtUuwEs0j65oT+NZ7d+J0JMX+IrmWGie9S8IBvMFQKGREG0u18K\nZGAgxFkbZdkuHG21doZSkBq1iLbCwoWar9qprffiXHY9wP6SKDXBgAszPcH/\no8zobnAiLLGio2Tq36KFkE468skl8O6XWYk/RBBUnfcNh46mfTJVVS2laiFV\n7O662eeA0y6Z7JnE+b2Q6n8ul2JTn1mNfQj4yKucIu80SE6mdPc9Ss9oOH/w\nHVZ6pU8QRRdCej192NiMxsLKPg+iWYf6m3RnkJEK9QlUP1k38u68UjZBuldd\nZ5i7O1HuiNiWE2dSNFQMYcIQZSCc5m4+4pr5NcjScPvttRgh/YXZEjvqHkOZ\nh0OrkBbQmfhe6hT26Q8ZbnlZPrkjqKWj5Vaw8Ia7LyYfObuuj9M7FTrRQtXo\nKIKaziFtx32ZnN2fAmyM9GgfDxducr0UiUOEHEEJyD/jVBG9ih0iUZnx9XWB\n5H8Rti7n1YNVK92ymJ4oPGYKC0kU/ckAzK3zsuW+0jewmzd4HfxPu221p2ty\n5C1w\r\n=flaG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGD8Vp254putnmcZRuWNrsE0n/7NIIjFj/aeTSF8XINAAiBREaKKLC4cF5xjZHETqxXlBUU77Q1YjOXW3QCqqvcniQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0_1591287861352_0.6327411692102398"},"_hasShrinkwrap":false},"4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6caa3665362901f4b24c59b6364690f9165ee733","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f0IKj0dBe4HQkcaJp+cv9pUYVAjjrqsG5Xho9WudFRBKK+1YQZ4dacRPAuF8FxDvtjbtzvQJ/EVhkDM90F5c7g==","shasum":"1bee6c6b0627b688192b55a48eca7929c2f807bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0.tgz","fileCount":39,"unpackedSize":175246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2SB+CRA9TVsSAnZWagAAe2gP/1oYKL5yZiM9Xp95VQRH\nPtGdR7nCNeVnleEivJtYX4pKgHBghzdBIEJYXvxcK/2hm4J0KMDldOaCbR7o\nLMIjZ/ma5CnBGUexCw9adBKcTg6Q36osLScXXejjaRuxb1Jv7W4/dSVXK9nx\n74iIL5sJ5EZH7jU6HlgALHaLpfOv1PA7eJRVZos3vubeRxlr+EO2Y8N5gWCt\nIuXn43Lja3nMYhPxBAboRxza4DQqo43paBRVUgST06x/pHpssvEE0MMp0qbH\nKj8p+0hkOvIVrgnqMG1ilBxe59FBnqsZKDwIQOjZduAWtGvTioHQymoR2hGL\nlqKdOraZzv79J2DQoA099hj/TdsJDLDEb+kzkWxcE31fs4ql9Eho+ZsqH4uN\nkHwFTLxRtQMqIHQBo+BQXMhCyBwWRA/9sG9NZR1xLiI04WqFlMzk7VqP/xey\nCpyHMhOJW2sT6wkVc0/jeVjRVpB0y6zOVDYWE0ofxYaXt58ER/Y/c35gTnWG\nirIcr1tjRxFei845PS+ZLQNqK6yE6P3AbsXy/TZZ9RbfnTF7q51WBIaEsjSX\nQoMB/MCwqLcOVdBvnTAjLzpy8wnMwbtMQEp4l1Q7GpOkseyLtsQe3UdCdY9J\nGWC2ASH4ZGFsqmtiph0bZuFklpVZ6urR/8KuvfOBmpp2tGnJm6hmiCmDXbE9\nMH24\r\n=bW6J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBKNyQBKjoHtJrppWR1rAT+znwEjg5tQOROJG9FdTWHAiAQQpSTkPl2g6o9pLkBR5Pantv46n8bS489DHt5ANOmVg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0_1591287933478_0.05372911803664282"},"_hasShrinkwrap":false},"4.0.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.11","gitHead":"0229bc6db5afb661b8663e3b7367a97ec53cfd80","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.11","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t/CjSVFgEHr6+e/NzJxau6TPleEkLKao/tttPmzwrQ0sfNBWwUnkbYkbEyegoxDXxO8d6eg4kNNQUDEvlbmlkQ==","shasum":"3dcca414616ba758143fbac657126764e9ebbff3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.11.tgz","fileCount":39,"unpackedSize":175485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2SCRCRA9TVsSAnZWagAAIIoP/0+nRKfgm9QUdKxcDHLP\nLs9zuYAVG1Ia3ufzJY1DZIZTXxva0MAHSXuyj+wdEAEtFLV66W95mNGLrVvk\nsKya5gwWyUucsvVZFILkfoc2vLvzaVQ8jxVsLcb2h7nqTapytz2lCNwwBFX9\nD2mCial4Um8RX0yj0Q0viYOY9ue6IkAm/U6z20iFJfJr5Z06qPj0PAQByepp\nr0Xv8cMx6hJcZ76QBA1u+n0b2FUzODr+UhvexxjYAcoJ26Ibsr450fHQfiPI\nY+ZLV7q+yBJhGpRt/22L6exXKVi2uSlBXVdcDbILJ8SacC96psj4aDnaRnp7\neN2nNRE1afzUSjfPvzzQTGJa2s8VOeRjhhK5WctqKa3P/skKs3EQbZJuZr+3\nKdIJexMTpC00+aiM79K3ZpBZB1Gwstn25ces8955QqW8TCJlj6K/XVbWCGec\nLpDkq4FehtEMEelMQBX8tdQWbAjG+DAi+RKSFSeTMrCUWasl/pslzB5tFgUY\nsx7Yl4scd6NbR35tsl9kWcRozjI+aSY++oQOzIKrJ+KNsjA66zLoNfrZk+bm\nrYIRPPdKzaM2iJyCznaes90wxBsIOdp7oABlSXrluGKJlwsYYQbfGbK4X06F\n5c0eAl2GQvDHmVTc9VpUHA9leWvzYW3dvRh/iyCdLbOdfruWu62sv+ve/d1O\nLeum\r\n=rNP8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKhXHRARrbsbMfFR/ldFDVbUoIeTw+v5oMibyRz7uMTQIhANADRJ0ncnZjBeHpJartWAPczUp8PC3shb7YXDkSTY3d"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.11_1591287953091_0.6129606900091602"},"_hasShrinkwrap":false},"4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0229bc6db5afb661b8663e3b7367a97ec53cfd80","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mwKhpSVpueYeRwxQfCdiOdeMNsK24wNgpdDLyWYNg+5K/x1o22EDnHubSs0YDAzrch0TFOZWCxh2mXi+PUX/0g==","shasum":"778290013c5d3600d69e25a8df02a8f59bf0f9ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0.tgz","fileCount":39,"unpackedSize":175528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2SC2CRA9TVsSAnZWagAAp1sP/Ra1yLjoFUmAAdkZW0r9\nCnRWNwChTaxO8/ldmx8FRMBLCH9UiJEoQ1nuMha/WRGmIH/nB04bmIM4F+ZM\nw+a12Ynmy92fBF5bl+uQQmHYjO+882IJkZ4bbvoElCwOFPnMvG02woA3SX1A\nCJonayOb2zV5P7Ga0XhhRsTI3nrM8PCv20U4ZTKX5NLhXJrGGPWrP58nutQu\nG8btO48Yeq9z+7WJyFv6LauZdq/mpRRYLGBprXEe8JMkvY8mBQ7wAmRIfm2F\nssaeWi/a8+c9/BQW8rLypyLcS9BPFdrpmRZ/NtHrFx0BdSkkV7adUoxwmKG9\nZN8yfP1vD4KRJld70bseo8I2Kp/h6LVUpfH15b9ImSnbCH5Avyq01vqKNCus\nzzKO+BHeLpBcrxR9ykLg6dx6lLJlU09IuvY/AzmOGHrMINTbczMEo6dZkd22\npk6lL8aC/thIVKf1uaNw2yjTtVdqBelEqY9O057RRl2N5/Kc5Dz/gj5hMzb4\nf6CTz2lcgj+Pyw+vXb7igCSKWDf/zTNJ2peeC9U7POZCuPtlu1oD0mBoX+i7\nrt/thdCg0tGQcOSPYsVjihYuDbfzHyoTF8LlXsoysFMh3rpdTCtdZLfMArzq\naZNhNjVlTVe5iFQQVhLl2gDztSY9OIG/WYu+LBqkoYOHJ6Tasybl1QoC8vqe\nkG7O\r\n=QF0o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGpb1GAjqCB2aTUwy66GtMV5UuGveQOnwXuTGtVFynowIgF51PV7R13jQ17hcI6/KczYBOloUEDpXQSIG+10wqCZc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0_1591287989829_0.6054969196106204"},"_hasShrinkwrap":false},"4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0","gitHead":"23da4a100425001dae4cbc6b55f1d82cb9108b38","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tUBzppBDXS3J9ft6Nd7HiuUlaW4g2UlyPFNRzWSQYBGI2zVpOHCYH0GKzQA59Q6vly9HACH9KMFWDxEbSYYeFg==","shasum":"5bc8105a6672837e00adfb93f80586403506c57b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0.tgz","fileCount":39,"unpackedSize":175528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2W9ZCRA9TVsSAnZWagAASKMP/2fLfmqziQbXFEa7hL8H\nb2Y5eihiB8dTogGFd2WSsLXVjg0OAsmiexrtMY65KLVW8e8DoEKP9aHDa4v9\nUxi6VMHgXAs9X6iouit97JzpbB9LyEmps3Seze2OcrSRpm3fdU+1UKhtaeDQ\njBMuwr0U0g7//yAMmbdH29pzCo8ETpTS7NZ75674OOE/ukmfS9qz/OhZoTae\nbRcls6Q51qvmdRZ6GmcxidDk9nwvPlWo48qUCFw5vUPuJg/ISqDsPfcT84vm\nEQTqlzfbl8KjHq1as26gj7N5z/W6Xmrgt00z3Iy+QIAkOGWQVfCJFWWw9gTC\nXdvviPFHGDpXQXNi1zV1kMxNYpABE9T0J6PvQnEgV5EB8YcXGd8ZZNma3f26\nxW6RjXuakaoKjRMVRzurFKAUX6uvn5TivDe8k1XDBW+1C33TNSYjr85ySiaU\n74nL5e5JDkbbEOcvi3U4u9J4f9B+Y+QjMrNGFVdLqR/LaGSVqos/SsEUqxrw\nkyvpV2ly40DvKj+kRP1SYRlobXm0Rn4UW/bn2VERVnzMLE5MzytYULE5YHYm\nSXFmfRn0VLf1o9zt3pYDD0N8XeOgcTO+Tc4FPVUte9l+cZpiKt0GyHUG4uy4\nLHtOINe9SnmY33HsQYC94f6PFPaFO4feX3ulI9NPyXlh5nvUYjKV4lfyl7rx\nsHlR\r\n=ub/K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfL3yPWVIwb1N5Y4tGCbw56v6kgi6owDq+9XF3N2j1oAiBLMN7m1rRu67VGPJ+clOk4UhMF/3MCuvZpccDR7jpd7g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0_1591308118157_0.13893824073408245"},"_hasShrinkwrap":false},"4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6e79466d480761c214cf5b6213be23354bb50edf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BVpMJwrJepBN5PtVRmTcljZhncEnwoM6mToBAIxcRNLEkw7FvfDj16jZF+PXJpy5zjARVzkog9w9COjncpUlWQ==","shasum":"0e151913b305fa58c6c577214accdd0a9065b17c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0.tgz","fileCount":39,"unpackedSize":175528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2W/rCRA9TVsSAnZWagAARUsP/iumc5H02qtjI+JGWXgD\npFt8AyTlYGFFNGv6m0C6z+KTnbqEK5/CA3bZpNCxrhTYh/9dEExrBwVlWVKV\nwkLdOdZ2uxqIGcJCHXFIJ6mQM3rqnsp9ovfhgKTD5cnJljLycg2dh08HVMDc\nk2FU/4U4Y3kvPe6OtAAgjVEgeyTNxFBPvvOUeIbo5ZbQf6Ofi7CEwozQlHse\nhW+N2tlZJ3TZ//+v5RZVdaXEfnX0dyZK59E9mkAjXjnYokTXI4/KhPsYg97p\nYqlqH6wb36BkAQCygNjXr11s6wQTkI/7QlbK78QTFuX6Fs0sSs6huruwFdso\nAb2Yq4uVhTGh9n612SnymSDUchmF+Dh9yoJk6nGv+ZBCPo84QMFd6aea/zLR\nDWLaefH069dbZ7j6jSxqHl0tPXHC9uhikri8msho07MBbcdvNvjcaDQuClC4\nQ1R/0p/mcdI6+NiiJcAQe+hT43VDbOQyNMQ1eKvqdzTlQbWAW3y5moiiWzIh\nxN7chfrkf+tjZ+K+PHPyM3D0i8ZOKxgAuQ2Y1frV0cYihP8OlZRmfVgiwsdo\n28gXtjGKAXytjwoXQRJf2Y00KwQZuYmCEcitXwhEfi3/o01ksFR1gyiMGk5Y\nNFOgIhK3dHRr5uu4fk7hu6VsWsks+edpVsS2wGp2eoAtnKrZVxByopjejAbk\nJwSp\r\n=ueQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7bEXse3RJJ0UXj0l0tVcOe85LIZZRF3rHulYPhMX9CAiEA/3KWQadQVFvAJo5bl7eNsmU7HtMO5daxEpUMzVailKk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0_1591308263957_0.5121476335871822"},"_hasShrinkwrap":false},"4.0.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.12","gitHead":"98cf08c60d036c32c7e35bb08f9eac8b699ee546","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.12","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6rqTdRw/m6GSe9J2jvTdedvl1D+WgncDFKtzUpEN2iWr7ag/waeFOK+rQZwjxyKj+EzZKVmU2CGE1X7lfRyqGg==","shasum":"488dbfe9cf9fa55826fd9e4b6974584e371282f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.12.tgz","fileCount":39,"unpackedSize":175764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2XAFCRA9TVsSAnZWagAAj10P+wf0rBNW0Reh2H6Hawaf\ndJMA+IKrjEizarpul88qAAi8MO57OV7NzwOp9K7SwbpDepldeUgAI3nxr08G\nAWNSN5QLpWdM4eAfbelm00Rkd38gBkGKpaHBjGIVg5Hwx3QBP44eg7Ba51Az\nrPpnM33F8H2jE7DJ7Xd7CzOwJQGzREgKkvtGKsPgnPvLLK6EHcJBD6Qb5nL1\nxA0ZZabe3PPLfvA012984usg1Ly3r2wEsb+N0QBCLgGtNMEuWx2AUqwM4cZ6\n93Hu1HFAffV3laGvKJGMQV/MzsvN2PrSduSMPOJpYhhrcChLCVSGkD2gT9/p\n2o9uAhDN27+iofXf4/fdCnMxjotpIcA20IDHCPTLxtdmjpBdGV42YV08avDc\nlq7hUvKvNQ6K6WUc17NBf4fXbqnfoqCtBu5qCBo7UwPOjuB6Gk5082eC6YBx\nSnf3TivTNS2adHsRoKbZfbj8dlue+ZK5PSIYMb5Xb4byCbmJAQHkq1Hz8HNQ\nS4Udq8rVJusLH2/DwVPjSBIkInaoBcAtxLqcLcvczywj1nvdvRliK5opQ4hG\nlqKDUap2J0WywGwBn3c0q8J/6cDnA+PLRthM/dg1XHPa7R0Mv2PfDs5Ko2oM\n1TdHOP3KoIa5pbiRimgNiG4p1hVTxCUlgvUmz8SBHFGICUcv+1wo3jirersj\nXfEs\r\n=ReJ5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJNQHpN22d5O7ewvKMt5GJcc5I93NO67ig1zrpmqrRHAiEAvjNYGqQ5fmrA5iK3Q4WQ449zBnHjd34WW4tCPmAeuGY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.12_1591308289184_0.2520926497307543"},"_hasShrinkwrap":false},"4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.10","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"98cf08c60d036c32c7e35bb08f9eac8b699ee546","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-haWS3UiIs6Y8KMcuUQetWdxXabhHciDZWaz5oVDUSaqrE1UVxT9VDhh6DwfbfE9adyaFxeMIjgnN76R5hbPQ4A==","shasum":"975a78720d0b002f265161e074f6999d0cacd9ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0.tgz","fileCount":39,"unpackedSize":175807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2XARCRA9TVsSAnZWagAA0L8P/R+vcRSkvPzBl5ULy+F7\niH6I26pkIstunwncn+fBC2BfMlH26GosGsHMx7Zu7+NLoWov5dovlvhGyvKn\n5qMC1YrDXy905LMYOUA2SHZwtQK3JwipI4CHv909n+NNyE9Ezp9fzzzmKpxp\n6PYf4RTuco3uL9MSuLqsYtxOUeH2NJfIhb4keyfJXGKDrkLBixwjC2LG29Yb\nP5U0ZS3C8Ygv/KDEjxQbcoWhycVOzN9OTU7VSE2Detkl/aNL5Sf9QTorLV6h\nyUlmKDcM1umlU09iwIwgMjAJAF0rgn0nAkjFJM2Ge6G8leyU0XUlJ3sXJbfM\nPEWrbbqeUqvxPOCvntDbZMpXzCamhrj+fWs0cR7EwH6ZYOD9nbMNBn6cm08M\n+X2rF7Jkp+doZa7cNsMSAgu6PQXaiYizAVHuix7hEnkb1VO74T9qu25NE08q\n6K6PwehQzZz+ePEXcm+ZXC/+V6WrxoMtxaZ2bgPEt6gxz2z58ewcLxt/ZLXl\n+JRkf9S3Cgbhv3fasgErCBNf4Jg2BY5tlnI7K2BQeoCPZeKSg4T5B2OEsmBh\nXSIMl3lvEgy+oTErk4KmrcVVHGL8I7+veJXrIebZJV+N3zq1AS9FZW4zM3VQ\n5Y40VBkRK65N4Zu+l6HZaXXxEKocQgC9cKutKB0XKoh/mNY0A33X//IleIJi\nOIDi\r\n=xkHs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu8PZTaO3hqTls4vEU7Dxa2stX16N7brGLVL+VEd2vpQIgH3PXDGPnuRJpI/N4Md7wvjg5mYsGupvWXHEyHCgrMZ4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0_1591308301718_0.8102072488161747"},"_hasShrinkwrap":false},"4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.11","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0","gitHead":"3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7WvRrf5wUuKCC8sbaZHsJP9Iptru74fgYAGjv69o2t6n/HLHWXSL9QRCG9TkajuPsQLcauZerbyHwYpEWfF9jg==","shasum":"51ceac60347d013ac22d737950da06a911b01cc2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0.tgz","fileCount":39,"unpackedSize":175807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2h2pCRA9TVsSAnZWagAA/OkQAKP3NNBb6djOTAOHFcyM\nwyElOZ7Ey+OBX4qrFmqunAUakqasfADuzyRBM8cpWWazO33322nJP/dcpWBy\nzP22zp0O7FEYMFdAqdkuM1rqj5urG/pr9B4NFIuHEn7YMCbENqawnqHaV2Ap\nDwL4wj+44kU/nVjL6fWRvy2xgu9dKhjZExXNI4IAF7Wp9JrDL35C/rcS+yD8\nNRfs76iLTn2sqh0YVW34NiOf4beOFKA6IMdYPrzOfqUB3dJqY4WIlqaEDFwU\nRPwNmffz1kusvGOIGOUzKDnAGIynZ5esgbY+N5hjAuOp4AlU/k7X9n9fljrU\nAqYz5FdW04Xgtn+LAS6CaZcSDIIhEFwEidfiLfz/9XF89ZKhVqEsWq6HMLBu\nRN7w/ncN4b8P6iMmizot7hwnPiYfvtrQLPrYTZ2iwb94JU04KAaMJSUnrx8x\nis+0tKKgx3/+lNBmfb8saQVRyC6BBHn1dp35ZHVquDwvyIteNTLwGf8WL5XG\nSdR94oMQ2JFIXpkQbJajFvIcUJMI1g/nwo/3sRJnyYRnQ4v7ZP7iNP9xnR92\ngp3TF1+mpzK5hgZ7HCSev9kV4U6wLEWnJRBpzSqdo41D9/UQIDZICAgQrhyz\nkLeuKAcJLMtzASfuC6Nu96cZEqGEB33DSNAQHkS74d6kmvQV2g7BjxMBgNnS\nPCQC\r\n=Bjbl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICIf4ZTPTWK04ixNX4c1ifMoWbmwESts7flprabzUcecAiEA7eugA0Ldo02Ln7PL+hxRbh7M0Q6RjrK7Hx6DBCkManQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0_1591352745308_0.41390284559149704"},"_hasShrinkwrap":false},"4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.11","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JH/pcfzk2BXZRC07RHc2+3qXAO2NGJsDuh1Nd6TitimX11koOVia2gNyVep2LZaiu7Cba6DQO/gihhfUHsgYHA==","shasum":"75a736a361bfd7f2e20e2b3e0404047601570e34","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0.tgz","fileCount":39,"unpackedSize":175807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2h39CRA9TVsSAnZWagAAa+cQAJER1hRnyVoAEzoEw11U\nbDsUy6qjgn27U01OXjFWCtY/v3YIs9552+2m+TiqbReYhXP2knD5gafSvVPT\nhC0wzMb72q0sSD33V8frysVpyU/xbVKALHa2WrgTyQRxg1e9gOlv3ss1H+uP\nN9qAvD0ycCeCoqRGeqBNYWjnpJZEeOuexulvBL133cIHqZmk9F9hYRDm3xTA\nUE5ZogUhLeeyZewc75d+CeNDmHK4mFL0YomjBMQ0u/n+C86Japg39exq+7Uh\nfJK0x36wKhEyf3rX954vu8jTIK+YAlHVhUdHai9nDfx31l2ZhyG3GK/5J4o5\nj+ZcI24SAJpoSztirN/dG9mqTp83d4b28b8Pn8E+VfFLeGH/3IHkdNe3/MVS\nXLgiVHRuKoq6IqvaX3h8vcGbvytdCkSzlyPogZyHUi/chMKjZdXPm6HK3ifw\nfyjNr7GV/J3YRaXaAlx9hDyWCC1Ml0bVxHOskrsVy7d1Rp76dsY8C1hjbjI9\ntclNO2IzLiAzkJCBsUrUFH9408e+7F5aRATKqYHyJj5QInLHTyuhErUVEF1Z\nJ2RH7W1+WSlDKxxAxNqKwrt46lcWTVwQ/eagLhvOUomaLN/aV9Wbdl1d/iVK\n8b5z3C228UO4EcDYgLBYseTlPdTd8O15oK4xBIb1Jqr+cHR8CxJ+bFfKXPpv\nbPGb\r\n=JGNk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6oBlaFPRf/tLE0PV3FbybsPCaR2JysXBqIB5sKOjNNAiArSrRZNlRsXWglavBz2pDvaylLNbN4sP9cmFe8LGw1lg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0_1591352828532_0.2639301222072885"},"_hasShrinkwrap":false},"4.0.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.11","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.13","gitHead":"79220835cdad91ae860a86629a215b969e043ae2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.13","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FsRwsu0KhsVOx/esh9aXCy0vgCndHdSxnhQMQiISlkP6ttVIKNlDCK+4DKvNcWNkWsYDFgGxr8XngxPko3LW2g==","shasum":"acb51ea396488cf381f0574229d49faf0ad797f8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.13.tgz","fileCount":39,"unpackedSize":176048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2h4qCRA9TVsSAnZWagAAmZwQAJJpAabU4SGyioCZgKcZ\nanzZWFFjB6q9hxfVywLDceJKySI5toy989NdXUpa4hTLLp6Exl66CB18o3vf\nFzZmq34qn+02GQSOnjVcxWZwztuasPPjVyMGpF8vq0J/FMy5Zig98ARYwsBl\n2hWc6hwMwE/jcdVIe1xVliogPEONmwKz5atQava5IoM0OvEjL6XWoc0ZtigC\nSjoLUTGpBX6rhFqHUAP8xJev2nVBog9+lipu18QG/X+AXI/QgokUbXOf+Tjg\nclLi4+jjBI2vkj4ZGWzGOkt1fA1BxhlIHjcNRG4lHghCOgmYRycwaI2qPEFd\nsRa6zbLlyzhfrBhzf+2rxt1aRvI/dSMKVyXe42rvp2hIQPMHqUljq6uKgxZE\nuuyLK/ufk+X5NoCrNILzpjdC3dLq67+4Cexhcv1fCGnOq0oufW0IMO24cEKW\nmwwG8Yn3NB3q6h0QvTVCxX61q5DQaq2FqhAUZnqIOFU8TmdF03pHHKj88CTz\nTMgrMLHJR+jB5aNcJIpYHfo0ifIcJZVSIYOzvY16vrEN9Wz6QFkHLwg8rrc9\nAKbn4lM+NSPxIPkwzQR7gH9yqTKjI9kSIs9cVLiKcFP5TaaeIwbGHGxAuriK\nD81hX2/uyevjEePt3KrzPDVkMxBZB7yrkDeTugBzJgIMyE+MTtFoAQJLpiYn\nadab\r\n=M8Ra\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVYhYtTMmWLVw01PMAV6iSIYC16rCGqaMO2c7JjvKHyAiEAl8eJFYvlpgp6OUo8L52gDe0cxtbscnWHaSsc/g4tO5Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.13_1591352873613_0.717408975601409"},"_hasShrinkwrap":false},"4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.11","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"79220835cdad91ae860a86629a215b969e043ae2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TN+p64vlJoIW8eU3eQlK9nB2a+aB6ivnXTjP/97FAVwxL2nYBnVxbUWf4RMl3mA8/eCeW3ATmRwAqBU8MaDbgQ==","shasum":"08df5a4c6033b005ed226aeab4866a6c9bbaa77d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0.tgz","fileCount":39,"unpackedSize":176091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2h5uCRA9TVsSAnZWagAA3UwP/3JB7uXXIdPz96VWTQdC\nzP33gGMWJdBlMF2KrPHyXnYWzS3eDznjr79V4VI//YhR4byvYVUSwcgQnmqK\n0rQzDEX6gdjXD7bNlI7sJKd5IZbaZ6TZoNTHo+lnRRxrUssG3dvPLUODFWis\nKcCVE1P5IXYp/Z2fD4gcsV76cTbxjUiUF9QvO2/tFJskjczvwtYeN4nPq811\nSUP2Yl/D2usfSUi9Vabyy98+9MBLpfMRMTvqVdN99YrwbeGN3X2T7fIWDo/H\n0fitGo21xyZqMNBV/R+jmG/D0K2MkPTyL6eWSEtg/c2Iw3HfUMA+2BR7iaWa\nFqSj2TvewrQXz2PMThAdoPzaYWDhy1cYme25JKfHGj3uq/wWxbYkknohVbpD\njlkokK2LEMoj06pwwY9hKt1lgA4pWXj7r3xA34ccPmlFjQl2BFK2LyFMEBhA\nZAuqToz2F9AQZOBMNeLt585hY81Lgf+zI15iSQvHQJrZVo80KdKGlOo1dPGQ\n0zS8q6OE/Ik3yTtVodfBN6stp98XJ+wVN6WEbNS5HSFDEIJeLviN+idhGLDK\nt3yfmfXi4bO+mTeb4b6bo4rT6ymRInXtkte9Xz57uakZi71pAu0SeL6zDYrR\nGt5Tiwkz1RQgkYVZv1nrKmhD2WNJiWvAfRO9PhSa2CR/IM2+vZzsQvhkIjqu\nhDBt\r\n=mu86\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB963t745n4dTbgqHWtP8VbbKOoB8sqCUm2U8DwPjD3LAiEAzHhFWPPgYPRNEluh+Cm5nIWS/ZHRTRpi3wXwPDSgsUc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0_1591352941447_0.6341174536038383"},"_hasShrinkwrap":false},"4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.12","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0","gitHead":"12fdfd9e4b69540dc323346da5e2e3d9da12aeec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-h5/D8joI00LG1I5bn2CbT/ZBuVHqi6UBYDGKylIJsclJPfXP9KaHYc0EosdxvTacASJkJ+jiQQnaBIPqxSXqDg==","shasum":"276baddedcba3c8e243e314274cfa7fb816cfa46","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0.tgz","fileCount":39,"unpackedSize":176091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe32Z2CRA9TVsSAnZWagAAdI8P/A9DmzJkp3KzfRY1T7rQ\n7d63DZJB+D2Q/9kTuSquOGICoIadSxIRbPnGq4Fu7h1HtXgwBwUnU3OOqcuO\nxl+yYqeV3wspbPa6/E9lxpEfAYGJowu35CRwalkJMb/ZDac72n/HBNV9OLTu\nDqtRhwL3itmovcASKSDS7jeILDJhuFsoUWaeLYYp1d6w8O3yJeycAs7DW4xk\nfwIEko7WPvWvZiB+gGT0AWPPXDIkM2uR68ZowoBjbt0r8AhonBz8rpmxMeTx\nxRwXOtiYsapmmc5VWt3IqQLtcq2IR12I+4UatwBOZMsY1J+xYXy2Y7XuVqya\nkSuNfpxOwfCA3ASI3opPnACH3lJHD9Sa5ZV3qLc2GRLo2vuwc/f7oF/9qQw5\neiR6q80R40I7iYeN3wnGMm97JQS21rWes2cKcL+TkRHQsqesWIZcETgZ+vP8\nUWQf9V3SVuCh6ivTvZDC35CQM8iA7xMiGtBOaiTIsRIA3zLjULQymZx78A3m\niG0n8vDNxltcRUDMKgB7+RIhVjKTOMWzpc9yotZPyj77F2hzKJeOYcUa9nvx\n8BlTimqe/il2oj9caoq7ehHPYZn/aMLBvsHs6efzxiMIfNkZIaW9oIE/I7W9\ndlqbEIuUEkNJEbrhBSwAxAJycS5WhGeyRNSxlJEOLM4s4t3euOCDAlJg8NFX\nyvtM\r\n=AWkl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0sDsy/2oAjD/SuUGCqM9C5zaxqpN1rc+ilQpM3RBkOAIgX8aQZX+8hgrYupnOwIoZ2S6f8MrYlqaNYkb+S5T5U2o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0_1591699061511_0.17900947910268994"},"_hasShrinkwrap":false},"4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.12","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b0a20ba2dc19ee8428475f84c67bcc5171dcac5d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TZQyTcsTO9jxi1+kZqnFiwwn55Hlcdg9Nzl6rk0TCEE3FlD8kFl5HDQtYeFpHljKhfU2+rYL4yXxVYNlkELMKw==","shasum":"ed612a87caf598cc9edd3482db9cef87acbb57f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0.tgz","fileCount":39,"unpackedSize":176091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe32bzCRA9TVsSAnZWagAAMz0QAJ7PyudyRJORoPmBV72k\nQfgbiQbqUQeD8//cKEFMp5mYmNfHabZ7dyo76wVbPUlIu73FhCNDHBCTKdPL\nNdlTyfPxfldKf7PULj5Z2nZuyLQUXGGSNHKf6grT72vq6hG0/YcbxeWjknkH\nsOyyhHYYSCdmMspB5vpSlGY7pNVSEQqGHhIi/rhGvX2vLKyQAyaEgQiPX94H\n7CuBf4tH+Ad7LVQnYm9lanWTIHXugu/8vrMJDTt/sW0EYu/Dze3NX9zVe0al\nKfVX+0WkGzevcFoloFx4to1cN7fMMKFjpcUKHf2jqP74Bm/WAgJHdLPmjK3D\nc8Tg/nTXrckm4kChsNp+Uw8pJuMZwnJqaLA9MOleLOQ5LYElbtnVK9SL46mv\nIW1hTVLX7DjK1IQZUVuv8tz9U5boTFBOr1A9XCFitc2GOqaFRAXt2Sfo+/eb\nbTojs2vulp2bbeVnka+KIcQltLkBzpYROSYS8hdr3KlNrhDNe9YVexfbj2gD\n1GMAANHBIfy8GWLP9YRmLEJi0fW992Tazkw8OuANMUvijCb6RMiaBJpMGuzJ\nZ2kEhc0SX3gRVvpYV9IFR8T+mujfoR093ruB/G632OnbmwzTjo+C4MVBlch1\nDLv5KU3OaM4Xu/Q8JSkPl2+KuhUg/9XUFiHdSR3TwHxWIivymJsevYjQPNyf\n6k1g\r\n=VVdQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8bzIHlI9gFJSB/7qj0J6pl+HhLqONGbKC8/bdDRFyKwIhAOEo5r8KJ53Sdcur9U+3bPGT2lujzTXuwzB6TBTXfKC3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0_1591699186487_0.7575261036374679"},"_hasShrinkwrap":false},"4.0.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.12","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.14","gitHead":"503fbf35ec81ed232d83b9f772342b5d9e972df3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.14","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LLBXqbHnZci8ceCNpMyOE7H/IdrMwve/o+OdL9XTN8bDzcXi/EXKK7r572TTwhioIsOCH47UJgoui1VCzulylA==","shasum":"6bb200188cf0c0f991336c36af1736432043f1a6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.14.tgz","fileCount":39,"unpackedSize":176332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe32cHCRA9TVsSAnZWagAA+pcP/0AmYWrUNQXujBauhyGz\nEYThuOeOrHbcbb4aXBONsEDsikJlXzu5XyS4bzo7LvglPV3Y7+ZTQZkvTrGV\nmXd4g06xYLUAmc6GOyfP4ivXKe21q2COwiakiloR5Vha2VcsIs1lEn4BMX2d\n3hmP+NLhAh+bxnYky+7CGvrmXDq1XT+1JtPd9L3vuOWDqikusfDqUwm9X6vK\ntcETOG4fwt0zj7fWp8sLr/Qwa8wSqfka+2Y6/Glqt6P5E4Q6uDkazlJiAn2y\nB/AjkhSA5iSx+GbJnfggf0T7eQMmBgL/AjaE++SpXJtKoyXHLoOB9w9oTIrE\nKKMiZUCwkQvqjEq/dnPnkg5y60QXsZuk7aNcsPKZXU/NUv1G5HPsdJ/1TFL/\nDtduRVGa6A6om77msDQCuL2uWPiFGqcls34AuzDxxlvmqUbRGgJDumyQbJnf\npkB5swnH2fEIkgymLXdUDPr/tEJCgZmH12nzqnRrdMyXh7D7khbUpzaJbo8C\n5I5WMMKE2179+lMwY0e0x75+1pPeGHJRtquLd7wdwOikxvwL7QhXs8P6kwuR\nFSS2vnGMlhvEf5t1eWCeapykgSIBHGEUdPtQAybNjisUFit7iPfUF2GJV2om\nBFsL1wm2svuJWQ0B+9Rw6HLjySVHZnU/TUiLCt5LtdkNSW7wqpBmh/2ELPGT\n2yX0\r\n=UJ20\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9MMyPSBtK4wUeEMMLWNtrOJ1JpwJcxmuWbj1zZg2SPAiEA2zdNPqWaWIazbH9gs4ZSI/RPNC6NBPl7jLrR+L77ULQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.14_1591699206569_0.06505326773058395"},"_hasShrinkwrap":false},"4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.12","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"503fbf35ec81ed232d83b9f772342b5d9e972df3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZHDgwv98s4OsSZ6VSwI+dTh6Fu698v/f88RaSzPji3IZDs7z+wZqmsp9xwmRf46oLcO0Q30E6A7hczvltremrQ==","shasum":"3c8c3288bc76c61cd829187c4cfcc421d576cb49","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0.tgz","fileCount":39,"unpackedSize":176375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe32dDCRA9TVsSAnZWagAAVPsP/j0YtEp9tKfr2Tq5WN6a\ny7/jeLNT0bKL7R8vbHJSGqBMIUMP6pUt0OXIUlbazVg1bvcvefVMEY5xyXHd\nQB3toBNl7ub8zUZESCxiOpJyoijM7oOHs/oRNKgr0rIXgoBbQtFaCfiELXdj\nTphZChHjvEtVhPqqhGUU4LYIHos1R7nvhHoQLxE2dCl73Zt1tQT/P50e//UP\nsLIyzfM2mF6COvsa5oCi7AkB/sDxZhwMqA4v5xPuD6Syzb08zb1ywlYovG7N\nTn05ZrsiRXn9YfO35KH//Ry9AaIpjSzS4PFmRqeu73xB2ypE6NxAhed7jAUE\nwtfpPu8iTRxvAqCuKMszQdrQcPJMRIasiMD7zhJBYt2ZLjAPjPgKmwD/hI6x\ncnfvD4w5JO74GX76Oaeki22SSthkj8P3Pt+ZimQqzZaaBe/fnyBooyvq6Z7A\nm9aqTyjCeS0BsSyxc+eIilIfgyOdQHWDpmt1r1m8obrfedFlig4L+9cIKtGQ\nKHbAJo0v9nzMNrBj/xstk4QwIz4nIcp/mUgYG7IFXRZ0YKFeMqa6y9FcG2jv\nllzWFIk6CEvnFdaHhpIVjJIxTCsNsBZyyneQHzuljNosUFCYpJMTjNX4sEU3\ngQurrAEl6mCA6aEQlibQnLjSSp8Ai+/xpTeFoBl2AN8k4jOZ6KoCfNghcOH8\n9MkZ\r\n=VFav\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPIPSs7s+kpz4IE9wUZCQuYwJGRWLiKvYrUSuGqJFD7AIhAMH4Y7am0vn7k4OotVqVoWZKvKKD+M0+GPB75AowRNGP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0_1591699266616_0.01479998451810971"},"_hasShrinkwrap":false},"4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0","gitHead":"773811aa1ffc95bd3896ad4ec16e9e96d1447e46","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/D3tX9DI9noE2RqMxSCwypAH5dF84+gfokSxE0hC/JW0LHCRdHjepDXsb/9ULhIoss3uru/dp+xwMnOefjqfFg==","shasum":"327b23e107931c3b9d13974fd381b344edc84abe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0.tgz","fileCount":39,"unpackedSize":176375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LOwCRA9TVsSAnZWagAAByMP/2gzvlDnNyDdlrC62n35\nGY7LJ/28nV5ktZglrzydQek+KIK5sEJ0RjXXfM5iFxSzJe1YYjAfTGhA4jA8\nM8esKxRZC60iS2vbb2cDGCrZiOMoukXe9vHlDs0CqVhTw1RTn4XIMGEr3puL\n4SefMKI0M+jC9s7Mi1C99Tao5hAE4gHAVqqe62aQANPuxIFg4QjO6wdEtQF9\nqoof9VD5rzlFzwlGjb0ZBk/VXGoic1IO5rqbprqRzWwdR0RF2/m81jTwhWzR\n+EESlrtFttsHUbAUIPedaKuuAOyj1/IopiXq3+J+eoG7jPPlL6grfdm5wHFo\nP+MiRCoEvGwlWw+94CuEwDSHpt3mQhWDLzFaP8XzbFdHAG2nd5N6iiTemMWl\nxId2IeT90dxV/pg9DejkVAXgKlyF3UZa8vkP+e7RrCTDZVyJ36LHWxQ5z0kq\nxQqMizFIPuLntFZ2eCjHfHhQ18uBot5KOeK9TaLZL2BL79FzCTdONOGKDubQ\nn+/wAWEwpER8Dgpa4ug06Fz3PzRPQlhwN11QQCHJwO+GfiTE/vc0qklpcu+z\nZgwU2B8WeLURf971FUvoda6HxFq2Hoi/Me53gOv3yfuWqHSSoF0y1cr5sPr7\ntU/+HsnJgLMlfBWmWK7j+H0xGP0HzwlpuAtGXjuicsHqov3MPdW6QZJZquaF\nikUW\r\n=zPv0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnxaT8+aWG08Pk4oBhnB6NVhO4vfN/NutxmCGl8bVKQAiBkH+qJlcKGji8PXvB+MzMmhyhgfH4gBGysuMLJSB1GUw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0_1591784368259_0.1730660627354521"},"_hasShrinkwrap":false},"4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.12","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0","gitHead":"024587912dc26ee48bc7f84c97e6af904a9527fb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5qXPms6AvdQsqYpH+AAOLdvvVivFfOQtVGYPegOR1r+3c1RJRexzENc0zYZeR9BAyfRMPzGb4Yz/PMYchWjfcg==","shasum":"1c3045dfe1ffdcc06aaeeffab70b62ed5a243ffa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0.tgz","fileCount":39,"unpackedSize":176375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LQiCRA9TVsSAnZWagAAlq4QAIh2puXwc4BtuRrG9D1d\nlWoHV6Q3xYc2uRuhBZQsdA9dAsd15eJfy9QTmogFYOKCRrhGwofNDj+4FI/S\nKNzNJ96xYsW2F3Cv1BBXjlr6kdF2JOLj3yt6j58q7He7IC4JcN2wrhh3W/87\nFSIQp6I7Uvv+kCOjLePEfFVhSAX9p+JHhX7q8OWSxnaiZwliGairm1rcV60+\nbnjiH0mjIjX2qvdh7gFdOgFCsW1g6dnKhOJn2vwp6+skSo7lzr+TeHHlW1fy\naubnltSGU+qNHS3E0EsqHf1wqaf4CxbUCzmzKrJexhhP9iNEoYd4pIrE8QOj\nvT/xwUXJHCzOZ5LYoUwUBAIa+DtXcwTDBJSpPP+RDx4Kc/lKqZ3uCkKk0TEz\n6os2TBvTj4AwkZWpe3Cend6OyI+bWkVv7/dJUbTUIRnHq+okAwoonTz880Hh\nJiqjVPlx9uPLfMCAfJ1gOVlNUHFfBvBF6Oy2ulz8VlLmfojIj0vTjfzdh2NQ\nCFxpxqa2DqC0JX6/IA6saAvS3btw5EGYphn6DZUquPouCsNDxOJXy1A1yz7F\nQD2vtq/vEK8B75RB/aJb6H6rXNpJV0tE376R9/UNM0wGIcLSEAYRzOEZRINz\n/L1Cy855purbjwyRCj70Zej5So+gwRRItLfyWhFc9NsBN2iALssl1CFLfYuM\nOWx5\r\n=xK8w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdJQNkZtEnRhx65Os8fMnt40l4isv/NcXds/pK68/rFwIhAIXGnlqO0QqXtpoDUsPMJj1suUTZ/bwIudtHD8tNg6J9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0_1591784482199_0.31662398955935234"},"_hasShrinkwrap":false},"4.0.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15","gitHead":"448ee658d865598d54a707a103960ab954df8927","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KrHwwmKiRctP65tksQnSFrx/A/mJ/DJoQlFIC1MMG6fr6xGRS6bmgu0DpnjOV/cdEvKeSE/68JnLtC/rO1t5Pw==","shasum":"bc3f0cfacbf5ab517980daa9481017c16c3d12ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15.tgz","fileCount":39,"unpackedSize":176616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LRBCRA9TVsSAnZWagAAaaMQAIBX9ebPwhndcOcncnBn\nEMU5FTDoCZOmY4iRGUhjUOi7d+EcS50djnWT9inRnoVtjsfvH2YpqcJldcBL\nV5B7ZWvlrKJ4Yl3xf2foxaX2wdk3jDv1/a157auQVcy/bw9khMjrFGtMVe4Z\n2tZCQp04M5zWAwIMVgQF4L8JFSfF3z6I/a2xUXkDwZCBO6KmOZm/Wx/3OjhQ\npfxPQObwt9xpJE7pnj29fA5/ifet+wcLZT/m0o0JLDW5Zzst6FITEzX7Xv7R\n+G2zW9ugs58Ojcm2kdoJWWPCswZjcu4iZZ5hw3hf+OJs77Hx0DuZQUne7zUF\nppYSj55vl5aDvxcxsAC4Lde2Y9iPqql/eg+LkA48/KUfgED0EO8sRa3uDTDj\nALxXhyJeqOougGQcVSTUuOue5gru5DIdRAuNyost077OHZEZ2Is4jlKeMDIH\nUkFbR9zPyW8xFDLvwXdAqvZK0FXCR1OW2F6eBwSmNnSUeBOadGDENojVdFK8\n4n2qlBSOw006aBGIEL6OHccLmAV8vUzV+bPUdmX/TPXRBrsQpUg1+ptz0Uj7\nX2p3X5rUbxOutkC3CvbinlKhuxqhdSmDWej8nW6SiiFkIztpjie6EV5C+EaO\nrd3LLZebNNagn4pbMzRw1u8zed09+t2XloDBxTGGEPKnerQrHUfOl6Y2eZ0/\nuKRr\r\n=Crcp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDROVrRPhHqGC06WtAdlGAvo5PPsKmI9xa+MlEaMqL4ogIgdnUs2D/eaAe0jSicTx1SIH0GaW6axY5NsSiCjMp5ddA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15_1591784512799_0.1537063668058607"},"_hasShrinkwrap":false},"4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e7ad422c6cf5350110d2c93b9f3f270e865fe207","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-E+yDQlCFGNhIXdL7vYA8XuhN59fDXmKSS3ZNcdwhCygJ3KEGv95FAXFgUKd2/u+q82+NEBH1G3On9Fjg2UTYvA==","shasum":"a2300f9c7ccef7b531ba0d3c0343a891b4ee7d3e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0.tgz","fileCount":39,"unpackedSize":176375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LRUCRA9TVsSAnZWagAADnEQAILORQAMhRBRHAhcZFwy\nZcsNaRGPd0P8KVNkOYcZ4vMlBnF7AiAAFcOI1ruTgRJDPu/bHl3nLIEFTHh4\nGmyuc7LzgSpfQe4RbFbJ9+6XhZenM1T+AlgtZVO6lecwzJCk+AWYm9yve0mb\nPyumAQlM1GE/NkLcd0LVocCcVze2NUJK3QBacEVjeXch8j4mEc5q6rt/VGHb\nO4bFAftEkLAt/3Wxa/MDd48k693911XDpjm8ne4fhii4XNFHDmZ8Gd25KrI7\nR8jZNhLxriEBL8E56adc/c6PE48WJRibq+r4SMhogxOG6ARJ9PXjO0hcgrlo\n87fjAM8b77k7+2CJXpyoyowpYtsrC3pmitVqMtQ1PNb4f24XvdqshAO0DVWL\nmJW2MaIpoMtMHnwaTCwrOExcrh4GaPZqEId4HC4jVK1BdIhlJiUPIX3+yxV7\nlbnU/jEaIRPx0Z6L6LA/iYK5l6kiFYp1YW3vawfyj6fGlhniF9rRIFyPeSDi\nzVKyX46P9S1wB1C+CGdRmvymh06FggH778QqWERJ+oQfG10RFnVUpQ56O7AW\nSdRH2ESACP+IaEWBakID+hGJHLToiPd7GbYVAkkwXEdJoaAz8QWwALbF4i/0\nEWz5ms/oYty02DOEBAbzsUTJs76/9w8xyoqqZ6kQJr5lJTkRre/L+Xo8xqLv\n2ZpK\r\n=Hd8h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAGmBbL0NqiiUuqS0IE0mRj+30Oc93AcT3rVkomVaVLwAiBb9g6MKChRlm+OTJCleVTi+hAgVBpK2Ne7HLletmNXEw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0_1591784532397_0.09836384939365872"},"_hasShrinkwrap":false},"4.0.16-448ee658d865598d54a707a103960ab954df8927.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.16-448ee658d865598d54a707a103960ab954df8927.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"448ee658d865598d54a707a103960ab954df8927","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.16-448ee658d865598d54a707a103960ab954df8927.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FTfl+hmPLW9xDwt+l12AelbanGkP4LEBZCgMKWl/FuoYv9JSImuV+qpHEVXvjsmO2ljBIi0NGDBjS3NUnWdrng==","shasum":"da165a1924c65e21a992caa27db473bd7e2efb94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.16-448ee658d865598d54a707a103960ab954df8927.0.tgz","fileCount":39,"unpackedSize":176659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LR2CRA9TVsSAnZWagAAlisP/3UfZqKe25Frpf8AnApu\n7/9/7aDecH82apWP+vMMT2UGL0yfRRBfa7fQp3fiNB0261Z1gP0VsC64MkMM\nO62kfooFfAJ1nKH1MZ/ELJrc2B4BT9zV991s9yZDpdCOcefGye8Xy00pdEk3\nzNUNx9y80G7RphcwmwzDZ0VaD1z8/IIirFN9w2TkPXceQNGhsICn5ZWLSB5U\nfLfVdeBY2vfkjzAfxsG6OMRwtZ+j64iuI89jz016fqvwekR86KVrupZGv+1E\n0aFaDpx3t/beF/98KJABFlnC1Pu+TbbNQPC/lGXJK7KoysUhbqswHmGV4hzI\nfv1EsO/ArAICOxbieBBQ5h2N8DCpxBL276zahZGAWDyVHfXuRx5ueHhSJyxP\nOtZ8jZopjV7pWD5yGRnDkPfGJ4dRXwAE727Hyq1lxqmd8ih8ralo1iyEKHaK\nA4Gr1GsfIsr+Af8Cr7S8Ts1aJCBo8qkQX6szZlBCAJXSZZm0U/mXMQz9XypI\npzgiwzZUGAiaXx2kchCkLDZgXz1vY8hIaYZSJReSz0IKX4eTHBOatwwRfbsB\nsZytVa/1qFJ4bWhY9xJ3Xza/zYr5Q6PBEd8Vpa9YIIDYr3SD2nrEIXJ/Nn4e\nmfkscWKd19CUFupVEHkCW20g3troRiNav9qmxt54r+5t3gK2iOmCqCsEpvoF\nRAsi\r\n=mX3t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdt/NroaDkkphukt9uS48fNo2bqhF3DaoROxUEjOq3PAiEApnrf/Z8fC30wG1ADBU+pZQHa9SvzyXRb8iiFZCDtcRA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.16-448ee658d865598d54a707a103960ab954df8927.0_1591784563986_0.43985751725384215"},"_hasShrinkwrap":false},"4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0","gitHead":"0fc601b47d9d08b947a4f4d93f1b50cff742a207","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/oHR9x44anepba/7eR+yYtpLiCQo6SzMDzWKk4Tt1fvL2n9AfRwVEj7afmmE1XsWCfkyLM547ZpIczxAB7xj+Q==","shasum":"89ea5a2536a710dd980fcdfd3a2927be4a3c3ef8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0.tgz","fileCount":39,"unpackedSize":176375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LSaCRA9TVsSAnZWagAAPGAP/2iJQLDPSZB8JY/N4zoQ\nrVujd6nl/cwee02cS+CgVNv76+3DGRSKnTlTtOC5zPJW7TmMxexbb0qQ86z/\nroUslvpFa9ccuUvmDypSb0LhvVWkpnpgP2fiU65xlmCXw7JXWk2bVOFVjEa5\nyt99oo+zLJqG2p92AR+3o0mWgsnNlTj1gii50pyHsOuzsujBPgruvqdPJg86\n382SlGGTUZ9P4lo2Pr8dKLmE+MdYJk54I3WkwoBqIHp9rRUXDdwZBU3cBYO5\niPgkwJB2RVJ352qePj6Y7DY3DGtxki/Wx1+IX8flBA7T9wsZ0LurFDUxhu0x\nBceKyEnOU9o44G5lQ0Mt5tNG3no9ibphU+woNYLMqsOhb4J6X/U8d9Fnvgvz\nSA+iwNk2GN8JvPdTLx48lPm08jDJxZTBcOfIlSd29talwGbKiw5UgD5UFYna\nCgPUicfR5DadkdzOKHHUqy5fgosNQWJDw+mWwcXr/hOJas6uaQDMfkLQC9yG\nAdWlXgiyrzUlV3n9iRCecLvXC5zJYSeLDqpv/yi0YIiVhgnit+STsVsi4f82\nLJnsKqzQyPrrdZid/uNFTCP26uWY26nbToexhF3bCSR1znaoSxegYDWBO4le\nfkifyUVqaw0UnaIdednGS3b675+MWKtH+TdyHCVnAAsxLDVaCDV8zVt8pEzk\nQJPl\r\n=GajM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX35eVovcMF1Vw1lt2BclzrqRdpx5T3VO8Bj70Lb76vQIhALO+e4vbmlZYoWF0qskyz3+gJCDzSOIhjzLY91bLtlVA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0_1591784601780_0.09911322441286097"},"_hasShrinkwrap":false},"4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"012434ea707d5880b31a5e94e52f05464e566d57","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qBZGBsr7fCfT368hWtlzQbF+q5TAsPc3itupUjAY8MYnnTz5YzQnOOc11DePRwr39hdXOhVTviIzZT6TtC+tSw==","shasum":"1eb5873b522437ca0843ffaa73ec0b6026ea0a4b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0.tgz","fileCount":39,"unpackedSize":176659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LS5CRA9TVsSAnZWagAA+/4QAIXaytF1z+NJKXZgOWUH\n+rrff+yQyQ3BSLTAPeVxmiAiikWpd1mrwQzVyptZyoF7oG8zO0izMU65nY/6\nMWn9NbiEsOgjvZoTX+tojSnuyeTN+2QaQk32IblAn/gb965XpK2co5xNxjI/\nex0bTG1R7dKpOy9qcOwMk57jRqCiXG4UmaYM7ON41u0cHfS5HoFMiPn3oab6\n2lBbZmYTSjLECQz5Eo/X3ARMKaMQ8MtZrDYsC2HlBsTwnFxPXrdthlJMc+zV\ntFrKgNzJNgTrR5xxrlazZMcwhO2RQ1DLjQRgf0/G33PBHKe2n7yzbPqUO02B\nYFDMhmIwFE9Duz24SQ8llGzuwQ7MZOk1MwQQbwiKAENhImFRt9MEe5T17Gz7\ndEFW18B4n0E97lm32GWY0dQLP1clo0HgLNvzjf0nrPmLGsOa7JiRmjj7I8c2\nSt6w8Rq3/V66S6s0Tj66uHGBGYcvQim8x7ZhSrgqC0QQR7O38FmLiwvUjwAx\nZ9TQifD1CZj+ZC4HFQv0n0BFJ/xKaAGsEEyX+teyS4OYpf5PBA6OV7amhiBS\nhIZV4RSYvNSiX/QRyjsGEoF7/G3/w3arC51oDtQ1CNa02BNwO/KwGLo3y/Ii\noveoB49ahfFBHvkcUxJSvblrcJDmkRjRHNA14kCmiGFmyQlm32kgb39zKG/+\nt3MS\r\n=Xa3B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLFbFAu54Ly82P5PH7iUDvQbKWXfVPUQ2QGxvAuku4JgIgZVWo8K2kK/bkdelGMzuC0aEal4PoV+fTnjT61NFkQO0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0_1591784633412_0.8871371471342542"},"_hasShrinkwrap":false},"4.0.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.16","gitHead":"8aca189c4998a669dbb4738eb3b275e07c7e1fb2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.16","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vbL2OPoMIC6CeOJRzt08Xa38j0TtMgGWWJ3e69uaE2BTME5ZjQyH7eV1opWCcKW1T5WsJeoR6WCgWAO9+JIZQQ==","shasum":"6ea68102825bc2acca24bee547a8a7ee924a8915","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.16.tgz","fileCount":39,"unpackedSize":176908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LThCRA9TVsSAnZWagAAeScP/iWbei2L+4HgUrVjVDFn\nPbfLfFZRSPDB5hdPgW4b0tP/bB09jhnNweaXuf5Is/1jxZicN+/P1IEBgaH3\nQR6P+ztU45owXUlopWPpXvBuQ5k8k61zh4QrevBNHyVDNYVJZzjKXYiYFrZ4\npS9N8UYZKs59iNeMQ3mu9e5IavWpeBFh8YDO9UFqvGJCAr+o0TgClD42y3bu\nOFLVN53N6UimiDc5dwTxoCodkU4hvSok7VnwLYLtaruC6XKUCvCcmbccudfQ\ncHEXoQ0Jiok8bwyY1mq0glvi1cHc/VK/waKQz+tYeOLmU9NsV40SbRu4Yfkk\naC6XlXQguhrx3a6IzAFgUWNOcEe6Dhpo9+T19s3fZxEYRcScYMEUj2UDmT8l\nEyymeXSGiQljG2l6/muYBoapztKRJUq21rjpjJfkQt/l4oB03l8mKG6INSPi\n9enhy37W7P3W+hjLmIofWpMfIvlOJDscURZs9hpBM4AawKmBYI43OvY5PnMz\noxPnPal4Brq65BbFgaTPX/5D0vS/H3p/+Cqs+9bkwW7pbPrmECIsVbLSA4yb\nQ21omBBVbPXWgXboZfDs9XsRcEgByrzP/rVSgODPfdZRzXSqweFGhlOIM9vE\nzR+Fq8m9e1jBvP/O3HhbaCst4gVtOH3nugUe6PeEpB46Gx/WDv2aa7l7qx69\nIwVu\r\n=MHN9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDWe/rfu55ye1iTUjzvr20j/6npvkYvizBrDkV5PqvRAiEAmJE6sjOYoCIB/6sjDCYfT2Q7XOyhBLbqArc/6JdXZBs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.16_1591784673158_0.9897616213968767"},"_hasShrinkwrap":false},"4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.4","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0","gitHead":"8b043267b79f521a61eb33168bd9a7e1a61e78a1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4+bYG2EtoR6NoICG/AtXI/cZvLP3e0KRbfN9YnYeMtWNjqVvgoR3zUXgKAG7atNWRDTUwIw/AFxddUittsBHjQ==","shasum":"a42172b8b1970907c08a95ed27db40f6ad3c25fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0.tgz","fileCount":39,"unpackedSize":176659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LTrCRA9TVsSAnZWagAAtTgP/RWGkW+EMtqjiVItMWxX\novaQSPocaYosd/z5e/Jht0ppy/L4UNlV1hIamf4f0eK7HEPVpu56eQvFqPz3\nOlZCpzuyZJFVwcnvOeSD8A5ACa+e1imcR8wVDVONQmOqlIoPpqZlyr+o2lUP\n37XzPHtUEVJdG2vs611angsv1EbOwH5CejxjrGHhQtLsKek/oU2i0oRkUuiN\nrvWM1m4GeaOxd6ub3ZyQF1zeFtTM0ckb02zgND6ezBunDV5/TiOBIWR4gesD\nKXLyx25VGDeiOX8IsZ4QekjequjBzXm6xrfStonPlKZ86zYcxzHxK+9UN98S\nSMW7JuR7k5iF8P1rmoPpfU/ItsxPz8VfAkuN+KFZyFafXwI92AdVENII21xC\njUoMrPOXGmrJGY6b3l0b6HWvVzw0cO6JRSFZT/Mows5eVOcdpzH4K03wfBjP\nJU9tGb6BhSIc4J5SkDfFZma/X2C/q/eG8qIGMK0bzjIm+MoztrzDegp6q+aC\ni6Lyh/aE7+Y7P+mQnD7s3gCFJkz3oZg4nX0887HnYfFptzv4BwZmnrlHx6ph\nUPVuW7qtvs4ay9QAz1qEFQGNpSpFMcSdaDL6H5IoZOxkBT7p86eFnz6rjaZu\n4qN7f5eZiOcgEbJEQYcsQ66UldiAJehp8h0QsmyVgUmIeNOeRbQ/IURnSv7e\nr3QE\r\n=aBIB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmSc/K+IROBYrDTcZ4oU14X4wWkHc7IQbEGm0KgwgRAAiEAvQ3C5w93XTBDfyKiyKsEUBTURDmPcHZBMHqL6PkRuTM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0_1591784682965_0.53217441369909"},"_hasShrinkwrap":false},"4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^25.2.3","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8aca189c4998a669dbb4738eb3b275e07c7e1fb2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/ai2ctW1/ZBFqaCQQsgCfghLP7XQm0c2yyM4Ro8BN/dLvNSIJmazNy27D2MoZfLsPm3rtRz0o1GZD8YPMtrvmA==","shasum":"59d55f276a0906ccf4b2f461fb3e078af733262b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0.tgz","fileCount":39,"unpackedSize":176951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LUGCRA9TVsSAnZWagAACTYP/i8C4nBbHgDn5wnnunIT\nGRPx5qBGh+p+3hkBT27zIX2T5v4cwcB8ZfVVujsiqBTg/KcfWeQl0TjrQ3xg\n08AkP7waTIwF78NGK+Z5uVn11bNlTTVTKrkdntnpul4lf8RQFeoCbS/0tL27\nhdhQQDY9sx1G/jf+ik+xIuI5bqdNcUVHYsWNI8eLtoCP+dhlAkEsWlp3VcYm\nTs4w99yeKdXHF9TCyBsGE9d1ou48XKwzzEnYt36bzVyuXXgcMLq4A5CNAonO\nTZjrta1Y4tjhrzGsk0zOR4h70racWeL0vD02sSTefLzAPxs4PP6iNPksTtdY\nRLQ7vYwIpq2Idf7SYNPE5H/l/1QiJ53Cap5gjjwTpzjgweV8fenFZM2Gu15G\nnzlF5vKGFr2BGKJ20BaJ1o82ltCylaR4kToclW+9jbNEJK42lSb4MuiXXH6a\nin3JeM4VdVr7DeSmw1nArau3X18ysXN4PgU7huBg2PcwmHZ4oJPxh/lyKpfB\n/3Q8nSvkasdC48ktdajlqYJsnhz8l7jzcjXiqOBst/0SpAyhcNn0xNBNx00K\nKvha0SLojiKMQMQ7yGRqsEyrYl8cIpcyfXqRu+kbEX2maNYwX+rc1YlaDiD0\nBj4ggEzK4hv3rbtXElHJNrgi6A1zfyDy4br8l4fw3vw78E/ra03WTvL6rcZU\n+CVg\r\n=Hyxg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICs8tGnkG0qFprHA9kyPCuGLun37AtmtcRKXLDgygvk1AiEA5skt7lD0V+sSOnp+qTqCRDXb4MmWvHycycbfipGd8Qs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0_1591784709527_0.9732591730017282"},"_hasShrinkwrap":false},"4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0","gitHead":"dbef6a403b702cf64a1c67e0dda22bc7aaf9476e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TGJiSOgzjxiM2Q9yHAhTvqiNmuzFZlsmTi3JkXkCcm+fD63lZtR+GzM3RTdV/Ct4GoodxWkBehIElM5eFuSMjA==","shasum":"f8dcab2b58abc8fecb22f7e3962fb9f8826dcabb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0.tgz","fileCount":39,"unpackedSize":176951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LUwCRA9TVsSAnZWagAAP4kP/R8BgDd82jWUfVG3KZK7\nEq3kXZTlvL9T8++JQoghPPTg8Fqf2m2Ve9jsVVWtRbyZMJ6sNh4EyEKwgaf/\nFtacOORUA7BMOPx/i+TGD4WC12ytWdKnDvoGftWJPBRLb8TC4h17SNSluUwZ\nK2FV9ryf8YPiXA2r1KavPbLKVefq46BQIH0VUe9E9AkNHoEI7rXlzAwLr4uq\n8HMvY4RLXe2KNuQEeJXoDvArRtNhWIbElssdtQtj3w0+mdj8yab/RYHwWgnQ\nRRelVlfZ6qVXNwwMRNuACUy4Et+UKlqXalZgZoGod9MHGYVWYo7BavxCqHai\nWgv9nOnu0KZEjR9gwHG/sat1oYrfDXOxZpKzqjgIJJ+qzqNjqe86YdUbu/GQ\nO0XfVxggCHcTuS1hontvJAH+Nwg1YSs5NYdY6E/SEYieVJnurtMjm9myDgok\nBw+PVLRefPiu1gVC8FWPHaqXpxc31MvzB94OWLUL1KBeRq2AvNDmSkTJFrir\nW3qsexKb/SLqc7KREXKWbtWN/e2R8Wxr9w60QINTvFKoqTDvHpqUuDsF9PYi\nnK5srJNktRRCpxn6MZQJAneg1YuDxRHxi1rOyJfY5pD9quIgXZGX2CTiiamA\nub+AJCGkTjkueL9PoTr5IwV+rKdtsHhbaeR8o+rJ78Eg0YeidaU3k3z+Vr5J\ni96Z\r\n=0jCo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNgNQCA8/p7FYp9WASOuIrZOMfH4Xvak8+ORpgI0I3ngIgJoqmLNvpRix296Vzt8tl9ZnjnEC/JyGqcmV8HqcTo20="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0_1591784751913_0.3678243376368957"},"_hasShrinkwrap":false},"4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a2d6771b10317ad2a2a2fa66400184a9bd686eff","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Usi4b1bTOYFpB7Fp8GH3D6S0NfuVaajuvcI89ii7SOz9M0Dd2ZiRv3NcH0SQ2FDErVecb0//P82Eg6J+RfBgbw==","shasum":"724dfb36f899a4487689b9b0f9c1981e9417e6f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0.tgz","fileCount":39,"unpackedSize":176951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LVDCRA9TVsSAnZWagAA9H8QAIdLKucp0aB8JfHUAqrD\nozw56hyK2fWCbekc0+uBVGFzDQ10eD/4NamfKJk3bP9BJxI7B4eCGYL1mhFc\nqqPjpMpBBYSEqDkPEeEQaple8r3hW9orvMz+BChElmRsRcahxs2uUJUUM9Eb\nGhhGZdIb8r0yh2AyY8HXO+frp3cWBsqaRJVC/cfoA/FOATHPdXRO8IuHTPs9\nHeMva25K0nwP8MvCDMuLPPaxEJAE3RwL1+mykRzx5UnsPpCuPfpt8Yrrl81V\nOROwOSQ4Qd0TyUvPtw4AfFOnMImVdjw0EYQkPPYhZ35tKfAk8/D63/eZBS8W\n2vTjh/Z+Kjg7m4PT6XC6mYju9Rxn09gkni/xg17YseFveMz3J+ISf3RY82gh\n3KDreN48WzB7LgvlzD8QZTIqSr9YsPVrcI29bRXstdnKqK5jiBSHfMGW6pLf\nylJBwvggdSDv4dRkrXa9HyVHsdbW9KozWOMvBNTfFeGJe5F1D4NFkOmFCE1W\nbErEkw6XFctxBTo9tCKf7atvNIOlCDMI28UMereSNkU/gfjNzv6527/lcm5F\n5U5wwh6EYRzeWb+zXQjYRCJnD0R7UBf3MJXrsIazbVABC7ypgp7dfrXbveDN\nbHlm6vNHxWiREIrFS2D6lI8EzwgHruLxszoNvjZt1JRoNQoZR/VolQtEftrE\nUOtS\r\n=/8nm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGR6WdvuAuDU0284ZBwsV99ASREMpgGDzxzHQzFLqPFQIgQfhSebGnOTNyvYlJtznIcty5mVpFssdsg1D7VX9neo4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0_1591784770846_0.16383325092777934"},"_hasShrinkwrap":false},"4.0.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.17","gitHead":"acfc6d119165cc5d7ed608325c802df7cfd128b7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.17","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ETkRO+mH3er1deFJ3lsIM1iB1RruitRPaadoIExDpYxqCHuOrlvA7Jm2uL3jHGIRPbnLi9hdQOob1EDfIH+ebw==","shasum":"34057c6aa11f54221579821612d279ecc93930c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.17.tgz","fileCount":39,"unpackedSize":177190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LVaCRA9TVsSAnZWagAA5OwP+wcg5YDcIgJ6gEl89Enh\n5iDFrWJMpAK0nVDipeu0QsjjFd6ftz2x2ou9chsSloPAUccaVuJNfgW+SSEr\nLHtl2mS/zDul/wucBusUqmlJ/36rvMPt0Wnmgzpxa0LTO5NsVBwkUcjEzwdM\nIP8BkWn/eSJWPYIjA/IlHUQAI4GdlxWaI/6r+7yrkZVKI7Xl02DcBPCTfjHu\nnMt+Gkx0MiuI9Hvrb6oVo3+rkbl4/4DNqWikYjjIhNzrt1COFoJpbocbDvKg\n6+pFRcXrf/AMzrAipd+xrUPFO/5HzI0dPPqg8rQpdVZd/UVs5WDyfr0BSJjn\neGiVzykiYFG/ItUqyBy8ExrS2WAniEO0veSj8TJ5EflaO55c764mTi/5WDSC\nXTOYe3rDrBcEI522Mb9lbSoQ5KW4nCtFR8MowCe7P/xG6yXgggvUkaNClIGy\nvR4sYCjzPwfT92JuCF004ZD0Js3XTxyAraKYKN4S04nGdN09qctVIjOPHoUO\nc6v1QTw/VD4gb0eX+XitfKqxEVWBHitzyV/v7ImccX+n4NJMPicQ449CODeT\nYoC9wQuKlUhZM8walices0cHx5mJFl0CSPn96wobNDW2JbDbPlgX4EoN/GR9\nBTQctCPWeXLi/yqFn2FMWIcRXVLY7SFDGWiSrZQlezSFTKYVmlF7K3nsjMv3\nLmjt\r\n=Powy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH9Cyjhw1FmCGTKgpZNiT1O6vJY0oPVYGy8OiZ9nsVuAIhALK0eId4jduzYWrradsYz9U5qs5+GpOPVxWCgDk2z9c+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.17_1591784793687_0.7750048210778475"},"_hasShrinkwrap":false},"4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"acfc6d119165cc5d7ed608325c802df7cfd128b7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Rv274/go7Btnskj2Zu6V/Bzlkx2xwujm1ZDyO0FbRm/j8fnHp8ZYLe4AGjuyLNJw+Lzo8ELT84//c70PkVp+Wg==","shasum":"be4654606de6fee56306509e73428a882394dd00","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0.tgz","fileCount":39,"unpackedSize":177233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4LWGCRA9TVsSAnZWagAAq8MQAIDk0vFCI/6MwivjJN2R\nJ3nuWFwh/YYx7Lks6lVjgmxylXMuDfWL+4DpHaIuEj7v2XoyPJjuvlIw9g7C\ns1iy2E/Gp34bWmej6BZWBGZbdRmyxnIM9rTNhV86isPea3mANI7JAgEp3Lv0\nxvwpuub4hWpQWMk7i6WtbaiA+JpJvoejAIv2RB5Aia1Zz7iDnnOIgoU9llRj\nayHJX6zGKEbwPf4cyfVb4LngVUw4UPUEAhy1NJ6Zs4tEcYGB5Wo7gw35vih5\nF01Qg5svXdLuQ86Q715loP2+ysXwuMdLCk/7kt2/XTGwgKE5qQqtO6rj4J4f\nBdHJ0lgRHc3h0G75rWFVoPjps7xf3aUBF+xWg/6ZipyOCdMwquC/dDuG26l0\nQNTUfWtHbhG013ZQTf1KMrL0NHO1fBfoIO86n5yiCwA3qA6NXwnUJ9IVBlX0\nuaHnj9bL9VgtJW/PtZ0csK4HcdKEsOPm7zXrR9YJJjuMWgN7Bk1FSYnh4jp0\nm0CSHnC15/IwWn0lQcx29v8cRTVndOpWZQsXSXeLcu3REp2VMzFM1oyj9cgE\ntzKG61eS+A/mdxGzslWBI0guuCqm8YH8p//i1pvRYBmNnZYvsmVcyXZZVn6N\n0v07Nl1VahQRju/bS91s5XxTH/G2cVFDusC+cuBPmZiFxdso1rVxDyQGU/+3\nXdfa\r\n=sV56\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1KDv/KHIxkAbQYI019bKUwQ9H0Yw4oNInzK4vEFDqcAiAFvxJexBU4F3Pse1ZCImXDeMq97EKKI1tFIx2iWQF4jg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0_1591784837951_0.6098723124882917"},"_hasShrinkwrap":false},"4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0","gitHead":"f0af64d0dca359a2f0480488540b01137994f955","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2LVzrk1dgk+lc+AtrE1NLyPqqeXSVYroTYkXE4vtkhO5WhC/RDcd/8adskLKTl/XqtJeJF3afQRVhj3KskRSFQ==","shasum":"0505efe6f928f9a4dd77d578acb4bda4d350196c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0.tgz","fileCount":39,"unpackedSize":177233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41BwCRA9TVsSAnZWagAAO88P/0g4QwSej4ghDKBisgvH\nvsDbW/BMbgIxYRIImRx6L9qmGFd2r4LCh56Ai0yH+/x61uM5dYngi4LFSc4i\nS920sxxK5Q8XI8krBgd2YSeKbW2srp6qa7yuJL3zG22BRBMkU+1wWF2vmI+p\nW510205oZ/WdcoDwzPYOxr7hoaX1zlHPtkddNiieIFAPxAJxn7J8JrquIm+S\nsTyqikL9a1VWxGobNP+66QnObdBjr+uRQdUUnP4ngEBkNE2xrrL5NDThNxnp\nFErdXz81MC3i48vV24u6V3HEkZNLGyLLTZM3J1RZStTGhPj9HWi43qoT9fRJ\niwEIJWYCsrbAK7BlMwFAASOiKBr2GkDpGmsBhKzytFUycFLovuk3FYACcNxb\n7VsLkkrc4XwhlfHKB8anB3IB+GNRatvH+SCAnxQa8/80/ZVAyQd+no8NT/E7\ng0JRm4Bs93LXgi6G8iiJeM4vwKRTifznojNwG7WYsNCbIguvFTqU5fQbIi4T\nsJzl4GgOhXP8Vu4Q/nE4c+rTfuCVklmQ5VBxaafsfK0jMf/Rk0ucv/eNuBf+\n1v7dzfuZy69HduWXfm1lyE3/bk4VYNGYx1tsxKE/y6wXZmDQt1wypgkJlXRT\nzYJWpWV1B1ZPKTO5cmzl49J0GKd7tDZOaEeBSkBj7SNBHaANjCvlTgzNdL2H\nLJ/1\r\n=0LVw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGMtqJm90fHDZDnmmCA8VZ33MvQGy38pSI0y50nSt9qvAiEA3+oHP2F0ptbeYuGqSJv0vk42y7qHLohAnsA7iL82+mE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0_1591955567593_0.9507023996492139"},"_hasShrinkwrap":false},"4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.24.2","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0","gitHead":"b8aa6fe0f5bc994eddd85cccc25968308b56c078","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nYeJGPwV0leH0gfwM8T+5B5Oh/lhyR5PypQObIbv2wQ6piJIS0ZHt8+uL+N3L12FFaA0px1w+4wEn1kV8aVY8w==","shasum":"d3e31d16824cd75fa6e1da68d6ceea1ae0f40b41","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0.tgz","fileCount":39,"unpackedSize":177234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41DICRA9TVsSAnZWagAASAoP/1w9UNVUaPeCnxz/tzvD\nEBgxPnLIVWhXZOwj4KQl0k5ycpmGknnJ3+m5r6OMlWjjnF9HZS7c3bj9yCLb\nlvl4qHLitUuSZiPnfrxifPWEatyqMiuyzqngEKCnNM2JUrlnaiXVLy3vJbmT\n5JyASDtdmuXpSdcWLXB4mWE7qVBW7ovg0h4URDXzX79xbqgbrLSiKmBp4e0O\nMS25/R+mB/EvtfEbUhfAdB4U6S75hZiBj12SU3QqL+bdZ/iP/nzENXmv3pEv\nF2IDElf006MWvDTNj1pGHeYuj9+LnMApH5Y/WmFoj8HlR4v9WmFjqJ+oeIwW\nLuhquHuqOGe9SJCr9UlJF5pjsbexCeufrgxKbaOOSTcN15Oa2nQWNcOjskjW\nYNtB+cLdQyArZqdP8l1qBVPc3uG99yoZoZCdTxZ2SgP+wyrdY5pfqLINVBk/\nsomUeXZ4xjbRuViaBbiBgRRDSwM045guoJ83hzGbIJQGxN5l12HTk2KAZPon\nJvU61qMya/qd5BuTtqkXTEYkUG8tW8HcmrJof33BCoxomfWw+2Ep/nyri/y+\nwat2uYgHrVM0j/X3VeOkku9jbkbNnKLBw6WFvWI10TMjknPSbZNlH9oCDIEl\nLqy7SgE2oK1VE3Bd7uc/xU8c6v0yHimpVJ+v0w/Xs+u5py2deRmox5sGsrKs\nkpAr\r\n=h5kd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTEbTSCdZlXiGN3ZFRNcHKqLraxN6GM/snuu6xaFalgwIhAIF157jqDbWks6nlsELSPVEMYtPVspjzlIuZCIVRlZQi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0_1591955655658_0.753070476628346"},"_hasShrinkwrap":false},"4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"18d6bcc2935d1eaab98fd6743269144ca505b152","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4/jHPwSZwb8w+XRzD9CM+h+6UvyOrO04zVqbXogVXtetoM4236mOtKdMJbi1YAk2Im2KdJ6v89LskrW43JXCog==","shasum":"6b1bff14ec24ee509125ad40a6213fe57bb65cdf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0.tgz","fileCount":39,"unpackedSize":177233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41DSCRA9TVsSAnZWagAAgJ0P/0RUo383C6d4EbahKYgr\nK2ndJqUKHsF+d98IpSs98rwPi6tiLqYqX9JA3QJjL8o7iskjsCvpfSC42afN\nHhs/1wje27FKrZ51VPrkoFlp1Kl49mE6ogmtn4Sr3wZ+A9/Rtzk/en4oKyLe\nPeczxe0EQ+3nmYrxgT1dBkoGu7NQbmvidLlKPM1HEJR7Tgomd06B8ZgUOXWp\nnMc9hSns/ajAVY52QNBy2ae5qMeXj/xkd2hbjrmskdNProxcqReTLb6w3hV+\nXZz5yTRyQ9EQfS+oyNoIsZEWDhznrzfHWOT0dDN3zHzQ6fHY9NKpCXkQiAgP\nFQiNC8HVywMI0Z+I5XMimEQYRQtRAM/nqgH9qq3jiOI9hfMR5+Oea/QnQadO\nqj9l3vSucSqJ+jTOiPkp3g/qUyxK1sdmPIZ2j3c7ZRMS791B/hK9qqL4CSUt\nxZsru0A10nSppd9pgOFFpiLSwj6ZvLWqnpSMnE9uDgX5GQt8VwmtF3l6EHXg\ncRsQfvyIleXJG9van2VSSFCbBCRxpRW0VmOYWNzGv11arEq0eqj357LJC7Ci\nocc+/1Kbqscs0uQ0sp2aN0cKR0qq6w8KnymOy6w+1FtjIfxedUayfm4Qkger\npS2WDUv5G32d0sMh+t4BCthmUPJC07YSFUn31psqN8WcwVtuk18n07idYg3e\nY0d6\r\n=us5t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgo5ZDceQ9rAc2PP9V8u4Pb+mpjMup/Oi++0YDYcuorgIhANoZRMBdFahnV3gT/q85FXNgkG4NLs7qnuAmyCu1G2jw"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0_1591955665829_0.8745349329174017"},"_hasShrinkwrap":false},"4.0.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.18","gitHead":"7b43caa91ea9556a6a737bbce0dddf683c8c60d0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.18","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4ezvxaoQqBAnf0oF7AtAIzYNH3oIs1fhCMHDTLppuyvVyGCFFHmizpxpqnFyH5I70FvhRCGcsNEYN+6ni0rVjw==","shasum":"eabe1a56edcfce91080ce6185f6d995f1847a4d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.18.tgz","fileCount":39,"unpackedSize":177471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41DdCRA9TVsSAnZWagAAAf8QAJCrgic0sMk9DpEJI5p7\nwUu7hmcB5G6LoLC0yEPI8XshTw23V2hWXFCadrfkfh8Rr9FUpun9/7krb8kE\nMRd1jdLY3+yGk2EwgR1/gwgiLPMcZm3T1kEWlTRR035EUjL3YqM1ZRInFz8U\nYd/d7hNbsdCvy0+RQsOHYgzavDItxoBLJvgoxy6C77P7mKwRrFFHlC/lXXav\nTT1MiTrzurMUNhzkmLMpvVkdR7AwDJqRcul6r2zqO6UC7Nwr800uMfKQZYfJ\n5FCoyElGrWCWpE+nnMh8WC5Z+O6lP2yUQ1L2xFxTmcqSQOn4xb4GRSwGOotx\nKP2SVVCIsI+tnnxhw4lhFyMIz5c4SQ3OD3+PBxmcNFrnPdeNflA/EGEnJCnz\neD6o278Y/OCHsjm8Y+H73jCRE7On4DlB+vQ4V8VB1rK83/011t3e+TY3CXZV\n0+YBphQdkWOfRxs+txBAwcGmbQ3/5HXIegekOs7gEd691X9+3yA24uZiQcGu\nV9OMkEvUPoa3+uUWgckYW8hVm6HTjMqOj4ZXBEspYBt8VBgSQVkJ1bTQlHve\n+flUzNFTgbJQsANHv6rM9ef/5pU14TUP5GN6jiJI691U/8ZGEt39TbA9ftES\nfvcjPh2IurtcP6znXjNUbOm3OldgvdntC3uOV466ALTfENcsL2Ddg+me2sj5\nacud\r\n=d4dE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBAOnWLXFvvnBIErtzw0hK2YL2/hb4mIZW5SJSIWSkyoAiApaAjDrAYMbQ0AyGyhJjUf23RDMsM9qzgqE0MQgYdYYg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.18_1591955677207_0.6761731436505862"},"_hasShrinkwrap":false},"4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.9","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7b43caa91ea9556a6a737bbce0dddf683c8c60d0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZabyfytNn0AYxego6eifCx3ccpoghAOC7XhWecHpwFXVaYwU4kZpI9FJwkiQDtn5ToToTWInFTuuaOX4lORB4Q==","shasum":"4e27e4c26428d89893f46f57512c729ae7e6647e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0.tgz","fileCount":39,"unpackedSize":177514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41DzCRA9TVsSAnZWagAA+yMP/1ZzoKIhkhT7EfcAqesy\nnXFVlpKNqrVIPoIdnaHbUKC7mUyMtXSY5eX6NMuVPssqcAKqsAD0wbnQHnc6\nPc7LU9KYLoMQ4fVQJMt07T1xcOr2hCQ9D28FEExe7c+0LGYHZc8xdZI+BzVe\nJtk+fiuwXPjPcIQKg07XMOXYCpu+I3custiUxribUz6rxPndQ+l+1QGEuCe4\nw08hgGyklsjaK1bfVfHHwxmi/3h2Rwp+SjRBYshN6ce4BcAQpqkw464DaSyo\noRXHh6r4yL1MNbWioqePOI1DKzZvVLNGt2v8SNzYSG0lAeRyro6PZqCypxvM\nln0cppblNrKOMZqFGQYy90k+YAngQ+5A5gxjteGvAfPzq/a9lL4cERszfxfj\nQ5NIiLQdqsEFIIWjNYg2TSknqbCsnLVt9JwFz5Tykh5+mp1e/oph6dGt4l2O\nPMO+wsECy/5B/0BJkwB8SQIIq8XFNo8S6Lob3rsUIRZ4JFWAovtU5yserZDf\ntysODOXFfUfdS0nV/40GQpf5MSJOCHXO2lqHzipBH1MAidIGDa7KzDZKlABp\nFCXIHiaFd9UbyNRzwC8n7zQBvd8KpB2H5xvIiZ+tEdZ1gR8gA0/vUY5AMiJe\n5VkfYuOXfM4d2CrlGoiGn0NqwXHmuvKSR051uBX/kkV2xBs8UAdIcaSv9lpk\nXNBw\r\n=dstu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsJ5kbqUKG1cfmDa6NCgvdtzGGya8Vumr/WVjp5Tkh4wIhAOMWK3dRtG80I1csQwGydRZvsm2H9a2d3CBUs69vIInJ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0_1591955699285_0.9549382784021825"},"_hasShrinkwrap":false},"4.0.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.19","gitHead":"24031f5866cae31d592db7ba04a13e2fb83488dc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.19","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+DWdj01NFvmat18uqnPSH1mHam5PXAhytNRwzGTZfaE3JxZpqEbMAgnFuzaGyymPOTvel1daiznGtTxBxC/n+w==","shasum":"0744429c862c1ccb2280f8b99aa966b8bc41bf62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.19.tgz","fileCount":39,"unpackedSize":177755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41EBCRA9TVsSAnZWagAAhesP/0z4M8c0hEldfcfddTU7\ngHxYUwxzEmYvORvkfZj5TmsmMI5D4zfEAjaV3mPiLVa5+akf1ojmz623Q1Ut\nGHqdPLnTMyxqkR2xW1fCppv9pktJUa2eW9y5v5H9B/vaXCW4Aghrw/XCYMzT\nghFfVtZV3/PryhtatqlM6JgZL4BO1taUj1FhKnVkViAPO3naREF3PUsXYNnJ\nL3G3ZvoATkiyBcneuR7C8cCHpcOGOs0kOBmxUVs0EnmS3269DZ+RFIhP53p5\nlBtL66o+zVx+ifjIMjTsQF/S8h2XKlRUO7gS4PQAtkbm56e1itXJ7QGvc1l6\nKiNlwDAymuDOy7me36G3rV/ore145CmKS79u2SBV6/bjkNe/fAGuk7/ueIBc\nzbVABq6ggXbgw1mypcC+v90PI9USz6YSdz8ckK/XY+PihUw44Uo4TH1uWISA\nIBvIUHjXwpyBgU1kZlLJQ9mhFCo9CaM8iA6AJ4LHKA71pZFKktTJimrL0hhj\nYKTBMEnAT/aR1n9WaN8dqYs3vgCCnXCqOk+snmNo71NIBypfibz7qz4wY+V/\n2MdhJZbrzw+u3H5RmnikHIZ24jL63r+PaRmciVpZqFV89T4amShJhnji5Xst\nmA5Wai6F33cY3fFyRZzwdCOm5DYWdxnDUPKkdLYjXlza+rYndf5gNuXToT1L\nQ40I\r\n=kKeR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbLgGArZXPaYd8pSfY16mIyawPWRnGN8Uw5c6sO+Ob6AiEA4EADuA0AWrJr2+L4Ao3k+QZhfb5R06QYI9AHYdBV7O4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.19_1591955713356_0.8766478847377421"},"_hasShrinkwrap":false},"4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"24031f5866cae31d592db7ba04a13e2fb83488dc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yryZ+0eoC7Nfdf0npDBeMrJoed4EhMHzKBo0hCzgFBZksfcimntWDiSTF+2LZTFujb2wKZfE7C/L+/DLdBVpMA==","shasum":"379cc571e8bfe3ac9c02868e7307de42830605ea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0.tgz","fileCount":39,"unpackedSize":177798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41EpCRA9TVsSAnZWagAAngQP/R40T55YQAmokgVTRu0a\nrQF3UO4qbKFI72W+WLCb0Kk1re+K2JcAho82S926bYPShuKOxt9o4PuBqhFf\nI+xc39rU+eywpIdCXBK4dIpH9K9y3kTmdgBvc/oZI3fAG5QnFnBtoiZJiXxy\n0B7qfGT8i+Pu6eIZ9Gq6a+FfPa0XUWKX6a0i/TC3VVVWkCJmPT5cIBfH/pmD\nflbyCyj3AFAnb0OfXnWMZJ5QBkgCVM1bRT0xzqMUV3Rt7pWn7uZUL92YaJKu\nfhethLp5zZhuRWgtBJu2QOG9d47uJAyKe6RZwY56gi2mrSMBqC114hrpdPKC\nusnzpni/DMKGcqtTjMae/TKdTZf+bGbkZfr0AFwfXRZkFUCYdUjEPS9eGeSI\nZXtjH300s8Ql6ERBSeiVJM3jv4jY/4MV2DxTbFZAmNR6OwqYp3Yuf1zWNzVc\n0ID4cZ/Y91MzBhY3j1BIuYNEyURmJ5n5f4VczRETh9t14or9grNrgsRKoXWI\nMUobJ/v6GXHpRdMG3tCIOheeb45xbmsR9xPdhtaMt8Ys75nKT/7g2Q4H0p0x\n+X4WXeH42X/YI2WAlFY91MIbZlFH5o1MnWEPbo8PXBOYmtfB0h+ByNV8fpfS\nnU593zPagRYFZn0pfnyqNMt5LD1uVO1eKnmWHghALaBODVZX3YuHyL8ge3Z+\nGm40\r\n=ndks\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1OXCpj0JyxIg7GeIZBeQsJjn1xHllJ852pDXs/t4x0gIgCCuLrFkRD6A3YTxKvc4trj6Da95IDl8X/Qj5Nj5h1HQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0_1591955753339_0.4735648114752411"},"_hasShrinkwrap":false},"4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.0","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"eb3f78ea8dc05d79682e19562be5ec48fa916853","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hEh7I5flBX6rtbvp+IZ/NiZ3++GzBXiaDwa+GxhYwjybMLBYoykAJSdfpeIBDd47LwxvlqTFY3QyMMkhOgc3qA==","shasum":"1e4d345c2750bc675fb1885a9ae2adeb0bedff58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0.tgz","fileCount":39,"unpackedSize":177515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe41FICRA9TVsSAnZWagAACpEP/jGcuPwukforkBV8m2Xz\ngD0eCz//JYPnUElZuswjkGZAI3viJasA/oGYm9fw/jOT5cgyBdWZpJccTC2P\nruv0uAgLGg8LVUs7gmPWgAexhEgV6PDY9pvIp2mAKU3+wnR4tToqPHeYi1oR\nLjxPFraaqQxDJwt1Qazn7/x80KILNqN3ppOKzceOXOpA5/Aq9FRsqEa+9D/X\nIjQARukBhmAtR3jCc+MhsomWZzphpF2Q8O+9XspbxRU3HroG80FEWPaznANT\nL87urAgGfv3QfZVtZ9PoItvDhMJ1QIi+nNZjL7UdM4oX1EXJTAx+FUo8Zz2r\n5hCgx8eRXeEiEhl3ce8ENTpe3TGzw+sLK94lrs+rxuLy4CAnU8+Ix7j0acDl\nACLIKIPSSxxR2CbeYCL77mEjQqqN2untTwsgzmh03sCb49zNm6jobhkBZ8N2\nUOFHu6kfsJjDwH0w6/MLAn/GGa9XzJxuQP2S/RxxHqlFb6CDDnD2QQgDDC/4\nJY+ldSkOLkeiQEfKQXSeXvwSwSyAdGRhGvQEPVKTMQAf4Fs1zFF6AfCbr5rB\nyCxRLYY7dCdLawxNpizUo9iaW2vRAygAHUODrhWqVbDQvNrW2zH5JfZ7OIo5\n6gFU4pmGMrjZg1MeokYpRTC2KFmn3lnKs8frEW4t+YxZHtAZ0IE/vHwmb+kx\nlIqW\r\n=5bKA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0BT4qtKnFLIOC5bkOQb+4Z+nFbRAI4P29XCK7b9ug5AiBKiCzhQzfQHEV9hnKYvHrD26xo2UGUo0LC4whTtk16ZQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0_1591955783903_0.37181637575083815"},"_hasShrinkwrap":false},"4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0","gitHead":"7bcf9de5bda7c5b626ccb49c404ba1dc60547e73","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MzoSaVxMv48nLVampAXCao1KMUQLgZCFT2mkEzArs22jIgItWK2WLKX9QnXJuq/v+OyXnHovD578SJGBXX6YdQ==","shasum":"7dbf7196bfcf643fe6786dd99c0e46b4897eb996","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0.tgz","fileCount":39,"unpackedSize":177798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe51bvCRA9TVsSAnZWagAAWQkP+gJpn5/NUl/9EczGciPY\nJIDNwuKqVg3/tlwH9ONgjCBf0z0QcKj2L4zfygGOlhNp6VTKx6JylnNUS9Z+\nNtVFGYCBHinD608+qqLGEl4fi/KyNak9nzHotVlsSocfgVSNtSSS8Az7q5Wx\nf4cYpDiKpmaR/qpEmGXLiqq/K1HOtI8FVcZaiDdXkHR4GBHOq6v9N0SJvT1X\nXZp5PBRp4UrG207ZCapc6CL9ihSkGZ/404gBHs7FkwAPXl1k1UrfVXNqZ/tU\nbUhsnFTVo6tMMpL8+wmXo+tgEnuEan8BBvJJhh62IBmOXJTwp9ukj/SF68ZW\nM5YfcFOS8uWYEMjtkIe4NMu92YLHERPDBuTnIc12if6kPkRagbJ3MHHzdSev\n1XH7RJfmjJBmiQgUXRtKcyprwQxh2wAMRyoCAeg1eWV2EdpshgVwW8z8P8eo\neKDxJy2S6Nvkdk4NlC2ACV4iXX+tAYBjRUZQHm0SFg/xnvMQ7DSK35qclFld\nUSeukqTkRaGdtHGiXvx9uiCmgtW0Q1YqpEw5iWyxgyZWVO3AxUIO8mU6Ru1r\n5VUIb320TbQbwq25/1s+Uo9HmPcsHwth7wm52okVgqon4HWZDx7feyh7rDuj\nFiMm0FWl0URwsZAz2vz3aYxAO/zySKwBigzqnFZmjax/uvB0m90WGWRGNf8c\n48Xy\r\n=+DqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDx7wMgcApVWtwWq8AknQ8RnVQXYsyao1sNNiqtwNNUMAiEAwExzR2rP1ziMdRq+JbddJvSMiuk0zSqvet3UaoYHFZc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0_1592219375200_0.09546608828110892"},"_hasShrinkwrap":false},"4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e3ae1dc7f46f1417b5ab438e59a967cf14d332d1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HdzYSM5sOpVg93zUyQ2Ja9U1WYVCsUe+530n1PlSrYVbJrdTO4e6R2pTy2EC+aSfz4DtHgACibu9sypp2W192Q==","shasum":"1b24eae7067b8803daf6b05cb3d55f7ddb33447d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0.tgz","fileCount":39,"unpackedSize":177798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe51dxCRA9TVsSAnZWagAAGmAP/ifMBu3XbNisD+iWvsPT\ngQE34qoyCFPna9RGKUhBOHZGtidUGsPksL5B1lZUUriVhSXe+/FtdNse5vhW\npREI0reozNn8morqiXZlukhJK7+7/dHoWv6UuwvThKeOiLRROukRnoRy4P18\nxWfkbgv+Wb7ylXJfcNxsq2VAI2wf7i0oeuYH4YC79WrI7mEJDO87XE3vQygK\nAtvXY6LJC4Wm2xwraUhSswdD8bQym7PS1AuKTDPthOfgfwGCt0q+ph+Tbemt\naQG6pZEZ+RfqqSuhdEsPHO5TTg45mnG/VJBDFwDOUnyeAGNnRJ5T0/PfSFOF\nWP4nZJfsA8QVbsjxOR2KbDcuuBng/nPXuQpkaH423fVUg8AOzvu/Ei4NjbqA\nbguwToxoMSMSDMhS6hMrh5+6rH0VzpLBy0rKXxRK4JrljQau0Hcf3Y7bVRbk\nSzKTDrwUCDVjMLb+MVtIi+TDZe8GBTsDUH4IVMtpp1lHaUJtKFYLJY1HR1bw\n4rikvghy1FHcCfRM/mIjSRUrdjUJMu+L9mw75mfoRBVe7afQfEyeeUK6Btuw\nUZQGx+hOjTrgkbwMCnKtSTx7hiUX63YWamEHoYTtIxgV5eL436Hu83cQmLLK\nHVx969FR5fS2VXTZjvhlqacXAiablq3PXNfK4A94twqx8fZ29OR9SScfv+FR\n2pqB\r\n=yu1P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm5co1lTjyHCnouSf5E7thsPQHjk2B0My9t4xxAHHAQgIhAMxDZDP0pkvpYVZkePj1S9GhUycoSD2Nzcqwiv20HV+y"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0_1592219505123_0.2651797799602398"},"_hasShrinkwrap":false},"4.0.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.20","gitHead":"c0d6a5ae653345710231b0e11112aff2528ed601","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.20","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IxGeflrmIn1isxsm+6gRLuWTVCz0gW5WLkXbnVZe6rC6OEe02al+MF0WKtrLi/Br0xDkxjEZkk27ikIRIrpmiQ==","shasum":"beedc2bfd07f10f9ced77f03eda7eb1f8a0e3a97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.20.tgz","fileCount":39,"unpackedSize":178036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe51igCRA9TVsSAnZWagAAYtMP/2MgM3YUT2WsOFXV8rAm\nXfPjmxhyPzz8eBNQ02WPCSzGnWl7vIowl0sUAUJ97yJRVW6VZeRFnZjQfljW\nisDNJMHJYLKRhjAah1RF5YASUah+WSSiX8b5mdkb8a5/A3dB/yPPzizSwwj9\nyKOnteV8706XCrNT5FcFbz5mzCCvu7vLBCgkaz/8D62PRNBGRfNpQ79y/X+X\nyPFPpwnCm9y7JPUiJU0FirMLZBpz/L75DArkirxOsxPK+rxoLZ4dqQC/bGUT\nnQkAmDBpzcAzTT3sV64QPYmRO8KOjpCCtreMFTYhx8Cmcz3jWkC1kfe6cTj4\nvTDC3qlnIh54PDAsCCF2tfldsV7ICnYE7KTO2ZBbQk67DCWmW7TIjCojTlAV\nZCaEV4es2L/RivQIXP7aaA76RdtyTJul8r/cvVNUgkrZ5JJK/PAnzV0yyzni\n+mh/+gBPaeIJDKYV2TiZylv5u7mKsOlpV2flAttc3LxpuIV/DrmhoDF4jtoC\nf/hXvcb77hX7Ov1RFx5BAIKikfJuj+ziKcyXFmO+zIONrpCBIx7QVvFIQp1T\nGH/gs9PRiPh+sPRdPjdQebaINxwIRrVBnSe2syEmM8qFHzLofzPvjceu0h77\nPkneijFtXaJBVvsvLX9ADHSc9SZ+br7PxEEt5bNMNMwugpee/cGwFUL2VjzP\nCpaO\r\n=cMVX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDAjDapiiVJjeGMUX/zjgip7yVkSm92YFQyhw07RhNtyAiBGwv1wDanIm/ZZGWk0pcNipYv5QrSC2Vp96moY2kZTNQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.20_1592219808030_0.2841175596920249"},"_hasShrinkwrap":false},"4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.10","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c0d6a5ae653345710231b0e11112aff2528ed601","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DjeMYBWlk+6Hn/DTAGJg/BC05pAq4MGvbZloKn9tnwjFMW0DO/EtEvtVMEpe/6Whbrijwl2gONBJFdXm5tMfYA==","shasum":"1036d19b38e8a7c57e2bea5c8382e8b199c16d80","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0.tgz","fileCount":39,"unpackedSize":178079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe51pFCRA9TVsSAnZWagAAzn8P/ArUchcjyeoZ/Q8GsJ8Q\nKoZBNDOVB9yzwkEF1cMc0LPcgLvKpW6c9oWBNbJPn8ySaS26d2bGUEqSU+YQ\njZMiSckCcDNEo0++p79niYRSyz9DxmEgn9JgziPT2/pSEdkhdZIKWXJKDqeX\nBFqWGNJ3fml+3LvE+6F4A15hOzOI84FyQSvdsNpvEEW6OOHK6NWvZh2B+ual\n5cCNruvxx4j1kbKM8h2G3VdvBXAkLDtXqoyXmMuaj9B+TuoHQJlz66Q2bnrK\nLAv39O5xKMNKbz6tdBqd7M1htCTPBsOCD2Pczu+LDp2oA3hY/ycLQMgzZJVs\n+3IVR0FcbUJB0VqhCWWeWEUT5ZSttqw01vxFCVJaRgi4BJH/B5oDDBh6x09w\nQfjXKu2xFPymkk6UOwQ9Va0XQ2dBoNVOyO219Ighmu1eNx5hSQ0xjfsmmsCJ\nQJOZt+sSOyDuechMj9R7vYysPd1JsbQlhfQVhd/P69a10lgIALhXxTkSUrcQ\npMjkJ37nZtyHBaYwXZcWYQeOQcOUpO8ak810OQwEzczEJQxQMayHy6vhcNGh\nB+PLrGbkvPa2oIr4BHy2+BCsvVBbyUabGyu3NFsVxChPlyRsHEyei8w9U+ql\ngxFgJqlwhQiLuSVcNc1grN4bbsq+g3LR21MpMGKBKk3za5i5ui78RjccB4c7\nMWKk\r\n=I3IT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYhjf0eyfeBMMWmLd0KyagFBxXMycx1AwL7KJyv4vXTgIgTzhkRcGN7khDsizvgj8/Kvg7Bh2/FJxcuyYbvvnTdc8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0_1592220229071_0.8772020687886541"},"_hasShrinkwrap":false},"4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0","gitHead":"abe74b5a3475bd89c3f49b7c247e25ab81428f1a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9Vcf9R3mZ+UuWirYoOdfQKMEJhtytFyVjbYSMURAUEif8sAjnc19NtVJUWtDqDnO2jCnWj7xcRPU+XOzI5lnQQ==","shasum":"1020f192add7fa1b32e20f76c2bbf14d18576da6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0.tgz","fileCount":39,"unpackedSize":178079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6fC2CRA9TVsSAnZWagAAMnQP+wbeTEQFXdoYgsKsPPwu\nhTTzP/l9Z8gO1Hvh4EYI4TRles/9zXybcb/PkB2l00180TXI2uXRq7vaxfFL\nnPRNp+HiNgv9tdeS+cEmLPYbEy4YGCZFqasHh55DTMQZdbwEuGgg4mxBf+KO\nTCgr3GaVo8fwXf4kp57pF1ZaJZfCXONWXUzddh7dlfrpOrPO+vZO7tKbNmuO\njV41wWgvRTkKdsESB+mTadWHfGGcHzlD9g3U/0eCFoz2H+WKqVhRKCEfiKFG\nVDVF5V0ywun1GJvZVFwvFJPCJY8IPLaGXGGzvZqJowbzVLw/koryHc+TfB6u\ntWhUKvm+UMdxyAsIry/I8xBvDZj3TElhqqGkHit55zGv3c7rfzN1YOFh6iwv\nDFh+nWQZeXnuqSOC4S9HQpGTWDQCo22g0BVzo0Q71j7DwFLHCPY8FLECYKOX\nhOSsvnl1rmwT5IxmGYXIexXQ2drpEto+tZSNrRC2d+iZ85iJqPdZGuNza8cU\nslA0L9IujjaD5nVOReet9/YqLhXqWJ6JI1rxOhvB26aGdJ1a6vZMMG5OTB/W\nWtq3Z143mizRckQRXcuw2PrXF62h5jOTcSIuuYPs2KtfpQ8cIeOVtjCQl388\nCptrWxiFYq9CIeUgdOjixUAnq837tlSGU7e/khY4kfSMIQKD6TD7HT++jrQZ\nlqUa\r\n=F5DC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIALeUWWmhcAbJpiZwFGr28pKFSjREzOlp2ZC5h5tfPpbAiEA0Q1JhHUJJSV9ptvGl8fP2ZH2aDZ70TazN/qS0TfovCQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0_1592389813691_0.006214583429312803"},"_hasShrinkwrap":false},"4.0.21":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.21","gitHead":"d89961efc4b89381fe5fbc18a2fb1793c8eea939","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.21","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pkZ5ZsyTgumLWJuTVr/AP287p80LE/3CN5AhAdNZMMWpJosBX+bN7i3LKLXB9AUir+QLy5TjW7nz9OKpFDc2tA==","shasum":"0bc1d512251d75ea1427524105906e4302b9cf87","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.21.tgz","fileCount":39,"unpackedSize":178320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6fHXCRA9TVsSAnZWagAA2p8P/2MTqnyrbmpOOVcpSKrz\nMExbl7emXdrJQBBRJau5/PlWSstquArEI32JfPFdjdx5uiYAIhW7AA4o4+dn\nHUPY916kjfsBTYbtb7vsou21FT5B9lAh5FE66VDrZJ+tRLAspATI6NYgyatr\nWCVSONuXD9mlOWiBqRQhcSoyCs+phBmIlnY/LC57gsJcMsLrZSz0EUqAmklO\n/KhFUPGAmyETqQbZ+fdcBTqIVJTyUrC/dF/PP5qn1atZRg21/3dzKYXfxZRl\nK3rxdB66jXyZD8RBigQ+yIOkLwFuuD8og6cEyM2jAJYjG1pwwv8WomHz9h2a\ncAPnxOdgy/DvEUdij9+MN0unKcgYH3fBMOfx4yHXjMeFo9YmybyhqZl3lpvA\ny62S07Yp/RIgzz+poCqnBWRfkCjkxOGZbedPQvRBfDmOLgiXDBzvEiY2scyW\nzNiQS+uPRgv/pafDwvLSyed3nNgyFOHX3ToKC7kqh84fQEzX/8qMDFzk0mvc\nU9pvlcOmzXj+yZ/sKrisRtzNPqBN6TwqrnfoXafjkVj6PwFimnMXgbT6eaXk\n0vTy/nDilUM96rKjE/rzCb2XbcZ60tfLbl/5f7WzmF0SadqolSXRDc2lVD/L\nnH2fobN6wWemQ4ne6wbFsRDVFhtzi03lkc0z3OmBkFo1nwYMMokuxSvFD7nQ\nO8zs\r\n=U7lx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC18duQVJdSehtc8FUGsUWrnT0+vUsC0anqTC2C9N+xlgIgag99Tpt3UVoFX/sJDjysoKUt1B7BoNb5ZEvoDBkZv8Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.21_1592390102795_0.19715405990096713"},"_hasShrinkwrap":false},"4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a87454b11546eede10c32df79bfeac79c14783fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5ek85MloBUIb249+Pfs/44RdHE36zhKrxgT2gwqWzVlBVD03EMB7n+D2HOH/LT9dW5US5nLXLfD8aPP/B8ORRQ==","shasum":"611cef51d85dfdf10e364104ee9387c1a23e8c5c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0.tgz","fileCount":39,"unpackedSize":178079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6fHnCRA9TVsSAnZWagAAYGEP/2onieobsbnakrtA+LZA\nfV2cdHThDTvPt8j6nvuZh+me2x3GeLCFDbx8g7dqF4nCYR0F0lDQcIoQvGv/\nMDZSfPdwlOHV8NiMaEpVTnLtf1TWRSK8g4rVXtSq6ctEvB+t2w2NwrxUNXfw\n+rU0P1038nuLbuqFacTpCV2mJE3rfmq1iCXOkT/cgZPz2S6vttfLTpImweYd\nAVlUy6Vma+NqZn5V7cjrHQ8hCmGL008SxMq53W33uTFTc+gfL5FuaZmzDwpB\nt8uOEAXBJTTcoRup2zMjyfRG5O6tPC4SLlJMLigbooWZ2UqXpRwl1peadoI1\naI7UzPKLCLfSFfSmGPSOdZj28tuh38kxK+6WSW2XX3lNRlDtPcwiCtMosdNM\nFpJFtyVJuX0qxgKpLtJAZ28h148+3aYne07uQ9brivseAXzk0yDenES2Oe3+\nKiC08CM7JQPqNY4cf2/OHhYtzf4fNstxRotcISdrzEJ1qcITPyjHb5PpM6+z\nQkXozpGbKmc+5QI5O2JBHwJbdd9853p9SDNi2FCIrdsyjmxXr9uZkemqd++8\nCXf1M1tS7JscIvsemel8KWbux/Bs93TyL6EdbxeKKWIa26nw/WRw/cHUt0QS\nXO3YAgh6iNEXf7F7FbKxq8DbInmdbaEiLs6lE2F3fztVOHsBqqEx5zKvdZMl\nD2OR\r\n=ykpU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5a0FjyfYkrb0cNL5n36tEZUNQuR6csQj5JeCnnVKOPAIhAME92vfHS4lj92VMRn8GDBCVOgm6iZu8LFseP99t4P7J"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0_1592390119306_0.5889846798906577"},"_hasShrinkwrap":false},"4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d89961efc4b89381fe5fbc18a2fb1793c8eea939","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XGo++tK13yfvgdXp7kfFGGunF6xYr8MH50POrtpz1V6YHbDj4xGX3Oe5hFxxL8UB8RsY4qLvFvjb8uRH334duQ==","shasum":"78df6991db2e63aca33e3aceacf9477587078f5a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0.tgz","fileCount":39,"unpackedSize":178363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6fH+CRA9TVsSAnZWagAAnKEQAI5/bKIQ9f+YfRNi6dGK\nROkt9s3efpPKxNc3FOA6lg3JahiYO1epS3bR5tpO9gENFFrA+pp4myqugdoE\nGZMvHB9F3XLxs3PCSxfmGPYM6zOVID2SLngyH9HoBMv6f4/W/id9WtBxTfc9\nj8qnME+dbIPrglbHLu5ntAV+Ixp5+MVzcPEuRoJ1nqgrqkG10ApLkqVtCuPn\nYtJ5ticGi6yZDPyKDmRpxBMxhgkNzAJfmlBFzhvyxBQv+LlujuuaPAHkvRUx\nrlCQ+8j+AmrYimxiGMixQlnfqKQbRv7uqsbUa67Xr+CpV362kErCFgy8ELc2\nEluhvi/Q1M1uv9e3Ipm9YOQySmz5vn2OOqcvFC89suQkY5xqBImJR1ioEXsg\nr7qXPDo1NeIZwL5JReCnX3daGtcKtuzWNrpd5l1ioFDzR/Zr4O6rePjtWP/Q\nUNPZInD5clHUmL23lARqJcmKcU/0iaVHfbq91pfuA7uXeCu3ySOe0GZ1zt+d\nZus+GfYp9HzaPq8f85U0Y5m54AzwbegeScuzHFunx0omDVdMHebHGyqqEKVG\nVdsoVejiWmotlTwDUGojp0FVokJvbf19uDueRQShJbEMpuSTWDfIXl6Ihx6k\nOJFtVKwnKcukQjMc+EYl4HV3uWok9ZkuzLX3gJft9DERJh1L48IM3aBx6fVp\nmTEq\r\n=c+z4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4RXgCFwBTNUnZkokwwlTz9eDAZOy0F/jQfPkS/A9yZAiEAxc7IsBxDrMbl1YLYWdlL1zxrNNYpEWdUlUHDVV1DhTw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0_1592390142160_0.03921216303042496"},"_hasShrinkwrap":false},"4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0","gitHead":"d5a285a048bb4d1097e4a9fa70bcc17d0e14246d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vwki7BNbgNayWPPdIcgfZ88NzFui0DTsTJiz9cJFTAsf/mztqw/4FLGhTaOYK0aO/i8KwRROKTQlEvLGiyi0mA==","shasum":"860029e4e665a6a892415a64873c69674d7219ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0.tgz","fileCount":39,"unpackedSize":178363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JkUCRA9TVsSAnZWagAAjjgP/iexup94bJYL4W3wHL/f\nLGLhFkytQ0y2NYw533sfkSCMrUk/FO9ZuAc6SbT8qgYSR8wGqW0CpwtZK4Re\n34ilJ7orROhbn8gCzY/qGo2XIPJVygVK4mTg3whqTwnE9i/MFe3cPMG/NUIT\noNuAF1nA0wmgPN/C87qqFH7yPeEtCFPB0UIx9l9EwNxmE4O/y1wmTVY7tdH9\nJy8QqRA4IShfIA42tJIZ6pEXnbQlydxH7S2VoE3IQYuBJSw9E4QJdHkNcI9T\nNGI2xj19dJqT5yzvbvQv8hrQWtQkg42+0fUutgwezhQaq1QtPbTJ2aPFS3K3\nKx59pMNHk5Q6BxA/+q7XuJp0xPfbMVu4D7SpCJOFLY3LTLO/lHryDK7clp5O\n1HrGQHLbzSp0dcSe0hwkC5BzulijFbbL7m4ZiIK7hytm972qQDO4J3cZfj4Y\nMqGJrKGNLrrnUPwpQzESH6TEbPST4SJhhYbpj/jwy8B4dWMvjw1S048VLH0S\nDC66oJDFhSxpCYBV/3Ji2PXXIgkWKl0KAyjG3SFX6FGrHl+cGVCExbsSLVdN\nCFF7Z2JVozZOc0EhPzJo3y5+NyHHPV5Ky5Eiyk8CcnzOhTh17RiH4F3Lhz11\nn3HnuzGgBj/ZxuRUorKiLqkBDbDn7O8OWiisxtZKyWJLHTycwpFKKmI7sr9e\nrOQ+\r\n=bpfz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTn2OKKbz2k00EaQQ+iLZmJ3SCYnMJBF7EjRhNvjyx6wIhAID+mXbOyvtXSAbsKvd6qIEbI8njXs5Nw9rUk4zEC0TL"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0_1592826132426_0.4129992512152394"},"_hasShrinkwrap":false},"4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f019f18f26420569862ec7da31fa3b49e6223117","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Rm5BHwA5Q5sXwqt3Q4l3towiIiIMYVLkG3Oe5VNhsWSfgH0qDW6bcwqIfUXYIg67qA7pYOhi+KMY6IQZ17dr0Q==","shasum":"506d178863be53e8bcfebb808759c6b460ca8cab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0.tgz","fileCount":39,"unpackedSize":178363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JmCCRA9TVsSAnZWagAAEbIP/j69eVFY8XbKWqPmnQ1E\nZv33pDt5FDu+dsLhXS8u5osK+iUJvpXAy3WaWYwD3QqF7q4HzJ35hlMDxSPw\nTCPFj+MMH1bXS99VI5bWUfOYMJbIJRKDp11dWXYwaqnFiK+i7G4CBcjVSX0s\nVpbfsA5UXRGyp1kt84d7INsPnbJeZLLCFX2mHOT9TTmdru7M1RCHRv1YJP6+\n+uDssJk91Wc1VXy2pbjkOWQ035rnN8EBPtYe7x/LRUl44WoL1P+hMWcgj+Su\nSAiGUHtcHris3KqsYLbc1RI/yC/Ia5Qljango4ZVWYBOe5lr0o4d4yTxzI76\nGt5SlXrzQuWECwdamddU3LjJjF9D1yTo2zScG3aLLz/FvcCLgcLw5o2l40M0\nhUjjlhkoALqNRfZjVlwe0WHAWqd/oJW4iWCUVxflKBeyxEznFuGgFOP1S4Ah\nNsJkv9yhioTf7CpsJooMCdmoJcf6Tt4H7w9PbkENvcDLeSwXWAh7EkdFYbYu\nCgDo9c/HphPAgaimnzX+VFThkS4cPdXwZTl9jJw+T+3nVr3EySfonZKvD0/5\nUUWpHufNjkaD8XYZipJexJ3r+Ce+skwtghfCpck4z85ySc3eUG6sj0H7xwNm\nOnFV+Thl8IieEfiI5bCsBi6xlMCBWl25/ASs4hkXHD4/7zuxr+7vm55ymFcs\nNEDy\r\n=KpEZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC41OL4gamAc3Dz+m4JseuRdOSpFHEDfJaLlqcMtoDSUgIgXe4xgUdfhcs47uEqHNcoT9UjFgEJQU4hC+7Xt1YfSvo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0_1592826241491_0.8990719834273002"},"_hasShrinkwrap":false},"4.0.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22","gitHead":"f83009ce666f568aab33c3df3d97293c9e19d702","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Oh/8TSHcyZVpWGiTf3h7jHD/p+Kx9uNZkDSitUnylUoVc8pvwt2ZQxfJYJPnL6i6vxoo4NA6BgJXOn/XBj90Mg==","shasum":"1fea9652ccb844d7b454d45b7e32f71af73be243","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22.tgz","fileCount":39,"unpackedSize":178612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JmUCRA9TVsSAnZWagAAZ00P/Aj6SPZlWOpXmSCmhwJw\no07p0+1bOfuxHUVjlRGguyANJr9pnEdT2sz5/awbx/r8czZYkrOSlbVtVD98\nMagg4sWnWFArilnuoIfwR0CZRUhW4h7l7JdN1yyYRTi69pnaimBmAIcHSGPF\nWEUEUhmOBljsg6gsUbqZspCBzFd6qfAYzAFCAKKKcKc99Dk4g5/geEVPQfsv\nb33K9H9GLeKcoPDpdRhyvg4dmgV6ruQ1WAsZABFV7hElv3zGqBZUYrIQB9IY\nXthDUaytAYZZmAdpZAgm2R58IoqCaldeTnCN/wcJqP2kOnvECd2cK9XLEyKX\n2OiXFXFbJ9TzB8yPwDgrd1zrPZOALNHXfOwhP1bCz8hm3zLkyOT0TDj1XTOp\nypQ/k2qr5OxGHyDB+nkpLL9yhsUo1Uy1DV/GTMyOQurEwp23SnXm8doCU+Ou\nBLXptF6H/bsZiEdtND2jPYo0P313SBnB+uY+X0PkeDbo9glf6JAoKulLMa8I\nS8/w66nedDFgdLo8SbNlSuheXrxuZzbD/snPl87k4QmXX+ci5CZi1X7diiBK\nZ2/JjWeHVdQI+2kntyQw1Zo3E8ZO/mn9y4JMITKn4x5aLuHHbdwrV0aZpBqq\ntTZnuBsPet4uyQrboIKhhn+hYMqh3fKe7K2BvPDosgXM4JMOKUniFklXybMV\n6hjU\r\n=ZQQS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICac09dDPPTFaXU4mSutl609VWGSfm4Si2o1ZogHS8UMAiAttz7ubTlDH86fgCS0g+yQbgoB8u2KbtJXlI7ipSAEFA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22_1592826259974_0.8046241615002552"},"_hasShrinkwrap":false},"4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.5","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0","gitHead":"e1dff94c49bf60858a5e5a2032b3d6856849e5c0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8t7M+AX+NjWZ4CmCgs8bqd8N3oxONPmQbkldnRZ7gH2Qi44HucmF6LZPKbTjIQEXL69yd4kTVlnaDvFeos6COg==","shasum":"9b49643a392fbfaab293aac6c061d51985a61136","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0.tgz","fileCount":39,"unpackedSize":178363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JmmCRA9TVsSAnZWagAAK/QQAJ23JC3qHXXO94E2wxEq\n8rGGAsgYVr5OjjK2xA9REm/dKD8Mft9SKhwToWPBDfQ+a97VcdVoa53Z35rM\nPAufSqKzBeilk3fSnGNsXR3G49mwRkSoOVvkG9FJivEoiOTqXf7mdU+EmldI\nPdQEQ/eDMKKbXF8Bm9vDzRvY6wpPbjOpUtQL1HabhXoL0qCAzLSMcL/10dIL\nEv58N+KssGIYelInj2r5PbsCwNb6067APLQP/a5/Rlp6OYbxUunCDlUQEYVK\n2U9Je2ZR+qW9RpNSucCsp243ieMyxOpb5amelwfnD/d7J9h11ZQampMIloiB\nWNFhJrjLThSb+hevK3WC/oT3g0m4gAd9xsww5LbVvkmk8coYKACRLD9UpWkJ\nPhKKvO5w3DZMdDuNq14MtRk2yvtQMtfQM9506fziOyGKXle10gB0dGskAtMQ\n5BWnpQ7EzWzLWDXnJdRtC/+AGbQZ2jkNZBRm+Y7QSBqukRY3ECTcxSGSfs90\njej/KsSToMSl7ebYVFR15IZh97vnvesYQHQ6Ypi2TG22Cg3By350CuAZ6xDV\npNsHpu1yWesCulbosIxpfKg9oPgbY6c9H7UyFXpDhr6Ag4JCAQ9hvDGb7Uu/\n1Lcm4J0oGARb1RMxvx+pSN+YbtAEffSeVwUx4bw7cGNKYlHId2MIT0CjoMhH\n2YJN\r\n=2ZjB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnB/co9w/2m1UEtFSMbPnsT0dJtQM6Lny2artgYopfUAiEAozrq8PkAjyoMN+lCKyiuB80M1B6vG75+iGctIUNtn3c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0_1592826278500_0.20386141889507714"},"_hasShrinkwrap":false},"4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f83009ce666f568aab33c3df3d97293c9e19d702","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c3nFtVC9SoM+ONw26vFlLpf7buunl73Zk9RrlX/eaFBhVkDHwmXHz+2hik4K8eHjZLfGCFY5zET7YEDEON+s9Q==","shasum":"f8052909701978634f0e11344d7675607834e140","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0.tgz","fileCount":39,"unpackedSize":178655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8Jm7CRA9TVsSAnZWagAAU70P/3jspH5EXNyorOjeeLyX\nf+AqanStduE6T0jtByUG3ZBiomAXuTRZg/YR4nB+978YaR3QYrkadhZZoUhK\nnB4ky44PTBr76z+ESO6FtyvdAl99T/0h3sue7Zxmhq6C8zebvHOK8BS4y4mA\nHU4uwp1roj96zNu+R49F48RhPDjgcIC5qnw36sX0zoRXxw+f8PJthceceNVv\nvawNz0a2lIW6EP42D2+8sMKJtc9SCX9QCUKc2ShGZ0GQdSH7Gisgnf+UjSWN\nggk9dpDTJ9jdaM125Ub0u0i/ThEXoDna/eA32N/eAp6tJ7m5rnfMbM7IFKX2\n9Cr5KV6eg/dSQcJVMHn5Vbvf3xnB2zoj/yEAp1nHYB/H/g+yi8hPBdG7hzf6\nHqHdKMKHb5G1Hvr5vHf04cxi7e8I2/wvTpLzwLPs3+NZDFOLOJpxLhgSaBRd\ne88jcHSDqDtGkOc+8ad1QQDpvTwFIKr0SS0DEK2o3Yr/y8oUmHPR0FRiVxos\nchtgj9Pf+9JJ8i5aVeBkrGrkaINzQtRuhgXl/xoNCm/dzhQGt9gKpPAVjFoX\nnsGgkj91sYLC5awTg1aAqVo2LJpyVX+nV7tmxJFC7ODAC+dxJlL14cJdNFrx\n22tO3aCytAm1WoUeoHeuuZf2RrfaksqNkqPTSsbRKp+8Ez88ZKvFCr+AuX2J\n2rAS\r\n=BY1l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3KF7rlwv6een7767z8Ak8zkCqd7ZNqbgwXL4nlEUvIAiEA7WiqtOw9GRsT+Q99VCfh+kAauaSmQvYsV25ZAJX1ahY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0_1592826298646_0.4367753091615072"},"_hasShrinkwrap":false},"4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0","gitHead":"6134456b4adea20b7110abf3e259b94f6486f323","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gQFafCNbEvdDaUnjbhp+pdGNFYiol0wy5PX3zgE0EZ8n/yChRAZZXsaoyeA/uKmPIjpJ15uhfwMfoenW1Fp21A==","shasum":"4e13914a1998839f83bd06cd08c03ea277a84ea5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0.tgz","fileCount":39,"unpackedSize":178363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JnMCRA9TVsSAnZWagAAXbIP/RUWAySmv9qBpTEHg4q+\ntkA4Dig4pnqZVUaB9Q9toHUp05r9nzpIjrFYlBNkz+hbvNUp2aC7xDnqPxmi\n+rlmmL3R6nYouThx1HPSibA+6LGKwne9xV6W3LaB289ImofUSOvCDLb2YklQ\nRYs+D1EG4DblBabMBSwBW7iTo2UrtIyJfcZBO5oxn65KwIXbPbLCu5Bm5iSw\nqdA8l2ZvpmwP3FXUKCfb27C0q8fxBMYuF5j5U6S/5swThxVKjAvxZPHQJwG6\nUwaysyfjDPcA9jkhzsdAM7Q1BOnV7w2wSTqqQKOGKcvgNvR6daErzj36kAEc\neQQ3Gw/sGjrXEqRr6RQKTJ/Y6cazmDagBPQeU7vi51oCVj8Wg/jMyRMXq5L2\nGIjmyy8bZbWZ2V1b/tEvS4Q3q2druFyjaJLd3xbWX1KHrIBoQFnxXnWcAZZN\nmKt/L4PGKCs36h4aMjpPloC9z3+iNP2Rkfu+K5Ppqfr35KmAJPd7VqtLeVMu\nQ4undKIYbOIqwSi3mESjLEzcX5YIDBfpsH6h+a5onyJHxwVWATBSL6ZRa9tX\nRml5XvKdRc7NBgWv331HaNBFyHKpcwXxVZrjiQTLKFe7f3fN/nHF3PsyhJsx\nlXQ2XGhFwakVuTS/cTJr7dGC5xq1QWhAeJ+UFA9GsIyI5TXden9qcaYlFUqF\nmb3v\r\n=c6aP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGl5+f/HTuOhp1OtrMz2GdCA+t8svdVEK0DsOCDB2+VrAiEAyQyugeFbip7mED8JwFUBETytSJKZuoBcpB1qFNqGWQU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0_1592826316328_0.9735601190693284"},"_hasShrinkwrap":false},"4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0","gitHead":"3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-J5OPuk9fmJp0nDYO18hhdiX+7LVCrred2BHV3aVvqo4u/kVdMy+eQwiipNCLLLQAANE5/ZagSufEbjNPeX3mHQ==","shasum":"5d9da90a2033a9a638b18b38da84225144098daf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0.tgz","fileCount":39,"unpackedSize":178655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JneCRA9TVsSAnZWagAAxpAP/3T+F8vaUo2ggfDlcEcL\nMzLNy1mt5ibJohbUNOpIsJ6jqWZkqm6+HO9Zk6ja4755Gh4ACiT6Gsv+XUAm\naLl08BYETBczSPZ0YWAfMJu/fQ3oNy4lEM7mMqbkvrUHMId/uYgWp5V9Lfbj\nI2O/xEsxEoye5qhlJaFvIdYzYh7eWor+WTAzVrPvDHFgFPIfgtTO/1xWI2hp\nPC0kB8tv3D8gThNLaQgvTiqh8YmloI5hU5gNF5reT+9DZYbaXEsYo6qtQmoF\nhlgF9M8MlqmpRUzq+K234SzGQXSU0NOoYbFJXSZudVr7AjggGYUTVfgLdsxJ\nCN83T7P+ior/voR4rje251d2Mtsvdjadg4bxX2BFemO9PgsF2Ce/u5I4LvF5\nwk9ujx1i/d7n17AgfsFf6yrBRf6wUfoj4VTtku75vvtdL/r4D947/LTSHWiU\ngMz1UmGSid6BH/R6cDswn3TTzOS149Z1lRWJnFdcW85Y9vXUhdk2yXdfoQjv\nyjrzNZ8MunxhaYBD+9HYactsSVasFfk1bZDW/acHdB0uaTAqO9zE0lbNUsxL\nl1yybFG6ov53J09dh3YU1nEWUWEX4/oqJnchO+6VhKqY6Qsen3La07UNVhiH\nozmoJ1kpueckuAgUrlG25LHbInZhztLY51XcIER81Yhf+dnVPAJRcvpQqjtA\nGlhB\r\n=R1E8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4L5iowtAI/rJE7DrUK+jqGSLD/JLyWMx/PHowYk8u3AIhAOFpQKn0rsX5E9r9fksS6tddDZZhNq7wzLOO5s3Y/Kbt"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0_1592826333903_0.8090750412756265"},"_hasShrinkwrap":false},"4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a9d187f5af191c0b94811439f5fdc166d4842b62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Tq27qs5co4J9ro10fijxZrYyUP+2pSdxwRlbSdBgSg8l/ihIzL/wVq2J9NJ8o1X9fdQHm6RdCPYtV2GUo/aHxg==","shasum":"8ddb140366541f8ac801ff4aa938ae448c7374f8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0.tgz","fileCount":39,"unpackedSize":178655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JnsCRA9TVsSAnZWagAAs2oP+waZXbLjZTRkTdoWgz2i\neEnHEWdhEN6Ej9mr2kXw+hOkshN6uSkQrgY4harKGCTju0S0OQ9Htjtfu/XW\nGpp1V+PYvqV59C/ofB8JqI7l+ShOHoYbv8XIyDd8DL6F5/t9p0J8c1klgQz+\ntTW5pYB8/oSdA72Iro8EE7fln2nifmFjKHUyBDLTyxR/0Ke96M00UF1FbI2c\nLl9H20Gk6lPDWqwseBumHokxLPSAhTuiqV7TP+kEk7ObkmO5hBnTDe5ltTru\nhkV3n+bv3UgOHRXLP7h2XXS7sjG7nHn18U5ch+gaEjZrKzDszAsM2JuPCBxk\n71zg+qQhrT1ql7I5lJqoGiyKvXy1ND8xCSmIpCNDLyxBAJ64x/oKEVIoF7Zg\nLoUJkmnmYPJAa63n9pa6zM4rv9klSXVS+U2ZHnYKRXrqnFR/JHhVBTN+8UV5\n9Lwq/TJWSNQXLoTf6W1lFkDy+MhZbID/8sRXWmVx2ne5UIVCUB1kViDuTIS5\n/NLrflRxQISNs+8bJ3ygilhue14Yh8a7L/2a0B2CQ9GMeJHaDjRoT8eVM9xK\nvinY3vJk2HRwgLdz++APuymvE7hMlVZND8QaOvZtbJ5ABEi2KBDE76MMNePY\nh1R1DOVcOaYtoS3X6BDbFrvufNbW2sGCRFpRtuN4YiaTf+TqEgu38feJjgPP\neCp9\r\n=LR5V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWaqI5AYJaut0jShLSnYg3Rw4T4IP6pkBFILeWQq9XYAiBVeI5wX48KkITWS4/3bLIKtdiT2SM/HuZ+YxqUZLgcxw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0_1592826348159_0.41004738163448007"},"_hasShrinkwrap":false},"4.0.23":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.23","gitHead":"f3dde32e0ad2b2941fd295627fe6db47be2811e7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.23","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nbx+w+y4j/gQdOIq8QpANYPAQ3x9unW9PsUGGJrZB0IZiOGtmrV4OdL8sEiTcKkFYqHO182A7QzbS/vBs6rgoA==","shasum":"96b6b36c30beeec25d71005313028c8346878d52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.23.tgz","fileCount":39,"unpackedSize":178896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JpACRA9TVsSAnZWagAA3W4P/jRiRgQKVCuFTKXsW7X9\nDD+Kbk/JnAM8aux85Ns9cfBkCLdpQ4SrQ1rj5RG7LOq2Mnw11IkcJ0ON+X92\n0mSOtd4+GH0d64w9HxuIpLS8OFZbJgnTCABCu2dBIhOCDLaUQIYL/dacA8Jz\nn8mH9Md8HclOATt5sLSnS8S79ozXm+DebKmxbnkzFhAvPiJeJV0QBhj6Vxq8\ndLUxhUd/WUcjyxEr2glcCf7jjpQtXXWOkDgqLHUNUuuvhPaZ+OxHfbps/Suv\nFD9Zw3o5wvlWHkUYxpibjVBv1olmX7OkukVp8INjen/lTo9MpoBPNnMjOHC3\n0u3busVo8nS6Obic+bN/RoqIrl21phuCkKRMe+D/mhU3jrbRJfq/Ec29V/aH\n+SAL5hA1CZPgg50S5ybjTjpG4ao3QiFYTIAGBqasNdnIDCY79pjtouo1nWMy\nBaLyQsczqKxK+zjOH1JsTo2C3coe6thIT48isfKTTuWOXebHx3S8552mPAGz\nUH/mj0ENBWKT7Dbuoi/6zUx96y1+LBXZ2h+jrFjJEmkO+v4Zf1REO2469hY1\na0pA2tQp0uA1Vc2dL2B0FEiPdE0WCoHo8qfK3PdBllmHeG9B6Em5UTuPHYwQ\nkm1GGqkQA6wVLGnlVwJhhWop15gKpFVufmRYA4/JBf2UDnFaDzuM8jzdWKzp\nbwmb\r\n=/ozG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpEn/Z/0cbOjrVwU/s3yuLQXZvpiulvsW2An82HMUifAiEAvl/kvTDd3KvrReISHoy/ny0/C/nbSir6Q4B73NbTXTI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.23_1592826432020_0.8140686747061594"},"_hasShrinkwrap":false},"4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"94e49443a416294a4b7c6bade69d442b1b6f027a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bf6I/KS11mM5svcQ4lvMkdorVeKVOPVqUiYVkS7syUvi3YiUJw/RBdZyQwsbMYm72npDq5rxfHrv38PUF8TUuw==","shasum":"ec00d6a2551bb08edb4d3f188d2747139b071dec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0.tgz","fileCount":39,"unpackedSize":178939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8Jp5CRA9TVsSAnZWagAAiuQP/Ar49leI3Qimh10PlP8O\nUeXZidtUZmSpTwb74eqoR7OK3Yz0gjZ/eogwnDrcgELW2xNlFAeG4bJGUyhx\nsAw22beYeIlJR1SDyAgyeFyu7Mis9yORoSbpDAZm7Y1Y1SQ0jAzINvLz1qV+\nNH1/sNhfJww+JtTZelcbGRr6rA6WEJp8TlHzNstOcZEbkZsxj7IBmfN7ldYC\nu0GlwSWyemZcp71NMpQxVSNzhchDinVhGNa4Zy+ghGYKIbOwcAsM5M6XfbJj\n5H3Np4J73noc7cl/vj0iVhXun0E3DA4r5+Aeij47dfn3toDDrqAC2izIPtka\nomAhskP8QrpmW2oFtnoyAUt64fOAxeHV72JGf+bj0aGMIRxMXepzhWKuJRWn\nA4jsQV+WfhK+IhwXpiXtUfy4HWAw1SFHGPVx4Ee5+mrKswkijtZWz44ER0ob\n9jwwMXD3ZrTZoL5sEvtUziZ5nhExilKRf17PAoHeaRFvDziiUVMeJenyr6Ag\nApe8sAyMHPG8ikKVVpFUavtmvqaSo3N0tqaxYNo4WOCIpDMmNOBrZIfIR6z/\nuTbg6nnVhm/q8voHP2R+9pR2KGvtqEFKHojCghwvs7bSKjuQeBCv2AEkBK1L\np2ssWcqtd/rlCuUzhDQFVd0TFNdu7N3lH4FW6+PNf4YQpCdYLp2lSCtt0wRH\nAH3A\r\n=g2yf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENKsTv9G9+MO64ooN4glPpyBGysNrMWOarxi+3xG/PFAiAuBk07AdD1Tqt2/nkGeC41ux8T2xhh9bcxwl9Rgasdhw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0_1592826489498_0.6371356885405435"},"_hasShrinkwrap":false},"4.0.24":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.24","gitHead":"c0f930b5f3c847f565552081b19cd56b1cc879d5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.24","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mZ4kB2eSa84rFoYYg+e3WOZ2mctbzyzGryUte4HhTrb25PDyPaj2ER1azy9+AtxJ9uOC05MrAuHUCcewHuegVg==","shasum":"2a62be7d5f3c07b9db74d630a18a44f616cc8ab2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.24.tgz","fileCount":39,"unpackedSize":179196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JqMCRA9TVsSAnZWagAAZa0QAJqPuve9n8tGrflZXiX9\nWxIqA02POXc586LTWBuz/4jd6xVeDEHVYkVMQC9yJD0mF3cHpGx7ZtvJDMTe\nMqPh142RfyJWaAs8CsCm90hn5XoTgLYloSeGyiBNqeV8wwFepzU0etOVmMpH\nqaYequhnfl4QxevAA5rCTW2ncQGet2VrB3RTNkwr9eIidGxO72nrcNayJduU\nK3YHmJjf/f878PbyWjdYXtmJ46PtYybmetgkOrhsObwOf3dQs+K6aOWtKyBK\nEHV/kHIPFbq5AZmVRDP19ujEA4PH7Az2IZKs9L6cJe5oBd5X3jCCXZfjfsLJ\nNd2NOZSHZ1Iu35+ZmzUqa+eQxPP3bud4CEJGqQQxhpbd84Fg8mstvxoQgaIF\nafrRGhoJglOmgLyajBVNLeh5DfK40oN6e8hhpuo4M1UyG0TNJA9YRtdZ1Lph\nW6e2mwKx6j2ypDc8SlcrNuhAjKVySKS06fwY+bIZu93dHpdjhqIR8jFqqJwK\nBI0RHJCMefFtJ1bYmEym8i9XraxlsLsIxGc7ugSlPoSUugYRVNK1CnM3KMyo\na7jD1Xh+aFQD7AewhhpVtJ3MGPUzQP0X7iJz5oOedoGDVFsmnE5TGt/vpBdp\nSOINm6EoevAws6OUwrZ3gBaU+4ySyU3pA8hQ2PDRwIpZueww56XHgmAIbdbe\nL3HC\r\n=gMKK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDta9RzuFtPw9yXq70YS64AQ3P4jRDhfawDTsQgomuHeAiEA8sSAYCcOicPDrzrG5XvrW0mApF6TWeW85//DFwVrG38="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.24_1592826508450_0.23337781038597494"},"_hasShrinkwrap":false},"4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0","gitHead":"2f70e894e5521da9e6b0dafd6d77b6d206cb5e81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Fb6hlKDzZv8zmHw3dF2Enyzr4CuAmWZzmlfN+HThyb/AUfYlAceQfW4xnN8yJWGd+P42ftwxuI8lexAXOEn5nw==","shasum":"f37e836b2188b79f835d73cb8d40e147289f6559","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0.tgz","fileCount":39,"unpackedSize":178939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JqcCRA9TVsSAnZWagAAcZcP/1Wd3JzIM/71zDUPxSX1\n1L8jOZAnSIGxPiDaliPuLoeNXDgBeTP6X3OwjgtfqxHXKH+kHFYIW0Dk9YF7\ninaH9D0fsgUcn9eqbRbfA1dahlkZGK7Yx6xNAahRkvitoyNij2X3Cl3WoCLs\nUczSgysmJGOqm1lNyWgZJtWAjjF8BH0WqehXDrn+ViGCBvMOLG8A0dnz+24d\n2xP/En0BRVLR1CB4ZUDc4XJ1CusNNhzHwWNNmXlyTRcf7HluMrQsBVl/jGmM\nSVr7uXAOlD5UGguRwG72P/Y7IuLcu0CEhyj7KvrpYgIgQwBOaFxXomXOQHXT\nu4QOFCQbFQo9hw5rS/I+fmo83bFgH3FSNewAC+cWy7HxKYOV/wlbhom9vuZ8\nJRqphAxUkaZp25nKsMWW9awVVz32zK42xSwvIFnxaLPUgYwQDMVNH1peXQQK\nteeUEzWOcu6TiL/ZmWzUVXeIlZQ55NY55/wpLdtW6zxmht6I8K+Yy/frkXFD\n1MlgH+GK+O0ec2Cs6xG50sDoN/g1q2jFhV68jrfGy8RO2nbvsmGdbaPdUs6T\nIKmV8bN5CXrpCCm53ZL9z0xfVjNKppLHq6zjxuNA/EGDXHi9gi7VOaN/+7l/\nqVA7Ww8qGjeB9PcM0WCzIy2lH3lrqDLU8SJ0Nvhtd3W+oPsHmAgY9N2RvmOu\ngnUJ\r\n=F3im\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaB5LEH2BIhY1E1qzkxyLNeWPsGuGqg13+DrZl0kBZ+AiEAlBzvq3M2qG22lW++nbjNLHepKuopPhwWixh+KOL+YDo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0_1592826523408_0.15105906596340413"},"_hasShrinkwrap":false},"4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c0f930b5f3c847f565552081b19cd56b1cc879d5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t1AbMS0mmJf4BFhxLsizsmwGuvnTkeSgz/xSx4XuBc5CHWmrfphZDzps/t1Z1TTqQhCSdAIL3Td3Md1Iz7Uu5A==","shasum":"eb0ae94f9eb24803954800635c8c2f4232ec8d95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0.tgz","fileCount":39,"unpackedSize":179239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8Jq6CRA9TVsSAnZWagAAcREQAIjr8dfFNoRoKMbJIwf+\n4ksHIjT3h7D1p5Ylfdc/OaJLgYoaVhIZHAx+EEnGua5lIpKQgRPqJiS9TaHW\nPPzGiBP29xGgrdmp2KjF66n4Hb1T0rMWUOmEbJvKi7caIJhVZcL7kMQuHHHQ\njolhd15IJWINQ33EVwOn5GHdaR5BxAx9g+7kdJQpvHE9OTslPrWKG3kW7ENP\np7YVxzJYo+aAXrF7+gouZotlP68eVWVDJ1ZiGOMhrOSIrqGCs4JqgIT5UCGs\nO3IMFWKJnLm1kPcybZR7Sq4GkilmAI0FoPkSbvVLPu3w7EqJA5cfNAnoTfA/\nV/OZm+lEKG6XJSauiRcX284K0r+prPwbttbU6bXCojqEvtr8Xqnpgf/pPRFS\n1k+aUrW3N3YzUPAiUU7YcvH0kiTdGcPIpZYrY7+blu+8HDcCwOCLIJSzA/fe\nu0P/iRfIElsZrqzGOOV21mFARjI91C3Ma2mbossg0uhjr0UuCHheQsBkAWsR\ndf/JxxxhmXDO1njZv9cTJoKvGRYduOBh0ACKSBX7ij1mTlA6/zxQfzlhiKwo\neR33cNcJUmAZkk+XVkmD4IzgXCmQ/VOrpqiHstQIMR04Xk21uteMG4chNrVT\nJFIiC4Gi7kY9uB0W3Raburvs15TgTYTtqWVFuLHGE8PQ0SJw1dfSmDq/+DKS\nGnq5\r\n=fOTu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOjJX24UQYUMY8BxzTkZCq6zjzfFhhZHu2XPs8/1AooQIgbp2JhXvmbK8eXQsaxVBIGIECADr2MOpCipN6H5o37ZQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0_1592826553959_0.7577133404928766"},"_hasShrinkwrap":false},"4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^8.3.4","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f3dde32e0ad2b2941fd295627fe6db47be2811e7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-R+vHlLsk3/V/l4eyB65zaxqeYmncWPm3JmpAntzvZ4vHpIH86c88FhNVxJPhnJCdMJltqXNejmwdJ7gVhG1e0Q==","shasum":"36951f239ea53a9c1ca4c6d138bd502f95872180","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0.tgz","fileCount":39,"unpackedSize":178939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8JrFCRA9TVsSAnZWagAAK2AP/Rdr0SM5/4sp52UGMRZH\nmyoox9UwpTl2Z/URh82kwLfHR8tltAg9W8jFcVnSEjhG8NdQ2jD5c/JRGtFb\nfXzlGeuv2Kanq6XqVBJAUPbULQO3rtqsss3ifdzK7AS+mkndpWE061pD/El0\nNQFKB1I5lyoPD38u6SI1eaAQsUnLzBVqQpN3z8i6bSFXplGsbr984NBkWyFZ\nRg8Jo1mAa30/YOcLPijpG6xAmg/RQV5iCplkhikYgjvKDAInQn/rg19wJD6f\nw85LDRJisCH/lYhhdHT24sR1Zj9Cu68CSCn10+iPZaG/0FlyA9NQPyP1zQBs\nw5dNihtAm9JCQDmOWmQQNOrdGERhGPm3ERnOYn4TB8T8/BxAY77Kd12UFQu2\neIXTe/cxrzk4l3irMAB0UL8ccYj6HxgOG1XdlR4DOIBmRNwLufl6CM12JXKj\ntR/nGXsRA95FhosatE00+JR6jnDwQ1aOt5NJM2U7ofpbrJFxYutsTae6eSRX\nee0wFdh5v0ju8VSd82Y7XFTonwKuquMXjst3zTO2s2fNpN3nK6SGILJN/TQr\n4dbDmU985np7KOhV6GaWTWCyqGuU0L7KP6751chqBwcxrGP42A/7PVxNcXWf\ni5kbhaqo6G552DBsnkZj+uRNoOfZ/nxrm3ghxpUXLWMLOCPocNlaOs//K6Sg\nSIyd\r\n=AQZc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw2H/mXJNVIfIKO2jxNDeAo6g8PN99TPziIPOdDzxNsAIgKEQhLudPR5jFwX/7tHnUY6NeqKro/VlyxQmchk/yDoM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0_1592826565132_0.2162909645587503"},"_hasShrinkwrap":false},"4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0","gitHead":"f299192f9a9142ede97de982cc564ce4ef31181e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OXqI6GbQQ49UM4oKhFEObkrMcQ60M6QTmxV+YnxYU+NInFkhZA2ArLB+eAp4/GqiqUtK0iZW7SjVGTCVyqIyoA==","shasum":"353370100307f776df2b9613c25c7c33ba5024ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0.tgz","fileCount":39,"unpackedSize":179239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82UhCRA9TVsSAnZWagAA6xsP/3nKxVdb1wdKFoTDhL7l\ndWFsyNbE0gybyqUXKgYZ4oUmqxe58BoGoNcn8zmPu/EsrrL7h1u8MJw17XCO\nsPEl0ykm/FMcEoIVjILcZyyb813muRrtlDbPMjpGRX6NoELdK+Hzn1V4Xq7a\nkdkLG+T8+i7YS4S1dvh14F1Htp5r9e8MX1x5cyqglpVrR05us4dXYv1GIYGk\nA9YRotkNo6VRNQSMFKsVDKVLYZxW6oOFYK/s7pVR20JunpJVeDpjfXKPdcEc\n3/3c3Xz+SfZo6U1WmwFaBAhLoWDSWRnI6DIv+pKVxVUuaZZkAJ8kk+nVWrl2\nzn5bBQpQVLpLdw2n4cbrWK0utJ0R+DAMEFTwKaZ4rUGkG+FW+pQ9pUfdegwa\nqykbWcpBxdbASN+No+TegQEsvCMg8gb3KIr/Fa1QgpxY5gX9B+hHZLOGEMql\n0twcYkS9J77O1aCFDGZHbM/FSvFtoyUTGpYxECMKjGpo4i2wGFnA1pT1w/HP\nBvAU/TsnCbIY8xb0KF9s9mHopbNzXDd3OFhWiuW2xFWGbc4MSwwBqFisqK/x\nz8bfp6CTfWU6XgWD9K308TqZ3aq7IeKF6HyLAkhJ9xs4wh9Uq41aJgFy86Yh\n/azOxff/XjIKYQxaUOzDQerbsNYCxKV8hc6aiN5x/6l8zJX6f3c0XB2hC4rY\nDbj9\r\n=30Jn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv8L+UvEQjp8WJyisGGoDg58U7M72D1k0QBvByNb3LZwIgaklBN0KTrs0SBuu8lJ0ALj4vZZ6q0NnaVV8EiI5AtMI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0_1593009441130_0.6523555866790101"},"_hasShrinkwrap":false},"4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0d3d946e70ea34e59ccd0069d496253adad043cd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7Hsy8nPeiveVeHD+pLYwB0yzVekskN/UXedlauFrSlgQKST7z9+NcddVvv/sg2e9HbMRMTVDvaVKX+W5Y5DgsQ==","shasum":"fa58332436be930c37624e4f7ffb456a3f8a80d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0.tgz","fileCount":39,"unpackedSize":179239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82WqCRA9TVsSAnZWagAAwH4QAJaSWREGTP8ezB/EkJQn\nUE+QtSFMfLh0IOPWdpXyhEplVrLl7DjQ1bZcltvkgBXfDNHEymDF00Egsr2e\nnCx3R1O4DMo2K6qgCIukcNw6bhiJA4d9LhxBu3RUKARREutjfYj60sXOJbxS\nednrjS2hy/li901JaQz+Rr2FQ+hHb9TIuzPvnsX8y4kSR+J4Vlw543l0wuNr\nNrn5STipLk/6sBYlQ4ql4K7tA5g2iVKGnX4J/b1DwO/alQyPt6jSxhmqkPqs\nk0c/PtYVGOqXUo5mkRXpC3UskTUqH+hp7ZgPBqlJsu8UBVMQgdRV3xLBiJBa\n0ZKPAGdTLWbFSOT1koy8o44YevyLDe33WW+bqJfavhxiFGifpBkQlBh08K4D\nUs1ya8xgdd0PeHoto9D0D84sylig723kmrgQXmJiSprrV3MMPsUjHaCm3S5T\nJtv0IEbXN0VWaz0sAequ/vtm5rkME65okc5rLX5qzlvXqbMY+ZC+yFCkN75F\nQuYeNCmu4IvZwP3NpuSXZDvph0CQceqr/XqXZ5RY5qkT/+R1VTms+kJV9pxC\n/7MX/7K4JGD5tubUg/XEtsS+TV42AunYzDxib93joUfI0swqoWkR+he3vhxG\nm3krcGI54Pw3fPIGcGNSwlhV6s1fcj5PVr8nPGYU6LVmb/je6B3uS/mBlB2R\nlqxw\r\n=q77N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEA538MUhZgHihEfqaX7gdUN0oZDSFPiozH1iNks2ffWAiBsBRtrVgkMT0ZT7ocl6K0uTthLv1NxVbcW3eUSZvrEjA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0_1593009577513_0.21210816858111126"},"_hasShrinkwrap":false},"4.0.25":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.25","gitHead":"be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.25","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YXyYmCT7YW8VZsbmZ5I+g8ard2bdzcscZaYzCUtXfTd9PfCcndj9DUN0vYpxt8WGUqnYzZNyIA4/tdS4GvAEng==","shasum":"c5984989f2c3e4f4cf40759ed488cc9eee7d1b46","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.25.tgz","fileCount":39,"unpackedSize":179480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82XRCRA9TVsSAnZWagAAeeEP/2FeGpk3tB71+244bz9S\nCA8zc3PMXd+uzsausTo4KFIS13kTUukiiaVqsQbkxUWggR1uMEdPENge9r+U\n50/NYot+LpJqzZuzpA8do8bE3v75eDP2Fwg8YyPNu45oY3eoXJWV99dBxJMW\nalzaKH9R4TqVSrIuurP57aDMYUm4SDFM09sZHw7VdFQn7jObCg6xKXnvTFiY\nSjwm+vgv/5dPRUHpbXltAJu8c8ze259eKIp1gu39mzYQXA1a8cLw92m5Sj1P\n+U+OOGN+aWXvY6oHsSbow7vuLmazL4rFct9bJIYoboYcBjvHoX6h1vRTeHIo\nYd+3VMf5KKPiEb0z+76H1gH93/jK4Jm9gxjmy8Exki5qdVcG/GcUKRk4S+t1\nJ4zeP7nrEf3A0UghxJ54fpjJ/pwEI+HO4jTEL46FV+wOV0ti4Pclelooo/r/\nlHQx/td3OGqAwcaFRtfYeXeR1o24ffFsKE9U5lJbmI2w2vvFy+Ocz+23GKuA\nBOdKGzb7Rb01zFwkDP4dzHjXTUScGyESjAFNcXGI0og7j9KMekq0mPypAvTB\nDDHYQvJbcndwtKDGjTgNljX/IKwu6zC4esT+s3hCNZKH2WzfnEF/T9yReKHq\netJWyoyTeBZmWyHE1aY7GPTaL52oBfIHvC5NjpnuJoCuZMhQjzlshqp3gNJ7\npzD8\r\n=5yiQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6WMzAW0ZgDgjebAZ+UcgVqgp6ZK7St2bgQxS0eVUizAiEAtYUPPKTHOD1GT+ifbG5DMyxfH702tFbAG1GzQr264uk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.25_1593009615299_0.4666238720025937"},"_hasShrinkwrap":false},"4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.0","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Nd8uivA0+fpdyDBJdOd2M61BGOrabkkYW+cWS8CrXFIcGX+KFHeqtZuSaJxVQXNLS10uQwfu2ibDRhI9XBuEXg==","shasum":"80b63526da74ea6388dd1cf32fe95656a1d5dca1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0.tgz","fileCount":39,"unpackedSize":179523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82YQCRA9TVsSAnZWagAAWJkP/jFo2BFLTkIxJWd0Ws2+\nAhdmjZe+bHmKZCqH+szd8wjVtVLOMi/2rG7I9TaqfsBIhj9mLkBeqvMzH77f\nv+dy4aaRr3v6cIW+nJTJ6RHD1YU6c4oqCgY9MtsGYRYHZGf6Fb8eb9tR+co5\nKqQ0yoaWjR3py1di/Dcb6rRZ9vuFwPvYBOJEGV9VD/WuHyjmh8NwoapwOcsI\n16qjHjAbBXlsWCfLEkhs1cAfvXe7MmLbt1s7w6j3NG3qFV2sAVuzWeYo2bAV\nPWOAaYSg4VqMd+TgV20cuaWjECHl6VfxkxFTxLYcQ3ErEbxTLhKgtAxGVJz2\nSNF5mSUxfqAlddeb69irNsOQMZXu5AWHtqkB2yzp9Y4h51EEktCqkZn679CJ\nBQCXNcTy93SVqelnEBmz4rV7r0RwnV7MK3BUSNeY8f55OGN/pv904/Pprr5n\nSvcx4mRAjNDgIglO5bdExn59HmhqtEWH86t9GTSiqRMme1EbTTVsm6uttJ7Z\n8zTDIM2J4a0l4qJTybAB9EqcHI8Qgc2+3zsOwR3AkPhrxjL25OX9aRuOl9yf\nQrnJbcmxy6eNWAOHR/+Xb2Gq/Wf7viipFM7lg8tdFe7dAs4fPcEsiC8Vripr\n+wuE8D6NBWEngtOFW+G1zbMxexmXPT1ubkVlUeDMlkHNBqQlxnvV0x4lHuuD\nM1Kb\r\n=CIK6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBemetfSx6jpntm21b/R6RbLSARaPdZMPVzFxbNS+RfAiBICnj/kYONzGz2tmaDIgqF5+WHgRotUSJiTFe9GRCS+Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0_1593009677700_0.5925837158993235"},"_hasShrinkwrap":false},"4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.2","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0","gitHead":"ad313360f57d40ac53b3a0d11adba20f5d86fe05","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5cl0tCJQfz4ftlRUpVq8iJYNMzqdrp7XWZGooxNBJzZefDp6IJfjAc5Twh82//zjZNCZ0PRsEBUlREcNF96Yiw==","shasum":"7b3a7037207cb129599c67d942b29e687a1dc19d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0.tgz","fileCount":39,"unpackedSize":179523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82YqCRA9TVsSAnZWagAARTEP/j6aRXcjyDa8PuEaAdSc\nmiYnG1eUDCW/Gs9I33CeXZObfpOBS5jgD0pDIU+bF9gq5DX+S1fi+sb66uAv\nxs89C/ibmKU4qKjx0aYcChcax7xK/LnpTTtUJFkmtem0fWSzbHngFxV+o0F/\nZSdV9hz1Vo2W/DR8CsD8sFetHV5CU9Qagrz5TqyuDPdWkPVdQruE2BiIfvqS\nYcY09hKyOPYFlXf9zgForIxp7GQPn8lVuZAvwSFXVb8irB0HvpGNYCIvlnyk\n3K6IsHWsPphIB4aFnntwaflaj0SW/jiEXteU0XUwgz1r6b5F7t0J/AI80mIH\n/cAPv7XR8/GGKDUwiyhn7tx6/8ZuAKYFyt4SW8IMstv/A2OIhAgoolbQCWdT\n+mcakPlcb1bsSyCoiITVzId0c/0zBmqjWI2uR524vodoF/pbxpPOGlbK42q8\npdrQWqKUmOCI54D/M9+Q43HhZgZ2JygceCoBNt19nMSr08RC8V9+pYhj17uC\noxKd6ynevk2t4Eiee7BuVH2nkXCMnCGwF56qS/lVdpDvDWcRJwhPI/BWennw\nOBXoAzjFT7qOTpnCOwbBpSC0tDpMnmJLlPrcqO2AQXp4/sGtR1t7nqg65U5e\nQJXwPf9UG4XXdE6a19afIUIt5wlM9enX/R4uLt5gptjWiku+mwmhwAXG75lb\ngSGV\r\n=6I2B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBGajgfG8K0EB7Nx/Kc+Teu7VJjJvFmYKXgi3k8ataT3AiAp5JC5qNra/FbMDwGzO8gjY6mH/uGAJIDRH+suMs3pIA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0_1593009703295_0.3094851132357259"},"_hasShrinkwrap":false},"4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.2","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2a6504706e7735dca90c2a76a9389188120baf62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sIHPzSHzqvxWZf+gx8Y3LLweisr++7u1pMpeq570IQliyuK5Cd/xQurHfB2oHdJhpGl1Y6eSl/yYvWuxG9YvSQ==","shasum":"0f8563cd990e80d465502719b15c3f9a50d4a4a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0.tgz","fileCount":39,"unpackedSize":179523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82Z1CRA9TVsSAnZWagAAD2gP/A11h5Kw831uPnVNYGOG\nN3U6yBWGy3XD/F0CTZ8EXTy/DoqekIxwk4ISnVCingRx5tuLwIu5w8bptPVQ\nbGHcR6UdpXGQ0PA6jUc2s+7jd63IIDE1Lg9kdd9tJJW82+IJtBALc9s0KoM2\nMJF3pHH76fAHSezROG4jEZEqtt2erFKf1dPeQfjDj5uvcydSVOCIKJ+p1tNe\n7qQNWdb/7fNoF7FLU+T7a2/cCXFpTKhdyDUEP6vjNeuzhmud0Mhyo4b210nX\nq9y9JdGimwMkTjI8Iv1HX19l82YPmsoUW83dkJBHZlY0RxOGHGL/PulPLvj5\n/4kX7QoEs0b3IbPttbbWOoWFWbc4O7RiHa1ss80ElKdzbvr13wJZqe0xRC3S\na/Vg+VX2zKrfNDhL+K+t5VeKkZ5o46dLCwG37oaL7w8OJFgyBPpxHMwibS5H\ncZ7w0oRLoX9B97h/TR3hjp2Jk3TiSgGDr6DKyQ6DP8PUAqHnD4NbIWirmOdG\njV2R73gj2PboZlfKM/27BcxSN1f72t5BJJCYAW9DfXB3Qznb5bcM8gfcTTHJ\n6GIdcuccD8VRFcKYRzofbpP8XugzEiCT3LDSxyrQlDcDZPKMMvRsYbmomnNS\nat7SgDwvIZiEaW2DOiJWEYtqucP8Lhz8ihiO9AviY5nnX2GBZZyoNk1Co9N2\nNTfG\r\n=FZeY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFsvB7oUIZ2gDCM3eO1qKBvosFeww1gqZP7Of+sPtdSpAiEAleof2EDhaG4FXOWpxTq7qqmsLnqfnUkvzO13mfgE9NA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0_1593009780258_0.4386035529635419"},"_hasShrinkwrap":false},"4.0.26":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.2","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.26","gitHead":"397c11618f0b94d8e146d19fca96195e0ef786cb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.26","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-j4bFtJMuuTCud7TDCYKhIa7phLGEQzx4sc6aswMRR02RXU5uqGZkdCPJIQvnmfUWEAOaGJ/z3mr/B5ZchL86LQ==","shasum":"00324bb89f33774761127f0260b28be796b21ee2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.26.tgz","fileCount":39,"unpackedSize":179762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82aGCRA9TVsSAnZWagAA2jUP/RvTb0IlMQa8CjsKsQI/\nzKFqgyIAxEZMxtW+JdKQ9cD2zOlO0AoscA0KbP9YlB9gEUSNOOSN/VhRiBho\nE0ycKHLFIxU8S7NUgyIWc6H68MpD6tIzXE0DWAhjKbD5ZbXZDmiNjrTnzuQt\nHO1bl+6hkzsZCIkJ6eyJ0VDi4t9b3Ht5x7RtW+wFsFainIPbVnNag80bP97k\nN1q5/LYb/NyoD6QodJjywvta4o7g5IEy/NPINEWQcDu++seKdDSab7DBEsUr\nx+Cpmvo7mZTRTw+7dWt2aTFdw1pP0JlfYLgiPYRBJyqXMqPgXgCLx0Mj6XiV\nMgFNQ1NMAhCGDrrw06zLpPDjNldjK6aJPDQ/zQbymw3lMH7Ivn8eARGcrhfB\nHUuGD966XmVjlaPOTsX7rSq60AmlOXQLe85UP1BriO5oGnQGWR+EsHpTkuaE\nCiaXmNMjTGiI7fc5wXC0EBAXxi53pOW6NtpR4+U9u6IJyFcx+Jl+w/H6CPRU\niIWJibsUvsLXPorwIB2/9VJqJejTUwlQsn0AtHPXUQPcEBH92Eex0XlGj3Dw\n7DAE0Jw3UWV6jvNaACWWTm6MG20tWhaB25I4ewzokV7nIG4MMEhDI7sELKad\nVlORkPxAk23O/1oUvCfapXikl9wIDiWX1MBmdjzv6Jj0+aaJYRqXLIG38mxi\nVjgW\r\n=0+zE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj0IPLx7ZuwynvvVHBbTSZ2qneZFh898H5pTN27OS+rAIhAJyTbWEvdIvkaZLnpM64P3wXyoJSS/DQMReZKqD2dat6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.26_1593009796929_0.42322185163192017"},"_hasShrinkwrap":false},"4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.2","@types/node":"^14.0.13","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0","gitHead":"79985284141cdca2b3d6ecc42d03de2cab892df8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WreexOglzRz/TAQhGSKS+E7lVWiQHNvvL4UgVqmXxyXJXiFxBIchZnI3IakxGXz8W2JIqwsSG30SD4L55pxRCQ==","shasum":"b80d1563d89bb2938aef4f5879045c11cfa8301d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0.tgz","fileCount":39,"unpackedSize":179239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82ajCRA9TVsSAnZWagAAq+gP/25kDDdkOOsj//UMQh0+\n+s/3IC3xwpEgWoyMto8hy/HKWo/CdyXRsea4LZXvdd8nuv8sERkWM6AZoK3K\n+sq23/C4KrSpRDJrfxdxEMSBKRUR9p9hJItcMSZUd+EHfWO2Ds/y8XLIdj8m\nhmLGC+oy0FxPdzKZ2qQo/k7POzCIwJ6XN27LfrWyAkEoUD6r7Twa/AMQEPq+\n6GgDpfM0ybMOcF38gAWlfk+SP87mYr0Mt38InG96PGqyrFk1ZAPIq38pRetm\nAq4P7IxNkbpNsYd+OR73aR+Am+exvUhNx3M61UzroH3cTl4dsToqqdD96X3N\nYKMSwvJ+60b01Pg2PqtIRAIuitU40DrwAEDJM3H1FwyoR/37GpJP5Jim/pX6\nqYGeBRRSzQmyjCtDiMJb9UydOg1ypIXC+n0H7eNNzfoBBRYj3JMGFAzcNBm9\nHaLWZ6ZpqmJQDA34kR/SJ8vi/G5S9RPC/9tP4IQGZ0xLqWBi9n/PWsl2Xc3Z\nssjXOoYTE073g7o7sojVWXLF1pKleZ9f59DHgdW9EhHsmEAF9BrewHKuOj19\n0r5ckIF5TuE/uKAcTV6H1n4ZIA9skZzCKL9A5e1wieYs6jMAGNkqkFW+D/tp\nFGov6TkZpq01SL/9VDpZFuZBt+SDpr7wAOTxopWoMo8ECq9mMwhaKHLUJOMQ\njv2Y\r\n=8vD4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMqk8xlnc2+6q3VGZXXXOqWv4c10DRqjmQvslOAAOLIQIgYZmcLLbuqSCzlDG2ptLhoUp9Xa3u+srydhAcKEF7/TU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0_1593009826294_0.3282047030759394"},"_hasShrinkwrap":false},"4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.2","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"397c11618f0b94d8e146d19fca96195e0ef786cb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XQJm+BW0ru7iRClUujddPXrc73vESJdahazJ9H5FarAD7LD4FuCpT8z+/poYsRJkiBlBHMkoDE0YxUB8YusfaA==","shasum":"f94079a3259d531f9353c9d2bd00b0b150603c7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0.tgz","fileCount":39,"unpackedSize":179805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe82bHCRA9TVsSAnZWagAAskIP/3PaoK3BHuQkWrJPCZkm\nlwFKoi02SKE0kDooyHzLFxnnEbo9zL8fyshFu5+KQl3vgtABKYXfHNUcW6KZ\nmsJUL8TuSiyhziE2NGciNxa/TRiEzbFlnXfSt+Hl6PJU/UK2NYq17HihdXee\nYhSwpu4va2rnXXhJnVd6EN6f/nxaDIpS12T+3gchYE7PHNVX8At95IpKoguj\nOdGWRK8TTFu5XZVnRr9EOZ7h4c3dIvwH3zYp8aQODQndS747LChNr+ww539C\nGFB44+/uyUhgoJkpg7oeYnaUBoaq0ul7lhaMTj2rcYb10UrG+XE8Tjmjwb3V\nKYXwb25BjBFQsKXkZc0lZrB7EN0yo4cmAHB+31c3EPF8IMcSEeH4iF5EoB0g\nyMz1407bUhMab/COkWGCMnIDU8Md0rWxpGVvEZw8zMknXZh9EXmVwgpOl2Xg\nB83Ir0DZ4BV8o2Iwkt0Z4w7zSo8UJ98uZSFdX2ZX3wM7kq1FxFv12Wmowlm/\nk12WwdR4hhVtZv4YSSgBUImDoXuJ0txQNLH0whoBoSYc/tLCACpHrDhOO9Na\nQesfgr7PXSoqOtEXgYabwmWKs6Rb15sOQaO9FP0lnYTZmgdMk5lSnnBy63rf\n8geM6Dzv3cnvWRiVXVePZJrHgMa1RxvTz2+Yc0k7NH0BcI7ONXdjJIei1KOh\nD9bw\r\n=Zz0a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFqDSuAkWJsB5q9u2qeYPAip7ke/UyEUCLkc5wbmwk1wIgIQw52gulB6bpxZaISy/UOpsxZu4S9xGvXCd7HU7B//A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0_1593009862946_0.6533066860869401"},"_hasShrinkwrap":false},"4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0","gitHead":"063bedc12db7325a9d15d0ac0b3196036e9fef52","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zVL7Udwjc9zxyCwkk6bYxvcCIfme2YrT6q11oU/EapWWkbSPgdCpvuCYmj0bwE8ML3LqYW20JdJmKza2kAN2qQ==","shasum":"fc2ca4a6c67f7e94befc1e90e9b3f0ebac85ba48","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0.tgz","fileCount":39,"unpackedSize":179805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe86M2CRA9TVsSAnZWagAACMwP/3U5DLyxkehZ5OceoOCs\nTDFAY2yIdSxIK/3/WFttHhk8C+C/bdnpbRQadINSJIGCJAyW6pknxl1A95Mh\nbhVGb0WAjisY3SwV2BkzRa4jnUljHiB9u8KiGN/oR2zGpIifxkV6OaxW64VL\nZGw9uh/0dWubRf62/1ZsqC42SJg4UsPkgraAkqy2chf+MU/UYLSEDqfIB2mG\nYNQV3iU1aMjWfq1qLhIuUuTfrrfYiOnqkE+FJMHvFE3hclpcmLNcT8I5KmBL\ng7oTpfOojnD6w4Pqx4ho25kmgAEYNFqsIzoj+80x29Ul6QViwlKl0miM4JPc\nlzlkefDjLiqn9lbtFEe4AUg7iwAFdlEIh/IkjW4KOfgeEhepvlbHI8+3fZnZ\n6gJoAa93G1Nrc+fl2P/5vMK/v+YozBznl+JSb4Htnth2fbQew9ViMrpWBgCy\nNP7lD1tHSE4+kLGvHr1JWYcwpks5Or7zT3uIwB3d8zRJ2sjv840xoErJn6Na\nji7kOy9upfo4Wiyp/kdf+1jIS/dRF/KJ7wiiJaVmGpBkpY1zYjtej8hbMTzm\nZ8/efoOfsvlHJpoHrO7YelfwC4jxRp0A/YTBaDscvUUXdAsvq3woMrwdigW+\nkZYDQT4D2mziehu0lxMez/YM2ZVzpzD30BFcH3v80YbUjbLwMaY2s80lRegr\nGVPO\r\n=wJvq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt6oGI8Z/Z4Tp7+Gpin/dcN+C0Y14lDpfnpVvEFWFGFgIhAL9wB+uusBmz+P0o6vsyDyjDYHMCee7Qkl1v+WEXFpcm"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0_1593025334227_0.08304398642543065"},"_hasShrinkwrap":false},"4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"37452551bb5b2dd20b1c25db980311a69afa6842","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-93rvbya9iO1kBfR4QW2YOStcizyVqrRjqbKQ2f1bHEro70X0VxBJ21GMzTKHCnzfg85y72FV2pF2iiGwS4k6Jw==","shasum":"2a65b724061bf4d516875a83149314e4e6b4d499","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0.tgz","fileCount":39,"unpackedSize":179805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe86OICRA9TVsSAnZWagAAimMQAJJWEbOqkIwoLZbhG76+\nZFHJS6JJnqAcfpqB0Mr/t5jMPY14zYCozNJxLVXc17bV8X9Adza8LQ1P5HLb\n/fQObX0asXoNRtcmtMYHT6vKuznEhTjTdHJiOYiz2Vrnju6r5HpNVU8wNNA+\nccnzAfkd1dv7gqU5AjR7sYHUCesR0UxqJqZ/4XlVkMT1XG47aAAgZAHjFXQi\nbGmsRGxO1fimD2b5QT/bsqX2YJMxqiDPTYvi7gA4be5ikAGQZJ0BjSsZFU9U\nBktqDbxLXUz5Qz6VDoIRw7fdBXrMvxaM7gFQC4iUzwCi0HqSdgnG33Y64EoL\n+as34i02swtN+cxkqMls1FYdueKboQK9Xw8QoolgdwB3gtR6kW2PTt6E1jy+\nusTSpROHLF2IVq0ubqk8zfdS4Xmhip3y8xPSRqE1ngXz72mKagwusb63rjjc\n3pqS3u+y9CLcKXvhFBllv+QRLdtNbvGLkTtNxrgDB/JjYL73j3iFlfbTYrnl\ngAWmX1IjneTlifBCztEf48GmGIR5v6slYcb7atJixuAXys3/TMD0LJF3+eNR\nYcb7prWYVvGr1w0j6+kvk5q/mAn9bgxZVDDYH6Oh4mF6Yb2qg3ldu32sKQp0\nD4wuIv4kxmICdq7wl9W3x1CshRLUaYgtuwwlHsFKf1UzlZJ8ctVksQF0aEhH\n6zBt\r\n=zDKU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCapvAip8hZ7W5QwIYPZyV5xi5m3PUW0zap2z3oXRF1ZwIgccqwYbpbMds/6okhlfQv7olcmEyIFZ9Y55Xm0QlUs2k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0_1593025415748_0.1402741923862374"},"_hasShrinkwrap":false},"4.0.27":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.27","gitHead":"65b55395c3b54ef10a753ed6161b40f5d058df78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.27","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zCDnjqqPCBjoOCdXzxrJ651DrxTHA70KDtlxmwJ+8Tsbu5cHB+RuhR9rQvIL6THwFsgI0UoHW9Phm3p52OcK4A==","shasum":"74f67c274af0f05b679ecdc04936e5000b3214ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.27.tgz","fileCount":39,"unpackedSize":180044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe86RRCRA9TVsSAnZWagAAtaIQAIGvH9A6Cjwmu5nG5Hwn\n66BChZul5ESC90z+W+OmroGLlQLv1LHkGQxacA5y55PEDrtLPRIu3lGIhJLJ\nYIA+B+wNPIjuhhc9gJiHMwhG4oygo1IUbS+psFzCNQsvTNWKtduzJpzJZlRc\nkBlrraV0kWETUtR2zRHJtR5GsQWs+WqOZ1M49TMpbKTs765A7WyQw4sElCgI\nh0xzJzofEZyBZbKvVbIHS/dvml7F+fCOlikPgggzYcybei++45MQBRjNXbqC\nvsI+pkfyuxvE6vYaWWPJb8l+AUipxifitkcp8ysxlBN5MmnOQE/+1EjsKNiF\nWG84FLBf6WjyMRm+mfcrkRaI7FB1MPf37qHwDbmLhfCyyhoKSXYqks26JcHt\nAClZ1cd5PzQ/eUYRFlxNVCwhdB/ZNFSnSqUx6h8SITlYJkk7fcpqt9hSbxSW\nDJrJGwgr7clN+hEaKG6Q6cQPhYymOd1m7dGLJnbE4/Pyt+wUfkEj9xcdGnsy\ngbe3d858q1wnO/MOPSNn2M675xDd2OlWnFep2r6sSXkoulaJMjo12X1J2/nd\nOw3fldRzUtsgV34CR4/aAsGv9C4PBGgQxRXBXYT5FCT4wxla4hl2dKb9SJc2\n6JWADGSC7UgvTEKSmANWfSf7quYFntCFLf2NXknbmR7+V3bFerrGybKsqjhl\nX6sX\r\n=//R9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzg2TZam4fFHFx8jBYu2DD+fzJw3JdFxmBN5QWa2asgAIhAJ5gfh2vD/V9SQQPXW+50w/UwXI82/ZjsARn76KXqbHv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.27_1593025616852_0.8750728396097358"},"_hasShrinkwrap":false},"4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"65b55395c3b54ef10a753ed6161b40f5d058df78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SQWY0vIQ8s85pGTBGyiSB4G06MEsvX4R11H/KrG0Ft0nloVGyfNwk01VVyeAvGCo5BMS5N4rLb/EuDXNIbArvA==","shasum":"8e3caf7d833cc1249eac23f82cb5838b5b6aa8dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0.tgz","fileCount":39,"unpackedSize":180087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe86R7CRA9TVsSAnZWagAAHWoQAKN28HdaEYVn3makAzTf\n5GQfQVcuXCMGKmMOT95w0QF2X+cHpxYUYd6FFF65b8qZ+5n93/QNIcgLUeEf\nGykrnTuQ3stXng+lzAaBxqAo68n+lSbz37qX1jyvmJ7pBKMT5aIbMyY3RC89\n1c1RNYRJjIcEk7B7G8uFl6dbM8JfIitx8NNrzuYtelKZS7UX4N8/Roo51yTl\nVS0+ytfCkAyxTQE4rUqmu3npcIXP8Xvq3BH3hUjmMeUGXrCMY/HVg9FKPEP7\nEarqz8Gtvo2QKibeA+ze4DOlcGIKdKcZxsIRYPPqjGns/BA0lCoFv4C1rF/2\n/T/AoKgHMlPpe7d0ffrNQER+/MdzyHJO1rUsc9Q/B90/hIK6b4nafsumw386\nM2W/XFGwZm3xA6AqpDl8dPRw3F6NC5Jx0xWfQnc5TGvSCJIxmISMMlShq2dJ\ndxtDuTp43wHsGBbPKRa55Br62TbNS+32yLymJJacXhsy4TgbX1y0FVo4jDFv\npctP/EOUo+yLC2kS+g4teBS858goELWB9G5uoZqrm9PbvurbsDqIuWBqT8P/\n2GCKWS+72NcpzUUuNS6ecQ/Cia+sVJy/x6dreGzR+WwYE+nSvX9tFFhJyQW9\niZYes29Uebmytz2NOU1uzXZOiZuTeslxUO815yVD7dL7E13RQoTzhZuZUbYJ\nIRAe\r\n=Uo/L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICu9ABhNwpYiBgTmDyEcGK6g7MuIV5i9k/yl/aVUVNMzAiEAj4ALXOS5vbRFYM7uFkGxN8BolEC2PQJ/Nx0GFVgomiw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0_1593025658784_0.9672418175759161"},"_hasShrinkwrap":false},"4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0","gitHead":"d447d272e580690e7e2196d6b9117d3c4c8bba6e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-po7a3lgo+dMha5mB/E2Hd6vTlL5d+SEss8zSaOD6TcjkV0U0klgzCUK1CELdcITF70c8eIz0G/FAe6k+6tFZZA==","shasum":"55e89b288d2bfd51da182f5ec6675761ecbbecdf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0.tgz","fileCount":39,"unpackedSize":180481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9K/zCRA9TVsSAnZWagAAKsMP/3XnkzF5+WSc4lO9O5r1\nNFGER+oPl+/2WAap3LFMxKJisk+UwgEemIh9g6pAb37E4kAW+yV6Ekxd6g7u\n5P+mueJO5ueNwP5WPfMjK8y/fVCG0nKQHm6/QsZeBTY5N8m/GuaYyMsucXdW\nlmDsB2DWTQn4NFDPsk8sYdBYZZX5R9dzK+fGG75SR4EIy7iQTnNerToEW7OY\nEAer1PJ8ZfIIlxYeMurcoK1xLpliFlNk34Z1TXxQQKvWQ48cK5/bRf4Qw8m/\n47Le8i5XVHLFyDX6kYGlRT+H594qojYXfgLZtg2IpVeeKp4Lp+W0p1aG+qmB\nl8dyOlpQsTTut5zpZXSr+/MSUdqMagAh7heAHP8m9aXVvboiAKfmWdEEa8Y8\nxln//gMlHlZObGfx+KyBPzt2WP0CD6a5zDbgR7X5PvaupHh/aBxKpCg0a02D\n/f5sDeY6aFbwlfO/FY7zA+LgZnN5DCXR/m1UlqxWDIe6ob/X0Oc5l6zldILA\nKzd1Xp0N4XaQztMdkb4mydjpb4Y4ALeDZ1jnFpSKsBx+NniP4L2bWnOdIqGX\n+DYlkTDvdHS2jkIt+FP9OyqnWUuSbeNpOAD6r1Hwg42R+VQdn37BtITKkqMg\nKWXYRk5NS+hwypUf92xMOOiI9CT1pTDR1MAzZbNkHEHQHZC2eT2xEuLDVado\nOubt\r\n=it2d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICdoS/tdKlP7YP86RzNxOP4A6oWeOfLwto9iE73DiesxAiEAr297WZqWasRyoka2P6GrQQ9N/1GVMAwTDtpdXhnHAI4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0_1593094130528_0.2059425578533456"},"_hasShrinkwrap":false},"4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0","gitHead":"fab1f622267e3fc47f00223a76c079a052b64657","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IP13w/2DFFomteWxJQceg01nPkoH2/VRhLGl1TY+sDqfgwCD4Q9b2th+EaLLDSv+ta7KRc/TmQ7O/Ws2+aYWJw==","shasum":"b36abf4881a4aa7a83aef906571c7151170e3032","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0.tgz","fileCount":39,"unpackedSize":181007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9LdzCRA9TVsSAnZWagAAskcP/0cRWS9n1vPgotgmiQGv\nX2TTQtnncdn4yyLAWteCnVxwkqz4+HK+uzIlyd8HfMsh16w9XPVj3K802Wny\nzbl14CDwj3tNlPs7gbtzgehRMQHGQM5Kcue0XBtRQo61AqLOcgTQYcq7S2qx\nRAi5DWMaPbHuWczUrufYYmi4faAVtIXNhor0bkFQg0ZvBbMy4Oe9dzzbhwSk\n0pXqdt7NhNBeHWIB/Vdtf/GZjFtBZViIVU8nfmt3KzCBYS2gs42nsnBLFfnJ\nHS4jFPFc4yd55C9J9lcee+ekK/ara/Pwy2EL1svqAEXLUhPVVqZpWvu2e5Ry\nDOI1oAVEKsBZbxzG4qu8wj7m8zJ9oKjdz3UPrkWmzuzKs6bWR7Qd6Jvw6Z+1\nuz5ASpnvvpfcNEilrrsQB/PP0qHvdUaHulQdJ04vKFsoANmVdm72YL1lKaXr\nnWKbqRRjypM08ibCKF/ScDbS43jZdt2Q5XpNn3JrzWr8FYfmI9zQofIUjNgt\n+9CRnXV0Rb8GnqRq4OUbyCBftYLwPnZD3FoenB4dNG8U9e0tr/dfWSg5IJdk\nasKizsLNy2HsYzr5VAb9fcACijBBVgImYlwLXX+NykaFXMWVeGmY4go9/rmp\nNNmgZzVD/+LxoTnSNCwC4DS7ZkmSP1JekaS6XzVrtrplA9oyk1DxvAzA4QpQ\nA/V2\r\n=TN+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArg8RYFH3DDGyAKHWAbG172+IhyBbbqt8WGQkgYGGNqAiBz4s99c8ISVuoQTACvAETmmxXprZbyG3Zx4WvUlg9Yog=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0_1593096050950_0.7535573277276995"},"_hasShrinkwrap":false},"4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bc630e0f0877d4c668c8023efd7f00217e82be87","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gEdROh0EtEzfqk8b/dbrEjQo+v3eYd+ukQgKb4xpLk6EQXhk11yHI7tN8YdwOILMsdVKVMIvF98vO1HZRk7rKg==","shasum":"2113f2e1424fc54802ad289322a3fdb5bee7c5c8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0.tgz","fileCount":39,"unpackedSize":181007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9ahaCRA9TVsSAnZWagAAMpAQAJWamz/oj8xKw5M+sHvM\n5jWu5Obn3fHIuzU7fz12lv9305OZSRCheX5lKeipKECTAH4oQwU4xv+8ullk\nbT0obPf4rmnOXKjsXrMuX0XdMel3mvSnW3ztSDkiKZ53cIsT3MXZ1KM4VRDb\nzvnuXOsZa8pnAfXuAIN63CjKGEMUFhdo22pNgExw6Hrc4HsVSAK+QE6LGM3B\nCrTPQSp8l8Dl+381K9/xJ9B8rAxlazVbXIUqmLnXFY2yWCh/52dkoVecfNd8\nSC5a0OMkRAmoAd+IVET5ojxM7SO27oSOdtvPn0gnjqD7OU/d3ffj2PV7aFwX\nRDu8nZf+TdywEUsDuK/J3+kZQYMJ7PwnFPGzUOZP4Z+lnFAehKOVO32SlKq3\nAQj8KL7q+9KYMj4w1qOalJdPQN43ELeA6rnEaypQm0Rup0/1APjx2IJOp17h\ngS8eOU5iuZSSr8xSUQlt6YEzN0LmbVcd2XjUgYpsPnS8cqahHTKdbKcQh9FG\nDHYERzU4pQtMrVq9GDRqRxkw+OLjy06sIz2U2xW585T/MW4CGnLgWW6A+ma2\n+nI/juwM/lx/95Zr3r42NnoxBfgQIMCVgpEn+k3eR6fc88bQQaKUfFctZYRX\nP4hjNvpnYSwntsl6et5at7jZ9NDqbfWuDq2Kd+scR5TNAxtVEMJqPwFSOKfx\nufg4\r\n=Jkzl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiVxOTV8GlZBuUdcfKJJ1bNeZnceLsVLiUH0p1DgfofwIhAPpwD3efUKHaUkCzRAcmLPpUsO+iqewDvdNpaw+1Ik1p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0_1593157722089_0.8070713318383751"},"_hasShrinkwrap":false},"4.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.0","gitHead":"15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZTQlOOiZJf71Qvdl+m1O2K8zDTj89cRLMc6AwP9wcO/ZR8kCn2Emxa97EEUms+wapH9qVoVW6Br7KDIlgDqdKw==","shasum":"a77807dd36da6198bf1a845d79e34729c70c056c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.0.tgz","fileCount":39,"unpackedSize":181226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9ahyCRA9TVsSAnZWagAALlQP/R+nO0pIHAMWRp63YCCK\n6TEa2+Wn6J7S3lz8F+Mp+gofBTLnXC2PttmxFqkeaV3hKqggSvClVAzHr4jk\nJfAleG0oBF/QlZPWUCUqvG7lHHCdv2rD8z/A0pte6MGkmZpTgQOkdqvWHr/x\ngVeb2pRCkNHwQHd4s8SgPPMeQ7Yl5+T/GD5QA9KuhK21rKI/hVG73Z4LQMqr\n7pjhasdNJaA3rUR22GPncnjYQ3dVxLCnA50rXcBiNWmlMxcljwWMFWmSoOzy\nMTaX5lPsL9Kz5h2v9ljYsCAPMkUWaDkXZTLcLV1YjAE3NiAo2+PXD9Hav+d4\ngqMmXnUR07F1/LhSQWdz0vCvPKESwJFpySmqP6gulBbsxZyKZoxJwTW14WHk\naCi8Q9O466lA7xDqP6EhpYVfrhQ/Hzr6TVIIf4XhSabI4bjiB6phuDdEEsBB\nW05nUCQvjcvNpgPz4mRXSKxDVnTvx6rWg6AYTeBc+gXqGqy9emc7FPzzYz/9\n7UwthhFeIWD/07HKF/YQv8IFgjWLS+r9OROpw3Gu7Y6/LxsZ/bzMC9OOUouY\njNW7KW10i38dOsiKsA95QELgcwlEMDRIYZRW31V6phdSWFUFGd3tJsCBTRb7\nKm3fRve5a2Sf9cRMDww/2oYU/ZTebIbJslvOTHNss4wiUPAo2TdQjM1x8ruk\nptZP\r\n=NiBD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/FMHCihVHzN+JT+3Wh/tRMDYujRNqcGx0ud97z/ImdQIgNTipdZ7g5VwQdDIs4YKAOFqXaZy5NEUbAUNjxEc/joE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.0_1593157745768_0.025789123395946634"},"_hasShrinkwrap":false},"4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nJp92J++IZJquaR46vjV1daFBEIN5C8UPgUoNBAveOYp8klKv3jVdjZKFMCfXCIU7I+R0EVQS2+3y9xgECrB4g==","shasum":"c3ae6bc9c9c029b234cf6a35f4b8df2328345e45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0.tgz","fileCount":39,"unpackedSize":181269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9aiOCRA9TVsSAnZWagAAZlgP/ROKcNpXu/p/CCVriLM5\npI1nmt3XHktQS2bT8aH/PSw0D8xSivuV99b8GADvlFqEGWMWYOIR6MPLinGC\nCVR/z57KpBjQ/Eh0c5MYxw+HoPAB9cCALlzzcm0/ooGg21HB76omAjHX/fct\npXVQFm7/EhGgWxhpiqIwv4uwwMmjfXveZs0AixqVUzlLZMTbjuX/Cpqh1EdP\nSVNUYGy03IIFkazZw5oXWS/bl9no/LwQqZPZijyNcrVdxEk208gUE77W4z0s\nR+8xp3nacsW2c+Iz+TOQR2JJ1hUXe6CLTpF0rsvwVLCPmzzqSWL0zgoL8AGf\n/2Zf5keLGESnqWORBlTDC9BAZ+TgRXNqE0jTo+H7rX2r7SxlBcoSNqlm83IN\nN3OJY9t7cns4FebKcijKsuo6VUtTRdH/xFLGnvYztLXzqGy05yF6t5z64KlJ\nySp2zofFXoIMS/R0d6zkhRxC0qBkO3jzkIt+Bdoa5zVUKaP7Ehth0WLSP5LC\nLJENBSfr8DKnWpHLj2ubTDHeG3G5w0yk9hay1xASHACFEeFzf1kQcWGdwnOy\npi+IWzwklo+g/hY0foK1A8UlfrYCw3/m4SV3XtoQLBGAgPXfDeUa9Oqe+Ya7\nlMbETJvw+LtYmN4F1mUbsAmFSerotWK0ly5De7YyOgFkr7NMjY8UnNqCB014\nsSNX\r\n=odYU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlqXx3e6msiSUmGVTYairOdC8uiSizHGwncvJDgUW8+AiB/aONZMN8M2sFG+5oskHYDWBnMXi76VbyCwxfrznm7qQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0_1593157773863_0.8758304352066737"},"_hasShrinkwrap":false},"4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0","gitHead":"920b584ab16b2ae230a3c761fb852cab624bb4ad","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-eB1vijcad/Ter4pp2LswJolPwGLBuvSsKeYTCNmFGjVLVMDBr64Zf4FP2GbMykLKkQ5BOsGL+ETz1JpnXZdh4A==","shasum":"1672c44af9bc4547a5536f48441170030ba2ac7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0.tgz","fileCount":39,"unpackedSize":180349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9aovCRA9TVsSAnZWagAAe78QAJzm752HFiycSvzEE1xC\nk4O3QdUQCkKQL+Sbbl3xEj0LE0YdykrKXRVvx27ZdCrPNVTYzNokv5qUDEwv\nfETNZXa8fp9TmHsfKqg56qbpQoO3hxCv/udI7Nv7G0FgTyKBO4O1R+Qq//Gm\nQrsC89x+x+IS3uXrLDbe1pABLyeeU+3CGp1MuN2W5vQcu5v8T0JAd+DH0h0U\nTNIaYmuxyhts44/iQ7iLy8R+GCxGvQPnOn+tmXZTX+waogCQREHB89BjpV1j\n7LPQTDj3L5n8Cu3i3H9CdgNWAz0t59MUJU8BISZIBrVleMRzz9y8/U1XR+em\nysd3xgY6DLpdPaOV2rFaQWLTlhnhEJAyb4enBUyO45ZtMO4+35odNDASsUkQ\nUoh6ChJIrOump6FpkQjmJuloLNiAK+Eiu1qyZTxgA1CWcvzeAH9E2vyJJ20B\nT1rVKqC78CnLx935ou2eMq89/E3CAchSMJ0WAU0ab2OnmDLxm2+e/xRrvZi5\n4mictpAgdwqabsAAUV+zg6U+Xx7ZvALYVMvRijMnrhIBbe88yJJ8YkXpxUDU\nk5jKOvfVMc1lBlnz/AbrTg8kiIr5JtPQAoah/3CRUw1cRDJB95gvGkwdoM8/\n0c8MT/8l8kzCpW6zVhV4/ZO8BfDPPunp6eFv1wnGc2SfhOrPsDJTtxjDwlj8\nmvo0\r\n=jUSV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4tiwiCbLdVe8KmaGn/e79A8lXtdSYhP0DPYCTflp1MAiBvwVLt6WKtZAh3SzWmi/Gm/hHG4kahqmPiS1XFnQyA3w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0_1593158190575_0.01574209903284496"},"_hasShrinkwrap":false},"4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d4e917e1de20f67fcd3ad211295144bd00dff84a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iG9V8JRAhgf2tsHqT0NgQwn8bM7LyHlKbBbYm4GAMggm9jqJoamGJ2NpZ6mzeVjpXRqWoMUObsErVTin0eCV4g==","shasum":"ab9d0a6b1f30561c50ce6b7c5fe134699222f6a9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0.tgz","fileCount":39,"unpackedSize":180349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9ariCRA9TVsSAnZWagAAnbgP/jyDFj+vPYx00U1uhm/0\ncskIQwNfWSsvsR0xjKrsyOVF7DlXsqyHuutR/5yW0it8ytPeNUGNtN/Rc3+t\nECpJSFoS8p2iGRWMlZ7UbyN/+4/8S0WOmcYg30eD8zY2P5+gz3pHlG1NbIcC\nLQM3mm8rDl6KbuSZWZEtJ3Rn9p94sgffKAQCSiDKoUrfcrwIz/0rCvHPAKVX\nOWh3XXEPjdyxVNe6uoEHpGQihebsCuZ/shSkZQRtCF1NkTrPMAtQJQp70qlw\nAdlnT5/4ryKnr5YtwE3324j4zlrpHZHVJoGWiDVbGv1bI6XDFRJeJHyQZ/wm\n4jPcVLcfQBIAwdgahxlEm46YCIKDCHoVooj/xz3xclOfTziQ2krw5Q3scnUm\nd7LykvixluiS6HCWARmdLyvdM0NnU6fXsyD3PYrQWstrEYusL9MPS+DmHtER\nba1KhCMvZM9HB8jg6tkbVihMeBFXYIy8JCosuYK9TDbJL3H3ScUBrtx/+HMz\nQAnOHyZm7gP0yU0zti0Beml+DbBczn900/42RxB4VaBHkGTHAKLL4KCDUg3O\nkPpiBv+I9dzT9g83vLne/j/tK5K5ziOzXPsux4GHsoicpBprQbL4p0tioDKZ\nGz4AFYSMg4VJ3GMWueWnNuc6fwl6Li1Grn2CfwfW9kGy2spSwa5FXgv/4KXY\nT/fg\r\n=39Rt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqmHtasmfwbmLqZgqCEt1j+nw9QKW0Pp7g+PFJiakUlAiB5omARtRvEtIyurn4DwihKLXICYQmhy8Ea/NNmkdLtrQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0_1593158369859_0.5484634252434526"},"_hasShrinkwrap":false},"4.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.1","gitHead":"03dcbd19afedba9bde318cb3dd538deab94fbb27","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.1","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MePP8bF9M3mlsZvMb4wlTzboKJusKcmOiQu6ImZirLtEDOy2eHCM9kyEcrUHNIlWbAmD/RGcBanlfAOz0bFyoA==","shasum":"b2025556d45748fc06a49531a770c7a028cdf505","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.1.tgz","fileCount":39,"unpackedSize":180574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9arsCRA9TVsSAnZWagAAzR0P/RdVGTwXrT0PQUujMfdO\ndfAadZ5sPmX11no9Jggypf2DKp/YehO+L50yfVMx9l6H5k49QFUg3Qj9cdOH\nQ175LYMzEynMh6Fu9VMkESOQeysjQ+EZhlWovWJPSwG0hRJiIS/NsDT2gb1w\nlp5jqDLsvWb0pQCIuBp/PMLIOrGvXZxgslmHCK+aR7DWLAdrNOByqTP8hzT/\njSKYLb7uMIAUhbMuY26pvn0W0SjDxRSwlx9DCadx2Xeb/n9ZWvG/FptYYSTZ\npqzD6rnlLHQl3Gg0tKpYIYb21XNRCNupzacTBx9/6Q9ZlvOTE08V0ylImZuH\n8KZzWaVsHhX2FgVau6pMtK4fncEUbyhWB040TvINsuQyW8VxWdoUAKPNmxNa\nqGEV4TO4In8GNtud7tIhOg7roGBroVC0c2QubTKvnTogWFhWVIefg7JTMmBH\nY18Eq+SQXKMe160mEMcKpEBuCAU5nnh/W/zDCSClttafQiHp8QcUThcbHkwc\nJ7xuCfmdSasuE4C42nkEX1fgDve0B/yr0RAsnw36S0dv/ic/C6kWldseXMPh\nibGW/3MarH1n7asP5rcPnEBLrOvnlmht7E4nrKTo6rNiiHvYiYOp8+bwK2hX\nixesPG8rJdEJ6z0AUWNDUZHSjOUjHXEcqAOtB3afBUBsuW6rEx4cOwfxz8mB\nKmyb\r\n=/btc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSkiJ+Mh4EHZlvSbdTYgHjp+Buv3l+BRwZxFUDIFBfYgIgd989DOcq3+dLxDUmRPtBLXoC9H0Lowkx/S449R7WjYE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.1_1593158380136_0.6857355618865104"},"_hasShrinkwrap":false},"4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^3.8.6","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^25.5.4","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^25.5.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^3.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"03dcbd19afedba9bde318cb3dd538deab94fbb27","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ewx6fRnwt6STrhpHPumAAUSf5wCUPAIB0W9HzL8DJTBLOuOLjmqtfpQQ83KEjJQw37UEV2zY+C85RXL77HKZBA==","shasum":"4f011a972d1c0c29dd650323d0997dde72b29a9f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0.tgz","fileCount":39,"unpackedSize":180617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9asSCRA9TVsSAnZWagAAO3sP/3iuXRnagSpCkNsYJ6t7\nKBQ/J8hA0Uzg9WOZPVA5gkNJ+EFjv59UZZfS/JA5fv1vQtKLBweDopEChDMK\nB0yu6Yk1PQlmn2JAB9YxqhFjz2iKCjF9iD0jpnTFqITJKBU1ACPfrGBvPZ5P\nCIm3X2du4YvTUo43NVxS9C08a5OhC7tHtmLotrhqDoEQVUSsbDeAYZJpvT5W\nx8xxLnmaodYIG1ZbjJyPfSpdf/2WzBcybpBM3T0b8fDXLIedgbo97+y0ztcC\n8f1n2ma/Ud4F2kU2bZpH6KdRs+9F1CoJDGgXVkRwdLAHi6b+MQmOE8wtTaU0\n93v6N6m3+fN+iye3LYcrWy2FQM/WTIU1WqUWUW62umx6BN3KRZwGqfzs3Oqu\nfwgUwBg7biH13r7R9CaVPJoZ9wv0Z86vyBIIg2lDQPm0AMx2QBf5N2u0HT1m\nClZsDL27nPz6arhhGWXS/6cV+bYD2j7CQ1+7DWthrTSgQ845f815/62UPeJb\nOws6oR7sfNk9/8p21jOson1k2ekGarmNxAexBiHkySppQiWNDyQO9ajbTWF5\nzsSa4x+DkZMXLa122/NdgrzWZYyl5amVBqz+UFDu419LmomAfFshylm+tLfn\nN8vsBmbgFJuGiNLKwDIti2f2rWNyYqcwntAd5xU8Kkauub0Y4o+tUpE0/Kca\nA5hf\r\n=SrKN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpiaChYmwXGsobcUBYGWdMEGZWJp+28NweVjpzyp9uOAiBsF7hNp0b9fzTi6eMRLt02qFiwZkYwidQCWccUNUX9MQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0_1593158417716_0.5411443486042635"},"_hasShrinkwrap":false},"4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0","gitHead":"fa546679c415679c155e1c0cc5df185b9f23dc80","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aLd7jZ2TzxqEOJGBobANP9ygMeVRenakimCUoo/dO30ZWJNA+g05u/f0IOVM4fVGEjJPskfNCdIxUED9Y4KAew==","shasum":"dd07c38285ea5b94042f364f271199e98708da77","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0.tgz","fileCount":39,"unpackedSize":181537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9asmCRA9TVsSAnZWagAAAHcQAJEBQML70+o1zh1MB9Nk\nlGW/Io5UeOiTyQ6FLWi+DNL4GKe8HnlOiawSYfu5KeGEpf/iz0n9x4Ki/Uys\nTn0/Q79s15qbnJ0drNHRW5Wz6MlZOsPjlf3F2iqhJRbnN0EhTtNUBiDgdFV4\nd5Du4pCptmxj553Xjr8QWkU95BXJvRWZAdEO4/fja8uVM82jnb1REpPC9dGE\nSg8pTQlooWXMloiWSzCwCrbz/IWgJmKqf+MqBzntG4VvJ2YqYjM9WWU9LXgp\nHV52V5PvOS005vsmPzqG+wTnWl3PaKeFHPl2a0/sRIHl/E+fg9hToG9mlYtC\nB3iUWNRU5ydjNkXul5HVyqZrDuU2AuKClntBkws25ObGWB3goM/uibmnP4kv\nNWjC+Oc+denVtBTSyKE8QD1kCI+4pUiREXHRdXxUJRcFW3ZPpQY2Qa2izLz2\nNTw44aSYwLtm8GT+Jv+PmE4lWvDTNqfI+pPY7C8eQ4UUHWdNAejIP9HzxBRm\np8FDEV7sONtFmS5P8Q1eBjEIJyTBtpkX/XuhfH9DUgWiSAPcFR3X0Fc63LOD\n4Jm5HC8Y3xUSo7m0lrOamCpUm3AtDyHepDxmIuRPtslaStjZA1N0NNsp7puG\nwKtJ52Gr2EHwrk6DKrnzTVzXrEhYsfwx8337VF2cL/7NNN6O5WjdshJh+tL/\nGbx+\r\n=tWy1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQjAN+lXUXYbsFh3d2D8vDc5ucn67JBE7Ogf4O4piISQIgN8k/j3MzzxAvJ5bWXIG4b+CuCuv3mgK5VSIsoDIg+24="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0_1593158437924_0.4670656620145295"},"_hasShrinkwrap":false},"4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0","gitHead":"a4d2ad92ff4e79734439b5e987a18563db7e4788","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Zsi124GYJRHN5th2rSj37PLtmhJ7Af+hetFLR+swUhe4hzQndgt3jkgyqf/ZbI0YR5LRa7hn6bjA2qE7OBJHZg==","shasum":"7d8d37411666d59ee75bd383efbe42359a0ac19b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0.tgz","fileCount":39,"unpackedSize":181537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9asuCRA9TVsSAnZWagAA4P8P+weVaXH+BA+xgxzqUTB7\nHpAJVrIXXShftGcga/6N81hr0s94B6TwfLvknhx3SJdmr2xuLgzfGUFt5Z/w\nWenujmRCqwl03r0CEW3+AnIZ7o2H608ThxyZk3pFRJEqqAwMJ/5wqmyeVvCr\nrXd2wHO2AZJ137LRjDVhLq98BFpqQOqyPdIzKE0o2LkSk39CxIbhc3FVK+Kh\nqi7+y7ziIn7ptMmRJWJnPRbAX3oeRUp5rHZpPGNfIxLGrnrHIuqTUulMdm58\nY84PwNWxkQ+Gat4hj46VoshPGJAGrXYF3LlRWpyv84QGCLUBhmUVAK94om8z\n76Qp+oZMKiCyo91UWGeC3POugPs7/ygH97OK5BkXNqHnoK2vBqF/329UR5RX\nm9qKcuHhaQDosriCse3V9TC2bnzWNbvAvdFeHIn3dJclDbuzL/te5ycH7Xoi\nOVQNbQpgMo39ulLTXLnseXNsAbG5hXinmM+DeS3gpneQdIZFwal7CinFWvOL\nL56/CZVCrTTlXcEwWBPqGRlxapHA3FJCFuniiaP2HHeJQ+BMWtpH9uC0omgM\nB/rSE5/TsuIzaSg75lnCt0GqIItrw/2dCSVuENvakkx4EmyhJzfzkUaTTAQ1\nBcZI5sr1S83Bl17Gh/c/u4UcIqfsDE7vhHd51mzfxW8Bl9gN1VU9moHczG0j\nmAog\r\n=BzXh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDl4Pep5G2d0H11wx7nr7Nn3MWH5OJVTmC1HiUMtVi7UwIhAPliBuP879JgfClyrnDlm+U3C/cSeADCTprf+dbUZddY"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0_1593158445602_0.20317282402762982"},"_hasShrinkwrap":false},"4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"48f863a1a699121f21e17e8d82b68b4f3cc150d2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HwnB+CShA8M7i9X1tPuNA/TBWp4Zmi27fOmdvPt2p0jAEw9DQUF0NXHNnxPIf2OCS8RsJ+TeRBjuzBjaRwRccw==","shasum":"38d7d97810d73a8d9075bee063a1b0de6f59bb6b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0.tgz","fileCount":39,"unpackedSize":181537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9avLCRA9TVsSAnZWagAA/p0P/RdN63fmsqRKRdniNGsS\n9c7qsT0atuNDzhMWoJYJrlV7xeTp0ORbHVQt6S/nZKYSAhL20VeqzOysjs46\nQsdYEtUVdhaoXngl/QZRu8jqOJzilYnntwDornqlrZi2WGMKiYrX20iPl80q\nv5UzHYPtM+KRbCJBC7wENjPLy6fFDWzoXI5o1Lf+oWGPnQGuTaTM6SIGeoVr\ns62VxIZnUpIFiaQ+kOqY0WuvKhcmh4ccOQR/DWDq2aBUwl1cfJGlySa65xQk\nBX4VPav4fm72zgkFUL9/2igxED5BeoOvSsTDVLf2ZNJ0kpg+GzG/u6Ln1ev5\n2j+AGBooEWRxwXewpookitvgEqzwhQXTro5+sfvgSgmSB6kRuWotIVAbDAEK\ng6gJCQ7rP7un/yt+RXTUoPoGczgyML5YdtgpvMIZlwb+Y43vK77XP5qVx+0/\nN/1IUy0R+hCJzc0YkjXf52RQDdLzT325vHa0VXg6H+KCWxyDZxfjgbEwTKfU\n8IwlOmG+5WBeyqSJO001rzTTND5pUcr3pjCbgnkCY48F1eKkNmHaaQwyXlg5\nyv/JGCoeKHOoRQd9iY0mJhvtG5vr41pIZmn8/gsNyNl8v9qbp8MEDb5Un05F\n2WmX+igSXrZcV2ePJbP9i0O3vBrRUZXu2bqgHabjzbgP4L/ozZuBnhXd9Pt7\nuq6c\r\n=hQpq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0dApVerDCt3UuFQ9zia6tEQHWf/roLyZAqdUwNIViqwIgd3eH3hK+R78HBeuxlH+dQ/Z71MZkNX8AoLbpRKC7hsU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0_1593158603475_0.06467288759443535"},"_hasShrinkwrap":false},"5.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.0","gitHead":"6f8bd16677f36693c4051380f9ea06fd273d2fc9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qAifEHrB3zmiJiElN+8biboIwU1x0JEiX+QakLLo/oq9XwrUyYD2msrsGOKwYZ9XwJGgHsxG5zmMiOWHlE6qmA==","shasum":"5ca2e277e601b7b17c317aa0946344ca962c6280","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.0.tgz","fileCount":39,"unpackedSize":181888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9avdCRA9TVsSAnZWagAAg54QAJ466jk2u+y3dDyPe0d3\n0+czgIHZ4hAR+loRsvhXFYhDuTLnbVGy+7ggYiBJgb+cXtWo8Rz0CK++1rQW\naetAxbcjZ/tdw+KazZ1AVfFKj8t3M/J041+hREQ/bkCm2A7MQg4MoeGJCwOT\nDfYpoJvQFuqwpyhnArIH539PST7izCFPNgvlIAwKiy8LJzT6nKN8SmcY+78W\ne1BVgQwhQ79MIcxSG9tHKtHeb+TM4FF7B/aFK5aFJwSV0z1Sabujex3FimXd\nUmy8oyNKzRmp2LPACsrl3bpHGrVuqtCTUUyQmoJ7WLpRwFDwJHy5/A4mVFX1\nG2b8iByM+1t+t6kl4UCqsOaX/LithNVR22c49r6vSKeVfNvFGyWNYN4Byi7K\nfRZbY8iTWTUkhOvjVqOP7wmdr86WCZjAkcBY9a17aJQBS686iL+kL68St45U\n1zBlag1A4LH49qPt2KVcvLeVaxtPJT3IxcPSjRJ1rnCoqkzymUxfdiLTMfs/\nBJ3qYYrNIzA2eIANi5P/vq6Igf4HpzoYheCi+OCGzAIQAPP4emvc5uxzG9r7\nAPy2/NIoDGFFicb1C/akWTddKOMLK0ANULeYoEu2WDg3orYE/vJmpBzETK7Y\n8RgA5iloeOCz9w7WiWDm7jDAcSegq9XsXjPdJYdHo+e8ucGmEfV852Q9PG2T\nLYf2\r\n=tWRk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDO1BG+YqY7f7RbEfADR/1z9NfIk7lkiXmQufcWZvW2wIhAMq2qwKaFRy2GZb1VbGNdPO3+mQedcTuSRdyo04K/jnr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.0_1593158621277_0.7922573855792208"},"_hasShrinkwrap":false},"5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^12.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6f8bd16677f36693c4051380f9ea06fd273d2fc9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-I4k4oPaFLr8Pl66amDRs5ib8mpTDqiOxg65Z1tJZgbqBNZheaF4XN1Sl++d/MQDmvp15d/VQ3vnEAlKSC6AW4A==","shasum":"eeae77f40a45b515852d52cf55231023610249a2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0.tgz","fileCount":39,"unpackedSize":181931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9awSCRA9TVsSAnZWagAAfwUP/01XR2rWxRXoT1qi84p8\ngmwFWSxWpwQkSQHoPTI8MgEjH6umwUo7U1XQmLIIV9iMz1nIMlfT6cG02bbK\na7Aclhh3AjrSdiyan4JEXfp2v48pOQQPkdR1T4Q07Bpm59t7gDTl69MMWOn5\nTkTcmzQVV873TqLmcxxmqXxtcY6HS3zy5xSTauiXL1AUaJLcxbpERfXuiD8I\nbvIlQiuDEI3yIHAVpxjWAkuuzp+km3fGWKBF3lIf7FJm8JBNuNEIumLlnZq/\nCWMw7peztKyLZYmZTeVeDojFblGoHUhvQMmGoGc3QQZq90hgcOvV8RvapOay\nq4FgVJhUgaUc7+zN9dwXX2lhKBUOgaPhOtgXVAAw+6u1WLPb+J85kf7syNov\n/PsmVcPymVT8QwaenD6jk5ePzfP9eNcHedwuaD+1qSoKr35Tj9p5xDeK/Fgt\ni0Dm5RRXKjxN0jctYAhuetNz/ele93usS4Ml8kCIsmnqyhFaRQr3Q7YMw0Qm\n+4gOG/O70NqmSTZYYvnXQHqehTu7znc/2vj1tvw4da44z3LiY2Ha641kZ0B5\n15rwc42pFW++wL8VcZ8zuhC0BUJkyZMLlCfzxdV9apDq8I2mCvKr3CubuJ/F\nHnrwRDyzXmFvBkPOU2JgNP0d45g2hExM9e9PNZ56F0KhVcM98xKNDNlhBmpL\n09EN\r\n=1imD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhqMrldCHXQfMBD9TT6fGIxENvbz/SoQ/j/xPQ4enb+QIhAJfttw4m+aYtn8IaHeQaiAk37Uq1RAH2dlKmcWKH4Y2F"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0_1593158673435_0.07879782889554021"},"_hasShrinkwrap":false},"5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0","gitHead":"fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AzICWdteacOuALuNuAdDGQh1OY/8iR6H57aikzK0ljuz/9iGKObeDp4eG/huWDb0gmRAwU4KsL/62WM3xy4/2g==","shasum":"cc9974b3e3ff27a66942b0f7ca2418236361d519","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0.tgz","fileCount":39,"unpackedSize":181931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+MuQCRA9TVsSAnZWagAAxSYP/104I31/X9lFa3ocafk/\n+39VIxqrpBKcUrgApFyb8G1CHwV3y0Y1rfLkRSKRN9rWwmxlD0ybmHjjfvX1\nCKTrfpUAVa5lfajtoG/5PSSHSTwqCXDpzfPg7hpcPlNX28/vRLyPL9+niq6A\n8okvPd1AbOGWfTfQbn25GHxwnjk6vSsJ30n9t+miqJvVxlGPtZ9d6SCqErix\nQhjnBlVPa03IbzJrt75OFDsWkhQ6zM7dLgLEW5/6Jn3frLhKY1IciA9vX2j4\npqgzLp0jgWUlOr8LnlSvt/XPuV4vtZXKcJTy7a+xQZ/4JlaYmH6PWmm1pIpo\nCpiRllIgEPHuaJP9CmPFJX/pkvsGmnj51Ezm2kq4U0G446mjGunt3Xp9/4h1\n/zwYYXtyaOL47H8pLp4k3FdeESosmvw8bKevss2GvSeFHsZMVp364eDa7gPC\nEsnzfnY8AMhV09r929Vx0qnfaRGjaoetRk9jDKDcm9VgZ0riILETjIXPaGKc\nAe20cMQ+9WVmivjFNnKFHuuML05heF5btBYoroDYDCAb3DUb8HKgcrIJYoVT\nk4/mDvFSrFchIXTDTcYgtU5nqboRTOI99DwiLM4wyWW/aG2yuLezGPL4KQfE\n8AFRtpoiW0UqQqiGUHmW97tQdrcmx96KtDOr+FY/SBimo+3gMtpGyFCJa+bI\n4sAq\r\n=GYw8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZAGX9DQPax0mqhuSwbrnzWBmvOmYWmKTGU/dxBG83kAIhALQ6Ta3qXJvGLz8AEm6r/c0wcqEGOLO10NGigghNN+0s"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0_1593363343847_0.4319705120145414"},"_hasShrinkwrap":false},"5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"977620dcd4342231370593d3bc296e65fe57a640","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-lF9pfRg6G0FpT8BYpKCIpk437JmDMGpctAM5TRRbuxQ+nHN0v7JJlax92J94n+slcJd83DsQPsNqRYIL8OBQgw==","shasum":"48a80e041aeb9d96de136da542231c75187bf54b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0.tgz","fileCount":39,"unpackedSize":181931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+MvRCRA9TVsSAnZWagAAwbYP+gLtdtsRN1iXyJckvt6t\nqWdLgRS/9aKrFplast6jEeJsuLzg/Gy1bCt2Ll2YG1edv1Pqx+5VpVeAynkw\n6dFYWDEJOVRghdqu+UJ69YsexArAe0Ouk0q+UMYIsXo+BB9bDyCup16DolRy\nbVwp0e5q1jNQ1N3vmR5j+nb53GZso7d3tAOKGn5hC560JgkzLfgpFtH2GSXl\nIpesOPWemMTBf9SaRI/x6jZAsN94HRLOJus5PglzGw0o4uuHhkzLcD07YQct\ns5mTgR2ajx9Q0Xq71kLOUAqh2jIN0qzCH7Sb7PnyTZWv+7qmZEThIKLAtTnm\nssmfij9GUPWYogxwWiOFJSRQrPlJ044dzmqvXEgSD3jW6SaeyLIRLaYVCaKh\n8zc3u84IDWeyJm5h+dQ5cNuZsUWvku03+PVpal+C6eozoOwJgy08o8U6ydbc\nmqAKWP1hLcKXPL+9yO3dceGLPqhdw2v1tJ1neiDLbMX4MQdeP9wppMuF4Dmv\nQn3+R1FcT2cBhnGoB+i1m5g8BAW3W43OiB5nIwjQompPDsAiILaY+lCK2oQC\nFjSFkT8tGT/XwfW5KHJOQ0bbEyCM4uBl7ZOm7drkl3zPp2MmmzTNgN1sR0hB\nbHs+/R98Xx800opI38jZAI5hk3g00F2fbvPupldwdJooEQJPWs2NWo+FEogb\nzi3L\r\n=4mJZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuDQG7GjTA74deSjig6DIzrmJMnElpF6v1zpwIqfIPOAIhAJ8NKSq22Nx6vpPbyqlUiuBZEsYlONFeNs3MVYhh8IYo"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0_1593363408635_0.10564082585736956"},"_hasShrinkwrap":false},"5.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.1","gitHead":"779a0a19fa47e09eae92ae09567231575612e272","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.1","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DU0+cStuO+woSf+31nr7/AE9QZsNz+Ig6VwVV16AE6qsXAKjy5eeA/iHRvSlKazwzbjZqMwCKdWPeJ/NC+rvrw==","shasum":"c64100ece4bc3b5f8b5a07c5e342315fa9ba2021","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.1.tgz","fileCount":39,"unpackedSize":182160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+MvlCRA9TVsSAnZWagAAWk0P/iLMhpPXsw1PcEKiuRJp\newbtGQCVg0hYjqffqgIKxciSxLF7yYc3c+VmJ1BUXDKMVXgXWlTt6Dyp+F3g\nnDBOlEABSSQXgXnG2gla+YTUevJIfqGI6HMtLMcz+Pe1QBU0r7c1ETT2BxsS\nSNfTO1+A5N5WaDVjmWNLjYaaoHVoBvlkedmPUbOCNSVl/NUK5nCZKqXpI2PN\naFrIlRMwvti9zQf1D/ix2rtIKBwqODXfXydKWFAX2bxHaZZR1Zf71MFolq7z\neD994U8dVg2xMAnHrXvuHOGsGdJDE1w3U3jyYYOSnPOOXT+sWxoG6wYdCcuU\njy9iqkURBROBgASEuIoNGQh7BlpjAHKQ5ehWhkWbs8zfH1Je04x0oTXnkhxU\n+x4EGNRkapxT9veWiiTjLiYKYGU2U5yGMI83+EnGPH6UDRjATgTtZRoT/3B3\nKR+YvMy7fIWKoTU68VEBS9UsgZ3UmgeF0v9LsGj/dJuiDRL1SusGxtr83z5z\ncxQX0rC10YQEFOPet/Susb4ZybOtrpaPLhd8CHrHdP/m8GDhX/VNQJVXrgyO\nDtF0mlqnBtdr43zWp4hiVQP4dXjO7yfbMknOEwLabJvj+SdnbxNsKFC9PJbm\nF4t4cIspE+zIgwzfPD1vUMLuOuMTWyqfuPEwJuXDyjs5uGHJZnzEO5jguoeu\nnVkA\r\n=LgjH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEobprFndeFmZRpmPVFeUwG3WlJd8Ykr+ogzHBQybMUAIhAJSS+ODeKkmBQXZDWZWztgvK+lbquwbU7DJrOhVEsUb+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.1_1593363429504_0.5505827529465839"},"_hasShrinkwrap":false},"5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"779a0a19fa47e09eae92ae09567231575612e272","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c1EswP9dqZgzl3JswtMzhYFF6ZT5JedFzFczSpThqGs45nozSjeGg+Sgd1d8o9vh9k62tbGx7RJvBjHKSM68PQ==","shasum":"94cbb44043284f4ea869dba581897d7242c3ba62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0.tgz","fileCount":39,"unpackedSize":182203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+MwPCRA9TVsSAnZWagAAm3UP/iEqfodW5CO2047c8ya0\nL+g4+THOBwpyHgbBT/lk7EqydqnMtMQMCK6dmTuNyvCLAT3VotW1lAj/0tak\nBKkkPligAeNZquFBVgaFSvVy/m19yMq4kHJSaXjIs2+37DQ4li50lqDzhnya\nFLTbKfjFwjsntwcscNDOw5Y4DxArSKE0hqMQbfLrZEjPeNSbd++npLQ4SWjX\nRJwJJ7CqnQA707cQHTBtXU91dyoSyoBTlKoQrj7PYxQrivx+sZh62j3giItR\nH05gjcyEyYifAonWSyg81X4u1x85fBJ8p/Vyj6ToO0iRvt4rlgRNjqqhT+WY\n6QJ6Nkm63MSaq2vry1T1KIJ6gOsJTES+13I9P5guclsjbvwMDxMa1nTTVWbP\nRRZmHrbM+ZBqBnomJv8cr1SU+/SPocO8PDm5OlIKvC7Y1WswXg5vED/z81Yg\nG52OF552WZgBwE0LvujQnvHZI6dCVJ3EuWRroIhVCd+L/WVv9lE9AY/xoNcL\npf6yomMXzT01pWq5XdqhoNl6/Gchpz4mSSsVgVPTubm8qRqYc0e2fJ9nRE14\nxBGhjN/AIFH9Jz9vs2mrZVGDW9KEPWVffzSaqtAVyV7W6kQ69Hq84dftcK9u\n4dwet6MUPdtIoN/iGgpP7FtQMMG5HDloXsbf+IKdjI52SlDC3kmODIMH+r4S\ndkZY\r\n=MAH1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJXxf76O56WpyXy48yYvJHG03mVgGyskd18lqqtfYk+gIgIQ840Aw6BdZgUwgfJpPFb4ldkEa8FKYtL6HqH5pKrb4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0_1593363470685_0.272692618906049"},"_hasShrinkwrap":false},"5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0","gitHead":"d737459596fd1d8b38bf35bb3894651121d812ab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LiUXVGOZe2VcT3oz8ZsZW0bM4rq9uReBEMsZxoTu8s3v1lV4K78xfjZfx32PHtMadsi+rLxuxEIocbT+UdXGqg==","shasum":"3753bd8e5ca477a5745655d03445a5faa15fca04","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0.tgz","fileCount":39,"unpackedSize":182203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+98qCRA9TVsSAnZWagAArNcP/2Z0J1z1DU67qplrZbA/\nQCqWFlrLI93uSbrtbeIaRsqPlKkQw9NX6YfWpJruPmSz0lSSVpUc74RrLMWC\nIwGWE65uv2lOhjjEW1xDQ6ddWC+JZ7D+tOSsSzpqjymyXybxkZandWPofOym\n4rJ+j0mmJP9dT6+5AeprIbwO4SCCJRqHrFAbxVlx3myRBlApXySJgS6IzE5q\nMxcPDEeiOjuNMiVJja+/tibUnEVpaa7ndyksjX70yPARnTUaJf7QRCgdACMo\nqI3jUTQDhhM0ONIy93x8Txud3FPzoIlMfk6T0h36eISNVrYen1uZJc7VvMkr\nMhj+KMgx40ljb0hL48Aqiy+FLgFDkL4F6LX3+bI+YEto1EmJC7XoVXv9oV8i\nu+81sw4vAH8kgRjd/7qfoi8NfbsesuavCnTflSp3l1J8ZAQ+ULlCslnDsYny\nrqcD4bIDhp+W+75Uoo3/Zzh5FjypFhskSPL+cyIe7CrCNH6HDh66AviN9RUc\n6uRxY18+tkmeqvrm/Ee2DcAoQK6RGUx7HrzliLbdY9FO9/RuStWKZT9jk2mL\n4ngin5owKNWrEmofRL8UVTui8OWYMgPG4liYGi72NIARBnG2rvP7AL/bFxRG\nw1bRO1a/+hl7veK8SRHMO0xYOzjN2SunzPo+dk7vxuRr2foh0tUYP9bCf8nE\nIEMb\r\n=cVKu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBAlWCT61vo0Hmy5k3aRbwbPoIvxbE61H5oUOC5g6xrOAiBB0QqGvF8iBbe+WmT0jxcOPUXeY4AkzrVkk7bT9U0Knw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0_1593564970212_0.8642025643596007"},"_hasShrinkwrap":false},"5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ae989f7f5ef01c475e11b1cc77763dfb52fd2b33","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WS0uhXa2F45bFzv021Wpf2g8arx35lmc/HM7kaJJaasPdO/B1A0cksgJqbUXBm+h8liWvloEK41xHrYoWT3FlQ==","shasum":"4760222a3a8b2401ec88edf5c29c8ced619a8cea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0.tgz","fileCount":39,"unpackedSize":182203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+9+cCRA9TVsSAnZWagAA9T0P/R46zV6yKMNPt0VTY01v\nTG1P/t/tF5T7ojuti1B2xnx06pCK8BXWe2siBPGGNGtQFh7MxVVXTh3yx3/o\n7hXgrAMY2Iba5ojLMKtMe+KeskMfahFeBwNCkqTVq6HnEElHwwM46Idoptul\nb8bj+PTYzphEvzyM5YyCvc5iGurh7+s/9hIAea+e45rS60DP59l96KOFFPqd\nd9KJW5owyzQpne32GsHvfYn5pj6WkOAbQyo7S2sysrvkU4i3FTb9TqzEtAvI\nsbpA0ckT5JRJmXhYNE2xh7QIwF/fiXuX3s3N0BE58CwCQYUlc1TyCcJaNiSg\nWGeZJvUNop/KKkJxYE+dZ10BGDl+ruV8zmSB0nmKIrxChSBT/SeKnZx67GXw\n0hp98vCCihI1/AUQc+xKixakeRzl+t87WLCgcEsESVv7w6Jfxcd2kxQXXWFm\nRqn4N8G7YAKeZSbUwKZu9dI1IH0a4v3mNgkV3LsXUEWzWfgbWkCrp8wMeX08\nLAM8E9xQtrITIrrYteMl7yRRMGDjTK1JrCFdypvyD/y9vRBEV5S61cjPglCz\nasTIWYPLMlVjV/DR3LHSl6EvcYGypL8cyWxEp+Z3s9h7ehyBllkJRfftgLUG\noF5/vI/ZHs7vcyWm99DPJr/Ga0txDbzGC27rQBHU/HpgBqfdroxBE960Shpq\nPCEH\r\n=xV9G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTSY1C2jr6f34HMwExuL1WByOossGvz0yAmW9/VF/gGAIhAIFkT8BoddgKAL413Ec2s4QbPw49zS1Oy25D94EQ9C+i"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0_1593565083501_0.9551497866302305"},"_hasShrinkwrap":false},"5.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.2","gitHead":"b7626d42f7194aa197e2df5331530484f222f5d0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.2","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FovQI3ARf2+TdHxThI/RXLCYxLYTMCNYeb4BSpcFZeEcAISQqJfkJNnzz+TMEARKa2EMyYxAaFzNx3v7uxwZEQ==","shasum":"0844fb6fcb97d233938e4c9ee70bc7b8ab17050e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.2.tgz","fileCount":39,"unpackedSize":182432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+9+wCRA9TVsSAnZWagAApqkP/0xK34Z3VoIVnLCljCgS\nFkJEsDcxPR+ftWQ58QcP699VpHh+/IFk8NjYJPP4pHuCWo2mitNdzf6ZSUuO\nFE0JlP4re9Y/xqYnHore7X3ZKmC6ycP5qkXvBYvTY2ePHw0yvzZzce+X30D7\nVAopl0nPgePKHC+H0y0iEYXq7/ePZ3rlQfGayZFVDUvJNIjWVdWwB2+/y/g/\nO3b/E2V7e1rtJcfY4Z0YEpB14S4KhwyGXL7yq+ExuDup4LbDsqM7eGX0qWkx\n+PnbWhcFFsGANcj8FKmcHn/QfkGa8CEHBDk6oECGi0edEhTvF3Q7KMEzHlbO\nxs4fQkNG2JxrXmNyicimYJiJKQOy7ioO8zjRJYD/1+jOL3bk0J170kvDYFZH\nHK7ervDr8h0eviEuQ3naefWsoeajqTg819iDchBF7uDG2pNG+G59PWLtXwZM\nMIPY0x7fvcAzHrwuFnVMBbuBOG07pV9yuNLydfBDAmFQTQQREHHP6911Jf0i\n+TP3mxnX73F//qYiUB5X8JLo1K9V3Fi4QL51lpssBV8UCT2qJIsCZ8gDxSSq\njMRzrCFSpNG71m1dVyEXWMG880VMlGkYcKwVcg7T6UFW81xVmdBppUvH/hXe\nSOu+WLnOY3jJaU0wgyrgJk1zZVvwJOyqYKLMw2L9gsd5JG4/x40z6tsUe9cg\n8r69\r\n=oo4f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGVViVKSn1rNwFwFJHbY75E+cuPTsWfwkYAti0WI35rQAiBpxPJKDOG9yS3vh8+Csf7Tp5IDUO6nN1MUObIXD5SxrQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.2_1593565104157_0.6639910179261761"},"_hasShrinkwrap":false},"5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b7626d42f7194aa197e2df5331530484f222f5d0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hQM0+xFoucGxsvtG9d0/Dh0N6jpE5ZrHoW9x+cUuPf6BOJ1fiHo0ktqCjFToJKYXQLJKPiaUxVrnSqzZMrSgmg==","shasum":"48ca20671917942f08c42942dec32e04c36dc2b4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0.tgz","fileCount":39,"unpackedSize":182475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+9/sCRA9TVsSAnZWagAA2lkP/0Fzgm/TGRgdfeVLVP2n\nGRbbGXQlyg+aM20PUgkmm88aOJdEHnED9Q6oSC6wwX8lZ95gIyPH7Vq9jtGn\nn3mJi4RlasBr4iSNRFDNhK5tlU0rxJGmvupPZ0j9ecPnsQFtIYCHNXxHeUwI\nbTgWdmG2xwpRkwGYGR+E0J66G1Pzq+go7TsKJTJmEvwPRXBZbAHyWc/vIIno\n/sQVBXlgDcuDKEbJD1GunJJELcC7IWKrG3tss8pZSST3ToluQxTpVXJwmK5M\nJlamwI4CerEhISUjhkRLRS+346wL3oAGTs252iDpyEz9BRoIQ/8Uk1jpmKyD\npFcy9tFu6ied9Uvj9b3L1wgrYEceztH0cvneNmH3jXASesW9IQR4MEkpeEz7\nKMMjaZySjm4uVEuDYt1YTmB5kDbWddYe2sNk1iYiT3me3YYzk4UCxopHbu7w\nHDws605F18pdeJsyUIISdNU2UUzwg9ZPVv7L9CyQAxFLLlufTFMFlWjd3olG\nnKxNs2iwSn0S9+QPEj8EJ5lEGPkIBxMEYnPXMO3aw3KwXEEEZWZD+/jWTY+w\nQtad0sU74WEXXU4PsagpYxe8V/1v1Zd7lVfvqt//1yUFLtyFAkyN32htQYb+\nDufCputUhP9Ps+tRnLdOp9M2ijY7Vz3bwU97HRJEyn9DRMLcDY1r0YNssGIg\n7b1z\r\n=qEOV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLe0tTmvFTBQHdi01xDtm7f3RC8c/GaMH3wrbqxfjKxQIhAI9HGYWDifQRhiANjes0IzRa8FFO9lR29LiHhCj54eh+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0_1593565163827_0.8327799761427552"},"_hasShrinkwrap":false},"5.0.3-772a8610632e17c88933ed324595acd599c52df4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.3-772a8610632e17c88933ed324595acd599c52df4.0","gitHead":"772a8610632e17c88933ed324595acd599c52df4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.3-772a8610632e17c88933ed324595acd599c52df4.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XEVE1Rmy4dR+44WAvRl7bCAycl4enGzefB75q7PIFrAd0Ku5OUgehpjQX85ttkjxpHoLKUWbwhVbBghGohPMoA==","shasum":"2871800eca51a7d8656342e4c03a01c6885ad8e4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.3-772a8610632e17c88933ed324595acd599c52df4.0.tgz","fileCount":39,"unpackedSize":182475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SK4CRA9TVsSAnZWagAA3RAP/jLwt/aMRwslEOIuVwlo\nYieupAhTSzD96drj8iQLRp7kXXf2kqmm0ylQBD8rBzArRUk6pw9VM/kUrB65\nvE9Bsw6PWNOydYK+mR+dYjQkeAQrhgnP8qdMWz2db9s1IsRZe9GCtOM2dVQa\nWrrMi//tNDehU/yVCemIakaTJDa2qe55zGph20yCID2mQt7Jn40D33BXCd1u\nPr2ibkZmQdApBA2VAEKHDG8rOjrXj3fT+jCga/GYJfbXvZX/n0m/PSurv+/i\nLYlmCxHs/3/v1mdPNrCx3K5gZrgelFThPh4EM6lj+MEdjsN4BphEm55cEqb+\nviVkbw/y+PUXR8eJYoi+rurhKfiKsuaogMgIlcxGXF29AH1/GU00hiO/GF0X\n/RePt1U71g8nWWFBgvCiCFax84y0dhc6WynhCgrGJNTRQoBHgIaQAUfpYhXq\n6bvjjHKqt7091X+bqoEES+PDvUsdSOK7xwlU1Xm8WeSs5F+9dkdf+a7ru6uh\nc9otd0kqjgETRxWtG9srBZdQNpYVCN97OrvLBtHitEK9k6TWb3JlYe3Q1jQh\nyPgs1vPs4SfRA/iYAf7Cu3CgqIjSqlqfO/PpR1iCPjVcVQwyD4g8cnzRP+ol\nkICsHHSGV/mPczJu+TnpRZLd0/n6WSoMYKfaSNCoITv7mAADYogLYklv/r/X\nKwM5\r\n=Y6F2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBBpydWRgtXx2IJmDrlfsPytjtogBh+ybBEx2q6beOkAiEAtldHDlqxpY4ONC8VLbktcuiqGQXw7VV8QIjfzPm3SSQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.3-772a8610632e17c88933ed324595acd599c52df4.0_1593647800178_0.6840556098676058"},"_hasShrinkwrap":false},"5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6752ef0ef9907e919e2dafe3c8f32d8a566d5f09","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3TWk+lhO2WPLjPNB784+Kg2/BxwrEZclCtueLQU7NTs/dKci5eaCfZpdvOB+EyLEl3sijIIvOY/34RR7ULg74w==","shasum":"ad4b0b7252d14097426e2dbb86b7e341315abcfb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0.tgz","fileCount":39,"unpackedSize":182475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SMXCRA9TVsSAnZWagAAwT4P+QEO1oCKxBIjRp8J4KIP\nK7Q+xbEXvbKLEXtZnJ9fW+gPB85e5vZKH2Pq7CcrwBXq4TLhkFafhFpN84U8\n++rUIGhSvcm5CsTJ5qo81ZI32FPTpvS4FHNEUIrwOSYm66QAJRF6zXtjR5Iy\nnFV6dIz3hWGL2zfbkjJ25jb3kvr2LxaQltdVZgLyTNWQw37JgJ+B0NSk96eg\n6zVuE6etvqlHAx29Z2noKGYnSaZCDtXrWe1HT03a8jq6DwDvTW0BeGtvBziQ\nQ59HBBhxMSvGL6eef5BniG3IRQb5HBKZWXSg0X7PtMB3KFJ5pcSMrMZgSTwh\neaZV6m+viJUqz/D8rlCzxB8imZdzxarpFWn2Tf5JHo+pscYiKzPqJfe5jthJ\nLtTfzfHBmQB2wnect2RutB+Azhhg8wsdjhA6z5BRZkKHBcW+zzCLgHPvUlmr\nNTVu6etG8UScOZ8AGh8l0xcxFAXvnR/umzPnyffAJJ5rAKRJry1jVIYIMzHU\nPpfzDY+kxdsVl5oGiPfbfnSj83dQ+PiXLYhpdJgw4+zxfL4j9Id8URa5ynd3\nL9A8DCF+IKvv6bX8DuPqDVOwHUFOc1etvfu4kuRzfQ8DNuoAxx0RNsADZiDO\nj4hh+6NI62TyUnZXZ5DOrhl8By5RMZFSoBGL7cagfKTVavwp3+zQTegNV/8P\nsX5x\r\n=BJvR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHY2Nh3KC1NU/OxrdI5A0ADP+UkjnbHWtPuooUjWpBbQIhAM4GuA4fB/YGxk1IGe1UwCq2US/QQXJQJ5lVCua5neME"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0_1593647894489_0.4572246309976826"},"_hasShrinkwrap":false},"5.0.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.3","gitHead":"b8d355c3874ffeaf1cea202a7a934b2719b2760a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.3","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-N07hxP3NrJS946P+7ubvFZSPDyODrLuK9TfuXEuoveFEO6pVd+OEdkiK0wyoGAsYwDEcPtCmq3AyEyFzckPwTw==","shasum":"6689844bb7c44db1ac148e662a2f35b208726df7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.3.tgz","fileCount":39,"unpackedSize":182708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SMkCRA9TVsSAnZWagAAa0MP+QDAEqymPSfKQsvFR9lg\nnK8/oMAGbPtE+KXERwTfNePwosqnVPPypyOtSu4OdAQlBjTvpVHpyuBgfhVQ\nHgKT93ogqRKawvxYY+PVDML2aGSJ8DkDzFmIIjIpA1Pj4XuodcPYkmmNK+wF\nBu+0/+bGpEg1W9UsoOxg08df1WAynhuKjLmtWUEO7XkEfowxz6zXhPuZWE09\nVg+RP0FLDHR2cstKh0aJHjARoqiC6T0M9QFdko6cW1gkHLDXnC+iz05DaJaI\n1kmOO2pbyDmJCbnSPV0FnY9em29kFH7UY19TW6bf7mUXx3eTg96fMkwQV0Gt\nYQ+kJD0i1D0OhMyWMqEWSHFQA0IOsknGiEh2IjFYN3sEdRCQ0tIntXje3JZc\ntDINND/VTrCuIH4XYFLjt3GzfoxsCSBqby7v1ozOr3NL6DK6TYf8dQXJ1GMx\nu7QvF3xEPbwCdGD36UfvpZHuUnQqtYqQk91ecJvKjTcCNroX7TIFz60kXCr9\n7PaT+Mbi7wGxYAXOaJz3hF92OoaxcMl/MmrYKTgqaMN1pGQ4oSU9uZUu3IXe\npE41AQwwqzwFxxj2nWzWHvwMn7jW3hJi4xuhpK48alUamEipbITv/mRNv4Bm\nruBNetrDPNT6tZwZ6YS5sfb4ZKRvdAV/ZJ236G6vsbpabuR7wYcY7fW1Ezil\njyjd\r\n=eVz5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID24cevjA5P8WTR2muwBxKwPlCYXL6Exs0TvzCSUlaUmAiEAl9RsJz6UzJJwTfhWHKAxm8MdD/XysCoYUg2Tcm7k6i4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.3_1593647908000_0.4115696554241106"},"_hasShrinkwrap":false},"5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b8d355c3874ffeaf1cea202a7a934b2719b2760a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YQFWf2iURE/y1U70uoOO9PwnZsx+hkoWPPgo2uBi7ZceP4S876n/oiGunYb9+NGZmRUu0U5r29wOihDYgMOmUQ==","shasum":"f9dc5edb59c886e01ae88b2bfae4f016b1cc4a8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0.tgz","fileCount":39,"unpackedSize":182751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SOvCRA9TVsSAnZWagAAKrQP/0gSTw9p8wIN+hz89C1f\nQyMMGVvWCO4ba6BwKEzVJ5pi7uvhrGwEpyHzBsrkVSbDXsIF2EyNGY2TpVmS\n6YHNjvUVMGxq8g9EYfrfxsFz3VgrbomUO2fTFxFd5cVNr2j/fkIKXmoXiEta\nFtGkF4SGOHomN4zk0GckIPivnyfKk8Zvp7e81d8qZe+zdn1DsZAkUEN6+tSH\nHrzdtxik4aWfyAFxY+BQycbUV1HVM8+78mCc/sENu80qfKYwz+MTrsr1QD1D\nmCU8LPXstqTxxcQgHMIVOCWQhou/A48L2g4HL+o7fbF6DcvavIWpQOSUPu50\nBQlaZ9JLQjammyMxfA1CZTO5AgsZNxXeFWRXUDKMJN8EEkO2N+XXgOkw0/Wl\neXQbk+V7FaxNsGPiEicPA0IRmr7T7HttztaCMd/G6sVVxogKosMZ5uOYDBlg\n1yZfn1wydpsBZvFxwu6zzrOPWubtvJElHJRvuiPzp8FQHQ6bQdGB5nY5lhPS\nvmvIHWxYIsd1kJo8+maNKjLvc8mgoIIitUTRhuEKzejzWfeFoJrfuoeUIyRY\nCDEMAPwnKoJ1IhoAggadyx/q4HSL61MFlTGxT2A0gIGT+ztxu6/CqLK2h9Gp\npjH+R1fQuVL69jkfGqzBiJBqDkFKcw3GV2fSNN//hvcAs3IWPWxEbHotVZMh\ngauk\r\n=j4DD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvDoJHjuFbNY3TPwQcYR5q/WH47gbdQX7PDNvwzYajKAiEA99muY6WoGzSr1ffrVJU6uNidZbtpZCmRonvL3PjaZFQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0_1593648046736_0.14547052340435118"},"_hasShrinkwrap":false},"5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0","gitHead":"d90d998cfe86548aac9df0fc5164b53e1cf9ef18","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Z1JzB5qKS/2kI5qaRfy1DHsiBIxz3tC77XoBu5Z5ZzoK4uSukPNn64fdEmafG3Vip86tfymzdEjELnDI7Af77Q==","shasum":"0baeba642a80ca46c0eaa85e5ed75a50fe4433a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0.tgz","fileCount":39,"unpackedSize":182751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SwlCRA9TVsSAnZWagAAYTEP/Awltqnds6SVqeaDWOoN\ndUKcv3rP8OMYcGIMS0lnYMwwZrb2KKf/CsNMy0Q0XjHmVztzLm0lFcHlIfbG\nYJN4ThnAjXMPdlcqqNdyA+i43UeX6es6oHDHRHwxGWttK8gN1LS39TmJmfAN\nDIr2lTTDVqmDGu7unLdhuAmk7OTBc9uQP0UtQJlu4qrCA4uk/OgQSeUm41Ck\ntRnwpclq9X3DmnvKKfqVmxMiOnxBa6uSBxPt9gTdDeIGQm8OnSQy9rzmKq7Z\nxv2rgHurmNItQlgZzak5++HHTRsvKX4gzjTCFE61oXcpVnauguuWi7YHWeUL\nisfm+ZZi0hjTQMiAevgPovL621ZBa+kHIhbA8N5pWZKRnQXrB5/i5ToYWTuX\n/iFHODC3buscFO95OZK9bXVJCbejGX4fDaooJH0TAzsy2Sk+ux3LRuVV7an0\nRsuC//bRdjA0CZqbRGecWxh3yR1Q7CZe1UP1FWgpKAMjJKz9gQXaCw7lH8dH\n+aJ1iLdvVY9dPwo2UKF1AberyaQMGGvB3gwkghWwpEArJmbj//ShXaYSvRB1\nFQhmCVPMJE/zadfg9C5ZquvtTZwg20Pj4+Xjjlz7DajC3ANfA2Dzaul86GWd\nOxM/kZ3gWPi2l9WmZJPEqQCGmPSuCIXpRj/0u+M2ZBIK4I4JJtnaaWvqX5Ik\nEBDU\r\n=FL/K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ0gYUQ2KDuLGcBvGDXxqXKy5nnwVPvA/qiVrhY/NcdQIhAK9q9yh3iX8N8MBeRh2uLE5fm9tcPZ6owyFVYBF8ggQ4"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0_1593650213024_0.5268867301850175"},"_hasShrinkwrap":false},"5.0.4-dffff67d593941d5d3632891e08539be703cff80.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.6","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4-dffff67d593941d5d3632891e08539be703cff80.0","gitHead":"dffff67d593941d5d3632891e08539be703cff80","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4-dffff67d593941d5d3632891e08539be703cff80.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IStlBoEyQ9qmvlAVMs+uAtPDwQb9kQxBaFNVlJXBKNl1C/32gUTsInhZ6BfEDBXWsIUR5EdV+HjjLw1+M+8nvg==","shasum":"66b26d8461b9db038d5ffdb432d87018e2bfd9c7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4-dffff67d593941d5d3632891e08539be703cff80.0.tgz","fileCount":39,"unpackedSize":182751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/Sw4CRA9TVsSAnZWagAAxy8QAJr6CQG/Cbt7dhEznJcf\niniPdlXOjf5Z+Z6p0KAFMmkWTNh24FeBUo0ozf0Yylyn61+PPU9bNDG8Uved\ndvoubRlq0H3AmLPHhWYd2tT3eCrjoEvjj101wi9eGine8Z0Jq4fQewlIMgOB\n4CL7//o3OHFbtEfXCKjAazPej1X8NW2S2wES3n2ShMFIdzrP8VyLR5WfjFcZ\n3kS8fMyidiVlXj13VmgHGAscd+d1JiBjp5Y3ucfeFD0xd5R6u2CeX+XdrVoR\nEvF8HhnCz6BRboAqFu+I4sqaQpYuVCUE5MrqA9GAg0nvJnbp0pfvQM42SrV8\nKjyjBELZH/lcOkaTRhY+R99Na4cJyY7K4tcT4Mtnfquqbu9bZ4qrljcDiISA\nD/tqf1HxRdeQMxcboVtuI9UJDsF41bmtuu1U3Kkp2ZSft92Gf9tiRY1PwNan\nH9Trfx0Uc2QABFCPdVCeBgO4fAj5e8XZ1p2FFWIWGp3vb0frUTetb1+YaYsn\ng7zlcZjcOeBrcYZVW/JSUNtAEnxrlUCQJ603Nqv8acDneJZBJnbKI6nBKnvO\nZbLSE2kvqKGquCPAuxGkOidnfgGdwlyqbf0kGDV0/2SNLcNE4jb4rOw6udlY\nWKc7FqBcmL3K/TUxGAXEkZsH6CDeBEwPIAgik8D5PiPR92r3LkPY+cVdYl7o\n9yxv\r\n=2liu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+Vv6WK/bc47+K+yVlUNHVtMUfVvBnyv+fDvSImo14lAiBLcXSE0mC46XB4P724hHytheaYwo5TZBB2LcO634/ypQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4-dffff67d593941d5d3632891e08539be703cff80.0_1593650231795_0.8984848564550048"},"_hasShrinkwrap":false},"5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.1","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1a806754b6a77c8e84c70e92605a6d72a94a5392","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xh+mxjAQUTIqVqn2thxJyvnEDm1gaXJJaWsVJgNd9AFJwX1qww5wm2I8SZJCG3RklF7KyXqhPyNqwQAYy9gJvg==","shasum":"d01482af4c994b059dca13511034b802d9245efe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0.tgz","fileCount":39,"unpackedSize":182751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SyOCRA9TVsSAnZWagAAVOIP/RZozkKQCTdLlBRuslzi\ngEjaz5aLfKtzCOEhCvUn5AEecX2PgstM5vx4J3zydCtjLH1z1mzGBzK4Gdsn\nde4kaVmYYfBbUtmAAWPNn4o5bB8QHJ+/8OISUdVTbi2ZUflNNKsI3ranF0nB\n1Uf/CDPKVVaZONkGH4yIWBzEi8R4qQe+oqxgDTuMINMDeCKNIaoIt43jkNyb\nyO1cMW7Mb6sgtAv0KTMzJpCLIcKVHjrReMmw5yiwxPgr46snXSRKI1JEwvvH\nTTHIijCJj9xWG6y7gt5vkR31MORQZJ0z4p38cnfCe3IGrfigT4mUcLRZOctx\n35BPoKHKy+Tp1F+/e09Xwus9tNSULbs/98nq9nMuOa6YxJAscO3TeqxA1gcU\nLghIWPue8cF5Vj5SI+Wtlk7bWzlNWjJ1DjE5ic4vzVYM2ixQ3Bc6H86MTU4D\nEMvyqyklMUJaVwJCJ//8C98oYPf5aK0NuXORcVIKc0n8mCKCBMZEHEXqQgVS\n/7IqLk/Vd17u4mp6d6fGmb1h3rcybG4ggGWgM01POJr89fb4Zvaebts6YJSy\nakr+8xf2ZnsPfqByeRnkPkVEk234d16nN9RosN8QZxt5HFdkUlYbDpf/ZE3q\nbXXC0rkMcfmSsO8InaKLxv2W3OU0tGKSNHOFv1yhDIjiqVoPq9UddAipxUgI\nb6VL\r\n=8ieZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPiqaVChWKX0KgFVQyc+ZAaHx97PyiQg9Qr8dC6GX0vAIhAIDIwbajQcjdL6jgz+E6sHr7eDN2RS78adCy3obibo9w"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0_1593650317827_0.6667382072662675"},"_hasShrinkwrap":false},"5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d167f19d5817f093f428bf37bc3a49e7256cf795","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-g5ByOLow6CzNQDbxIZiCEKsZhBWlUPx93r3CGZUVEdDWyrRpKWuX/MKmxgtiG7+lhb5FwzrbzuvsCpPanbRWtQ==","shasum":"545dfad68a57968075546be7e428f3c9120b3e67","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0.tgz","fileCount":39,"unpackedSize":182751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SyiCRA9TVsSAnZWagAAKUgQAImXAxBMRTEdjNI3i/Dy\nXFcy7utdTVdnYIq04mUMO8knP8X7QJ/MDJ5iQNeqj2IU9x8KkxVm40YpKXqE\nY+74TnmWWjxK+gfA+wWFaxgEg/i/6/U7+6IZspLJz65WW+/QqNfqotztngiA\ny1XKVPNyKs0XC/6fjkguLjdJ4tLGaSHDiLIc+k+RDFU448TDYDD3XUZvEl2O\nVIFyHwZ4UJbBLIzYgb9I04/BA1mbeUA/OfMc//PqR3+/hdZvcQs5mmZKZ8iu\nBiE9P8UsnsLDj1iBKq1VB012TiCHorJtwGum1sEX6cUssT8ExKHsKwe6WzDN\nuTCnyrkuECtGnePMEmmz/DzBcen1NwzcgbYvVI4kiZJO3m7gxajtnmvyExZZ\n9OJ/wCLqWA267P6GhHT8yOXn2oYHQTDj7haeqfEV2bbz3dIt6OsDaFRpGrJD\nIKtyhcuIW49ltv2U4IPlJz1mf8YJW5h8DDVWCX0VsYksLt3a0JZZ1Pb+U2gW\npx9LiNMuF3Av9zzRqPM+ODfMxkHQKlJUqlmmSmIl1YPdxhA8J5FT/c2HTC5+\niRnX90Dhex9hiXqOnQyJsDotKcdlCWJrIuVi4y1hnhd/50hOskj4lRkGV4L4\nbAKtSt/+imhy6glvob67Sltio7TdnYjsxoitgoU1pbxZusUe1YvsVT6bXJ/O\nnAg5\r\n=V3tK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDi4WFl/DkKCPVX/1abWeXUPpAQQ1sfCpfiDVvl4SuNAiB03Wi/0ixdFTNZpTH5AKlBz5e5XQ4tM7t+Qoe96f+prw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0_1593650337823_0.5153109859410612"},"_hasShrinkwrap":false},"5.0.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.4","gitHead":"acda8331907852b89fc735a484d11cd52a9b1e49","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.4","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DlUB6+ToNtMbd2MNQ+UkV/MUWKVUKzk0wqhwITMn6Im03CJ0f0Gu4ZDCvY466xClwCdJuMHL9wpOAgeLR9J6qA==","shasum":"f25ade4dbfd1ace35bc435de6056517e4a0f1856","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.4.tgz","fileCount":39,"unpackedSize":183148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/Sy0CRA9TVsSAnZWagAAl3EP/3BFpy42S43G6BHK2Q6Q\n2r6mqz1JN9dX2O+ivvk93MB9qQSN29nMPZ13uaCKe4KSRgtMdf3CKNLTWd9I\n4ME8RbhFdvZaoWXrwWpLAXOqQ3fYUpmc45yG3+bbVSx6GsdH9I5fJZ5+KGZI\nfI8xdMQJ0jh33Fgs1aNsdKRAWNb+Lu+Ls1Rjd+Qet1RXxwsBGVpAHf32hyqX\nQ8g2tVUhyhnlbIDh5MmQMJ5LfnumR+J2jA3rSQhETvDpkySEsdU96EHF0eVY\nku4ZhM+ovxmxZk6LpXrlg5eCuoqIxzhsDowuGWTzr7ICK5LWx4K838WP5Q0f\nRMmTIanGNIqaRIHGJSyqoyCPPXVrFPLz3ic5gdtyLDblCO2ogoa/I/kRfJLq\nxCOvhkVyenhNCO594qwgDi56c9XmuUBjpiGSD0p7Hy4D5NgI/ZdoUzJ8RYZg\nC9iX/N5KwIynEf/oCTJQh7ct8aN084tqeJ5WtErGV3DeCT6DFd+GFbzj1YV9\nVAqZ3l6CSvg43p62+17FW594OwYbX6GFllqSd1IdnVsOpKeTaAZNUNTIuSvi\nY6jPibvMrajdhW6EReP22xLy6Hobu28kcZ4IcQfQCDh8y+oHKepRHJtyx+/6\nKemQWPjCDMYkLuyHhNDjLCzyVjzi/ZsVj8JMIjI08bc6itB9g37oRZrXoZq7\nvqRf\r\n=wAze\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfikrXd69633WdObAJxl9Eufp5QX8VIHJqcxUVvwPdWwIgYVeJLGpa32LHNJVMiAwQE3ezNbrc5QdS54CBBboZaIc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.4_1593650355781_0.9666806491483757"},"_hasShrinkwrap":false},"5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.14","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"acda8331907852b89fc735a484d11cd52a9b1e49","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1sPl8KZPgK1TsNAu8hUH7qxOFwYwRMFMb1Ci/6MlTCNGHSB4pnV6vhFZIdDPttG5eLjR8zTbL/Q9nwNonpiRmQ==","shasum":"9174da639c16d9ed092d57a171f07264880c8be0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0.tgz","fileCount":39,"unpackedSize":183191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/SzPCRA9TVsSAnZWagAAwH0P/3JRSXG1q7qhsoFhqVPv\nVO5bEmXMEugEFwnpYQ0Pegqqeh6lxBxCxLMaPz2jM+dHh8/2IWut/ypOsnSA\nvezuHXL49mq/xn3PXEnmWtGuWMki2dKv2UO3o5z99AJE+SfIwc7pE/oQ0Jgl\nl6A0YF/mEno+BcrgTsFRLPtkWUswhUL6hG5Yvkg+wQTB0ZguENajkYfzR9aS\nTjZp6N9eLSdwTsHaEjoPVN9h1QZYs3ixuOW/GyEOeM6/pXrulUA3xfCmiOc7\nZE0wEtbvQUN5URQgREoXVzQVtdkFA7KU1/NAV9TULNK2EqvolGCeikHzHzpq\nDCT4sN3AZgUZebZ+b1BF7shgZEW6Y0iuXlp3Z74GuiVyRbUMk2HXG46Lv5hw\nMSvXTKaqCYjnjXihLw8D8PV8fuJ+KcO6g+wXzCnoP5C2ViHM3z9FmWl2MYb3\nX1bMbXzrXMzAFDaV8B7/22sZQ/ALBMCB4MhS1VEwK3vly+ZlBB/KLOq9b5L1\nlhJ5wVmUp5iSJuD/yaCJakMkC1KmwMa2o5WRQaIRL5o7UZGzByg8Xg1erGUu\nZgyeHJDzTOeMUKZsZxoIwrss/ihRZO1Br/4jQXq8RC7XvyqYXHBlJGA31PhJ\n5owRwIaxMhx5LbWH2Q6rjWk5lZZZPAPter2YAMvw0QjMkGTyxt0xN11xk62I\nvfvG\r\n=WlIG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgALcUlmDwUX/4FGY1auz90qoG13Wo+LkkVrnzNIFP+gIgLTPISlFqpTlu/Mhe7XAluYtKAASwlSPNckFH7joN5sQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0_1593650382681_0.37087135345278455"},"_hasShrinkwrap":false},"5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0","gitHead":"dcaf6c6b784477d12a55b7205e024256ce080593","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jOQzka4Tins25R9llakhCzQynHlcl2DqKx9ZRCPjs4WQ9zJYXe3PRDc/GldiP3o37qMeCzUlGPiRUNwXxynpNQ==","shasum":"c214027769b311fbc742b90bdf4dfc9c647df1d1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0.tgz","fileCount":39,"unpackedSize":183191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA8fTCRA9TVsSAnZWagAA8A4P+wQnqL8ucrNfRIu8S/Fo\nVi8zKazz5bQpDvStL6z7a1Hf+hCGx1irvms8vSjk2mkl55YZv4664NH0gdq3\naRzdzvPuRo4tC9oVzwse3zcFyhFlCY5UniEmfVUNh8gFrHdwggoigzg6ntyi\nchah4Oj1N2nbtDiurbRmelAwqQPQiVCwu+gL7xsMRHa08q4gvJrMKi+60eoa\ncX+1bJYlfpAgtXOoopgEepWrd1jRNrt+vjQPdY0hwDkYiZqm+jdr13zbzrwI\ngLLREJ+cURELU3dmQrWmfNb5UbFd2/+gSDlnnNwpQQmN6Cpp1jaABW7p9fMj\nR/mf1hF90UHsdUzdldf28xIX4gql0KvSzg9PPP9APIwWgTx8sD+bgF+W+HKV\njlT0e73mYtZ9cXBqN2xcZI+WTkBs4rIvCdncdEJ7Tmo+lhsL/f1wQE7iVvQw\n0ghUMYQs+C4n/NNc9xUIUeGIcwgFXygZFktoN5scjszV9aAgIlRk5AkGZD+H\nsPhK+AGSnqWce/yxG11x8/pA/ulzXP9Grin2qNMc+BEQnZpid8yUBJ9UNRbq\nG5nGH2qHCxY01eR61BLx42GBck8bLLb0MzlQR7Pw6h/4qZI78G3p1ZBKEer/\nfZ0xfGoKZUO/KqRp9W35P+eGsuNBbt1SBAxX1dAdeZEn2KLXfhSsGEGDVGvB\nEyFn\r\n=4IQW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5pB39qoATyohVLLtbFJi+XtNui8+BrdK63AEM2Akt6AiEAgX34KAJ79c525HF9GBDKNOSFGvj1PoPbfL/NlID0s2M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0_1594083283339_0.4097412135772691"},"_hasShrinkwrap":false},"5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"156eb255a2082289de003d5ab04c0867c8847a92","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-m6nlyWL4LNfUL3yJGZLAhEYFSxhteYMBWSv8kpN4y9B/yNK6nTwQCxclXHMLavIyL4y2jtezGC45iegYtTKzkg==","shasum":"bece50f5c588a433ffb7b4a5c87bde18711fe00b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0.tgz","fileCount":39,"unpackedSize":183191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA8g5CRA9TVsSAnZWagAAXMsP/iHPKpvB92NvRpxnCvNQ\nG7W/tXFA+fpd1ieiz5Cdffwa4OIHKDWCwnTxKSXJiN4fMPT6FPhRsAsdv1GZ\nfjE6zoG27ANbM91R8ZBX9nPS1sc4afQfr5YtpV6U+FBfZruDKh7Jb+W+SV7y\n6Tyw49M0OSeTNTLDuZuN8RdebZw1ISN2porzMV8hv1mKk5zJZ7xpwyQftScZ\nwYmd6iEzEzwrqIDtzyTMcU+7C58nUbmCnv0zsQw4UO9mvzxMdqzXyO0SUZmf\nfCljxMPWY4ljUosMFcCM9gkLMTmYNu9ebuWVTa0Sw4ODPzXhXeDS8VMFkmst\n125BU9ConM5ac4PMdSqDZQenBUMupAiFoXR+UGaNYRO8iUqqwtBo6riST3b5\n2M0mLANY75is9pMH7ZR6zO/D451huHN7oX5aVSekB2UCU3nCna0NNWpF5Q8l\nDsTbnkZwhbSqrbUFCwx3dgarq4o3nLbve93o0nzUDhZ5bu2yLqQ8K1OjdFFQ\nP2NMal06SIQsz7J/Dh/Ywl9AzDhjJDsVSJrPeVJ6hiHqHgcKRKvT8cUKYYLz\nkBF224XSD6mfUR+1mKFeO0JySfiveNLQLgDh5A49BdoBTCJtXsFm2TU40p6x\ngv0apH1/W6pkcHM2tubAGwZ/IgFfwTigC6DQnyBkG+R62XP73PymbC37Vjmx\nCYZM\r\n=xliY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnoR23f8Ym/NPsBvBYQmJsmfc5O48UdDzoZOBQLd4CvAiEA1zRVUZRsVhz7xXrnUBmJg76z2823txyCN1U0SuVAK+Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0_1594083384571_0.3620064775878309"},"_hasShrinkwrap":false},"5.0.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.5","gitHead":"12f8b4607e01e1db69d39b4633f42c7b14f39ed1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.5","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t4ywhKJISRJfD9uUYX2XDjrzBTBc0ftKxACIPV2FxpUnL+CYxkIwQc86QLiSEC0MvDuabO6BYiDGCH+Ob69bnA==","shasum":"fad0a6ffaa43b6858aa4e45c133a17643281ed56","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.5.tgz","fileCount":39,"unpackedSize":183429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA8hNCRA9TVsSAnZWagAAZvQP/2plYhhe14vyETBkt2Ii\n+62+0ynlSLHXj5cgY22XNXHt7ZbFlh4ej+ljP4w42OcpZGFoQl52cC2Ggzod\n91766tM+30P/797H9caefv+j6KQw1Bzm8m6/1zelM1j8VzK5fhC+Qg6Wgkio\nlfn7YKzvgNvShZGXZpf6ikVsW+Fj4rz35Wi54/+Kjv9jsqd20MQlqpfFbRBN\nXON/zQdfvbp/FeTJd2K9SH8eEaKudlDN6gsdiae3sidQW3gQFSKukAB+xTq2\nmK678UHBLz0u2EY3Hx2gAfdbh7ZLfHo3VlQ+j+NT3xM4Sh5DDp6VHKk0wC17\n5HyTMxvEP72kOZMfxB8ObcbIGxuFaTrUNyKk75M/ntXie4489erlOdFUkbgd\noeLg0tp/63aTDCeno6MuhXeTk6Gg9CTiq2eDG4HYB1+m6Xabd3SM/WkMepKI\nkqCtlDlQmo0jsFbNO064tryMyncbw7W1UnHNpii1fM5ZPNGtaAnLPI0tOQLT\n095nVKlWYMOYvcbcb8WR0bHBHVrGk+NC8KAqxlsdPxrcYO4aGEYr5gVbdLYq\nozvCH5GUznyws/b4zxijB8fDSO90Hfz6IuZSkB39tRdeuHDcGdujWUI5ECcM\nJHrQa4L9wbufvchYgMFm0Dy4Ybht7qz7ROlHXskl9B5PkJ19C8zdCgEk4ZlR\nbhnn\r\n=x/EP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDq7ZSa0hXFxW6K/UVcxMfqa3qUA5cionqaiUEFXpQeSAiEA8zELcc8tiOr1+1Yaw7+Vvpd4afSZ4W6aiHt0hbzTAzA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.5_1594083404958_0.6766440750409906"},"_hasShrinkwrap":false},"5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.3","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"12f8b4607e01e1db69d39b4633f42c7b14f39ed1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-X7BOZylp9fEqxdPeYMAzqe18nUOYTiQn1I3dWvK19hmzDBLdEFxCrm0+q6dLI2wtIRSOwsePC9rT02/NC01JYA==","shasum":"83473f682405cf7d4ea4b81f531bfd22619f20af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0.tgz","fileCount":39,"unpackedSize":183472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA8h4CRA9TVsSAnZWagAATSQP/0g1VAC5ejcZTzVML0+V\n3Lr1k3fCxxrNojlSkbYruTk7b+a0Jx2DakKSgXe05xnPhgDGlfmifp6zUkkm\nToodLhANGwDrbzvCtdG+lStseitg/F5m4u7FzCbVj7OEZnvuaambPZfrfcz2\na7p2S/9oac0ejCrz2A3isxWTJ5+q4OOj9s0GMX2njGn4bWDBlI+/A3mQmeLZ\nSud/6qaHK99y6Ov2wqaEuzMYZMnVtZtBKcFEjUEktkb6S+zeC6Ge4Ay5G33C\nGO2/InTmaDaQJjRtO14w+RfNPwmLjqVwM0kTUlLLP9AOZd445YIJ4rECQP9H\ny5av7taWLJdgLSTnlMAtkYLBIi+CsruxDxEIYezjlGCQD1pKQjlbpyN8XI2F\nSZyqp8sGlbYEGOPCQITPjn7wUcCGjbLUpOcpwFQm/JpbUpUDpSL7k7GX6PZz\n0pp+cgzJ5o6rzo8u4q9l3A/jsS8AzKmzseTeo3ZfFBNr2YIFlqxo45zpkQrw\n9EmOn4So33j4FLx4bRFXsIhThSpJHPdA8nkEkLdNDH+O1nuXJtyIeQJh4/IX\ng1RXx6i9UJ31P7nfSKMDtvpBMt00BHN4JFCrf6c592uPB+ZUClY9WR9cjWvU\nOCakfBFviuFNTEknYOZPn6700FinT20kCubqh+MzC8hwMrMlUMjuObxR8gos\nDZZa\r\n=p2M0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX6E9OXJ+I5OX3tVXpyiftR52sWlUyXSd/152+/GQKYAiEA8QAyTVeMR5j9KH85pmVjM+xtVej75A9POSOaRRIPRRA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0_1594083447788_0.47515148780658634"},"_hasShrinkwrap":false},"5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0","gitHead":"5c9d447a6dded38cfff870a47e61538dbd50593a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7tA4bO5P13nXT2wrxMaioE5NbQ/LYSobO4bC1NReTvDmswdlVfHl87f44qVRG7gHATfU5eJCSapH1/cNFvFf3Q==","shasum":"507edfc55e82c1439a0b1ed4cbe61e91c514f81a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0.tgz","fileCount":39,"unpackedSize":183472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9C+CRA9TVsSAnZWagAAPm8QAJuQhwm5Hr4gEraW61if\n7IprDqFXwrKCmfXnKFNaWrRpXYn5FJL+FDMJv/V39IQGgboqZhrz7v+TiMwz\nsddbRxytEchuVhUfWjsEMVXU36OZUfAEf6bCzvtDxjhSGWTzMrXmo25pvD7H\nhK87+fX82ED2oP2tuRQRzpGx0jbMdSWB3wYpIRcRtYummcB5WKVHsIIPrMnt\naz9y+4GsCDyBfCxsIcfgb62yrr9fKPhPo8Q85f+mRKtRxdaYGoXsWQN1rZbW\nrJqfweM4r+p9ZZ4sWg/AHYZYROrOy0OPFnSA5tCUVqy8eGlp1FXh7o3NW+P/\nDQHsGUHFwGIrRnsJW92GU7pMIREYAuUgiOV4CunPh11twxAYKFEt8AFqOiNT\nd+rnGt+7QTjZl3CTqerkEQdPLVzHdCj02cUIWV9ST/i9/YuEneHwi4F3IyqZ\nzSsuFR47d4GYMyUPPERgYh0g2vWz6exqc6LgmUswwMCpGcQJeux7nqrbHSeS\ntK0/OMyfVyxGQ5Z0hnZ4G4UmUkJa274ZMxCBqBTvzaoBxcJgfj4wJzlo0blD\nvMTFeWONuT/vmajQOKKzRhEcq8OIViSBslH6D3jTKyjS9DXtcD56Xx/ujvrL\nuj+z4gqRl3l3Fo3DusL4p98WefT+he6DVW86ED7GGi0bORz0zZqYe0X2t0Cf\n8A9s\r\n=3ZhG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfm1ShEamaSdqDflqgMLlH6PkkK0UShcg+BBYLZLES+AiEAl2d4HJWRqdMWpzRkwLbOhghd7MemoiSSmcqymNfna7Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0_1594085565877_0.859526299436224"},"_hasShrinkwrap":false},"5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b7956fd37680fbe89730ccddb65503f9f79b19e8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uV1pX4qBtdBKRMrH2tlRLE9bJucQiPuvdJkPrh8psjBDt/iPGz1iJydC0NEeQHHoJfnwNC95RNR9Q9lYFZ3KyQ==","shasum":"caad473f43c3e9fb5cdda81217e74d890f661b7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0.tgz","fileCount":39,"unpackedSize":183472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9EdCRA9TVsSAnZWagAAL80P/ig6jl4eHX3Z7PifG21f\n2YQRhQI2J9gwKXOjMuZn28OP078yH2fMCEcInfXshoogCQ/hRnOcQ8pRdreS\nSVQezKhj1GosOA1/3z8Rggpdw8F7126Vv1sdTAvVtlogQresu70yq/HSB9/u\nalwqCXri+BxEOpOSNoDPN8HQ5ILny9LJtKPMgxJWNoY0bTkdZJl4Z5qlTrXP\n/KJ3C+imrpQD8qpdmDPaM+9fWRV8tYxnfjd2pQPzZ7IqszGJ+EQB9jLNFG7l\n/rxwuk0DKS3BlOpxPbSomw9e/CVg7qDK1+O8qfltJBlVwgrOuihRqLgEWHPN\nXvn92RP41aFWY1m7j9FVZEEFqZttyRo5Dp6iIP7DDNYki5v6C2IXJo0dY1ur\n/KVsJIWD5zJH2m/ti9MQySlR9MG7a2aCQ9wR7ADwIEMa9ObuRVnawHjNScIA\n5TKidO3O+tlv18ADnC5drdsAHE7WL5I+9gIf3FaAjuoCB6loVC+uvqUAzwUm\nphlGe7zc+fHb7bhDAVnVVKBNKOYBRCbzgMMW6GKtqskQG7MO/xTzSCrmhjyX\nG6vJYa8YnA2gKj6oADcqOJN/N4E85il36xo4gLkevMt/vPPgXirUCOEUz4yI\nSDur29x7UWS/UeSerWENoIlLBi1gA4QKkiyHAmqw3FhXoBJ6ZgY6vPJCZpTc\n5JSY\r\n=rwBj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEssOEPthBm4H6InbPNWbu4By8lJQdkEEX+oym+vlc2pAiEAz5HIoKKWf/ruOSevpF9D4fZH/aeP7ECd9BaJBe247d0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0_1594085660526_0.9664564162478306"},"_hasShrinkwrap":false},"5.0.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.6","gitHead":"7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.6","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/B7Iv6tcfW7dw5+pqTS6lpyqo8kOYGX70/OhdyTWa80qpMJlagiTq28GMfR1NXinL//0Gn75kg0LQS6FzpFUfw==","shasum":"0e23d4c8be8a9a8006896edd00ba3dc1651bfb79","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.6.tgz","fileCount":39,"unpackedSize":183708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9EvCRA9TVsSAnZWagAAJL0P/2GElYOt9l3uEh7uubwz\nF7MAjoOQluh7+WxZHR6dErFMXH/+PMSSWMeyZIxxpbT3lGMlYyApAKIjRvkl\nPt8LEeAUhxhwgZ8fVBc05gjBGiijOehVOrMEwgtT+2MFmTT0ZGI6ZZWMUDkC\nQo7Mx2jK5DqfzTuxM7h7PZve2ZPW8MoOcWi/BygbDwKzL3hoh838tA+/vTct\npT+DASoisZ5fvn3z8AvA/a8iDrciQtZuCYLoJfLHx8QQQleBUqW2xt0FsjCd\n87WZwKn54i+Llec/rseFJ3a/OaaE4lgYQQdkMl3hfFp1LcdWC2QtcjBkNjla\nUn7THjJ3pERUquXaHGd2WK3MNpSXk01CZcJcVxKEomu6/Yg7gvOhc/aeZeZv\nVp8eCsOoAEUcdBADqwesiMeBcTClh6lbotu9ZkYhEZFVXdNgszo6oRW1jBqV\nzXARkwEoD7w0veNQ0FMWXVhMsDKBNBYNNCNasTvtTjVDm5x6wfG00drDb6Ny\nAvDKg5jxDw36upzpOM/9yIi/4KMNeaymiaNJ67Mn5iBmCClY4oqY96mBGOrq\nED7EusBESRl1vRPIXkDUskL7kfBJtBAOOOxeDS6bA4BY5KdClDpdxSjIKr8Z\n+63WA/K+GQ+B7hhMoXplz7tCieLl8kDBizOejQ/b9MGBAP9++1vYbkFMNSXV\nGQNG\r\n=ZoJg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbWq6A9GwAapRAS0Mb/1iFv4oCVWSxUeKLIsNwitM2yAiEAomvFbOFAuHWp4GkFHANDFI/YKHvEmF3NzTtHX5IwN8A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.6_1594085678665_0.8640002150580037"},"_hasShrinkwrap":false},"5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.18","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Wa7l5X+y63hWcAl5b+MyvbL4OgYLPHvZt08rO16c9/l4s+tNb6/YXzPNjBpy1VQktHsjGSbIO8V49M8yryt7yw==","shasum":"9c23242011237ab087c7a82a44d2e4f64ca3c350","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0.tgz","fileCount":39,"unpackedSize":183751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9FVCRA9TVsSAnZWagAA/AYP/RT7CUAux+//ixfZYvHn\nqN8ReAPegUw1h2QAeNG2HxPvXOaBjqIaSVecPh+4B0Z24rjlejGAXa0u9hgn\nNdz/mLPNd32dVsqPaay9bUnBrG8mZRnmuNbSTJnBxfBjD9mcZD5OOjxqHGzR\noHh9lpg5i5WfkQYlHKTbTpTgrfIeAsqhbNjc6lQJiDzoM4p1msyaCISIeScu\nmu58/VNdO6Ajnp29UC5y6JZ4QtPxIlQkJf2SccJ+/sEoOxmGqYl0XGRQ9lLo\nJpBt7krpWQcVwQh0eZauQvt/4nNuBE9uYySMqYNlvV8KBUGU7J72LE83aFQW\neRmTf8BaTm+QrFmoZxvlhQA8gFw3Pvq4164sPujKe0rDszeJOBZ4z/8JZFo3\nlgVEGB2az6HRi0VYOn9cljVn5UE3Qp8UPOHFvF5v0h8moiyF41B6iVg5G1dp\nKQaYu1oxmNs99kedjuHS/X1OP8Ioou4J4SNLBh+3RRPYkQnliftDZqwXDVix\nFqDSDbPD/4C6PwySp/B6Em/dhSTSKzdZjzwwjQUg6cEF/2tDiSQmuLhO8teP\nh61yOPmWa+5ZACl7j2EZgYAGBdRYZPQ5XxwWMgIuo2zSTCbChCwTH1BKZY3o\nEkt+YzlR3P5HW1pozlhrr8hO3nu8Y1NJhG7rvS0ZjPs3p4LPHcdxVwksdxWx\n0NfQ\r\n=P7Pk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICdUACdfKCfz5PNmzmPjWwYB3An9PWnBG/Z5TyV70pdcAiBdATn71k8oYGd1kBUChcjBHlFxnkHwQR3AnoL3PZJpMg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0_1594085717206_0.8661126325944093"},"_hasShrinkwrap":false},"5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0","gitHead":"916a6347b3fe401368f0508ad4c2ae1d011ac999","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-T0y/3VWSzwFWib0nZIOISW83wPYpBkXsfCbiZaj5gOvJaWV2rQDIzbZY4RtHpPfY0c15bqly1Vp6LXjKvH3G9w==","shasum":"6847cea5d3894e10542ea11d273a324e315d9716","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0.tgz","fileCount":39,"unpackedSize":183751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPHKCRA9TVsSAnZWagAA2xMQAIb+d9m0KRxveAip99s4\nNuuAymI93U12/E46MrVYJox7j0vQgjTk9BgRfoqoKc3R8YwhrTLGSE/j9N/0\n/fEqqi140F+uzfZJ+gPnS39h7y5TW9n+8xanV81ljSXUFU5FWBWr6oUz10UB\nPGk3N8+c2Mw6+HYF7NNcVwir3vnygUL3hJrx+qfIxCFy4LAAwlc+UGfd0HQt\nA3l7Ewp0hXortRAtdqrA8X62JMQnSNcM1RYdGnAsYUo8/fw2dDpAdtGcMpAr\nUGeykHPGVHYxFJ6rDgwzqU+5LEMAZ021okT5gtplDzU4GkYUUsh8AVQm5+87\nPeHcjZ++QeDU6Dvj7aA9Wr6RXIM+zZe3rY6R28eQWWkpzoY2jgofWqsMija1\nCI1szk/ZS7cqeYYvoki3MZzU1uWKv6oBkqzqKaLJfM0lTO3+16zh8Qot68F/\nOvcFOYjLHCa3ryM/SZwRYoq0Lu9QCgV7Jp5AGnZ5rV/dc4O7KcvvSe5DzDwt\nImfB1o6XJdpbzSFXM4EGua3QQm6CG/T95AiT7NklptXRTl+hyjK7AzihHCFz\nn4RMvpuQ/xMtTpVn6h2bdwniChqghaF3kWiOB3u5Skikk0WMaZOYCfEd5yG7\nYyct0bnThGqj6RDDhdf7vwf88zyxaENg/91pDahJbtliXrERZq/VoPxv04xB\nOjcY\r\n=Yh5v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW/fpCJOuINZ6kgvMBNNff8HGn6fSe5jHzLHskVZoPvgIhAMk08i5jdcP0w4CT0sxiNHoOI0y76aDfNKsNRP0KZuji"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0_1594159561733_0.6918660632916267"},"_hasShrinkwrap":false},"5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-S1BZcEyIDsyiHG5vNFjWvqvRa7zx7WJVu4toFB2BTyY1bQsrUSrGPhZYb5hmPy0/xZJNUsUy7yyenC/xDPELuQ==","shasum":"2afb94e163bfeca598125542b5f5d77a417f9141","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0.tgz","fileCount":39,"unpackedSize":183751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPIeCRA9TVsSAnZWagAAPaYQAJldZBi8O033p8luXpR0\nIB/g4qW0kET4RPi5vmwFdW6tt75x8P56ynXB6VMBAoUGL5g9hl7XupFuekQV\nfFRxzOjaRAQ8RgEVo8KFekD790o8oILIeXZQk9lgaVEn+Z7pwxfeuFQieNjj\nli3xxu4awxmfJ0BYDoQoYcZ8r5VkIr25WIKz8BGt95GcbG24CnJ1A0JVnkVK\nnZ1VNjC/RymEYVCSIr0BIj7HJlAplXkF2mWBlOum94ZE2LTLr64/tA+yRK3B\ntGpCeJN63OdjB8NBETwXhFprHddbXKAMZFqLUFGnGOPFdvll6qMhcyTLpudG\njT9g+A/gY3MqVmkN1p0RC9vlN+TF9T9+3qq075fq78GOtoVPqjkigaYbJjTZ\nrntc82tnWzEvaH9zzw1LnYvRRqk0Pl4a2Z7iCQkuyahG+elCuJT/JTwOUWSa\n8hBfMqo+6SSO1gS6jC9B9FxZfZwzaLLXpx5gPOyLbP1b39Fmzhphl8GtkILr\nT79TZZNuh+zAtfMm7c8P4N0def+d8PVDJ5wjAQEFZOGsxXeqFGLLIozQx4RV\n83QPLKHI271EKcup+Nl+TUmWtgqewy4uz9jwiTO9fgO70PCggyDa3T7DXguy\nHrCxCzvMd9H+JbgOWcHjGQC6BJTBG4yLSjbkLuDgizvVCCPAbOeXBP5oz+sA\n/lbH\r\n=bUt1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5JOThU+ncJBMGDOHy1c0q3OVoc9IS4wWw/J6V0kcXGAiB6b+MRj5a2K98c/EVzAfqNxwazkxvfhl9d7cspD7s+WQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0_1594159645856_0.35925301396203935"},"_hasShrinkwrap":false},"5.0.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.7","gitHead":"e91922337256f78677266a6c1aa59e1bb65c80f5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.7","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uEdrGfJW8AAHWaQ7Pz7XMjOUYRvO7e3pKzpioDF7k0qmog2BND1IXX6iGvQdOxhFA3l0O8jOophedaapHnK4rg==","shasum":"f63bbe3b55b45336900b153828264fee830561f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.7.tgz","fileCount":39,"unpackedSize":183989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPI8CRA9TVsSAnZWagAAj54QAJ/CL6UbeFHz6TTNfX/v\nrNYc6XJ/6Ckk446rqyCpgkr2oCKTk6zVuDIIgrXaYnsedWCVWSZqW344odSd\negDpb3GEEM/NevFJ/KJyrTM9AFfyXNKDgJ8/mGUqdw2r8ZBA1tG2uWRHuucv\nTNotToWLt1uQQghv6GqM+/Uc9vh3mRiEMJ2CSLBq9i1euZHdixrCUr21nc+8\nbR1qWRS0IB97pME5OtlTn7lGFXNcPLCVfmuG8Q0NxseK5QTtT+e1PCq2YrPF\nbZSIq3q2nWwA/+gvU9eSWwMK5g1m3g3Ht/6EyR8Y5RlEczgozZgBx+q+ByHV\nQ2Bujon9+bLCXXpVa7BX3+7PEihQ7E69ZBpxSPC0Soo4UJqLAwqkafqSPD5s\n6FsFlx/P8fJ9Jdp/X0MQG96I9/6QLMLe/g5k9ouH7u/qO+pPgSvW3sGN2Niv\nb2BQfgD6BvqKf3nR0nV/t2kUlahBDcO/Nf/JWi//VJrTpirWkAi4dpIZdZUM\nvXJhuv6KnOUnG83XQReOHSDvJdl0hR85zYvictVtbVm45DouBV0us9faVkqR\nRjWrClHarVhZq5mzm0+i6rPTllZCjjxpAaZjXOOY4sCrBRdodnx3cPo5yuLg\ncBbHMjdjZVd2Ptd3Z2143NugmzyIg0OXLdKRK3k83oIU34BqM2ASD/+cACCc\nfehO\r\n=kA+p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZJUeSqxFc1aavTHLkGl27FFQlYOQlNhinfPVWcvkcjAIgZ6fFOsOfUjzV97/MTeHN+j+ZyiQWmio0XC4Isw1vQRU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.7_1594159675689_0.14917969670912323"},"_hasShrinkwrap":false},"5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.7","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e91922337256f78677266a6c1aa59e1bb65c80f5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bQXvwtwp5q5C+Ubof1VzHsmrvC91dtyKQMi9TqZKTSEg937OBZoF2odVKKK9tbVs/spRhKteTfK4kXWYf9U9Dw==","shasum":"56d80ef30b7305c567f46992523245e4a355f296","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0.tgz","fileCount":39,"unpackedSize":184032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPJdCRA9TVsSAnZWagAA3tAP/2BqcZ52MX1jAHpVkZnX\nE8FSTRrYYK9rQCsRvcOLm2F2+t5OTYeNdHt1fBVHyaszdQa+Z3ZjdvyKNfrD\n4RxEbocWB8g0Wm1HjaF4lFQYdTPU5TZaCESCNno+aDi5ATs10Y7+Nt31WXo7\n3IIq11/RFHVZDSTcd/7TloK9pfsgAu40cuM3YRps5AVJ+GT0G+r7S6IVqvOR\ngtRJaddX+VQ/4eYX3y1pKhS9cQmVzemFMC7nrdWt/oxkMaJYgaM4Q0lOrvWe\nQkW6mD95Y3Qb4V7Y4TK8hZ8DMBbDwLu74eXS34dOYzYSWyJacyizZ0dv7MZt\nu86Rvk1gBvYu893UnRjqHywIY+uyhHWiCmbouCX9+CxiUXEFiJnDeNK0pHUN\nEFUwFlmes3AJCjovAnCx5+7Ig6T7wWrUVuwEn4iOOTCv62msWIry9bdC3g+q\nTWy5GqGhzPmINtWnMq5YOVDo0M3A7rgH6IoVWqvE+/uZwCtAkUc6U/SLHXmh\n5pHacoWZL06kJ7oMbQR4WGmU+/bxbM8AmWy/A7kK3QN/p6H22FS6xFuqzI6+\nv5RZbMc+5DwsCwVoe5GTnyqQ/MMEjpL+FJO8uSHbWs8Bby/bexe++/o5exER\nNifrPvxRk6rm7W6WdCl/hpYxSFvTl5TVctpfghJRl7ECi/f1Rn31X4mzFTaS\nkxV8\r\n=P9/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgOizm8mcH8dCTuf3zAfQ/bjWXdioBGo5P0LeA10DNOQIhAISA5hK+/9nNrhgVGCqA3NXle1ayBL5htpuJChjE2oB3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0_1594159708875_0.5092181337517694"},"_hasShrinkwrap":false},"5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0","gitHead":"0461aded08045fa9bc710ae3b3dcd8db474c9a5b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6WLTYHH1anm7uwB3UaJHZe3k92h0w0T665ikWA7qvSftFdiEeeVrjuDMEwPo7JtDYhyGi3kFLjdN//5eUHwabw==","shasum":"629cd6974670a35f98044e70ceb502ad81252a1b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0.tgz","fileCount":39,"unpackedSize":184033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPmBCRA9TVsSAnZWagAAjUkP+weBkIJbXkjki2uk3yqG\nEiNEyrmnsUahaCXbi4SVGnWPrpJBXno/E22IXxN4132iYQDwsJXFTczFI3Jt\nBSnYUrkf9Rqe59vM/V6kLxJcgeQRKEP0CvyN4YySB7cy0kFmxiBtkSfqxcnl\np+PBXkPDa8F2P+KPAcpnCc1DzV82dXRRbRhAMnjIGOy5QAAgY9rT3+HO+cxN\n6vaUsovsOg/3zJ3dLpbNm4ClMUjzwE2Azsdr0N/DmqxZhQULOepNHL75ALnQ\npNJP0Lp4i6Cdf0cVEqyXkXF8vssDlpAxJ/ZXklwa5/2iP5DMfcs0dH+pQunW\nviagDOHYbCQy0xLtjk0XPyFEoL67YFBf0BKAB/2woSN7FZjo6/09TDgsj82U\nmEiKanyuJfvFSCPJ4Bzc8NfVshk/2GWyJdeAr77kAiCIe/M9qjj903wsiCGI\nG7VPYcJ0jpkZlA6LYEnG6j6ZO0Aa5WebX7kvHWBrHNIja7AIZXLixN36O6cq\nuGVESw1FiMb8hani2RH5uKKB2mNsGjV5j+yhsUClSKs9LQq24kHFot0B6DpD\ncwEPYxGLRMmhFMvL4DsXa1uLWHDzQR5r34vWvnttWAfMEBjHPmvqxGUhTDNL\nW74pgBUj1hOkDHQnwIKQHpWoTLgGypm98/ep65pf64o38R3gimbfoJZZaIw4\nvIAa\r\n=D1Ib\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHP6oI68MHLWulRObRzCKVvLqR1W2rQ7anCOW4vOvfBcAiAQUXlp1QcgRQRwXHx9F7YbduAbh2C3TpMi2Sdof+AaRA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0_1594161536824_0.7288523326886667"},"_hasShrinkwrap":false},"5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"24bdcea41a9f488456fc8dc388f404ce18ca47d4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ROc/Kp4x6ZqYAdmkMaDLZod5XFWE9Cx55v/O7Nwckmku6By91aOYu4LKk5fMo17J4KFGPZyHJu5ZAW7DO3sgEw==","shasum":"e2f9831bad8dd7ae00ba57ad9d79ac6e037bc594","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0.tgz","fileCount":39,"unpackedSize":184033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPnPCRA9TVsSAnZWagAAdE0P/3H9RRWZYFaI+dQgoOOo\ny5gbh4b6HIXAV637dqfLq5u41jlH6EQf5yPie27tP40Vgu7gFC2GjjVBbtoe\nVVp4uC/8F53VZk+ZwfZgNvNLmctKR6PExW0DehPhi3uzlYYURdgFrrJ2Y+b9\ndR7N3HxE/9iRpaS3hj2HAyZbZMFgYkTzZWio6+Qb+wEMgNTZ0fbpHxHAvS4t\njJhqBgd+2Pzk4kLyWfc51gxROoJjcMyXzrjgoUVPigH9eOfQy3EgId2ZhPHk\nVjVUTL7LKCJGru92EJvYS+CB7b/z5Dq9JVVjfspc6iH2Da917A1lEyGPyAn+\nUdNoVootr1BML+zRQuueF5a0MWXla0Qa+bT4I3ErNv0ro9VQbdqIlrffBzc5\nKRGivuWfOvtvDvldvxFjOLYRERmhzdo5IyifMdV01uppopXs3GrTjCNIIHHb\ncoeBWOlUdf9B73F0RH2Plcz4FiE1Hf8ndvCLBQPYE6y3IdywBXDjzH6OzLoF\nr3zK2UZEyHjZpoQEZuDlOweyhUByoPKiRGmTWTP/FhmCsa9x16yXCeh7md/g\nhfd4Y0CR/t1byZbBVjS0RUnYnpv9NATZx8dQvqy+8cwJEuOVmUVzhVN7M1Nz\nvRrkMdFwhOx6DIODJX5eOczqOAkdjaJreZjG+dk3cL/o4GCPqv7qpc7EWSGW\nUpD+\r\n=SBTX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqothtpvGQu3ecDM7+2rAlFlnPhBXa7z8Itmm/6DfDvAiEAol6iutOIuiYMw9h7kLbtyzzixMEQ3tiuZNytUkUm/qk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0_1594161615211_0.2354458801268906"},"_hasShrinkwrap":false},"5.0.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.8","gitHead":"08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.8","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FU6oNO2oplcQetli3dy/C/pw5uAOzCa2/aGOM4giMrlYfH0ibMEMav/Or7VaqzUnqduPTv8Jks++WLl/dHDxeA==","shasum":"dd846032a7862b201665ccb0d210d5eb21b31fd9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.8.tgz","fileCount":39,"unpackedSize":184271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPnfCRA9TVsSAnZWagAAb4IP/0Q0Zg9IDHsMhwGu35Uy\n2XWbQPxubRWCZtVitp9U2YPmFB/CvtQPOEe1A/djsdcV5Bb/QX4E6Vb2P7Jc\nYk3IPGTZlzQLinWU6TkHemIeFbX3IwUJFfuHEjmI4xbipMbGJFpewj/H+7ho\n09cOHu67auWQ23UMN2sHzqIfI0IeM5kOx2eNnTbcrF0HZXE4sI7PPOzP6HGf\noWNllNyce6hTY6r1l8VUenxPuRx3eSn0zzhHzaXz/B5lHm3nowoLoDuGlrUm\n84eDZiQEOYXwpU5eTXw7GHCXH4qDQfuaDzk3T5YHuJ8QJLoQBW1jU6RMoA9m\niLrV8d4hRu5i1YYb/MrkhTKTtyg7FHXSYt4GI1H2ZHySvprqBRmLZoixDfpx\n2aSg6ZJITBQ6vHSJCROB227vUpjFHra0ozWGTP+nDYgB+h0sKOJvK/uBDMqu\n7s6v0UD9XWsSXEGmNwSvghjPI8/+n3HR57hEE9/xyrLSj1e4ZeBb8favthDu\ng3RiDezS2y+gao0TbsMsnuos9wq+0ltZgxC0Ty3JCuKmzAky6NOBA2qw6J69\nsU/uZMOo8GA728IABHjF/xlTDtpnc1NgZOkD9Sik+ENxP4tgAAgatfIDHZre\nhIKH39cB8L4H2KZ39U8qCLXWpAHnT5pYkZC8R0kU1deGqVZInmYpY0DdFzWL\nQ/tO\r\n=kRvk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuDC/yoxAZLZO3FAY02nWWTnm7l17+i0SRwzG0XwyQQAiBXcTnxu6Aa3X8V0oa3ZvM5sOwUSVe2VuOutxKry9xorg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.8_1594161631294_0.5591847142934518"},"_hasShrinkwrap":false},"5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.19","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MmkLMg4a5IXc6+bp8wHTv3FjLIBK54DSQvrSjhKs/SS+KAJugwNHuaYgDVA47+DFh82hE7b0kOow42f0mAaf5Q==","shasum":"ea94c0eb5a13885be4a3ef0c1ac933b1d9d58630","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0.tgz","fileCount":39,"unpackedSize":184314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBPoOCRA9TVsSAnZWagAANgMP/0WGL8b1mthhrx/aZ7FV\nM4JczYmzZ50TM/e54yCwv2TvEHRZQuTXZNOKBMi/Z6drjxrv3ld0aOmtXvaL\nxIeTeIEo6k8VqjCG4EPdTs0WpnaK6MHfBKpxQyYnwIXSB0bfjwKKAVxoclwT\nD8r9SDUt0T8gz5f+OU86EiBM6PvMTBMuSOjIsb451EdKn5TwUUBgoUfPHXdS\nb7A5fCy5bPqunBXu7CSQ8exJEuPAim6AdvJ6YLyjx7r/5CWr+vLZH0ePadBp\nBck2mMo1XoIUdr8sj1uJf1ZpOqfDv5oIiwRIK2CdVDgrwmmeR1CWAXp1zfa+\ntpf8MrndNxgJ77kHlkdTiuSgI4P/9D1zdLqBwWp5llPJ7BRaVIm2CQqjv07m\nboktHu2Qu23KAiilrAZBs9q2JnlN7oxbBDnARVl+EhR/VFo1xDLfxS+sbXmZ\n7CYdTXuwvH7BFWe9917KS6sKivqzdP0F7A1fYUZ84TkRXvtUEtnXCFNCLS9A\niYvWmbkJ7d25wHjBZ4zsfgoXuEHBv0PSxu877GBJD3q8NXyM4YBVl5tlPE+A\nwo3urVIqeFOfrN8LOiUvM1OyLgmeaTo8JJMI6fCjUgFQVArZACktdyYhpgsN\nDLK7KTcQDWZLtocHEBJMqgRsdb1SkVqArbOAl4WMGdBDsPpmqBuYSAAJg/J5\ndbPa\r\n=bpc+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCddWUGSGyEBH5sCiGxyCGwuZkVfipuJW+OzhpPfl1RkAIhAN80dOlFjVyV6LCdOa5JlKv2yCqEbKm3SuvUKRtdDtnd"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0_1594161678066_0.9158284338274707"},"_hasShrinkwrap":false},"5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0","gitHead":"a63b676ed04d3ee8985fa21b8cc2e74335d68934","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jI8b+HEegFLbUyXh60aHswBW0EClxpvpUUT+2aPCbQNm4n1+j4V1ADBbl6wWkZpMXcgVPIo/uXEJWitboVZGuw==","shasum":"431bb6a280c7f3c403e8cf044ca26a4e0cbf8933","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0.tgz","fileCount":39,"unpackedSize":184314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBiwICRA9TVsSAnZWagAAX+IQAJhn8ivHLZeCoZXqJhlm\npi6gx2+E4QHMTKFUTYHeX04Z7/R9E9K6FzXyEvcoUfIxtX0+FSRdLHA6XIUw\npwkna2KKUELEeCvd2VTLk5/cJ6ht2LYTNa/54Xs+Q5wKo0yyX1ZAD0FJ9EKc\nMia84mD4yBqbmyM9VlN938y/GVTZ+QBAYk5tKXB4EZN9HRGzPUnQYtte7B/6\nT9TeRW6aloq+w/1PplW2V97Jf21k/zOvLRtwfFe1hCqyvpSRcD2abCZdgnRt\nFwUYHi7xwar7HqZl5QgJK5X8T3li5u+bH4LlPpIPVG21zOAHdJ1YUsCa0mom\nMVkag7MXHdSuTYZ4hxOL2X6bnWTiIbhcjAxouQVVQi2DkwXO72/0wpmzlAiU\nZavHLrpZpnv4nQFvMJ3VE+22x0UOW7md5cJdyM8BmM8njDwGUFXW85Ng5a/T\nd0ycpy1cswL2j/Pe8Tu94jf4pij7El41xVbyOSG6LZgFo7EZEjs1H+jiis+j\nhj7N8lXvqr71xrp70qMgdwpIPks8HxWZoumuiyGayMBFt7TNbr1qOw7cuZPt\nWjwkGvT3rYWUUdypLghCbkIiSkxJB2lCJLhIKdVr60lSRjMEXwUCcRdd3gLw\nPUAVoPBfGxRH86Q3pNtS5OaCFKx42O9Nr64qCuzLw2Y2I94Tr/dC2YGf+W81\nv3Q6\r\n=xo9+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEd3ELRAhQ5obH91o7rc0mbBBuxFy5ZqM7pMGwIw7mp2AiEAz/ITA1KEbpU8ChrcmrAyLkw4iOHcPL3xXbQTzw1EdjI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0_1594240007894_0.9704054726633993"},"_hasShrinkwrap":false},"5.0.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.9","gitHead":"5535a3effd66497c657cfca3c3964e78beb4afd6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.9","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-D1j6Bio7XGWodcaLbcifM+zmAmCo/sTzAKxNfMu8+BL/0xGe9Bl6XBI4lrn7M5XjmIJKvk6xqUJmmh4k4hu9cQ==","shasum":"360f682a819ab8c0f977b2d782ec80d00259f6dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.9.tgz","fileCount":39,"unpackedSize":184552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBix6CRA9TVsSAnZWagAA1lAP/23xnBBUSVeRjD26S7uA\nRN++wLz2IH1t6QhXE+7FibZiw0fa8fa+6Nw/eaf3tbisMr7pXB34jo0KEZc8\nbOEwVpg1jqsJKcSJyW0BQk3RXpoQISfEKAIKjN02S1zlh9MYCjMwl0ik3vYc\nVewBbTAvCq6JCWhwXEq+6XlhtckpGMMlfPIgiXvSPUEk5UqVy53F+Y+1opKu\n70XIKgcdbDPQ+2uNdUht4pBY8oouD2RLVR6NsmecIhMe7qcdVIZTKsZlrM00\nKNkJ0Bw2P8819f93sf1hrfl8/+opaV/XzGSpGBR6oK+C9hSAAog6md3ngD6l\nJxRVyoFmv5f7InMkOgJwd6Cl0Ovqh9Iwm5+l9JnG/sUgFc/JGyDh8U6fhH/f\nSHaZ3SXU5wLCtGDlZpOd2XrKiOvc6EQAxraaY5cNOBqecNGd9hogucx/tlL5\nDg136NesA5DKXLx102iSyA+ErvUG4w/VhaXOe9q9SWsEBUPcFUzYRxN4eBIL\nhYImjv32DYJ2MHuE3pCbbRvGDrAdp/SKeTP6pDxGw6bPMci9m8Qe4QB628sZ\nGlo1nXRM4XSkQNc3TNF8OR9kpkUCMu45jCMwAa1EdGexzpJm7Qhg4QRx4vyg\nlYZLeE+47NYINDXp/9T2HtrKfAGQxi+loV7NFU83uaJtUtY86suMxNiUAH5O\nbrY4\r\n=g2Gn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT8MBOvdTqmZJHCi7+vW7WwqeqX44lUEHjbIVzOP/MtgIhAMfoA0jRrKdTq6X2caM6/LbsTOpPJ030L9TsxQy2oO0u"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.9_1594240121876_0.7466261076332392"},"_hasShrinkwrap":false},"5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-L82aNPXDbrGlxqJkboXBnHdpWx3pa/GK/qbicGmwPieX853PkBoPqMuzuqRuDRiC1ztVVIziCR67MAw/ERwg9A==","shasum":"337979328f5a90b578d370ae4583b489c5705caf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0.tgz","fileCount":39,"unpackedSize":184314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBiyOCRA9TVsSAnZWagAAmzoP/RflJHdl56rtj8JwCefs\naPucTvKDyiogkpjw4c+3fFqK2wpl9HwChr3JGSHauoy7oWoQYCPcd0w+J7CU\nRnuzUUs0Qa49ymEY3Q6S3LMRevahuSSnoAss6lgAzkcM3s/RicUS53nEVxV9\nNDs+scPmY6RaMIJMTcqVkIobvl7X1anEcGdyyYAABfrsAuRYbOO3asT/8S40\nThmd4YL5x6TQ5CWI040NSR4y72AW2Ltu8dJ08XCx8rrNIvJC2EcX1ISfp8oz\nKwU8T5OZVMSi+Mbkp0j+VyPjuFCN2k5jbjiMggRhya/uSIogS+oAbD5DG4J2\nbuPMmnAo1Nrv+FTrDXp2si7nrh8JilLnWncV9HhwAfi1LJ48FrbbFc2Goi1j\nnd5STjp+HF2OWU2sZnFLZi2zT2QO9ydDcIpNPuUzT8f+qE6cXtdLZA4UvU30\nNczeWbD5a4tYlgvuQovDru52T7e4aUoep6LdmBpYrZjnZvn1hjAnSyP6VKrf\nIjIO28/LBniJwgWBdu/zmk7ZclbRYS4WlTBd9WTyZGar/Af9hYljuMGn3ygo\nVfyGOxaZVLGUSh0eh7aHtkSUfCzawufReQ557eM4ihdQNu2yh+6863fHp9Qz\n9i5wLqTNc7WWjgdU97uWOSs39rf8mNyUUVlONmJQIvqLntwpxdvcQwLFvyJf\n/jiE\r\n=Gx+x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvVU3X66r/n1cvuTbW146WR2EQcElAFcyOvyPVAz8KXAiEA7dTlWdwdf35ZZ0tQ0RwRCsl+B1uYhNZ4Nk+Jec2YGEA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0_1594240141932_0.7184507048209483"},"_hasShrinkwrap":false},"5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.25.1","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5535a3effd66497c657cfca3c3964e78beb4afd6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zdu86qCtcbHAtrzY+jC6a0380UUnwFXt0sNqWPMDimxA0tighmOVLcQjocNaqi4yu9Fw/RgM662L/+RhXCORtg==","shasum":"9158a3159e8ceb1179cf57b7cea19b638497a609","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0.tgz","fileCount":39,"unpackedSize":184596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBiytCRA9TVsSAnZWagAA3AIP/3W0nLp3fc2DL/5YAxW8\niBErRZDw3BpFBt91VXV70Nc7TRerPJroIoKXeIvqK3Hld81zkvO/EIEk8mPH\nlsXdJvr80KV858E7rvaQx3eAvouEa8CjniLlHg1+6Ud4a6bhGSugw2Br5Pnf\naDpDecBf+Z/g6jbOc03235rgTSS2CSplOhllW9bGjz5VL1qcJ+3sbFcvZO2+\nzz2dpt8JLqf03a8O3PXSudWjwsjSqxtdWM7ETHEqZktjQgs6rHcD/ViaIuUG\nkKyq0k/UPNMlth9ixxEXecSa2+raMXJEaYLkpCWpqraI18WBlxpHm/aKsoeP\naT6qMpCg8v0oPcrK/q55BxKLPHgNxSD9gisUqfcrbqsj57rjQQdcOSYhL7zF\n+zAg9VqtaAQvjAdU2h9r/IEvD81uR2Q7E6kWo9unlivo0oEMhW608l8kCFeW\nlcvnpf6D8OBjJq6SDEM1M7I317RuSdme+pMxjQfEQkpmSOEF1iqhA+A8pkxo\nm5XuBO/rjeK3jsyRn5x8xawcaat8mkeyrl0sySj9xGYsSfax0BfB7hpfHFe5\nup8q4w3ESlOESYmXDEVHSwZRzL6PoYAsN11LPsJetEqIpv+2KQPHorR6JyBD\ngzNgQL2Zn2oIkJHTFGyACcJuoWf+BA5vODVFKINIS1oYPfhUw4Mb43TaFTAv\nwiBZ\r\n=8vXF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhH+Sbgn75H9AOoB432ZAsm6zC8se2NN2XSggzbVETkQIhAIFT3FVLT4siT8fXtx9Kkwnta9+4YUwsBKnWsmE+RLUF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0_1594240172573_0.14248046176579"},"_hasShrinkwrap":false},"5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0","gitHead":"fb4e208972fed81ac5ce0b7d710c003d2c63ed38","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZcJBbtb+NCHP+XbPW5ldVkUVL0dGVtdTsqzMdmluG/r1s82abknoZJ7W/YJBZvA5DpOQA8ciCy7W0X36x8QcPg==","shasum":"81b71366767dcb5b219457b2ada06cbfca85f362","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0.tgz","fileCount":39,"unpackedSize":184596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBk8mCRA9TVsSAnZWagAAfYIP+wZUzgjJ28Kma1SivHVM\nwUe6vYLWmHDSGgTNdc32cFYSLhYIpv2FRLK4FxGwe2IniWNYGpuXPkA/j1q1\nfo0vYtIw8SE9huUh6WNTlKTu/rQqsKsQ8dc+rJ8NQO7HqKbnhZLlcSlfSgcf\nZwkA01UjDxGXYb/S1L9J8OKECuEzdfIXkVDArCXsDM472mQHDsdAJEO6u3E4\njjvWzOambD5MISAFl0Z4SqqtvuY26P0U0wSsM8W03vIy+qShA+pfkYpsaX9F\niXDPe8gdwuyYL6E/q7bzj2ZU/a7lgjfew4+Pj/XVoClHPxfY08iML2qjPUOX\nqmauKqs3bdUL10hAwC6JjAQu9I2wGt6UWRZxRYG1+/GBzvyydlP5fxk6YK/t\nS4REcAAWPOl+JeMz+b5zPQOe0BjiEBZh7k2vFXHl4d0g1l1P+2u/6cuBmm9F\nwtN/Ta3mqZYZ6RSovhguVVakomGxjN+ZDgIvnpxzKHycQplW8qyG5xhePX7A\nOon+LkwIJMTKlceKtIzyBUtZmOKijwqA4H257aJdEuh2huxE7WshleCLg6fu\n1GhFmwsYf/1wPmdHIKPpwWViMPpUqzKpucXdh9E8aopNi3C3pSVrM/bdsiTZ\nxEwWm6Ecc88cNxbM2uDqaxvyZKjdygv8l5GN3FY/P1W6EKzNJtMvkSREbUlO\nPkAE\r\n=R7Fa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmBinfyeYywZwyatTFAfWgWUPij0iwVKnkWXAdOO8F0AIhAPfhHPTB9Xm9dMwUAa7oxrS5ylSPLHRUEVmCh1+0oo9C"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0_1594248997842_0.8213242250661981"},"_hasShrinkwrap":false},"5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1caf12bc033cb5ffc53656084d519dd7a5acb38c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-w2XpsrzWvL1OoV/8SCsz77gsd9h3DLLTfL588ML+Q/Hw8M7FYhCAZL+4do4/ENz1iTXKyDKTzac3K5lwRno0nA==","shasum":"80824c342c7a84ef05c00ab0675a0dbeeacd7299","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0.tgz","fileCount":39,"unpackedSize":184596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBk+DCRA9TVsSAnZWagAA1aAQAKRIWcdmwQHxzUP9BWyi\nAe734Axe9B+eoMFzP2LKUUMPaRoznQYyMWT37tdrKHxdJPPqmxu7fojjlYbj\nd799upFzJL+teRFy7hBiUFo82NxOpgQV14uxiGcf3K0mUFrJvQ0eVOeVuBBd\nhOQM5chZ3X4+9Hkp3Be4VklQhrdJGk+265X9ohtO5PTOq1MJEMrRl+x6KGVP\nladsAaRBGMeuLfBw5sqpl1uqrEs5iOAnxEfkUx8W4S++sktdi/MrN358eUYw\nZfLdtt1q81+HDy04PcYpd9KhxJjgOu5Xmueph5ePWb8OJUvGOxdN551Mv+7p\nYN7JFl9QUbc5POAKSFtaAmB4TwwK0z8oxog0LtL9kEhnsDzCHN4kL5VtxgZq\npvA/MnCrSi8XpcqXxKFbnziX00mbVTZmgO9BuRmIhBrlgUTV6Yd8CjP2xMq8\nElDN+xCOyr5za2bt/rSyqp2mOJRPqAcFUHwrcdwcyNF731ue+QJfKaiKW/jq\nILWafOmrA/W2mhyHfxBaJjxaA4DM8PhWZAfu+oCah4ECpYr5o9zCPRh3qrGZ\nUflL8r0SX0xVVE+F16YzySw0F+g3p+gWb2Um5thTxBNp0C//m7cPP9bfMjCu\n7NG9KEfZfPs9fm50bk41XuR+l3xWbkVS47xtt4yIPVan7N02ocqLRcZfUHPJ\nQb97\r\n=sU1i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCMyXX1DkXm1a9V4mKE2BTjTMi9G8KfKoMR6mkwfLhT+QIfEykRl0nacExP0CHC24JTnHLQuREK/dEWyZOsHTVmeQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0_1594249091031_0.9663180536957889"},"_hasShrinkwrap":false},"5.0.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.10","gitHead":"9c472e5085d265b2ea4181cc4825d2d5f7538f0f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.10","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-O2g5jd98mEPqa9L750ZOfa3myOVXnzGxizkNvX5d0SBD1cCCdao1nKj7CQBsCI5vEo659ZUQq9d6FkJ8ZoATwg==","shasum":"ab760391d49d02cba7c529a25502ca04534a75cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.10.tgz","fileCount":39,"unpackedSize":184833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBk+VCRA9TVsSAnZWagAAKkIQAJdVmalnbVB6ByNEhdpr\nUrZWnSpKcZOJD8GYOcINUmW1yOHwuhHurL/mv0xh7QNPFACL2uEeaIRi/VjG\nId/7Cx564fvYIHpkAadDFBOyE1G4LwZL7VxR3RvlSRR+c9rhkKFtbqQTSCFn\nczANVrFHaW7JiqyuucWYTVa9dSCiKnJipNQfdrk9o6isJOA3wHj4LnxLQvrs\n6+zzPI21Uq9o7Qe40Mq+nj4rEtYMxqE9iXLiJXi8/TI+X4O2vwmQZ/Nw+P+L\n4XDvRt7nXtXdrHD/lYG0nDNuMe1PAbdpmDSmTfkDttoK44gnppKPPsWEgNcc\n7+t8IZP709jGHQAU9RHP9NHj2HI95yhme1wWApzNW21zabDRrMBO2GGgyIHV\ntpXUttZuYtqXFxT88cTaXlT8FNg4klfyZw3CtKwL114pzEZ5W+9ZB0iuIY8M\n80KX2pSnAA/i0nwQbwriEedx4mxDKdnUH6P4NiFZ8BWKfcrbb56fEN2nFaKB\nz8B7BvAUazOI+48fN2pabFRPo0kMTmbidVeMvlk6qKdbior6o1sLZN8B5j0E\nH9XM1Lnun0UEs9PmXjYHexGruMfj6emg/1XZwiY8TszQe8z1sfWE2rkSxz/d\nU/GSNl8Z4X/OyBPPi0uMcB9h4Ea0wt/OhzREuIfqzEKRqdKHzw0rI+eHNasS\nPgdo\r\n=BTf/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMRfaCflddUOVNBJ7S3PJDQyuWaavlkIc0onB8WAMpIgIgGlWF2492Dix8hxITbvV34tQW4133SC1rCFO7oSjyuqs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.10_1594249109293_0.4004942276113117"},"_hasShrinkwrap":false},"5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.0.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.0.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9c472e5085d265b2ea4181cc4825d2d5f7538f0f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FiMe4uBh9jCVtNvlvkP3G4GytiXQlfA5wiwSy4ruPA9VW1duly+JfhhD1eMLmNb+7DJI4FJ7jDhR/orm9meF5Q==","shasum":"cf62ef6432eb63a777639efe788e3eef991c88f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0.tgz","fileCount":39,"unpackedSize":184876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBk+kCRA9TVsSAnZWagAAicYQAJ+gVcoCjkISSLFFb54s\nmPhu7jUOFsjugg4l0rlAMpznHM/WpBPmFB8c7Sc6MuzFJnz9JyQmj1RXseOx\nx4SEwBwUTHrqQeVksJslVX4DHyYsZrUKi5vgEU6hyp36MAEYTAG8z2oQTZdq\n7GMjcqmtaUf7681i0m9yaLXbOXldrwGo0306c6U0XRIunJir2nEocIfCczcr\nJuZUTnOpnjGM92ge++8y+Coev+p97W+hK49RISl7ogXNG7/BAcxUZKZBy97j\nd82y99OV+nXoh+sb6Aq7VMZgdRaxe6jvORH5d8C6HoD5QR7j12jTKGt5ldit\ntZoc5fdEiztsIkcMvhiEDIf5qcYiXT6H34tLPL3zrkmTXE6wmIRdMEhtCf9x\nUXv7O+g5jc4pwcdZ2o0Y7MM44Mbz5mVEggLKZAOIjy5aVNHJxXvYGIBgfwxk\nZGlILicFS+YzSRlBCIUPZ1b26BdVT4Ikcg0dQJO6WTphH1jVm1iC6N7EMtGz\n0RhvdBRpWQ5ioLNt7lZjkGydQxl2XoyXXrjrCjT0wCj1iFQDV44ig9KioZ4p\n+3fWM3F5WjlxvkzHfCiKYgz2fvVSIE4syO27hBYXJZOQbvLhkbLAfalonbBX\nvz+nhwmsXMkblYZM85QyMiBtpErXW6HsTv1PUyyUk2ZbSVgkgKaDNqbSPueQ\nhL3z\r\n=rlPR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBKh/u0vPQ5U8uSRgROGmzuQNE2PrnWpQniI9HUG1d3AiEAhock3NSK8SE+wwjots4YzBkqOd9lZ04CySxEooTTu4k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0_1594249123750_0.8896872602804149"},"_hasShrinkwrap":false},"5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0","gitHead":"377f3cf2d11515fa47784df7b1bc919febc9a88b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c6X1tMchhzK94u5X78Lh7c3yB/hFeq0G0/3gattXO1uXMAg401exIVJdmiwPu6FveBfeSndZpuivZjz9/1mSdA==","shasum":"6bce07ef5083a02d8a4cc9cb43302eee92241b70","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0.tgz","fileCount":39,"unpackedSize":184876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlMrCRA9TVsSAnZWagAA3cgQAJmMW2dGVDgsc9QhQSuM\n7QvvZKPXSRj9cIARkwdPpgpLmUXMmdeYJL26tgsMtHCGR0dPD2Bzsn6esDHy\nm3PVpd2ekLp61d52Sa3R8S7LsteNw8f8D5ZbBJa381WXZUCzyDYkfiDvQAkx\n8J3fpUljrv9q5FesNyE5zRtbdUxA9z7ME/EOEfrWe3H0sZoo21LyEyYgArl8\noh7M3HnWtjQrSMDDx6HYPRe0jdpdTDIpeh9LTGGSXeRRSif2A/rE92qdkpxY\nU69myHmPVR4eFiCPdp0VCn8N6B+ONkv7rWh+Dwq+PmMdJ7yPmDgY7IUTcGh/\noBKQsFxNT/tKxkAOgbWMHWie5313xl+8ny3NHP2gJwG1FzImE+hHIw/mhe3T\nrv68ev1PbiaGKvCwLJT/gz4awGfzAZTFqtyaQg4WcUA6pGfTLzlCHdUmQNIk\ne/bMhjPrqMlMEkQzpePZzX6BaInKeQj66fpzzfCtQZdntAdGz2b6nEzzboEd\nQZEXbQcs5FSVr4wbWFDCbwMjznkIQ+Wp/LIQiqTOOUEE5givhJZE6cHvclLJ\neRBne3h3dCAiO1p9BdgsWqlqw5i9ZmMd1J1zxnFfJZfzQ23S3PmdIkwl2PEI\n7tX439zMklczXJR6CZV8xRadu8e8MN6fzDYlAAno1M5DgIgTPHxvIKoJb/O+\n/+AF\r\n=fZ+s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7SWoDtbceFgiPJNcrGSVNSuYSMDknhqq1Cf0YmIDnbAiEAuBQMnfycAoZ0IAPTVcgcY5P/TsTBJGSVuzY5U9KRfLs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0_1594250026900_0.798516138392303"},"_hasShrinkwrap":false},"5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"00dbf082675ab2cfc4ce7d2b1b6090dd878382a0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FWS0WMeiPgIpg9zgv0R/vpbL0vzhybeTwA5ehS/h4ravUeADICR+PhKWu8iAzkAlgIASLl7yo/G8FPN1NH6oNQ==","shasum":"18d9d8159278f515999759e1b055cafc95063415","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0.tgz","fileCount":39,"unpackedSize":184876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlN3CRA9TVsSAnZWagAAE5oP/iw6Z/OWHTtEih4WFo5b\nkpRyG/FXla5dZNqelHgatO9Na6xTLyUNAdr0ihMCQwypHhqbPndEJBFnEZsa\nHib7ceiaoZe+1LPxR4gl8zuEMR1Qh2oAtXDfvZOb+JuUUmBy7Fo6jpwtFfx5\nKLd8w4Xw0u0XncMbGmfItEf5n1KMlZ2VoWnmGZuTFq1KyXHD4lIlD4Q7XjAm\nvKiOV8gh67t7V9OGsEqh+IG2ZN3+Rq1UVudYvwu0gpXG+BnqOF+rBKLnBSol\nU0CclyJexNtGON4G2EvLlBmb1P1ecS0iuxvue/kUrYIpUuC3uGBvNzlIfX6U\nNzvFi2amgNh/awWVG2Is0jHDzRl+138VLAs6yk6+dR4FiD6yYh0Q9hfBBGnH\nog2l37AYLTkM2Lwho8wFSGRDplbd7x6N4ESUNQ41o/jnEnuxKagWkP7j3IeD\n4pZCasK1FCR1QafBjg1WHaDD4n84gX6OCKPPAa1wM6BUnD9lSR+2uL3JV99M\nsIkugmBo7B0Zl3BbGEUlgiaK5zqdrtJVPso4lSVqKQqldMu8B109imM9JPKc\nu0plygnx5YTrWNyb2a28MAIPpXGiqJiLQU1mt5U3P4NL2CMhbX1Y87vvPbrO\nJc0zgtBeGieNG1ddsPGInlGklxain7F/u5ctFDnV5cIGUmMoJvKdVKSzGfPk\n+aGD\r\n=yyAY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOZP3N8s0ZT8JENZcWahhtoTeLpdK4NXjqSAPWSI5ZNAiB0pTgFc/WBGiYq/uWmPqc3M6bjS/9Rjxwo3MUeA/wmLA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0_1594250102696_0.6020534755078766"},"_hasShrinkwrap":false},"5.0.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.11","gitHead":"5d303ae37af10c4726f17b3ecdc7b8ace6e3399c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.11","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mEVaGMMDDj+typChf5hAek2H26KhoXVWG6J3GXmUAtAnIM+ghEuov+kDRlbWFofQcneUGGkhFIa550Pytt3jWg==","shasum":"e257a5f947394c63747ec7b47baf4408a6e1e2c2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.11.tgz","fileCount":39,"unpackedSize":185125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlOSCRA9TVsSAnZWagAA+JYP/2y+CxWe5XUqHlwbWiU5\nHdlCjEhs3/jH3No+myqjhszaQerNrAwT0TLwQNw5pKffJidqYCwmnlN5F0A+\nP7fH6ufq5IGow7zoIyTybs4JOgfOTEZJ/qIPxxtDAos00MJ/RDK2GGqebaC5\nFeet4fpq5I4c+UV4sLX50dSTGh9pBQOhflLhMQtp6qr2jjGvqjcH84hJ+5Do\nGV0viDI4aQqylpHSSLygwsQ35p39641rz0js+Hgh03JOr6U3rj5NJmL2c2NX\nO3uZQVYcn/dFCIumZhWiBTS3/9luD1+k33A7EdGENm2pQpRh+Wftwsa1vr1R\nvHNBgKdxbeXvBeAr0gSi4zzUJcPQiCk3KXvHyb150PHOMGYL948WYedu8mAQ\nO9YRGxqahskzbi4CbpPXcXAQVUlVLiMyjdsBoN93KLmN6NyKUUI7RS3GT9w+\n7nAr4eVhsjGteVJPASnt276KU1zkUgbQHYsI0YneL7Sh45ummIz+cx710GFm\nrhSA8KGbvicpHU4xt2fdQbGDoJ1oEsdW34hXuxeMMWTDO1LNDJVH8Lr7bBNs\n0UYNgJ841TpyEgjt5Q52B5Hiv/tA8zBc1E8HY8bk7DV+Up+nKRNNOAxZBTPg\nwvjyJnb8lSjAibRc7mrQa2xZ+xKDobJlfYv8nZW+hNG95popMWDaT+FeQMZv\npf30\r\n=1Q5m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3L/6Dp4AhnQFxXMzsMwLkqGtA/jIZw3neKPc5XRDXvAiA8f+Rx+ux3HzugOvkOTV/osrT6LMUlQ8rG6p8dXNUyqQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.11_1594250129649_0.8693725993636239"},"_hasShrinkwrap":false},"5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5d303ae37af10c4726f17b3ecdc7b8ace6e3399c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vl1gXmF0zOQgQ3psB+FZOdDGZ1yUGGaLN6aLi/OBREZAhp058rpThw/swKfJYHp46BoTvMqf8ct0q5SJO1nXIg==","shasum":"1d69a3ba6acc861dad4082d684701a364f84b42f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0.tgz","fileCount":39,"unpackedSize":185168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlO9CRA9TVsSAnZWagAAf3QP/0ZeOWZFwDOvflrqZ6r5\nR4gpN6orRr6iic/XXrygiFxG9yr9/d3vUtNbZ08tkLLiu9dkJREW0gkCcPsE\nGb5/DmFKcjhHLs0uF6plnCd1fwJyANIwrfcsu9OcIy/aLcG2SjBhvl1p7Nis\n1LcWK9Ia2teqJV6i098w2vtro7iwdVlyNo/JO9S6NhU41lK5VhBuIgoqwr9C\nlQaB0zsMRg8frRQVKrTrNjMjgOgXvSh3t9/y7cBJ2g75qOOO1ZZRTaidDJP+\nDeuNipClf7PsazlWqFqUjNYSfdygyB0Hjk3UaXLuuKti/PEp9/G7H8gi+MxD\nlhWa0onPe6KIRF/JAWuW5sfGVU/DWIaJ46P2FZqVV8K6e8o9Ahd8g2xT0so4\n/Tm8Z7d6pniV6ZfmE3xF8h4S2pVA1ij+1bCrQsqOBTm3muDLwHZMTKeVwJ12\niTPmRc+QV2eZOpjq1GT9QbVMVT+M93Uvrk2aJhqBfVp7LG88bNF4KSG0g3lg\n/6irs3K8iGUNbNhb0PcI/2saIVG49BX+DgUInMmC8Y2axxYXfGCnPdvTylhe\nXLwDCWRHI4wFsKrUQStirLW/eW+bDRVnc+Tb7kuvbL4LO86wPC/A7yRSLZRE\nn1n5b2U4jXbRtqtXn08fViCtpPkTaNbhUZD2DV1hNpENSxTZEMDQfwPyIZCb\ndmUT\r\n=c+5Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgc2qezj6IuxihmJsgNZZ14CLtAeFXHjVv6nXDJLg+zgIhAIONHD5bzOD0ltqSLlaXdI0fcUa4YVLKeWvJxPSRTPfz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0_1594250173396_0.7659975288552614"},"_hasShrinkwrap":false},"5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0","gitHead":"d1092dd868edc452d94e2185430f9ec8163508ed","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QZc/5312qTJL3qVe/oanN911Tpz4RzCpZYRYsQYKw5hhWjn+e2Ze+UqCjqEKUijdgOSk3U2p18UjwrIViAAYYw==","shasum":"ce8fb02b4adf4b071c0ecea2eea0a1f6b9d26c07","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0.tgz","fileCount":39,"unpackedSize":185168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB8c2CRA9TVsSAnZWagAAV68P/i5sQGvEfbumGWRdCi4Z\nNRp3rSAS38MNV54JiV/O325sjNSU2BHqXq9QHy3yBJMmx8ZCw/ir3hHzekYY\nzZKtcI4v8przXLplxrmQ0G3/K/Ob6aVQxOxkAJoZa37UFt6BxPiZzDG5FX+z\nXj/vDa/yT/n6S27SvkiXhhR2WAL/PWVC+rgjD5F/WWFi63jUVKGLZPIUASlO\nPKwAfvAMu+TDuxIEeoZY88FVgw+Kbm6WUJK4+WStncT16cPmCX8ZK+wPUerf\nKaNHM9rjNEAp/788MQ46Cb+85Jng+tflfzdicsRqjrXHVdhI9Vr7LkQgYNNW\njv9Nv4qal8/V+hYXs1/2fcM4YH74Qq4i5u10HY6hfOk1h7b7b3vNLrhDuvtD\nrn1lpKBAKR7WK/srYuBE84UWYsZhGVutzVgirmte5jm2T419skQkukwCjxE/\nc8SFRXo04UK0CkExaEvx+N0heSA1U2knjWZGf4NsYCmhh8JyOksX8IgK/m6d\nDb8mzTVU5a8vYC6hetYq3ng7gFiLQ8B+wG0060j73Vef+esDMDT8iMfiH/mP\nF1/OFLVQgfJskrxlvT7er9XGSwX8tNEZTGk9hrKHYmSqZIgSDM7kSz5PX1+K\n3gswX49ZLCMAWX99Eim8pbU0J5DCbtSPtuIYPcS9yoXUMZ9FA+hcOBhkFWKO\nLICy\r\n=ZzRt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClvR3KphIyiL7EtGVUNwx/feKJ3N8x6Bag13kTyUpbJQIhAMgZgQuqKTLDMEddicnOOJkCApxaM8xqcqfNCHNVegPr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0_1594345269996_0.1744813358287698"},"_hasShrinkwrap":false},"5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9da21a102e40ff32c499b953de8faf150f30091f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-NadsAMp9/DJ901cnuvVP+7O+xHQtNfyh0MclJ8mfHswMK5PH7Pl6ULIiYX7HxNvdXYUmXl3i9zSdBVD/2qjFug==","shasum":"4a78da16432ae4a3f9ff9b4475483371f1fa15a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0.tgz","fileCount":39,"unpackedSize":185168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB8dwCRA9TVsSAnZWagAA1FoP/06PWhQiRbUdsJXHv+Ux\nwQ5iakh09fKOUTbLo8FIsKpCV79GVz7D2rgURlLNxeW3ia9ythZOC59QgYQ3\nkdxr8Ik3yRSYjOy6uitFTqY9jc3hagaAm17Bxqa8uguGYR6RcGxhb7BZeaLt\n7Knxa2KbqaGnc3AJRqgiLktrH0fYnlR+dTvXZ10/+6SoOjPTPVcho1MvgZso\n23Pe/sTF8r2du77IbXdv8BZi9pcZub+wAEWJ79uRNccY8pPO3YAkohDd0Dep\nQDzkl/Vz5qSGb/thcFimvqmJV7rOLxLte9Tmw8Y4bqnvY9JMb+d1esKtIrnw\nr1NaZIyohbHz1M+hkqkkzHSRIha3TY7hCyWMtLb7D9yltvDaFo+//PPbgC3v\nOlOksyqUBnVhcIv61aJrRI0iBLNUfS+XvQsdD5UtFZ4ol7vE4fCceHykqZrq\n5Gge0bG0n5UmoUcL/d+kOmZ7DnCVxuJ8EGz/FLHB3n83y4b0EHw7UYkOQR/S\n2RfXpuV/01+cH9wuVNTMFncXQucdeAg1uxZHJT5vIS2OJcgjthNYwFT9YItX\n2oRgfOwqPK82Ud4u4BA+RflqQJu42m4GEzyXZc14xGogaZ/sMkqgLCUDQQE3\nCte54gpVI3mDBunkV4iSMFdIMBnsQml+L1sp3B1KPfJaXBkBFi+ON+gB8run\nAPcz\r\n=sw1z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXAnTLh7WWVBRVfcXND+0uJJzyedZz/m1e4U94KpDGRgIgLUbf0GD/BAz046KPgO/Ym6Y1kRaaGD2BZ/kopH/BsrY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0_1594345327572_0.9571306847232286"},"_hasShrinkwrap":false},"5.0.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.12","gitHead":"d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.12","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-I51b7gH3/OkIId04lSHtaJYSSOZ+6qHlSG6bPWfkfHtO9zqD58gmPm86zvzyG0bLj7zmYhdzg1/heD5qSAsqng==","shasum":"31b503894142523e9839cb6c300720b5b4369b97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.12.tgz","fileCount":39,"unpackedSize":185417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB8eECRA9TVsSAnZWagAAxwAP/RvqGSGpmgdaL8BGHAcE\nZKvGaS0j5b2+KRW/yIjPUkH0ffu3TgptjmutGmI84XK6MYo8G8iKBFJqgAaW\nmUdVJske+ZpPwIO/bgobezvxZerZ7qEGblPkhdeumt0A/PS9RTS+G4/7A1f3\nM++rsesjoUjpOfimO2i1moXKFI+fkXQEWJU24qQsxu0QpUxXCe4vasM05Ncv\nITn0hGxFyRid4cUUbDv07EMe8zXqBpxBHThrTwffoA8GJFQPAZxo3neD4Zkk\nrb9+VvgyROLJeLF8AQC1Z3pxAJZWQTw1RiyMNY44KU6JBFI92CTGpjtdDPYd\naBRTltiNEVktzrPPeMcAyi2adAosKlRbypLexNMMXdebKPkN6RwDKOjSeYcX\nTtkIJCBmNUkFXtSDjv53JKMDfTX8tAV7VcjjRvfWSz18wJYwY2BfuquGo8W0\n0VOYPj7Frwm7jXK91eEH9maVMz31zlUGcVibfOCHPyiVt3PzEdvUVYTMaOnk\ntxQ39WAfeFyOJuW3QNhxOlia/ZNq4ER/OoA0/JsklvkiTyvlfgbxebxJyOB6\nbyq9z4VklvbJDx9FgGgIiem0ejZ5i8/aVRILR/mKhnuI9TpFoaj3zBSNBxsr\n/ulnNcXPbz9xV/+ztDMn9C3WMQGfSxqTnOPF4KEmQ0NZjvEPiJIDFGiG4pWr\n0XbT\r\n=7Os8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0ggnHbdXHPKEBUgsSn60nWAhdngEQhX/MkNnRMOgu2AiAagiF9OOLKwek8m2MUj1B5YXaS6XpnJ9p/xuhfO+IyCA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.12_1594345347505_0.14058294749001066"},"_hasShrinkwrap":false},"5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.20","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-UVhbpOuhLQkGjgLBAAFhdF/8L3W1bAnbOOziWW2ebVqKZiUhYMUzfOd57GpgPdrSOjFCdix1cqYFusICuztICA==","shasum":"b06a37caf0996f6afec3a77b07dff93ad4d37eba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0.tgz","fileCount":39,"unpackedSize":185460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB8ewCRA9TVsSAnZWagAAaSkP/2CkJnmgkD7FtspS8jrT\nVz0gRIidhS24btZAy8m4cSfUtqr+afznKqvJdJKOIXXXw92fzkfFn7wDy4aO\nGyu5shpErny3a5fPXftCQiM6jnRsy95XtfHqky2rcD1VOQSsCGr4ckvNkAKH\n6AappIB5dPuwoXZmdg9HsjF9Cb2+cvKHCWS4Jts36Hsl7pWGOHevJrNipWAr\nGkTaH4/Mh6wFSYXhz7GzT8CDRt+6SUTff0hWQhQnJ6Q5/vZeOZUqXT8YjEle\nzgDhr3/WrVh+FhXHoxZCj74GrjQJ2SI6Kvm2GNS484/EvJu+IDblPenOq6+5\nAok6gmGuYCAe2Yq77VrFT3BMT8aQSmy5U9v6V5AuUPoYY9YGiCIYHm08fp5j\nlpbwIp2RBvQ7zeOPTQk1/KxHmf5Tl0+tyjBFWVRw8ntz1pl668vgWnvbXpCH\nO+V530kgdrIPDp1LWcNmuoF26+FA84CMdJGhPRY7sazoR2lKaJP/NfgyGAPK\natCDY0HlHknGZRvWn7eD7j9e1T0rfsRNXbXDkRbbEk1OEmCzspZR3VU+RxFY\nRBXb/2329aQ7V2kzrp8fZH1acdUqTcW8e6EfWa4bB/K6IqzRo6p0r4bsoLhh\nQfWj+S1kePeNjZcC7HML9N3W8gWV0+WoQrDmu40U+TuTfLV1WnjdCu3KoSIG\nT7aK\r\n=YCNe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOuxrPaE6+au05ZhBjFACE4+Wr+rpK/jAKSuJK4HchoAiAmri0y2mk/A3vTK6Q5pAD345ZjBWo8pexl8ohOfrZwrw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0_1594345391610_0.9634300952786188"},"_hasShrinkwrap":false},"5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0","gitHead":"a5c6e37c1a6b7284e6b58678dfde44262a59b10f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uuITTNFmqcOSdatkug3OF97oWQzbjQ3USQgcWYI4e7jXg50CKID+3uCl5tzxPfy+Y/e75blKD4UdWmb+zvDwZg==","shasum":"f39154b60e155e52245538b0c817d02dc91d7cc6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0.tgz","fileCount":39,"unpackedSize":185460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLSCCRA9TVsSAnZWagAAd7YP/2cpRq1xJ+im64KIBetN\n9KBjxKSPskLVvlwMBC4yDuDdOiALrmDLf8tcPzxrhvmtb1ZBzEjiUCaGQycq\ncIlTdWZ+z5lympbTD3jjT7MNrToaTpB/h7sWYSzT2VknsIRWdC44VsUitzCT\nKJtEeqbCWDuM15IeF3qW98XLxMG0iXAYpDBovWlCJzpTjATj/Snk309+sjD+\nNMjXoh1A2ciFsEqScmyaxVkIqhz4/HIzf/LT7EfF/kJ6EqsUAXktSacv59cP\nCqgeveCeIBBcbccW5pKx1Mp3ghYGUn7Ct489Rt2E2a1sesx6JpmIedlZ5F6Y\nljWx6+m6Z680WF2jLpBGPfsyVTnnWLn4K15FDufkP8M5R51ZhPoKZ2abYLK4\ngBGhZyFLAnYuH4ipAlvU7lAS9KetMN2M5SZ+3kRH6txKBtDeTBZDxznVIg0E\nKobKLMA7eWqzkS93elT5QLUBtg/2LrBbYUvop3WZ1r0en0hDlEU98g/Q2zuj\nLzWa8E3gaPLdGRVpb56f3GE1X9sGaM9KsUOM09kGZq674k49h6JNE7Juh5z5\nASOJyS2hdzBIQkESawwirIO+XETXHtBE+4pjaRzl3ya8WHJJuk/Sn8oxss4i\nDD+oU37p72fMFkgq6zZR1Kme4qSP6n9hOExKhqpk0suICYESc/E+13C1qCGW\n6zhR\r\n=TZSO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChIjikVocQqXc/29C8oM8IzDe6CkJPuWv//t0ngf5SlwIgWbCkiF+lwu9P2UEnL7Sv0i761vmiqQ4CXAzJGyGpmR8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0_1594406017817_0.9371302756992106"},"_hasShrinkwrap":false},"5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9f108d2be75f5e25f8731a61753bc61364ffe3e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GWbvZyNUGysaVUNe2s7hrVsAsS63wu+qKflXLCgqOb8b1cTsTUAR4GLH/O9PQNhDd7bQCV+AshjWx1VAfJ51mw==","shasum":"d78e4c1ddcd9a6f92c1c22e0541ebd2c2c5bdb5e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0.tgz","fileCount":39,"unpackedSize":185460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLTSCRA9TVsSAnZWagAAOBgQAJj1rlNXjJSLiLAZyea5\nnU3rD8W77LRBxfhmSq/bqLZhIrbyD8v6CL/qzg3HS4/d2E14q9YWL3ro4Wnn\nioJwIGNfqW3kUoRwvxnV9G2AMdoYSL2gC25pNh/uxnrBcE6Rqv4xjdAz5rWK\nqHyRSH8KRN28M53WVt61L0XR99KmaNJ04jfi0IUHYRq4qY/t3CG4AgsnIgIi\nthPIn71J1LdBlhoks53QRMbC5DG5tlRHDYKMxcVBT5QCmtNuRt8gYasluMYY\ncDaxX+yHDGQcbgo5zXj3wXV2Fux0eDewYVOwGeuYj2DjbA7a7Wu08wMLbmKt\nOW42zX7macYcZ/NTJyJ9fc2OOEbRHhwIjdNsl/RNtjTWJELTiXXCqldpkTyV\nkzSB9hIRiZmID7i1n1KaK3ro2NITZ8q5lEnkSUrTnHQtLHwQ39RBn1nNrd+T\nB14aWO1mi1ZQHMPLRHGj3LTRonfsgRdm9ywZ4BTUFWMnzCBowkIbWr9CYXKA\nXZby/r3EyhKZxzyI9Q3u4FWmeunVJYhRg5B/4sskbyJymOgArY0++bC6DLjB\n2THygwFjwM9A8hrjPZ90c+BHNoI1/1B5NPpuAEkxMo84wdMBS03cVuAMkp1H\n1UaVenJ85JAZsxJDxpF7BVgke6SZCzmYQj7hlGUk8d9JY32vQNbBhKvEoiRa\nIPLY\r\n=smPH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxsGr28zCPyLBNTQ7W3zUuOMfhJuVnMtjNNUMwet6NbgIhAOtkv+5tWlCNA1G/xtmkmCdccrPt9cw8u9lz/2tnjGWa"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0_1594406098121_0.35025234461200605"},"_hasShrinkwrap":false},"5.0.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.13","gitHead":"84f363204263da63b5af0656d6e1cb4be37433d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.13","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-SIL221NrPsOXYlen9kCjVJV8aK22WFamP/arIXx4Zrx8KaBRA/Z7IyXj2y7VESleZDICDr/owBPvqam0aqQ7Cg==","shasum":"ebbcf0532aa27d9396e2a628572563ea4ef13dab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.13.tgz","fileCount":39,"unpackedSize":185701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLTvCRA9TVsSAnZWagAAiEgP/34t9tRV66ln6VluoZeb\n7G7mC4r61Q0muPHilOw6IvDTlkA8vLId7VTJYvcU7zfQhyxHxYbatt+12RbS\nNbBkezYZyDMZe6OXY2YTzobPJW9L9eQB3ijJTQzj8ZZ4yWxs4dwhJ/5EIUzY\nkRaKz5Z3UiKMQ/jBX/QOdm1QP6FJzia072IdYVSXmbZ8SOHd4Tj2ND2hC6wh\ny6B7XzzPyTm4y1W33psH8E48jk9/YV3XxXyI0yUym1Xjf+dg/N9vTQET7St1\n/Osb/NXxoiQ18YIxJKk9a0nPzvageMQmtcH4u+H2/NDI6C5OpXoILuMHm4p/\nNLH4VSIpjSnszIxVBDVrhPx53xNcQwrCShiscm89Lk1AgLiyjbBwZhstYxRt\nM9Lft8bXMugWlfNhu5VTykrY4Ghuan4Zvpxy6kmeXi+45DBeBEBn7s9d9G57\nclNdxRA1VIHrPN2btT4kSWZf5+lROc2Lg2yn359QAbggK0j68Gj8+WHFhALj\n5KdHguCtnygtzIRSK1JoWpjfHQKN4YyCja0Av1WZNyskGbsqAOe4GbrSE4Eb\nahf1f2RgfNcEXxopGtwOs39LM4igUxNtoehgz3UM/AMllPseJmmw1+DjZDkH\nwodoQU6jdLFvNP1dUGhuugW/7us1SdsmdgqrljRshpaGvo9197YIM1TgCtpM\nFcvJ\r\n=zeal\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHtQmLOsgHVJ+fiTwyiPN7gARDa2uO0q3MnNnXxi8KCAiEA0i+wx6wU7TOoegXeNR7w/ScFgpshsZdykvBaycISOX0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.13_1594406127040_0.9135865699847596"},"_hasShrinkwrap":false},"5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.10","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"84f363204263da63b5af0656d6e1cb4be37433d6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GgtedEVrXf3g6bLkiZBS0lpEH7BAsABKVmzvozBiHyi6qJw/Oxl9hwgWp+hfq5zWMR45Y8QeG01Ug9q7zhyZiA==","shasum":"99edbdf2ed4d117e53df5331a0437b0b07b19541","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0.tgz","fileCount":39,"unpackedSize":185744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLUtCRA9TVsSAnZWagAAhW8P/iTu/HbyCyQDb991f3Pa\nkIX0su7pCxetLwCskun7PL6LDjPTngQWMGmDz+H/eM0jqWAQRMUC8KDizaXi\nPJHrt0D4hHNcXbaCr6iIkrIMhmaH8UJfs6iW0V21fDVtfWIoGxkftSAmQZ4N\nxCcd/KeUOhsJe2UH8+Z1NNBtAXVSUcQwkIPEC4bGpZfWhyygEpL/nHvP5pgd\nmPfdnO4DFkDaksG4TnkCv3kHonQg4b0rJ4zxyxmpog7+suzanJ9j0PwPX6k9\n3XFJbNvGrlb2ICawP1X7tT0jtfSNExS0kPXRNrD4ovWbMT3amXVGQWeibpzr\njWHdsvgyzYrH8q5dl477jLRP5BvqTbaBhYUAVUm8NiO1fyL2uTjylcAJ4NSD\njeYfCby9Mdh16FIQVxvD3otl/3WBObpx0KsGFmTMctLEg4R4E4k2jTZSYBSp\nAtx3txlVlrjkGmHBtW8/PM3UYArJwSd81b9pRgnG/Zll8NV1YsEdoJQjUg+z\nXmjvK7fK3HOWJAzqG901eaYR5rodL8vSdlgOTFsVqRFIqVzZaGSadtdzZhu2\nfY5dl0N5Wk/xoweEqapQPPHYDlMGolL+r+rbWC/OgT6lYm8RfEZp7A8o5gta\ngUrFiFK9ohM6PNknLp/+dWZf+sVpVj0F2dx+qjooB13U09BhMCSCEbATOKX9\nNd8L\r\n=49/Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKAlAr7KETxknJTmSQld2rAaK92Fe5VCXEoudTKX+6pAiEAyHJnQo6JKJqQrjMMXJiGkyWAqB/8OyY80uJPi8fnPAg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0_1594406188433_0.788833814047905"},"_hasShrinkwrap":false},"5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0","gitHead":"76edcfcadba65faae27617290bbbf2bb91026994","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nIMEh7iK9NUe7VbJg7TFysX3oBpmfpzGknh960Nw9R3qCnt9WHoXkbw8NUXIeS6cm7lXJQqVcu/pmnvBlRGX6w==","shasum":"fb8f61b1dfe9efef2912d877d60dbaaabd4b3516","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0.tgz","fileCount":39,"unpackedSize":185744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCtesCRA9TVsSAnZWagAAlcMQAIOXk3J1kJz8tfva/xV1\nvXRX/YIeJW/IKR17GmqfNXdDOPGVQJmW0OMv/ymnXk6gPBmYIP4a1cVI55Oc\nIueF49fnACzwCKLvn3kOf570hubjJItBNYq/jDdVCztCj7ryzpXk2te9bWSR\nuN4BEht5TMieqdX6WuBfeIf+Y+K2aO7cBePMpxD0mxW4b5Cnx6vGnu8tj1hp\nFixjbzfYdeH9QT6h7igtzG8eUA6v39iD5B1ZPV4hXh7SRn1m0EGcxyUK7AGI\nSRwQF1bksb6wf/sigz8kMb2vTpIHQvIHCkatz3iKNFVKTcMcrURtcpK/taTP\n6XunPb6s+iiYfU+3Z+OFb6X/fMqFAs+gmDYk6amTugKruMysOuKODihmRPgk\n5TgJ4xY4bq0bfBCdarUUmsfLO9QMKKaUKNhpHjUYmM0Tws9bXSjRdsJi1QIE\nZ+adqKDzyWgnSroUoa6QVQF4xnHGReMvnSoHkJpeUAL72nwMhAR+BxZ1/ODy\n39gunZ6/e5tgfd3s6w2zGwES2LDGOvihfOI4vUthRwNCfpOLwEKcBgo8NhCM\nbh5Pgdq27oYT1a6a/oZ2jXeAG/Y8Nf53OCvUc9LhfIs79FM83rTNzQfr6oSI\nAGlq0OTlLfj89A9UMP82nWplVKtxDCtAcnuNyTka0PuV9ao5zWz8c78gUo0H\nUQn+\r\n=EZ4f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqUYjWlJ1Jii2CGEA3C+43xoeXP07+H7BqcYKGAEupcwIgE4v1COgR1TXQHbnAAjvz8HaDyDPDah2tcjv4tv3oRhw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0_1594546091511_0.4797801824728398"},"_hasShrinkwrap":false},"5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2c10643eda1889ebfe86c4e0bfaafeb96f5562fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QerK/2hoIUUAe2CBvcNY9dwFR7zEg9vuT6QibZTpK7tyesFxBM9mPB1ii71ARFf8BWPcjiXbKsdSUNsa4ZIDgQ==","shasum":"25bc8c06aef99ccf9f043ae89cb40b1c56e38297","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0.tgz","fileCount":39,"unpackedSize":185744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCtf4CRA9TVsSAnZWagAAyO4P/2HxJAxriDW9MBhRp6Ym\n+F6N8+XhR3b4MYmh94HnXk0/RcDUj+2LmGRTYWfXGf4KzIOILP8h7epy9LNn\nHBT5ULD0JJdhQyip8r9ZT8lTmzOgdoElsBTlnRHOapeEJtzv3cASj3pPTGWb\nwwKh1tPPb1OtDNOYOqEdiTnSOm053nnDFhBbbHBe5/3e8tQPhxh/hvorL0So\nKKl+EEWA69NwrWoFO1mqwsv2iVn1QyagOJC9s6zLql4r6tWphPw43mKpT7UE\nkbKiKIpPZpV5+AvHaNuUPTm4sPqgm28gZRBXXG98wjE/YZQROc+iGyXz9uq0\neBf0qcbhZsfx+gAhPu30toq7J1tpTWIFzgx6CDqPCESftQqGmPx0pSZNOpnQ\nOKeAVedN6/SZL6fL1poPSWfMSvPavBBzCrODM+TM0LxWe2rLDaaGsxKAH0lR\njLzE9XHwdsnBrgXA9REUIPvXW78uudU7Id1q85bRMDjsSOv8NsSChnREmgr/\nHTbWvnXvKq9Z4StXismqXLi6jaej7aniUYw5J6ENSKh7Zv6H+LH9LgATe0yz\nCn0v8x2TKsZxUNsrRhj+wH9K3WnKF+MLvzXDdek1XDmgETeqzhreD6UolI4V\nSHVsWtLWfPP01LqnzBnAkBdFx96/s1Z8cGjLUM1RxRsWl0anfS/9CWpWiQ4p\nv4zD\r\n=JuaM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIK17HerO26X+0wBSYGmi/gLJ9i+ESOmdt0qbxPgglMAiB0kVG4jJy6R7dAbtWaDDEqcsthNUTR/wILaY0+Nphfqg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0_1594546167785_0.35962794426711464"},"_hasShrinkwrap":false},"5.0.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.14","gitHead":"5eeb1c97ce2171a02631efbfe1366f877ee63c61","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.14","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3p/vv7+tLRoGRm9gI/N2G0NGfr0cIY8ee/S91QAuzh9MvXqx5m8BvTV+GklxOKNQwmv7jy7pNhqvw419islbMQ==","shasum":"da15ac4896b3d42060897cda773622d2d5f74b01","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.14.tgz","fileCount":39,"unpackedSize":185986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCtgPCRA9TVsSAnZWagAAAeQP+gKMhoab5R0gVjEEuD+h\nlL9sJIzVMLcgfDlnLU6PZR6sdedZoZ3sEpFN7fzX0SJNFQoUEiAHyZIglitm\nByrJfhU3c+tBk6fmMgkn86rsvB3+D/ug5lXuh31w1bbM765FuUqNUFrlRV8j\nNBFQM3iKoaNlXXmF2SfJ2hwTs/1e63K0IXJS0duZ3Iyys9B0IV8TTY3TuUi4\nBDUSetk1IxEqQwUqdcJeDCTFSO+2wWZiJhYN1dTEr9M87v63vqr0EJEIWub0\nSTSVzKJHIRI9MQnT/8uH5toIh4RYHHrWijm3ZwRLRdP/noD6GAJysYLTTUuU\nEBa3Cpyrwf9IcGd+y47qxayNPUoU82ixh6uUd71acj7ZUlJKpqCddlCRO9Pc\n2MpUvca46niIAGojpokCEo0cXJz5niju+xOphnZ2zw0mr1132IWQSvCSpnI1\ngiM1RfOX/Id1ArZ/BwNogqTnG9mcG6D6Mjov9hC65IcTNYA5gT5rFW22kGXR\nZOcLGoKBmvI23J1VfRU4nIcMnTNczO7ZvnTcJv4Bx/O2qmbm3L4N3rX7QNOr\np556R8VwGDLNygxA/4aow8zb+z7tNfHQPvKrovxJBrq/q9KgaT4PdvRicbrz\nVJAOwBqtgqiXFhx0SbooKcCYFGJ5VR2UEHcl3JVWQkxIn18G9cUlUg8Yvnhf\nyq1H\r\n=tQqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzyVS8U7a2wfGCZdPL+gs89EFsrrXUoppP+FCXft1SHAIhANd4Uv+Nkl+CZNZELB4XdZYjpoi0IAJjbkOT1usWcRVL"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.14_1594546190668_0.8866425741750308"},"_hasShrinkwrap":false},"5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.0.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5eeb1c97ce2171a02631efbfe1366f877ee63c61","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/u553RjJmnS4pSRL2kFXFFmFT8o41/OzGTXgHgzCIEJTcAdKBEePVbCnM/I3BGJAYPrNSDzDh6exfeNApRV9Zg==","shasum":"a036054440ff42e20f0eee4219ad8fcd09b60bac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0.tgz","fileCount":39,"unpackedSize":186029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCthyCRA9TVsSAnZWagAAdrAQAJ9cALw0er4q/ynmp/pM\nXkAiF4cdsS410vZoxXVzlR0VgzNSON2adwQbTDK/PtitIwyQlF8JGpaB+koo\n562IMCXC228hpYYLuM/WsBG3DtL0iGb1/N3e5QvoGqrV3V9hVZDU9+dIFr+B\nDoo79PJjhRRSDyfW0Ca7TyFWvAgJLWEYJnlsXOFWu/lfxgcTNp1GFOlHob2t\nEKNJAa4a3XQIaDhDaZz4lb1W8yptYSPJJjan11Rf1VDT8ICbpjeFqLZmPALR\noRBb6uhipFoyBfcfj7vGI4SVQvFCFvwCnXh0+yA/kuLEHkvaOTHOWmDqC/Vs\n9/Qh6HahCF+PWxh5mzkk1SpV/SqKz/976Ybt/pV406DIsGcv6nKgoi6AwL6x\n5GKTXjl2v715Gd+EdUTCHXyTSFNLBLxQwDWl/xwkxyyeiY20nZKj6cTA09GT\nQgzAB/FeMXpoYR/xUvTaODHbnySpYghp3wNdTHqNOFBLf2Gkz/RhLI8o0Mfs\nGBUQJfBaYByxc9mHrbhXowXY52cMV3BcUYNufD26sbpBUaOyIhJdrFzUkO6N\nD0+Wr0kK879m13uapeJvQKVv83pnErGWh3voYAo8iKlQMFyX+DK2kJ0XJv+Y\n/8hKSPDKEhLtkfAv0D23V7K8/SvXSFrosBuYfIfDa39iqoSlXbjJZa9FNgPw\npNTM\r\n=ygfa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIf4aVgOl1U7gG/0lJCi1q8rrCaLOeVM9+I486hX6LRAiEAj1+hI8yEkMYYLsclGZ9MCrtxWgHvaz1Y6jofA91gkl8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0_1594546289555_0.7138779095998955"},"_hasShrinkwrap":false},"5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0","gitHead":"df31511012d446d36e2e91c3d2b6e1d9f4bf2955","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-be+hLi/DS63558S2x6Wo2327O4ro7iucZJzBQO+zhaOVFzURTTORU9maHuCcgIbSXKOiVVRK1cKTdFQC6e5Viw==","shasum":"2eb1872f101b1f9fb864d5b149efc5fbc614c3c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0.tgz","fileCount":39,"unpackedSize":186029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC9upCRA9TVsSAnZWagAAJCIP/ioMMOvzGPFtJQXyv94A\n9UbDsg5QSsB4KG0jBQSB/Y16F+xaF5yJA7fvkWKZf5cQb1H2vx4lhAf0ow/u\n5cbRGAWiJ5WIbi/QFMx1NrUgryF5M+mMxM+thlU42P79/vxZUT96zVfaB7nz\nZ4D9G1qVYtCBSN4w9GRo97LhgW8H2+fFniuecf4rpN/lfBAlpnlM79BLftiO\n0jSGRaUymM1rUI4f8bV3+6oh0uqYZVPcYLVNrt7xgFgJq+ZuG7p2Fjf9yXFk\niV3laLfCLKkQUWIqDKEDezACMlb7qj9cWAcuupV9QZIO8ah6MfiJulbwFm1/\na5V0GvyHJpMIr/2Ci7lr9dwdtP+d0S4vyH47N9iS8ourDR2wtrdrtYhiRUaT\nYNiJaHID9aVFUlanRbhSULPsG/ngFokF45CKuE2Nh6gyJ6N/CsRrswqL3iOE\n0TSk92akVa/o+fhO7VEWDpJfB7B5wSrpHa+LdD0Jh7fOEU8LLEcBrAIPRh4R\nJYu9uGaV+rfTC2X/V1GWF1pz//MWCFA7rJaaNH/WtcJJRolOMjzxRL6P/gJo\n5d9/6pSFBMXxWakXu7xBn/aoR1P1IwoxTovh5GZKFxttEOvEzAhpEwsQruDa\nqlo6aORQK4h7XwBa5do7KVSR8aVHn0/Svk7ueCoLjMktD9kwmTYGBXD9Uz+O\nPZ7p\r\n=7ovE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICb5x0xooyonpn4YvfRA5uHn0aKEYLyiImXQE11Ywx07AiBfCzv36xHFfbJYBIPQ2dYtMUHCbSANkK+ZQ0rJvO4XJw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0_1594612649354_0.6677620571359377"},"_hasShrinkwrap":false},"5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"04fb0ba9a013d718f8d1290755bd36c47a04a284","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XwGwV1WNmSgbqXqzA9cmTzQC0LBDhi0LpnDp25gC12s5/pYKcpLpslj5gZubOO7KuJQyCwKomLxM4d/IwlBjZg==","shasum":"de046ae9b53d30cb34c3197e50a6beb4277f3c97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0.tgz","fileCount":39,"unpackedSize":186029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC9wnCRA9TVsSAnZWagAAuOkQAImJL9eRleNBbLJRgvw7\nkYnVMiogWTi3CTIYGzeYfZShxqxKJZmhlX+eRjOHlRe1pBzD0Zh4AEkfQAgm\nJXK436NOEDhSRXLToJKB4tOXItMfi7fu73SxgN0UBA85jDsPNobz+pE5DqkJ\nV0dawnm86tHHb2icwGfRKclNZ/cAKpdDCvjnn5a5mM4ObVyOSIDC/N+zSBEY\nw4xIGtQGilqwpWtVJkMkK1Ceeqt0tYJ4/95Z73dUypSe/4sfK/fTUF9jciLY\nrUwR6h1hxG+KyRf3+z4ON8iaHc3oya1qyAipCtnT7qHxgWrBE8XCyWP4SeSu\nY5Nwyi+OM65tkB8quRH7gxjpmTnkk6S0AU8tYnWIYs/+cCVuTeIaAmflt1RF\nSy7cDiO0Y4Tj/gHIN6G62D9vaZTrcEsW3pzlflptTfxUf1yHMWQWBBDZkqgD\nX7PqeZ2OAx/fP05U5BAEdI2gm4UzIqb8LW/Q6BspLtDDX41UoODiIX2Q51wa\nmQ8y6YqGo87Bv6wKPUS3MGQ2EHzzhfkbRv3GORDp2EFg3Oi3YPuQZ6SP2WSz\nhoDpu6rSsLQe5BDq5VFC//DtzviPT2GBLx6A9Yex9oDR9G+PuO6mNkbuzX+i\nGKcAA9H39dKh7eO0Yx3iy5u/IYg5AQJzVuhAz8yhIXVy/MJCITOPe3M5Z3J8\nN75T\r\n=Ln+G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDltHa2705F6iAQG0QbDvEZvvauD1JqLDhUgGxgIlQrrAiBynS/Mko3psEkcpR89CDKQ3OflDQXfI9js9qZYx8DhSw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0_1594612774551_0.02832743252253489"},"_hasShrinkwrap":false},"5.0.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.15","gitHead":"d9b519d7de2b900c746b17fed328c8c3d04c21d4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.15","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yJZag0vLU0wj5hka1c67DdGwAy1Tk01dMcagnOlX2SMZMLFDc4tld4XhiFlKKMQJJfwhIPnl41owI7UrkNSz0g==","shasum":"747182721ff9cc93ded3a2cbe96aca86a13b8009","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.15.tgz","fileCount":39,"unpackedSize":186270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC9xRCRA9TVsSAnZWagAA1/cP/A4n8Uc+mH0SRPvEPdAH\nKbx27GaiUV3cRE00CLsCeTdYRTUVpSHEvvPsw0Me91q3Qt5WsSK0GMoUnwxc\ngii+p84GsG2WbXGL7tiraI1hsy04vww3pX9Ol1i8tRFn3Z6AkMql5QS6vHSZ\nN+fFr/ZbKrKT3DAb5yI9dHtrV6mnFeY0rtOrh9vQHRFBdAn0PfJjOU1ukV2N\nMvq3/AqIBn4lNxYGFw60pieCuQkj9LZ5cqRqmhzG+UwxaEsqinr94jKgwts6\nzxyWPmps7C7tZu37yNhZ6OASID3c5I0tsHW7sLzHHuQOruhid1ObJXKadTk9\nEzv7Tt1rUYhM9uExzTBXyYckePThvv/80bE5zm7IeN6rPIBTP2HqbfFn1+qf\nS9icFK6+9S1ObLS6Wl7sIzwyHkehXLsPUtN/KoPmzu1goQNxb4CDaAQ0BmIV\n//hKN97XVdNkRpDZRjDvs9kH8VX3vSJ7xWvzoQiAgM3GfsDoLtHV1+Xeflkq\n3RLVN+3A2YNMvI49iIZVOSjD0qmFhgBY+ptyzwFPhtpJ9o7BBwSZ9yMf780a\nkBMD75tdo9Pa/G+/lHv/Aj0J4ed7i4sIXBAnflDCQb6IQjRChwkYGAvGV2xB\n+qbyKqYyU0QmaDCw+1Z/OjePj5QjnswCSVv5h53g/YH5i0SVwAfdYOxQ5z+w\nY54S\r\n=be+/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeTchKQt79yl9J1D12JBPmjr8c9YugLc/au7KsTV8M6gIgBfd1j00nix22uI0k9JQ2aIDvNSb5z2BTkbDhcfg/jks="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.15_1594612817239_0.873699453597818"},"_hasShrinkwrap":false},"5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.0.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d9b519d7de2b900c746b17fed328c8c3d04c21d4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BBi4YFQxQ6TEcO1TpKa3aqPehlXQp3hg34gdpl4jC9pHaS4oFRdGGiMGXMfCEBpFZDDP0XwZpRbV2zsoEDG+lQ==","shasum":"a3ca303f422baec32a3ae22363e665082733bf43","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0.tgz","fileCount":39,"unpackedSize":186313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC9yHCRA9TVsSAnZWagAAD5MP/R3l4x0XkMTVo/0aG5iw\nTrK1+quHbEWBWCTljBd03k6K0lnFDKhEjwjxLUfhA0+4x8SJqqF6wnQrRwH+\nUcATmZyCeyqQvIGAEAjTF3cbAHz4BYyPRm8AyunbNqnO7cZLbhaNh+NusPiO\nNaBWHiclogrF84RC4EGDiMy5ZiKY+L0VgBg+JnuitqVpjVxk55wCmFvpMGAL\n3lbzbDPpzT1B14t5pc5yNUbl2ysdPqLudEqoP6ZMCbTgpPqha2alSVINVLmy\nZMYHCMpO5ShdJurmQ1wIw6Byx9RRMUOriFWufqd0h0PiTsGVVxK6d2dJgd5I\ns0Ka0ILw4u0p4gU0wVQaUarmNB38b/Kq2spbKyqF7kTbDxfaEhC0+4HR5dCC\nekyB+IFq311Mcj4jJ9sOvIsVkZIqoHfLZ0UjJ33SJ6r1XnuhFRP+MwdDScuz\ny0kJQLHONE4RUp/GxzH5pEhc11ERavCK1mzU+GhfxnZyk6qGSI+hhjnlyNrR\noWeyJeC/Vkoc4gcC7DB1PSazEhwXzI74LOrcCNOIonaPwvHdsP02K9vnWGuT\n1/RSAG+rlIzQusbkI3fKkvtfbGU3lYL0qSr1rhmXhXIITg+EDLI9UyVm1Jir\nXO9f/PVEykvzXXxwquqKZR6UQFv074rCshipQOQr7A/5ASX7dcJfo92bHgNH\nuSUL\r\n=Igfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJLyxcKU0q6X3uhJ+ktMKedJzzdbSctPBD0uBct15AEAiEAsLhh2ffj3zsfJMbJXNbLE11Lp7KzrsSPu3/I51f0oEA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0_1594612871027_0.20412755919410186"},"_hasShrinkwrap":false},"5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0","gitHead":"b3d92aac65e1dc75180e37f7efa474a0b4c6b340","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CKE33FZ1aP7VpxQ8qQVQ7Ev577kTSblP+ui3Kv5hdPa1BkIfMVTeNV1oXW2pHdze45lvQ11vrWUeiUqjE0rtsA==","shasum":"94db3c932c2b276f0033bd0a205991d731ba3833","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0.tgz","fileCount":39,"unpackedSize":186313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC94xCRA9TVsSAnZWagAA8VoP/RwIeB+ePXrYVFxx7dEm\noU83zaLq26WWmkzdD3jP3MSqAaLq03VP/coqBbnslAklnot69gUkaUDBxC8Z\nKbgXOp7k7cdQWKgxrNohKSr0Ke3aD3etq84N3x8npt4Z0xWkDKbpY/BQajNe\n3nwBYE+dwN6Tmed6MuIuV/F0HPApgQq3Uc5MhLtNwxF08ZG1WtI4nsPiOE/A\nttf0tEGvwaP+DYJ3GKTUF4J1kKwjOscqfMdpZcgABnUH+qqeYR1k8tigTeVV\nFhx1dThPUqYEsZniGGPCXDx5HUcncrBMQb4fIV6q1dHVTImJxBKuIVNlOu1p\nvzNqUWaChlQBZuLJpw8b9bmgXhEuKqxVlQIJopxB1GPTyP2/xY+XtlmJkrfB\n3R5ob4Jc5cORCD0/SxIz7jd9ht0N0jgYnFc9YMQHf7sA0alG710mch6B8JL1\nGHYM2RQEZKyqQwOE8FzIOaHydt7GSRR9XMtSeQXeblyF8iWcmmaSz7T93HCi\nGBeQI05qDNag7itECDX7zA7wTMpuLS92lsjHmx9MQR2pD8TxGjNXiDbST4dt\nrTbmknEJ34yfR9XwIIHQxDV2mRABEbZTieGxva/XWumMYicNO5VifP9+vXs1\n/jplPUsDiyHboRu+U3uUrA8J7QreJ8zBG5/P9iHjudJVC7e9K/2Iyc+/mCzt\nDyCp\r\n=cuWu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsxG3n2urSFzOUAEQCP1QW4c68VR6LJsHvmLzRUXMc7QIhALrg2LIPfuljOCHm5L7JxM55bnvCmcnV13wD51BCD5qz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0_1594613296606_0.24190682988103474"},"_hasShrinkwrap":false},"5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bfb12ae2e62192d86460634d4545fde859eaaa46","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AuFmFr/+4aoSbuBXLjigKV+33TH8qNBh81yr6Tomah9zZ9Lvk9pb5GXtC0UtGDQdQdq/noYw7ncA3HIX9m6RXA==","shasum":"934cad02b657dd70a5e17b3d95bf9f00c12d5de1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0.tgz","fileCount":39,"unpackedSize":186313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC96PCRA9TVsSAnZWagAAiggP/iFXfvHPrtmhq5Zkig5g\n8oQZ91m8IHidxXz7HT4WFM4LV9+pweiL6SVR6TI/ad9MWefe9apiCe2npINK\nTZYAOOr03Sv1L7U8KDaRDjY1HvRTQSOec/C0PI3opnW8z7GY4sxn//12uFNa\nzldau9+BzkEB697tehEV8BozViXLiVasZDnQV5piF7F/YwoFAlIsjSHL3wBw\nXWKR6szYwwbg9CW2QnGffXFGFyA7HDgbep+hdoFA3lTIqQ60TchT1ygSELyX\neovxHaBbXJvTA0P3zn10ErTDqXuSqJ7mOGFHZmN1ltUq8s7Ti7iLQizkAGHI\n3OpGp98C+1t8GZUnvzu54PDzSBY++A0DeHhWfHlCF1lnxbKTigdFbb1xZhH6\nqhiIH9NBWk2EROzss9idJKz9nC5nDXw+ZHLjkifPE0QfQMroLIGSqcWle2cd\ncNutSKrh8gwJrWp534RhGDP89rRfsmCchlSz2dFBCASCDJlCn8H12dFRU0Sl\nHIv3YJt8BTcMn3PJV6FfId9djwmRZNxpalfl9ddIcv2Vf/U+z8WiDH2Cu9SP\nb3RAE7NEN9JEkQZ9YfSXyGKER2Tk4Zo8JXM1ydPJtXJbcxsYK6OwWnew3yI5\nS0tcejbLBvCp8uHvc+OgQDSpGjm4F7jktnr6t44WMpuxMUlfuRTRIKGw2ePB\nl15i\r\n=UFLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAd9emQiFsLMs+rex9L7KWZtUp3UcCRMBvpQvUgKF+qZAiEA80YMxfH9XD7sPIm2XmKrDYFCqQt+CGlzsCriuYGMOnI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0_1594613391412_0.16437075030174464"},"_hasShrinkwrap":false},"5.0.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.16","gitHead":"24f97ec2cae9cc981c4a764651088a2fc5a1927c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.16","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9dTkUZFmV3SamDyaZvc0EQ1+ZZTiFCCvxNgV1SqI8Fne0oanvKeEBwpkq5oyHxFQC59dcWuqFhYqSKOhObYWkw==","shasum":"4171d1fff8276bab9299725f40b00a0e8d047f2c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.16.tgz","fileCount":39,"unpackedSize":186570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC96vCRA9TVsSAnZWagAASm0P/jOYZvhM4+rQODSXkERR\n0JMPX74mC8s1zOP+O1bKcn6KSUxGbUzjtfQhY4D1BCLNaGjEHvgkUAkq3ynW\nRlBa+WclUnkzITwney4E4Ifm9fBNigXjPgjukk0HQYZhsKRbxdY/PUK40i+o\nXZ1N7EWy7qji4szzRhnJdooKjA8D5jrPp6AlZFvYMi3o8CfnfEJ8D/SS3/V4\nliZza/dvN8vEtdKEUk/NSNuQDLiPMlLkpin7vlyfvyYN8GX/jnbFiUbE4ckk\n5xpxCN2013TcIhJKcbhQCO0FrMOBhbP6p4FhPHS0OYf/UZX3VjcEEr0/EhZw\nJHvdFhkqPEhKO3IrgRJWjheNijrtTS9EeJghIo4wtoYMXM1ZBRIRW1Xy2mGH\n5R8vSw+4SfEj56ulpJPhKfohfpqcMXuw3X6UVMEiaQ9HUUzr0HK89jeSzsKH\n5HTyJEHIG/Q7Fw/jwxBT60l8YPAbz/XirYldDCRiCLkeHZNnQit3rXum6YgL\nmR+2b8bz0LaamhLzDDe3HBgahjUEdZditmWCiUFLzgFcAh7iql9gcBMJckql\nC0asyWqqLiQ2K2vviquvlZGMJSYZQNvBA8j3Wo+UOo5FnC++laT8ZEd2/Bjv\nDmjaH9kG5gM285YnPeDnK0xXRHaRBr9OMOHctP1hyMr8q9tN7rydRZKptRJo\nG/JG\r\n=XaCP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4P+B7pqcik915gd6s6zZgQqKmhfUuB1jdKJnC9g4C9AiEAzrNDbIQDwyDFiokvtGAkve/QV5KkAECxIM1vRswO9x0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.16_1594613422573_0.19195980841236104"},"_hasShrinkwrap":false},"5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.0","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"24f97ec2cae9cc981c4a764651088a2fc5a1927c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wn0cNS2LOeb4tLenJDnX38qNgsoTc/0Z9ohowB0zRkENkBth+1VDTYRlEsztyxP0p+E+bLd5fKnCoGIAOeYN9A==","shasum":"5e5ae2a43e4b7ff8162ea274b4b75f8251ec0202","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0.tgz","fileCount":39,"unpackedSize":186613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC97jCRA9TVsSAnZWagAAu1oP/3j4KeXjuCKgHauw5eSM\nKVF+oI7imHCE5gi3lkX2WuWfQG3e/FlmvkP6zbGlHnIqnF9yBfPV8sndfEG7\nH5bnNzXZOI/xaJ0CKEBRXoQHadwpco4Sqzkr1dOIcEu6KWyac5GYvpRPGNnF\nKB96K+wGG6xpESjkLqhtbnBKlzYjIUeo6nlqZTYtGqEvt5GEtbdaWTioIcZX\nb7otMdYLqcEgmsGkLkqnf2CvzndPVUiK4heyCRqnpItwFvQStYf//y17kQ6t\n3soEDk+BLWipA8pEeARJTKyBJ/18rkfDtMD97d0PfPY2LEsFWWuNiF/W1Aem\nLONfpUm8zSPUYO8s23XtqQn6UE/ssWHYk+wUa+Cd/0Kb8V/7TVKtgM7U3iUN\nZ3YuPqucozdmdZfH3odK3gvIqh51eQ6jru7S9H2Wr/qYk73oTYvVN+hs1oxa\nr58GoYvrBL0reXSWB8iPIe2TZSB0FRe36ndSJzj1qCcSk8BzfwH3K0S8oWJH\nxKqn+tdYUmTjQM6IRddHG8lXME3gRXpNhJLxx/8EdG5hlAHbP4QrHmT9OyCb\nw3aY/dyPgE0TSHjEOvKzoh4yL5UfItmLIVrl7YQw5dHXXY9tPW6aFCoRa9Ow\neEF5+YcADQbfGtF3rsXKwDOVY3UXUADvdq9nInpucCYnAc77uqQ3AFlfXpHY\nC/i4\r\n=668Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd+wPYuFQLPAF0fEyjw4duMs+B6q3pCaqiBjJjO72JRwIhAIkXAY4i7kifRN9VH+3mnh9AYz2iH/I7Nf1C+5FovkCQ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0_1594613474766_0.48261926597393257"},"_hasShrinkwrap":false},"5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0","gitHead":"4f0281a25065a3ef586bed32889678139539fcda","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-CzbIOPRafh75T4hi6wsrnzTMulhS4ftwUknEiq+Xn6alwWDyhMQZaDlwJhRRplCrBusZeICYDe9AruThOPnj6w==","shasum":"5b4fcd80c587a2119771c3bd3fc48fdf0cf17851","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0.tgz","fileCount":39,"unpackedSize":186613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKraCRA9TVsSAnZWagAAg2wP/1ExHnP0Ff43Ix9eiDVn\n1UvPipN+c4nmo5L/qaZh+4rrf64J5tz0WvD9ZGvBCVnw7tA/zsphIKUa1jJ0\n/OpQbzPYw6SN8i+1dHm3cFBmzWjJDQmpujHDXFBUJAhxwlPj9zC5KxFXFKK5\nrlIimeFliZy+xOx0F9jKGmHcRuKoxt9j99VVXmoD2LR1c01r61bVnlhQYSjo\nSqd7bW3DKAjDN6VVC0xs2TPnxss+THuNahVC+wm6Fue+7AddY+5wGX3CTdHX\nmBlSiCN+/Wu3C1s+IrlDsnqBlgIFm8HirFKNvAIxFymiI3/djZQFE6IxB8WO\npoLoNnl0g1mstQrj+0A6YmCh+s8kclCB77gaSFaa5XEKJm6guLxV0q8b2sGf\n6ovE0HgtmmxhYlfEpQBm56K/0BK4HzNFmAt0cGFhxPIBOaSoQ/eD5aW126Cb\nQjQIK3kwa5MHqP7whNVhKH6+NCmNFNr6IsYDZ+xlMA6A328fDwqXyePLz/05\nNiPf/E6HqCzkWMZlhKyjCfuwRtWelFJOpOx+tKLsSynLyS6yDr90wWpwmqd9\nqRDhPsGryAIj0OWdYiHlf86FaVS3KPLmIVLevkIrFUeSIjPW1JFa27oMGvfc\np5h6AQNGfyL+wgH1koamEvuxqIWvBjc86y2Bm8w8AhTLr/Fni2BRgyTDPZvm\neUsy\r\n=TZYY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhQAWUCOBKXntrhBvQwQhI0V1/XkJTjaDggc7xT9Ff1AiBEz8ubF9mh3Xd0pJwbVQ75YO7928lSftU8YS+dU4ZUcg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0_1594665689993_0.3006123573041479"},"_hasShrinkwrap":false},"5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9ce04c1df1fe48c5771b452411cbe05fd1ff77de","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Xut1sI3JoZDHjlU7eJ7qEC5vaG3Ka5UdwKMr+gjtnzInfBAx67vf5AUzICWJlYB1WVW9T8eLuPZy8kPYt7u6WA==","shasum":"6302de8b50b218d47071466c6239926c9dbc46ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0.tgz","fileCount":39,"unpackedSize":186613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKs7CRA9TVsSAnZWagAAzsMP/0KphXqUFdSRNM90OE7p\nrfO5qOmtuSwe8aRDLOonf1OPI8G9cd2M1SpTXWs+cq7sWAc5vztaSIETcNW5\nPEZ6pJA4o4Za0ZG0gYYsD37zqI1ZX7g5Ljs4I5+Pafl74uBuRZ8gTjus9NJi\ncOw9WM46PotrU2IxYefz9WNXVR9HNN8v9tIDXYwzbhORdEuVsEwRqidkcbMu\nFRniJ5V0ycDbBLTSN56RNOBg5zm+YznnJGUw3SKN+pNLynQBzF0+xn7vA3qQ\n331zmDAhEBUTG2WgzSSkTGVQZhQPKeijPaqlgmJLHF2olKA+ap9oAzK6SsrT\nvQg4y5f75K+Z+hr5PBZlxLJfqImy9BPJFRoEF0xcjXOg/JTUkzwaBPXD0Fkk\nBEQxSo32andv5nXR26C/4D2X0yeVkdaHY9DP7PS5ShMLzyliJIrVRkLDWFRx\nu6zCeH6YuBifDpvVJpxlw/blRI6r3fetM+zVsshcCNbwbGHLUMSbu3jR2ouK\noA8rRtcma4irXC3huSU0UqQEgLRxLjy8qGl0YHaQTe1XhzuqAu6L94sGPM1w\nbrFxsdf1zlCYbWETIYjVZtjGsoSyHa2gfXIypyTiA9qXNY5xbmarvrjJIzmd\njMn9Gk6NOZGNelg85ye+9tN5jiboezHWYHuWykHZ8bCLpG+E+wKpKX0NwX6u\nciWX\r\n=qBe8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGs3zMsvV1YMHtWv7xiaVnXYBkT1HS98Qw3LruK80uouAiEAwGcRVe8GAzd35GClcwIJIlQCptf1LW2eG20/Shk0cc4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0_1594665786758_0.3212302811072856"},"_hasShrinkwrap":false},"5.0.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.17","gitHead":"62060035ba2b16c5b95e7728ea1ce2eb76d4da18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.17","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hg93oql1lE0kus+6P36DaGJ76O6MMyAg/Z6QQhaWDcS0RcoZI/j4OXqjYCG9nTYtJufUCaBTP/ZrxuvBVMCd3Q==","shasum":"49d1a78380953b64292421dc0457058f9c91fa2f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.17.tgz","fileCount":39,"unpackedSize":186848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKtJCRA9TVsSAnZWagAAimMP/RdaKzw7QTb8L8S+ow+4\nvgWEoKInvUcfevEI3XqiH9/HGX9qk4/G2T7rbqc2l/WB3If28w+/nWNaJn8y\nWB+5uzmktJSX0/8VgfUtKpnm9wuBA6MYyMbKBEf00iE8bAzrasBaqFKle1RH\nSQw1vsxFw6zhvlhFokS7J1kADRSLi2AZVA/J/h8gk/tsovIL2J3MmuNzHesT\nXYAFxQvB38MB8r8UtwG+0AMLUu7bRpMeaRLLWLZ9EYVVlFTqlOCPdaIlQdLq\nll/ds4XU4FmELYy248oDvPQOMFtYIaNkkJucs770RxlCjOmxT0G05fR3lbO+\ns9yrZVibsPsjETN62XkClurSJQF2UowD6dae7284pS7N4PL8y4eMVWOQTODd\nNmV6LYK7o+buQaQpKV9jBw3Zger9oFmgUCaPyX6Hzn4DQGM/aLwZ4WpFJKsP\nUmU1BjWA88kN3htBI/onKgkupSWVlTLrOI5BCh2rV0IroIPH9xtqH4lrZMMG\ni4m8cSBt245vmQmfkNaIdEkN8zcJbbZj2VtVhLPR7fpV0NNa0k0N/egfBgt3\nVaQ7PLxI6dKkIei9FAYvM0KB4B8nlIJdOuDxY1mM56oABzZ+C8xE4O4vJ9Iu\nkA1yUpLlnxfu+WIJceR4+4ENkj1a0eO+s9FGNSztpvH983WUws8+9wpsn6Sf\noWWN\r\n=mGUB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY09A8AicTtY1JlTZ5DzMlW1e0uTYwcyip4izkbAbkZQIhAJTcO+bqLrMEXX9/mfiTgzJu7g3qInhHp7BjNcZYkfXH"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.17_1594665800704_0.5410614699947125"},"_hasShrinkwrap":false},"5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"62060035ba2b16c5b95e7728ea1ce2eb76d4da18","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-flpg5gm2nQRbmn9bFrYl9LjJo9Ckqfx8CI0h5rfsOf+/zMqaxw1eE1CK2bK/WuybXL7C5Pmmj2BNGoqZB7WEhA==","shasum":"7580c50f5297d8abe95bfb9b449c730a7e489944","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0.tgz","fileCount":39,"unpackedSize":186891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKt6CRA9TVsSAnZWagAAEDcP/0jCE0rXy7SMfXqvk08e\nc1dih/46WDIJpRiW+yECI2QF9DyLYizstxaabPaTYsZLRnUc1ZplnOtZkDy7\n9TemP4KenY0sLt7qtIlHhAoeI7ZuqG1XOz2alR1CTZCbZxt0IDFvrhhKK0ZN\nIst4MiLZvnzLsMJooOgSjo0DAnCkn6Xqv+7IkPwM1YyutnGftzGPuz8tsL0C\nExgx7Jci+U52bbmus2wJMJ5RYN9bAvpcM2C60qrRsRwkV3M/UGlfC2gjbyMr\nKNwyeMALxYS+f1VW7hzKwp5yzwP+59LnlJAKFTfw8UuuMnuSTsbz1c8wO+j+\n3L41qZZkboKRKVMVdI5PpZJ21fnAb8W3o/op6KRe48wFNTPLJrc2ZkOgG6Ts\nEBW0aruogYKWw00a/oxnbQCyHVNdkr4ClH4AWaSZHF3VLrlnPDX2e6qkrHym\nTywgTJaSMVx5aXnqaDfOCICQGi7Ny7XFRx2+R9/J6Pwt5QsTsA3+DgT1OHiJ\n4lAduzRphaaPOuK42/le2m/D2y39pbpb6UULSSL5o6CAbfNVw+sKfh14mP85\n9nAqemJjKSfOK8tiqY+scSgCvTr5WbpO3EWqm8bYBHN/LuBTclP/qsoJTQeG\nvn863VXfXh8vh5xvLEU/zM1EZWLsNHBjMuECGaFvOaJsODiDkV1VgTHNuZRR\nZMfi\r\n=pzdY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSg3VPCIjFxQ17v3GtmonzDlAkzmi16GLELLgtyWuNPAiEAhY+ZKDw/EC7SmaYxh5H9k1qNezoFcXq4xUxS4EouNIk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0_1594665850394_0.6988181669431954"},"_hasShrinkwrap":false},"5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0","gitHead":"0fe04be087e237bc9be7b04cb24844ca2eab5aa9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qmwyNpuG0gBGPDOlyBC+Yetf4xJ85BaTndgR5ZcGshu+4SwLfllxX6v3GyNfCZpHceYBzvRyqEt2ggAEyjdMHQ==","shasum":"0fc7b8abd6301d08db8ae6a05d17169f02d57044","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0.tgz","fileCount":39,"unpackedSize":186891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDOLtCRA9TVsSAnZWagAAA48P/1aVzBRBbGCYDzcdzK4I\nYQamlYSv2UPNZKJwIAZmPApA/AK9C2RVS3HiyPwN1lOY9LYdhC1ILwFjOoWB\nOsLlhsQGtE+9wdex54ZeE7rBFoMnFmKpnpPFn4PZuG4kuu9z/UxYxmiLQkxX\nX/tctxPPEVG611Rc7n3y/ikfTj7o+PT2GJxUjs/+jXVn6+21ItEXa9do+I7k\n/sDspKaSyF/r3VOpY+SYt7GMMZLQNuRMiD4+qWdVQGz9oX1gUn3I021FZelR\ncIFcjOqW3lb2uYZkNaJmHgasvdDbvKBwaHuLiH/x8sYlXP+/o3VBSXha9ixI\n66Ev9iueJksiU0bTRY7utbTMtXMhT/+sIgqLXfeB8l9nlfxI6oS1GXI72bhx\n3LghZevn31Ac8kirdGAeAZyxX3gg6zUSdEvy+wPzglDIjfz3Jyz97Wk/cdhd\nqoZtOstRGL5heDrnJnboRjc4ghSlwdjpvySvFyDNM336DNqjMp5VjkX2snAe\n5TjUYot8zIkqgtSFjR35VjAnBJsb9WK5EI+kh6kNKkNLyWVSqx4M8EAvmmwI\n00jCK0//0MvJPmWiRytgFeO1yWauECE0SYswo4KYeqwlS32CMiDNK3RS0CYi\n0tOFGqN0dhjDi+2s4gSUPTXlwg62oX4ZbjftH/Ogkx4DZKu4rBzu5yx3eMky\n7/hv\r\n=5OYx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYC99fzsZljVDNPMHFkAKwsiJi0ak1vbvlcSALbXsVLAiEAmdJuXVJmiIYXg5IDhu31XQptVQCrrp6Mb/5tiXRfZxE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0_1594680045421_0.0002939980758809302"},"_hasShrinkwrap":false},"5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"75898d595275cade567308ffdfed2aacd118b9ae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zHi7brBCJ9Ejm4slj0Hcai9CmW8ZOO39Ty5twqq2NhwbBTzhYbHL2Cx6Kgzs7WphzQyZosSQCx2pRynkaJBCdA==","shasum":"8b5f68c7d19ec90b112372b1f52a5a81809f934f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0.tgz","fileCount":39,"unpackedSize":186891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDONBCRA9TVsSAnZWagAAjKcP/j56yCR7RPqWFXISUbQM\nImYzeyejakYMlPJrZQVydAZJy4L+yXRwyoYoUrhxbPByBVWJ53es9cZgJjYE\nekQOP5WeoBq2GyZJkuq+R7i7cWl+8dKCBsuIfPF0kpl2fKSXA/vrcfK1/Pwq\nShpV3lDhfkLqWbyGwM8bn1ybeIkuran4zH0MIJO58bjVQfyAXgqqBv1GPLKZ\nHLbAorb0WLGW9m0rxz/wndehr2HldLwDrb97mOl9MsqZChHRCt/SVury6C/0\nAcvRQu2xyfE2naTOXKXOhu2yu00LPHsEoro5Xf7PkQjOSimP/ukKuTKkm18I\nOflZVrdYRAD64fz04VXSMbQv7l9xmPVV9Iu03lpI7wI/JT5H7I1bUUgTtACn\nLUvx5q8QQ1129Hv3UVGnmQWEeHZRKfIgGtQJpCwZRSi9Lip2IA1qz9WNRDWG\nFzJZTvoVqiQQxTQem2qrIzsW2YwiI5HVYr3DQ3gHWARBebnAeMywwDguW/9A\nqqeKQ+YU+sJ83Ws0V7+y7MVG+9m1wQktGnuK1XbKGnDsD+iDdtXM5EYi6vW8\nP0Q+Ht/HMq2XX6BZjlHppb0xLQ3lqCcMGgaScNJt+mmqdskOsxtgk4XLJ1S5\n+6En1wsDZppDYJcMqQdouGYI/fRnIW+mJuH/FtOfdC8lOuRA1tkSpKyFJzPt\nhRke\r\n=kHI/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6aJDfb8Zobf0ffIQoGDbTpk1Lo1NvQe7QNEUgorGhMAiA+XI8W2um0/oHrRRkCoZEm8///V2cXNrA+vRhwN6NjIA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0_1594680129383_0.7702259539481875"},"_hasShrinkwrap":false},"5.0.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.18","gitHead":"ed85b8451ba6678881fd0af3979d68c8f01e97a7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.18","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Nioa802I/pWGGFTcOr9LECpaaSc5ELWRCQ8hl83Dc7M2Q3XksDMoKzaDOVvC1pcpTLl4xsBnJy4RKm8mvbmQ2Q==","shasum":"c154a8a30432472bd6ca38b01feb2964cd19ed02","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.18.tgz","fileCount":39,"unpackedSize":187132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDONLCRA9TVsSAnZWagAAbUgP/0Pa3zSDZpI5cJhTMvMA\n0FSw8YDzOm2tT22j6qptMHxIRjnG43IPuJZorPtLpk1MeguLre1krqZpgPsc\nNIAzOwm/h1rhCV7ct8st285TrYxgZ5Ns3HgpcK+p/N91wvr4O07E9w4goRZw\neB0TVh3WZSJY3GQsExVRxmqCBOqqtpUrsoqe73HEZ8cJzxOdfiVxgiD3eSVl\nDo5sXwgcVen/5K2MBsVATkbqLzBCUGuQnlAtH0581M9pFNSjhHNqcneo27rx\nHMlMFagR17VgsSrvEQ8u4Lsqx9CDpWPPUxbbOC1XINFZ8p+e2nFxPIWqQLxz\nIa5SXc4Z9Hr38YFR5NnN+05SEF1S0X8AUpCgZs5AKbW3ESWU/HMS+R7rPQuU\nzut6qgwKiinpvw0K2Q0zpBfz8lOpPBdw99PvRaiFrXJVVvMGaft4ki3cRQmz\nvZblNsht/jHYHxy5WoEnMqOheeyJgV7gcbVh8fE8mPMTssqTYxU6I+emabQa\nHG6wVC2BxGb7UdF+ZZctpHgXpNK7wS8gUCo3MsfsvqjgFGsj+8sVU+cfukry\n7Hlz6yifNjiWJQh6GdSY5yBbmKXjgBl0jR+lnixkUljYi2FYAN/lVsR6Jvxr\nBfnoq73cSnsCS5YEAPHG9DoJZG0EbOmfcvOBo5u54SO8QDmgi2Ulmn+pUVAn\nNs+z\r\n=Um5E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4rFtH5231ZYOfjMuDSCH98Yfj3Ynl74vKwPwASykz2QIgNsvJWsD1AB1QPU+DAQIM8y3S/mVlGOkwmeDBE+S03I4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.18_1594680138739_0.5541549658843807"},"_hasShrinkwrap":false},"5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.6"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ed85b8451ba6678881fd0af3979d68c8f01e97a7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-088MQ3A3rAvSdq+QfpEowDk4/UcNQvEbC5K+3FRA5NoXG5LTxTJnP+EIXoENkR90JAocWQ0BkixBFz58G4QA+w==","shasum":"bfa96b344d58da11cfb65d76f8a9b42a405991ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0.tgz","fileCount":39,"unpackedSize":187175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDON/CRA9TVsSAnZWagAA1MYP/02OXN/nDcgrP6diZ1Pl\nXiT3D9P7ng+hSqrdcJicYKxJFlwV8UxYuF49X3aNLZ8X7CVjSUebrEyEyRdB\nYUzd/z5D0ic3HNY0PtpA/dOXanJRQP/r/WolEH/8xGP9xs/4QrfCwKd3pN3G\nqsTyelP6y82EasaocvWugv+kW6XvxF27bBb8CjlT52iWqYhJGhWyx39Xn0hI\nVMjb1p6iZCKK9GoywYs1bv3+1zIgaTtrRCITzdvUW/wNkyTDWkNailIES94R\nHVj06/cK5WrvXZ/CKGo6TfhVz/hsChIaWqWj5xnaOSVCc/OpYiwE8PNiKdbR\n916BqHCp1hf4KYLH8cnWgSE0JbeSGWDtDBQAfLq952FxdcNwLcuaYL623b2e\nBBStk8DqpyPC//ALHm7FSb//YfdGNRESLc4t8H+TsmvDQYEExulL78QrIO+v\nuslVaysZ2DZ9/nVD7RVgBTxcF/zNuCi1UuuyIQga/clJxKyz7Tx4hSBmOct7\nRklz59UVC6o8o5sedFaBJFpOxn9YwtM3Dmb7YUj+NRlNgxYEf+WZmAiyBwyc\nmCcvU8T1izjeOnFuB2PsiycEL/FIBVRBG7ZcfyPorMWsqwa2EY33r824uuxI\nBkwUyUhFzEbvdOoCXvHmfzsUI0Ok8uJSAj/850q15+4JxnA3OirUUupCwC4z\n70/k\r\n=4bEb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDD70lL0xvFviUH14OSdwha7KxiUuInr+9dYhJPANy4DgIgVMAKZtDanNxfUYjy45wI+faLnTP7SROiXU80Ku/9LDU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0_1594680191182_0.6802971879325206"},"_hasShrinkwrap":false},"5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0","gitHead":"65e020bc907ceac08cf7a39626f89fadc8931f0f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mSZx5dkl9s/UfOdRwwdKJUZcOJuNayJSRKAT7p7CMT8X7kOiG1iB8+FaHpDns0JnWg8Cs42vRPEY8x551CutmQ==","shasum":"91e73858a4c81cb1be78eab39cd3199a5b58e5f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0.tgz","fileCount":39,"unpackedSize":187175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfELgHCRA9TVsSAnZWagAA/psP/1fe7j+svXR5FZ1uS7bh\naHWAtiiRpE1AmyQopfCwoja2hqPoVBnvy3YZ4KyB0ur7/wkOfqsEWYnbyj9z\n0uNAncUKuKS7ucS/zLVn5g4ucGZeEtzLxdV7lJ2e+vPqgXSSJ1X+NIzvYdUc\nYxLnU4cWUcRA/1v4bhfY1yyqJhgfFDYDXXLVrxho/Se5SUfkZcmQtZNa5K3z\nb4hsHIlChqD9uMZpdt3QncKXS5uix22aHpNEMIr5ZeP7rjB7wk9f3QPFgPB8\nhslLuAbU16L3wfARSvroX6RSMozK4RK5g2bJIX9XpBrUMtKjk6bUTWMr87G0\nd5/MMsY7DOwenxhUo/UoEDwhACLpKQ9yMUlKVSZYjod8cICd5IPJOf2V2tns\nAc0d80/kwC826dP6qKh3/5sYwC6Iw/+r/p7IcWAFpT1LfBagrYsri+jsjXR4\nZC84yhiFM1PY/GxWcza3Ih9YnndRz5Fs4jhZdlEecbKGfpf0MPkQfm5Fw4+J\ntsbHdKelyVE1DLq6Hk6nKSAhwuk0ZdT0lkEH8JyEHmGgHQD3NCGEeJ5Trhc9\nk5tNBCFKZBE/Pf24tz/RNtbKl9PGCkVG6Y6ZrEukcP5Mn0YRHlliPpjpzCOo\nWCqG5GFYa0uAj7z1iTkI69Ykcg33Wgx2IAkZsERdXXTVESL8BRStk3zsnKfD\n3+Tl\r\n=U15G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGHR9mfsdOfaCddMBSZYkWNDiM7E5DzN2Yz2NrXcZNawIgS/gaV0yQemdxeLm6nUxu26KGluzd+MYAczfMRUUJzrI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0_1594931207062_0.22968619476026553"},"_hasShrinkwrap":false},"5.0.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.19","gitHead":"6121aab12d022df57b1bbf2169e7c37a1c59266e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.19","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LZFMLcpXUL6CRAoVEhgiZ/BYM3uLQdrCc9MEf14mQKj+/8nia3IaEv/lbdrZz7FJkwEgFrzh8dEucVUZSdne4Q==","shasum":"472b00192fa5b892a2b0fa1b2b8038925562cbc6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.19.tgz","fileCount":39,"unpackedSize":187411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfELh7CRA9TVsSAnZWagAAWfkP/ia2SXCBvJSnKWGR4GSj\nbB5AkkU4fn3Aa4C+Ge+OTBNt77oJIe7x97mXy/6g05C2ssrM2ldKExWtR+yT\nvV5LZiT6eALpR2ZAoYHlxZzd2JxLRtLYj5048K4kIYh+fyscUH10QHpnZ58j\nkuL2RWoOiG5OkW0rKM7vMdlZJn7xPiwxi+qKu/kTeU692yAbdsPWR8hVCU+J\nZzkgcq2Hu3Lh+3YZ0Sa1wppu0e/6YrRcdMdiU7u5NRZATU9C4W2UOpEw5qh5\nJ9iT2U5g57neO/pSau+WwZc85fNUftTH49i6z6qDtoloQvhW4tX5a79ifk44\n9uK+RSskcdTiuhmx+AR8xn8LtIxnWagftfkcOkKl9XsvTzkCIZdwVIg3vwnc\n7swlQN0IYTIVkgCEkFxnvQjGi6k2jcy+vDfa4ZVNwoBpXOc9Qp7F8WoNp8Uz\nI62DLETc4I/Fyfww08VUNkIEe599xO6IyEfBX+TpkFAsJXyl5WA6hwQ823Lv\nfoZzZGRBjxs0V54m1Cq4FjHv8McRT25xWYTR6NZws7ubmqXfu1G0oP8LZRrd\nlX90jwzqUtj2bgwJx9IK8aT9F17jGy5BXt8DOUOKATmPuvkhbcKxdFoyvoRj\nH7y328/Rr0jxwgN+mQcUHSplY1nBNx4Yi4UJUfR6CP7t9cFdZztCIQ0bN6vA\ndB0D\r\n=Oozx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMxqDi0p/oufDOUaoRFYAAWUNtL4oIbxX9quI9wUS1pAiEAuuKZy/oR1/YPy0ehyp3emvooneigLyZcCFNFSGSQf6c="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.19_1594931322704_0.4178170128028309"},"_hasShrinkwrap":false},"5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aedf8ddca34e5bd4216102fe2de68b034f8dcba2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4sWV4DCQLjg3yzROgUCIsCub22/RS1CLcyWclbpDPtENm2ZVKqlR+gTxP5QFdFBXtfv03sH0Y6mHQjE2puCcZg==","shasum":"3cbf86aef68e4a61ca60d4e1d5539f6361ac64e0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0.tgz","fileCount":39,"unpackedSize":187175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfELiZCRA9TVsSAnZWagAADFgQAJnPC2wSTW/jTYXd19y8\n3I844g9I2PED6Hso7eUemldcOXLGHaJ5NiDcRjnEqWg70NM+YbV21xmGlN9I\no2on6TYDaM+E6J5tzzr1ATGf45/93JcqjzUkqLemKO/dBDip70dzkdjLEp8f\nX2f6xtkSZLglTDQ/7YwklWiG6Gw8vs9DRexCj67dDoCRDqezi81bRc5p5o9K\nu+SmpLIe2S/5oxVMqyi3l3fyW9dxlRrJi20KnE92YLthCMYETgkMsSGMAiiC\nSWRRx2sZzTW8n2XxrC039xdzco2rNFXBtOqAY4fCpV42RcnetcoVKljDiDSs\nKjBP02PGhjC8bMDoqvmZ+fMUQTMU3v6skwjLBSEVyjh1DRsvfV6DQCDgn4Xw\nM0SVtT7Y9q+gbAmjNL9PsywjFtdyuiHRHRrdvVUSsL//K0pd2nxxnZrLuVOD\n4MaaxL0B0vaX5qEOIFAOwhogt1AvwNoa7bgCB7hng0vi28wl7yZPPrjiR9AB\nbJQreUxL0+W1YKnc1rfqpg51yWshoykTNYxAa4+A8ip6UHdiGmDVwPLOm8nc\nyUe/BDZSoyi77uGJKa1Yi98dAOAM/BXA4v0lqr+luW+B4On3KEfsXkhKE9jo\nCEZ4mWcVQ2P5MjC5ru6/DG0x7mdrs3ktxCqm8qh1/ZMmnqYS4tiIDJAMCd3P\nAfJL\r\n=pn16\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhCcTAWiopSsEmU+2ix2JuJSYU/rSECMSaCxu88C9n4AiBX0p41Z+K+/k4r0lamiUyuClSOtW+1hocfbmZ1pqhoZQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0_1594931353364_0.8862899405324574"},"_hasShrinkwrap":false},"5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.2","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6121aab12d022df57b1bbf2169e7c37a1c59266e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-smxycXMw+BhQKqG0HTc//7fPGIdfjPCdbUivcgSghQL7SYtmm7nLALo1LVmLriK5XquMvWKa5SuTEOVljYGGPg==","shasum":"4a510e32699e9b085d89a36588b43d5bd6045758","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0.tgz","fileCount":39,"unpackedSize":187454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfELitCRA9TVsSAnZWagAA4WoP/1q7w+mSYruM19bJEl3i\nDFJoK+9ghHQJE8UFrwHyMutQ2OPwoA6e1aS2HZIxulVObRs3Ogm8EUijyk5E\nWNQWkyIK5QfUjA1s4S1p7br8IyTXosxlYkcveCDDcrFQYhbbSvtOzjOtZn/e\nzW29lQrKr+0yk3qiH8BmjMYl0j7miMbKCoXChM6vsgb91v11/SHcMrpKt2ID\n0Rf1KODmoLjbHKDpxlDv+Ge7gkcZm7GIyWn2WSXFH3Ey89pJSmY8O1Vw0h9Y\nybDr+NyKggdhduWB8ZDP3q9ow+0GLKF65S+sdGvhVaZl5PIpvwA2znwbA4c/\n0plHBg4pyN9XpzbxOhHdjSNCUoF+fkPEEHfS3HESZrSlZIzkjWr67zFNm8mF\nw18qwjaHtX8vSIfJvA0b1D2M19+VULZPXLc+yXejN1OBk0YZLE4fGiKkPZES\nwU4OsUwjlrbUpBf1WiFTbA3EQ/aJqh39p5uVZmlF50fZSiGyMnFKxpPjnBNV\nUeVaxBoAYMFV0eDDpjB6/qULOq8EwEcga4wZS4Ls+Dcvw7SlhDu3lSe+JQqv\nD+X0YBYbeTX3V6gda4LjoB5dEKcV0Qn07ZviDRqmOMObgighbndrnHllG90w\nhJEz8+0N2AZMlGPdbgE1WWD7/XXg3hbhMMtp5payIh+w7BudHh17E5TdO/Iz\nMvKR\r\n=/+FR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUDPxw4DYqcv1a4e8wt/O6dYDcwOIVj7erxXRdeVbAjwIhAISCi8/Wn5vJmz1/bNA7j0H7a/ROiL/YGj+lK8Rr4klz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0_1594931373349_0.46956722649651583"},"_hasShrinkwrap":false},"5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0","gitHead":"3c1da0d0d862b9183ecd832f944c43b145a314c3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gx+YIpK/Lypc/cHDWXrME0D+O9AmGWyJSuPtqYvyG5oFW9WjRQdrShmA506e80nqzj3fTP9YGflCNpMeN2EL4Q==","shasum":"956fdae4a5ac441379c74c137e64e1c28ceaeb4b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0.tgz","fileCount":39,"unpackedSize":187454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUUnCRA9TVsSAnZWagAAlEQP/ivftbc+FlM3TmqdQTiy\naYHOhWlgAMauZmT6wPVYZ7jCgFap71dAWqG58iPg4N+qKckyiaAPb/ljjdQ6\nSvzg+J1fkGYVdbHrGK49IKm13AK1Cp3BMGBeVbvqZ/Salj7HeLcOeOfvDtil\nN6wYcZOjGyg1MdQgjPqn2PSNj78Wr15YVJqS/0JLtkJBjlIb3ihZlUlEbHZQ\nUd0IzoRUTO4MdT1P/B5vRWhPhIb3r/PHe1M5CflpbbTAbzOdKPgpDGc9cd0C\nbvnwmMXOsw+qbfSUfW+t2ncSwWMhWDHx9gj1ve+oo2IY7fa8511Q55ByZ1gV\n9IXRmTX3WV9H8RwBt2bsEaW4zps42xZ3U8rRuCxzKiw2kuw0gFs0lpjsKF3n\nKNmvMAThWTTq3g2gnN5XzjEEA/k65c0XN9s/2WtxHNM7vQ/2I7R/klvpgTvZ\nSaTivNaRapDSJGL9ConMubSqi/8KARoYMohA4cU6DJwaBH5zKzZzGsRFK8ac\nVFGY8l9tDsd+a+DOn9iC23sVKuHxPlrjMmn/jlRaUaqI5e7jjT3BZcoeboCc\nbUdGWktFKVly/rM/bPJeCTez8Ixc302+2MTAEP9ubeenjGM88ZstsgsOwGQu\nO0k2p4UWcaLaURCZygHMd7V9+SweLCNBMvBljwReJX1nzuZ0kZEA9g2ZpvPC\noFxb\r\n=5d0m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzZiR+lc7CzXH4Yl3hWV4RHDfwBrdF6rL+aDVjNwdMwAiEAkMgRchEfkDW+rKFCn5sT4J+n+JfMStqLvpUiV3BQJKM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0_1594967334575_0.6678176058579031"},"_hasShrinkwrap":false},"5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4WqzjL/34PivVPGzBQM3MXh7ESStIdfS1FD/xTK2EXMGYOsizyPqQ58BRF03465DSFLU9r3QAPfhFbInoOBBow==","shasum":"f9f31dfc4214f415b0ae1e4fcb0e4ae63a836b22","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0.tgz","fileCount":39,"unpackedSize":187454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUWECRA9TVsSAnZWagAAa1IQAKGQeu0XBwcxti5gCtMU\nTls2yRoOXFCSQh/7JlmBaMKybC2WU6pUwbj48ftrTXATkNge/Ca0walEwvLp\nOEduJfmc9d4GXrrsQOX16kwj3b0Dm9dlIHMtG9athiyG8MY0aFmckgo/e2ex\n2EC8VuzYMJVmlZo0sFujUpe/wP2SBtWui/zqX3qYapcQn6XnEx1CdCiZ3eda\noGFXyHJGPnKWPzyAUDQZVuiK8vMZRKCKTm9MJEkdQEFTn3a3Wjv4pCuL+UtX\nD2quyQX1NF/7Wc1XML8asCqcAryCwjFzjGHayn/d8BP4/x5RJnaBozVwIz+1\nM7zMwczDLfUS3YBRNFTky25RNkcZMYMxLocuobkUG5iJjL8wmcxP1q1KjaGl\nnK1b7MIVyj+J0uRjEfQ6dm+lOK/7Qw9GOXvYNh29oZ5nhOOgOhd0JATPCMxd\nPJZH/JvFdufZeKqj5sNv3GKRBFWyvzEj6BWOsYK49L7Vmx3x1s8WNAP9arA6\n7+udygp083X9YnX9bpwUPm9lnLvS/HjNp0pqFkK+qgA0Fw/VJJlfUv4Owmth\nTzUPKKSy13dxgifVrht94mekHjLGESHRFRoXveinLK7b0N1OgaJKvEk825oP\nNupT9GIc4qPbKuBAFwLK69DOg65sIJyYcANxk3sK3fvlHNgHcTOW9zvzeIIR\nmzto\r\n=bIrW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl5XhkVshDzLFmWZwQY45Qi954Iob90qdcvdTe/h5eCQIge4uVbWmMjO5cWVL97xDHoHyKcYPuQzKbBVIgKP9gnwA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0_1594967428146_0.972423263979123"},"_hasShrinkwrap":false},"5.0.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.20","gitHead":"9e29dd7493a327a375ecefd43b6a66b7a18feb78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.20","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a0EplF3zVEU4ZGgLNdr6/dYDZC1a0Wo45j5fJVdZD3OtOxXp99iV5mLDzmLNnPJDCQWjyKWtBjLq0FpEgkwAIg==","shasum":"81106c758cc2d376da1630c9e8fa8c1fbdd80466","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.20.tgz","fileCount":39,"unpackedSize":187689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUWZCRA9TVsSAnZWagAAgk8P/jLBOG4Km9RHdEe0eXFM\nRDE5inH0DbVL/g0kqGu6nV09xCb0Dryou/T6Y5NEn/cykKIctesrbzLJrQAR\nuTwZUfT6UxGDrqbov3xfgBSqxcwX8wr0kM+NVRchoWXAD1/BPCqGytGJ/JCb\nIDEXkkGNoxByS56Pe9/h+tlWTaiM/XCE1zb1ElpklSn7/avH/AwR2Hph4lt5\nR4HwXZsde0VJ0XHHcpra+M8x7cmvnKl8xAuAzR/+RlgDuOSo9Ok1+P1h67lC\n0pmsFEHrdjz3wKKqwxs3zMKgA6JOvY6vR36eGbQC0N5c9MtcUOGqMvqP0IQd\ne5I8lfBcxb9OFlxxy/kdMk1IcuLAgEQE5uiI0TB/zMUO7e89TXFrR+nh1rEW\nyj9R9ywn1AW6yso8Bpx9jNPTaeVZqDAx4kO88UwcQQ49ANccqsK1/jhBXw8W\nNkmwDd4CHf7OPgR7Xklv3j/l2S/tuuQDJf3ygW7xSNfNG2TinQ8xgCWTCeN6\nuw3zkGtiPSvjVOo1xcSnAARsPHeDSV/bBfifbSdvHNeqg0ihNCcg9aqVlPkK\nIWHWZzZ6bRiuHyJmqCRklvhAdJOpngZfixYIbHmaz5W+/JIxAJ8tMEjAOyk8\n9QAAVF0mbc4AaBte63ip5jdwMRqX4SxAWOfxQyJN+CiBQSI79tIWkw4NfP5L\nBhUD\r\n=XheP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZSG4Dn6tN2P8jy2mOfydvCDeMtrSVUTQSUQ6xHulp1AiEA7FLYR1dbNO9dEMvFvFsuHk9FimviZJoqFRZz+MlYmHg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.20_1594967448814_0.2113223561067672"},"_hasShrinkwrap":false},"5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.4","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9e29dd7493a327a375ecefd43b6a66b7a18feb78","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aNHeI79oTVtoHF6qgE2+s85fqIbu/MTZrFKvMAnoOeIcRqQm/SuIJyTnT3W2eDe7mmEV0I7jBFLSagXFLcG7Vw==","shasum":"0f82766ec73aa33b11d23886438e8c920d5e4998","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0.tgz","fileCount":39,"unpackedSize":187732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEUXPCRA9TVsSAnZWagAAlsYP/2NxFoSk8AGu9qnMzszU\nPWrJm8Uk15EST2RfH6+FTOvzmt+EZj+aSY44TS+OM+SmhCgqMiC9LQQ13l8R\nTGNQG78fXqOsTG6obToT61YvH6dJP7oM8v+2Kgi7W67fdqeeyv5pbLFFY5jx\nFUyfitWQS6vcqWXKqlwGsoHgTTkbp3Elp6ijeOxBW7Hvgoe8qpgE1yiGvGqt\nyRuJdH8uJ4RZnx22W8iuSrauYygXHacsF5dSrit0tAzhc/wMIU1wkreao+G4\nH/R0GPbO4wd6gOO4wT8d1jefJ8bpFS+hepn0dJzhadJ1BQ2devyDUpZ4fugD\nWNlpiHnIvavKTu3xfbjIQ+jFWvqxVTImG+a/c0YV/9oSOrdstDFIbTctAWlx\n9a7m6QvokpTrNfVrOvrhd48LtlPLYRHy4RuxNXaJu7f0W9FH6r41Lbqv8RnC\nGT+Zfx+XSYtnf9r+drMXV39hL+RpOQWoE7Ms+i60kU6UXOa9VGwfp2Cgy03z\nqnO0tn88TwMiaYi0CQ5I5MHxXXU4aPgMKJqDytu43sp37tRqm9ru3eey7RO6\n004uMxzfZZa8geAm+KBA/zaHWID1mZnyBDyfnXn8fxMlFRzYnG10rdtVcicm\naSig2J3rB7Ikn9PMa54RLXq5jyeer22L6BbkiSOuqEhuXzHO8nlx5fJ93c/Q\nVvoP\r\n=sqVR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAEhroVji+x2TM8j48mO6cCXjHwa+CYH4lq/QwrcmqsAIhALxMxPfpv5LusD4iJJUNA6KzpIeQT2quKFP12x2S47cv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0_1594967502917_0.060143974816651236"},"_hasShrinkwrap":false},"5.0.21-f72e055840d140df4279ed66ac658867184147bc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.21-f72e055840d140df4279ed66ac658867184147bc.0","gitHead":"f72e055840d140df4279ed66ac658867184147bc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.21-f72e055840d140df4279ed66ac658867184147bc.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tCcXcRhfwY6Qdrn3LExg5Z5PSZtiUmuwl17RBl8Vxlo2jUBd9iAX1CeLdVzLFIuIFhsaD+60aVDMR48zGOwWqw==","shasum":"d0f5512c1e175a67006e247359d55d816a4baecd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.21-f72e055840d140df4279ed66ac658867184147bc.0.tgz","fileCount":39,"unpackedSize":187732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfExxOCRA9TVsSAnZWagAAJSgP/163tvrSAtEBu2m99v6u\nrt8K0qWRJI/UXAYlDfO9WSNah1bZNNvjl0ac9UIvc92IkaZPMi11ZCUKrDiq\nOj57GYSCds8iUbV1d1+LJtgJ097C7ThMUBr7tZetI88pvYcqmFO+8P5I6aEw\nGHrRKXOBiIwTsWfQTb9ElYfa11d6D5Yq9fJzsJ2LbLN+4GUnvEqBRwklHScl\nPZ3IK3Bqb+KcWf+lQrMuCdMZ07JICun9SxSTkKye6iutLo1WxG/OGYtMHz0T\nLA3szxluAdaVOr2gmDgEXHGgA4j4hsDbenPQL152jYv9cmudTQQkVagyaiaX\nJ7qJsVTm2wJWK/iE4ptH0gLsgpOxFcNp2ahPnSdVuDXoq5rar/qykKuEfNiP\nNDYV+7I3aiVjdxm6RRpKFK19vjnj0juGg60/8sAv2HEcFMyYTk5XZv3op13P\n4vpof8s2MfU8+bAZNoVikK2j5ZSywJt/+N/T69EFxePVytn3VNI8/tfQrdNm\n0187m7D/Ay7B+KRBUrSmrDTwzhVCPOK63cS50Mc3PfhmJjZLm593WF8EM3Gi\naqxsxNxM4ORzgw6+Rxg1kWteRkuG6/Ce0SoJcD2liqvxWjAVZyKNqBa2KEk3\n5AdmZmwkMnKIH71U416R2e53PZP6Z7TzB91Iim43q892JGtrVsTxUNm4D9HO\n9ZCX\r\n=lYwi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdMFldlAOjYSQvfHn4uao5j48SmY+q+A5Aq2Rs8SoQzwIhAIsBTTezn9ZK3QNgJgosv2iJi3QAmnSwZW2xhT4mHzcW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.21-f72e055840d140df4279ed66ac658867184147bc.0_1595087950042_0.12411693139697855"},"_hasShrinkwrap":false},"5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e30b9b89461014825f78d4dbbb257cd9607d92cb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9hlxhMZF8YcuEmwTYdegCZfGtiiVBpcsA74ZaPJZUbG0l15RwbKz3KArRedyQcC+MSphvw363IzuTLZVoht5eA==","shasum":"6282a41ed88b2ec5a1c7ef0471ac22ff4b6edd15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0.tgz","fileCount":39,"unpackedSize":187732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfExyVCRA9TVsSAnZWagAAdTEP/jzvcTME/lrerc9oH8X3\nzDzVBOMRNNH0cTfIocawcnbkvLsXd0XxELLkUXFKH/jDas9JgQO4I0iulWmz\nJrGW/Ot7MGLpv+edcxXyR8gsRwSeRN1iKzk30f4TL0BYTTmE1SJvguoBijEu\n2szAaT6kGexwTYjy+T/8VYN8R3KZw9NVXpC3W9+hkDiRGJKb0uKJUk9YDnZG\nHVM88CFXQIx4l/+yF8ydL2xXZ3ez00Dh7QWjHUrU42zH4xH7tx8t7IrRBl9z\nTTFCWPKn2hsXvuwEjR9Ng5apypuzfSjfTXq7zwV2dYOtOUwiHgm7KLejlKlF\nlGkf+FQQMX3k+JOSkWi9VooxyM7UNllSzVEjKIFvTcupud32S9ISnyRyeAJc\nTZ+BeXqu8GjfwE4Kx6vav12Def1CS9LRl0qdW0uu0eRXQWMh0AEe7e/8bQSM\nKuxw4SCpDPDTVt3E7ctYdt0VWE7zbkf4QKaAeZlyZXJBDD1s0Modm+96whSl\nTtLQ6HyWWIh9nW4GB3pAYBJoVsDtNzblrzw9bl8ug30aK6Jj5OTzSKKtXIAL\nr9IwglJqSGB71l4WblT8B0qLWXGk7R0gC4I969YDikOuJX0wuZ0G9bVWZEjx\nEe8dvjksRhGczgWF7RmtEMuAqXrTilmCnSVjcw8x7ZF2Z4hdH6lCsmK9wyl+\nmyyb\r\n=m/Pn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7LwzpawCXGQptDjPHAKj9srrlXHOSGPIQVqwCFp1Y2AiEAzKFeBktJJgao8BF2b/EFZ/saPf6GOW81Kpg7dEO0ie0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0_1595088020663_0.6597144998007678"},"_hasShrinkwrap":false},"5.0.21":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.21","gitHead":"602d55eb4e61fef5fe65238557e2bb6389f5c2fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.21","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-fO7w/ZbBkZ7+vYs0qxyVhgxtN5CI4GbiVnhdv1A8k0E7MxqO4VyV+hTu2+NjZm8mi52GKiGXd5Q43gWvhfHCCw==","shasum":"b095afdfc71df03e9b001e27d64c116f880f56a9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.21.tgz","fileCount":39,"unpackedSize":187971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfExyrCRA9TVsSAnZWagAAuKYP/A8DdrEGWfp70Hksdflc\nYbiQ5ZIUTeIcS/oFZCylMEEbbTe9B3l+D59GZV2a0gwFLJpJh/NU8ASpNBMx\nW9wfrzw1w5PKj+55AQqH9U9Kk6cQRX/8oFsTr+4ljcaF10Uz9sFSqmAU1C21\nEFKLyCEaZvVT8LUvP9Z7iK0bIgBDfVi0WIxhx59IopAuhwzG+RWA/gU3uxEN\nEvoyBpjGHnBFtx2948aqX6JNkRKE5nuOn6JwYIkPcad7iCkyvabRmd3LvSZb\nRF7Ec4z8NAk4znTHlmvqunUTT2sDUIXSapFGSA3Hb1a4KP/TuhXH4vT51Xwk\n3gd6Mi/DxzGYbsNGGkNkoWTQ7U+MXqEu57Smu0WKxBQXee0VUIsgr3Qha/X8\n47gQ0rIs1ysWcaQJaRLD03+EofhVEEwDxduMjzwFdfQPsMDVa/nOSOgPmAgV\nhpM5xKIlODSwmInCjrAanMS4aBN+i0boda6rSb1pg+Mwb29lnNowPe1f+AsE\nrZeUWOro4TH0oDvbi/rNIfcLFgYINKYQP4nSPExxCwrkgfIeGawwdjJIr4/Q\nxEvBDHuBLPuvCE5cw4BcXw4ahsh5Vupuu00hRI5VpNpNZCZogfXYCeC/cdA6\nN9w4FFoVm6LqeElaOHIjPDksvOQ5X53nikbFpdyP/PUZCCSjSyCdsBdtMJg1\nazhY\r\n=wV6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdyfpG5MSO+LvKrE/tGlwgCvE9eHGL7oLuNvB+PdHBFAIgZu5bDQ2rTbvxlFOXRF2x6dRrJfZBAdnDISTBAleDITM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.21_1595088042488_0.973048036652506"},"_hasShrinkwrap":false},"5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.23","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"602d55eb4e61fef5fe65238557e2bb6389f5c2fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2JscGS4BUUS2adwQZ7PqExxOZvNqqGMe4cn14QsEYHerLdAeFaQmo+dpUxDP4waVRJ2RRvIg91lyIGk9rS2W1w==","shasum":"6379eb235f61d2d4993c14ab8907ddd9a96da4eb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0.tgz","fileCount":39,"unpackedSize":188014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfExzNCRA9TVsSAnZWagAA3WQP/3bw1+L83t07v2tNjuSi\nVDkq4MaFbQTXR9Gbon5ljdzu+iGKKt2dZz4sN+nqCFGJQEafAbk3sbjbCiFH\nP4wxLDOn702BG//oEZItr2JnxSwdOnfmryrqRXOHSXKj1ycmIiYKZTmB3top\ndSQ/xztNAXMVyaZ2Daal14kG+Sx25EcpupUfuw/M3tjWVV0CmsxbjZXKW9s8\nx6xPTI8nwP6zycL7cv4+INnTUigDRIXew/waX16y7iBKBrHSNeeWZsYYHoO5\ns417Sv7+y8iLtkJMSuBLdcfxl/VWTjaW3UZ+EDBNHdjq0DV3dfBzKOiQflCJ\n5HQMnVZP0NQQO1Gbq3qMjEM7HGE16Z3y/JYNbu5lK7fq5pR+2Yuo/BXhE60W\n6LxBTTo7ubaGCyLv7HibTtLmlN5v9DzkvLq8kOZ5A9RbwACn5l4ZaLWdG8bS\noV6236iIET4G6aJFjfeRZg6zaBFj8AggU/1go6Jn+iPTrVRkmSsrd5+n67Bs\n/mQTr9lBZw79ayh6zH+qYZ5ySdqxnbdyXjTAtVk+BrG8PW+pWzIFUuuqd8ex\nbsrm3QzKsLzoTsUigQaXc31PnL6h+r26alP2C64Jrh0gGlLCLz8M6lXCU+f7\nZw7m6RA6bLXuZZ4ROcI2k2GPW9zGtufYEqW2eVsDBRDruEz1HhwtixgHjYqB\nPsgW\r\n=6sa3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2LKNl2atmXUEka+YEVtGl7KpxQjDN4eRRFdOBwBeAygIhAIcVIzYwvbAc1yVTdwRsdrEAKZR/cv6LA7vPz3za7Zfh"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0_1595088076986_0.4155370018057165"},"_hasShrinkwrap":false},"5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0","gitHead":"3afda9dcc310a96e3234cbb5374e0744800ca3c1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6TZt/fGvUlnXwKt3qgkQ+i4uzIxJWSvcK4mnyCVFas1K9EpU73rm0/Mt4K9+y9fZsGYP8BKKL1fKkCPQUmW6IA==","shasum":"5d218441567579b3ccf54ceb5417307eadf3ff09","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0.tgz","fileCount":39,"unpackedSize":188014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFj2iCRA9TVsSAnZWagAAj8UP/0+mFVgPWgrPgH3Nbf2N\nN9mFJ2d+TX/lGt20QtAfJ+rir1uBEMpo+n8xvSWDeCl/qVGin6r6BBx3nsBi\nw0A+uSQgNzYvJ76sJ00quuBhphn/mINlag2ORz2lgfAbg6NXeQbKHabLFNnr\nz8qpbv6OQWRxBPKqzdVfRr183e7BQDEdXUEQhvz/df3lcKZCQCVLjgYxsQXy\nH57TpK24+LEDW0EmIwqYNIqJV7QxT7UlEt+46/ejCwV72NFIC5jbaT+1ai/C\nsdcXfKjKNqA3Lq4mHaQl0H+IFrc8GVh31AkghAE2VsZnpPzEYwfI100nzHy8\nbfQOYJ7qAn30spWNrk46ppUbWyJzU6HGVC5BXoXRSO19nnOT69x+Vy8nejdU\nZV3lvjwXzcmVRlcUk0QkXcSu5q4sHCoIkp3OJ5Qs63VgKaCXbzksckqe/0vn\ny5J22DqLwR3l0i32gESqp8GQaMO3zxpZl9/sy5MontKVNPIG7l24G5fsuEpB\nqwt6Dj6+HlWb3afYFxiAGaoEG8SJqNvUnjag7olN1jtjIOOT3bPuNYz8F/1n\nZbKit7HPGjLPzDKUPspMXQ0mNl6PM7LdVRK0Kv8PdOTKb89ERBR2HAWM+BCY\nZWaYFGTcGrMwAIsFv5lwu6Re3MSo+GNYopZ5WjTjzYHKUaA21rDHkNknIKui\n473d\r\n=8M4S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQAL6/RdNnRKw8ohscvyzg63S/NE8GkFWPvohEmEV2LwIhAKuC4nd5tI7NICmMGMRecDYIO6r2Su/689Uo3itzBKFZ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0_1595293089293_0.8582893868162462"},"_hasShrinkwrap":false},"5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"47d5af28aaa37b1a94f370347f607694578e7b4c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZvQwiXrd016Nq/vb7Rro8TyyB1Eet2yoByT14IFV/HfqxSpyHAcw+68medf79snWzbacurgLXeJqAQ4otGp+aQ==","shasum":"cba76f257319f3b368185edf280fedd082845548","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0.tgz","fileCount":39,"unpackedSize":188014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFj4DCRA9TVsSAnZWagAAwHoQAIE4wG3v7xjz7BTyc30q\nNvtP/ZpYq0v4pBGYJXguexDd2mShe3k2iV4HImqBDQfHN/C1/UTzaWEXeVxf\ncUf6fHuJDecarkVC7ZFo+7lAeAgG/x6fn3MD0GrTl24VKKFbocBm03heogQP\njPFbNfnbhFynWgNP47YNWhVmpU5oXodFTjN1rNwNGFWzLnLjpBW9owsPQMAo\neRmApXTQp1XjnahHRszK5bRPhzMBL2d4mmjh/7LfIpSiFtNeUgiZYILpFB5k\n8R+ISN3k9PAIjfx2tEqT2e6Hp86azZukgcMeMJbBZxuzpg36BJoEBbTs4m27\nPdS2CuDXvcqzxrYKJrthZCoejEvIppDZNYlnf/y7g7Vb2iiNRy/amWLp7shO\nauvjmSANvlJClAP1gr8FDXuIA0cwhawgQSFjz1pyJVEv3p54uFtVe4yGTWNi\n1LiKZhA2/Y43y1K6W7fsU0nFiXnMcwcMalHEQAV37W9z831pXUM7JvMDxd0A\nwci0j/zSFo1fnBK3uyya1KR1Ye4UWt016r4Swzt7DLIQj6SOqKuMsiClwh6/\nqOyP+0AMAKkRVdFRgz0qlhE5vcRqMFwMgA8xX/IthXCgsxafoYnby+m+swvT\n8IYnbZweFgOV90PloMCtGAAyLj65WXkHeZ1g6ben9GxKbZOm390iOM92/gvU\nFyDf\r\n=cnAo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxDQkwH0qrxqGU+MfU79BtdBvZAf7i5fbnrHFYhaK2zQIhAKsf6Wq6wZYm/ejlnTDvG8ykiqO58HqXhYsQx6HOPpF5"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0_1595293187367_0.7715292206815558"},"_hasShrinkwrap":false},"5.0.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.22","gitHead":"88a33f478aab0ff18769e9b970732baa25dde18d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.22","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FkaXLvSDqK13R4x2nXjbkRHHfKmqE8OfcRZRi1ISEgfJPWEkm77O5QNtKCkq8YmEtRrI4IkIcW085CcL6rzPeg==","shasum":"91f2bfeb9fb87dd054cf5eac9c3064dac142d2de","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.22.tgz","fileCount":39,"unpackedSize":188255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFj4VCRA9TVsSAnZWagAAZj4P/1z7h4G3gPC99TMIprES\n1K+IahI1TQB4gQHl4jPkB+IpmEimT8TL7E9ErsDwX2WCWf6Du9nqUoCla0/1\n4TlqpOTxEmlXYNZiZPm+qPTvMYEsY6Oip1HGIB3M/KjrNVI7veNsHSOAoS8R\nlHAW8ai+WMQMr59j81E7f7xOsYmvUCQRb01NAkq7ro6greVlP+DIDRkPpmKs\n3crpNO6PUau1YmaZI/n6thU/gMg3pTeukrdABxxIDFNSfR0mSy8Q7PTnskub\nzRyXzEVlFaiS17dvBCsxGpZVTh1pTofnc0ZF5lpj0y6WdIE70kHu423jYKAW\nMoxLDnl/B18wD6H7AVzb+98hjnZ9r1O6aizlWN1J/vWaf90uHkyW+CmPyXJx\nho5VStTFdSiEU27jTcRiVrWGV0x8kq4ALK7bjMLw/EcbMQ79YUN1xqkKrvLg\nXi5AAH9neakF2Tq2dtjZRUGed3TUjzg2/d/ws2hGLl/ksC3R8vCAQ3xoInBz\nCTL/qYJAxbBQ4hErgRtioEvtp6ZqtdGdPdJwcQAirJNDJFTA1AXa+O1gdjca\nQE7ohTRTUx4OEykhUgnwwKli001jcdaUw8P8J0ukFjkHB9bQtpVHc6+V8Iyq\noBWkkLXYHs1XU7wyP+oSXs1Ns3HB76VwjM8l97I0u7TfGGsaXJ4RRYmnU83R\nONQb\r\n=SWyv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHXoO55vxVt6Nns0xaYRU/OGqe61RcKSd960D39ONEXOAiA3DaH8G1o0890knXhejuQ5jaYz0BpF6WkCUDbaTn19IA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.22_1595293205484_0.3601116867112204"},"_hasShrinkwrap":false},"5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.5","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"88a33f478aab0ff18769e9b970732baa25dde18d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XdJJjDprthnuhSN3JGqNAl7u0dEHmjnLDMeH2KUrAbvsz8fLJRTRx81Kx/873cKrYbpR3YkJkja55SEsfUDzIw==","shasum":"6db1cac3d6f303a402bd528696ea58816fdf27d5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0.tgz","fileCount":39,"unpackedSize":188298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFj5WCRA9TVsSAnZWagAA1U0P/jdoAIGg9WTtRuGmrwVm\n5WUkPwqUVa+gFkrw3lbW6smfp5QtQN0nW0HjguCPHv4iHdvSKPWYRXDuJ8/h\nWGz3kn2gXITEoyuQyzZMGGSrQ0xhBd4irBWLobzsBEgmyZnH17n3qWnvXd+Q\n27MGpHUgzsojlYgqrazE9nJo5PnQk+ULNw8zfzlnC/hdloyosRAzUwGAIxzz\n33QQAEasxtWjaMpEKurrl7z0EG0+QK3JGifjk4Ixu6OktgF8aDDEG5wVo/4N\nCIc/9WXUWv1peSn9SyAl+B5Md3EnMJG3oLuJUt+yO9Jya6T2SieLTBligiCE\nzAJIH8Te5qDwIa8IRbVTjdBX8d6qiIgNEhgHsvOInhZ6nUQ6/KiXsxKquQS/\nZSkakyxIVORoi96FD6KemGr5Ya7oXsuokP7UCdS4rdl310dnst2/YzACI4Ua\nRL6N68t/MITlCCOP3/odq4sGfNCNnjxzFLvKsYrCetyCCcVRXV6tUUS4uuQ4\nqsdJh6EZgTb+K2DA7c9//C2LpgO4jK+ua91bOcyaHatacGPH2iTRXEYxsRod\n94rx4724v55Ud5EvsDI1HwTxyFnEo61no2abhGQ802/EiqY9wKA4up91z2WV\ndm2jPd+7Lh1rjcAJalHladiuoPAnJIB746j+IThN9snnkrHHy73w5yxymm/J\nVHRb\r\n=UQd7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0CX97ngU8rZkWYuMB9UuClYcfF2gfs5uBqzntqqMybgIgYc8JvejyGcnhdSH9ShFe/hMZyOLsJkDZqmTy7ipR+R8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0_1595293269443_0.8811363135313364"},"_hasShrinkwrap":false},"5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0","gitHead":"d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bY9PyabZabd/6/QgNm0bjEd4vhEf9l+1xvefMKPTPbiE/rkj6zFDZMfBMyOKGt7Fml6Lqi7KGQRfD1wH0UBtHA==","shasum":"6bb7fce90a3c408165493ab1783766a7d1b0de6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0.tgz","fileCount":39,"unpackedSize":188298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdeuCRA9TVsSAnZWagAAyekP/1yt0WWwpkX0rSeQ2IxS\nj5O7cQJ1//M/Lrcgt9th+vYtEXdfltO8xorB+aKUkNj21O5Rk1WQy9UVgQQg\nNtmBVvtHZeVHpPjxj2DXviag4YqfSYxi1WuvCjrE8uikr+e+e4dsKTc+YFsc\nJwUyCrmLoPbrLMST3ssvCzDeweeKRELqdBnZUac5D1RU3M/oD77Xh/4FUy1I\nuhD49ZEzz1AqZ5r0N07mzmDUswO2di/e/Nrm0AJhky8eoOVB5yUVCG3LzZRm\n+RIaqN/ytG1TZSxy9jByIGrtZXwKjet4pDjim4dDEKBbi1N+2i7EFXL31MgJ\n3O6owdxhNRq9Qx197jaImNdDJY5XkLmLnOnwwMQhtGfDlHLnHE3ljSw7Ni+L\nBdoh39J0fcvsFY9IKjWps7BLAyuBtkzkAOrIDQttYTDFH+vI2OOlj5NAY7aX\nc7U+H5Q4Lg6OO8yRadLoH1msf1Tex0ciWcNyacl+BWbrLZHekUVGg9x65cmy\ndpwruSkza629zvVROAtM8PoSIuncYKoUGuBxvbBlDmuAd3Adx2c62o2bo+Jh\n75BtpLzDxVAqdMBvTro1Vi9kY+r5oqkL+FTj5nUiGXGllYIl7ZiUsFbhfpIS\nk7x3dutIQglOpZC2idLd7Dr3U/LS5OepuHMfT2yDv2d5s3h7pvwV+4w/ztOq\nlCWN\r\n=X20K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqHf2FGaxC+Cpd0aLknac5Im9y+6IBBWD+uggiwtQKPAiAv/X41M3x7dKrLfYTkM68FIbwPG8iXLkvtYUkL4bVjKg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0_1595529133583_0.695323435221092"},"_hasShrinkwrap":false},"5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8f1448dfce4fc681f46c8db06002d4d395760b0b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-x5wsTY8icQ8kJn3gLDZEbF1UBSaEPOJ8Y6/QjgNKWHQH+8feU+hXQtqqRHpguvG4Q+6yZFsS1NIuN5N8Y+4aJQ==","shasum":"dcd8f6388ca0a89dcb449cf67403db728ca6d758","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0.tgz","fileCount":39,"unpackedSize":188298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdgPCRA9TVsSAnZWagAAZHEQAJPZ5uN2pFsT8YD31PuO\nJSOVvM8AI6rqEi63HKqnZijjmXN1OqVCf+fw0aIMpmMvZkJdfC6Sp6CpqGJP\nZ4EM68HePI57RNHD2+EqsIEuddhGVCCxbNbpr1hqNrKslwzkHzU32XMcjEQO\nsMmXxf6/DFsj6wVaoSKX8rKlXjWlzT6JKkaYqTNBdzRjZrWAmk5kiA9De9E8\nKlZHfYXJA881zk7mfGSIHjskEQqXwZHzlfaHbjimBhHm74AaqeFoNMsKqr6Z\nUECw4NniBEfODtBNSOdBzJw+hqu6GAcSGdR71M3fnyxF/eFbJGBX94cYSjYX\nEd1AEEZwhUe9qkkuOAObmELm3HlslRYw61qM3XamUP2rF8vn46qufBMz82Bn\ncGPH98qLxby4t/bms98+JzIbZ8hkuZHShYQqS7mxbV2mHkdP1AYexLypI07E\nZkDeLkIG0i7kB0s+P1wd2JO6SsWNZZn1mDzT316Ngmyw0QZkWRQygXT1fWzl\nPAJGT1Sv/bjuASCev7yai/pw1um5e4VBVH5ytzdAduxSPehiXPS72zKq3VIw\nNPz+ahPnjESAzTMe8LbQwOeEJnoR3XiHLLC/HC0SP/ryupP/silVjNoJej8v\nmkzDtLlubCWSTbhEpxQBsWloNM6Op0AtFnOkDi83xGMBCYuJXw/F270aPYTJ\nxAh0\r\n=YoVA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyxn+QiaEBYZc/PJbuKrU+Ddjg+1zs22X+9Ptq1YVNJAiEAv2xzJuCyR+1N3ex2V8r02MoHsAL7xWJVjQn6ksWyafo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0_1595529230667_0.9479833737898962"},"_hasShrinkwrap":false},"5.0.23":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.23","gitHead":"8d561a4f92211001c301c7b38d1de4d2164e4c3c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.23","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OnljuN8o95o12BAom3fXnYlVkQFZ2/PGGdiFg5roio9UOkNs8C4GUmKjU0bYmMDrraGjzmHC5jinIyqKoC9gvA==","shasum":"1f111e79503d556f1d7b8e852862923321d2fa12","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.23.tgz","fileCount":39,"unpackedSize":188537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdgiCRA9TVsSAnZWagAA3/UQAIB/tLhiUsbO9nkJ68Go\nZYmsM/AUIFzaZAVthtnzUsKDfY116twQ5QI9T7Jp/lFrYkjqmXv+LJtgQed/\npnXeuerUr37pzLxN50f27YsD+V7jImA3wLbCcbHXG+uqtwuq6+xYtzgJRsQX\nr6rZETqzVt2E5LQfIBPEyqK8PUz3GI58ggazez3abZftsvhYW/b9LGVaNA4E\nNxpzXVAEYbrcJf6IdtzdQTW/jfkD1FsuKk4zy/nX3cwXc4BpzxAkf+Edj8e9\n8FOZoAinvTGgcs4K4ZR3IpnSCVFceaSkWBvRObExEiwyFAe3SxoC0WezkMzt\neycsBU3kfoEjc9dovA3QnnqP94yEkiQxCmGIZduOrS8IKnKCl1uUUNeVayNV\n7w5goKhUIi2cxjfI+QL2g1iSYnkIKwsTNXjPL3xn/d3TclnN5Avjs/LxjTde\nnMrYuj1v7FJoF6IJc9OrILyGOLUgDSN8ZidV8/t+uxkBJFWSSZSs36IZzVvY\n9aAoGWYgkKAHVvGn0J+D9kL4to/w04XNDfGrJmWZkhgonNae5Ri1DYlO/vxy\nCJCG5cicDThbrLpfWdyxguaoxUCIiOMvDPp5K93EhyWsZomrpFz6Q2YEQv+g\nIz3xZ952VHMXmOUWhA/gShGpWdz5Z6PvFq48nqkbxkHjFeFv0JQnpqmqRCpI\nDBEW\r\n=gMm8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsGZfwvl9mf6SIWeMVGPh6ailLhaWGW4n6wWlBy9IyzAiEA9W8QBPjE7MGpVdC2qI9ZH8QejGetSBS28/I1htWDEWs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.23_1595529250130_0.6545037531110522"},"_hasShrinkwrap":false},"5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.24","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8d561a4f92211001c301c7b38d1de4d2164e4c3c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-lzCEKLgacBc9wT52IRTfUnSwdpY4HJKESovrTfUSOC8o23iml/Ruk52udGWtOigm/kMyoBvZHmN3tJxvHVHO0Q==","shasum":"ff2de314a22371eb513a67ae1c514d71d2d9f53e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0.tgz","fileCount":39,"unpackedSize":188580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdhOCRA9TVsSAnZWagAAQMIQAIW1YLaNdGXxryA2gg4w\ne/UmLdxzUPu+X1JIfblj42w6QmPAgIJ09FYlQI2BDxcO0dbCSNxdkqEF8frL\neb/tT3BmrO80CADKno+RYvj+IyLErWRKZVTYS36F75S4+eSvelFXy/+pvGw1\niJU1UHXwulSuTl9HobnpCoj3nOnI8l0XTzLmk7QCe5ywXyehBF3wH74olcxw\nAZWGUKXcheks4a6sKJa2ztrM4P7QoTNz6NGWp/ZuUI/S0ZEVXmVEz9RIU4nJ\nmoaP+SkLpgHERQ1Zt2rixBBSZizEjB3rvyn/JdL+8n3ViKHg2T8nIuICcui3\nm7jaYhnOfvXsp+nRSSrS1Z/h/RmYATuU5up7fj9fixZubwICWlivXwfhdErO\nJ/dbRt3XoacaUrjG4fCRx0Lm1wbCMd/Fp0h075LwHUkg8/yhSIWoJC81CMsN\naqCtQLBBPiQ6j/YU+A6oaDsQlgQY/NsqaOl8r6/t9gNMa2ogDeF9keX0t0p+\nSkO3ZJB7+XqXA6LFTnZyhqEN987p2umFBdP9vA7QV4t7JLJi0EPua6jZXF4+\nyXFAsJg4MZWHimXnCBhQP7zizXwn2+Gi7HhBy7i+wu3yOmqeYOVeZHVnS4Kf\n4g42227uOxszBbPwix0vIbRUcLgKkbrxg67711Q5ThK5c7AGMKMYluYXExfX\nhpRC\r\n=hPJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnDialQimK13sRV9HuMyCHVeuRs2nAqI3TtMJK+R/j0AiEAupdeQr2pPSMmcHGXBLpDqRSrEwSioV57AX8hsFT8ZM0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0_1595529293532_0.7223177572142641"},"_hasShrinkwrap":false},"5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0","gitHead":"c204b43a6a9f75e4f86100a1bf591c5939e88214","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-n6YwDFyMqZtakKN/+oXdbqLvI2FolwqOoV7aHCA2kzU57M/LVmBWMg9sT2HzLKKwKA2l4wa8PFHkT9aZ5GLkyA==","shasum":"5befad6bf131757d74eb6d9ba4c7a11e5510ed1f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0.tgz","fileCount":39,"unpackedSize":188580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGh0tCRA9TVsSAnZWagAAYcgP/0fAUqKPLEP8NdH6XE+u\ndwND1HFzUnUCjPOVqyqkPMm2aYsYwB4U2+1U3v8K5MaIRRrnYvd1JkZ8H4pJ\njK6ABDJWVWKDFg+IuHxYNYlqRXb6HxgdMDQRMT2oQxXx6LDvpTxSePvU5QCH\n/YemkpFSkmRcn1OYBChPQOUQjKn0hreUNetnHR05+nGSzBCqU9Cnpe+cO7iB\n1dpimWpadzbsBMJQyMlQU2sOIorxEg2GQc6IJwP3GvHON5PodOT60zKup2iW\nlxtF06CsCO16aD9+nUFFW+PQ/jCyeuOKkbLDuDsvftUTinZaMJrG/t8dMNh7\nCEYbEf65cVfidMZ7hGEfoCgwxNA/bRBXNvPlMwwRbiO54yGcv0+DesBWMiPF\nIEh9ddK/FAR72bI4N+meKKRZkNYh1SD89FES/vKmabXZRIk7wXmgl50DeNTN\nBergvsXKjfFvqjk47uZ5yY1sJ818KZY/nFCcrIhlOpHTMEukEmO98JTGAIu0\n2pP7+btO7JceAtLadT4HRCAbP+waLVBbLnnuA38Ek9KgToq/wcWtKxeVAi20\nHdpMaviflHVPapQEDAS772TdOM4s0JbmGGOEDsv2PP8MAtI/RhSzpIThZCoB\ncCJGmFeUdrdyJIdemHc+XiBu4b+1h7dzn9qzeteuUG3k98xaXmmFxd5Vztm9\nPG9x\r\n=35bA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpEOiPQfqzPg8Im7KMX6Y9FIPlRQpk9HtTKcJ7emxPDAiBThd7mAm7LXpeOzcAujfOtdQcLfuo9KLEyX+fDZ44dcw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0_1595546924811_0.33420206011337394"},"_hasShrinkwrap":false},"5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2fee92897320e140b02c3c41490d2eacbe10a0bb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-V2ZiLCR5eyIN7d0V8B+RHDs17o1R29fzgUU9c9tmqvJh4v5v+M7OCHNnOh+mTahlcR+m6u5KN6R1q03xn9DzDA==","shasum":"6b53f8f0881ec2abaafa4f2c2750a260b3dc3a8b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0.tgz","fileCount":39,"unpackedSize":188580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGh16CRA9TVsSAnZWagAA50cP/j7q+qVAiPv41gkG1Xqh\nfq6lqvM9ocEWeKqeTBGajLdxtOTy+Zix7p+BXX8H1FkJk8W68wmXHAQseOUj\n+Dm7Z5NkiNWTwzQ6uetP2yJ146pn3q8lrkSjNhPfM6qCgvj7XvsiTfCaG/gQ\nRh7RIjR/eTm9p7PpeuwF25hVdQg3pa5USijZOvWk21nyxx2O/Fs3KnyzvjNp\nZ+oUJzxEsQOkXtPfnk3VwboKBPUiXLGoTGLaxQC0IDjIRiLQvYn/oOG8+HB+\nETYXpY83cQzAeG7IWDILsKZkcHz12OTtQ7PWS4LN6EPRLyt41AolnzWp0ww2\nKA5+HUBiK2gZMEzso/DzMXSlThGPQmbnwmAeyVx7gsOsidytPWwmXPG0x4Ap\nhVsB9v6e800+X4Caybju+AsVCz8rU0PqkAZfXrBxfRjWO/hCnZMd85VUqZVL\ndbcooeMzMe5En9RDiYRwQNV4GqQHrRWhZqzDa3j+ut8I+eQLQSPSEverrlki\nG+tJ/xb7GF+S98+ORh9PE+FJhIub0vyQUvZ8+91SGgLshxPdmVKVdUtP3HMb\np+V63E2Vdxtb7gbxvRRooOqBfbjPnGznFW63yL1LMeo77NqXxO84kqyCHFZh\nkITMtUWLIKOvLp/bUpj23xmeJtALE9YnXpTyosyWTHthsvHofGVY8y/CkMpA\nMiU1\r\n=Apcg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmPajG+1UX2fjcBy4A72LSUmPeIF5GevET4NNFjCrw8wIgPoFSiE+uAqFRJ8miCqiLkEJ1eoOeKs5nbYMy+fs9KU4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0_1595547002286_0.5683502776185974"},"_hasShrinkwrap":false},"5.0.24":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.24","gitHead":"a56e81462c804f083322ab0a0f96de6d9c794448","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.24","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tKghK4xKQs5D1HPLPFbM8cYe3fapiPyCzsBjgcEeVGr+mCjSpy5SbevGMjL8yx3MwlL4TPIYjIk5CsTMYayeDg==","shasum":"b40920a0ff2c558d52b3e477bb15b0250a86d7ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.24.tgz","fileCount":39,"unpackedSize":188821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGh2vCRA9TVsSAnZWagAANrwP/3PR3iYr1C7sGsHI7lUT\nCws4mkkmVPNlKBQZAvVx7992eIMZOOxKD5daUWaGRxR42omhXFBjQnNIIbj7\n8SjJxODRRzcmmj8JcndxZzIZ47eLQcRFxkU2zpzZNCIQ3+5q0kqlgbQtZDRp\n9p5ktJfIR8V4RMJOGNxPt8oLKJB27gSfY9tv4WpUfUsvYFC2aCJJJzCWT+s5\nb7FX5dlTc7x4MVK49dbxf5WnyG2VCYxmOhrWGZVsjDGGFXpQLh9Ya19PPrT7\nTdbO2/cd4+0tIHG0Th3iL/l2Xh7r/rp5exC9Mk8ENDKi24gIcgHkjVlV/qdm\n4CCn0ETOubfFPZgXCtlBIxn5kQRUI9WdXpImfhLbtOZz97oIqdtuWRjeP19c\nt8JsoiG1hZWZwHou4oPfQEkGwKYkxiCXwyTHCOjjhlTX5wGV4jTn3eh5XgVT\nUnXQKvvt9SP/wrWNKgb58iEi10mKVt4C8CC/Oee0St4ZHIX/3hrX8Dw5E+wq\nImDib9tAVmkdoOpHR/3U51U1xFhBtWD8XTJgNM8ZivirjvAS09sYAi0yXI0C\n2obIGbgBEu9surgMiPkxb1mVSoO1ghD7KxC+Bd7KBhGgEBe1QQGytFNj9QNA\n9r1oT5LD+1EggUxFXmlS6NJdeviKwSiODfkrPNevcEgSGhIAQDhZuwOXyB27\npKg7\r\n=Qp5y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoEipwG84i0fRuAjAW5AawAzJr5hrliKnjm446Vbr+EQIhAJp+GuDxeOBNZLXwc4Qu6UAcl5p8GUZ2BMoL9OhQsJuQ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.24_1595547054461_0.6674670186302787"},"_hasShrinkwrap":false},"5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.6","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a56e81462c804f083322ab0a0f96de6d9c794448","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9GQ2j+SE+aNY0JUiPrOLUqTrm00gNHb5BsaFRMK9m0RMze7Hi9EUhOYU4HG/foT0FduDf7zukzBWL2UaScIXog==","shasum":"420d54af67a2b7e4e55e0a8a74ea5323afa197e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0.tgz","fileCount":39,"unpackedSize":188864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGh3NCRA9TVsSAnZWagAAxPwQAIwznnBF8nBvn7OCnQw6\nxZwCzA1+mDfOYXNagM6GDMRrI0cCY/nt/7X1MPNDIl6umpPWDryygGUkO2Dl\n1hyREfQHyiEATmlMOFkZ7KIJe1yKuEwFt9iSfSES5beOER9CKNffTu8JzE/r\ncBRn9vrSAPywBpZt9lOSACmRht5mRdXKVaocgD+kM4vaKqQ6jK5sRGjaJ9mB\nKtwLsF1USD15zYKozytuYa6mOXrPzDfqwYUs9bgNA5cQidIl5bfP5fMKS7CD\n4+YFzP/Kg6y7+GSSdEDyzCm6uwmObusIRZjZNrNs/+4kR02XIaFR3v7k9QQy\nEcL/bQGmYD1nHB62NWgaNgEmiGaqRx+syRvYfEt4yPWaqh56ThokGDws+fTP\n5wVeunDSuJ05LRjam3eMAkaXlWgTaw026b982xyHDYWWmyLfESQz40YBgLJi\nOfcUsHtBpKFAYSdNfXOX1gE0pxotEzeYcKtnso7z2Ba/ys3nlhijFukwELvu\nwP8hW0uYuzBUoBFsNwxHCXtDywenPGA/EwDMuuQYEeD+WTg8lEDTHw23lb8c\nbfpksG9wYWZ5LIr5iujpi5ZFCYqKhCHDe7ym9LyxDJnY0YzGXE3ocuAfgV7p\n1JOjKlDSy+hCD/VXcv77yNolYh7ymJ3tbd08oFb5Bl9qabImI4P4TiIAcJ9Y\n3vMQ\r\n=uF1T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTmK4+lANOTLRBfxDIOHkM6DcWCNbuhkceB6N5OsS1qgIgCsRjSgu5PNaygYaPyzQd48XYV9klr4ISPCSp8bIBhvI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0_1595547085353_0.8653064445085725"},"_hasShrinkwrap":false},"5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0","gitHead":"09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-XFVB1e2ABqKvvlewha5xtM6AEzhodsGacvBZsZXyeqKhDg49me0dGQSuVYMBThii4dEA1BnH/bfholJNbT+VFA==","shasum":"5e1e52cf049b6cf70ee0c95b794a626faca5ad5a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0.tgz","fileCount":39,"unpackedSize":188864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjAICRA9TVsSAnZWagAAK3IP/R7+0aZo4ZbWzNsp6Q1M\nxTwI3YFy5rJwr4BtwtkxjJH2bJAebbz7eRDShCDEa7+iNkTWVd3TLjKzG8iM\nOSAaDHTF1y/acvi/RUymCR7cDwJzKqsIh5hjpjOGrLYTZxpmWE0IJx15tIB5\nFmOpgePZziXsiYBR4nufHhX1CPlp02uz2oMhZP9mEHg5wX9LXcn9x5Ba5aPo\nsQbteW5h0anU3o/vuER85fG65q1Md5GBVqVGG/v2I9lzaxpBvZDU5J0gxrlK\n2w2MXt6gNYQi2Q24euVmQCRC8hAruH5WU1LnG3Z6JdMHAGF5IhzuI0uUQkEP\npMITz61/FX4pox9AbWk/EfRwSkkEG4MJbPqLvXaHZNZUo67MJIN2L3V6oJm+\nIkTbNtapZRPPhcbB46qCBgblbFTJiwa0arudMIevgq7vKp0NVtDR4XX4+HI3\nIade5FvSxo2RBItjvI/0Mq4iDGRt29wGghoQ6lH0Iw+6AfaeVtJzqvvENqE+\nsnncSOx8eLlxnwpWtsZvcvX9IDeLEQ5dWhGPjstn9GLOAzDNPLHd4mdntwgj\nSBLSRgAOKa94IVG8bbOGLP0OgP2lcKo7g2+Qh7Ee5Rvj/vhFH/9DqBSy7FuH\n24sNmx+8553GpA+UyVwx6Id40tOCJTrSqWHg0The2tkknwKvaF+EikTjSmkC\nTWXO\r\n=KLsl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLDXY7no30fEaRml++Lyis6pvTPCFGylMIqo6WLYGBpgIhAJPMNs1z1QJdJlihlqf80DXj8gx+cdCscZVdQM+b/rqk"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0_1595551751621_0.9346974652023439"},"_hasShrinkwrap":false},"5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3357d2a60805d42040e358db43d2ac04951f0eee","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-r+gO+akccB6qMb8Yjdc0WwEjtKHjqozVnOPqEiZJNYF4r6z3ZGO0gVV14T+byhsp0Eg/km2z6n3mQBLuoC3TFg==","shasum":"c1dcd9810014a4bd3a6af806fd979b9cd288bfbc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0.tgz","fileCount":39,"unpackedSize":188864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjBYCRA9TVsSAnZWagAAej8P+wfhjU8oj3lnZXeHTRre\nzdQFmYVif2/QBmj/6gsnn3yAG+DmqQQZY4XUErCc2ylMTYthhYrDRa1S9x1d\nc9cjJAHa01E8vpmXYZjvQ7NYonVlRBs1kEaRdykmqiO9g5KrG6/5bONhLCFu\nmtlJtAzFJEY5USuEd5Akxupa8RTCdtjtSQrMC1pADGsol1jIxUymS4KNdB8e\nRYrZN/CJI8pWxpLUcUH9nFgZIaJpROru4IEH87nJ3jtL9sVH1XjI3QTkBlGs\nUGGsUjGXYgR3/GzFaZOWz7k7E49yJef1gmtl5TJRe14VWkIPAL29ww9IawhB\nLBcURs8532iBf5p89zBoyhWPS7ecsE3s3ndhzpGMBtTD82bSAlop0njY3Z3p\n25vAYhm++KCEG+x1CgUVpCxgu0h/1g0mGhT6yDuonCYn6ogwZbJru+5DkruZ\noJ+9j9ehw8CLcSQ/iax20oQ4SHOlE1SaXeR9schRgTTiSUpl1tSJNYrc6gJe\nDeXKhFwEnUYM389QE8Nj6kjyXfEVgzKxFygaeJzCXesnfdOVs7CNrsMD0QMm\n9N50crEffEE4Qq6OtIH3jf3RVQ6EAhIzODtXnyjpYTBlZHQEvnHACJVWXokR\nv0v5GWYOux0vcCHn58vX4fHQXuY5PM1ZYpTOQQcfF4miIAKUhF3f3Cs+xzSp\nUDQL\r\n=Z8tP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfMkEfTpixS9pKBjrr2qFe8UJErvfVTIMxZPAGHXhfpQIgVvpgXY4AZivVNue1G97zFC1TpvWF6xFyE4ytvO7tFM0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0_1595551831807_0.3279387326102159"},"_hasShrinkwrap":false},"5.0.25":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.25","gitHead":"db8e274ef98d8ccaf978bbafdc393fb3dad74154","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.25","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AIn/Ntoi4tmnPbNhB6giO5JvLZt0jpUw0vmfwPBkndiLe2cuKjLw7vensY1Jd2VQb7MFx6Z5hoB3HPbmoYOMyw==","shasum":"bc254d96eb945c6720bc37284469dfdf3a76a012","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.25.tgz","fileCount":39,"unpackedSize":189103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjBtCRA9TVsSAnZWagAAulYP/RyO3RIfeh7ibDvMPdHn\n9XiSjdff2vNtQ/AkvKjXmv6ZsKgI6wOrKAJNt1TxhGplKUyWcIODxn2DYFCg\ndv/WscxsWySRE2P21h8AN1OM6/gwovkGiRGy889R9Yl461Dk4VP0DmovERqS\ngqJhqhRrbXOOtdHbqXbL0JuoMMrxRU57ElIcCNmpdChkIV22S6hC1yOLRG7y\nbiqtMRaZNyEgZngKofFpbI/GErL7Uk2H3Rc00sGmmSC1Xybj/gNbZipx75IV\nU+vlBmf4qzMfoOpXxAOZ9hOUH+s8v6ceP63XbS2YE0bhOdKslwvjLuLiW3is\nenz8c9BdtbaR2Cpz15yyWfmuiDHVQAswJneTlz+rgjEqYmsCuN7wItf8/dVo\n7Z2DlZgxF1mluyYIE5npz3u6B4AmdVSZdb4LBR4rOfisGDIML5CviZLEfeSX\nFllE98sRsOtEANQbzCPIOC5RBJM0siTmC3BRdpM9+Y4yNXYrde/+6Po/C19a\nrFBd4QO/2GemAqts2ENHhTK/4MLRzSEpDkBvLleADqYhzFvOY5UqnjMvOI2x\nELB2DwQ+zzk1+6WveHwJc4jnNHVTlrkSSL6uk8zMuKCFQAhPa0Qezouj3aHD\n+3t1gv+umX4qh+lx5lAIq8dBC+XW8cj7B/i2Z8xkUIlbsNSUIGtY7ZMfsGuW\noj/+\r\n=CDoL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIzNYhFmwxhPmzq8GYwhqbBOCScgS/rNBG5dSejsv7WQIhALLuQYDSd2vJr9EXWW79jHwJ2IopiDgR4M/9a1uN29Uf"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.25_1595551853457_0.13363033143927017"},"_hasShrinkwrap":false},"5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.25","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"db8e274ef98d8ccaf978bbafdc393fb3dad74154","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WjuPqDwqmb9ICCY1ccBfCZ7rpXp7i8kW4pESBUXEaHpxuR5wL0xIGNTj6QbuPVGBCcjZ/QZBMumdnAPB4RUFiA==","shasum":"f947a8d3086e7221c8ed51b32b70fdd8022f7e05","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0.tgz","fileCount":39,"unpackedSize":189146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjCYCRA9TVsSAnZWagAA8CEP/3CFpBmXa60wt1u4WnoH\nllk9vr03erMpnJ5cJWANmjVjikiO8/UgYpbTgBYpxfz1LUbYMSYAiOnfOkpM\nkKHxzsOYbhcewyX5Jq8u/AgyI9nFLTMX6skpWnsz5+6TC/IIylHQRk2OUl7l\nfRyJ7a8whq2mbS+FcY63ZfHNB5O33SjFQMQXZy842+ZkZPWMR44KqkmeoECv\nU5FLLqsRR28DrWd1zqQipdyTVbRq2xnsL5HFiQMSRvaTPOa9eMREVKz/IY7f\nxcZavsxifdRkBed5g7S+O/vJGhV5fbpq96A8uepPaM/yHQa9boSiyNGjwxB3\n6z3LQjYEmDET1N5Able5A2T/5j/Ec4sMxh1y6gBL55NboVhn3V1YYiqbiNoW\nDDg4pl7gba1zzftOxAYEk48AnEUsQqyb9DJ9r77ADo9hunGYKYmz9aaVWNgC\nu5A+g2Qr/a71UjajOygepvaFB0Xyyl5KHKtPrivptmzHMMgpQxL1Mgvw/Hzq\nXWGf1hHOXbqt6RG2EO3CdC621Rvi1q9cOZz2pP2v8aNJ/r1Ll0xIo/ulBTv6\nJkZMqWgl30uGkmTB37hWQ+p0EiFgBPgd2Jbs+X/Ff7tn0JLtJ9qXznUYEuLY\nqKv6l4bJd7TkrDknuWEySNt1Y1suU0t7fv4SIeTG84Nskuh8LhdnCJrwbea+\nOHyP\r\n=fnsB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHAL9RCeWw8Bp2sK4e8y3UsVLQ+sSJzdgplCBFND6YMbAiBuePINCsTLJ8b9ly/6gLeFoUCYPH0Rkwu/KsNgC4jyYQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0_1595551895471_0.9402749575533491"},"_hasShrinkwrap":false},"5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0","gitHead":"3280d69ec2a200f056adb569e8f0d161bcc578b3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Jnq2mhLNiiaV5CZUGI70CGxKr2Mv9cD0PF4cQ5PHlvI7OhB/2gbaOaWb4anZW4vXzJU8Im+Gl7ieV+2MVbV8eg==","shasum":"f58de8009543eaad1803a832eaf0239b8df9e1d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0.tgz","fileCount":39,"unpackedSize":189146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzqKCRA9TVsSAnZWagAA51gP/i5m2DUvl99TRHFBy5iT\nK6Hc1cieCYIesVstcuYTIKabXm3I8jt7e8115sK6ADxtBNjpAsK6lCHicSBS\nFwyc6yomKMh3hrItiJKMjRWtZouo0vuLdWnM/8dP83GbjXZ5d3uTtTpx0Mi0\nKBjEtNW2RnAe5eoWpQMceZvsn9eQl56d5U6hBNr3iGqzmsJmUzVn1TLgsF9X\n1y4igF5ixacjW6BHa02ufMMDNkw9Pw+4cyp7O4eD9lyzRGblVC3IvdcBUBUm\nATTsDhDsIBpMqVDtabk1h893DCzusInGsQh0e0yy+4nG0wrxM8PBGv9s90iE\nTcsqWWh5e8ApkTG1OKbTs59OGkXFuhOvL++HS0Eg5kAJ9CfQVAcspoVmf/UT\nwwe2Y1E+MWO0tP2gHXotIpEifWxXVCbguht/ac1f0RtFqJEmL20wlsgoNxu/\naAhbiLMkSVIqPTJ3Hb+e0be/A6Q4J4PO1heNM8C8xIXmgFxa2aJvi1M7ryal\nBnlQU38puJUQq5LoDLR5ijyTopKaIeH1Rm1+ba7BM6Qqovs2JesoMe1d7bsv\nUZFuIdn3yOXb5kR1jk7vb5MKVWS7ebxcl4qA15yxyui1APSTQZJH9712iq/d\n68NSHqhCUpc7bA9OQL+WaAx4PD2GbbyeEq6KV/lhDY2I+r2zx+T3DQn+yoqg\nyKS/\r\n=4ojp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbhSE7cIOoDD+NA75QzT40Rg7JGjt6VOJNbn5w1iQZ3wIgEcyphrsw07o1JN3VVhOTOdNZbHk2LkmGVC1mLwFSmRU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0_1595619977999_0.5459103634655516"},"_hasShrinkwrap":false},"5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"86735615ba52f530bf8746eec9923e0d073a3a57","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-k6rR1Wx/WpHLGsr4yDLs6ipYXZ2nKUtvUIVz55kwKdNxm21osbU++4jVCVM9hVBP8dT6IAaS2q5w1FGmYIK6jQ==","shasum":"3c925ac008f6a660eb2b4ec201e85f344456eab2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0.tgz","fileCount":39,"unpackedSize":189146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzryCRA9TVsSAnZWagAAW38P/1sUjOnRgvFuSljyRchw\nUtNN2TAt9oB2k3GNrx/CMzeF/jT+ZQ2mJd4/gb8O3krO/ZHlcKPa41ZWSbRq\nBipqe/iwP4vUzMnJoHKp/ze3DF0qCRSwmWBJMBTx6372utBn+bhn2Dwp0Jip\n1TLyZCZZL2lewBW29/ZiMLJ5yxNsBx4xMLCAPwIoLTLCyZVndmZANU2W3NZL\natb8YNy/8SnOnJfFe1rSMFX1ixEgLaVLtGs6Smu0cHjCiwl/+Je58ITm8LUO\nzSrTb+TeWFGS+4njqg8yplsCiFrNIVsm5ZerkDbpEI/18ZTMge/b5mXQ0jrP\nGWANLRgyPvrxOL9u3ylSaiiUDdiXEtCPH3ZQzCsYcYhphO+snQgQJbcBzYyj\ncMl1IOwhz6LgJxPfCkhFaHX+z5w4xX3xBgjtvCo/TlNhclg82WLN5WLcgBK6\nhY6rbsTR63a9a2OcRiiMznLWmwEx0hnveaXQMvnNEvaApoe9YAv2de+kYNcT\nn/T1mvy2ShpD/6KUvxaZQSN8wErHqLG1eQh8NxY5a7s86ExaZsLJXU1/YOpP\ns7H3h/1IdnUBfJ3mbokbD0adQ4hV4AJoD20ZDfcvqWtqcpJtj8DQ/jNDC3Wm\ncKP1wpeo2TYtHzloBpIRWyhctppcJznahpVX3GTRkkppMBMw7zMomnqxIzOE\nxg9m\r\n=05bd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIynSfvk5R5bP2Y2ubhcuMBxr5NWWgCe3I3m/lpsf1iAiEAzGZ0nXNB2WitfTCWjg3JWxSRcotAIWwdpXrZYEhXzxM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0_1595620082185_0.4748678752344895"},"_hasShrinkwrap":false},"5.0.26":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.26","gitHead":"2d73ee22b1a35729f8accce4aebe1afba8c84a48","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.26","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Rx313DQlwKSqLHvw0rk0mrUkEIMZgOOlHMl3XLs5dUDNOXgBQs2YZmi7pLyyuZ4sIIJLsh4Wy65XpkH67ReG8g==","shasum":"27481d90c43bb3a73afa451e0e75199e580384d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.26.tgz","fileCount":39,"unpackedSize":189387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzsACRA9TVsSAnZWagAAZvsP/jeWIe5V4iYykiXRbERi\nOVLTBcizhjDETBBOQyxOwcWKdKk8uxM66g0/DwgfjTVlD+dwCbmwNxbMmxZn\n+iEApqOS0TIgJYI1QyYIWIpM9lYOzQRwoq5FWiW9D2MvapDdzNlULJ8Nug4O\nqcz4PlSYOvEUuLAAQoU7Q6/qPMuxftEbno24yW4Fd7Po1uVCmJasgxUllaxa\nqAoqHTEi9i5u8rZzGTz/mZtJlxMBaUJF/vv6vxIh13xEa3oHp9p4f/PqK2l9\nXv68pj0jwzPJeYmTJIxtqaoJXYHk4sbBYEowWvBGkYECHE/ik3QhI6omCLOl\nlO3vgWSNVM6CpNqNHvicqMcCQ1Ml4flCV9sF4G5mzEbOj/jnpkXbkrCngBR+\nFYKXWobrDPw2NYAC89BK8TH78ON/HOuYGDKaNzDq3ohFy+HCokH1d8NgcCL8\nQW9jz2Opv0Kmw+PupBKPIpPiwFejCq7mZlIjYuyqXS6DvozrKa6sf7lYzvWg\nWQ1k9xH7HgI7lFZz9QsJ7UgpVRuUdsWLoT6RTFfq+tq4jw7P2sbxmlYn5DIk\nIQxaMCwQp22RuBSxVH6nrvY7owzkD/O/UWRoJwsjAgOjHj5IbS8cmAMUeM2c\nOdBcYk5bD5IqD3NKvkyC4Wl/YNSI+Qac/PSodo8z14tP9uZwcqzkuxnz9b/o\nWmlz\r\n=H7XN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwTUmpxp1Cud7Q/8e+V4DiTB6H7VZY05y8MIVA5OhX7AiBAFLBa1AWJE7wWQsfmrSziLGkgx48xbjY0T60x3QfQkA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.26_1595620096339_0.6063817813164358"},"_hasShrinkwrap":false},"5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^1.26.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2d73ee22b1a35729f8accce4aebe1afba8c84a48","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GQWk5e4f4xjvJmz5R6S3iyhWSI81GL4F+8IYuSarpvZ66eOoTdlGoBMI6u8hg9YzQGRAjUD62mbmL/s0cTk2iw==","shasum":"6f00bcae8d55f6dbbbf6e120e13084b550fa915c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0.tgz","fileCount":39,"unpackedSize":189430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzslCRA9TVsSAnZWagAAYEcP/3VSxVXY+YrL1Vgl2ViP\n5AF9OCpNyh854/Q/Pn0KicgQtBNLeYJceP28rjcklk5ri9ayrm0Gb4m8NUhA\nGFzY5dOmihbGZ3oRfn/SHR/gox9Z/Lv2Rq8Cm4yHhKqSHsNBpamt8CeWuZEZ\nvF4UVMjDZSozym0vudjF9t6RCiOz68/F4jUv7OLTHtB9uk4GZ58o/aqNoISa\nL7UP90zZKumAfrSCJuzNejoGdwZaO5ptwqYvmHympFDXx0h/oFMes4MsSYO4\nYNQE9zzB8Yu6DetsFAVnHdWWTvteMWmMOe1yymiIGuGKaMgjk6NEkcprAVa1\nyVRGxKX9ZRsK/vEyowPe6mFTJ4ip2klxkTJjXrCN8ovpz6/yLHNOjgYSHoH8\nip6kIUcDsqSOgJjtY8wu7apJxU+I0TU8rjV9Ey5dF+wduvs01SFcyPvjsmji\nMW/owfOwbIKxveixu1B/zI5A0H3bRro0WZE8UYy1qRW9kXRtcJCVzhUA9K6/\nxhbJHwaOTIuICDRTyS7WTfiU79IPoVu4YX+1K6Tu9e4Qzkfx+7GinVCcPbqH\npRhCKw0yHFU7cz4Q3EyE3/zSMpRUiV/waRqcvai8YC4fGffCyEf6ivtAHzCg\nvQPD3jcmMjm2f+hOCufN/Db8ebmHbRrcOShkAYuMjQJ+as7RZWYiw4M76vc9\n3Bb9\r\n=6qOh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4lW4tWvh2YR0OCOZ6TM6/5jwxNLIuUIA4ne7zqWkxmAiEAl9SZcBvTDuC9qLUBFjq8MmIrDNmrD3FRg6LISHAoBQU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0_1595620133396_0.98566320352096"},"_hasShrinkwrap":false},"5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0","gitHead":"5e668684961c689b7e1273be8c5332b79102f16d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-y+jWhZS3t0xEY0nbLMQ6SmjBhwXMt5HmCcCJ0xMQnWMS5e4no7K+bjJOpc76CWEyJMtqe4rHR7FsvO2qrD31eA==","shasum":"c729af3508918f5b7baf7221f58b56b2a3e124fc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0.tgz","fileCount":39,"unpackedSize":189429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG+6kCRA9TVsSAnZWagAAv8sP/RORzuYrMXY1Uqj3Yo91\nzq0ZREYQSA9I1M+bdmkRWr6y9MAwzA4Se4h4p3Dm0YPg4CyzhYgCXngf0F0b\ntIExFoiyffuU5BkQQFwkNzqx75lvWor9urZ3yLhEI4KeUy014ZuFDkdR0lb5\n4xicTKSdhPLw8Dj9yQQ5hUdKqZPqGSzDUYPBtwiyqZqjUI9jGQpk0Y0PRyIn\nzWYdyYjbvjbjlVcYdar9FiXA87DQzMskpNJ63CoCepbKcliyBbsupHqUgv3t\n7ZG7wGWLeYoPZFQXDMFBaXT9440IyBaSyi+6g2RoByt4YENbCC8DGZvxCW9E\nMpxBlqpedPqUXgAllFMBgk/eqppup111I0bf4l7GomfJhin5ItVQKN2GqX6f\nDq0aufuzTaUajqJXJIZ617NIMWSnnWsHonavRho7p4HUyz505C/Xo7JnvxbH\nzLwW330M7B8Rxpuq/7AP0lyKYN701hJwTY6lTRak/lGxF+4j4scKIYbfUSE6\nQ0CNA/fosnJL9Y6K1k9bwyIR4Cp5rFYGinTL6eXq/byPllwRV+OH9GbWezUx\ntLtD+uhPS6wwToKkABfhK/gpyqBrO0q0rDFR6rOsWQqBUsqt/M1/6gqHYXBS\n1uK97oMqreN4sU5i8AAFudsSCC3uEklvOtG+r/3Ux3WY6D5AI9AtSAPe052h\nWa/R\r\n=GCXc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxdO1uTPvpHmhaemri51LZTavUtOw/Ry5b8vHxxZEAmQIgEoe+U+RTOQRFKNnM2c1LH9i1M7jChIkopoyyzdneOj0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0_1595666084084_0.794157169540965"},"_hasShrinkwrap":false},"5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b5df8f293355484735a06b6c31e346c798ae2411","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZySNZBd5n5OGOOYu/pc6j0emJWortRpjTz3aY8tfRO7h77Rp2alE+u4IuzxuzE5kM9+zEHvOxTUjGcsUlhiH+Q==","shasum":"5a0ccd96841a001bac327123fe5998eca0b398fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0.tgz","fileCount":39,"unpackedSize":189429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG+8JCRA9TVsSAnZWagAA9GgQAJDW2XJYdQh8weaRPMcY\nm260iES4etChbCM8wKcbvOLNDB55i7sn/UBWKcoDj5vohscjbttIzSiuw/A4\nNJdo2UJDEIb2uyMTe7PlYG6KwJcFkXL53z3PVDIPIxjznEKfgm+92IGm589A\n4PX7VlrD2oiLAiskqSlPIEj8YkVSqEDcl4DbAm+Q8v8feablLIrRJIvyON2g\nbZtbXZGivG3Iqb7JV52TtzaqEBQtkbU/mio5kc9b5Tn69c3nDAjF7KtyW8TC\nsaBn6VGPg/nwZOMAGA29J6hvgqMBi3mpty3QYK0kYZrGuigEVXyEImpmCSxT\nTHmqMM85dpfzId9CKmlltelXpSpSxqjQbZ4OBPJfl7ot6w9MJVpQVjICrnQ2\nP+eyp7BrdhMSkRWxHN4URw2M3J1BuYOGE5WCnUN3Tc+L23EQFN9fey1SWmFB\nyTBaPKSCXAlS0Yf5mv6om6eEbjJlRxahM1VJiM9fFUYzGOZ00UK0LGaSiE3W\nkWd1hotWj6vrgYLfeKtAwj77c3ZBdYS5G5ydNd0Xqabb2wiHXxDD6sAlpgQ8\nf5Kl9yoZLNqslN7Qmx2lSCQaDFFiI7gr0VriX1Yj06BTqYr/gEdmJyyQEwsU\nEt/lu2kP38aVrbnt83cd37hq+wdViYCWkJ4+ytn2xbhmYMVs1Hp43yGZWwJw\nzFUr\r\n=iv4D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHP0fHzvzjWgnc1Cphbxb6Yl7gxyl8YJS7nGzMPxT6+xAiEA5NLOgBe35j18mHx5LoYF/VkWx6rHsHRon9f5GYz7geg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0_1595666185142_0.7485880140133403"},"_hasShrinkwrap":false},"5.0.27":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.27","gitHead":"a4936e95d9bf626f834ef43d99cfc8d34bcfe38f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.27","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-u7XLVOiJ/YoggGRShNhb3MqedlFJnG82jBid3szCnsCEvjb0YjUNDo+vzWLSoWkEZvOO4ladYbxBaXgnaz0rJQ==","shasum":"30158593fce863daf8bd6e13bb2e9facb4c3029b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.27.tgz","fileCount":39,"unpackedSize":189666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG+8RCRA9TVsSAnZWagAAnZIQAJ/g2WDIq6vLaDgEpcjF\nSHEWm19SeXgOmgv+QRO7Se6UGICynZ938433ypZNdhEwsA7yd5rlUmqhE7nb\n0X6rA+hp9vlub2QBiONVeEeGE0L/85GYPSBDRtOhRliSGtv4Gv5sTBhWK/E+\nnPVsUqTyncptapb14YEQbxngNvd+d5L8UhlW38qT6VZmquWdpRzZ88duxrA5\nePZ3iMod1NMXkCrIbSgYkyTcLsdkbZsShNR2QtUCEgbugZD+NvHrcdhGyGtv\nPLUmf2MyRdL/pfmdJ6aNGpf2iWdLhYKBHLYUp6IdcOmfcmTdBoNVnpjUfaNn\nWrDrEGljttfIVHdF2dqJSJvSuSa/0kRqbH1YXiwCgBBpS8iEHEzzLTIQmMDP\nzlyfSTTwdIXz3zr/OpU5m55cQ4yI4xSI5UfJNR8hPmHZ5+5JBlc90F/wOr6H\necQAmxttBAr36wDY6reQ+CULFxSRLIlWpcBbAg+i2Z8zjRZyhWVB4g6LOvEi\nsInNz+cL73yslQUBGlM/gFoOWxbZhaFIbDVWgusY3SzEU/z8qUdsj7F9Gs+U\nzMnpA784qX9b/jk8MEXbNFAUw4Nuc7RWzpgypXVHp6dlSVM1w54LysXBWAR8\nRHyj1DX49Vg5xJ4UA4eDLkR1A63XXmItw2VS+prhVuSGOLZ1Q1ZJYI91OnGi\nO6vf\r\n=wTvw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW2aZayAz1JCLTR7bKRbeWWMVwuaxVgQIw/ggktHeInAIgK2+R8NoOWSO9EkA9Ra+6qGAKSOI4rYhjZGCxgFoM/fI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.27_1595666192693_0.6023068978296058"},"_hasShrinkwrap":false},"5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.11","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a4936e95d9bf626f834ef43d99cfc8d34bcfe38f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-F5myySZXlJcRLpJ4Um6fVdYdlhf6koGJ6y/4HgunNGSmKSZRfCT0Po+AmlVwAJ/JrAKOAEyQIm2dZ9iE/vd6Yg==","shasum":"e07760fcd00d791d2740cbb8737da4a5eabb7aff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0.tgz","fileCount":39,"unpackedSize":189709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG+8+CRA9TVsSAnZWagAAmkUP/1nC7gwPOWW+y32hGs6z\nwLgGCxjChc0lO2s0+tAjeZ0ecxFC9Ya0p4W2jy8Pyd+6YHtsuQ5YsKYq8l2H\npd7qgpZWx1o3MKkQsxfn6mzBp1IStJ4DOWjAmRlwU0fs0+hz+gxmkD+6eMpR\nk17v/sYKLceopDXqk8kqcNHYRPWc3S9fSLwkIGTHYdepVu7nN3qT0lUjv0oA\nFyQjpulTP0XqybJUvJ15iyfyoUCUAkHYbR5FQphid90G9Ph/gG1kY525FxIZ\nCYKX5H3GNgR0iJQ5ec7JxuuNWpsSLiCn/DdFC2pa05dNVm2lRLJ+7WQE+i7h\nc4PEHqpPA2sEw2TC/LJ5lILRajoacvXX/iZ0DnnTWvG5Ymzt8TQhpI+1sZ/E\nrAlDlRIdTRH0xiV3hM9czYNqT7R+bDUVvb4z3vB1wUg8gfq89Pr3NxxZOmXk\nctxnQirOiBHjYozY+mwUovMZ3P0h+wcqBxepFj5K0IwXbORGYdA3zSbpQOlK\nXDlhX55NsgAJUG4K+QNxacdKzRTkxZAIohsHZqs7MM416s4pfKDUsOGGfvDR\nSo2N6lPj4hMSiZJ6+yJjPMhVrP2I4aTQw5IjtDUnpEWUyeQ6LuF/7Jzq0ocy\ndEqbK7bspU8bcCI3OrrEue3512iHxJC2EQWX3j6uo0eOETKV8yQbYTtp1/ub\n+1v/\r\n=iHym\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuvxE2wXea64RWHxDUgbu5VO6CDoWrN1fjpWkJHk4emAIhAKFY66VDa75WtiupqUt0MPvExwCJdiDcwOrh6HQQkcak"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0_1595666238332_0.31654482027626085"},"_hasShrinkwrap":false},"5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0","gitHead":"bc424fb59780ec02036049ad2d9caf73d219a8cb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kCQyqJeQYDWtLKBKlkNnGJl/TNRETt5KQgqr9YYMPtuJvPTOQCq0x8dMcFkEZWk3CPezaII9tuAEUa620MJTsA==","shasum":"e5109c66da6aa2f72f5093e60ad50278a7f6b4f8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0.tgz","fileCount":39,"unpackedSize":189709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0BQCRA9TVsSAnZWagAAGpAP/34DYcAu/WjBcry8K4zh\nTFTa8+E1rqGKA+A7qTzqpG5OBGj98MtBTKMTQePLzOcBaxjc6wG0o222tUx9\nYYHUKQqqDNPn+EdGfj93fVLssAiBPuUk8sf6tk+oAN9tCEmYA6B0/WJs0F7Q\ndpOGJ9hF4X/LvgDBEW1Dcq3PxLLxtH9P+239Fyehz+xb/w01ipydkVX19N4v\nzVDihnWbjiVTxOVabUKyC8AdTGoRzWefT1yrRzrHENHEn2bcWjk2xX8OoyfG\nsAlP0E0jFvxeCOecm1FS5YpvNCAlAmf8PCbJ0fiwiLymCVmu7bNQDlsPSY0T\nO+UuoP6Ofc4CvyPVv5LeXWR9bVDCYMO8DAm61pzYdJ0KrJWuBsYo9Is9we2v\nYd66XP32LThUhwLnsfCY5sMRI5WB3SEWZkEo28FnxJ9lar3194zoD9uDJHGl\n3Tzkl47JCe1Zqb6WteNWSXCvXRfcK98derTWHasJACyXIYiKYdVRgXNbY0oD\ngjUN/glXSjeCnexxpH+G44BXd1zT0mM6GtAY/YaGu/zOePvGgPbGFcDjVCml\nyFXiwvPdLdvTSTBUpPY6KbmKoRR7rCwN1SDOuDHNBg63JTP7VMJjJTVZsJ4z\nSuqeTI07GE1Hhe0DwysB778na6LEqicb6kdr/XzvG18y2WKEgTI2SfE2Rhhs\n+2Uk\r\n=LRSZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0hVqOlwSutf1iBkDNQCvOkWR5YUpxmQsVTFxi7c9ewQIgTaO2LMPQrBKiygaIY/eLtInfT2Ig0cyEGzOoZDpPiHw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0_1595883599358_0.09393444513592963"},"_hasShrinkwrap":false},"5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1f5f4e4a63186a3b7a4ae7474f0472264eebf45e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EknuWmO1BivdQvvhnYCRCwxKriV5YNySS5B+hA2AZAsvURh7pxpPawgu2I1tH7OMg2UPsIBfTIAYIQmcWLQIHA==","shasum":"df75c8fac60593937ce15882353f14ec5eb85360","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0.tgz","fileCount":39,"unpackedSize":189709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0CeCRA9TVsSAnZWagAAH4gQAJyEcgMuoRjKzIPqI073\nLCv0mjs7Bp0meO6GUzekHlghx+9mTa8RSre7zr5kdWrfyv5oPJ8vPD6xSexK\nktnUO65j3ce/R/VOMPNkopYY/eqW75Db26dosGv55RDxn+B3N2UOpFsR4ULx\n7LbM1BSsmM9QHoO1KjbzGRb6QQc5s7BMP0LMG7c6nVF4dhjA4L8AtyJPyEMa\nq/CN/N42eLpfAKkQpJqbyGnPXdYGVu5yYqjLffPhb9aUF8oCrr1B177q6LAf\nCdzEzrq0B+Hjfp3ff5SrCrDkuEB0lh/ZfbcfIpFSPvHAJs7IPIaGxl5/P0a/\nQCGdFABFZKatPGac03dHpJ32cfTkOclcjL5hwWB/AMzWO6DOOWf8nN0WrKDP\n9smqsEFbnN2q1N4GboVM73T2m8n8QgkILPrd3zW1OCrOwZwLE2acAvvJbVyG\nMGUjNYTJJQcD8LjGaSzHCx4/ms796EosgpGiJkkUERHnAJjkSvww2S/DZEO0\n1e2fFc7orTferhSNX6M2AnOejf9Z/caRTn5cnMcgkNGJ5XBuTEujLrAYt9dA\n7fAlK4Qe/bE88hC6JX+2WrMSzTG6rYzmbDNEUEZ+ro8gZ4kFSVlVsUvegfQn\nwrUSPPXXRGXXe/r1M10Vz0dn64a19KfpXq+s+Iu2uqG3yjNQX3GFP8MPsDM7\nOZnB\r\n=OesY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkoR5DMT2AGVvDlW7oXvMt0tRsFkFfW3gcs8tu4MakHwIgCZCQh6uUf0Icy4ZUia0QvbDz3nreHfG/yiTnbBUibdM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0_1595883678304_0.49392556781390495"},"_hasShrinkwrap":false},"5.0.28":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.28","gitHead":"94aacde2148acdabfb3ac8930877cedb5cf58d41","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.28","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-0qdsWU7n2bSeBeniDm3XyDU7P3+g/KejQirIyLX8jariDXApn7ooejlmL3nj7/QIMh5VvPLrt2PX1gDNLBO6Ng==","shasum":"ed5159b1c079f19edabf22f46453a4838c1db616","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.28.tgz","fileCount":39,"unpackedSize":189951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0CuCRA9TVsSAnZWagAAu84QAJz15AC639yFwOnBMsCv\nhdqG7TioRed+e1O2SO/MO768N9mIalUS4M7IJrV9PMD89WMv9LsqLXn75z3U\nYMyJwCrdrvE1kqn3JVgVI8kg5tMVg+yhjUXAJNTjz3mkzRF3dSPR+4V2SYTI\n0WKn5TMYvRtv7YJkuhg980o1pjpSiu2JfpQLI128+TZUIKifCWA2Rryzqu5t\nmNgsEpuJHzzp1T4DMnl+Epc+xe5N9Jsm3z5uQxj/AOTQjrTzdQJwM0WGWSR1\n7NFQwpy7Q7WisGdHihfBkHlRl0KqTA8YwHEPI5cwFbwLli1n1Xu4RR/H3vfq\nBEdc+jTXonK03BxD04PvChgv+ADb/bki64UmU0qxquQkFWWdnS8G7lHRfsqO\nS577MJ5PXRU91a11nPrw10CLlVeg8fXfcwkbjgdYUcQJ69JJUH3HTm2S0wke\n27dE9FAXmQ9oDYYD5ad4K0QfhNQsGjjFmjNr7KNMe47+1+Z6udHcRcCdhorz\nJcQEx566SNeLYJAlwrlOBv/1SbP6sRWRu9yznby7iiKnw7rrbaRSP6uRwUVh\nau6Pu0kKGJymSifqpMk/I/5cQuUysUVjqKi7VBPZ7bpERmKZUctkXPLIQiKc\nriU6ss6SWYr01g+lyF4/vHUkJkY//BenZf17bCR4ZLJumWHt1WJhd+Pbq5ks\nQutY\r\n=uYZU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJQmnmJN5TaeuQrwUAXXOu+yki2ysS6FWX5dSsKWnVUwIhALFm+U53ZgMBr4LyYJwJmNaatns7nw2bcMJkxuiqWcSo"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.28_1595883693908_0.8685146624692879"},"_hasShrinkwrap":false},"5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.2","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"94aacde2148acdabfb3ac8930877cedb5cf58d41","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FLw3LY2SYyKdbCjWD/hgsffO2GWDf8JmGllqjbZEQdWXz44de6JeNmmTn/KlUXGxYHvXEv/Vryxhm8L8SZ0TLA==","shasum":"d23fd15688fa0f59516581600d13df83d3ca4137","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0.tgz","fileCount":39,"unpackedSize":189994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0DUCRA9TVsSAnZWagAA7UsP/iFVQlFcd3IIJsYhuTOB\nyKBTYDNXJPiKqmMp/4YL7XVXmJa9OwTJ0l6Vo1/6x5N68wP8fq/GHyo1X8JP\nGcJt0z/Ak2EZT1W01qbp06ItGj1D28yYy2CNkpxZtteKgRITAO/nxQ4KXFvA\n3kpG0hd3d0hRDv5YLP//7pQHDq+hqmUnIY5SXEDlewThVNksdC1QydnYV76F\nkyIjw9m4hMGlHme6xatNFbt/i9HvLeCvKO4pggRnLC7n9mVqr+PvSIaBNJ6U\n61t6TSTaxGDNlWS2BvGQnuFLfOvaeb6lXY8XA6jWbFoVz1LpMIyTHzsKHMoT\nwtcziWaJwgU4/rkcYtUuNJAqJijD3aRu64GYfISQxUrwEboYJLqTVNlE6Yv0\n2kwI8rAgbsvd41Mi1g1FIJECK68MQ/Je8kiEFnvatHFJ9Rf1ZUtzmwYVfxx8\nCxYQuLBMxyu/IR6mgRYduw1bqL+69Iv8qb41xdc+I9YK5wFS0NCztpc2Mkeb\nTbE2L9D5SPlZKVyAEeHElCPN0/4SrzlvP/60hc8SGGUC+pYw9UogtJknipPv\nslAlkJkmpWFnvHuGZ0w+WyZAV9vJbslENFLlfQKn3tcpTDReVQH2VZKWQCsb\nuiof9B+dU6toRj1EidlNBN+0noQ8DmgYg+SDhgqfw7/dQOcZ8omvy5qvzZHr\nNfsg\r\n=Pb6n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkZe7GAgKhPt9c1mYwx3cdRVx+PkBA7u76/GmFQ+dNhAiAvipdn/hVhW7PhYw90JgfRlvf2SuSU70n8n2YEi+8TBg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0_1595883731802_0.5991881432069663"},"_hasShrinkwrap":false},"5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0","gitHead":"48e5693ec025b2ec9c3e46704b250d2c19ec33ec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tTkxv9YNKvdlWXGobCojUNUJ8U+9JAVdMOXOMBgLxQcUWKGx66ood01eJcOTUoKRi2cPjfBUqb4e7V02RcfRiA==","shasum":"58d2de515ddead177f02aebcb5744cbacb179292","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0.tgz","fileCount":39,"unpackedSize":189994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH1f8CRA9TVsSAnZWagAAvFoP/1I+MfWuBB9xL7/OGGJb\nKazF19duuOJCMk5OvMXYv1me88lhritsmDWude0uPpDqg2U6oyA1vqlZsGA3\nBvcG0jXceMCViynPlCWSFmcrx75RhyXNxIbXZE0izDt6yud4cGnoa3XHA24L\nyFC9WoLfjJSQI1SWls6V9C3IIPtF4JF9hkzOznT1crTtDnA14161vxOOCDYs\nvspFfACszFE4DfX6NDkKzrpTARDU7kNfAz2FpLD+OQfyuGh3cdxJGi4LON2p\n/fkyS8p2Q0n3QDX7jmvvsmTiq7pzAv/o6XKovIAbQl3Q/H6mmbXeKfXTn25A\nuPTUf6PxKrkcilhTRNo7REOZoIE1f7Hh2MfhEVc9mPM/nrXP/giVZn78/sBX\niuHrHFY4q2rQWELuHlFrvBTc959K37uQQdPt8kk7jZpiwdHXtU74tJiKztYn\nKBmu/PRj2ryd6C7J4SudkwsqIprbvPpyvcvYioK1EQwxhYwWOF+owULoPgI7\nJkHzrooqYJVZ/TgYyRRkHWcIVqSts/86VhnLHteULO+Azb6ODPFsDQAscpSl\nYLxmoW+5ncdVlbznzPcNB7DcETVKWnQgO2zVkvyfpRIrRK9LEvPcEp/+uyvs\ny/8hdm+IblrOAcFu/FkYLV42At/057Dc3bwpuh0Rmb6vRrmGLzCXjZ9mHI3K\nB8IS\r\n=Zp+c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+VA8XPSWBpcEZVEOgXGsC1S63dUmCODp1JL9lrvs6DwIgOkqOIKlChr+nYI1oTzlU+G8pfpELeBv0Omy7xDWzOjE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0_1595889659409_0.3894881556054215"},"_hasShrinkwrap":false},"5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9b66ca67f34c317336b4aeb9e8d4f395733d3129","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-lG58W2GGf/G8idZh7/JSsoDXBlp5rA8n2aj0yAZe8ug6A4VrOwc4rdQQXngJxrX2uVuhqAwQXSJk/lfGk5D4rQ==","shasum":"4aa9c7dd973b4e52a50bbee63326a4e832e0d6ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0.tgz","fileCount":39,"unpackedSize":189994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH1hQCRA9TVsSAnZWagAAASwP/38MozmC2lJNqmHwUN7g\n54q8vv6Dh+/GpIjnU5gSukAl5nlz0Mj19GfYStZzayM6m+M5OWgrQW5Np77/\n+oaBqamHbgWgvRt3zfMv8VL5mAbw6vpPhwh22A2rxl0rmbZgXDO4/v4jeK6S\nknjNV0h37JMBodVGGwBD3UvNoITNTtO+56DwLKKvvEz5fVDjL8tnx5Eqfrfy\noiRy+MmfXiPqyz7WwjGPdJuibWdiCbv4qJGQrAkOmHQk2F+uA5sdbLs6PGO3\ncBjHEtWwhj7NaP15qiOtQHRzNJO7w0rJM6SN0k4frKAvWgnva6YFti5K3SvR\nQzwKVh9iqmnYM3aOlCVJJHzrfoKBRUtYjkSWtXbzXAWXcnWvrZDhoOKewY2k\n7Q1zqmYjIC5x3nXMUAA47OHOiaNRIbuF6zyJG1RoT2M9XGYJaAF7l1xTCOyY\nmrXSq20+Ke4OWLpyFFF5/nVRgFyVArr+PoXmOYWVyI7IpzPCdbSd4ag3yDSE\n587BdKoWtRUoEPFOTWsW11kI4kod1PxskGYW6vWWz+54nAVXY03ldJRHpCSM\nxgtklHosqks+ILDGtMtPR85zQghzFDWmF8pyVbx+AvzzbHPLIzE/0Wb8cAAg\nfoI56nJfj+sXBQE/pEYo6nvdCVQ10QNW42wthcYoGtaAT0OzQVmLNid9AWic\nWjho\r\n=v8yq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaq26XrfsL0cyr6HeziquO4Ukk9mB/BGjevjHF0OR/8wIgT3KWzc8r1rgvN2pcd9lILJU8pD/cmLcKg9oMnXnK/OM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0_1595889743638_0.4430808140777416"},"_hasShrinkwrap":false},"5.0.29":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.29","gitHead":"690d981ce906eab5a2e6fe4efeccdb89e63c2a45","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.29","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ogvxpSRuaIARRPXYAN9xtUQMrSkvLE4qd19IKgyHaZpm1BWTc7D1y9YQ7cmoD4GiCG0e3OEJ7nqK91dOx2noCQ==","shasum":"0b851b69c0db9bb3fd83b29ad357e7af4c81f9a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.29.tgz","fileCount":39,"unpackedSize":190226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH1hnCRA9TVsSAnZWagAANvwP/j40D0avnd3cTEWbUlfg\nZaunWR7Lrr1K/w36qZIE1GyVCg4ZxZTZFN3yby/D6dCrLJ0IUFjncVP3Q9jm\nifitGjuWeyr6lkoy2AmizDVcDhit3wlQe++88eYxcJRJkIM4yllFyJMEeFzF\n3oSMQD8QpOBxCDDmE3FPwLxvgx04iIdZp+yAqhUziCZZDorPJxZsLENybutX\ny2bQ8lJn/8BwmFvoF9QyaP63ozBpvW5kitIZpxBc894Dzx6/6Hzn2V9JLZpJ\nIdi3/X5jlUGrJdaQhJYdItbS88BkgE38upLZZSf4hRg1xj+he6cv62xyHLhN\nqySaOZKUGGsZxG4WfhB1czAret8609UUGYKKsfltv5xru8E1aPVvq0wsm1G4\nA1iKPqy4w5kWS+Hwb18CAxIuXyfXadfm1aR8FvlK5xUJLP8g5S+Tbvh1vDtu\nvDJN1a7TJo1MJzhJxJsvSqVOiV1CwratdHpUAKmNHPH1IcO4oXHRsVVXe0MA\n2TRME2/48KWYaWsyWmCMOOGYbdexq3wBUJkjI60R6obaesLdwHV2OswZ3zwS\n0jWEUr0vQeuRmYNdF5Sy4+AoF+irVt3tt4/momZ7R9vCIZ4HVL6/KjHgf801\nq0bIweS8VwaLV/llQRoLLx1A9gpsYbgWfQAlRw3mlVXe4lhkT9gJeHJAZaSr\n7Cw2\r\n=o0WP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo2MvFnussy9o1lQSBwFPo3orzFePSTIVlVd3JgvpR1AIhAPnyqeKI+zHn2fAGX/oLC8O609DM/bcRLp1liAQg7mzb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.29_1595889766701_0.7668644211160043"},"_hasShrinkwrap":false},"5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"690d981ce906eab5a2e6fe4efeccdb89e63c2a45","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-201hN311qkMp5Ibdb0z1AJQRIa3+ic9B9DFiJBGEYqbLRsk+cwk7jqz0CXMfrG5GayExtyx1gSKH8XQBJGxHww==","shasum":"736c4ee0b8c89f79d90c5403ad91e18fb17d01ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0.tgz","fileCount":39,"unpackedSize":190269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH1iFCRA9TVsSAnZWagAAWvUQAKFrKqdmciy9QyUyGeRr\n0K1UtZhUcYDkSQxlWqYSX61O+DU/KVq5/FNWZfoVxsz5lyetxWhJQh9CqP8C\ntRqsxfhVhdv3qVcykdHtcNOXUvj3iVyo5mtsqe7IRh69hmMpj/KT04hRV7t8\nF0EUW6v5WGEY1qiQAdry3k0ocVBPB6jx1Y1QfuXaDryIEEn1H2YFGLmvWzgR\nvhGbb8kmEjAkWKoQmOCmhCcagm95EZ3beOVXk16ymhoufdJasJEZj6nVh0dE\nBSXcqAK/Twbnf60IY4wLjJzTC1m7UzSFbQRTuClClzCQwb0ZKDOAUlglk21a\nrrMA4+na8839Uwtbkg8tJg73YlgpS0FwsLkbZvzMyTMW41CQ0g61lujw5UNn\nrJcJPGJ311IkGc2PSBzVopkFfdFHkaGV6sV5PAOitNzi9r2Nvqyk3wNpZOP2\nS6/zWFzHSg1wl+xMOJf3JXOTAbXPrxhprhUho1BbPJWJfD14hV+R81bpNzJn\ndACFjYJtkdxWYMYJmczsRSVKH/fTs7iYOeQam/J/XuIxYMFXrz6opK+WvvOP\nDojEQsZNR8NgbxzkdeFblUany+rwsxkzkYEuyJFxqe/Vrop7n6Q+b7k4K/5h\nyZ/jBGOrx3S4S0LF7pLNsdROUyI+VAWvhcwtX9CQkHR6ZYJTQoAESZtwjRc2\n20k6\r\n=aQ+4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqVuZXAn4ii7qM9S0f4fyDruJ68GbKxGpYbAKuSsEQagIhAJCHzcWFOwlodDI9Dv+m2Y2ohYmp76d9sH4Low2MyCzQ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0_1595889796588_0.3248968320121368"},"_hasShrinkwrap":false},"5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0","gitHead":"813e4b0163cdb956e2ad97d3442bfbc3e92a6477","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-seu4a49P17Jl6VwZ8hmDq/j7SfYLY/ae3/w7y6Ae9ZZQfNuLIAfzNHwdHHoXhTtpq1mn3hC2n7z8BFT5Vy435Q==","shasum":"5c79cb4f04eab76ecd4a98b51075e2846cbd6d98","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0.tgz","fileCount":39,"unpackedSize":190269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIABhCRA9TVsSAnZWagAAdi0P/3ZmsMQVS35DLNPKcx5f\nF27yJUVaoHWU9sLmnz+Ni/eJuqhVFpQq4X3qZ61yk19VlQuDbLN3F0S8kRmP\nWu9fUNSYjRWHpHcSvJv9Ce6DgtnLzwc2rEKPqyakBGIftwZG+ssiQ2sS3oX5\nQmWW/kZ9fMZqSgeFOiBamJy/o/fD4QAjBSwQKTlSikTl9pbQmmmaDg2HRtRx\n8PZS3J16jgZ4flp1WvhypTh14t6sAQPUX0ZZJxcGjZ8BC2RO6jeJbRWdXzVL\nlJUvUMWBgxyqS2BQMWlQolatnaBruDQ3puE46i1XgAg/bAVeEmP55cNz4Flk\nXrs7mQ21ymPpvpiRgGnszT3Q77eHyUrVLWIY/HLglEbOB73CVlzK09cmktRf\n24gALWIokbnq+9Wmk0h4oFcynqdcw/6KHq95B92PBo6MuaPaB0/m6Y2ypYZY\ngJwsXYA7P6UobB0MhulgpGAXjmbqhLHsaWYB+6zc8piHVtpkdXFO59wr7qGT\n6OqNthFxIc10XXATkyPIqQAvPIRW/U60/d9c4qfza5Lv0whjps44D+yCSKYs\nD6ycUufFaavyjfi9BIU0yupG9e7akTecQzPcYMxFddVmJqggJUrHWXZ1Q8KF\nGd82STqd1fey1/C5mKHyFjhcpU+Dh38nhlCPlm+icygoDBIF2Cr3/qSKrmdM\n0qui\r\n=w5iW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmf/A+fikM7VUY6gTQIWs/gjzNA9ifykyfkuIiqwTOoQIgdQ+bPZ0Zipi0LZU62OMNfTm7mUXJNiQ2G43ONg4a99g="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0_1595932768559_0.8247924930435828"},"_hasShrinkwrap":false},"5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"df504a5caf8f02c02720aa1777bd456c0dbd27c7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-TlQFbe44X/6KKJd/bCiojIPZbyot9j8vWWERPQ+KFIUiCwMU4rZAMat1bwM1aADC9t7hyXL/Rm+J/vgjB6gjcA==","shasum":"99b816af28657a0dd42e6b882f23dcabc63e30c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0.tgz","fileCount":39,"unpackedSize":190269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIAC4CRA9TVsSAnZWagAAs/gP/A3TjhnGOMbQrS5ojnv9\nuB2cd76IR2St3KH4Jbw1DXuD/Y97dGWXLldhOoc9skUG2A6WdOiP3aw+LHtX\ntpjeGcbDyHMc+TkCqlmYv4vgy5la2Fp9gZWnjfgCMiB24tB+OFCjqUbVA3mt\nwjC1wOCbaMFtQgHaZo2/drH3s3qfqAUXe4Cc75AOgNPprzhYgSYvaXrGda4u\njdfhf0OiOgQ93BxoBuHCKwfjsR5n/EIDJOKT8vxW1YdJw0MOMSB7LyG4EKl+\niWuXzr/0dPmY2+IjW2dl1SeoULI/rJ5j/6JC9717wZ/2NzGt3nkexNP1riq8\nGpvdUGfEo7JLE1tvvydjYUoQfkAq1sYWNFwmSwheQVViKHsyx0pzeMDnvWR/\nk2bNvw3AADx6k0hY/RgHcmAlWtB7M4wUTg5SyNjIjhk1hGIP4jJgYKLwajtP\n0M88/zAyrzAC01gPiZyjkN2ncnWcWwsfBSPFFrDoqZTXRJZGV13/EwXisAfD\nhx8zW8IePNbgxEFB/VGsISQ9zfmbFZBx/xLp6TKodnilNaMFBqhSIixoOnIY\nO0JZqlu52l/FD4MkGUFaR2GAwEvSdKX04HCj7rQl2EONDEbmAK5QTf3HTts6\nqxL0mGi3aKEkmo22zf7CgVRvop34Lrx4MU+TsC/U5w34i/ggQVvAhOXeLKem\n8R1v\r\n=9RGe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5iaCgXBQU+9RBj0p1ZgTkmuIspAmo9xpiPJKRNRCMMAiEAu5OkVCTHz55sQ1wN12FYXXFrXkBEr7Og3NIBKLswNBE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0_1595932855825_0.5628043360575186"},"_hasShrinkwrap":false},"5.0.30":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.30","gitHead":"b28cf20f3d562a3e398bc1bca13bbb4e659ab362","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.30","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yr6FiOXVcYxn3ZcM+8cJuLnT8lXhO9iuYoHAqBYOrk8wAq1mTlSCynNjbMyijBifAtAO/x9dpxSU99/hUpQDcw==","shasum":"b358410ae093100574acdc25e3d911000b4a108a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.30.tgz","fileCount":39,"unpackedSize":190504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIAD1CRA9TVsSAnZWagAAkpEQAILjh83A0xaF8aPXm90A\nWYpcErUAGOb8ECudSNQVlZsVNr8bpThqd9QizwFiyxKVpUEkwH2d/EfzAbOS\n6t3xuMP074ObuZFESqLGQOfMGriYVEHDALmoKTZgnEJ/TNhCX+zeiQZvSyj8\naO5HJVDnqg96c1QUbSB6FYZ3ct8dPTVXnQso3N+FaP8tzflXDeZo5R2Wutz5\nD1eulNRdGOpswD4MJPCZoVI2itBJrTGFHX3E9Y4lVHeJb2RmtMX4x2zNDfB6\n2VGFORorZwIB/o1Cp+tdkkCayFABKSFDd4lYZW19PPvMDxEPaGAkfctnCtGA\nqwjj/6yzrydWFMwBQIhEtLFCScXBuNj4NkAraNzlyEzjq6dzKzcoZzotE7ck\nkQNFgwpJRbTRx+XyMN4t5cjCPpC8olI7I4USvERyMj4kdb+0CBQ5eHRbO2xE\nf854yyYKIbfuW9keWp/NLroT9bIo37hnDVNrol2VKEJc0NeBiUddAsQpp4Ci\ncgX89UZOf+Cb3cokmpm8gpGAHV6438M2I2RlNFaatK5b0YtLPWKMun57E5Bo\nlRtWIcFAo9+cuAoFDdjxtJ7BA/NkynlcX0afRRJ7z/dtBTCjXGFRi8pJO0a6\n6d4/Y3zEWtinyuQdBiFR1UTMT7BLBe0aKzDnbsB30pHQzzUCBP1EB0K/v18L\nR8Co\r\n=pybz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENa8qwDl9ekmzkAVzsX+BsZHMhjF9FhhBLD8E47EiyfAiBhP43Ga7/11jfTkTcjg8uMu0IK+juaeLAP8RrD8mDwAg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.30_1595932917179_0.522541314390766"},"_hasShrinkwrap":false},"5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.26","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b28cf20f3d562a3e398bc1bca13bbb4e659ab362","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Kovdrzc0U/c+8K+q5a+7UtwKTqF41YyNzFAw+GeCZRxN1gcm29BsGKYi72wcwVzdRCJl3oes1OoB5rUos4CMxw==","shasum":"df4e6afeef8821ce2ac47dd36c48e9d0bb1c331d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0.tgz","fileCount":39,"unpackedSize":190547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIAEgCRA9TVsSAnZWagAAZAMQAJ+x+Teu+KRmBvQF24WM\neGXH5lf4LR1VV3XqAGCI/1IIQY0vl+y68y7jx5jY6A0CuITcOY0X4++/EB6Y\nxg1bmRnCh99t53fi/fLcmt9iHadqrGYtsqeNS5YOVxSgNcWvCwaVFwaOLT1L\nW2dHYOGz8RQceoeoWjkfD0UmeRsA4cxWMHatl2FeBRRwKytmYCbR7KKfRHFn\nG1HiNHr9Td1qdrv7dk+yRUwweB59D+7QXAN/mEp3FUpwuhl3tc7GHooT4RrH\ne3+PGTnh1YRljjbgicAQIqODa91HPidz0/FpTQFDSpQnA1EF6h502NNklz1f\nfNYcgUr3sMZb5IGP6ydR5snQaPfvrIcXg8KHcVEAsuZ249ES823+b6ilXd0W\n84BUpWnO8ZB7HjftCpEpn+ctQaC/5sBU1FBONrjU5pE24mVPUdBRreDPfH85\n5V7hk6YTw1f3Y9t6dfb8xtKAmheSXmAlPsrvx6YV1L6GlXMF+sb8SDGbbzV5\nPB0+qVl/CP45eIbf0ralaq2qJqtIndone3HavFW6FyNhQrcTBCoe4mw3dpdx\nfFFRb1aSEB27B6LP3dhMR0wgK33blf+v7noPD74B3zoMpmAkoG6Rq0El0Wrq\njERinA2ucWspNec6TYvSkH6lSdTxincLRMkhvGvN4bTQBbpnyh4Y3eoGamG+\nvMCL\r\n=+dZD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBhpO2Txqw/+omcxystnpV4lwH8t9HHh5aTudffKPy7AiEAwzbmP88+k/v/+VtDSPHq/oA5/fPFxxrmGNX3yCxNfKc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0_1595932959550_0.3374073934204156"},"_hasShrinkwrap":false},"5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0","gitHead":"8f4c64fdc957567b2141e5486ebf98c200da1fd7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PcTCUb2JjpA2hfdDtm4HLv3kFR6lNrP3XORrw/kLj9Yay4N2wKoWtKLUzpWkE5y9MwRkIUM9fxOypp3e9HQWLA==","shasum":"faa7804bef7c91cf2eea28bfe7b71c705fde8a21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0.tgz","fileCount":39,"unpackedSize":190547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILIMCRA9TVsSAnZWagAAIGwP/iDnRw+ORLts3SWCeB8g\nAAHuc8hI9AUnc5/Oxv5Y3tYnoZYkn+HUmMG2bkwfQzaNdFtV3kbOUe8jOlWN\nBXg7iUOD1NmH3n9WRXf+PJDi4OHLJS09cnO2Z67tsl2y3Tx/kPj0cfA1xaI2\nCCV/cBTe4CGBLYvN4ulzoPowt4cx/FlRlByuYeS234MZzoVUYc5ZK/gpSMN4\nkueci5zqaoD6EprAmy0S6XtK/RLREqf5tvYQ6v1upV4DUhplIZxjHpQkLsqP\ni0i5SpJVwilXs1e/bwnACqY0ep557fgt95E+oL2j4xU0DP1YCQqSHebuDW5x\nmVkxJhz/a6evpAUOIUVW3XUMcCrEoXjvnqRUuQpIW7e2N4WcCBQbp3YrDRAv\n/dfAWAyA5Gsqbx0ZPQSw6TNC57G/vOWHHFagWe9SlEg7nY1ZYJi4SZhs8xKE\nZ4g2PMFt8i3i/RANKzU33U5tAFBmqBQ2J48Vox+gY0vfoOclNyYRRfA5TfJf\nv/1Y5+gFZ/8rZNKGjoWqvZf5biNnJ+zUjEB3Y1o0FeDZ1Xf45vQJgYYuJKZU\nhXRuRS0jaxTXCMIj6rpE1EJbsoLDlRyh3cqyt8ZyIwrzoE5TqEqNoJ5f1eJS\nBlN7GLeROgFJXkpWVDL/MUCnOq+OwIFK11bxahz/2t6u9tRL3HtQYzhv5CFc\nXzzY\r\n=fkxP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXIjnXTl0J1Ipvpc7kGhiti87EgxApsjB6P0UGthtgwQIhAKQuqbkMPP7+XboN9hU1vHcrD6XvUr1CIfOUU0Z/iJFn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0_1595978251880_0.3440115519069533"},"_hasShrinkwrap":false},"5.0.31":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.31","gitHead":"a483c3920b0d7b3f44f785ac1fcca8fceb1a251f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.31","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GvQ8VzaciMDM0p5XXMopYePuAwBkH5IGKOJQ1+TQamDXZBrdk4TZst5naecdK+a/7dhyu9KBmwv7TyxgvSfioQ==","shasum":"6182a3a6ed905c5250f00442cda2f17c70bde994","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.31.tgz","fileCount":39,"unpackedSize":190788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILJ3CRA9TVsSAnZWagAA1j4P/0Ic6R/qE9480kFZSm4P\nSnzk5hcW5CNw3wZlZL3HBN/5U2eI8758ERUEzL3zss8HRh6H1b3OnVRc2SIX\n5ylyL3+ZMvOfqsgYSDTIwVfo3p+wFyIpDjx1hMgtGHVQCk5kVBX7VMuZiCIV\nHWHilqOPeRMSFRy6ol6YUNMjr+Zg+tJqtRrzYbyV4I5Ygctd1t7JE641zXID\n/itI+vZxebS+GJVGAlcJ0CSIDeQnKvzHUT1vA026mtd3SO/0+3swE44JfBxz\na1djQ6gcwlW3fLQA7IHITi5tBF9sQXbxNPhtu7V9VZh8yDedRzEK3u3z/u+9\nPupHU0+AvuR+GJv/V6wTq6l9T3iv0YYIK7ZhloN5Bp5h/qzIz5sSavkCe1or\nfYBY9VyiRZXg0MdtpyCH5wmx+O4fqY44EXRh2KQvP8swscZz945uO2u6+I20\njdlrW1nhTEgw9GFZJCYhaRku6wZe3iaBLM7Vpr3HkSQGJI374U7pWf89HH8f\nsW3utIDdmIcQJr5vdKRr05W4+171Vklpm4svbAWs6WpE3dl8tZg2x/cKXpJb\nlzaYdZPW67C7dOeFFQML8t5dNVV+t2v38rc0VPaG7DEgZ4MPqhojIEv4SGT7\n3df/vdN//jC/PEGI4OeU5XJ/mNc934UJq95o4rZMl/1T1dvK9hj9blqpkVwd\nqYa+\r\n=2lap\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD34VT3agoQlEC0SSe++8hF1dWo345G+YCuFpLJC6nfNAIhANyNNQBAK4aVUQa5Vr+sH1SgChHgvgUcDHeO8U2mkY27"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.31_1595978358385_0.29325210067628316"},"_hasShrinkwrap":false},"5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-liwf5i9MTFFgf/Rg/Shgk5z2kzRHfyK5vWPQYlfUqPudqZi3sB/z9uBmUWGNPVtWqDsLIS4S5WMp+6j9LzlDdA==","shasum":"3fe2f613e8216d7b8d6890e37119b0d3e7810689","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0.tgz","fileCount":39,"unpackedSize":190547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILKKCRA9TVsSAnZWagAAwOsP+QFtLJnI6/k+0l0ewmav\nSJvZVNao792OcNsLSL0XOWdo1OCIS89pZHJDsYXWRQnUZ5CiHjfRGljY+dQU\nYbpGK+/tB2+ZuabsofsgRozSMhpnM/20Y95mYqYVZVew29cqiAFauQLwtNV2\nS+lvXr8LdlTBIix12sKyKTIBf4K4ILys22Gbb3pnT8z9zNLL6+H5DKAvq9H2\n1RIoVBdIhsp9a4LtkXI57TfXRY28woXKJZVy7KDlA0vZF4Ef7hnmwnLhLY5j\nSHiALNQgS+1bEtX2XflMRiZjEJ/OEQ/bTNoKJGEEaxXKT+rd5dA//bOcAivk\neyZuW7hDO9wQ+Uv98F1xi3BYBRf7rAmThsCNDGvMtRyOChDcjZBiOLxXflrl\nNnT/UR7w8prAXL8gZZ0AWFkZiw0Nrr6TBKY2K2zx1aX/YEBKoQ8eM7GVhFWc\n3VWC+3yA8STTCJN9yIJXM2PkUNGripWmjYYyl7h69MhQqSmOm6HGzB7JYIvZ\n6Qezv3zGZNMZ0HIKw+ND+y3lwmOXyDGDK1IkNGCwTpddHsj7fRQPB/y/Phm+\nwJMvoo7AznxlVUzETCaD95mEK2VFh0/MJ5dxjRB9fQkf89BULJn0uD1UwX3v\nsG3OULJbLQPOamv+3qnxF4+O6YjIOtN5FMQg8oCyFJJEYnG3mjsQ2OHoIOe3\n9uGj\r\n=gm0T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1XTkB1QN3nzSfNSVQglXzaKRxV3qKBgG2zDnIpIgB7AiEAxVkaxW9zFXhxh04Sq9beeGgypnwhW9fwPghLM6fWmis="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0_1595978377670_0.3860254283923439"},"_hasShrinkwrap":false},"5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.1","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.1"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a483c3920b0d7b3f44f785ac1fcca8fceb1a251f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-B+aUHaBkc7z0dLoascSrbNe89+Q/Ncyx0d5LF88W8DpHp5W5vJWpWD6SvoOdWGMQpt2TKeiNTNZbBLMf8LXwRw==","shasum":"39734a3592b3ffe10dd48838056842e2e7275baf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0.tgz","fileCount":39,"unpackedSize":190831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILKXCRA9TVsSAnZWagAAjn0P/2HLIb0lLjRQLBIEeDl0\nFIds7Lmf72ISGgR3Fr4W8PZooofbIg3NwEBI1PZ5pp0rMgf6q+ibPpCXbp7/\np9pPEwqu6afClo8h+PomneOZ1LzqjnPVEnHic2seCmFq2smLRvzWQ8QsNEn4\nR1sUqc6ot0qu6UPXlmKeFshxd4Kd/fzLLoduuK+06oN2UtMUv5xJtjCYo1qs\nrc2KVWFv6t1WzcDBXtF7eeP2DXfH6q8kcYdRAWXytp7r8i1Y+w4vvcaG+qYw\nbUVE5AyjJ/U98JmfPRlwTNw00bPMbvMavZDczBhmGo5zdzr4NjEU+VQ5olvB\n7vZG4mal38Hywp4MEM2Iur8axFdh4CVGWTar6CCXoVhQZY3Q+2fgNyxftK0O\nVDnQ3KVCwFjoUJg8+iI4QC63ii0BXsf9GDCQxSQzSKAFXqySQ+5iUXV9t70T\niW1BX7AWG9ORDpAB0leN7PyXvqxhqOUgOAYQ4DjDWhJkFrlYRBDdcrzNu78p\n+kwuu84ZnvgzHZAtbJE/mIK2Zray3cs0UF/cUOHlpyhG4Npe4rI5x5xmxj47\nrugD7iSfGpjxrnquxzPzSfkkuQDmGJ4WvRjskJIat01pj4m3GFjPDJWaTytl\nEyRC32gQpWtzUKWveJfbZOeK7vy6wNxVUJytpDBwulEYvICyKsSOrGUlYhSq\nblvg\r\n=wTsc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXU50rHeLMUj11kUMLyuOMBliK8da9nrgaLTbXTyBW7wIhAKy6U+zzhMqbmkE914E1kYkRseILp9+g9x18l/lHi5xF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0_1595978391238_0.41774764125010444"},"_hasShrinkwrap":false},"5.0.32-8779c925c419c3883592e491a005b787140559d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.32-8779c925c419c3883592e491a005b787140559d4.0","gitHead":"8779c925c419c3883592e491a005b787140559d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.32-8779c925c419c3883592e491a005b787140559d4.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iPfZjp1JA6eCBaIxtesi+nbk06rV8LQ+NS5oFcC+qF65BJfmQuwVleV67i/iwUAaa+Qfvhg06P7nDtsk2kJ86w==","shasum":"8ba729a983e05f9b05b4e8c9ffb676c10f5a1fa5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.32-8779c925c419c3883592e491a005b787140559d4.0.tgz","fileCount":39,"unpackedSize":190831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMmXCRA9TVsSAnZWagAARiQP/jMxPHPWkQkHfc4kdrjz\n+Gd5bl+J8DIq41CNPzeUME4Q2dOGjBMhenYOjrBQfSXoAZHOA7Ln4hqFlsNL\nC4+hbqJtEEj+1vgM/1Vt4XNbwymB8oqur2lzDtzzF61SFVc+mCXM6DMxZq3+\nw4tVI33ukfMU5ca2jzxn8wAl7BKoljcn4A4zQAl3U5XOFa4WJHo1jNiHjgMb\nWOBIiroIBEWIaP6IEmOGyU4x4Gk9OigFxVlJO0gligNBdH4w8cb4zpCcRlvq\nLnSaY0x1Vxhp9xeRLxqtLXo/T3nzYcCKw+d6OoRDk/rDOylxC3+otPnsEqKK\n/gjYYCiHqzsw6emCnRcO5GTlJ2qsMcfxDFQkQqqWeDxxlKzWED9BXbRIEJhM\nT1C/ig6ibpGV7C0Xutw0rdM1VvUxHeFP7N0c7+bO1gkYV1sXyQa9NjFOI9zX\n7Dk2Q8USxuS6LtGczyv1Mr4ZZqrDvw7GF9hUpjKce614hw2TobVM5IpRDF3k\ndSOEdcMlUdR8ABd6P4LoGigg6S6teysdW5D+9zSgwQqcAY1B2c8JhGy5Srou\nbQC20QUEvrJy6EfGt2z1lOeLmjIR/mfIZXK4tpe0kKHVSooW4/W8/EKTfLXm\nC1oeoyBdgiO+ax2LLDtPnz8mM1X1UKPa48iavvITWAaaexpfDlrL2n1XA/Vw\nWrLu\r\n=/x33\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkJEi2X4oCAGrArB5nX2kpYSIiYoSZIG1Aozjakv3sXgIge5vZ7T44F3OFw+Lq2TjiVHNgmO2VglJAvQHomXLLpwY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.32-8779c925c419c3883592e491a005b787140559d4.0_1595984278932_0.5555143096457911"},"_hasShrinkwrap":false},"5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8696ab60bbd1e060f09526afc66fd253114960fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FQpifJ3BelGShsSv9E31p1wQ1WxO5aU7QHH40Ay+z2avm7EjtGxbGUnZHTTkhjMI9NhUSL5dP8woDgI0tt9m3g==","shasum":"681367791d1a4e1aae61711b7e172e96afee28ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0.tgz","fileCount":39,"unpackedSize":190831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMoCCRA9TVsSAnZWagAAorsP/3asPqGrLHmrt8oJ4fBO\nwaSrPexWiFeswEEuBWBzOWwKNnIZQTkz8yMgwCg7uaOHwVxKzq5Eysv/dW2v\nJ8rHJRxHVXoOkXIKtMy+LctlQYq974LNLoW5PMwIY4pjeioVat9c26FFGVtM\nmRsJR5Oo/IIMNDrmDSNYTGiLXjauM7BZfHhHKWSTHxu/W7qLDDrpN7rLchLJ\niI2egHsU3aspd0VzMhvMohf+MCUysqJMV60UnxkHVuSqhD9FeiuoctZcDEU2\nhXletjumOJsnWqNg27e0DQBtZScH4l7yEThMEW/ZESdf+XPqb/z+/V6Bgy4Z\nMkU9ngSOLDO73P1AM935nLMk26MYh2e7xe0N743TrUk2qDDlZ5M0arcm0UXL\nqaXx4Vi8XMvE1YQYr+xQDVZpYc3EkNpX7ZG9pm9Qf7YL+f5NpvzDiwbPcGOR\nCKtXExTIbhm1A0fcbKCH5XllgBwqdwbTL5zgpvrz5LhWGjplrvxlyYDzalkI\n3aN2My+0xv34xKWZw5RhaxsV4S89U2l86JDFw2m4nmmkI1Zmfz8Pny+NLPaU\n5CG2h+wyf7lKgjssay0m+q8thVwsxDJqmNJzSeapXhDgGHJtAtAiaeOeCDWw\nNXGjS4FIRXVX63x/9l5OGGOljQbvY3XOgse+iCEu7xmmFgIOWLkCKb02CByb\nI7KZ\r\n=LMwn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiPj3m4od3bAvmRYcYoLFy4wgq/Is5nBXHWkVEVRFtAAIhAP5DZRHSoO2vp88siG2ctuBBQrka+odZ6Jyulu1ABNHE"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0_1595984386381_0.4781625608087303"},"_hasShrinkwrap":false},"5.0.32":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.32","gitHead":"0f1bbef99846ee4c675427f4944aea2c826e41ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.32","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2gfICZOCkyKnfissW1syxzDqg06HuJHuxp+cH0AAE+WvmK2f11HdUjF8Fe0MV0V5MiBeex6XTpXJn3d4IMmqiA==","shasum":"92015bb43145288e23756e0716ca1fb36d02a4ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.32.tgz","fileCount":39,"unpackedSize":191080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMoSCRA9TVsSAnZWagAAKYwQAITXs45md+e4X8fsqOR5\nPsJNGN/5lqJpck3SnVikLAH2+J9IARjPeLEhach5WmShAMLEpIxKGsSlgjwI\nbksNL/v/iC6uH3KVmNcvaQObzHIIlV6qpli2TtAAjNjqbZ2ZN7dqz/ZGiwF6\ny0Ut63qtDYpVg0n0ZaxJcZl2XDySXfzCd65S3U+Z9a3GoTN9HBHUA93S5v8y\nKsEAa7o8Yjahy6mIQlrE4kmUb1EHsAvwRpNH3ghawNkjWp6FA6sizBMTagl4\nkbqiPojCy91V+JkI4MUL9yvTLfMM9vwS/Ia+zLKCDc+1Oo/RDdd1Ho1izjnY\nqD6ZWhkRuqC2lkP32Rgbb/CZvA6xaFzgyPmzYwqlYsqX3rdX5hUvLK5lLOrn\nYCU0ehEc9ojS33k+Fv0Flmc2BdUxQQ8icZRg2pG/1mDayqxFCqQ8NT+o464K\nDLEgKVoLy27vVeCX2T/vlvpKp5YBHAwEZ1bkycZdUpqFDG6NQi77qxysJQP8\nUov3cWHG4kio7//Kv8Kpk3PFuc28u+gmvrP+NHdGUHobH5OMzzIWahrjrMR4\nqKTz/mSvcWngQoMOg/nCHc4RVfvsIo9M8gfDCBFn2wV21O3lZH1feZYTf94s\nUJZoMnsH3TaYo2mr515pEO4DmQr3Ov20hpNNpvMPV6LaED5cdlR/VE9s7yx/\nzxg4\r\n=BUt4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzdlyuNtKL9WZiCULHCeyqirU5ixaMstAZBB6i/uWttAIhAKKYneIDMGoi96Jzqmf0SAzsblD/pjhc6tgutzzehw2e"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.32_1595984401807_0.49182741106124106"},"_hasShrinkwrap":false},"5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.12","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0f1bbef99846ee4c675427f4944aea2c826e41ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7QEAD3Qd1S3Ne0ppzcOYUuHF5WyrVNS2BqH5p45+iQldrRaOib5KFjmcc4/a0KVOx1Ch/kO1w06BB4w4JJnA0Q==","shasum":"8ff6a2a16e01e24252fecaea0558b648075319b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0.tgz","fileCount":39,"unpackedSize":191123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMo7CRA9TVsSAnZWagAAX9MP/2yjAvxPgXQ+i+Mh4+VW\nfUf5CsYFvsNcoG9UnTF6ucNhFknnZufVji6nJpDjS1NiCsvHcL0s9gqCPS5I\nJbKhWF/wsDr/VtK12LKiEQhYO1FcW4REN5VNEyDQ5EBHK1hMeSqAmWFnAu0I\nGmpQzVtq50HaQvfpdq3v/bmz319uVikWt0ZcVI3fC8dJQrSfrdhiA0LhRnAe\nO4eJ2tmzH8MnDK2EN1v5e3vOI8b1n17VzbqiX8rKZSROJKk0NqxKWNmxUG93\njlHrbt9JH5/vZgO21UCNLUub7/BGh4cyr5NgnU45+CUHE06PwssH+D/wHvqG\nFp3wdIW+HzybSLAEPKZWYPj/HbEorlkfx003cqVfcUyxjpeATlREs2HpV2f3\niDQVkrfSoOUXNsXfs5yptVFtDl9kMuyfhF6B2imiD+H8cJcjEG6gfGKSCocj\nrPrJNRtb+/HAJMT8YFZiEqAi88KGj/z56Lep5yNwyU+ggLVErJ7IkTL8umr1\nWkGYOz940XZRify9Qp1DUn5YtblsPff2TIKYCkWzJpTu9YPeummuLrcBSh65\nNk8xtz7JXgxFK7TqC0OsNau+BnIiE3TEGadJcETnQc1/+BziN6GY5ij3Hagl\nlhHe4h1LZydaY8kUlmSqKGfxNTsh4mnmaDYleFZ9FGc3Henxr99xGlFwSdrI\n7zGC\r\n=Y41P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbsoJZ/NvizPPrGtXtIHHS+V951mNWq9ExvGmbb87LKAiEA0fFSbPxT0V0z2BUYRgUakozjd7fju8KZea5GcODn1Ts="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0_1595984442511_0.47783051385618225"},"_hasShrinkwrap":false},"5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0","gitHead":"7d7a3c14cafab844cb365a274b3fc7dafe4aa611","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-0SlJah2Ullh/4kTs9QvPPnzUx8auGqEs2iycIh6R4BurgacYZAPz3M1A92tEp4zD4JRj8S7bdKaNfDVeIyKFtg==","shasum":"e387a9d87451475b4000d217bb90537a7be327ed","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0.tgz","fileCount":39,"unpackedSize":191123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIaztCRA9TVsSAnZWagAARWUP/0PWwd3c2cPNsRYPjWHK\ncjtzPeotNbcp0IiBm2blR1EzEWmFQfGKYVhPnemMWmwGaj83rCjmbPU6q2tS\nu8+Nl5xAM7Lf0iZouOfIoqmt/cStiFKN6wM77DnxUXhc7kxa6oYrkKsea+fg\nrRAsLO/Yp/pppQHMJR7cBhFwoZsk/54Ec9El+EkeaSKfn2dlOp9Fe230acLt\n/uvy39YDX15CtjHKdWX/hhbLJr6jimn6Nz5JW99cCxAOYdzrOMZoPS4WQN1a\nw6XAmo1AnI/prZpNopjAxchB3P6wxZcunAjU5WoX2r2UU3dFvkQCxxwakShN\nZAHnYMJ5ishIMVkEgPuiTNwCQigmee4Qd3pAJxK0xazwLUaq2NKhz/lhWqzl\n+dxmIgvqfIHLk+FurN5bvBzC5VMR1+olhjJykqzOWTZrznDlFY3NWLs3rxQ0\niQkzKTvFDIsZerTHl1163tq3w4B8UHwwTeLAWjrironGNogDsoTTKZc5Jl+F\nrsGMYD0+7uij5DDLaTRwYshjEHHjV4P9Sw/v+Gf8/gkR8qaKgLrJ3Ef7EU+6\n2yp15YnkU5zD5yGqtAyqtJsjLP6qmukpjsgqSuGzQ9OCWBibYNQ3FjCZBXon\ndXOoCZ/6wRobHHInHu080YIFuk492mwBOl5ezUBjODq88x4IQVcB1ws6UqFt\naO88\r\n=HUlZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQxh+9Y/Nz/82k8ZovQnv8v5foBruga73U/d2FtmPO9wIgfxLsC6+O2ZWAvcJCSCm2HsEIRnIUTGdjpT6lPlM4SJs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0_1596042477267_0.8375515249801622"},"_hasShrinkwrap":false},"5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1d2be942c9b3039c7b7d841fe77c95ace344649b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2CHJERWNmu8DaPYbk4Y30KKiwcm5Yx9Lzp5xvpPdn0H72EtEsj4NiYMOaBbghb20Us+jNd8w1aty+UnGBYkplA==","shasum":"498a312ade82d9939696db62013320c8962e67ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0.tgz","fileCount":39,"unpackedSize":191123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa1fCRA9TVsSAnZWagAAEBAP/1k6a9SURLMfW3m/4YDe\n++f9aUqmXXsxSLs+eBC9IHrklhK6/PZMmfTnzhXGOHkaDQxTq19QqCL4GKUo\nXQkKNsaMS21Efg9KIksJhzzPQ9bE/Bmocn1xSsJFVMW9eglrh4aG0yll/GOo\ntC0DhThxp00D5DtCyNxLqFoyLhcbWvVJY6Iu4bVuyRxZ+vbS67IOvkH6SilF\nk77KbgmlsiumH73usBFKgO/oV1b6KC+onEmqhc663b6Tw2pTGp5lpRA9gOG3\nDbbWdRvvNrYhyEVa6TkHkJkBoeiiQGNOrg8DHkTCpI0OJQMB9sM0ypQtlKC2\njtx17nYxHpKvhUb4kJVBfD7i5oeODscLXg3afsN5HJBQidY5F2BMUdw2SBL/\nUoBkhDKz8phiTO1b00a5qTncu9I3WrKdwg+MMayj/Q6dRZilIFRKF9DP1EgN\nhKUfo/AvRxY0gLguACp21IxEpRWdvhKbfIWCfEeFmKK+LoaXfzoFF5m+iNDv\nxe8QoVfJw4F7kk08nZh/8irKSEPnJiAqgzsTjxHke/MfoSjcT2v9JrUtSZV5\n4ZTIWas9k79MSiWQctqPIzyfrCZrZ3Bbz2ScKcp6wPco6abjjoqNrWDSPjPy\nXQfVvnhahkR3Ygr2lkqvK755VCg/hpTfdKt8eZ10/e7uQ0oQFT/wVHRpaE+4\nDUuI\r\n=bhML\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAsZwPLuX1Jn489BvET1AmPE4yt4JT7FAabMSJ1PamYAIgfedRKO/1qNV7lYbhuAZoGMuS1bytAsRd8UGFyfpH58o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0_1596042591113_0.14206441906637046"},"_hasShrinkwrap":false},"5.0.33":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.33","gitHead":"2a1881031a3e97a4d91d5819b9c9d5001045e5fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.33","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-S1ELphgloiNDzj4XARSknTrvCqVDU0BoAvwJqKO7bOvHqmp6ZKT/imcibJ2ePMlG9J1KLoYtSJukL7xjlLqXmA==","shasum":"964816cec9fef6204f3073b08f49ef35d058d366","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.33.tgz","fileCount":39,"unpackedSize":191365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa1xCRA9TVsSAnZWagAAdIYQAJ/5HWPzmZ/KweuZPm5l\nACT0M9SIlaVAdrm1+eVyYRrdNssd3Gux697o8n0aJyGwGCZyQ33NNNRYSuR9\nIEiKOvUVxZUtHXnBYuP1tUV3r1DuRThqQ7kTBPdmBt6xeMsknRQ87BvESudI\nfOMs4UpSk1KZKS/SD/QwjjP6Y217VV3YVnaSdsUcA0h6bLeGw9PgsHRlVkUq\nrIDCSL20I/1MsrQaQujAXaEZQfDChh+V4RTgc8QjEfwO2UUWtpjQzEk2urPJ\nHJjWbjqPcc1amWKI98anPrn+DwF5qAjoXd78NCwpdtwy7PBRUVKZXRqeHMCb\n1YgFj1wSfO2kyKby+ZYR1/nygAmMmKF4avan8ZhSVBmgRncMywyvUxY1VJh9\nvgESxPTZTiMuE7E1GSMqfcatM09VlpvLnfSCAkQ5Q5bGxeQ3s76dfs0LCZw6\nhI/ekFYlxRLRsuiR7dHZu5AxbRyN7B5nSBZzKqlxipcN2Y2qlLZUgQAfIJmA\n+1oYffI10xDEHHgdPbsJmAB6YpkRg6IsRYvd2LkfXEjwvh+cP+cvF5L9DqDD\nAuHdVgnqf7OszDltDmk9YN5UEe1U7pGe/0Y8oEC1HBa4c7bJF9wrgbRvmm8B\n80+bH4bGtM76aBw/LcNTpAy3W0qlG4AA9O31HTyNmxNqUBLvc1+So7taWS3v\nHEK/\r\n=afwf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5O+STK6QTtRV7urg9DrJnk0Hy0Y+9Wld8jQYz6izUWwIhAL5qOn4glM8qGiJTKgB9xEcyjqCWoRON2ymJXMmZCB2b"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.33_1596042608349_0.8114888094648904"},"_hasShrinkwrap":false},"5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2a1881031a3e97a4d91d5819b9c9d5001045e5fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t9L1e9UL0scOWdT12sS+yo1S3dRxtv0ZhnhNLBrs62yJQXUyn0Jh7sKa43MOotzNP31rFgd/Tl0ob2xcggDuYw==","shasum":"e8a51ff6b7d17166280e3a9d3e50f2e2f0b66bc0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0.tgz","fileCount":39,"unpackedSize":191408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa2VCRA9TVsSAnZWagAA7hIP/jXJpCkSXwC9bo7UPYAa\n/w4H0NNhsydCHsk22d1n4h+2aD3IGGsApYxHZ6I8+DmT+Dg8mznEFZichTA4\n5yupaRIx3XyPIq1Z34sjR6Q1iNdNiPpca2jFRnNtFeCORx+TUBWO11TTo1KE\nHWHmu5IoeIUm347472FE1tIDU6Sgt8lhS63o4/0Gw1dvk9lX8Uv5hqD9I6gg\ngdL6zPrD7jiz0NXmlV1aBmPbAEZiXLRpzBWZxbX7sS7JQ2Qqn9VKNhHvteNz\nyj4PIJ+Yi5GfiXroNMrfQMqOXyS5O0P4rYrlB0vnz6ziQE0QVaxxD6EIF5jQ\n0lcEgoFo7XZgjobk4svfOh+yZNaNkyfaBtgrBbDFQszaRpN8AeiFdBABknNH\niaxm11oBr1iQEQ7d6ZMSAHA3JsINRw9fOLpyYSXEt2LMlwrI51iVkMwjGBDr\njvqFzMjms6xm9BDqDP41N4T/x//YdXQ+4bEwb4h0sA0DZPeRZdyeZmm9xd1L\nCBlaZtADyE8V2p5Iixia+ZBa9A85DlJ6gn+61U1J6agsXem5qeICreuTgeoC\nzZ1Q+UhqwnZQ98K5vYfLizQEG8k4U4C2VK27rLaqSTk9/E/IaRh6NmDn1rp0\nGN2ckFvOpICe+EdjWbojCJvF2r9WZKAHn8Vqlsru9p3sJ7/wnXUTIBVA+YXV\nL7Ub\r\n=E+jI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMGoi8QDwp7FDB+sZ7RnDS14tqUvrRfM3qzOIb74i5MAiBnlNcZyfpwgblp2uBttFwzvsdr4qZBV0BA1xP7St/SsA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0_1596042645143_0.3117079465666215"},"_hasShrinkwrap":false},"5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0","gitHead":"7135d9859e53b168524d59d1cdbc3ca25ab99ae6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4dCsae5zvrcrvqXMdy21459MKt5cXx0w8twWXuj63p348WpF+62c/RQg8Ro1LLJjBfOwHcwLEJqgkybcpJaXsw==","shasum":"ec4158bb35abd00adfa4e9d4ae33627412d0ba00","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0.tgz","fileCount":39,"unpackedSize":191408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrUdCRA9TVsSAnZWagAALsMP/2H7Lzb+tIZ0EBOVLjUZ\nh/vbKxGfkwFuPiKjHzbkGeNyTajtE9L73QSK1irT4+eUwa+gnIwYEMxySae0\nXx6M1V/+iBgf+hx8PtrLW2AIOeqcSeKnX5q+3K6jAS7VFhONA5jllekhkfJm\nQSBajpNNjLQgwEWkgw8QOb9WK0/iBLqYIf/zPZrL4gUEqAouKYuJDhHcQoaX\nGUSiFa8HC1PnyIwJvozqk8U1zr/a5zvnJKfb3EaMRpPqaWUkFh6GaXq3ZlmM\nNRZDVyrSwChReSKGxPmyu3fvBCqSVv/ZAslp5pndCba8a8kLS2+3QlczMUf5\niplc4roZbh1StvK/lZDZLcJeAsCGfsUjHNm0FBqPcIyx/Pm+yiexyHech95I\nTGYvYUslveTMA+y9JW58EhaxZEdGn4zyixoAV+znrcUg92Rh1Ltv5iWMTFh5\n/hBa0sGg4sX6q/aaS7QXMquPfVjbgJNr38mPv2c9H+421pv85OmFLC7Tbzmw\nLJGv9TL/sJGoUFTrOc+fgU0E0+wPgPXn2ZgzZ+NNwHPUumBZO71iscsfnfa+\nTxFHqPJXhMWbmJFZRdM/f256XwWNH8UJpasHKwoccLc6+TBH1shwivS1Mi9c\n7UnOnc4yB8Owh8cQzopJsZUCQqUwmy55dgYbRO4Gzlz9e1Y4XY3Ph2iFUKJv\nI+76\r\n=9Kl4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCszO3WVM8uxICeDb2/3nXI1+ik/aAPfEPk2ufqF2qPOwIhAK/n1QIkONlNlv3JVv8h9fXgtl4Ff1bBCcEqCdnkIivb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0_1596110109051_0.6237200118056598"},"_hasShrinkwrap":false},"5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.0"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0","gitHead":"61d58933d51494466d2c66b1d54305a4bfd3ec2a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-W+6rcn5FqR5KAVcE/21CJOwUup+bOQnqHn7rwgDtGG72MnovvRki/4WFIeNBBpbqiqlaqk31QoCcsX6SF7tx0g==","shasum":"a8db6b3e7a23f9da2c57a0338ab6d3fe04806412","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0.tgz","fileCount":39,"unpackedSize":191408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrVICRA9TVsSAnZWagAA2asP/ixI5AdEDpREkCGib18N\nqJcbhLGKDZ0+l6B2VbVtSXwZ6O/5Vu/7Ml9biBWDxhMugSWzN+6APJM2MVOa\ndIZR2TISTQsewcbVxSXDNnt6DwgTuRoZEHYC0jLj8EPY/i2rvBCUZ5jLB/Dd\nQepRIFPEoQK4bONETBbWCkA2UHqW8AdIxcVgJO/nVjVLHDcGcqOEJrdgC+iQ\nvCiqK385B5gGlQ9Gpkgnf+a7AGPEraSlGVXGZsqAk0ZyWly4js6XMeYVKjug\n3bEaveJo64H26KtlV07dNs/ytJeg2q3Q48dMXdfKWcpIjXC5Z2EU7VuOYl8I\n8GY74oI7utywWZS6Yo2ilaP7ORL796cC4Ku+Wq7vuhYS+QQsZ2lYn1d2JcFt\no/eJEqXVoB24MPS7HxqLE1B77PHGhXuaguThrgfEw980cdjleXv3gGrMPm/o\nLGKpB140/K5ZDd8GKqfxxChMRrXkDR6+JdjLidGCCjtjQuRmks9u/NDNLJ6C\nSvekUWX7bz1fhpXH7EVntX1AsHcnfPxzX5CyidE6D/29gQAxqHt7RXieN/ML\nNFFT/EzcEIEP6GfNlop+j7Fgxkk9IcGQZQNIzfYbYWt1oznE3+kO+G8rHJlV\nL5leOEArWzqX/2dtsGDQo7aYaWZS1i0ac6uo5OIbOxwHzEWxyoE7FbY68WD+\nAd0R\r\n=V5Es\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHycBV6KIhzh/Pi00+1e3h9XzEI9zJFE5D1Hw7n1FAPvAiEAknVdjEh3fL1aQGUi3fyR4ROJ/6xQQk7UD8VzEj1osZs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0_1596110151551_0.01481908845151314"},"_hasShrinkwrap":false},"5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d3e3c8c91d164aef8d037cec9b634fb4759c91e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sJZEzsRqAT8PoU5M+zwLNiGT+ut7y/F74TzKiD8vJbMxIMEOEVIMjOUEIll46yRjJNWabnlxqLYcwSxNwqTNVg==","shasum":"7760fd4162e4d3b3ac30f4d2f1d1f4ce38a52057","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0.tgz","fileCount":39,"unpackedSize":191408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrVZCRA9TVsSAnZWagAA6KgQAJhOsGUL9My0MD/C4SxU\nr8SEyU6tZ/hNvmw2J17fheNCaK9VqA+tKgrkyKo0S2nDCt1bUuk3lVesSUzg\n4XaNvtQJeoe5UFj6sTq2L60Lyw63BjevRf0MUsjRw+g5mMxfHApoRj1lWK4B\na4mrOYNzc8qGQF/G5lrrC3lWhEn6YKUSftBmlq1exiZzuXfV6YNLAAM7yibe\nhQm1j3E10H3XC3Uxz8WrDuFU67DLXnhHGefBObTo3OCF0asvB9f9uEWxxB7+\nWWXXLv4j+CMyRkFBWbcg8Pqj45hjO+g+AOOAwXJ4nbvBLIsyzOnGXy1ZAh0P\n8cUH+gc3+0BlDqS/9nrWFLwJr5m6FWvwZ28X3hEJvzKyFQ6GBc6qqz94nEbu\n1GI/OeaWJXjRbqwL6WmuVO2dowN70LetxGIeqYq+5Jyn2CnZhZKwK8jB1drz\ngYEaDNwmRvfUnx1uk/424xG4Wu1YcT4zkGEa3utcba9FjI3MwQQj9AqNJ7qV\nU8XkR3AFz4Xfm7KpEqui9r5oRISIlx4TYLVCLymGHRjjbxQ/ypeLCZvRVGz2\nBhg+wsCoPR2YKVO/oIe8/f+8vBuey/7ymMSqPKCo4j5CxL0EGtnLv+JS+Rth\nUPsnCD2dHLbBgXHT5WOOMwGeiMy5bs7XGRODXbd9xLQ55siRO5iw5gIFP/eA\nuCQT\r\n=jlhb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACys3iWryCmKpB19LtK0BmsV4+LWzzshrhI+cvTbgfyAiEA4MolKVF9ybdmrX8ns2RhzuQaYakay3cIE2bGAkERoVI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0_1596110169503_0.8178083669236778"},"_hasShrinkwrap":false},"5.0.34":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.34","gitHead":"928d8c78af131cf10b148d0d92ba95fc4d92c7e3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.34","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-z1e4Ij7vEzUuHJKgjecKm6m1JerQcWXDBpdjmLtTCdSsy6ljib5AOxGz0w8k/1ZW3SZKh2YcAhhLjx7Ierwnjw==","shasum":"e962d15943844b4522ef353b6c35c7876bd0f4e7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.34.tgz","fileCount":39,"unpackedSize":191637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrVqCRA9TVsSAnZWagAAJDMP/3354BsFKOPaT57CLss4\n7+3nnxfo49Eh18m5Bg274cYOPORPS2/z44OM4pTPvnque3iVbPKdspSoyDsX\nBerDZunrRnzzj4Lu+48KJ8R+whhs97mEZIuVBSHKKHRo0LrDQZBklhfTUanG\ntkNx8JEzDIKv/b8FtrF1i7bQQ7HYUS04ftTR9Z4dinFlo5d4f/R9KTBI/6uf\nEnKXmGTqxPgthXF3O6e39+G4PKRAg91YCZ0xiJY3h0fBdKKnV6JpzzsZMzwg\n8d9t5OUohdip5u41KiVRuIjFE+eViLl1iurXpOgJvYJYv/0yeCctSoi6RbDL\nTZ3Oj8s6tMAzkmZOrt71W4qxFdISUfNXySebJs2L5lxvh2yst+StYrDZk2ZX\nylUwzNCOx61LOVjqu+gBVj5EXuxqp1ndDjHROkbEaguKwrKfOD/dn9ehOBdp\nnkW9L+ff5We2cZEZrdwJ3d+um/TLh6zIAc0xQ59VwLrCyvUl9vU6hTpR4xbD\nl1/cyG2Q36LqaGCu9X+aHowqNtkCZP14+LfFPR7o8kz44TEmbkqXE+beDr8i\na6dKXfWz4NOHXMj9ovCq/InPgRAbquDGW9JV4Jn0oJ+7XAGJAtSsU5ZR5s0h\n5sU+33gDMAvbKJ/zbDuAIBLIC4Nvsq8wdmcwxBR4WFcfnNK1AjH2iOXyE5Ay\nmA3z\r\n=cNgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoVobzJJQSIrMT/QUJMps2tSFfqramYZb7/VbcLPtd6AiBGRnt+SoxI7PEcaQb+IjbZ5QNnne0PdQIz6xoD0Ulh8A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.34_1596110185505_0.5643737001285694"},"_hasShrinkwrap":false},"5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"928d8c78af131cf10b148d0d92ba95fc4d92c7e3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9OAgu0n39LK/Bf6/RR2MGFPMy/Rh6nX/K2tvrYBpVlyTQibVPyLIXtccvyDTHZQoVEHbTWoNpIFs8YmhYrGkSQ==","shasum":"a6debb57de7f51572f6fee7961616272c1e0037d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0.tgz","fileCount":39,"unpackedSize":191680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrWoCRA9TVsSAnZWagAAvL8P/2wNGRyCj3rhHzRNFW8A\n+cTv1gV1JH/c2K1tBljWDzoe2fKWYvX8JpWaKd5VGLuc5rrY3DFEn9pNZSFA\nHO65htHXUutmFTT9bhDF3Wfoob0Xs6Vsjaiy+aI1MV2kqwhSfA9sr8Cw2VqE\nmFAUtQvq2ZKfhiNo6ETX9jM/72lmAEpUmIEJho8mIiqC7oDhrFcXtaL85rsR\nykGK2rsYSmy9QjFWeJuQuxLYTtz9dw3OTZG/DuoXG/dI+Suvos20DIFLhiXF\n1kFFG4WP0hk5WXJfumHB47wmdgiKvZ/ucwmpykJ6u+TvZBr9YNkRrLP7FlU5\nXcDxWZ83LzxhqD3owsVss2dAdbvb72I48SP40hHuJQdNw5WGXjhu5j9Q0FOC\n3fTNip7nBIkcXiYxqxlLUgkB4GG/iJZvva8hsZZEEQiStp6Mjm8aV0L6Zbt6\n1F1gxUXCaMgIORUIkNzZresuSjfB6j91dsnlHOAHWMPLGArLdkdP9nHkpkyo\ncJD/CG7qbYK3Ky4iZARY+HruvVLJ5FXF5aeo24DeGVymCicOTT0ib7dh5Sj2\njKoWmtxbI5VHTfWF5fJTpJiY2sNI+6S6obRgFy3VUhG7HGRImM5ZL4c/yeW7\nPV+Yn9l0QWe4GtsAl1sl2p5rgf8UDrmIjDINe/DbXYhfXZoqTSz5Xva0LvBQ\n8cqb\r\n=uCRG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBU3jAIytK8Z/yx24s0WaCdHJD7hqMQ0uycf4KcIxZh9AiEA/Df6pLv3s34NiLzIx9yPQrFC5DZDjdkUmzmbyrD9I7E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0_1596110247955_0.5247886117783864"},"_hasShrinkwrap":false},"5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"eb71cd249b29775768059228d77c2e19eba72769","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-m1ICUoBRgg5em6uwT5KQAnhRuCQXTmEOLqQbYDNqK0ugU08UIBOjZ/bR5zpdQIjN/xgzd6J6q1jp++fxjbTd8Q==","shasum":"a82a272b19eefb4d47f8496fecceb3eddc6f6e8c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0.tgz","fileCount":39,"unpackedSize":191680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrWyCRA9TVsSAnZWagAAix0P/iyJa6Jq8f98Lo9cmFmC\n9VOYtrNJrxWk69wxmaVzNa8cREIHfukcPkicadjLJWplBh773oLkmKYGYVl8\njWrYWK7xkUWVjRFkALgZl0SBEPn24x55uSufY0cD666kN1eVwXzqKYYJkHgS\n49gBUkTJsSjQ/6zCl3FHZBDqiufxc8ohAzjNCIqvn8JnVjeksA29YecqMfCx\nOKLA1au9OzPU59pdeszVo9ZimYUJ8CzRbqg/YAEWsN+U9Y/68awMKFHa43sI\nrhifqPBm6fLOCtC/DkHFvAUBgZXENYxAc1kWFzvhX7UDGA3sJ+mrNBPtcsxY\nXRa3Z7YzWkL8BagzWx6SRZj0pjwDb6o287wa8r9RCj4DWEbe/QH7BrI9v5cs\n7RCt3LXkpi1UFvYkZPtsUv/mdFebHgb8CIMH6NDgq2WIaRdZAbCMqEkz7Rd+\nkWlVfhmhn7YWayAl97iVMZu5UsKwOy5Y3sAGZi+DQWReucDGQeM7t41uRQdq\n3XJDXqv/cur6gKD7AMX11brenkGTUCTGirDsDmmBAClDFbugzuYkk0oK0Hc3\nHrVDk17uZMGMaQ3HIyUXq80vLUvsdMzQaF02WlShcYN433Mf8FeGD5Of3wCj\nlHjOHWBQ1Wx120lav6vSbrnMf/8Ns7pp+kF+moPOSlJqhTZ6Dhlu1dSEHCPf\n9gc4\r\n=dMFy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+eTy2vQRJY9OayHR8y0WIY3soJyAieauLZrFK7lNznwIgLvMNiT0+l+eHW4+pRqNPEHcpLce3QitDnFogC1jxqR8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0_1596110257659_0.37743916108813824"},"_hasShrinkwrap":false},"5.0.35":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.35","gitHead":"d4dd93af2d8275f1ef707cb5e482bef62374265f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.35","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Hm6UY/r0FvaevllmPsjl/59M/FfZyo2mMvx72PnOdxPqUipXNO5PXiXVETq/tqbuw66jGzcX8WPYpqF1c8W8pg==","shasum":"41b28dcc5f7bee0e009efe29d983b6a9709132b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.35.tgz","fileCount":39,"unpackedSize":191912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrXFCRA9TVsSAnZWagAAQ1gP/1STHkN70p9FIMzhOs9W\n2h6eoGRaQd0E1xwRZZ7KNvSoYgLv5FMF70bK0qc/cJLfdLPFPtJzwN14mEKZ\nY1CWEHYGOH7+yOE/FEu99oN/XxaZjHkzIsOJyHe6NlXVMMJ28jl/L6WmbIsf\nOO7ecRrGx3NaEpRDh+fc2KPkdzfRBQQVkxzj61sVykV+5k4IvZgVpRp9vcLc\nHP6cx1+5bMNTHwCa7spOjTrt4c2LNq7tEaa6y27aevR0Y7UqDSLdKWk5ucCh\n1tR/uHYGLZc1DCcVk+fMPYu43ItDci1t26KwF5UMjX+kelDqGFTeZ76YzCRq\nK4p8KnxHY8+SJ02Cg48gub7yQnOF9ikO05zQaTf9vFcXAMVcoPmBgTro3W64\noR/6l0kZbUh13WSd0Jhzqm8aymIbWAkO2ayGbp/g2SHglRJZIrYN0A7XjuZT\npXxteESuz5n8Hagr3G/jrMcrYIXdv+owru9WGMuZB+DUIR3DsbUdinLmf4QF\nmBFdvdTLVsT1wgKku95JDcDzPZEZwZ4+S59LwwstjRsjlLpTO53+IPTnLS/P\nyo9g2aF184l0Idl6fi6hQ3MFspWbiUzdqpbujtOGzpvtEHHXUm7wmV8cM3tl\nU4hkpAjnqPpH8SJYsJg/eeWE0UknixWINsbOTFFf2+jnAo1AMb6yG1TSySGD\nYy8C\r\n=I64B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6XWUz+DFEgTEmnv026D+ze09mqQK5P5N2TLBS9C2b5AiBmVmZcuf4MHGXPCiWlAHA4iWAUVvdBBZJy2upfFvtlpA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.35_1596110276775_0.3456148650410482"},"_hasShrinkwrap":false},"5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.7","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d4dd93af2d8275f1ef707cb5e482bef62374265f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2vL097xN+hmENfddj1udJmnbE4Azuvof/Z/qlLsIHIWK7V4hogwcQgN2J4xosTmaSG2MJQFWIlfO/Ga4j/lLSg==","shasum":"9e82649f89e167044bced2cf56faa99001a04018","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0.tgz","fileCount":39,"unpackedSize":191955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIrXnCRA9TVsSAnZWagAABuQP/0CEG8OhC9fJjHMVjMWW\nHF08+zeod8EdimgLoed3/SbhO9NWRPGDkWZLbavK0PESWWEydWqnQ65zifYL\ntfts2Lm7M4UseJPRhaRv1PicXMao+TuhJ9L0zPfP9H2ql36eMpqWFS0t4QmB\n+57LwaHwr3z8CT2Njz2v1/cpsaIuKfT6O+prZiRpMh58FFGZO8fhhNp3J3s5\nVWoChjwZo9IHN+PpAVW1ne0haWbVbJDAEy77l7KdEYRdW/WOa3BnVZrzgDcL\nMnSQdegsBPhsAHWitT4eZTrtTv01EptTOS/VYYmYy1tCJQs/yI4X1UWz1qnl\n7bhP4+BKDZSo7ZjdvdCxpvymc56pKUcssdi5cGekZN1tiVeEZBQxJ+DOEd58\nOCJWcQIuz+wbqBU6tQgka2LKRwSffepl3Ox8Dbb40eVhsdDPeDiNdKZON9RH\nmiLtFmJNYkdIF9MKps9RuUQit3jmI5N/iVdi+yuR9MM0LYEfjPMPrU1iWQLd\nQz+JNd9XYn0QLSHHzu5qG35ghzFADiTueqsAwFPlQ3hOdVtmL98GCqQnaRya\nCpxa8eg639cc/bk77uGFfds8fM/sHN3t4v1tYb58Etyn7fd0BckE+QPzfzra\nQDSi4BU88NEo+R9kwUGcY0EGH2QWic8jYKuXnWFeQKAhEWzsgL6Jx6vSL9FI\nceQH\r\n=yQlu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXujfa4M4w/sBTrqvx+Txg/MibkSykvMkwVOj8BUgaZwIhAP1ZexpHYukUusk/bBTlttVFHwkK9XvBDaTS/875t9l9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0_1596110310859_0.9647723778281323"},"_hasShrinkwrap":false},"5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0","gitHead":"a97757e51f93ccba933889c1ca1ed04988acfb63","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7F76FyqC/4c8qT0IYyV1KUfjv5w5RAWJ+Jbvj0mKa0LbOO2NbNpUfroAR/TcY4mZvzIF2uzlVNFY/U+PNYEGgA==","shasum":"8f54d6b209214fe0ef5dd4deb21f5af415a08d3e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0.tgz","fileCount":39,"unpackedSize":191955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCEfCRA9TVsSAnZWagAAsZIP/REwd92mZVUBRKQ9veGC\nKMLzKF+uh1wBxdwD9GT5J0jZ7Ufu+oOUlP623HCESiqlSZGgZ44iwydJAS4K\nlbfGH3KIQA+dwYIIoltLeMYPiMjYzEPojTWhcGM5WAh3HmHMB863KH9XZ034\nvHRce7sWVYXPv9AeAplCJSrngiOdvfJZk4H90jrTBe5whq/tQqz7Yh1M8m4H\nTJZQ1nZPHTicMYbyEMuvF/VAqq20g8ETaepwdWPcCm5XJZzSeFwT89cHADFK\nokh6Av63p+bP7YMy31k+OAzhGKNkqKx4w7avvo1AQuPCDdp3vnea3vWdrSFI\nWLgNR16Rvq8QYOoAIuF9Kqv77RTg3giKtOiqTNI4swLHWtT2L8bN65kg1dxs\nrYWFK9e0npFYFPYxcunoSaeoPdBUwFsuOgwDmHUO8L/jwitAUJKd8pc9U3m3\nh7pLgOP/0dEFI9kWCq0gTq0fwh5zmgrXHm0ktcEN6JBy7uUl4qzCBfeAC+6M\nYSYMQCvpeYdjqGNFfdzkBgI+RnwOojntI5ZCgEshyYwQ+RHYtkpgDrG97fQ8\nV/5NPn/t8ZQT9GlosH7HWlx5IbPC2BsqCiXXuQtDmbyRRvA+4Qxq4OytTmT7\nYoPH80hXE2CJIcIyqCJuNrmxA94LD5RUhw9Q/D+yCN3aDiK/s6PhzeJrn3TL\nP/MX\r\n=K/Rq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXezhfgYyKRYnOxW1VcQiNzVBbcJike4Yf/5yLQE2BrwIhAOqGoTO4QfyR4JGNvnt18Z7hebvEU37r5VGYaaj1Xrk/"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0_1596203294518_0.4231207429451962"},"_hasShrinkwrap":false},"5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3eeacfca1109dd7256067595ba3fb6fc50d72a58","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-iyImkG5wFyZH86esllPloeKrmMBQW4wAtNLvUQSHqB/HEdu3w+WRW0pAh/Hs79Hvp6/PKZSWJHNtytSAUiJ7/g==","shasum":"3be7e8cf76b74089bb296f8ff23cb5c480539a15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0.tgz","fileCount":39,"unpackedSize":191955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCFhCRA9TVsSAnZWagAAM/AP/jNkuoQcTUQcCO1R+6bq\nTluBhqJ3SORYSat/l4ZySKqgbXpctD14IKFPLrxTYFjaWk1Pp02OaeAOrUoD\nXJJX/yE8dWublguKBLeYY918BpNxDKQcQ2fOFII/TpToBMFDQLTfWwxNgtyF\nN8QXZ8W/KcTyrMNexO/tKOIPeoGnAezbe4Qt72MQdH/dBkQF7V5iTtY6BdB+\ngwgDcSJkSl8xEQ++fzuHJLLkOMJysMWFrT0EMZr9j6zFsGm74gVBuZCWfcO5\ngPtJM9CJjzW+kgBrzZ2+eqkPBByjesvVLfkFY1Ep32D8MW0xkO2j2d0ffsE6\ns0uVsp26t0Xh3bil4jPJVqXgjVfCNgxrQ0Ya9W+6TuoVXbwg9KXo1tEyHm0U\n/ENIGANl6MCTscQ3/C01p6g1mnZCxfvPBtQKT+pe3D0tdqflLnHF6paD+Ia5\n6qwxg9TJqx/6qAypy6kvQwLA7kRqy1zj1gro9oiDYLQz2LQt0/f/lyWzrUXp\nwQasTIhj1NDKKA4+pi+Ke59AdbDtGz5qAclSSbxnD3kIwGr0JROi+xeIGSOA\nsxRc+YjkMLwhUsB10aFM+XlCZWPHYPT5S6Lv2ojLNOQfTjRokXWl24Cf3UUG\nKFX6pI4rs3vNezTYpAzYV+gwMqsSj9isHIjs51tUmKj0JcNOGH92f80+vL9/\nXHt0\r\n=HyGF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAocdzwCvCRkGLAoBjZzCyDiEDUrqlIJGBIt2GhrsYzjAiEAyvhvSAd6h0KCZ8PHe1ln3P00JVfMlkR7QZaH6ombh5I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0_1596203360947_0.791825196563533"},"_hasShrinkwrap":false},"5.0.36":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.36","gitHead":"834bf263ee505d0e32f52fc19c57e2e5483a7cec","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.36","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZSknNNdCi2p9/UD6dwlvZukeaVWODqyXisfuckA1haVXEuczbEof9N+4i9oL9gmlAR9M4BzF4Nr/tE9/PSwNlA==","shasum":"a36442d8131497da96fa955369314f53f79b6790","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.36.tgz","fileCount":39,"unpackedSize":192194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCFxCRA9TVsSAnZWagAAo8sP/ia1+4Ms0OYPG8k61JBh\nnW19rt+hqaqToQRQoiMeuCEXXrpiJzIBmrIdumU0XtlVC1iT6RurKt3/ZGf9\nwx7VMRjmI5j4v/AjE83PLBqHpPSxCH0DFx7UrOJuebZrF2nTEuXHTSsseIjb\npeDNycowm7UgCwRwo6VnnWHdDQFwrWD7byP+7wJ8WWGfSc1Avs9g5s1F+83R\nosjcQQ5lqkmVz2SLJOZDSNz4KITEssjcvDsuwdqxOOrU0Q2eDIwZGOSgsgsP\n+590RmhQtpoqHM5YQqTZlFcywp1jYhN7oNFeSWcbvgLhURE0txnevq2j5VNX\nMQvi47/RnAP7WtJMsWWpGN9cgGaAqGpZ7XH2i7byZe/vHegedo8HsMe5cujo\n3ouJiEKrS86URWYQqZ63wOFVvo9Lhl9BeGXdVhK5i1w3NL0GARaC+zsheYTI\nvpmCnxzAXdMb0zRIRVYavA7N/VpCU7zmUrVr7rltA1vwxgxQCBkjsvBztE1B\nga1pS0AL+l9FzOgnglc7rDXny+8LfmZGfBc5A9kQY5DAP7zOWCDfT6OtAlKI\n20feuz5Y0dqcNe/zOzgvQkTyHhxZh9r92OocUqnYDNh920rUcfD8B07I248J\n9Cy3bfWcviOGtAVMtO1+S9bbhOhU4Gxls6iGA+lVxrtoHYd59/0QPLs0XP6I\nFBd2\r\n=Fl3j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFP82EH9b4lqHc1fhLpys+WFA5PO7rObChVWjfaaan6iAiEAheAKWUdm+8sw2HvBj+26PXrlASW2Y4rHbfW2xaB+hFg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.36_1596203377359_0.6939301214937228"},"_hasShrinkwrap":false},"5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.13","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"834bf263ee505d0e32f52fc19c57e2e5483a7cec","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PqVrP0ckB4bJ3uWkBtOOXP5CVWGwkXJ/S+gkwAPSuVDv8kbfHaOSa+NtesyKeRzOw5YjU3YtNdhFwniSfWUpaw==","shasum":"daeb969385f744fa1e122d035469c58b27e3818c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0.tgz","fileCount":39,"unpackedSize":192237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCGUCRA9TVsSAnZWagAAkAoP/2i/xyQIejlypJtnTzkb\nVQkY0buYtMIhLmms9sQ5UNQz4gNM6vv7FQ4GXObD54vKUJS2LYnSOwQY9OSY\nDNShJd1S7IUvxejvq2rHs7HjGJ1HHbGtf/3OQIA8tNVhTbPoE0nRDC9jsdtK\n18K9ylGf95MNJ0am/n7RWicZWRdirDWqJzfKzwE9qVetIkduSycVo10nYnKe\npbiAfJ0xxjAY9Ad2gEjCqYddhaKUVSACtzvwX/xJWdZ5fFYZyna8yqXGj5YY\nWZrA0KTN38do8XHW/JwSxXI8/tdQOc4GyWPecAA6iZvGYa0UrEl1Pn7wzYHi\nGUVt4vLsTbvtEhxcI/ILImwUlxGUv0WcVFVhmzpCHONxUtW2V1Ib4YImFil/\nNMexcLGcw3hx578ONznKpo6abGAuu+Dwj6RfFLyxyrusc+K2ylathmKJHHTN\nCgoB5ApJpp06pZr69wMHoUqNFkdqnOixPGP5hNty8Bu6ggXMt2tfp+63hH9v\nVR3m5EAxM0Sk8P3hwPUR2hpEV9XJxhfV7yx+AqEzcqF2mYHILNLntsV48NDM\n5hgUXsLV04dnN+VvabWnlF7nAuXGJ5WwKr4HqZ1ZipAtkQPvBkDBXrnTjKX1\nRMp5KBxnkppApLSpHIfRJLIynW/FFGg6RNBCyYhOcaBMkMjn7KDZtkMAdAtc\n3rzE\r\n=3opY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIQyBtBR4dad6Ui2IlzOaB/BihLm1inl1OBd0KuWOGjQIgfvcRJRpLFRoImq/boSJCN4FcPnC401CdfTeUxxLUjEA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0_1596203412448_0.42303750802610973"},"_hasShrinkwrap":false},"5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0","gitHead":"cf0d526148b2bff6ddd87f75ce4a2db48fe736c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-mP5hxRsS0iYwL7oz1vRK/KIEmwr/2jq4IcTUMVaYkLo66lc7KUWW9uK/DUvTmrmizroS+aGX3WJIasaeu1Wg1A==","shasum":"b5eaa6bab3a9d6eaf3978506be04a997811e29e6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0.tgz","fileCount":39,"unpackedSize":192237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCI3CRA9TVsSAnZWagAA7zoQAKIOFakVyekAJPWLensI\nynsL1Jf6u4+MK/kDw3klfv6uQFPCa3jDrW6zm8IVnB63vs39/qmog6m7k/qP\nIMOI153fZiRd7l9fjGx5touDTmLShGzUq8eoADwij8bQ4kUwLjUeXvklVoR2\nM9ulcQGOYefLnj2KplP9Af36nL+N44wOS/yYsDkkvKaXQIjla+L89QvGafgQ\nBia01yPhlJbmwWckp9uvhMIDPeQFDjmGuhmiL1qysLr0amsDnQ5isFexIq2R\nCbxfi5eRazVMSxhjKFYp1PvDK+PoRQjenDjmpKlzTvWbqV9idEBPKRGzmSu/\n2Mlh1Q3MVFBeMwZovAgwy8oNAu1qHpSUkgiXa6gBa3/igXxvRLV2R0KGFBVb\nU1xmtsPVSHQFTLeSXVtD+VYQCyBWeSIKP5KI9xX/V/IdsuABIBs2VP2aD0pB\nGlPqLsapBjYt9FWk3p0AA3nIr4HEZHUQselTfAr2QzD5YSO+dDj9uwvAX39H\nZMjXFNPCoxBLEo2LQOP1BydTR1KCvRy6pIr6NYH64SwYovIHAQb8xAxSXjle\ndh96gpCLpnqy8e46/wtgmCd2se90M+ZjEXMHbOZfkbalHg95NgeOepz/s3PL\nBOwGxRTM9MXP9C8a4wnvFyALLuD4HBHBCfgI7lISaOBE7S5B1olvEgLwtZh9\nWJGY\r\n=7jak\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/XyQdRZsX8dx5d5bCACTGlEgJq/rdxx35rJWnPe9XgAIhAJRAM74q/f50qBbt/q1bASxg9yLEv70gUjpT/uYDlATL"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0_1596203574913_0.9004621941989466"},"_hasShrinkwrap":false},"5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"962a7b406c3d6f1a9666e20943edae74b6770f42","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4WDpPZxws9tkv08bBiz+OZ7LI6uqADyH1rTZbQx6RNfdssQimpsx+IEJyCL/+a1gc1HclBjqb3u8wmfny7rrYw==","shasum":"09def6357aa94fceb58cacb84f06af48b7751d88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0.tgz","fileCount":39,"unpackedSize":192237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCKbCRA9TVsSAnZWagAA8qUP+gInT4qv02VEaJzcO29Z\nnzIyTqq5qqBOhB9mQdWfQkEKEa571EIAMdcZAcgMP5ZGWqSdvOx+TELDHZPV\nQ4hZs9vPksJOG8LBMgnrF7PEBHsJJJgYEDHt6qow7BSQ7yVeYElvbiK6v3hB\nhSvgN89s+6ShM65DT2ysmW4FpBC9qx5I/6y1CdKoGSATKtITIfEev0aQXj8j\nWJdcS4VMvuQHQIb6lq7umIe301YMtifzOVXL4r/8DKM34AAIKZf9QfOI4dgm\nDYj8VJ7awHcbJggTj9W3hZnJq/RpKQ3XsPBGqcLtd9nEIvt2E0MrAJnYVLyX\nhdoOkascLSYwYkoTh0u4oEFviDXDPjdVkknNHXfJTOdsAHuTkrV0PCk08eJL\n9aw98aV5ILdWqQ1MRRsfTXIkqcDwkCYPxmCpdDClKvEffUKaho5eYWHTDCk+\nHHGKWZf3VCVIaeWsfjeCjuR6FvtcIAoNfNzoDntVYKCs+ZA3tVbXXlXwVicx\nH/cnjUOwAmgAUC1Mmk82oMMFb2NIw9I/9433Sg3Ll6rm9WzRtnn97IGP3PkU\nlPC1q80iMEjeSlXyGdsEl2qcsReMbY1J5f8rBmplt5gB5hAaenkPPMdcNHDj\nA/jFRCvS03bXAkF4Y3EalurSdG3VUxehazdg84My/zba2ObQvoAdFwCifHzM\nhcPO\r\n=doIo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQDyFyv8ORCPztx/4IDHax3xA88TsMewnJv2QaLniB1AIhAJ0XpGcqXCNtGfghu7I0DhXWsaU1NF03k0KSyQefADyK"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0_1596203674709_0.26323030473929565"},"_hasShrinkwrap":false},"5.0.37":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.37","gitHead":"15c1ea0f3ad35ea7addd93243561af656eca3d7e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.37","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-I9w0YQB6Aiqshocrq54yMOFl7Cu8q8sFw1ToWJrxgkOU/uNIdFRhIPrOTA3sqLLCDATbD2/PMUkDsGH9HLoYzg==","shasum":"e023186d6b1179b8869f9890da0c09e038281c18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.37.tgz","fileCount":39,"unpackedSize":192479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCKrCRA9TVsSAnZWagAA3PEQAJ2ZfBm0sDxm9qr8A45b\ni9JbMSQc3foyjq6kp2ewb4YKfJe5QnMx2YgLsTi2I1V8KXbgWimsijBVwFcX\nqFlBLzpHmEOEOXATZUo+uqActBADl4yNdZ4hC3jCSqmRZ8RRI/wuX6qjzucC\nlZZ0Bs3uukdIH10Na2zJ+Nm9huX/5SQRAL0ExYCg+mcx8Lt9xkP/shwGxGgZ\nkbN5Ppxge2s9NA/m7RJRgQ3qQKlcgRxL9pkLWGP18qvDglbR5JEM8KJHqN5e\nhq8TLV2VczwSTpMTeODxevVbQAuyafofNFgoeE80t/L4QAAgZoZ8UK8Lsh4l\nyDfyVECEdv/Vt0F9VxPnRZRprLOaf7VsRyp6Fbt9s6FzHOj4awOSppX39E8R\nmPKKZcJiA7ZbKn/JB7ERtdmxdXgchGijj2TlSm1L8nndGVaNo8/4IDg40jgF\nvZIj/rmAfzA/DB6V9NI5DPtJqe5sqcyvIqpB2eDsdOV0TLaRAnN1Q5gY3fay\n0YExnE9WCBKvaO1E3DxktJTt4tCL3GkfUNRqjqbgML70txfwzJ3kC4z87O03\nciKWIQlxE6nOy7GzQxkmIvIAwowfnjJZAF6rqOy5ULUx1hOQ2qnK5/9n8pjr\nyy9nFaDJuwVgqL59ftnKz/d8+4SjtNLWzfOZu3L9DHm2i2UuasThXrMYtJC6\nasss\r\n=j94q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmgTn4T+som+zTPsouTr0uDb16kJQt9Rw6l0jPyj1rgAiEAwwE98Z7zsJF8xsarJyhsQph9soiLpY+6hNOWeRzh1Kc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.37_1596203690649_0.4285384036089108"},"_hasShrinkwrap":false},"5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.1","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"15c1ea0f3ad35ea7addd93243561af656eca3d7e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xKday/ISyz9Zi7gWKGoOvU3bePOI12OvU6Fvudmdph10ZXEEiDDH90j7DT/GUVvI9fmL61Epk2otZr1eOVRlmQ==","shasum":"a15e9df743cfee16ca43a547db956a1df0ae9c88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0.tgz","fileCount":39,"unpackedSize":192522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJCLTCRA9TVsSAnZWagAAEsIP/iqNnzMkHsa996QXQY1x\n726U/0wyNDT37yrAHPuIrQLg0KLuyhqGWAcJI3kObk+Ipx/p6mApFAmi7Rxl\nmPT5TGvybNIeU6QMpE1Dp47LA19Wc5IJ+k/ewsfCtox4v9MHZ0sqeJUfenju\nCJ3fUyrmNdllh2piHUmmE5P/6YM7lStFmqe6aVmZGgVx9sLUopEBvN/F7fTx\nGPBMsnmxPvv5/t+syK5WDGntkk9Kx2Hd+XmBmuHvZV0q0I6vXAnlT9MHjjoM\nfM/gaAG5vF9cxkis/KtatRH4xWXJK668CB0WHRxrWkXF7oMYv8SDu7GHjIWp\nEjYXcfVXRAXuLFpXhLttwh1vXb2jFE/zfx4ljD1z90EV7+XIMiyAt5jyFLUu\ngvk6itkKkjXlLO4z9MDJgdXWqjgwKzr+03Y+ItFQKnRC/BDVuo1uYNvoiF2R\nzAbr+StL/VEzJPIIxMdAC/Zc1Ewfg6UF5UUyidHqt4tdIBYh0rN6jgWuH2X1\nWHvFiXP38Dv86pjGUThdChjIO7yn/mbI9N9NhDJ+PUWQtJf8EMyDhst9Grt4\nXQFiEEsgi2+O5DFgfVrRCPhceR7eay4z9cBWwKHPgP20NX6lijCHMS0nWcu0\n3VzpfV5J/b6jUfrJL4JDd+Hh5WzGcHjGx0CJ/Y0ktH5p+Xnfi4ns38TkhWsL\nU84s\r\n=zdRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIApOKqwYrdfRwL64jISG3RI7MHR/CXTMeI6mNwVIEGBZAiBberWTk+tp3rFjw1exFkEmGtfqoHY1yfa+DpbEGgPs8Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0_1596203731392_0.5548149621123495"},"_hasShrinkwrap":false},"5.0.38-412f409058dbcaf7377b37a552694178e867d120.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.38-412f409058dbcaf7377b37a552694178e867d120.0","gitHead":"412f409058dbcaf7377b37a552694178e867d120","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.38-412f409058dbcaf7377b37a552694178e867d120.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-akAZTufFqdfeeBO7O+Snuhgb29Xb/olUgRwSSNT/7WZAf8Lvbxw7qIJRa72KlIMwywve9xFZHXWBest+vZpudg==","shasum":"f57545aeae0bfa66ef84e2617c561736294a5655","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.38-412f409058dbcaf7377b37a552694178e867d120.0.tgz","fileCount":39,"unpackedSize":192522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJGU8CRA9TVsSAnZWagAA+Y4P/iDIzcs4dfadt/nAEPFQ\nitd9crFyVDE6ar0OMAyIq6HU2+CKLa/QdWTcHEZwnUArhon5U/Hqh35hU0zo\nSU9xY8Sqoo0p+nlErLO75LplFnJdbVMoeJDdDu2g6Bt9pIVcTR3nT4wXTjYO\nbQCyTUrpA1CPBK4NlCgkn2jgLkGi7qAqez9coRb6LxkolpTLAKM5QPWzRral\nJ9oWBfOTV6dt+uAGALI2MqdFOIKEFv1+SGywoGp5a9yNljPK4mJH7CHoKnuK\nMWuqmfdbtiWNbfy6XvrcElu8KgT5f9+SMOnuROZbhBcm+hq2VrzYvOEXS5kX\nOVvqKZ6eEPF5RjIExUkFtUMzXEgbn/3lCiz5Ng0iZAt+zqYAcLUjBVCDhVYL\ntCEbWWvc1deTBzzXq2q/tR/eGZK1LGamLnC6SCZaVfSG1VBQW4YYVVRzz0Wx\n9LEYeCSiXQp0Z99kw9m1m0spDyGOGi0Adg7A5+ZLlmAJjSycbZaAajKWW6h1\n4xq/cfdAiggedOkLmXDvgNgx13yA63U8CIgFPzLoDtYQHEv6cFBdwdICDxth\nuR6ynKq2elGIq0pe5WcnwrFabJdQnhoXvNt3gmUrId+Zxiw+t3uVDrV62ygX\nClTqkSDG77H4qmMUZI2gwbT/RWzbVtBs+BdpfLZCLq8znvvjImbxfPODfG9h\n4zYI\r\n=dTnt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFqjj8dU/IRN4WEyQAQNPSBdNWR4Dj4KwD1KK+GYYdmgIgZunU1R/YSWVZmpkwFCH5rT2QdUy/rXlFFp3jd6HglCM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.38-412f409058dbcaf7377b37a552694178e867d120.0_1596220731863_0.053709927741538266"},"_hasShrinkwrap":false},"5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f0408d44bd648e1b0e3d1d282a10fe649e240572","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-I2KHFuNo8bCo15glRGWDYZY9vMSnh8dHp9edH8TuPmJZber6ukSEOiXNkLPhF3hF5EKaQKwZutW91lq9WEnaGg==","shasum":"0759788e036fd3f89264c325548817eba8c8592c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0.tgz","fileCount":39,"unpackedSize":192522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJGV1CRA9TVsSAnZWagAAr48P/0ZQjGE/3zZjqNpLhmKy\nbK/dNgVUNwWyyBgWJLw9nLzFkmV0lwZmpcxdW9qXj3JD3UNe/wCKm6TRLWgn\nYpg/s4SOTTUK7qx/a1jtWZW19H9MW4XcgWL5NinBTJ9sAvcNKRV+lg0RwngC\nBv4rJOkX+ICFyW08RNw8FWwNO22uouk03suJJzx2RkySPOgltEWDQDWIh6fp\nbZG/OgOF1j+yPc7Co/FvfMw6+vdTu0mWMBPR+4pD6Nd6zovBJAZ2y08e0Tlb\nEDAQA3m9HljDBse56+B7l0hqemRl3qvFFZiuS2DxDnmZCgcR5/0FXCjLK6sA\nifYlTXMIgZVkrbu93VJr7w1d7QHEnM6EPwkHdBkpbED6WDI3DKSRDMujmRZn\nPCfN9frTKiA983iFWzv1WXElNm0dEbdaZYadOL5YTG7WUbSvIQAF1CcmBL7O\nhU4tp1CtQXByHYpty+xViNpwIDfFGuFeqACFHkade3qaIPgzMVd6WfnFXg3g\nil16VwHwwzr3y3RCzMEtnahD+DfiRiC3j3o7282H4sxx+Fh4IWczuJGY6jlN\nNw6hIQxcuDdTnAck9IVmVDlBjbQ+hBwB313oEMrYRtcy5yqlep8zWfabOIhp\nkNYBLr8oorA5DZAZtDVaCgYk3kNyAnE9Qvmf8ViE+GxWQOgCM0Rn6+bim1Jm\nS7/n\r\n=nOLj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQlh77FhQjDluavSarufWN6/1Qu66x8T7k9MTTi/B9NQIgBrWe4TjOmOsmQdBX2nFoZC2IjHMmr0BQm/cC7PbXgLk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0_1596220789497_0.5007407611806158"},"_hasShrinkwrap":false},"5.0.38":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.38","gitHead":"e6aa0e2a5c24f5cc66755a830c55f41515988efe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.38","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wf6fAgeZVmCyo3jMoPRGK4KqgUkSTVWONMAToo5a8FEA2CvppPuf6uhIuaLL0JB/99sG7l7fSVm0gSxigWe86Q==","shasum":"cbf4691d557cfa293ad98f49efa9c4885b53b970","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.38.tgz","fileCount":39,"unpackedSize":192754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJGWRCRA9TVsSAnZWagAAWB0P/2aW4lgIc0sqmLj95pMn\nqtm11DoSFH7xizUFG5wzFs23VQQSrz9d9N1NEBzSsHgBus34as+/tTyJvQ+1\no/L67JYrz8rIQFw3yLAL23nrFr1SdOj2o7juetLqk6dtAkaTTlyO8Gom3GGi\n/FZ7aKHmw3YKlIpHzSvIf4F+Vg5+Vq9xizK4mrli4cujYCaTaOrjqQFzvG+1\naFytuzUOv658kSWMg3EI5VDgnjoSY6y50qlOhG1nbMrDNG/MwKHQcP0cRdtp\nw8uZ+nbu/n9dYnIKlLoj01jTfZvmW6htAuM8CE2L7ODqhMOcSzsY9e6DRs0C\nVOwjMVGL1sk3SuMXf2QfhYbaaRxKf20uhT4328qhaO2UBKkv5JKMu8XBh3Wl\nbdjdJSelw6Pu3mmVPX/6kbkmfiD6c25CscbxixIQg77tuOwNmmKDnEnFr5iR\nHPxP1iMC+HaqG5ItoIfHlypiRe3Ka2seMaHD2XVoXwVtr4EbMHsBnfV/Emls\nAIQE1pwdDUQutuCye318bE+LTLxlIgntlteze445aTxZ47fnCuvJ/7wxrq5P\nWhpL7cHronhkQyF+SGcQ6tTZcscSF2NzzKmBgR+kMDLKgVQ9EQ89xpfq7yJW\nENzfAWmmchK+QZUGdxwZF6XnuwS+ovXtlwl1Px3q1zmh6rmamxSGjbD7O5Ji\nBWT9\r\n=30ca\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSoSOlfx8bXAuW/exD12G0gHjQx7Hb9WN0GmmZDFa8qQIgNWSNtmD1sJGX8GAJ/5HAvd73UYxNoEcVFQDxkwqYdMY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.38_1596220817222_0.25571945482622604"},"_hasShrinkwrap":false},"5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.1.2","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.1.2"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e6aa0e2a5c24f5cc66755a830c55f41515988efe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xm6Ci18YcefxYN3WaFtEog0xYsE6US8SxbFK5G6Wz66mzq+Ls1oiLxaMi+zF7ahZwh5CuX18C7lO66QFO9jgkg==","shasum":"41c651a56208fa41f73f9f0d63f7c85d2246f88e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0.tgz","fileCount":39,"unpackedSize":192797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJGWyCRA9TVsSAnZWagAAhXQP/3tMH+oOfjD4QW7bCG3v\nqJp5pTuLiHSkVSvYtni4kdeHEYgnGVTg9igrWY852/1qepoiCJtSjKmMVmcQ\nNNMmhgti/va3Xihhzb6YfdlEgIu95y/LgqT/npwC9F2EbfJ3cDhJuXrZaL+t\nZjpe6YueLj6bc+1eKp5IGNUKyH2rLDLzKWRlkPkTCDHp+dXOTW6aRWKG62a5\n6l5lLJw7vL6z0ycQBd1osIa8h79v1vbpJnpXiOp1bTYfyss9d1zV9CXsoqlD\nYhyb0++7G7iY3yZoshN8WrDtqkD6gbO+F6mdmDbGdF2X0YhOayN3gEXDKZ2n\nR2PP8v1evmqg6TkM4f9Qkxzd4oNX8EkBrT3tMklqsF2I3iUj4qY9qROlW87w\nT/5troyV1gRIgbk0Pc2oa9mHC6E3Y9j8Q/r5Oq39sJgP0NQYzdp3KTissOBX\nWJoxCDK2Rzrd1fsZbHJzTuCVCDUxfGveI+u43AzlRGrKzw/jjk35cw/3zMOm\noIN/0n6Wn0qfryXanRfn9P3qXlEgIO8xjB125utvz0fR0MIdujOtqlJqpIDZ\nJfkIlMm4H7WXWnAmWy/ru7YlTgB3uysIPjVEi2jMIDBSNLkoDi9fkbAI0r7y\nchaZyyL/R5N8VSMaE5LjoToLqYQWTD2/xvXxRkLQLE7bHqu+LvSe1Kv4Lt/3\nLunb\r\n=pf3e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ0zTqKQYsF0UW7XMJsZVk07ob3bZman5XDVxZTeZe5QIgGfd8bwGEnAGjkJNiKgBH3R6mxrl4LNCiYsA3Es/gmB8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0_1596220850041_0.3426407557154936"},"_hasShrinkwrap":false},"5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0","gitHead":"adcea12363898e57d7068c1d67f27a2c938b4421","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-VE9DbVJDSfYMarJgqmXiQQUN5cFk8QnWGuzL71lkAeET1Q468UlWF/De7ftWrcuUYmXqSEObtl31vAZGyGy6+A==","shasum":"ae8c298cc28d5970f88dd2c48c390f7cab094ae7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0.tgz","fileCount":39,"unpackedSize":192797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKM94CRA9TVsSAnZWagAAVRcP/1u70k8s7a7FTWg8g1Ud\nwJUOaf+8xdwIyqaef48zVoKZS+FWhAy7dAfUKJAum4ExPvXKBJm2qgMjMzWf\nH1SmYiYJdzyhpjTU2WvNF3QLW2oDz3/CikhR/Y+wPwQCBunOMpRQvnx2KgFH\nUfnxz4eVMkI181tEoTYma3hUh+50PW50Rie7wQatMUQoi0P3l/1gR7aXazg1\nHza9wDOKcpCvMTrcL4qdyDwmIxkLApuWSuOscukuoqfFwaod0qRKuddhKIk6\nIdJPsO1HMJrAMom0MKdOmGFlTdGIT0dHTi3NlhdKI6QQazjMglTdM4lZUQ2z\nLn6B58iMS6LWwyZisjQyjZfqiTEd1jUAKYCAh8h47dipW/tfskYSLirlGGgi\nBr5XrWEfH3LvM8RfIZjX3fkqrll5Lvwm1eCE9weNoRjvtZSUjNJE4Y8DRmq/\niHO772IhwTDjB2NIagLNDmnuUXOcdxaX+Sh9w3vhbK1vuqF9a8Wi9C9u+ymi\nUexmAY69F3sY+hvNXCX9KRjaD4isUy6s5qbK17S5yNi50mlTAL07zwmjlbdr\nvQMnFmrGSkWem7jDCK6C5+xsjgl3FbL7X157jUoIZWjEtiR5+A9GRGFIagT7\nf6FrkMugT9vlkDFOBdnWNK67GT0TLrlI1gdAnM4m9kEcO1lhKasKuLb13fv/\npWiX\r\n=9Qec\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbHSU3J1cv1QQB3leUqKp5tUDVD+kyTV8Rt5f8ZARyzAIgfztsh2zY5wvPGNqHjgEi5841+TkTrZL8yfznuqOh6jw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0_1596510071736_0.03696231774930303"},"_hasShrinkwrap":false},"5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c4171c0eefe66339bf9510eef08c679922489b27","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AlQpTg95iPJPaqECJ2rkADTWjM1vmXBbKDckEIwdMa3OSO6Q9cXhojpwOhsIrTeWvsnIPR1s1kYngpDlqnu1tg==","shasum":"1a9a0378a02b617c202f81e3781c001d7beaacb9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0.tgz","fileCount":39,"unpackedSize":192797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKM/zCRA9TVsSAnZWagAA0WYP/0kX8/JDQXy6Oo/hK3vX\n+hxtfB1QltvB4VWohqHIrd6HOoSghe7DSbgsmaMbD+qJd8/rzuYvTsUBBemv\nCIzoqPgKhSGu8I0VeyEzQVKo/F4VNDeuVWWcdhNXZ6jBf0HicM03Wz8WX9o7\n2wd8kGl1mQkU49NrWdHCt4YS78mLqCO84vpIrSdi42B1oyeFQxNDhHqhY6qM\nvLBXSDDCZH7NNjo5bOw/AweG2w3k7mBv0yzL2xBZMI4h4PIax0mGKNTXAj8N\nEO3aeEa3HTUY1j6H5PiSVIZ9n03upG9V7za3LxMdeu7MHpwn4Oc7VmmAyyQS\np7ZfUWXX+RxcuzZExTXewnMYuSN3rLJP3FOa9Y1lPQya1J9qTCRE+DuLg/P7\nQri9DKsD8IoS4bxSGZ7wrxLNpy1kxCf0pj64IgGA9A7YvHcSyCj03RV1Ff92\ntDrSEJR8y/VD+ppaIzz3UtzcYFnCrRXNwA1Lfs5aiaM8DZPWoiyehERmcWy4\nN+d+2T6BSumm+0hac7oZVQEqoz8R4KbwTXzr/yCltIRMquBWrUrsDUipPXYv\ndd5xTKCZPrAXTq4PUNkLaxirhdUxuyYjJb7snu4lhZfANKGzJS7IrfPmmjf5\nkuVzLPEAIYaADmMiLmEreTl6M+CWDcAm29yBiRI7nvr21M/q0XGGrc/eAejR\ngSqT\r\n=aqzo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdY+/qWloAEFMZlimflF3PCNEudaGef0jFsASFPBsrFgIgGT+SM2UJZsdr+FvXJaMxN3UqYE6QES/hHl8qz6N3T14="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0_1596510194623_0.6061665283435116"},"_hasShrinkwrap":false},"5.0.39":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.39","gitHead":"1221f4735e49edf67540990591df45e5582b1a20","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.39","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-iKKEYPShw+50KvDKRCtDI0//QTffyYKQxbtWT3Yn+zke80uJLA1fcOqcmc0Ra6fW3mO2n+snqFNdDqyYOFgH5A==","shasum":"f420dc5100a0cd909a7c1c3c8091558066bd4432","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.39.tgz","fileCount":39,"unpackedSize":193046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKNAQCRA9TVsSAnZWagAAO1UQAJNCb9MvZcreVl71GGeo\nVMtpT9AWiKEtaH8SVRhIFkBMzvaaeFDoWkk9RfCizI+IgvQwWfiFkh+D0huX\njg6uGk47DvjdC38HdkQ8FV47zgbKeqcohkrsC9bhBANufQPxbiywf0lrsrE0\ngFtd8sKlchAwGmh79uqjMyLCWYFhAYrqpTdfGDb4gMtCKJ9K444QzgL8MMUs\nj+3fVicX0ER49zB3gWY0g6tqCkzl25QZRiuNRrqtqoM6z8Zw5rBva0ofKF2d\n1ZC36ki6QoCn2rflNXl8ZwbD+v3sbueoyZAxfD+CGqBRohbkDwjzobfhAP0V\n/z9/ebuhl2ulLHVYBpCGzpsDNDKlvLdibdL4hvbIVvd+7qbsn2JQW8PsPY/U\nQaAe9y73lICPjf5S7Ei0ZhuXcojnFLjTw+oCtYB4Tpa3joNl7QFbSxy7l5Dp\nIlcsEvZDCKJMYIDTiQ2z0Nrm7Es2DPNFZpnPVheF0zE87NUXUb1DWggXzPUt\nFWUFPgD6tYp5raObDgxXAlMM+fDta/MNwRt1mUfiY6q8ckt3kx+TcpC5IRZj\nTuIUtm18hAqQrZOcQ0X2bz/kbUwJhFLCu6wVEz0DOPTpTasYAAy+mN0kPunn\nT759UO1MpK84FfF1v9bD9nVLz74CO4LsItb1BDqMy0mPd3oX6BK9vZquXasI\nR+zX\r\n=Ll81\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBlpb8lvYnpsTxj6l7ypho0sc1wDuqMFtKGj9ONqi+y5AiEAuZoRHOv7/GLxZJDUgi1RSgcjMry6rbBwbQ0eezsaJws="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.39_1596510223670_0.469134747158525"},"_hasShrinkwrap":false},"5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.8","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1221f4735e49edf67540990591df45e5582b1a20","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-/V23JhN5dlq1ReXW80WDj4SzYMcp1IRBQ8A9kLzKj7mHzMNt3X8EIzB5rK3P3F5hBcUAfvQIsSxAPw+JgtDFKg==","shasum":"8405be127f053067e3237abe4dfddcbbcc2d1f94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0.tgz","fileCount":39,"unpackedSize":193089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKNA8CRA9TVsSAnZWagAAtGMP/3ODvlZ08/ar1aGLccdE\ntVYhXk4DtXsJMsxjFXMlmKH8Q6rYwGoB8g8FJ2PAdO6M4DBhsEgqCEM4Tbz2\nC9XT8hDNQ2dpp71k86OtXKBhQlymlQHn6QdJ98MvwqQlKXvC1dXDj3+AUCUw\nPdHGltUK7BkY8nO0wHumWz71nS1Y1j8+X9hPzbUVHakaRVa3HphdN7rW2CKG\na2VoqV3UoWlC668P7qco0Lo1I0JbXX+egJt4cl30Xt9o/RQ5kPYJUsTnmcB6\ngXGeEG4KsJzWUEz3jf4zQ//yq94snjYwKkul+Nwg1DW/a7hDRO//UZc5u8Nh\na/y5nrr+tYkdW+JSx+uDxQLKk8mz4AxFx/So3ZzyDhcLuhvcW+/PHOoPQ8Fv\n19bV8hLBmJ3dUY/779Z2za8Q6wzQCWOu5KAyNX58lTYfb0nXwYA26snjFLmc\nZk1tKI1C9LxSjYI7uYo5gbTUTpGv9TuNBO18nOX+y6sIs+IAloTUPIEVSzb4\n3/bPiDe2Vjz3coU1XvWuZ25K4QRZob8EBsCmjhUFq3D3W/l6/BUCNzuxK5od\n/23xOuQ6Y6HizYPXmSWDT9956ngXU4ZO0fDPfaBAUYHQI0DOZWBZJH4/qK3Q\nIZhzY3m6Vnm7DMjEg87XIE2ek8HaoxVe3NCm738W0jnr171qW2RTHviry93n\nH9Ue\r\n=KYR8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBrOHuYiEm2oMihltis8mtgt/kAk1jPIS+WKNl7RpIYZAiBsua7CeEU2whR/Ibt3Rqwoqx/DXflCjpKf+86x54sdPw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0_1596510267849_0.8947354009310164"},"_hasShrinkwrap":false},"5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0","gitHead":"e622afc27ab4ab863f37de57359b8bb1739c7117","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KkJl+tFb4q0DlSRBe+U6jaQNDFPszYa8JPrfucNq/nRwFKj+TNtx+nKI3kDY2GUXXtYeWnkQsJBTb+EQC8cxsw==","shasum":"bfa630c81687b1bad354550ab4d0de2e66f71366","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0.tgz","fileCount":39,"unpackedSize":193089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK1y6CRA9TVsSAnZWagAAdlAP/iQeQwo9owBmm4JmOVMB\nBkhsrBvcvw5In7zMRVsH7pcYIiw/8/lKLDca4thBLhBKrDcfNhxaKJa0UuDZ\nn5usf2louLp2/EBtLwbXwdcW+0NOT3Wtprzgww1fwDR337j0CwK2WMFuKHue\nR7UFEXcbZNnGtrKWJ+r+J0px3WKi2zHFNOYLImrid6SfAcRYYuqtr6cEsvii\n6stZOKDqnBUQHe9S6MVMV+hbmjOtcUvIidsqnGn55uX8itWV7qy6C8SrkZt5\nMiD6Y1Yvf7KdQQ6TyQE0DT/kkm4+91ddze4m1eaWZ+mqjv3eri1PJeFH0Q69\nJ3LXVGobPJy6OFJzyldcu/dfl/8sdX7Jh0G/lxJigj5ih/MRvDxJfWLDGAQs\nwH+ibLBN40DLsAXQwCrmO1BCrYCDruUJOBWgJj9M9Y3NCpvk3YYcBAc1xjnE\nj62TFuD/IXh6HUZ/MCnX/UH44GeHUnWHekXXzEQWN1dHMPhjsqIvFsNBrw60\n60llyl6yWyeBa5UI6dyhi8xokk8wZpmXuBD5gZC8DflC/tf5hzPRpKyH4ind\ncaKyFrDNPDQggicwiRaYDQgIMCGWoy+u4yHh0OcqKmMU/1kPwVQWA7tqROcl\nLSziYVNIupGVo3eOK5PkAGhy/YdzwujhRUei1RZAMjfuDiWgu05dal0N15Bm\nvgoY\r\n=Qf7c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu6b60BKcdBOcJ3ne5ybmLU2WQQJiSyDPwrXLqKjYGdQIgeDinng1Fm0O59mHg1Z74mehSwhusto9LTmxQyeshqwY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0_1596677305728_0.9106117428589637"},"_hasShrinkwrap":false},"5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"23a35697a120d9818a867deac227f0858e8a31b9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-H77+qawNUKdliCuxxurqQo6eGFK+DE0e9sZdgbstuUHhWxA5UDStZ02qOvR1tMNojKTAYQtSmtxuccQ/2efiew==","shasum":"068ad8d253f7f1b2ee86f5c618bd78fc1c19888d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0.tgz","fileCount":39,"unpackedSize":193089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK10KCRA9TVsSAnZWagAA4jAP/RLjqCIQRT9zyA7P/xeO\nY23WbwrIbmm3Hws2up7bUwAZKbx3/Z68PK+sE6TfSWnTkf5E3/OuS7ArdbT6\nn4L3D2FjCLTDRAVJIcHrj/FRzSobAGHgUC78Cx7wJEy0JGzwZpFZ8ZHbt1nY\noo7BP+sElIqtkKATYP3nxpcc4wvJC1eqN+FtkWtoOqzZWSYDTMhq2RMOZ7GT\nxRonIojRxnrt9mI8JLTdgdVf5mYjhNTv7J7CqFVmfgLdHToQq1LrN4R8giD/\nH+KQeTCfmatrNvHFgIllN0KODO4fx7EeZguEUMbE6+WsmcM8maOqsCvcHoqN\nZjICNEI3r9Li5P9AMOOE3pzD5sQSeAQyrsIanLUiwlen7dxj65lg167MKz3A\ncINd/U/xzYkQJsAAzxEEAcZXzFZv+hUHDedPtzzmZjRNPvppTYpyWunifETb\n1RLk8g/IKqrArjQ/Jd6EmxC/ov8OM95CE/MKOP7yWyO2F81YxxSMN0N8iNcv\nNV80Xqe+TvPBDGoCsuDRuTyE8xbZg3WHlaZF7qLmrAS7besCUuV3k2T4k0jA\n/j1Kx4an/KXwpgQGt2i13nDf0gC4avpZS6WdIXaXX3mocK5jpC4mYDAYP7iC\nfMMjY3v83m4opOu7qswaNf45rsBcc5R8wkyGIxyeQPd9BhSngWuqVqRqYYRq\nf4id\r\n=xFtL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAP6ZxWoCeY9Uhk2pi97sHsLJRM3vHkdnyCq933g5gxEAiEAo52roNU07QnzbRrZoFM9Fqz4FsxMvqNPFyaPCnLAToo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0_1596677385649_0.43660293988762455"},"_hasShrinkwrap":false},"5.0.40":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.40","gitHead":"0cd7ed970c37d09a1c749374754f628f2c9003b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.40","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZGTBRrYscjlxf7WtMdZhNgXQSg4X5W5huOuDVrnZtRmvxapKe3qB8MA1uL+Z2Qsj9OMKeA53TDl48gi79Sszfg==","shasum":"c2f205fd6803e005a4dc15ea91d0b36a1c66a616","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.40.tgz","fileCount":39,"unpackedSize":193328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK10oCRA9TVsSAnZWagAAV6sP/1/+99fYnOZbL02EyuoS\nTXIxIUFFrJW2sHwhoVNxyi/UMiBdy5mIiUfHCrSbv0D84uuCF0FCse4YCbv3\nVPNTEUxTLXlKvOu/FRhZSLFijYdnxaZXFzHKCAb96wmUda9xo/DQpH+MjiVl\n7FwRwOqHOAo1xT+Q/ELjgAILX44Jc9w4nonbUkVZJnqkYMr9yEEQ0bfg88HU\nyQkvav9A7fNcFjtSb/7WTQXrXvmqVg16n21MnCca+JsBmQBZ7FeybV6kMWs8\nIhM0/C0RPkDK8G8qJ96rzu7C6wapAPw/bWb1NXrVhZUb3w+080FJ3VtB1shO\n1RoHXgssEHRs+qqzxp06O1s/5ieNGR6t7LOGs7PcQbJx0UPvgCqwuvWZnMHu\nRWRUzPT4sTdDPm1mHv25ghXhHAo4cTgntVEBS+uZvCOYEvmgSUJ6l9JSvJES\naA70FnuMsDjUGvMOJt4XDGzicn9gSRpQMba3437QCxi8BRBba1SF85YM6mQf\nDBjKY2lFlpJOhotUWiU9Yy27Th6yTxtoGt8RSQJyCIFHBxPHPJNxUn74606P\nKL0SBCcy2qD2WVjmIzQr5+evb83LeBqXl4d7fIgEseqhUna5q6rog0EHHmKN\n0949ceIdenmaPSofoxN70XlbKGsO93W17FxpmC6Dx8nuylQOkQan/j9v1Xh4\nCUS2\r\n=STMs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXSAaYhteB+NRuJpiUH0GJ87l6zRLEzcAA3ptCAQT8WAiEA7SrktxuTPuA8kMx6WsxIpUI4bjC+fK/XeZMx2oyznfc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.40_1596677415886_0.11767421712779291"},"_hasShrinkwrap":false},"5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.0.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0cd7ed970c37d09a1c749374754f628f2c9003b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jMTOKVDaboYZqCUGBmEOtoGQsFoeLbHOvXTVBLU+KO1Fpzhq7n15HLTFV4wzWdT+OhTMjPYP+SI1nF+nk9s8DA==","shasum":"e91462a2616c4d044377e42f9f1deb458e9477ac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0.tgz","fileCount":39,"unpackedSize":193371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK10/CRA9TVsSAnZWagAAyS0P/3TEt3f8i02dMDJBA5dY\n2u87pnjwtmaD+wtqcuZhes5HdNk8D8j3tRhLZY6LA1OFBTp8WViVqly4Qlr4\nk6nMjyMjKpl1QJZ3wbaeVtPgWrqKuY9Q8OQAbzsO0XlRBX4CZK1inADquskc\n1JXtdtqdUjhMfqcrWcNsuX36YDTO7JHt2KJ/EYMgwXJSpTbeA+mk4oH0ly8i\niHS+1TWZZiYRzvPi45UdBq95ynELH9DynCb1YD2FaAwInE9uhYJs22vMMgoo\nFygm2OOfVJ6FKEf+oErg94snrLTNBeC2IXXLaudV6crETtrE3VizdQZG2mjs\n27NON/B6xpDVmLXwtA8qOxy4T6nE3ZCoq0wdARa9+5OlVXeD16pYmtV1Ln7i\nVoWCIhSLdHGMfPwXjw7b5khQ0zKyIJkasJ8ryrpmQxzpIR01pSE1fddGvz7d\nBPGrwx3WUDbkmUmCdgcd5FiWZhmquHRdQmHxeN52BBLBOWulj013n+wizx3r\n5sSR6nG6m0PLO4MfPReeWm2cPACy6ztVEx1dG0Ofp5qC5q3RRiKy7zeirwve\nG0DPBNdSeQrFNe56YT9A/yYmGgp5snwmSSVrNneihIfCf9B1wCobWbm3IHnF\n5K0cj940eTWyJs1vuAwxCjpyer5r4NKgCidO0T6W7pZut2NxAbsnEP0pCOMa\n0hJK\r\n=DmEG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8kAeP3/W6m9PXN7/Wfzj9TNWAyMVIGKZi+Kygr+G/mAIhAPuPJbje7Es+WAyTXLlpRPOsnBU+BKxYerF39//QmgNg"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0_1596677438842_0.4621322712302469"},"_hasShrinkwrap":false},"5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0","gitHead":"0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OEevapqE9yqDBu17An/cwhRHSyXSv/tilUELouXPsrng6+/tzuOwwe6HJZsv9szgboxPfMiWoicAZCj7OQC/Fg==","shasum":"bb334c0d18666160dd63efa35ead34baf2b3a48a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0.tgz","fileCount":39,"unpackedSize":193371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLTSbCRA9TVsSAnZWagAAqc4QAJcxpWQpju+VTHA+1rwm\ntpq6TadldK8EYp0UNwZl1PDg8NHRKamD5HINY0YC8xIvfbfXLCINVc3NXAel\nRCzV9MHPTZh/Di4BtSQOH/949IIdhCsEBfx1Y141oXDVgbdEnKGNOBcdEY0a\namMWEDcM1Ak4EIm7QJi14ALuvUERCuH+PJvGMTYtm+ncuULfKmcJM6J78q/a\n/d1fd6yvYCs0cttLPO/XMLDw/QmD5R9HoB/Un3tklEyiUasilDLvjtteUqwm\nqqEYpR/6aTytfNrXa2+PnRoTHLt8XaBX9dNyfWFn1hRSxja14q8GidsFviWe\nptgDoYFks7ni9aaJcIK/yTqT8jft+OMhNxWaI1dXiKD1+2VsQrB3PyZLF6uH\nnIUPf+ovcrJXmIbGpuKriWKK7xfH3R4VuQs3crsXw2Ql3eW882IBpPZYZ/Wi\nogjlifTmINJEmYL8BNuP2hTKRuTfsS/fzX/smuZmsmTlDHR2LFIuFIhq7yV6\n0Vwo7ns6QLObIMVcdd3ChXcoRiCKGIjs7niSqpdEu+h/Tx1hFBF0rei4ERc9\nIELvoPOrFv54WWGughoq3B1sGtvesXsRczHgWVNDrK7aQDEWbBjxKS1uhH6g\nDL7rxllDXSvfjGAf9hL6sDXKOwvQDFLRAjQbcZklP0oye0NbyLHtiKB3q1XQ\nWH6z\r\n=K89W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYB0uW4iwwiQYbhS73BKcBo2T8fQj6iRtJxq6auSrQagIgFlpOqfLGtMc85bP/WzMKO3XB3qhUsvEcpKSc2tAOv1o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0_1596798106944_0.05122219477912293"},"_hasShrinkwrap":false},"5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f39b8c7c702821412a98dc15847dba8f59d3aa3c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XqoceABP+ECKbmkf5+wIp01KZXqv6gwjri9MVbD9+Vpjk2fhfAW3RuzVOMEXWqAKpH1+hQj7axY2O/avy5CBAQ==","shasum":"e6c43c9a107ee902d813ba3b9cf8e1f2f40c9599","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0.tgz","fileCount":39,"unpackedSize":193371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLTT2CRA9TVsSAnZWagAAcCQP/2mVkn5/4Co8g8aH9+GV\n9Fk+QSpEAdcIlbh4WU7LFLiXN3Dj+07vKqAjngDtwrDFhpR/icSnKG5p2bCP\nYqIGUePvmJPIx6eZ4odZrDQDiKFiww1VZHkuKi+sDLfrY5p1DiSq3YuPUleb\nhjMPyw1K9rKUdLwzfs6h5fRRA7NR8mvYYHlDInkgoKF6uejFtq3Bnk+U2IXQ\nV1R1Gxtozq595rng7BkC/2G4Kf9sr6mQEXVR7ZE5pJyM5oJMvhbhvL1BDe8o\nJX6P8uxRvhmwTuZFm96UEma94kz2mBn1FQDs/N9uVXXyEcMzV1GE9E4GaI2d\n2fw4iAohTmRnO+JKM7+zfKJQrtKG/pfWjDAhMGOvxwe9kKvV1olu7Uod71MG\niQbFjF7uUR22dDlX81qBg/YHLix/hRdedzJD4GUlGhzQNvyXO1PI5L2+V0qp\nRsy2YF2aullOQHpkdT/d9In9TmD/RDV7bNUbMbQAACYHr8DS83s82w5GfmtM\n8XY3C5xP8uVZN6zG8zwjr+shZXU3xPTs+HuDS23OQReO+HtatntTAMxc1p59\nAxKMfs4XJ8Ys8WtrPuVhv+A2eo58HD0fRnyq5j2DOkB6uoekYCLBsQg3JRs7\noB2+mBKKOtbZbhynwGEYZY7nzUICibnIyXXHRTejKe/P0q9F4RZ/d9HWrUDV\ncny0\r\n=9Waj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzuNRcyVItQb5B+F1sSjSZr9JNUS1eNVXauWBySusApAiEArws719WgbOLrIOhHb2GBCjs0zacS7Djxo3PPT2iZSag="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0_1596798197779_0.155425308106657"},"_hasShrinkwrap":false},"5.0.41":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.41","gitHead":"231170b6ad289986a4e0769b4707f87924c5c9f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.41","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AVqXgRDdWodiJ+PbUltxkXKlxgvd/3W1L+0xcKGGR/bXvsiaP+pDDBGbJp0MWDJSQqSmBW2tlCqkhuldLpYfnQ==","shasum":"697f0b27759762a03bc4792b90aee7c65b7cf026","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.41.tgz","fileCount":39,"unpackedSize":193607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLTT/CRA9TVsSAnZWagAAPEYQAIG0JGC9AyxUba/opRMW\nXb//TCYU15tFcu/Mx7cgG0OcMc7nI8I2GHKdEO3IgeWda5ZEr7BXJfaU3r+b\ngzpsyfyCxahhYWxRjJlee0W+TR7RpoXfE8mBugzyfJG4bHuUvgxmPR1OwXX2\nDvtHg3rGJ1ltJWgURJ6F/jPtmVd4bclSJOJMWFZ6AYYQWlmwASOSmYnUNWQ/\n1yr2UKwJTsAYMjHGoS5BKlAm/UmrilsSGlxxWJBOwVKQ9324oFc5md3RrmSV\nSDJXdF6MIQXAmZgLlU0JxNKrIeOK6HErU+48bmOkvjVLmPkh1wujL9PdK8zo\nQU6OWfxlF8UZie/QVbgAdeTlGDBAE/pwzC88VHJaxgUSKqGdkyXd2ugNvsw3\n3ZGVl+kOgHQ5qm22o2RFpzDsGoVeCaCyCiqDuoS8r4YRvw+Pacd3/8wjHjRv\n86WAq779+0WLWqKgitBs0vJArc8iwjM33M0qAzHe0ytdub3hH7C5om/yeKek\nkvlBF/bYBc9mKeM2r0eLAfC133YeNlqunAT3NaHdXypvHB15pb/HiFXVr+Te\nZFfYClj+ELCKHyO0FsdvUSmasneZPGRn/G37wON07lVL0D7lCaTLWv+CctnP\nvW/mMYa5Se+Ud8p79rDoodZywi50LTpKfZxMY+yCzlV7fqG50keq3vJSRBKn\nqKlM\r\n=jApe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDz57FS/BpAIYjWDrkhq5S9UYpicPEsbDJxN/2I245VzAiBphFWqkn5vdJGaPHoDHici+mrQNkVf+6rc8j2eR6EtRg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.41_1596798207160_0.4369709373158013"},"_hasShrinkwrap":false},"5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.2.2","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"231170b6ad289986a4e0769b4707f87924c5c9f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-b0PGprhZgkgM6TchSKfyoakEEsNWsHk5DfwHXczyImyNPb9illhIgXZG/H2aq32F0lAjPeQ80qTEFQEbLg4qlw==","shasum":"7935b52ed599bcce2a283f3d9bfb786c38769b2c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0.tgz","fileCount":39,"unpackedSize":193650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLTVACRA9TVsSAnZWagAAW/4P/0I5SiMOKH0QJ+YVb6OP\nCIMtGv5wP7eOM5SlOHjgzY72BgBcE+ojWXoXpV/5vR6EHY70+7xGmlCCxKWN\n8q+r7mH+Ajhuvib0irAiOgik2d3/lNRpt1LzjWqutdpDsxO8S3erfKSnxuVi\ndSx13R/+7G5ymdwN+gWUjQ8MGJ/ZBMbZRjkTwy7QPI+3hr90aAvyL8l+Gyil\no4h00OENdygJqq3Z+2xSLG/kZLm2Z89RpcrYEepwWmcuEnhbnjIYmh5TMpnM\npMR7kupe2fyDkY/ZBqrioMunsTujjT28aT8J+WOsHLC/GRlN6+/Ddi23fjr0\naOCftQ7MLiHa1DsJBFmcl44vOHKF+FQ6cpT2SwUCYQNqU4SepO0RUbBEHGYG\nWhu9HMy+2pXDeS5ImvwjAy9y9RNlsZhkcaQGb6vNjsgmiN/SyzsxGN2cwjjx\nOrJ9bwZn7eQdqoQdd8sodwLBg2iQOiP6oBVISFpt7IpnuVy4cWlSb2fPVj1l\nycxhKv6NjIQ+rpzLmGRBo0Z6XA0+xRb5D2mrxcsO8U3GYpG89Huz4aV+xgQR\nm/DcX+XNNmfbquduTrgLrKcHFMi6hsKtLqPxM/jcdjWY0ibqVFoBWsQVUbLb\nUaOUPZ2+epS8yeMVR0/vZ4prTjT9+myFN2IC1SwnBHwBi5w2dhRbWx/wh5iS\ndkzG\r\n=pH1W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwQ8jK4YNpgZIrf6RDRP9yghPPDUxrGsYp4CTLRzEgcAiEA1HMesL9GOXzFBk87dsIt3oiGw/OvwGfGGO2Gvw67P7E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0_1596798271616_0.47327859756850743"},"_hasShrinkwrap":false},"5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0","gitHead":"95e72a1689b8d19fab54859478c861fb8c9b2ae0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lTDHeKNIK2bOEbTPTeiOmlHtUuBPhkiP+ycXZjVnxUR9fGDaC37crW35NQail17s7ytQXicZCxkgC/ya03jLoA==","shasum":"c7f2a884eb40ae334a2718220dbc76ccc718d4e4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0.tgz","fileCount":39,"unpackedSize":193650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMb+0CRA9TVsSAnZWagAABncP/3ZNk2DWtugDq910ke/9\nvuu9x9xVRBGvnvzowx36xhQi+mJppXydnxv9x7x2uXrRYuRfgc+XQ/olG9zL\nQuddCC/5VoCxCYwlWoYdXG413vce5iDGobTKIMT7aqtroZTeiEVO6L0c/GV+\nk7mAo7rb7riylD0esLHTrYHkILDcZwbb/xhoaXbzWgIDzME+saQkxpD+/JV+\nazK8cdx7fdQY/v9/ZLTZjVyMqdua+MvYgnPGV/LVQE/Mgw/8yjvfbWqtdwmX\nUGZV76GvzKz01CifI5hehxqTfZ70AShQb6Cw1temw01dTNgYVXSk6dg8HCxT\nhi2P4jemYS1wPsf7x9ZW3AOVxlq1cvW4aP5So1oVU0bDJO1taCxb/an2gqYD\nLhSNexZmjMiIEwK5A5W13kxMl2AbpBQ9BHKqi/b8zRQX6W8nD4bC177cSdhd\n6fH2/1ZwiFK6USuEIkHPGqLBldBgsCe7RCHYYQ+g/WCAeFyEOuu0WyTtDNHg\nVQWZvT3112/ogm9Wb1HS+LsDnWrwJZCo+SfwLbjWV7g7iJUCPHi6rF7QWxgw\ngz3PNU6CxvfG7dyrxXDPil/M6x6/ayQsdWR5ew1+u3TN6Xp71tYBj2nOb2e5\np4Un/98WjiTjxfnCoAn9aJFCLMlOdl7zhOfOMYFDxCWKVtM/CS0+qXudWVg/\nq5Hw\r\n=KC5k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC14Vh5zm7YSBJlJjPt2IQsLmlJCgjbghrxDn9uBc32xQIhAKBPSsbnUHBmS8sE+y//ejiN4X6h1BN93eZM05b+TbcA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0_1597095859807_0.4236686120253852"},"_hasShrinkwrap":false},"5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6be9eabc28742e85202ec165c797f4470201cff5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UPcskqkN/dDwfI/glpJYR54PQq3/Q4Fo3H0KsgSTwlJPwQQJ1bZ2CbbBjtqVnLKopk5kc0kC5f33GRu/BgqEJw==","shasum":"7bd190872d1c943122a980a470e21d28b6750216","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0.tgz","fileCount":39,"unpackedSize":193650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMcAMCRA9TVsSAnZWagAAMhQP/i4VGZ5rTgY8v6FLBjKD\ntvi2tluzZXXkZr+l2x7UCJb/SXPfDXpuFr7QZJqp6BEjPqNv7cDkmDcv0AqE\nlFnP5T6NIR/FltpjWiEZCT4yjUgeR7qpvYq64e2GZcgWlxPlXgeDookCrxhu\n/aDXiTbMa3jI0jVdHkdoC4+i20P9aNnZzo79Pm3mIoljQdF1UJP8nA2vHxsC\nsx3XgpKmMNWCePBFBVFHny6GjQ1Hq7hVu1lHeS/2EK+HcS818t9zpKBOo5EM\nuogknpRXryDiYH3u3EVwhGMHrwm2ivbaJwON8q7lAXsJR/v5YIWdSXucr+GR\nWYnV3qY9F0ld3go6alZTzarJxUXFG/U91bh21p9zh/MsbxDpxG2t++0kk+5P\nfCAMGsTAGwwHPEm2JQDn10uvpKeGRFrmXNffZNxIgV6Lr5hgfWYzY+jVE1as\nahLsJQMYWD1tDCfRklMBf8yTY+ccQZo6qJwrAX291k2HmrIzf6+YJRnfJNLL\ng4nQC/XN5oIgEKi0HeD1+RmJaLR/VnXnQC9wa/5fIazT0MUYcPEF+RS2AHeG\nZNk79xLq3eDqoyhRjRP+JOmQ9FiMuEWeAWdb2kb+GFn4LTg3f/WDK2P7IF2P\n1//SYii7WA/1oJnpSu1WI9bbY8UzlNQKQsnkOAQjH2g9eTrZQ6zVVws474jD\nepyY\r\n=crjj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhV+ieLa4ss1Y4CncFMbqCghletWQ9BtZaNDwNFEENogIhAN6yl+1WBpaL2fDhMVrjYphOb06MQ8ijY48MKvDFcJuy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0_1597095947909_0.10831982340935431"},"_hasShrinkwrap":false},"5.0.42":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.42","gitHead":"c1afa148407cb484b35a1c528380100c56c8048e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.42","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-DLFIUgSmxt2i6kB+Uh4wefa7Ntb9+7xA2xy+JxrHzbk8oECHGWao3rWzsVRP/4laqCLHhzW2vMH6pccB7C0GpA==","shasum":"89e4d61fce60c75fc516276012dd9c409ed764d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.42.tgz","fileCount":39,"unpackedSize":193882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMcArCRA9TVsSAnZWagAALJQP/R+xo7z9aYSiZdCEObdU\nIV+00AQUMGqqDl4YzjRlm5Vm01NuUosq7WqN5jQTlLi1gms9YlO4+zErw7e0\nC27PRFgrMeuPGC7gsGb47rEzdfDJqNJhWStLploFQwRvsc0EejD+v67Oicrh\n+wGEfjy2kZQGR4ko3yAupScyUZFbZaXShKpFWkd+SXcLi9/ziwI6AACdWh5X\nixGzl3syBVdvbLHcwWhPeCjvSTISkLH66zmYEXsi9HgXnlN+xwaeQvNdRIO+\nt8aJzfWipyzJil9elwFfahsK5pJjWYvLqdk15iu/1ohZMOvym1OIAbDX72TZ\nHuD8mwT36KIrqvoclxckcdyTix4VKQsNl35BlEPhY/z8pCABdD4Y2C8vQrZ8\nt/Ti08Wqww+dbDlsDx2HdAVwvntDrlNWWrwfxCBiaploOTcdGQHgsFL4xEyf\nhX2vj9D+t00uo+BtPdKfONpbOG4EmO4sKmQzYWSfnAmu2rIPBvsfgVvAsCab\nizFACELnCsyamBGZ4r/w5mAIMl2KwKDcES3WLBqUmNtwQApfgbLehSOIYQTZ\nN58SpdfqVyA8cO4MiZu9oPveiESXPRqZUCzXkJfpq06aonZp6hpo/bQ92xqK\nXNv3oYeHATUdGybG6/GyclbOdOmCo9zr2iIhFglsyZsZZd6//gQsq+6FaYoc\nphov\r\n=Vd6P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzaibeH60oNNcBU266inWgBD5500LlCPqnBBTeLPgzgAIgZzQ30aKbilPp8oiCL4k/2hSc/rEoWstJDclt35xHbyQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.42_1597095978969_0.08810971000355905"},"_hasShrinkwrap":false},"5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c1afa148407cb484b35a1c528380100c56c8048e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jZWRLhge9DOnnWtAfI920wyn2ak16uoSyFY3n7TP3sBDNb34wBalAPjPnw0VWaKusMpUpPVTbhn/1+kG7Hzadg==","shasum":"377c56f9e18521036daaeba8647500daaedb43b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0.tgz","fileCount":39,"unpackedSize":193925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMcBbCRA9TVsSAnZWagAA3+sP/AkjOkHM3gEENXF4kiPR\nkuR7KUAwHw/fd1GNxWTj8dLt8Fr6WoWKx9l0InukqM87XuZRgIhsZrXpQK+K\nsO3/h6IAzIuk3UvBhmecuDKa0G3zhkm/j3IhcnMjbAmOC7/q385ZRMIREZqc\n6kV6LLO9V6Xy/apfwlIWGk1Rfy51P15zF2HvScTznhxaYhyraYwdanJfEUTh\n6z3Xj8Uz07FcNDQG5sMObxAnARbDPB4sgj8VhBF2dw+TLegaNNW+pMlirCNH\nB0eVgQj4Lj9bDN0SPIcoRl8KBqyqHaHySW3cnp3ErV8gbNcQUBUVKxtwXzh7\nC5rCiFRktdp1ZQX77kr33WCkVOh7gAlGFNCZVMJc2l1vZLj9pIfrkov9bVrE\nmNES5s0lko4f5MjQLERNuilggrDpy/KklZ35Y0MrFJoUv2knqoeQHCqx2uAl\nf/TcTE9eVco02E+EUq0xU+MedoejqQCLlMJ9apQC5A3nTTgSLne4ETpndkId\n7GGsO+pyu6ywm/VsJ+JcORTN6gCL/oTbt3GUMqHjuTkGJKoYNP+kx0idvOBS\n3tgcslwRX/OykbQ+/7BdGaw4ewJ9jFn5imGDqom7bzsEA55rvFwtjEtRWDwx\nF5qkaJz8hGPbxhWWaBo4LzoPHzCw8wZUXNmXJF9q57OiAZ84wbyDiwJ9iIuP\n0dhk\r\n=3NTl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyNxwLACkd0P+6V6Z2aNJiVvZrRgT42jBKm59QsHP/egIgA0FfGsPWL1lvip2hJSdjzd6Vl82/dbPZMOk/2cYa1h0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0_1597096027004_0.6490475080289648"},"_hasShrinkwrap":false},"5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0","gitHead":"2459cc29dea38c73852fe8772d408f18997d4f40","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NrtK9Q/HjKfRoiHZGDBlHDNI1Jh8vDmzYYLAIThf2U12QvynzGP2zsejMcTo11YXhs8fEP/x8zY0U0aOkwM5Mw==","shasum":"1c66b68b122dbadab4bfee2ef4556c4d04830e87","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0.tgz","fileCount":39,"unpackedSize":193925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMraoCRA9TVsSAnZWagAAutkP/1ESj9lgdrUwBI4V3KX8\nTW1HQnEQDpXyh8JgPBFUfyKnraLaGb+WvjxNK52R3cApJ+OmFF6zsWAv1jIb\nNojBagcu+NLxNiuOcnZxBEqXnO/1hOr5twDYfUkWeC+2q/f/hXd+o47XsQNa\nlba0TDFuqxqJ8nHuaKGqycdgUIIK45nu2IHcfAvHHTXG40//ybV3SGxYFwR9\nkU8P0pZhBQr409DOrq2+il3nS1kirCAAcCF41UOxdMugY/XgDEOaxtY/akOJ\n6iy26olUmobWns1FxSk8LLcXEZVexn+82ihRoZT4cM1bAYkYa/tcrDbfGFUu\nIOnP3nATfkdB14FHHEbW2iWv/RXkR4/aBs2OFdSQV2oSw7lzoUbXIRnH6ols\nlBkofSMOH5RaTfz1O9ctICCxG31k79RDn5M574LOPJOxE0ZEh55T/bEZx5+5\nQLE85feVifpjNTff9n7qOlB5SxvWxSPGLoxBsIsbQhpgG576sUBBWo4E80/7\nKtHlqTmm44X3qb7RL3mWmJGr+6CSLOsbh8TD+w6iwiNzb/BUBr30EnlCHX6A\nmiqjMEBMpsu1GLMsrAGJFu0mrUgmnRaZ67wC962+b6aTwId1EO0ox54nmjZj\nwMnU+TRXxnZSS/d9z8oSM4hWp37GesTkhScosrp4hZJ3ziyf/ZVLIKlJzOgm\nNK9p\r\n=+57g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoAJkH9TCxuLuf4hS52LXFogD5ly760zKkRPhVXwM2rAiAcacG2O+M/lnnl6zUQcbOWNveG+F+JHZcetLAP0+NXKQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0_1597159079770_0.017066550621000154"},"_hasShrinkwrap":false},"5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"29011bb303eae2d033f9270bd0bf09335b49f8b8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YBidRR4OUnMyKBMeGpaC8gayVpWIFAascfOhcY9O2yTPIU+v4maAMsNsVYftT+ATxkuYD3PBt6afEEHH/yvFtw==","shasum":"1a7b28866c18fbc5d050f22680ae41c92b0287de","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0.tgz","fileCount":39,"unpackedSize":193925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMrcBCRA9TVsSAnZWagAAqV4P/3LdmfXXyBWG3wPQqa8F\nwnAnfo7U6sIqC8KFiH3O8KWzasjp2jm+brMm0XirXAO9QHKKAIiwnoTc0/xF\nm8LErPCw/fYkl/uw0Thm5t//oqkWhDGUDS9LUWkaSEZ50Qi44BythpCQsNMu\nSn61Lp8Nc7qCvVbLHfGAkeIPGW4vvP0dylzVaDBx8KeLODHawvLZglftoG6Z\nblxc90Za0IEvJd0fkDKdQ/KXDBqDTOAsbP2XtNreQduy66huxNtOYpgw2Ky5\n2be+wmO7YQfzcPzc6L2aot+CA/Q5EWm6E6rZV0rhZqmqzXZIKVDzhEEsJjqS\nC/pttz1OHVCRXQoblqXTw7rL1RhMNL2YZprJTFESnnID415YyzEXTNfwJUGu\nleHWONvIshyfd/W3CnWSgvGGgpS06oXqLgxSqHQ4Y/HYTBQUpF0INYroQ1fJ\naklapTQ+OJgkqjS+fTJPYZWtSxxZaVW8rulO/eO90/ZY+WZh9SDNs3+t445P\nE3vqqTIxWaoHaiF8EVNflOLycM0Zu0bVRZR+Nwa9vcZWWAYRQncsfWga8rUU\nIa17G6zt1LK6fgMXVjdEuf3p5rmctElR9kOZ3IxS+C7s2fnTrKIMbQdQr7Qh\nOf66LwZGGtjLjBRXMI6wgjxvAZynEzsbJZ6ZZJiwTCipj0B+ojcYQVXSPFWW\nyfs9\r\n=JuOL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIANamGz+Jgafo1ABwLxDbu0MkeetZoimrYHLyESVYcu+AiEA2xuVMP8OYB89NUh6xyx+31WbI/xrUW1QD7OlvupuB5s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0_1597159169206_0.19830937752450462"},"_hasShrinkwrap":false},"5.0.43":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.43","gitHead":"6178b0d9b311a1cbe8cd9614768b4877c242ee46","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.43","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2H2dLI559CmJgcytJVPQ9V5qMtLXcXxhNDmn97imw8sNemUGBJzWWtJIW2g/xo+ET8hFC8iiccGotPUgV4q7MA==","shasum":"fde93a3ad3adfc5a61f0591672fe3ebcaf61c5cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.43.tgz","fileCount":39,"unpackedSize":194160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMrcaCRA9TVsSAnZWagAAjNsP/1EIzohJu0jeCdfHmA6E\nmKguxq6slDVQ8ywl+MY3bKM13Y/tDt3lpyTOtBGUB7Z+wcO4uaKJSCUhx4B6\nOwuTYxw/h5sc4jnO6CA6O/7K7CtIIqDeROr869WoBrCOX4TsqUJX4r5ON0fi\na39l5H/+BqdvEQIEyHpLNIVDUQUWwMyQ3TojThQVrvIdtwiRjfOeN5udTImI\nYw4crFhPRtvbWQmSd7oiYd5MozH73SpkoFlFl82+E9nQ8w4I06kVKCkrJGFM\nqbO7EHC9nZl4rgQLurJiEWxEk0KtWSVEBuON/iI7QGYV58rtukDuIy/1sqWs\nBl98J/1iMC4hXV2E8soUSMnnoUm24B9Z3Cqt4lbLd4Qfvc+9ACthbr8u40d3\ne5raxzlDBom6Rk6KUv0xW3axQC/QL8PnyaixmHbnNK/b/2KQB248aXmopSnD\nEBoZCxnD1S69GaamdRyDm3pkGyiFT42xRLIelA78Ql0YOdKaEnLuefEqOOY2\nFKNj2r7kyOFskBKr5RmwFSxGiZzvNSHKD4xbMh9iXQKW4Ufys4CAsIOvCCbL\nUk7Qid90hwfGfiCXlFpalM4yPdla02rPdWS637lvAuFCAcRa48bVSTwCVXmQ\n3rhyMsONhKFQLuWhw7qC4Pu1lwwN7UdZxsujIFopXEyJcRiZiKUAGmIOACy5\ndBW3\r\n=/BGL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD5cxi18/be6vh+xLENZ8/8AWmpMb1Ed6vVBSlCQ8HSAIgW1MpbjMlbASwP6+etJFfAKQ0begYGNbL1NQsjR8FNLY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.43_1597159194305_0.4968015754095567"},"_hasShrinkwrap":false},"5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6178b0d9b311a1cbe8cd9614768b4877c242ee46","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4FUmlOudWlP5pcOh29eU/nZltzXM2CBFeSumFkWGP2GwUqSHlnHz9ynQx6k/vIL0sLf/RUmv7SjF5IqBPeeNug==","shasum":"19dfc246b5fef940128570f107c56ff73c7a2f63","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0.tgz","fileCount":39,"unpackedSize":194203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMrdECRA9TVsSAnZWagAA92EP/0sDbcFNd6o26X6RUS1N\n8M9TKPWYnO7D21K0mKM7WYoIdUnqi1DVb8yYsoUo0AGrPx0N7hZyRRkjnClO\n5nVHqTctNlzRR2JR7yrZFYunKKcXkTuV63C+wRMV4JqaujFTpA+1cMWvvzDJ\nOXusUqn1gHfju2288lokTranqDavcoZaa31ApPYxwT/ItlSkif+QKRGdlQOx\n4RFsgxtqdZ2nhOFkfsmMayYMq7ZuAPWE1JOP3M/M5FLQearrPt3Ouqiob9oP\niNgVYu4VdEXYoug3G+vq68VrZXfHvGr0PpSZhrUq7Wy96prs/5P9xkDf+XSX\nzofMX7C7l2dUgLohECWqDCllBpNFR0z+zNY99d+zBh2FGVpf6oUzWsmR6zT9\nEcohNBXigHPVfTEjOjUVoffOgchHkCHMCtseuolWD4C0bUxhPYCc5VzMyvS3\nlHgq/y2Hz/XGEAcPoWzLwVOvxwErdmtYW11iK2/cubS2q7NqHTvUA8QaMnQC\nyTfRoXF3tZ2DuU1IlaCBkORu8c0HIqgzcnIlJW3u+EjEStZLIq92Tl7Wbz27\nYBQp+T+OngIkcubF+viJbON6xsgkLmOhr9ovdhYVg/JHOP14RzKGRMpNtcRD\nOMe55NTy0EtJ5/PWtO9KHku4YhYIQA9EOOEHBZVXYcoHC2eZshxPfK4qbzKJ\n/RQP\r\n=qQem\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFyJD2sRj/CzXWsBEqxSX31/M5epFek/lvpURXbvvP7rAiEAuYNkQiyRALQjg75sNOlqA7QhZ4kjyDfuyXHtXgZje30="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0_1597159236234_0.7356152060333927"},"_hasShrinkwrap":false},"5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0","gitHead":"2f600add83b3d0887a3ac8878ad5c2f54b91b0b3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tQTwriOoBl3iVZe/bMe/nRcc4P7JFLFJf5AEUy1EH5Axd1fxBp0HZLQJzoCYup1zqGg3XrdjUmozlEeZQHt7eg==","shasum":"5ab2f019bab40ab116e6983bc7fc346784bfda74","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0.tgz","fileCount":39,"unpackedSize":194203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM1YaCRA9TVsSAnZWagAAAwAP/2fvz7pKXlP3zd0/9Rva\n6uSc/dxTrNPfXSqW/cIakgKeEY/JOdUDPeClaeLphvQX3rJSadZZUzGLdgrR\nsfi4NMPjaoO9bgwuf9WmZsOJQN7cBUj+yyyFIqVKH4avNA4oltE1j3Mra5Lm\nwG/bi1bf4t50/knfVaIbAv8MvlbGCMvTEfo6H79HBQDQ6WSYCaCPcHObzWPT\nSsB2Tp+1Hhy3vaFTAV4C7M6k10yys02CZA6v5a8G91Jx+Ehvcz5apzj0S/Oa\nvoK9nfZevYFD3Isy/X3T5VTgzkWWbi+Hagb6QV3h1IOtGQIoDbYMYaJAgbuz\nMXu+kG/ZXVF03e7gMVVm0jeZ30B/1nnjMD6zCKAAFCxW9j/GjAt301fg/qj5\naJDJykoVHULhOtwZ9UlMqpsXSfzkqjYddumBkp+jns9zQTkC6dSQVT1fu8qC\n0OFZn81/T19L/pU3FwyO6xcpDVtMr978g1ZrGFqpd+ovB4TgbD+8zsqRy/Pa\nCnAfVjQz9L33vZzxwojb2F5IWnkOHnLXgi4fi7TAOGshGTnlfJDYsTyBfq1z\niWFfxGMbNh3czJNoLROCKh68bExehf4GfHx++3/x5ykw+m6hqFVRv9gM8g2s\n5Sm79PCSIcp2x5wYlkFYl2IjikwkcFn0JZ/ajRulCbyPehwuE+xuxmOoOQT8\n1qv5\r\n=qBtR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVtaHV8C6jcvSwdpycAujWkZCH+3nO818M2hwvqS69GAIhAMGp9iJKXIFtesFqqnqZ9KTvEq9j5g0McAG9E3NNBfdH"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0_1597199897619_0.623084314341616"},"_hasShrinkwrap":false},"5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0781d0b643967eee158bb7ccac413439a1950007","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vxKbn1RHMwPy6rfGEdZqn6aFBRbUPnP3eq4/Vxd1o01tLQ3MKl/QPzJb67tVgNeY8fYaiHCKmY0YBYZt2jXp3A==","shasum":"88dc3fb88d6ba9d8ebad5594ce1cd0b4bdb7d5d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0.tgz","fileCount":39,"unpackedSize":194203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM1axCRA9TVsSAnZWagAAkmYP/jRjGDE9C/qUi4f0M+Ff\ndVsjoosXHRN3fwa1ymPnYzdKaCczpLeqwFJIaXK4PZtEcH8V01mZJvQVGPk4\nsFpa+k3GLNe6GWert7bUQ0VI4gP+8YDRcC4G4DilN9eShId+KywIPTcS3vSl\n6woOSINzcPGtIBk1s5X96qHj/LEosv8ljl0Ai3KqtqjYKhR0SeikkDiOXb97\n5bB+U38UNGNXxILY3db2OwIWHVp3HLNqy5z2m6kzWw15Z9hoKaYnTAxaGurO\ntLo+cTB2a5U2fDagaldRBJ1sa5YZFwlS6eYpovBv9UXo6AYAkvmWtw4JhHda\n3GsdLTmKd0aycH9JcVpufqxSs5ZibNfypR3dsC7qIJu/9HXwHxwWPND9xQRm\n07MITOICeXawzzFKS36RiVsGy2iYwlmd7VbP8QOAedaWYXA2Wn+7TDc6S6ZK\nSguvSkmwedGDajGHaFbiiE5z8kF3n40rwtvbo1QYgn2FQOTk0hIia0rqI7W8\nFqMnyp1Lq9R71FhIyLFLCKaK2Ltkf3RJtM91IWaVXGbqX0RxBqV8W4d8dQ39\n0PKAqiQi7nLqftGjqxJd4C8c2wQOEqXTRz5iDsTx5CbBcT7gpe9dsmTiUj1Q\na03ddPpO8UHHqrUOISQHqTKSe1paZVENvrxnv2aBS98fCtAaHx72xTF3RKc+\nGtgO\r\n=Ozcb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS77TJcR7k64Gki0SkQ+xhY9am9Zr8RGTKCTt6OQu/cAiBEOGwsXgtx7sGdnqMG6x7R4ZUW/UratTHHC/63lViGcw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0_1597200048502_0.08831488479206961"},"_hasShrinkwrap":false},"5.0.44":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.44","gitHead":"d59340d28718593d292e853c15cb1c0496bc0a12","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.44","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BcraBoai1AJk6MlCOYy1CsQIz+zz/HXCLzP3ErS+bcEj5BPskETNkGGvkDsDgAL4CgrBRJGtyBuPP1+s0YZFWQ==","shasum":"9f2bb903326f0dc19e10a04b50296da9dfee7f03","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.44.tgz","fileCount":39,"unpackedSize":194435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM1bHCRA9TVsSAnZWagAAC64QAJpM+DV9t4MBkI3sdGCo\nHVWSe2gk8EK1B1Sgb1tW+3VFoFLSDDR7nSkORscUppwfmJgIvbLninu2aXPy\n3mzQhnHrr6/S98QNYcXXYZWhfgUKr+PcFv5vc0Bwc2OV2w8wP1xG0823Yw4W\nzi0Mya5e1sbe0i+T+sbcvKycGfjL/j2rQ4N8cXDlSFCVBIH+aAm/tvK2DAhv\nPpDRFyND0RIrmTWzSGHqrlLB1BM39PbUId02psXczVDYPTC7T8uwoe7UkyT1\njDP3zMWW+kxgAzpLdckp9aj+99BWDV46e/98O8LhLg920O3nyCgfj7wLyULO\nrUx7fZWaLTeVrITYXVp9MWD1Q8GZICp6PYnmh2kIAPO0hdWJFRUbuPxEE8Ib\ncRdmboh+ASyNJ/L5mRqYSkfUwFPpmKDopxc5SiReI8K0+TPRPNtwLcnCat+C\nriVAYrvXlz1e7phZMxMZsxsb1uZ2qJZ16JEv+o8QXgxwDF/YreKk7EXTintq\nGGVvGSiKCFZ2JRHmqSYad4Ydq6kv0u/DW6GKzoStlNIZugyadusrYHGWtW2w\nKwO2qIlfBcgY4yGGyEeU8HdUga6ckp+dSACkh6/65djD5PR/WEqfW6/x294P\n+tVp45XGXNLicYs+DJRyfGw2QTEW67mcrMyS2eAe/N8WkN06rF3PG01f6uRz\ng1Qd\r\n=F/vi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV+fEAPx24AQq6IMo1g2zZsX8b13YjQ2A5AEPKQ38vJAIhAN/xQMyfKbNyKZbWlxSAXkbzGf5x5+MTIiBIg22l3sHM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.44_1597200070532_0.15724253507964736"},"_hasShrinkwrap":false},"5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.0.63","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d59340d28718593d292e853c15cb1c0496bc0a12","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3m7d2QYJmRm//LiYWBe7mO/gsQd5SU81wV9IB7ragJqfHTmdGE/+9LYIVqdxhQxkbgf6KJwjODcPvyyoBPL8Cw==","shasum":"4cd99dc85283a327e4556887187caa009cfee540","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0.tgz","fileCount":39,"unpackedSize":194478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM1bsCRA9TVsSAnZWagAAxxUP/jeSbbkk6JnNGe7YyN6m\nMttpPRqnCKm36ZvHzs+8E3OyxpKnyaANqGoNc3G+/DfwXbXtiYpLP+D3Sbr+\nm6wBJvPw7kRLe1LCfEDfXSNw70DNupQq7esF8O53t+elN3OrLQZ8F3D7uXBY\nHXDcgQ5ZKvkKg4CD6FHCRGm1AN6HGHRgO207WPImQO+Sf4vS9/mR2flFas6I\nEAWMYldAJ7xyYdiPl866HV90Noo/V5MZtohIgBi7LUJA70c8cUepAsJC+P8X\n3zM9/1HcDjvsS9qkNXavVOgFdzDuAmzwyTW1nWVYx4GhqgKSLhX2tDK5tQ5e\n/oLzf0IUjFTMWKRQguYUgqxZkkqiFn8mhyaktpMhkqpzkv5RKcRambOyp/fk\n28zo7NG/aOsojsrTD5N5moRVcfln5ROkF79Zyjy8QKTs9KZgxNo/iNJisMJS\ntgv1CEABYnkP1x38e6K1ZWMMRt56VPe1IVm6hNobRZT9fQm2WrjIB/Cyffw4\nbb23jH7qsLx2J7mOsYXcK6JitS2yKKFM5fzwEVQztlgdN10Ji7fjKFDUPPJ5\ntS9uMuMsC9SJO+HyPpuJvlQaHC6Uezs9kJ/1DoTaxGL7yP2TMmTGpf92xO0O\nquAGw4u3t8PM2VxAT7ZpmkkI6w6FVVcn1jlpvKTRxXIC6+pwLuT2LWQra9Av\ncwzW\r\n=o/r+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCA9gQz1rvmEyIS8Sx1WC8hw0mCzc8M+BUbH2KWrfqVSQIgaEbOvRiqST8REIBR6YmjOgwxilGoYPhikD6K+5hlC1A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0_1597200107471_0.8493607319008467"},"_hasShrinkwrap":false},"5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0","gitHead":"b3d6954342af16ab12b58bf33dc399af64096dd4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wPjQs3CyGBqs39dSdX+wh2OlGDhizCnELsBWOfUIZZTFniAnvlxV13fe9CsDhgbhNDhCqNMGh6m4kZ+Vw1ogPA==","shasum":"384570c2ef0b1b330d30f9ba480e8b94e14ade5a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0.tgz","fileCount":39,"unpackedSize":194477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNKEDCRA9TVsSAnZWagAAsfMP/0jNfZaBd9T4J0RDnuNk\nVWjqXG5OqtiNL654WfAUj9z3YJtapnWVhtlPj8222cZshHx1qFPHPRz+w461\nvNgbuwuvvINdtzi3hpd0vhoWGyC7fTKVlGTFpWz7NHJYVQW68iuYsDahX+Mu\nkXDCtEvRp1wip3k+fuCIG1M9J67jvFqnTOKRVFTPdKa1lqcEf38KqmOziDXb\nn/hGiNFU9rXPeCaJGG7qpe9wK0Dl7uZByYBLin/8lc/gIGnO3tgK54qoczHm\nyRo6tFlkJhx3Ib6nXBS79Jfb8rzvO1m0pCgWH9xOBQWszbkOcTv873A5ge6h\n0L/EhqEcclPMsYmO80ofxIqdz0RCwjcEQylUF1bjExzxbHmfAZUwZgVYZam2\nT3ilK0d0waatn+MMxp2oedbHqW88LhbRLvfSzB7kY/k8JB1oT0uG6RJ6Z5mT\nF1QJ/XwVlZEn/Pwnscy1RGWasdVKxky6tiQmvWahqcd/U3f1l0O8qsdpHFsQ\n3yyxOMHLtZDo+3fcU8Zde2pm6AgdmwgqK1U8O5UYVw25lpyeFBCd240WZZIl\n8GW9/xIjtlFXaFkobuu6nU2pgd1eTGQBD/k+VckhfDf7FWawB95ZsDWwXiZT\nGyueA+DU7gZmVWCO3jQAINzMJqzwSmyKBvLcC/3khr9ncY67lK3DIdki1HgU\nAKAW\r\n=/2wG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3R5xC3SEqHn43dshJVpoHBJJ1kG7ldsKTy6sz5IU0KQIgUOl2Qtx8nOQrdHrmQvFkKcmXuurx2DGoQw6Yj4jXrOw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0_1597284611407_0.08756103002975757"},"_hasShrinkwrap":false},"5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9c421b2e5c34b6600c36b188815cac13face8ad7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lJn3aDZnaDo0VE/1JL4SL3HhFjvcTLKHPtJhOgnHsNJ7nZBIJAfdP3PvU7+4TryJIdUWGZ48rsvNivBsm/iSMQ==","shasum":"4c52b1c38b8f3ee172056dae83ed3212fcfe2fdb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0.tgz","fileCount":39,"unpackedSize":194477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNKFRCRA9TVsSAnZWagAAMsMP/R39kORQbaCB5LdLRXBg\noxp7XXRqjAq/QRrPtmVMzkyBXBUEBBsI37H7SrWZNDcsYpJDTX6YSY76o7YS\niek4itiY5sdZA8sDszyZ/SJfQZz1+KtPJ5FF95j4lPuCSE6ZxnYeEgRamUPO\nopEhbo9HOt1yiiZBexcv5wYKnaK8/vM/nqg2mwXvRc2hl0/EUR70/Ri26gz8\nvZWnEvYtlBbsB5YtUlBF3aBJ4ZM62lJf1hWjuOD7t7JF7m+6vIIBBknAQ3rH\n7hxJunHNx1Je1iwbyBP3/cMu1RY1oXZjkPT7DsDFL1kxt8TMOVXZpkDlFWfl\nh1FSa6aMxpskMM9xF+RbxY9DVsswq2uMFzsZMvjgm2+sFcGLXdnj7jdqOtEy\nZ/hC+TQwAGKpMAPryxLSxIt+gwn24O1sUZNj6PCjxLVotmJZGXgVX8utuD5l\nlAcVfW/YnWADKgS3kZrwxUeTE0a5Z4sdE75a6Ov6LbdcVe2+h4HVFzmlUDS4\n/Fze4rEkdQG8QBve4OknScjGbl0gM+W7ZCGAfgjlXOXKRhaYzeinPPUtm8ix\nV48FKpzaP4eg3yFUGqj4VWX5bH9YSpc2u87k/3qDpU6Lo9BBBNaBLm2Re3OC\nv/QKATP94YB3eg8uQfurN1b5QDGfJ8VPCN2wBS2ZZ4iEc/v16Jz0EMvHN8aY\nou7T\r\n=NUmt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv/EiwvkUXPMy4pAcCuPlW62cGS5lKWHMLZeLu5cb5eAIhAOOAESR2HFUwoGko9CQlsfnH9KIbdXfFNZLKQ1RdN1eZ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0_1597284688512_0.025121194221042087"},"_hasShrinkwrap":false},"5.0.45":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.45","gitHead":"159729eaebb95613bdede59d4157bc3bb21c31e0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.45","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-A4pX6eb0NF8NcBP7H/fb8utIWsVeCy+VQ8g4LePFsyTR8jb/NbD3hIRNY9bWrJgVZmuAgq8w7eYoPf4ObwE7Cw==","shasum":"6b91735640561d44abecd783b3d965743c839ee0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.45.tgz","fileCount":39,"unpackedSize":194710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNKFrCRA9TVsSAnZWagAAgzYP/jCAvXjEPukLs4JeoYZr\nocbjTHD+UgwojiUNhZ/XpvRlV1f/vJdQbTXMCtsb62c7ph6agZhvi5L15XOS\nDvt2ANEz0Hbk6+ei7n0hvU/DIz9WZXD1Or78F0EBJ5wr0aPA7njGRS6FpUpD\nCtD5nfjVbAaBMVLlh0ufEMtZPmGJLXHNqyfnz+zYKeE8jAnAmfICEDndsmtO\nVdHCOdSvy/QwgU+hw8L0eOogdX1cnJmVVDfIYyIrVaD2y0CohsrkF0QhVT+I\nshWpWL5As5Ijdt67wQ8Uo47iVabQQ4L+IuX9cpwenKuq8Irg4HnTZoLeQCka\nNqJTYsuBoUOlou4v1wJYLfnp/fxwuwTuieu2bC9ccli1IT3sYHZ7lLJQMgen\nfuno0ul1Dj4FEuZo7ORaYIn0m4kSuHDKxKFaDvpLpMANE0Acu2cew66IFmn4\n3m3G0VR2w3bhHfkmji9Pw6RQN2q5EdEtGFtZnxTSr4yh2iRBGo6oZVD6myuj\naGl5b8mw4/3TUszTk7IpD79xKDy2vv7aMIeJ/If3eUkgfxc9B5OQvcR5IUOF\nozhhxQqFWxMdxtyYV2YlyNgM6wBj9DLX+C18iaoP5jSrJZbVCJiB3n5vdmV7\nrC/Gztr9GoHohI6Mno+KUz6hcLTJSOhjAJCJCVjmd3m7/VhKjx0Az5oRZ0JV\nCSuV\r\n=WRad\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDf2bFztIHleqLoQU0LRFG/ZkaMe3ENE0NWyVnvq7L1gIgV11f3LZZ17lLzinvpl7yLThorabwSMS+SjuMPV1HZC8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.45_1597284715012_0.9888081894315222"},"_hasShrinkwrap":false},"5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.3.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"159729eaebb95613bdede59d4157bc3bb21c31e0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0bwhItWfG56r2VurHNmMwfM+q+DOXMbYOw+DWlMxF/+DxqgtwI/Xefc2L46jtZzwifsRF5cmb3iVEwdDioeeGA==","shasum":"a21357a0491eb3eb68d0fe160299ecbb43083e6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0.tgz","fileCount":39,"unpackedSize":194753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNKGGCRA9TVsSAnZWagAAPgcP/idc4pdaEb5bEs2qVPw0\nDZyj9GWytDBDByPvTzp45YyAWQ8Asf42+xMJlhNdiGl3kYcYEQsDqIit95XD\nxKekGV6fiJCHZuUgWnVqq5JvXXOvIVH1xOWfUQqxabwO/2ngFa7dct9mCE2O\nHa0ji7eKxA7uFmar2mIhu+9YkPiZTBjpXFzJszOnQLu2fEvAVYfffJN4+FeT\nhu5Yn4NxydwrY+lw+mWQHzYX0nzYSpjujLbj88FJ+b3A5d+RM7d0XwPWoRBl\n+FIYMF9kQX2Ep0sQPZDxiB13lqVcitipT+LBxdp3QzoW6asOUkN2t3GUzUbH\nncWHHa8erLXmwi6X5TOSEllgYT50rtlELAlCBmHkQUXZWInD2Mya3C4C68z8\noLeCeqqNygllWtZ2ttFzxvzY+ShM/vGDMD2WobfJlzT3HtJctuvQUL5fUstV\n30Q99raDEoLXrNNlbLKWih+78kDrD+pYEQHONSJllDWrcsnUnl1vrAiqZrrn\nJX/0dyfux5jIg1ZEq0a1pB8GxRMyYq2hWeq1/r5EGRHuTKavFr/5XKpcySHl\ng88mGKCSS2MblYsImJI3x7cPwBBSYY1pT3R0fZSUg88YLu80l563TKvo82ne\nsea2Ec/hrUUhnYdU9YUChsODZsBcE7KIvud4eMuN/Qi3owW1ax8gFIeMq9t7\nNuXi\r\n=6aLc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYZ5CFgzm18JGYsllv2thTj3EUnDJiMUFF3afVis4tPwIhAMgJyCQm3amWLGB8yEYHI00+xJ3lPWIYo7UOuygfZFvZ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0_1597284742147_0.15803845229755797"},"_hasShrinkwrap":false},"5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0","gitHead":"5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3P4M609R+Za6XumGs7i7ARFnO6mIWgEhFRnnGxSdBz4loGuLAmi1YhKTqLFBiT76+nGfpt3HfTBwxuvmd16NPA==","shasum":"2181706bdd5e4d6c8cbfaf1bcfe9390e65b695b9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0.tgz","fileCount":39,"unpackedSize":194753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNLNyCRA9TVsSAnZWagAAMGYP/it/YrS7FCm47TcoaB5J\n09FoxdF7CdInE9ZI3jdkun1mvkF0KeFVtx6lEqmrZgzg4oRb9pGD/L2Llny4\nWPnwMWc4OaUQJSuVkAIq0EDmPJLafyyN5fens74p5K5kb8aBLY/FrMbEwGF4\nbqpnaYWF83xzWLGxt09qUBcbD74s4wck5R80CPuMsC81gMuGKqurSH3yIWLt\nI8ZjNZQf4cNJGiSY4XISdhXeyBquigL7++l0PDXdnwERZj3BLvsO14KP6gLo\nCtOvJHh7o6wPW2LvHsDaze7iPjjlEomNU809reaC9dftAWOPk2TznEMowpkB\npN80mHCPk+1VfdCwMLF7bSAB5AJeRQcZH2u8r48mFRsOTjfAiGXxSBADu3ge\n+iTjh9gXwY7N/FsPwuZqytuGqer91sGEyb5+bfcyH/t61HKPHDgyWBDfiMQy\nJlcHGUht6BViP5rIeEzX6Ii8fnonh+uY4AwPez6XNxKJAAavpQo/giISI99Y\nkWdyymngeCq7hKbtPC0ypwhGogm2h1JWh8h2tEA+AURW/dStA5DX4L4vJre6\nkGNM35Fs47778x+0brs3M9NBHS1i697Li5X/lHPxqAfQxoE1D6h5p2NnZoK0\nYl+4Z2gVbF8jSElyzgB/OwAnxE3S29STNQDZvovRU0dgHHFYn8kHVKpjw7Ht\n6U+6\r\n=tsWj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiu5aqPGOBNJGP64G1alLKXAW50HmOcNlKju3rq64j6AiEA968D7mAOcG4e6qbBB8/VcU8sYEXk17OF87bwLcFXdMQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0_1597289329815_0.5949557634403451"},"_hasShrinkwrap":false},"5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7233b1b7c0336e5c02586e5521dd59b82bb528d9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5d3ta0LLZb0E8ZibyuTucX7kEURlei6RDQVf+WsLFQPQWbx1P3VDHH+boCc9S+uAJPVdiYlr5ATXXmJdgK5Nhw==","shasum":"3cea80958760d9115dd4eb2b7533b30e1676ba4d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0.tgz","fileCount":39,"unpackedSize":194753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNLO6CRA9TVsSAnZWagAAiaEP/2rzRSEIHielXV56rcVx\nqgCyBpsTvvdxER/KUNcoB9X9Hl6nW893aQytDUAZAjohwpxyNEGUgRTexukW\nwsFpMz+Z9Yn7IPraIg68GF3RatkS4/n8m0ajvW4HJvNCnYXFwVkCB1YLwsUs\nfVEg98Tqwi+qYptH8pb7BPJ3cbxyOzL4ea6TxpyIYjZFV4uDHvBXYWBA/0Ok\nmDXNEqxvrJbAbrG00D9i4fT8UInhZ0EpuXmFaElQ6mP3nq8wgwy2XPQMhAhR\n08AUPV1HVuN13jwpItDUy316d0G3hk/UeqXmVEPLVSAKgn1y0jfdFkXm//YT\np2CeYmQkLs1ehV2UCqFbFKtEw0RAXhRT/58faVmRBTxtJBsns9l1ANyGkYlX\nGICDrIAcvwemND6xTbx/WoBlnuN2d+/a805Z5o/TNp4Y2DA3tkY4RmTpfdx7\nQ81afVV2iVp0fRo6DJEFFcZts8BHxHq0VOuB7rL3hhNNmsUYkHRnJWPGuHN3\ndnqCRNrurLUEvmNyRIiMmyt31v/sv+KXHtr6CJ0FDeyONP4jrVy9/ZsynfU3\nSREMkqORYgcP/n0QTofQq9LfsJwbL/TPlP/e0nJcmrdVz5czyYbzKYmW2cZA\nQ5WqmcV46E+QbSCgRnVHPqXlxwma2LMx9bGY5TQyZNan2G7+iWgj8fcljHi8\nfHN8\r\n=sQVM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5wZLdHrUb+lSlQyhRYmVgkkmdcyavzcvH8F3PnkSxFgIhAPcv7Fx9wxnZ57yx5ZLnFM7eF1/d14QSUwTFHtFS37Wi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0_1597289401676_0.20550301773024748"},"_hasShrinkwrap":false},"5.0.46":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.46","gitHead":"9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.46","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lRGHQZjEkteqwIWpN879+dHd/QZtdlsyQ2mKbdARZpTMKLRyIuSKIyIwA615EmyTEcynV6mzYgKd/FB5eJsVoQ==","shasum":"06919e913d76c6cbbbdd451047621591fd991303","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.46.tgz","fileCount":39,"unpackedSize":194985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNLPTCRA9TVsSAnZWagAAH0sP/1pZSQv7Jsmri8ZF8IkN\nYsVs4h4SlS+/q6rXN5Rex1z3YdAu775gxE9Qo8ACaAgIU8rIhtANK9cho5Kg\n1wHvX6r5O9mhQr5IK45nwlODEP6jieWPGfnNVvAdSU3JJ/ksA7wswtiAVrL0\nEumR7ATaghEgcnKpATeVeXHxBloL2yQwzmJbeFjl2BEwdHyknE/Kffanf8aW\nMRAihH0jDOHFlxY/dY5JyFsC04K6GljowDaZTQ7koBE2dCe81+LE48wIVspI\n+CgGfssoTrDUsYAYHBSfR27eL6QXI/1Ilkf/uKU2XNkNdJygntdu2Co6cklA\nPMr9dRUTAibaoA0Svt3rALEIh2kHM3muHdIvn3dbTEqPbs9VGMxQqSqWR5Ke\nJQE0vz6EwgWgqYjR9D3cbt3xT3tvvplVZ4MkCLTp/Ne/16SnbGZHHFVlkods\nnAz3tp6nGtNx0booqRsZf6dMFL1MmciRX+V1OsX9lmCxyZJ4BJQvwVnJ6B6s\nLaEZJgMYX8hK1ZMLmRsOdJlskYmXSTpBZqNr9KgOTfjfYP1qC2E2N/ULdGQt\nEcz/Qp5278Y3X5goB4YAxtzKxH4pTLrILMyckyXhdsoKUFIR2u5umboHtjsZ\nKuqD+6VKS6dZzllkk6xOGwds2ecrv5I/ol8bLf7k+PRbw2qhxNiyhdCnfKUl\n0XrJ\r\n=5KFe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5OD8Gtkjn2N3HuxFc0w59JVTpbnSp4NWs+77fmWex+AiEAz50CxopakXXPQtiGN7xw5vh1VGR0XHOAZVylGWAYKhs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.46_1597289426704_0.5064551438906237"},"_hasShrinkwrap":false},"5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.9","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PgMqQf70QG9vcqHgY7qxrlRvVoUJv1e6EZa4w5pOkmZI57rlEVi45roKNMoVyjNdGkn5iMlLsTaLO8lZ6W9Zww==","shasum":"e2b514058643ff33d29e8cddd7e4f162ad076146","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0.tgz","fileCount":39,"unpackedSize":195028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNLQjCRA9TVsSAnZWagAAm7IP/R0C+0sQUfk/n5QWEMav\nIANR2AnPdykUheD5vqBs4ayn9SthWkMPON+wvn8wSLWEDbeBgqxfqnKrqPMv\nSFnyxIAkMvPZwcNTd7hMFjIycxHPU8op31R2ROnJ+p1Lb90ggyyJCZuJnryR\nPFRxehZcdi0Anw7joQ4m9lbAYyI8sjHqYLaI1bmhVBgNxeySKTeC2T9NiSbo\nQMfnl9+aFkRmA+3+RcRULze7mc+wz62bdbGrtZLHsQrFDT2eTaQIey5E3ptZ\no72qu70Ncbie9OFG9lh9rK2sCSfgqA9YgsGang8g/+B5UmUkUWKkJ4QoFZs0\n0YU7FrbEXWsC918fZ+PyjhrYYSOmloOJcR2FQsFPzPk+43um8uAMZUIqAAOZ\nfDZ8uAd+ANTrcwHPeU7whw/VTLfEGT9E5UUsnqfkteLl0QFDtlBVYxQnVWXN\nm/4qo1njYQA6QbHNBUCG2eFOmuMyr8zYemyqGVvCJOKMCm3dnI7v+IJuoRIu\n9BhDeaAyA+KyKPtF0bR+2p6Bi/Z7/ft796Dy6t8M0INJ8mH7ObOH0Rf4fUnP\ndkH6F7f5ze46yNwdKvLOQ4sedfCSF9rQNLWwsVqGl3LWwhdE/Q8wnvJnVA0T\nsnemU1UdkdiNvBPtWtpesNOgjXj5V2doSkzvC0bOdqMxq9qPNjJ6Cw/BvFZi\nPjEl\r\n=PPR5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzUGcAxicfebf5IYiPBBLrvuZR6BurQ8VAg0nQf67DsQIhALXmS0hGfUlQClKTR57Qv+xi3RJ/znhSDx4EYrlK6ztT"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0_1597289506503_0.34338279851706965"},"_hasShrinkwrap":false},"5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0","gitHead":"707ee924e0f4cb3ce2954c5161f9de2f558fa3cf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-F2vMKYjq0+DBBsKRcGBfoNst/F9d5wDFbSWK9u0sGMG91vaCoGwXn3B8HO0uc7rJEz1D33reVdAbpYXV1x9yEA==","shasum":"998479b38b5a28676c6d62161c1a13b1198955e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0.tgz","fileCount":39,"unpackedSize":195029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNzoBCRA9TVsSAnZWagAA8v0P/1XWEtW8XYho965vYS8d\nZNRnn2hXKEAZgdOwWsntEBoexq9f/hnntyYgRd2srJjBAI5gFcfjgzaDN4lK\nt294R9c8+pKAcOpzZgLPA+SkxD9+EKovADXmFEIyAU+rEpDOEQmqcaeUk7bs\nr9kdS4wpsnq3ng8L46hAyE5ZhfYCIdg21bN2F8GTy9FIRyJAsJSGWlENYUTA\nRF+VyOwEEp+Mt9BvjsoI/Twb3lgxMMhJ4y3k3DOwt2ukCXN8y0DfxUKX6dti\niXeYfX6WBOiV4qe+KdB8P/jiy6RWGpkZPUKa/5Ij2+FhTSxloW5Axnce7HVx\n7ZRj2ROHk3So4CmMXxqcr5wpzs5RFHqlERPkNu9ILVpC+Oax0SDbsRdxOw6n\nkGvdRu3lEJ1F75Mws0g1R3wYMYlUdQJmE8w3OrAjz+fzPZDN6I15GkDFHTFI\n9KVTIZajj2oxyjcEWrWDKY3Dypz5eQHoX8ZiEn103vphKFLkDiah/qbQ9NVY\nvy7J2TIXI1rYUzzl/teKkzXpoK7oW7onL8t3/L9eTd82/UaeXeo5hBCKmHc1\nazARRNVXf9/FnoPx/amsHj+LWGo2v1pu9HNK1ywf7zOdWmoEqr2K7wO2GOPz\nPhZ49jXG9yph1cKCd/AJwEhFcBO8Ieny6uKAg7wW5RVddvm5oVaotoyxbE8q\nocFr\r\n=RixJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJJBPVHa7osBR4P97GxV2s7g90k/EJVAuTbCC8nErRnQIgKwAi+LFfHN6/L+te1+EEKAqeqmGDStjOM1M0jF2zH90="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0_1597454849200_0.6514619312154337"},"_hasShrinkwrap":false},"5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"65c36a22836edfa7eff5def346cb7e7a9d622616","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yuXRcff0iJ6XEJyvayhqZ4ehy1hZi8loNiCbM8s4+WY6hUDZIWavVq0SoBfr1QDOTxSTmlpgUjPqBjGJZl3x6g==","shasum":"aacac4df582f4da4c221d93c9b67a908c67eb1a2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0.tgz","fileCount":39,"unpackedSize":195029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNzpHCRA9TVsSAnZWagAA4KEP+gMoM/SQaLpqd5Wt3/ME\nX1LcTDC+tw/ADaj16CCPtzyThcsvH/psr1uv2TF7NzNk5nw8V36WDYW6ro/W\n7ubXN3z5A4qnU2cSM3FDYvEECpdcTwyEPTM/UYxCSAH228WWz58vYoVKih1G\nYDzP/JBlWvgAKXW02FRJdq0Stw0WOaIkZwwCZiIorut6ZuTPfaIHOxXDGvbO\n1qZtHKzXai4HzCEwby8sjoCr0DBTDjRowF0ht92ekNcl00pSmPYSlpMI566W\nRn07DdqLSjNTrIHihFPpZkNabhrmdvquy9ItiA69WeEa8EXK9oYoTsDfjMPr\nAEqldpkHL7WTJ/AoXoWw6mo0Gi2UR0gQf5Q4KM5WHh4/pf0EPQ6cIrznfQXe\nFsjrJZA7B5FBY3QTEGTRu5viExZaSMuTBkGFYsvfOXFG3TAoo3WUMQVTaTvD\njmU2b6+UQCbn0bj5ifFUbZ/NXYOJicgFIGcLZlGloWstAxgeJlLL1l8krqYG\nYpxqcNqnwmU0fj+/cshqiO48H6wZ4LjWI9rLPGVeHHdlO1w0YzSWZwTIvUFg\nJjEs/t2Rgt04HIvpFWgu5dFvMk4vzCRP8OLvwLonO/TwFR7Nv0b1q3q/8Oyd\ne0aNigzFXB2/1NECxIdiPJIZ1P9CrP4YeG5dFqb2QakhUqsO06uUH8EmCeln\nSinH\r\n=TjkN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA64/VEg4bnrmU/B1gxzxWFW1tr6XFPNQBJx420TY6iHAiEA7ARgOnKfanz6f4YK3B3QCO9r36dZtZCb1jwJFdiIsZs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0_1597454918550_0.7776024064301743"},"_hasShrinkwrap":false},"5.0.47":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.47","gitHead":"deb2693e9ea9e6e94290a4a6cb10273f8ce1144d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.47","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6DQXW7kDczrYn1qrG+G3ktvK+z/2TsA1W96dUfmceg9eiM1997ep8zhRUa4wfCjDOEHUIwOjetoiJZw+kzTvUw==","shasum":"4d2eaecebb9537cac0e9bfbd579718713aa5f404","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.47.tgz","fileCount":39,"unpackedSize":195269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNzpgCRA9TVsSAnZWagAA55kP/ijosamLGApuozMMyhNW\nwzktVG64QnOVPDUe16byXIkoFi30Km3M8cU114rBBkkQ+hzznZLsUTrOiZ1P\nn81yJoggBrCeg1BCN9fy/7ZQ71JbnxVKzvQS914gqDcZEttM56gRgNN86dmb\naGSG+hbnvA2d01GEQ2TC/Fog5W2VqAmAkUFY6aJovtP6eqhyzJ+k15aKUogL\nte44SpSblgoPc7ciIe1NVKB60rY6zcXZEQjxzFLZGhW7eRFtsIX9asO1dfyW\nWgMI4TGUJChPFfYx/fhtj5Cve2GR9ZuVGI0qUg7WIcbw/8rNyuzCkRdQUC5E\n6gptZ6KZqlllVSVTGZTALcWwlF2UyvguJDiqPb0QqTLYXK77pEuiNNjQ0MKV\npoDum5IlmPvOpODc3nZkzGV6FKjxa0eaPiyUYQyu1RI9bwIGXtXXz2eeYtNx\nysaMUyRnEKs9OuDDVmsGV90xJUVGBEUd+t7htKmL2MyGpA1EENVviBcPAwfk\ncfOvQ8nezjpVpkXrWPhsbLNFiQbP2e8/oa3Q0rgE+9q+CYfVR9Fh6t+DisfM\nMFjsqOwjSkGRr1DEc71O3jA8YuOIXAZl9oKYDcMEhocBLrP6XC+l4Py02DLA\nbKJxri6BgBvRCCG+ZtfqK7mPvcuxOku3WfHVNGBAUyH+gTjoajYh7rQX7OxB\nH5EY\r\n=YDBk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDau6zd3KTGRkmo5d899VrKqoTqynHZnGE78nDQbLNejgIgZenourOmNXgPO3NnmSTgc6ntsFK8Hhco73cz55K0Bbg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.47_1597454944033_0.0959850091694252"},"_hasShrinkwrap":false},"5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"deb2693e9ea9e6e94290a4a6cb10273f8ce1144d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5bvhBw+tEZMRtWm6YT6t3UbHhORVFmL+7mZDzDQ6hoSOGKIqGhI+IuaU2qM5YFjTm8kwHVletZqrSZopcCSzEA==","shasum":"06220d6991caf40097e1ffe76ba1e134cd137e14","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0.tgz","fileCount":39,"unpackedSize":195312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNzqECRA9TVsSAnZWagAAPCsQAI9h/FoydS2kfVQxhIYV\nJg68BKnFO/3fVgyNP8cr3TZYcoJXy4XVnGe+biPZ32ubzR7gzooAYkfjcO2X\nTegKhxmgD4pZvPrBqaPM/eQr6EGBsMuM7uWVinrWU5SgtYGbBnIelMSttRP2\nzQFftCm3TvInEQVMUKSOH+1BYKUSA/aNAl1ieakV9ejvtwW4sLWdSYe4NXvM\noPRck5tWCjd2F1ln2yGLT38pop1z/pA4o37201L7COs4I808XsfZAnVRoA0S\nrjKL04r97shbL9s7g4cK0zrbQnvKmban9fxWbMGI4yjt/LJ141zuw1JFwwX1\nUsDtHYU6cctWa6QtG3aehVUnUqloPlaDhOBpOVMr6eqTme+ncykagPezlNUv\nfug6vIAXl+iJ3PRvSuOMUVF2yFaUBH1Aghs6BNHU3EAAkkoDFtOAMA6U5nMn\n0fvKSqwxN+06j9wVtRlX9d/dMCZ3RfK8Dz1pm45F28oyNv68xnk2ZZ6pZh5W\nP0CZi03b6EkmNwU6R3OuTo42goyfJCsou+pT/z8/1Igqz5Hun7KcfBlylq7a\n2tr3c9GmjSHT2C9Yf1+Amic5/oyBnx8/UwDi4x4CXyC0TphL/54yLVJBdG5e\n1Ycv+bWvBn4C6eHxPA1MsL2HllkII0oMKQMN4GtWpL4eILvdG5WbNl8oZp3W\nQkHg\r\n=PITa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBK6Cuz5H0DdUjfGediaMcmKc6K5/2hS9G4rcv97zaGzAiBAiEPXDmc0vC7iiBqWX2xDzmoAKMcnHSumcTOm7l+QqA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0_1597454980239_0.014750885386538126"},"_hasShrinkwrap":false},"5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0","gitHead":"0b212a3aa47dd7c74a384515c062dd30feec15d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-K8tvNE0aKGey029jyUSqqEU0wsQWxyBSaljS2aVsd5UUDk5TQMvoRE9OgetG4NON2oAWOohCPtbPQP3w3ak8yw==","shasum":"e883c9149a366e396540a35b04913667e15fc675","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0.tgz","fileCount":39,"unpackedSize":195312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONl3CRA9TVsSAnZWagAACmgQAJwp5QbJ4aqoX9FOKv0h\nuD5wRfgTMdwTEavVYDHMoAyCCbIk05xtTXHQ9K8vK6hngEnO1KBvoi4PoaMk\nHsDicKPswoFIKTSbLvAmQ4SfZ5UPZnriFm+R0rVNRbVoka0KKpqGtGTwefRZ\nc4BjKyF945WFvgT6yYR1KZGd5Hq2PPqsR5yRBK2jB25mMLkHIB1RE16h15B4\nxR4MeLRSQnKrUqppGlKdImA2zycBaj7fzNQfFraLzRwEGQZO6rUxYX50sXqJ\nFtj6fQ8l0O7jhZKG/oBpB569eR5FMeu40h2pCSc/A7Zg7BkBsywoFhl1KCJL\nf9KtFO0iZDtRHxLnIb0NhZIPzeeiClYokjyEM8o52QU/A99gkiM88wY4tr7s\nV7BTVxQeUAS5OU1VRikK2tu9lMz8Ypgp8AJFfofQTYgXNE//6jcEOIYMv1sl\n7H/Tz/ua7t2yokeZD7C7RqDSu6faF4txaWtbmlNUy/hZGWpGL0khaTazkIcM\nvJC3vW9YeUOv4nD+pQuSBmGjA0mI7yX2bK1MQ+1xkgfAVv1+8Q4tkwYIccO2\n7R8idMpiLi0KN0gU6VKm8LwFC9ZoI+PdmiO3fQ7Y194s2sKXb0aW8vmpQSe1\n65Fno75B+BzCHLCtRgjAB4mPjr5uLYUX6OucqNkNdDNqzfkHx4KWpSQ/NCB5\nd/kp\r\n=vSKm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCp1YDzM5V/452btLWBiLoqu0m2IASPSBtQ1KIJ8nqYQIhAJYL7SYWvbrpj0EBj+nX6FkS4+aWTruoWvDkApbpKoh0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0_1597561206421_0.40089902781765785"},"_hasShrinkwrap":false},"5.0.48":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.48","gitHead":"ca23f62311543d3717559b0c58c7b76751512290","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.48","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lq/vvvnCB+EdpflAJm4bdhVED8LLoX7HMMcYdvWvMsBoQ41nrFzTGj+9fB04aUXcS9FNyX6C64neeleAyXl0Vw==","shasum":"59bdf30dd1e32d4231a16f2459e4b165f1bd2c25","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.48.tgz","fileCount":39,"unpackedSize":195569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONnoCRA9TVsSAnZWagAAckUQAI85LaY0/kw1QFB7JYHE\nkG+B3AGHC3d+F+d1xiqtYWinFqKNo7HdRtoAgCsvnuSCM/FlJsPBk5fknZ1C\nEchXY2MhVGd5q68irsTqxBicC/xg3D3ddUjsGNCLLLGBAU0JheIQPisnfGl0\nf7JW2aSK8kl1hCmpm8TL6E3CLIrIkvNlGNkA+KdjWPpDmEctOtH1G6ZFJWsx\nxxKjHTW0Ywf+PNgROztx2bKITiFpWEVdsXloWIUnld+D3nRBKWbMMTiyvsIm\nMR0j8UBOKKHkeY8ikK8t34hr6RTe60oFn+cI7n/xRFR+UoNE/cXgIdR20Zbt\num0X3OrIMZ+tDBUsy8mdAaRaOBBWDFi8NOIGxaikRSEr22W9OkJtd93iMxKc\nUmjxZL7sG0n5QXCXOcaeLxj09U9UlPPE9KD4ufU+QxAMfBYlU5898pSQH9t4\nT0c1aiZV2RvgyM/59AoDerBfjN9DLIgUZgqVN1toApeYwqAEJhxcZkndRo1o\npdA82zVC6w414pMwPBXAUyDnj+R+/jeeSzvomqaPyHZ8Sysb9jy28nCXPaU2\njlu8ramf+Z8aDhAjK7Aal8sDsuctaIJ/Qy7lqwSK4PTSz3tQxFlUXek7HcZx\nOQ66rctyox1s7aK2j3IO6XHJWGkuAijmCzea0moIM+11F1kdezKYta8pwCWe\n0kht\r\n=Za7r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEFrRdgcadzqFE+3rG7ZKAPus5qf7AlO0MyO0iTvkp2gIhANxyKX2Q/h3m3ZlB63BvsqQKv2s3XleGHYTbXUxPzTqy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.48_1597561319425_0.468849192942284"},"_hasShrinkwrap":false},"5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-WTNrtzco8kXBxdou1Av8SPB5XYTYqIqdxScWQ8qLNYAE/5sr14Hun1GxUJchkLhYcA5H4ZnSSFlB/XkzyeSMHQ==","shasum":"538e5a0068e07543d921c5ab14712a5405304aba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0.tgz","fileCount":39,"unpackedSize":195312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONn7CRA9TVsSAnZWagAAensQAIsRJJu//Pkg8XqtdCVR\ntPQ+/Qqu31iG2wItZRUlC/YKFzlLBVKbGgJgTvlOYyhOypxGgp3nlCJGo2rc\n01NdSDqTUNjo5wt1cMulAlQzAFBnnREzLCTVNosjHpwqOWfjPCtco0dpnCvv\nqr5ftV1RNAEt8tb0T64GBI7W+ECV0cDRlylyWtQ9fa3VYZFen6M39IsJMVem\nnZraXB0x+0crhYgSsB9Hm6SqVMBcCNq8dujwwBwlA7nB4a4QgE0UlIr0vZTu\ndmvb2dQ6o3y/lu+mYyHo7JcmxfP4HPr9aO0I69h0KNMlYDMpLj/qAFDn/6n6\nkO8pTm0vVGyLvYC5JTsQ8ZWP/bsWxzTA4WoMXcm2/EMgc5LN6xTH3d9vT1mA\njFp70mS3g0f95GEx4I35wPcxHFgP0pX2qhhEr7n51luGNC94w4uTZktlqJ1G\nufZdZ0/BSmWTMik8RtG6lqVk6ZmVfjxIHdNZjo7wdNgQRUWa3H7ULCRYM0ci\nGWaFge7bwf21TAoqgKfMAwE4mKW3nofXS3h8nWwtY7cy5nWkChxUcX5V1AiN\nUX2YTIvRzE/2sPL49U5OCA+e2OsIJSfhXOb7jLVpatx8dSfMzlH3RClYjSPN\nJVLPcC8LBHTAwAKCqPOBfYQZ+4bwPLt+TRp1FEL/XgDdnVv/dlrCSDjQliUf\nYDHW\r\n=CPxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8ZYzc1pWPBlbea4cuJVZMlix2W6meE9j8TykQBNwWBQIhALmt9/N3N7MKiaAzBm53L2db50ZwRkDFqvK1d5F25AM2"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0_1597561338840_0.3113686788324508"},"_hasShrinkwrap":false},"5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.1","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ca23f62311543d3717559b0c58c7b76751512290","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Qx5wpstf4wxWdOjIiglW4HR9t6lGDqMrU2o5kAHpeTiCl/iwFpUHVPKZ5dPMnwvnznNtQRWFUoNMfQ4nkJQxcw==","shasum":"7d5bf89c55cc72dfcc62a84212a4691e0f118473","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0.tgz","fileCount":39,"unpackedSize":195612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONpWCRA9TVsSAnZWagAAtUkP/RwUDOrGWREIV57iK3sN\nPFy/QRPqCa43zVThp8e1WRcVynfvX0L+Sn68bQ5lfKrjyZDQHT+eou/eYtu9\ntfP4TuX9z7hc3JlDIi2YJrvpf9rGDYmNdZQ/ZbhGZemiYv5Vdcc3Irui8R9Y\nt9myLEUgqhsWAsCBob44Gmv/qLaqX/GO/ii9ykdN5AeOfu/N53hvJwK/u+QX\ntYgv2B2olMwP4U5Zt3qyMIyqCHSKRUxX54lf1wi3DHvJZ8arkR2ngVbAFJx9\nPBXZlzTEsv6nrw4SA6AKygLpF9x6QC4LfKx0gWElAwPe4hlq5XC7ittdGtaX\nTMuOOoJdgRlHhPxU2MNfNsEX2tHUVbXFzzc7BQJXzfswTtnsmueo5uVAGyH4\nZfdZjkC3f21qFJvw8sbunedg+BRdj9/O6JSOxzmDWx/GZPDG0NPYgeCwkhe8\nu5MqfDqqhSm6NHMy4KEfXhRS208D/KIIkiOrvaRY9K3jJUlqrCYDeTbef2XK\nzePKq624TD7ppF5DHXI3yPd9BZcHd+XwTB0NYrwhx10MMzTfV6f4s6TY7AuE\nr9k+BEiWmPM++cSDuI1m2wZOrH+Ou6R4VaC5M01MAGTE8CS6n/vxBdw09+hu\n5g/3CYF0HspFfhDsGlUpZrpMEWsd8ubcCm3Vl4awVQxkW87CiKzCqim7olA9\nnxLI\r\n=CyYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICquU9bzW2RgCApNBaPeJEjYCQqlz8ZhXFzW2GkY7GE9AiEAkT5wnKBctJ0S7246gzMDIN5/y/YQnASTWK4XJtovjVc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0_1597561430427_0.6170920794804495"},"_hasShrinkwrap":false},"5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0","gitHead":"5a9bb8b5857f25583eace51ac6e397620b8af176","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CY8GodnNmcLT0OWu75Epfu0MZNV6pEqmMXi/EFQ6s7D5RKIOMRcAG0DmuD/SnFnTXDXc+zzFXno0fCRDrG2E7g==","shasum":"b1a3fc6ce75794c4b805c75db4b1e5c4ea79cf7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0.tgz","fileCount":39,"unpackedSize":195612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONxwCRA9TVsSAnZWagAAg0cP/2yIzSLw3+mg6rAqDQmm\n+JGdX8BqNwF7rudOXyqoP3A1OWvSdD3y6M5eIbXElzmmwuROrXKfKf0llWkJ\ngezCy6qEflCZufIcNTrWxHC2U5MiNiIkR7bEFRk1k01lpJmbrlRu5oD4l5yR\nbZGhgXsb4wijkoyafCaOC6HVWC8zzLZ2gj9XKpFxAFzBTTKIsv/KrYEiWW2d\nVb9IHRULXJ4EWjUHe8U0cvklVNxuh3F5Ypwf9KyBgGgIyJ7yhJqcmIbnLGDa\nw8ByzVv7J/3d58N9qY+uFbuU0ghlSZc0PqBO4GzMlCT0GGBti0NXwMyiDFpf\nTBQSxlVyGqEGYuBIwBWQn4hOB7FdFIM9CF5Tx1x1IBeY/oXMJD2tqnPUXWF/\nblLx1BYyG1H68fAyFzzwpKb8ikRrNp737NkjtmIkNCsuwZQ3/SNxziH7J5Qi\nV4rg31vPsKnRcGwi1ACuhUxEo/Mr9+3C/KRgrXWAAEqBLi0D5xph5VwE1w/o\nXeiY6cANB93nH+k5IgPADQ5POjhJ+ByljtrJ0CugPULE6gE159rO4fi7Jz5I\nl87/CBtAueFprFYeO/5ovBEo8q2Z+ZMU5TbDx33MmVtkS3TNzX/Ry+iiwCt9\ngezTKlCb0hA49uHNxcsYaomS71Ol1n0/pdFfLAYsx5bbv0T5uf1VEOvDd58r\nFdGm\r\n=wxq3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHA5Ah+pw4dQvU/R/wOR7T7pgJxh0po+rk8hdgajIFMDAiBIyiPWl7TAQqIruoA37Cqj9hV2m+zRblNK/fRAkWDN8A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0_1597561967628_0.6962271056747309"},"_hasShrinkwrap":false},"5.0.49":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.49","gitHead":"33e439b7d104dad7e62a76ee55c5f2b15d7f231b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.49","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Q6OAo/FBxzbh8YysvcnCX4oKWy618H5ty0Z6sXk8xmFTzNXeoKJN7aplZ2d5Iky1o7hqyRd+/F+/0HQgYC5LWw==","shasum":"1d46e43199de9db6c40bc28ddaa3935c29a758d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.49.tgz","fileCount":39,"unpackedSize":195853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfONzgCRA9TVsSAnZWagAAxWAP/A198nWsizefvPwTHD71\n70wuEwUC0fHOSYSWLMNTYaiwvkjNa1SPiHn4Fb5hN9AmQjOtvVV8Mfat5aid\nBatlmCUr5OvwdqNhd5cVCLfa2oDpoo7l5GpmT8Ud1UMOb4fcDfhKiKqZiaGr\n+tqGMMDkhPv0kDsHYTKDf+Mv8GQwz7i29fwpSKjzffUe5QHxUmV8O7jgc2+V\neJwToWm8woBG4Lwls61mTO3gcTAALull4eVUrLIMLF5f23z+YHQrjNoZaSRf\no7hi8ozHEuHyZ2Do2QzAtYXnDuyabk+EgQ0iagmgVrxbsnjD9GSKSKe9r0Fw\nk5FPhPpfWO3rtqIdCpJDOpcxi/shijQDyluDY1dS/qS0fWiJbgOxk+pC3CRn\nrCl7FDsWDIiGQ6vAPdvCnTYnEJr/6KJVvWDyQZJawMCHAqtcc/R4bjZ1Pnih\nkil9WHX/0YYnEkkVzMBY5AJjlyyCoP6h094TPqXJ7KSMIzilxWvm/wYBF2lT\n8X3bt6gxmt0TyVc/7W2yYadGPVI0CUIJ2/L11yrj7oRlONdPQv6vVETP1sa0\nWZivJUTMbZcgt7vHXnILGwplCrawl1Rm5FTq0KqkR1MHTfaCqjvf2xOhGOwo\nB9Ri444Gp5L7p/+c1Mi0ZgBVlLPGWVl6qhMpyUU3xqRWj/7TJMaQI9F4HvNm\nzNE7\r\n=hlKT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICnX/1uCij1LaIVDWR32fie27pR6Xg1iB/LUpU37ZyIkAiACu82a+ufeS/lox3SDNHk4SKQ49fm/MfET2tc4+jr4nQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.49_1597562079573_0.7773115316221366"},"_hasShrinkwrap":false},"5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0124d5688e79e7fc723ca2d0be68b25ab471b962","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-88wvEIq9wKsvaKlkwxfXKSev085TqiADsdMGBNHwgNsgcMx2har8LwPuu05WFl7gixRjUTY0WVc3PUOcfNothw==","shasum":"f7041c7371f8e94c981e215ffbff393504cbb0f8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0.tgz","fileCount":39,"unpackedSize":195612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfON0BCRA9TVsSAnZWagAAvLoP/17PeBULlXghXLUuXZxU\nTb2qUvmfp58ID4+yib4MXa9gu0eewhgB60jnVPLq+bsAAw+FpjjzBGaWFtJc\n3VNMGDqjyMD4dFdEo3luduSeprIvkqB+1JGxJVCPf89M1H7OgIJOfwQNms79\n/BVfqhJJ1zSDUTITHqxLDUQv5twJJ3YjpcjHZ45S/gyA93864zlsGqYTbNc5\nLxHo7kO1pqO+Nim4aJkP58fN46m47zemfh1vZe4V8GRVRmQw943ey9yBereK\nhY5vX9LCQ04eIOJSNe+6dSSfxh6JXJKRPIWouZz/ZEW5PDJz3NyYHugQGRJv\naMfGA0p9h57xrbPWGOzDcm73jEgxSGlq4ugU2qDCiMbhonNqtDrSARAxDARF\nteNHvqsZxlxWf+RSwd7tHzmdwSYZUaqsUzecjiz6bEtPOTTdfpyeaH1HUaZ+\n8IvlUPso2771ZPvkYH43zXg/JM1g0aeAme5HPeHTD7jxBPhFK69PmPu7E7ya\n4Vm1ZIduspLGkghqskJ4nCpQGGSCzqC3T9JvPbTWbDdXv63E0LeQBwFzXiep\nJOBJ7RaIO3Wlc81YTNpwXIKhdyKP8TCEnuReYKG/xsaH1Es5cuzuWZpMqeev\nPn9rLAm5pEGxnhacisCliQxUhCnSOCN4k2o9OXkjtxRqpEdcfAR8ovrqsleb\nk3Tw\r\n=k8B/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtKxrYGGYu6Cu6M2IKmyAIQuV2y2/Nwgt7qEgf6dovNwIgf/VPRmMbzPYUQ3nCkPS66aVBBDimXm4SUlQhvfcAWDI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0_1597562113304_0.10494645047661777"},"_hasShrinkwrap":false},"5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.0.27","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"33e439b7d104dad7e62a76ee55c5f2b15d7f231b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qXyMdvEBrxWD7FdBumxe9VHOg0jxorNCERuyKw6zirTE++1lKVghERwszOkeL2/aBf3FXmcqfOYzJ/o0fdZC9w==","shasum":"568a820059dff8d4d73842cce0e4f4ed7af2c6d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0.tgz","fileCount":39,"unpackedSize":195896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfON0PCRA9TVsSAnZWagAAOi0P/AjEW8+6fytBdUrMA+hm\nodJU8WeLsacuPB0lV7v2Axp3XwsFuYYk8i7FpqZgAMtKf5aSPWaQvzIUjNW0\ntpNE/L2fUFnJ9Znh3VqS6wUwcGbt/XO+M0QLbbPazY04ssFT3PBxBpP+3q3B\n1gvyR3zu8UGlCUkJYOXkVHKWj+GC2POpJLUSDCEUayYw2FIB4Tu9mZiIDRrN\npyA0a7RvSe+OO6j56tPhFchmFKVnWBjBt3jcXAsHf0QwdNhDT0YJ4y6WLCk1\nY/skFe8LhJvhy525d0wYFQWmwIumM3XTjOpd/K3zb6piSptdpBG9KWSWxlfM\noa2nJJqjY9Jo3b1n3856mkstH0mDz32FrHHunGDqyZ694ffeUj0FmA/6d8Al\nV6QVik/ENe1H1ypZ9hNnhqDqt9u7/2TEhLx2nk4iPcyOjRgP2wPhSXXJqS3C\njI3n2pv6JozwBUHpjcumCUxIRUtYq75n95/S+9oCEwSMRTlEj+9E7kZZQOmM\nze5WyQLgtcxINTd7X2dQ25laJa14hWrNtutASztbMy6QXgFZB+QWq1Jv7Dpg\nDgKksNPyRXDAPaGrNjMtdzUcy/oMk9We/KgyVWyfSsOzF2X5irOMhR+LwzS8\nYfQNQDk+2CxNWPpEpQ3OMbmSrmtCs2WaVWSWGaW6NM3DGEaAQ2etUx7qOQUB\noAJt\r\n=vOvS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChvPu0NikCNb7q/bn4d2j9U9IGzpV5Dx5Po288C6SYVgIgA621/SWmH8iDkYc/iygwnxea8V/ZTqsNmZhd5vEkw7Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0_1597562127185_0.806986805264144"},"_hasShrinkwrap":false},"5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0","gitHead":"024f6de93168baec29c9fbbaaca5e72572ffa269","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sYsSuECxQh6oi35WyC/5rUr3w4jjlxIHMLT/rhT8nHVaCV17xJ/nfMMAM/lZ9WGHTCGkM69JjYRFxiXoxenkXw==","shasum":"f8faa89a706525041ca3a313be9cd6cdb30799d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0.tgz","fileCount":39,"unpackedSize":195895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyoBCRA9TVsSAnZWagAA9bgP/Aso3WISlsKkr+l8oYRE\nl5crVHN6ugvSsL2qRdginIef8OdR5p40clbUoTwqwYbrCT0lHCQ1wTVLZ097\nQiCaMuVf6ap/IeN/Kgs/hRuqI73QIOYQNbbGk0jwNZdTAdzliMi/LOtjg5nj\n12zhPpxMIVFbe6WzODLYbciPfSdCh4bLKYHZE+gGo2nrmXvjVkbxFGjW2Joe\nERFUvTvikDqdL+apQS+VQrarxXHsRJpKfG2UCcljFjPZy8ILtUJpG5EHJMv9\nCtzVFFsgxj0w7BmFCPaHoOGYiH2NbvM9jsKPe78SdXeTHCyC5vY3pJgtc501\nU8J9F1EZ5ZODlUP/SxWi0hvJYy+EWs2u7FZ58DXLam5l4/n8xvBrtVXm4XD7\nJYuF7NhiTUsKI/Hl+qNWoWty3l+PET6jLggNKEkIs8c1JEJnCNPfFe36aSdR\nJymDN9swLsvU/QWqDPrj782eReK/jFM+NhEZswfk0sdtRjfUV2yNA/hoaMXS\nH6KmfniyP16Wf96V609/zy07EgXM18D4M+Eq38N3atIiKBUAydXDNRpPxjA9\nDvb/RQi2YQBK1zXdFo4gsFSvuYA1uO5TkyhXB/m3M479UQo5BuKveFPAszYr\nKiuMcO+bCyCefGKmxhlfuo0wd2zL0CNHIzrYAGsgrBwX+Acz7+hVidsoBNF+\n8SRE\r\n=9ev9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjvkBAU1XeniyM7GUYzRSZjf+P+XBrhaQ/pLY5YCqNLQIhALzROM00oD3Y0WNA/jZPIW5n2Auten/SEWYHv/3PRnAp"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0_1597712897349_0.6356813107504979"},"_hasShrinkwrap":false},"5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aba09486d83411cd1ae4ec110dffc1f7a468863b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Cx421yK9PgyYRXMNSivWDgqeuGA6d2chc6oacQjxyFY82vkIodm9kQlbVBlpj/RWBaxmPbqAD0rkRhq03okmEg==","shasum":"3eb9f187372049b942c1577c8cf606b932b994ed","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0.tgz","fileCount":39,"unpackedSize":195895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyp8CRA9TVsSAnZWagAAHhYP/iFOVnxjcRE+AtvnF/du\n80HpOoyW/ozAjVFx3PslLjn5/p/ywzw3xpMSL004ncEBqxO04W0fwilkFfR7\nlS2b81vRbVIszArH3FrHM/UBbhuP92x0I7q0M1/4mLWZpMD5EHPO2tpPEMH6\n1fkck9RmKOCf3NxAJ8GRaeaeIbm3d+QR/RMIWNpbK1TBiAYxDyB/Q8BZ6yaZ\n6XBOVrPbLGxgdIa3o/I2JtAlXSvu7sXUuvpAMENPue9OwaMRtGvDB/lH3QB/\nrvZkbiQj3zXp9DUrM5C3DZprWsaoSk5Rians2MogzvsPz+5Az8IzCdwBI70D\nh9LTBnzwFAelNn2hLj0OC5zGKocHk6uC/+QSQ00jNVWjgZV0l+jHzh810nJn\ng0e2Zd3Dyf2iy1uG0jRFOSwkd8V6t5THVSIeXaECtWDOT2i9hUyDnOBPy4xe\n0Q8shGEa1ASlDmspBTlJzDCSvHhBbjKfoBcE0gLvpBoW5uLcr9q6HUe9L77d\nBQYi/XxfgoqRSOD4oiW5SOogvypNnJ3dkcBsE443krEbj0HI1Wn9Xd14BQ/w\nRMLP2WQ1vmDTbw4EJDa3QyVTEpVsCV6C0W3n1JXFdAiyGZtNsDHvH0gqNLZ+\nXITVoswXgp8N5opvA6fIJuuG7D16QlDEmGiRrBLPlYNGIDUdEd+fQ0mSXTqs\neOeK\r\n=WYZY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqEld1BcnDS/ywOV1nacu7ozw1g6O9QRuUMtHogcjMPQIhAO1rUi2o4Umn5mn5De7GX2EtuC6IxbvWgba8CHZYj+Gs"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0_1597713020364_0.20896353877338347"},"_hasShrinkwrap":false},"5.0.50":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.50","gitHead":"41a15590361d72f4f0661f46e0311fd3710bd626","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.50","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Rf3CQUuZRcIzqAKWy2gsVq6OyP81p0mgIM6Rccpu0YLq7nDy1Ji11vdDlaaV8YR0JG6zBQItbi7ljvpOFy5zNQ==","shasum":"8690dd8295cdb5c4ddd7ee8c3c1fc3a1d6ce90b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.50.tgz","fileCount":39,"unpackedSize":196135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyqSCRA9TVsSAnZWagAAQH8P/js//jorrJa/AaAF9Npm\naLhbEVIB7XQ4fgYd+WqzUBuNDFdQh01UL0FSlZThsj0syZ+Mdl3sbPy3oxdg\nGnM8tv9G+wno3s5bnLFNmPDCq59h/dK0MMmLfq1P+GLwZqQ6OgwBg7PSO3Ze\nE6aszKYJMWU/tEEKaY+m5Do4TWpbcea/ILxd9ldqHFN1tVxPPsyI9C5DO1Kw\nrKWXWfUYImzjIkJCQElcqc0d735WHaDzRlyI9RW7ar/SwrFJJNruOencA8Nu\nBCPOe1yS/N1xEj/1rZ+bc7f778nlHyJ+uRQ2Yf6J8QE6rUK8KUQ2CYv4MXwE\nKt3t5VNRMTIid3UT50MMXDSYHqnbizyzZDJCZXzgH9kJLRkDBAlTvL8BG0zt\nZvFekqaLV6QVraBUPHrV1BHVL3tm6lc9Ge/3l/LJQBchgnVsWUoT7EH/jr2v\nczXnNi2T/5GId0o/RYTW8SQHrQuAXR4qoAGKNjrPzyK32LuH1BTXJNm5BLD1\nlXe9/iLrt8R4rxeTtC8plfAIDQOUxgH6MmnFEU8hq+npSeULZJNqaUUxBrqI\nkNi23lXbnnNKSiG8diTJlSVul2Of8kuiAo3AYCD0/UcIMRvkkmtH41zYXx9Y\njZXpn0gbItsdcHKFFVNgmh2b9V1k5KFTo0x59Xz8pAQh6VZpEZb1LfVdGz5O\nGNp7\r\n=q7Fv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnnjEA81uNmjc2pKxsvbJhUjyAbKc2X2Ty2S4xjxkNMgIgZWjEUS5vmGtDDP9yO2W83p/rwfR6C3Y4RVFn1VfsVHY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.50_1597713041551_0.6660254662079248"},"_hasShrinkwrap":false},"5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.1.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"41a15590361d72f4f0661f46e0311fd3710bd626","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+/48ubP/BaTxvrm7WnA/uC9el6FjPJLQnSfBiL4Ohx6QkmzuFoqmgZgZNsMJan979hK0+jMgDJebF8JblAZiyQ==","shasum":"0518aaa2b03046d6df6e572fff5d1a95192e8547","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0.tgz","fileCount":39,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyroCRA9TVsSAnZWagAApmYP/0ouec4dECjMwLNxIEiP\nchDAAkgDb7KEOt88N1sfIr7AoV7vO4FLbsK9taKlUh9FSOh1ZOfYeFmMXUht\n4Ju/9LgMjZd2V1I8UdJMqa38P3SMSjOY9RRPdUU1g/FQi6ociUyLq3DDf4tU\nvB19RxNxth1xLrCPctOHCCB4ccXwx/ifQgWLXW+pqELW2IuI+t/gDh2j2VuU\nbKlVouO7QKudhnKdnVjLYumyVap0owVjjScNg/qUfdMWXx8RXLjdXSHoS55N\nBvaWDnfIofBadwlMrwi6G8eh+BqqYQJPout3ZxAA0za8K7mcU8AhY8dMbw93\nVT7iQhHYop452qnWiLj1+s01AwbPUEIhjTi49vCyCHmc6KjPkxEDoNavGeqI\n/EBT88QaVaL9EXFPqG4jeanlJL44o/wH7k1raXOFyhwkuk682QvPl+wQENzA\nGavT1D44mD93TwuW/fMYnlgPaSS3hmrRkuogSzBvA75i/9K7LMyGTAHLhEdk\nGRlrfzHhhqcAg8RL0bFy94JxTuhIXnemzxKBlZhlh0WrU1khuxqzdd0uy8YZ\nfuSQtURSSmTrELEd5JfqMR3KSEufo4HU2N3GuwIHEpxTIYZIJb2+16LXsyLe\nCO/O6HomLtYsue14MhLs3UzJ+kJq12heSTBuTXCnXnsFDmDzhTgGrmrcNnmU\n9QWw\r\n=SHdf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjWi1/zAEFN6ZjdEoUdIJnhCRNfRxLReLqOw3TfJw+ZAIhAN70ZBAhlU1S7Qbeh7tEzcI393lZNFKkI1Hd28QYVU+p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0_1597713127934_0.49190571236118674"},"_hasShrinkwrap":false},"5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0","gitHead":"26fc3197ea8e30f27c2c0397cb100d7584667430","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0UU5XZCmUBNBQDDMiByqxiiX+1XAarwL7ELkkWq8kGEWu5nvSjEp4kU7nBgoE88SPLaUmElIqxomtEbBAPBGdQ==","shasum":"050652ead1426458d09f386ccdfb10cdaa0f8540","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0.tgz","fileCount":39,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+UvCRA9TVsSAnZWagAADEcP/0gNznLA552jrDByHoMK\nHMxLAp5AtNnikFOJiiVYBg2h9xf9BFEcjWkEnBCtf+kPmiHRRmsPFM4pSz5w\naoQaF5QrKJyT6zfg5YJxI4FhY/w61BIn1cvwhm53RKJPt0DookZedie/mkKr\nM1lHRTV3qXhcOJRKZdYTCr6VFBGcM5RcR5KhG1zVvw0DfKnxHVFy4Pja52gi\nYD9ArZP4Wc6QI8TcNMsiJQizRTF5NziLIrynkrS6+Ii7lrXR5xJV98cJ3G64\nxMxCYJpbliwHuhCTi6IuLtBlnr3GDA9BrXyHfOG+ocUbEctV6nOMakPLXnD1\nus/dO6wVbiaT0j77+pCHaxGrfvPjpHXy8n7iTuKFOfbG1qPTjxSeFUy98/q5\n2WUb882CWeHTQZ/gsYjUn+CbeMsng2AURRHYRBPt9tS0gCYPMk7d7UKg/UO/\nWX7uAL72HWmD3f7m3YuVp4jq1X7+lQIkR1MHIudPFntEV34co7IILkTcnShf\nrsb08LXU4Bv3wGVD6kK5TNDSonBa+2hq+H3psTq/PkBwz27AJ/ciVKkqo0Db\nOYJC7kGYhIK8SG74WOLr7FQKU9zWYoonBGEo/WXZZrqpKfh3360PomnoP820\nYFLGIf1RP84PfSA69hUulZh638ghmo9V3d6kNe3/hEMXDamIrcDSjAnqPUYM\nf6yd\r\n=w1mk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+dII6xnAysRrZPXwuHf+SX+BxB5Tv9MZzza1YzCRd5AiA5JDJrWCpfBi7p5/Vb3d7qBrFsORK0G2W1wddcLNkmvQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0_1598022958984_0.42567947171242104"},"_hasShrinkwrap":false},"5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.0","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"19550f255998150bd7cb1fb28415d19cc7c28b81","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3zletrGzYwWq4MYY38N4P9PBsclD1T/bJgXsRNxNbr3DkTXZgYi8t0aNckaCIWp/t5Y9FobUjdMfxaTC17e9Sg==","shasum":"2d72557fd2adf9c8f4b9d109ea355276f0cf436f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0.tgz","fileCount":39,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+WDCRA9TVsSAnZWagAADgAP/1bJt0rkkl31zJoVuOK1\nWREMdxvE45TJYR0rUdHs22fxmQh8Vvp329h7j7Rn32p2Zw+oe3WDne02aZcE\nmkn6GQ0TU1+61Hao9KqIRGwzqZ1NjNoplsGT1VsoP02+YYMxWaCRDaa12S/q\ntz8NNknVJ93LhCBsP5o3gxwlMEFqPaMq0qNHJCrVQDZsdA0vmT+iDuUrZ6Oh\nULvk8KqQil81bQP6O75q5ih8B2veV1fXi/Q4jybL6j/9THAhei8e3RGG/DQr\nopXrSrMKJMKwSr7IihRP2Lcg2UlmFBULtChpxuEwnvDcTaMRuZvb/FdXUR5w\nPS6a+B69C/DYiPz58G5OcDYM46ItnWd5AbCGQ7XBw1XD4UMlR8p6ll223D2T\nUWK4XCtgX3WHGK1KAh9lmKqVvf4d+7GDzOoKnQdUfYgfXOEuLk8EDo4/0Hao\nkBHZFC9VqNp50CdGJ9mE6AAVKcK7RUlKOb8xDl8g4GaXiurewp09yPYbKI5R\n/nnmf8k+Tw6hx+Dfqb0auRnoqWf1wYK1V0rDi4u2R56EysJSff8+wMKCGfmE\nG3WEVoZcrgK6oAw4SCpc9+rr8SV4Z7s1M+Qtxauh0MPHBvQPAzl5ZB2Vy9NT\ncRH4avul9IyNWbk8ShsmcIuiK1qnJn4rrpSZpQym6S+iBm7hF578rysjW5Y5\nnoN7\r\n=72cU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXSvjzqD7Aj18W0rqTxLWWDr+VLb1NeR+qQYzlMjgw3AiEAyGm+UtyGGiq9cWVMLlAYW7FIh6DbFYCAHnzrYgHQXhg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0_1598023042844_0.6922458374410512"},"_hasShrinkwrap":false},"5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0","gitHead":"dbc16e56fb9a47fb35038bb2167bd809d27efefc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-n4kQAJN7lLzyiggR8TsMlhlQF4AOQ2cL/oeVoehuoOrQZY8JtXxqq+GE5VovdLGfbH16u1N40K/zPKKgXp9MiQ==","shasum":"df33331c4cc8fbfeff18c7f798734265a8edb380","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0.tgz","fileCount":39,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+WXCRA9TVsSAnZWagAAwvkP/iIrA9tGBvPVQ4MWXCbS\nDkhREWDJ80qE+nZbTVogbansWGX4VpxJ+6nCqOJaAta+nrXWYgTzejzeUF7D\n7cTpyY3Xpmz2fJvVQ2NyFP4NROxcfhvKcvXwxJls6TY2s+6tq1L+NFCIFwoE\nrKKvz6hPljSy6Q+a5LAaGOdF9WvTY0CI87STy2ZLdcuFh0RYCIl5yZ0dwiaF\nMWGWd8oD3FND1DiiJBlmVPrjsMdgE1S7KONURCAw3CxyAReRszeFnBvvJMAC\nOT969yKaJIuIVf6/uMGAt/l61hI4htxm/KDQ/e2JV4F8d7X2KbHadOl26UtT\ny7gKKx6qcgRHlZWgbYZ5wfr4hMw81xdlH7NMWVWJUup58WmLbj4I8pZu7gHu\nSWGINNGx0HWigQXH+JkI1BTT24/bCtrLNAFtj/zWa70wRZOZzVHQ6PizRYIJ\n7g8U5TAw5l/KP6EziO9Yi4btrB/6TnjbrkjJnMuE0IuTQzwjIQ9WfQTodxWl\nAdlMtHqUAvh+P3HzbQEhd6y4/GTvK8FDPPxmjGgfWLIZ/GWKlrslf773u1bu\npKG3qaFzw4OSoJX4332UqlxhFHHF3A0B9K61Na46cjQ1++cucizAz2/V90Tb\nFB08gYd8sMKK6Q7/BHuRb5UqGgzN6mlFwLZziWwd41yW49iz9vC5Hre9meSx\nEtgr\r\n=NKcg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJbD7et05azT+SFvWh0LZWIcNGS+W7HeRpAFdi0FVOAgIhAMWadY7Dfgbcg71M+xtYavo+IBEXvby8UlkrVjd/y4vO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0_1598023063156_0.6239838820723513"},"_hasShrinkwrap":false},"5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"677344b2a773fe46568e8d6319a99ea5d1e9992d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-n0ylLnVpKMkB//Ei5U3eEyBV6UkuYuqDo2oxsJY4CHZZ1M40bgHoRw7hsu5vFezYb+dT/oFe+00dXeKWeXkdPw==","shasum":"9c348f3133d5dd079666132cb97444d5b0756772","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0.tgz","fileCount":39,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+XmCRA9TVsSAnZWagAAE2AP/03yu69e8+8OyNubv8/Y\n8zbhX8DR0/YfRuBcQ1nd16u2Gvk2pukEp97Ks+QuZpI2fe8j7DsoR48/Hpfi\nHIKJO89X6ckvh/rRBP7Pu/Q2S89gxvVCQuV5EajPwZk+k8FZc7OghxtZfT/B\n4SdfjgZJ3M8VypLg/wz+piAaDlJQU/L7Bfm2/eb68VUVRi1Rk9qIlwEcmFWn\n3JNRNy4cg6rLH0yrdRAM2qD8o/Jc8LoTuAvT8ueja6DCu8GrdI5ibU5oL5uJ\nUuG3JZQnSLMhW5LoarLP846eBHUgwpvX3YFDxAhCNMZ5XAcXXVTrV2j8ayM0\n7EW2ovYW5F95IwjpSxiuiAaSj6mPcFeFFP8J4u6pY6kxrncJ4q4cFSKvSuab\nccBfqNIeri2oBxjs+u0kPj6e4cjvFwko4oCL7GVdr/ibXJrG3YnK6FdkJtKX\nWXFcY8uoGSqgdwwadfuAy8dW1j4QYhutWlhA9kPf3OWMjL1sos4wxSdqn6m9\nuD3OEgaZnR1uAZz0dQ9y2jywPO/fQWzXQMsmv1poxArClKn1Lln9wj2N8i+J\nWJb/GUz7hR0r6dznosiov1xcL2Ba7Twlrh9LsUX2ZulqJNKFaCqpZdPWVsPA\nyQyoMUA5fauJzH6jktpg0ScdwN2PJ+LUhVu15eFq2dZch5w4IjsreQaQMqGg\nBKXh\r\n=eCWM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu5w63TgcOVmrxPV7XJrj20L9YHw0ShF0jWYty1jAenwIhAIjZPoq6xpQ/152IYOYwLEUc+sDrwreB/m/ZUsB+fDa5"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0_1598023141863_0.9054358576777015"},"_hasShrinkwrap":false},"5.0.51":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.51","gitHead":"62fdc086641007da6af45b24a86c91fd0c2dc776","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.51","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ck5BjyQHrYUm9TvSBkfqR5mJ6b37yjj0FamzYW+y5dXpJUcdqGsWwvjvLl/R0Nl0dV5hIKHdmnWJg97pHtXiMg==","shasum":"084538475c8e9d15149cfc4ac74d918e9d4d190e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.51.tgz","fileCount":39,"unpackedSize":196574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+YACRA9TVsSAnZWagAApyUP/it3jcuRx5Wg/EZjigsC\n7gYtLYvs5d/AUJmxKnTVX1y9KAWOHLyUffiV5MvtJ1f/FGCz7Aa3jn0NZcgd\ncCmuNEpx0pbufya2bmpLVO+Aqt7jA9OD7he1YJ7xYbpovMyJKjqQYeFtnh5t\nAB3eU9J3JDIHTsVrzQiRSv5GmK6vbjXqi3DuYiODtHML5UlRmhGEtRZdmeMT\nOp+xgJmmeeb+R6kUEPAtfB+xGhcpUNPcGPMCs0gz4HTmF3aIE993qQE18MLn\nT6mJRI/IH0IQ1gzSQFXAX5QJo4cf3K0PrjiMD/G3iTIUR+u0bpPnc7JlF/vN\nvhvULPJ20lYPpnrTzBdoSTX4z0bWVwBoRjBKe38oTkvYs93FVot0WreMQh6U\nTGx+DNXlvahk1quWAsLUR0CZ09DTStMzUgqlcO8r8cFWqgjuqnQh3s2r8w9L\nNF/7ERSvSKyrJVRelBq9fGmqmdWGaq/0zEu2htj1M/OD9HbFfXV1SMelhKKw\nkV5ZMHLG7Fg7GdVp/juXbxmk+io47fZSvgAvhp1zNdHrnRfn2NNzBFleceG3\npO1Lb/q3h6K8AE17i3l5jvnx1l4FX9QZJXrZojz5DCunVo4W2mQRpgTIM/MA\n/F4F8uGvqI6c7XT+L/HTeuWWNRS1/kY3tqf3GwCvQyOQDkACnvKe39O1kDu/\nyviz\r\n=Cekr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVFsCpL+q+N9YeRoF4Xrr/A9yi3STpGN8Jt2QKmR8y1gIgVkYo8sb1TIkdvuO3Qk9Xx4XfOmJiBDIdMhqTbDc51h4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.51_1598023168351_0.7694386290267825"},"_hasShrinkwrap":false},"5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.2","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"62fdc086641007da6af45b24a86c91fd0c2dc776","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PSdgOHkkUxaprg/TSL/FDTFV2pg/nIiH4ydGZbAJQ9ur1Dcy2xFAYLBaMAGi/Y/W8X5Fn2+c9jh6bSmW0FG9Xw==","shasum":"daca8f2be31085d54f16a20c9793bd01757dec9b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0.tgz","fileCount":39,"unpackedSize":196617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+YjCRA9TVsSAnZWagAAYfAP/ixzAHlgpoA77QYDUTwp\nr97hB+A3+P8sYP+tR31p+Bek2eBLlFPWJ+rZ8U0Kx6gSGzyZOpmTGNI1vkPi\nbjThxO8PnXoRTRrSwrxPdVGpcHnCp3T5jYlEn/v2tEpvjhv3cF2Fa8gMPhvr\nnnd7FOljq7XfMJaZHzXpkaMJ+OhWSrtwk9OQAxnMYxlQknc+35LHagOV0zKf\nOBXigwAmqmN1NCH9ukwnDridh760hhCeaQKLxdl5fqfNiCRNAzTIY6+rtvw5\noFTuBRLgVOZgNhUYZ6/gCN2ZKAcejlXMJqurd9RvIM+HL1YusRkq/Z3hlnwH\nGJUekw/1lB6ClA1xVlVzLZScCI1hlds+OlBstWfh1zcgJ4Fvj+ybAv4Lwf2Q\nH4EE4eDrTBc68rjpYGi2+obz64lsT5S2tU9rCBU61UFS+OFmGqCgeKNPkDNQ\nldH/QboLBFtk8CXuxhChvSvjxsCXaNrzEB6saPfVmT96NtFrecxTsBvyA2v9\nwidDxXnbt2c7CPr/TG03L6JJnO6gUUVFpRXrqKqzq+ds7LD+BwUSeFAWKfjS\nzk40vebmBNxUQ0Oy8lgvG9MRKktp4o9UvkCuE1UTQut6CAnfk6YA30sEi9cp\nE8mDtZSlFrTx1ED7G0pc/c++rdkFcEBDtDUYuv6qC2Z00AZlKmARYdQgl9dM\nG3S2\r\n=zr7k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDesS+cpkmaLvYDVavHjPrHYmA1oTc0mZ3DAXu6pmMASAIhAIitxpq9F7QNtbaSKZ1zN9Jt12fxZvjrOm0ITZqFmPNZ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0_1598023203180_0.7516874321697429"},"_hasShrinkwrap":false},"5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0","gitHead":"a5db4b42a0707a21550c94d4d855cc3a51ea99cd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZIQT5Hgjo47Zim3Amnk3EFb3Loo2PlZJjWp6gy74B3HqczsGUX1zPDckC36jnNMp7mdWLXKTqrK1b66v27J5gw==","shasum":"1bdad6e72e248ed71b581ee596931485f7144861","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0.tgz","fileCount":39,"unpackedSize":196617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJnYCRA9TVsSAnZWagAAJXQQAIOTP5qVG6u7Psiq+Xpr\nc/iPfiMtJfHf+2q2+b6/x7aSrQ4l2Y8n++eEI02/nuwatyp6iTHJDbwDBRpU\n7VsuM6ScIt1VBFX9gIzB6/Inz11F7cCb624NxF62RddgbCifMpOncE+oJbpG\nCPRnAd2FPL316zMyg+3szm+4VmTSeGhY9TgaBNDTwnFmrlt9D2YlqMVAwXZY\n7E8WEaHOWWUKAHzioJzIeRLv7Jf6ShztlI6LVp9Eb0YVjk/FnMlpMSXthZVa\nH8pjY1OABcyQUWd6cUxXp6Gd/ND7EGaOKigxjlUTlZ1xO2OXigTOIVECuICB\nC0tftGmIRi81GKXbz7Us7bkyXXoz5xrt6w9DR0xQLaUuKiDANM2yvDCakUXU\n7IGlTwT/6oK2ubv0TePfuOVhtS8qTJ+8KtC0O5Dent1X+mgTBaNosu02ike9\ngllaJA9SILJiJYyNR8TigNVzVbnZnAIv2DI/O08h1gQCzUwj0VVLNopmUvGD\n/+Ofqa14yHI35CPZf4nhMqCDroit4BiQkjFsSO5HOa+ZSyILWaOutKX5gR/G\nA+Oe13elPa9e0+oBIIjpJ8shQnnG+fKMg0oNGPz7FTaQ/ZiqfFdAYGmD3qKI\n+IkDpn04Yy2pGkciRyjCQ2R7KQLPaTJgVUDJLlL9h1L/jy5Km8+eSKWUecUL\n//6q\r\n=4W8p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwpdZQFMjbn1xYWRsVUbMk1kd5BjFHwWPXf/ReV2wLtAiEA9MG4KzEhNe4gZGl8Qudoz3W2QQtPOOmlqcqNI70bmIc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0_1598069207530_0.01480609862067328"},"_hasShrinkwrap":false},"5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b9dc429c89b64678df7e052d4b2f525440f92752","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z7/5B2gWrdek3W0eST2mrDTwXv5oWlev+wIApChCP8sY80Lmic5P7N+ElTJ6vIKOfhD2ZYiMHX8kE3uUklqnOA==","shasum":"97b8c0a94c5185e5afbf6a867cf9d8b4396cd9ff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0.tgz","fileCount":39,"unpackedSize":196617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJomCRA9TVsSAnZWagAAC70P/j3pTu/Uw55ZjG4CrYyo\nE6rz55MvxCMXRxilTL5oJ/3L/7TPAj9memrjXclHyiNshmRcjcqJ2oWTGshK\nsLNgh3uyO3ENnegNNIU/0qrS33vCmy3QeW5rJwAYDGXHUyjOpPap2fgnpR9s\nIZHh/u+9O2AQBTqY1QlpbTyP8bD6SeZVeVZSZrd7gRQGCxTwWlkqZucRI8dM\niVLH22Qpdqa8Y2w1Pa1YZdy5YutQh9Nfu47nJU0GTcsKU0ZPQvWxHh29YB7v\nwTvyCDum0e21GJLGyWGNg60BFBRCB1a0q/sYYDS6WO4Jcr7P1DTUuJCW9mif\nkVop2iYf26ez8TyY9SWTkwyK/MKr/lirALoI6LNyjiRKSZ4j279Qq9XEm+bA\nul6Pa05VjlhL2bdyeXGUvJRM3sHyP+MNu8Jcni0TG1DsaizXGPpBkW0bMQV2\nPC479XVIXNukewdQOJMwQLK5x20pxKiXUqkN5ueVdJb3Lr3jfywzg1AqGCCP\n3vibWVML/YTw9zT66rbSCcvcBqhEHMVIHozpiGbCqsuxUVsFqqogJ0FPRnXz\n9JAJKNKRU//MoLWP3+TwjmOUEjSc3dLvGer7zr6M2PWd8wDvte/uLnN9eYVF\nABn9SmBTjw9gC3nlZDxP9cuJ6dlXeA/HYMjMAXtUaP/iXra7JuAUbX/+PfaR\nF9Dh\r\n=3/nl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPfPMjQptHXLW3t1IHhq6UhAO7bNec/Io8FAn1oM2r2wIhAJ8Lm6z+6b4lDVR5aV6q+fqDGFImC6/crwgA1HaKXk8f"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0_1598069286239_0.6294870428264223"},"_hasShrinkwrap":false},"5.0.52":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.52","gitHead":"32df79f660de220e5f2415f6aa294a1d35148a51","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.52","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tv2y/7B/RAAzKUFG7IAdUOEPvFsksnygIoADz4AtzIOC0qPS/BWIJa44YaGdQcHdvy2vRgpo7vZqhKYTV5UFQA==","shasum":"28065a68cd80f4cc22786dd7c509ab2e1aca9f80","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.52.tgz","fileCount":39,"unpackedSize":196853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJo/CRA9TVsSAnZWagAAi50P/0PVGSjiXbdB6gEu0CdX\nO/QjP9TqZXLde5VhUhuE0WIwRc4QIV7iyc49MbDPEaIITM/CUmQBkcriZ24Z\nLwePsOXrQgeY2DOwR/wd0aK0fBaZSXZkg5FEBSU0bZ7SAabdVmNOPrzet+dX\nvJ2zXnmTGi01SdohqDFq//pkMQbzxB949yz5g2GXLnukKk90nD61bKs/Kh0M\nAH7WAuEgy3kDuMbAW9hZbK66rnpt4fKUwmo/iPt2LfPz7vTOvfNdnnwCXbid\nGzmX0QVO9bpzvelFQIT/5zwvvToaVYmEmqNL4k8AavmAUt9LQACMn/30Fndt\nu5nDb/l9eX10RPIPrN0+N5y6ie1NzFzXSztX4mrTSOsB6uSrExJ0Fbdzl0Mv\nniNFcwfXnVfi7XlV10Uf5ffynWlb30ylgq0er60abdpIX5naI+CQfcGkaZGl\nlzjdN4YbZ/SeO7pGlBm+OeMVHoaaXksokrcAMvjTsIgrcu81ews7SU+5L5dU\nfWWM8vKkz8Pnx1ycH85cf4FO/UDR9pT2l8ySoBGr+JAR9cVOyOk60W/dmwtS\n+vN3kWYLN6N/XNSD7n3IIuXPkOk/s2u6QUT0njoUcNJZzPudODuUAqyqypKr\nP5GUiiHqbxSPP5cF7+I7d8X1F/59bMmlX978K70w48vGUaDiI5G5XIBaJQgO\nnDr0\r\n=bK61\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATQ/j4SgJESCERLTWzp/JSLG9vYTJiJNVoU9ayN7+87AiAwh73Tf9NdIkpgY4mgViUf972RxaP+h70pGmx07PY9Dw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.52_1598069311169_0.667803312286124"},"_hasShrinkwrap":false},"5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"32df79f660de220e5f2415f6aa294a1d35148a51","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-itkhRaFaH9RL1uw6HtmQ+0Bs6zz+apAPoJVzp9WvFosZfe4FjGuEK+uitGYj8Gzn0Ooqd9EdFSFSHNr6AgmJbA==","shasum":"38f04bc372012857de87f6c59378abe3f6a41df7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0.tgz","fileCount":39,"unpackedSize":196896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJrkCRA9TVsSAnZWagAAfUIP/jGt2Cw4S+rONAxZhPVc\nZp1fHE0nCLjIGYCPEU1OLBpbig8FJkNr8DteGxXQJhn42yb5Uooa1vByuz6l\njVpA3lhAYgB4yht/UoGh0WDU9HamItVo+tUN1mRDbEBEqN+DzPr9WutOviit\nRaj70KcLEb+lunMgIs7Aw4Jbsx0n2wHmgSlkhhhje5WlC/EDZwfp4BKrVtaI\nOaSp1qgKTZX0t0pHsEgkUnaka/kLvjkLTsfZupvulK6tUATJoZfhxydPEa7d\nvsow10DR/Ago8lOW/1/XWdyEhxKXcM21E59Zl2Zlp0g4ymMPt2Xm7AyO6oBC\n4UY+GmGzpZkk6g6Q7BaqxiUEBGWXMcHbVGUMReeq2Se+w9n54oqHqX9ENxvj\nwUATKWreceZsBnNEJ6AQziWcSM1P1BkCvEEOf1G26ONF6i6DNmsp/2wz3gD1\nqnqvm5ZGjatfVHZmBc9kFI094NfBJtFjFtR5/Evp07Jt8uGcHcxyeF+PrUUh\npr40ts55PSuqj84u9KtNKWbZ0DbqaVmwLGfWk0Qx5t7zGCa4LdkRh4DT6zuA\nEWpQDR2A5g0ltujtHZyxt/jg1BdHfB0bep05M6/LwbbJChuDI1WUz3dRClW0\nQPeGhmtyqSE6+xPxLiNNzs1uvnlU2vrserIKuYwNgA6A3w4wcCte/NZ0NHG2\nZKTI\r\n=q7wl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFnNFpbr+EN75ItheQzqmON9uYKDmk/CKd1eEC8dHFJQIhAK7v3g69JA8KGKI1jx4SpnrjsUfMRu0oFq+Qw7slnQQM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0_1598069476233_0.22472862241717917"},"_hasShrinkwrap":false},"5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0","gitHead":"29a761c1bceb8a17133fb408c65b3b52dbf6270c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lGRWPf8t9kC7p6pIDjM9d/Q7nbDVr2/vMkYdLT2Y2JmWY4MILakTATkMwyzpLFsJzONnFOmNBiQBsVkB/OjvnA==","shasum":"10c81415ec824984d001b07d22c4d5e190a6d169","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0.tgz","fileCount":39,"unpackedSize":196895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJveCRA9TVsSAnZWagAA+pkP/31hJQuDsQMY00EFkYWv\nXObRUo9v4pR4v17VkrAxnI1nUexv/WbqRJebJEviBzosCX548N3wI0Ogb0LD\nJGzGNYB116ZEMgmRMsC8bfJHjdvc2K62rQNsELwtJbuCPq4Dgs/owIyPVKV6\nnP63a6oo+gciZYYD184DGBaf3A/Ba7SvK2qRiHv3IWlUl8SviHmRx/+hjiFe\n/F1GqL8p43PX4aAP6ClsAS59vN33T+qeKE+1WRqUYQez3jbr8940SkNZLt9x\nkjXEVHtH2YTky+Ht9XSVqhkXwhwtzIi3XjN3Gpgy8k4VELvGQIqJshtWn2Mh\nPVc/gN/VJlJrqTNj4rCHd2gQK7O3Axx8rId8tA7YlBmzPocCwfoAphw1EoBa\nN1STzhuQp07/xhJI/72IiCUn6aIK8SYq7r0ojkcM1MYjoF98uPYTWMWbZoc3\nGPkS0w8JbrBi6hhKvXjNW7y7Zjr8Tq4xO62DqbW3AQm30/SGteaiU86U+J+M\n8R9aggTpr+a/hdIY8AuwEHntx+az58v2RSB1gAn5t4WTyxLzvwXmRWzEaEsX\nafYKZtu7T9rygUgT8shhW7QunJ8rYTdO6odxJ3RAqcNyHOENFzT4JOTnyp0o\na+ckQv8V0TuxNegDQA6xsETM6JGXriLkciP5APANzN5Vf0jkL+q9LEQkKCDF\nOGmq\r\n=FQzT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXKPRayHaHZaXYSfd9y88fkK+S2AimsrS8hIFMU5tXNAiAPpEf52NzFo/u0l2mFr7x8Z6/60Tpq5Y2j1cUUkvOAEw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0_1598069725709_0.5164165937185639"},"_hasShrinkwrap":false},"5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"16c3076431aba17a5a9a4ddcb8c812458fe6a216","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Nqq6bFsWdfd/dYnHjNbhzMj0zuyi0Vdd7ePH4x5lHX6T2JZAQpTGbaS49HgyOBPCD/eWAY3V/FSnYXNXhTF8Pw==","shasum":"6911e86510a7d2bc20d5bdf1f7a4c5b5105d2e58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0.tgz","fileCount":39,"unpackedSize":196895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJwWCRA9TVsSAnZWagAAC94QAIin65YDGqEv2ggA+I6R\nlynU3raMVar85TyzjFRcd/XzgqJBuqdpbyFlYFXdkwXSukM+l46Gj0kk0mBt\ngROTskblzpSzHHSBu9yP/JPY87DNNxbx4tZDpc3SVetfhe2UDVuS4M7G96gC\n/izrSJJrQAGrnzAG9ZJkPoUSlQ7QbXSES/DC3CbVXrCg1Gjp/dSEukTAN/Yb\nI+g8foN583/1y91XUGh4ilzCNWBtvrftctB+S6XRGok5Hg9f1kye8PwbE6ni\n7EKhYuLn58pe0AvyiVuKd95ZaV4ZZv4Y8ncCs1NrhDFzFFnR6jdVS8k/EZK4\nbBgBQskuENHtQNOT3wgiUePfVN6643pLMe6LxL+Z1IFSQyX6Pa18T/PAs/39\nUwHfkRSUakz+Kc+3jKnBCvE5ryDRAaXhkzKssiV/OGsh7el7ucvWiXkEYL+M\nt30oOlhCM+ddg33bBB9zHsi5pQcsDumihA3P9at7voTyK+cmvNAs+XQ4GuCK\nEci7X3mbqLhgZv35IHSbfmzgejFcts0lk0zJak0M4a0x+eoliqkLwUdACR4D\nwrErNjVSkqYsAar4RbQk/MClNeunfkRxYANmcn7UwOVA8sXXYylx82NpBbCi\nDkQ6CqqTVPuwuBSDRKxlVSDPwPrYoQI9S3M5I/fzNwVml/mNBBUv58bUfa/K\nHeiZ\r\n=E6R7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGImxkS9psTStmXMn55fYZpkEwq0CPBfn0LkaM+gkWsnAiBQw8UQpPUsGeCNoDoiQQRpC8rGKdLfdIQAoEsCSNiQUg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0_1598069781751_0.6177528499805354"},"_hasShrinkwrap":false},"5.0.53":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.53","gitHead":"cddc6ca62e879aa605658c7b151d044cdf2475a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.53","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-mVAe60TDTAXHMtt2GSUYS/1RDWeqwttQrQqyJSL8DsWp/rZgxIozBP3laFJEBu4jqXuqxHkhBWvK/iogkPXjvw==","shasum":"59f811b3602925824ea58cf42c2033933e597c5e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.53.tgz","fileCount":39,"unpackedSize":197129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJwtCRA9TVsSAnZWagAA1uUP/2Y0ljFJ1HWg+uGZ84CI\nwhHbdUPPoJ5PIoa29cxMvTSEbjykPu77gc/XcyHX1E2qZy/CpeCgWnhfWC+L\nlgccqu7EdmikFJ2oX8P+t5dyUMmTZE5AI7jvkH/FYnF84pQjV9XBkP/az1nV\n1IGQAQMraEY6NhpWUAzlh/33pAmYjS7tZhvb8J87aeA5HCRSzOT5LlvtpVb7\ntg6xSSDJfG0muj6fnLM0UoZ9PP0QlOwMAnE5h6dwbGRjvW2ftFXd4RW2Vhqm\neSGa9fau4iWN1sJCkmxuLeFjpz7BpN8nNuXdaJN84JeKe2DEsi6LKQ3H0Pwo\n8LRH7LDrWviO8C5GZF4WuhUVpzIu/RLCPR57GikblbA3qGMFnoZoGJqk59L8\nTZR+Bl8Kh/sZWOrKNosL41RDD4nUExiz9OtFnHcOl8bWnJcmEXUu1LA+AFsg\n7n/nKxkyGB5Dt5a0LTtyUsTeGATYp9qyeztGhfrz3e9esaBajLUqfvxIJ/Vv\npBeWhu4lSCkvUJZg1uiSEbyVCiZccU5XHK/zzGs/YpHqtas1VyaPNMIUiLfA\n/l8czkZvkqbBu+6+3qMXhz6IVYPTVn1wbNRUmkg/jM8719op5fss/+yVkdq4\ntUt0/D9vfehB06pAZ8CdBui8fYvyjU4UqOGD1ldtKjA3IRAMnvEivhr9YmrI\n4Gjq\r\n=7tpl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMwfjqG8GiNBBTA1ND1goEA1SzBHH4CmlQmtxz/ltP8AiBuyiYmja2iDyTrJWvUQcf7T2OG5Dhj3BeA/e4SpSho7A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.53_1598069805319_0.9914582096488316"},"_hasShrinkwrap":false},"5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.1","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cddc6ca62e879aa605658c7b151d044cdf2475a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vhGBTQs76TvItJGtTgzgpNn3qfEaFZERNwfSRjpH9UDeVIzyWj2PvcwiSok8mFdEO4ZcvWQbNIZYdQG9XJZxRw==","shasum":"4fecb2c5f25374ca49e0de917a3800a40d93abc4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0.tgz","fileCount":39,"unpackedSize":197172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQJxRCRA9TVsSAnZWagAALv8P/2thN/dWlFCLgi2AqBiZ\n/wTp6NXUTFf94Sy01OvA051VctvbsP6qwUb1gUxzNuwHcvBwAs2bRV//fYr7\n8rxklmYbvxViD7mu+TngtyxdjKmxYp9EXf47O1ZNfZ+JWf9TNGODuKsK2u9u\nn9wPIpauRWXY4jTA0G8U9Z312fiZqzB0r9ieoiAzmKQkJFWS9Hzwa7SnR/jy\n4e+X2JdQK7FrZVxskamGqPHcgnAE3F6l3yyAZMwkT8LvQJIPy+v0ULAedqeA\noJgDHhwySjwAu863VI448DAiNd5dVPIuGaa3uIC8ZqfSpaYzmgvx3LeAQO/Q\nRNLuy7ar6WY3DC/Oar4Hh/kgnCByNvsjFkMy0H1j1JPrYHHDQuRJVWZP4QMj\ne2ZjujmBdkYruG+EIqNqUeHueMawCs9BVZy1V6DHwKJ/62sEFLEdlgh6Uggp\n8BGMAprpSRuj/J5Fz6BVevmuYwTaexyA43BFlUzEErM6Sgli2OD2+w2VN5QT\nHsuhgyjmGwgr68N2iSfs/UIUF1rJ2vkOPpgQGcWd6xMUuedQVXS33jQcyKMj\n75+1CjKCCsUtmRsis2qE85QITtgAHp7B7yVkEKGkkZ5/fSRPPIkoKI0e6AFV\nYD7XmpR0QEQXzzxyGclbuosnaka8N9mgmIStjjpMgjwsDvym9aFnxSpP8VmZ\ny9Vd\r\n=CZ23\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP3XtPIEeI2j11LObzs0cW/qsUFsSKnmUf4+tPAKcVCQIhAKwN3h1Dh8wzjRrxPo7tuuXsYG1yRvJUDbb9TCz5i7+o"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0_1598069840710_0.2674051618576321"},"_hasShrinkwrap":false},"5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0","gitHead":"09aefc6ffe3936fb91931f4669c3795aff8e6f60","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZaLddvOu0v1YB72lYdPeS25Kmk1EV/YwzfR5AwapxenLSejLUGTv6H2q2NySwxDeOVLiwAjYa8I7XRC4oVAT4A==","shasum":"0f215281c290957113f3d2376afb10e3f66d01df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0.tgz","fileCount":39,"unpackedSize":197172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQRlxCRA9TVsSAnZWagAASocP/2QIw0ShZgBKaSoFLwqQ\nxLyTxpROFNbJTRhCpwbcpzaBbTp7c1N0BvRY5HPrMD6i+u+aXjqTi58zTia/\nKrF6jz+3Lks0KQPwhCBi+Z6Va4asMzkimCDJHkeQSDFt+DHdfBIui4zMy+Ys\n71FEZocSKecl//whM+ZavmO9uA0SzqhpVMkecQg85nRkKN6Vyw0SM+oeuezQ\nWgi0uEz3HQYOhs3N/grqeLSlz0P6ea/PEr0DgNTvTeUm5sh30En7FW+j3qHy\nUWPZ2iSfImz9HTWf0kmI3qZowsH0muuzvUXtJHaN1QZ8qSjYmab14JxMWBw7\nRXdUdmiKD7f3Mh+xEyetMmbEGlh1b94zkrhJV9CDFtBi+GmxZ6TjX0yuFSTo\nQN1XP/FLDHfOlAJ5td+d5T5lz5QWG1tXBMi/+L2/SJtXDQt/bSAk1GA1ZYqT\nBePz9NTElARoQ41yjSxtEZxUIhfYGZ+7WD1yG3ERMuvSI6z7NrBHsf4gRtoA\n02Z3337NiAW2GcMZJF0nRFtzk/DZN++xlJU2wtzs87gwLVwlkfcQHjk8cFLd\nX4iY69DSOTNXxzwUClt3TbHmibmDQzXN3CvJY9i5+gqa0NcxcQW7B2cv9LA7\nsjqHIZNpyVU3DHrCL5kpMjpuOVsyvoFjIU2m2gSgWbIKfaf5EGGyyBSzARPx\nqSRt\r\n=o09y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjViT3oHeE7If51sjoIZuxJJPp4cHFFEI+jCA84f81nAiAemb7AGf7i8fnbon7IAFAlOQ97XUwFJBpqbctY3SeUjA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0_1598101872559_0.36165559100914924"},"_hasShrinkwrap":false},"5.0.54-019589eb17d810513991f3a638bf77be746426f5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.54-019589eb17d810513991f3a638bf77be746426f5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"019589eb17d810513991f3a638bf77be746426f5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.54-019589eb17d810513991f3a638bf77be746426f5.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bWvy5cqq2Vj4ZCKJWX/46Ah1v24P36wD3JxQqiTt/I/gxJvdvTz8YdkgA2gGHnhiL5dlFlRC/Fm5yHCISohZWA==","shasum":"ace913a2d3bc79d27dfad93ab75f9a1bbc7a4552","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.54-019589eb17d810513991f3a638bf77be746426f5.0.tgz","fileCount":39,"unpackedSize":197172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQRoNCRA9TVsSAnZWagAAEH4P/1dCsaLsXTuKDADaSBPr\nCtfgONiBBcAEjuN3VZNK+KJT1s3SA+nYYRKPjoaLyH5OaicF7SOrk0bA9mKD\nvWwu48Mr7H7hGRIuab3ap/Kxq1DzzV6JjeM1WmzTJsj1yp5fKQiPQf4pVsJW\ng8lcRYTbo4YCENFBX7MObKFCymrZP67KFZDRfoIPNe0xMen9Yf0GiMxuik3l\n+OaHnyfMiZ6bnb4l4uCHzIsPXfDgXWdswz0gDWCv5lk/9nwAjpbYUSzAr6TC\nLamoN9m3M2xLxj0A0QZM6407hm7K4yF8G+ryrW28LMx/jBRZOq++cdChTzte\nMTcup28yRdHRWuGcm0sxY6wIH4YzJVOJtOjHu10jHuMge6lA6IIRkq7bEu6n\nFyp1L4r4UFqRKk+cEG9MT4djpK4xjhideJGpOxk4G8h41opJZqloFI78WZGa\nFugvZ8V/+iiz90BLQIoeyyyDZM6FTrbxcTkH0XTQAN6Frzi4JxFHOFIzZ4Ey\nBA413/iOHIdiYah309rOR4eYPsnQ5T6YUjbkdW6iXyIxOrehefL6jphOexLx\nTiOreuI3tSK7SxbJOV56vJaLEX/AT02ASVT8bnpAKjvCfXfssWrbP3aUeXc9\nDnqCGnv5vVNwKNK3jnUmVJCdUuznSdHKq01LcTgl7qbMUXaszjxZDxfmsM5B\nLu5H\r\n=rCIy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7ETnA1WKj1lGSb60AeCCmuJfJvzDW8RbAqnnPmFhhxQIga+G4Tovu5HZ6G08x1+QZn9yu7r9etuI0mQMFPpHlt20="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.54-019589eb17d810513991f3a638bf77be746426f5.0_1598102029111_0.781396018118782"},"_hasShrinkwrap":false},"5.0.54":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.54","gitHead":"51809ec785c34be395c169c90da80359b45a8e61","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.54","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-L7TKM5Yqd3bF1+UupTM5vYtwBkm+qZiwepooIKlUS1wgISJiJdC76w3p0m8vJHJPsQ7Vs8a03NMpiG0fiwbIPw==","shasum":"a779505f6e6017cb6dd0b41770a3545ecdaf1721","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.54.tgz","fileCount":39,"unpackedSize":197404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQRoXCRA9TVsSAnZWagAAWOMP/jXFn1Y1zROmw9k3gBmg\nMHgllXMEU+4SeL/4KlOWTeMoMCXfw0yKy6H+thVlooqhOITEzbyh86MAom8r\nYnq2xxLibAiW2bmBUW6oyT4W6820fI9F4C9u+nE4bS9/935/hTxiZ5TIFt7b\nQMXj/+C/B3Yb0cjsFXCzISIC6ngIWg5JozTVbf2A0rYLoi2b3jc6zqvbvRTA\nd+rDZ1HlfZzXnw1CvxIvBQrTUcIB8V3lVqVWGZSJ5W3JggVtrX1/pb+j3fdU\n6un07OkXvhI52nVcU/KRT8+E0N+5yqyHzzcLvv8l3+YEWMp6RxaZKZbfAU0e\nr5SS3nJoNAPU96yD1HfK+lPBODkTO2qjmTyyl0yNwrScqqrMLnjGGAqrfh5k\nrNLkZh8yYZd5Rs5hy5KMnF9noJO3WzTM+yentXygRP/FtrGBRqNb9Yt6SRZR\n4k3GGXsH5X5a5+SgJnc+a2EYp3dTwVQdk0JyR5xWQitENEvEZ47iLlQNNTQP\nVmekHAtt3ZaufWiHi8iQBCu+u4AeG3PCSbkw8jiu/LxqRMFPAgXCIdYo6ImG\n4vw1mMHmiK8fFZP/GHpzRLjl83xfUhFyzkoOtxwi5+vEYH2TvWcwE0sTwoki\nSgqsfI4rKtM+kN7qaCj69JOv8lM4Nv1YQgdV6/buJLWkqjZGoswmxXhwgpm8\ngSgZ\r\n=HM6G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBU0MbsH+oc5Eds6CcBS32VKJ5WQLVUOJFnbneDb14RwIhAMKP5KPi8kOMS1xTewvFexzi2YtGduN3fvJG5b1wCXgk"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.54_1598102038875_0.3116991760600416"},"_hasShrinkwrap":false},"5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"51809ec785c34be395c169c90da80359b45a8e61","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YJiLXw24JICL7MdEFK/iDB5Ls2x1ix+TQSDvAK/LRGt4VbCmPjUWNiVTwrIv8zCHloZGJ3WyLmIC4hUFGf4e3Q==","shasum":"b99dced7fdcde42c9b6aace499ba9b998d94a006","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0.tgz","fileCount":39,"unpackedSize":197447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQRpSCRA9TVsSAnZWagAA4RQP+weqhvO+U6Q5KA5of6ZW\nfKpEvSlAtImiyvqfAvmHtOjvYLTH0L4mT98gQHKGDEE5fns6cC2/nhJal6GS\nNdboJz6bMLiUv41JQ8qXC28o8Q08sLiP4AHfyCnQqCZY0BbZ3R+Gpox/K1TX\n/7p5s0E4YuiHKlUoKD9yV9tZ7zN35VGIFjbHhTYZiRwRktdh0gPhXg+BNKxb\n2FT27u4jxcmSZibUK5ywVjPGBev/M/Tu5bhbnXrUV++Zp4LK7FCLJVeIDyUS\nTTuY2QKf10sIpns+4Tor4L5x4e0Mlz7K7zXtZE9WvZYvMwjpR2VuYTulwYnv\nLrz9pTptTZ7DTmhNALeq8dWCDtYMfu4eJF7w8CSVurMK49rQEx1KMzMPsRQg\nO1lyAwxYZ9wOB/reidxrLmdj9CON0AdFmePu9/KkMFolXvM67Gt+TnvC+U9i\nmX9iCVZNw70r15vjOHlf5KUaeuDewNb1qd16NajDQLeldOJrY2tWIseAOtau\nofq++jcnRgkWjUxi2vp+R92FE3JJFqGz7vVlZE/bYvIb037wXnUjrumVTPqK\nd6VqedgSb3BK6OWO2KNfbv5SiyG8g8+bGqS5J+LhF+Sg6wuQOibLWGUCK+00\nPkpvCG6766Gx/ea3zCtfLsm8z9J6NOXmwjfwRmC+E8B+uhI5C8Qwurn5gMtr\n9l/P\r\n=6bwv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa+1bqhOo9MeEaTE8IafRih/QvGHCzES0CgRylp0HQeQIgTDEotCnk/xugdphaupDMStQCGyqjZZ+D2gP25c+bFw0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0_1598102098111_0.3345370433925199"},"_hasShrinkwrap":false},"5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0","gitHead":"aa0b31e28416fed12334fe21068eb4127353737b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-n1sQogMY3vUZHuYEpiTJ66yym23Qxnh2eKCHzzf1VFrLYMhvs2giymmqn3jHtfCLVyloOOwEHVdEiBBZtuy6Ag==","shasum":"fae8cdf38ed664c4def4f569cef489f53c467f4c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0.tgz","fileCount":39,"unpackedSize":197447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9tHCRA9TVsSAnZWagAAhhgP/1cXuTt+9lK4lNM0nNrV\nWSlOTSr7KCCmmF6ERrNG7BH1xI3SRzWeiZr5MXxe/XoEBnshgZLYCZf2twAx\nqnkU+YqOFpmLZQvBEtrA6K2SdX4sAboazpM5Jw9+L3yNiNESNN7pgHxgyZXk\nQ9hpI7gbYgMOayL0d9bkHo+rVRUxE1mWG5EbwKWgUjgLbweODyYrSlerIxmy\nG/31JGvwvnFZWtCkPVmj00hKp3HUIlwb5GkgZnPoQUlieGry4NBFqMZZGiGU\nSeCtYrf7vYq47QsXQbulLXVu3JoEcsp4Ai6yhR0CcVTHV6Fhod5CWPsE8xOc\naK+JMjkmSxr6gYXWFDyuSJUuAey5EhfRl+A28FYY+SAPku0TYyRWr72XyrfW\nBPlg7hrll61lgDVNP9XqqzB3gm115W5zgstT9o+V5M5JVIk/v704m9s9MTK4\ng+tZSRVsXh1GfNUb+UHfSdUvyUjvp0QNjXio538hsg1hAgOxJWOTqmkRNeI7\ndiC08aBXApgIJKARxoqm6gSjYJb2yldxtPrMplpgzmInleTlqxYXeY4G9Tbn\nCIKJhcttCMufaA6s3svFjznQhJTVTcyQP0PUoS7vh8uD1MR2xb6dAh5Bbvvu\nyKbt0yWe2HdZm53haKC1M1FzfL8Qwwhj2rpRJO/Za77ymVIK+/CwSjKYIA5m\nFyKd\r\n=mqgw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX85uvNcw2AnXa5kDLuim8z2Gb+Os6muTElWq/xDQT7AiEAr6NMzdMFIMBLgEkwbiuphX9j2SX3FKKXXKdDQnWmB1Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0_1598282566384_0.8411893315587919"},"_hasShrinkwrap":false},"5.0.55":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.55","gitHead":"7816c2ddfdc07ef5197a63408d85adde44041573","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.55","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gfpdbTkL4Y0uxZVSDm0wSyTzhlkKBNXLsswan/DM4E2VWX+jKj+GjHh1OdG4EQCYzqxXJEPZK4ZPpE3KJsT0dg==","shasum":"4e2743b0d2617c15c8d0357f0dfe919875e4feeb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.55.tgz","fileCount":39,"unpackedSize":197690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9u2CRA9TVsSAnZWagAAKwMP/2hHeGboZKKi0UdWak08\nEtQUnPdTFU74Z0lq4zIttpnlWjzpVSQZn1XYJTCFItn97u9OE17QGth+hkxP\n0eDu/oX7Uqk1Csy7bSN7EI7BBxQJyc3BoOlTUp7/Cqr0sa2bgSOt6CV1stIJ\n2jLdivYstojz90xjuVnE2H5eLFF5mK1mCXsnA+HXeu23ZzyW+1rSAYjcBunP\nm6AMHs5fa5fDgaTcgX5nBpIw3Dw+JSjYXLsJq8vHD5066eglZix01/64xhQi\nnSnnYkPBQK2Aw7RyCltqOrao66C8yt3aweZqHva9wj8+4eb8Tz4SyobBuZIy\njePDlvJgtQPCLMpgu1WpBjBJNTVrrWG1v+QppncUp2EfbkEBlegJjutS5HRe\nhwuMtHkYMHz656XsbEfz5VmK4uhRdVmOCNM2naxYcDyYnFIoWNlj6Gtmyi7G\nM0YhgX5pCZJHYsc6CiYo+ITkdG2EUzp7/WgYjZlTz6iP76qc1L37C/Ybpy8+\nUjj7Iax30aaWjMlkoqAe3fLm4ESyN+yYIQ4FNbLv8KTPKloJuHneEazv6viO\nuuMPel7CSja8oG1kDjIppqtjDM+qcDtk1NAr1WHbT/oztRQzkKyYFBQUYQPx\ntyjjEzLD5A1Bl3s+WOm31Sk9Ajp4DxWWww9sWoPtT1jQ9E9Jj2/Aeys7fSjd\nvxMr\r\n=62PX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQrwKvwcEHsdWruZvnj1FSX1WuwbrLcctetrjM2p/wtgIhAKJ218Jn6A+cHWyQELwzPVPzjfgtvemOol5uMV2JzvnB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.55_1598282676486_0.46647075890292866"},"_hasShrinkwrap":false},"5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ab52f258876076a95e821d4bf8fd45b49b64b77b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KO9cKoTM2wYwq0/zGiOhlhn5D5fzrD0egn8iRUJpmO+uyzfVDxs3HwBnsrh5N8tpa2tzrQDSE/WynRwWipy4yQ==","shasum":"1faa2c1b25225261dcc2e166a673a78b9598a044","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0.tgz","fileCount":39,"unpackedSize":197447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9vaCRA9TVsSAnZWagAAsUwQAKGfryTyR4ASrq1EmsJT\n/t0u9XI6wfNaRwfUJrUB6YPttAdGpXgwyisK2VJ/83kDVtPcRcCQWuj1KN2Q\nlC/mpjAYqgMi0tOa2WuUCGfNqBp2NRQdSAjDKFD3S6kg6LKObPTHZKzoesIp\nTrM44xVtVfBhdvlRD2XaNg2PMz2UO1OSUhJLcdYjAwTIUHv5dqMTwNqf0/Qn\nm7fI+mvb8xZj6AJmACFWiSpIrWgE6DX2MGJuJKr7x2bSzXFc1hpqYY0sAd7/\nkvnpZvHISq3wD1BOO6xmzKXbFst7ZygDw7/Asp6Oc4REYNorZf0N6tJG/4XF\nfsAS7zoFAECEHzPX2klUE2zdZquMzk7366pN+QWHePBy6mZG5CZzbjwUU+Rg\nq7anITO9afiXdMWWqskiQNS4D+TXCmX1pV/X04UiPK3AFe041jg848aEXQCD\nDvoY4GiC7V7xf18RJ+et/BPRySeyzZWE5WDmSb+xIzJAyZEcJX/LoIyKN/42\n9SJ2qSDkL1kI5tCP2waxQdAJNfyzrTmA7DwhiId/7tiKbtR1atoF8sekdMgE\n+4gtQI2T3wblLIbPx34J0bx0Vu8WEAQpIxS1FwstlXIg68dHhOS9GEemCqVw\nVqsU115sK1yezkIOkzrV8sLRmOEH80OzckMt2NaGDQeMmtz7am8fdsCXzSB9\nq5hX\r\n=gHsQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDc0U6gQys1p+XaRZkRf9d/d8zhRrrmoOe+LJAKBJ7dnwIgH2MaPI+DoQ1eAUBKsjfl7rTtIJUiAU1NeCLLbZsE2z0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0_1598282713707_0.6927660164123766"},"_hasShrinkwrap":false},"5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7816c2ddfdc07ef5197a63408d85adde44041573","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EzqbEnnQzEENVz8D4lXvkOKpb7PwOGPPAqIfriBvDW8FkdVyW4rh0u9lljCyiL4TI2moxQDUUDYxjcepgXgJFA==","shasum":"afe5d75468124d6036f3290dbf079792adcb9894","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0.tgz","fileCount":39,"unpackedSize":197733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9vrCRA9TVsSAnZWagAAIkIP/3wVXnCX+DdB+zWLgYJ9\npotDO6URcggaezpRZ/W4HTZwXlaTlfkTM449Km5ykXZvX+AOIrXPKAzBBH8F\n7h3pe/FkLhF2Uh3L679f2rrzRUytKXvVKILYTH9Adv/vcE7urTSDsx+VXFzE\njOpQQtizr/3kMuzQp1rFeY5xoZZnogIb20Q+SMYVtFDyH8lvHAbgAvSccD8c\nxzTNwJKWpjOry4j0mHFI7ZdTvPljDMud6ofNSV66gfzWXzc+Xoaluo6KOKUt\nDHSUbMa7e7vc7hCqrsHJPYo15kTaAHDnlbhesOeFzK5pGIE5I4kPIewn/qdO\n+bWZYgjidG3QVQ6KtunEOPQtMwgC9wG/o8+KFeEvkHqCnUriii9UnnH7Qsuh\nuGUo1PxMbub6Z9Gqv92DYWv1obmQPDUhiJGGE2XaMgqt66dBSj7HUx6ni+F8\nIiq9RjdGLSUE3tpYKSzlZ2bHr6LpONB5UzETKcvxco9+IFBSBGjkdPaXR80g\nG4VLLbQiGkfuXydG/Hmu9ONRJnGVumHGbwj7f7L3y7uw7LIu+iqAfuUtByOx\nXk6FUOF5GuocuqMOr6hu5pDn2/X/9RWRsqCUJiNNqssY8BzcMJeQNDxnzncP\n1fLcxXFf1aXZC1i5I4D/FtKwtR6G1JyO+LbHW4yC5T3e3ZlHhpTzFDRvLkwG\nOdRf\r\n=H4QM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiudXt7X/kKhwx8MMND/9es8+ktfKqPSRtsTiORZBkmAiEA4MSa7H17ZsUcpnbpEiy4HQPBf4L6nTl0z8VLo7ezAXI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0_1598282731393_0.28831230318712664"},"_hasShrinkwrap":false},"5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"15c4b2e3b083223d98a134e5b45503359e94ce75","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-pGfuQ8S1cTxK5IaZMWq/iuaGNVA1HL1NxqqThPcs8amo2cGljD9lNFcHwrVqLHaeeQ/tI7JrZ8Qg7pR/zQgEjg==","shasum":"bda58176fb19a626b750022b69e618691b7176b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0.tgz","fileCount":39,"unpackedSize":197733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9w3CRA9TVsSAnZWagAAqqwP/0iTL+QDSRqRuU/03FJR\n2G9Lt7HdjGm2yfDCz8oEFnaswMyRVwVHnx+tasXYgLjgMk/hjTEo7nNiZUKy\nXI37QQfa6EtGaPf3i48kRZS5KLys1XV3hdiLnqpDAJZUrwmM1zBFbdAQ+ZGu\nwroHScj14E75IuxLZ12yTsJkQ2yoh13VliSlJNuRIlrnsbjwBx/uj5Op/oPh\nCaR9EpSFQySc5kxzyaVVLwl+mpI1o/Q2fq+wbGecA/I6En8LGPwR/kQaFOfm\nUfQxVZ75xcA2F2PhL88e6RRmYVSvERd64h6ZTMjg6kG+GdltkC9oMVRiPqtS\nHVE6jv0qy9cD253ZJciebetK60Leh9LxsmoT4z+1eqbH9hi57gNrmz0H8WkS\nwQqEJjwaTVqcI/7+JcEGfRK4Dbr7MNpV2IGaaSNJ+ySfl5FaHM7tpvjmdLWH\nvw7nkyisHOjfgir80IF8ijHQ5YMeYQWuVE8EcWF7GzNK95VjdiCfuyYBuvTK\nnkquOGvFMqEkFCcH8OyVXdtAkRt3x99n0wANkZ6wxD67BmsPIwIDSUzGAYwC\nggc6Al8DUK5tdJWpAUEaKbHP3jCw7GXZA1P5W3hWs/1blGxvD/1qnG7QoGQO\n7+hLYEvSg+F489l6tsABEqvIDfH8xSLpYFopFBGwcv2/1O1C4H/6Oa/BsDeH\nsdJv\r\n=LoHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCw/kRSFff6Bt2gmBlwCfxLYvbKKknUHlk4p2a4FQFZIQIhAIlWaIg3Onj93lNA+1t06gZB7rNEUgvyu0ZJEbKUhHxT"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0_1598282806585_0.9382495615763209"},"_hasShrinkwrap":false},"5.0.56":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.56","gitHead":"47d27ef673383affe8d539b380ace8f4119a4fa1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.56","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-riFMwuZdI7sZVVyKFFyozEbngZCVXQlruSCW7CZaixnRErY7iEmNUnpaOmEix2bCmAz1fd3nFsCjN5dJtBnWMg==","shasum":"37c611c753483642c4ad76c28bf4cabfbb07eb08","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.56.tgz","fileCount":39,"unpackedSize":197967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9xfCRA9TVsSAnZWagAACjEQAJad8+r6p6y9XwTkTnV3\nHrDMiEkdjIpqARFfk9eYyNE39s0EHtjEi74hfavwqA1zwEKlqoOH4/MIyCjv\nsRL/ZLySNdK6by11H/eThozFSZghjZcQlo4IIQfTna00FtY8OXKOF8Eg9Z7T\nE7XEjw6hJatfUmIy6lhcNk1tQcPerNO0l1zK0kezpfGBvJfAHefJseHVh1wv\ntFn0etGf5DuX16DIN6Q5C6C3TKBA+QhH8tDtqSJQNoUFct5iAJ9knENZloKZ\nztCG97Bw/R0aBGNvqJ0hUR9pMCu9s4WorHrgbSVueuLixbdP1/1FGHBlAcsb\nqrFA0Sf0Dt4Wm4NiAF3xiVAVpplYVwB0XgsEzMfOeOlVqSugQf0V/6jFS3tI\nY76w2yRQ8vzJ+WaaSOwoLMaSaKSi0mHNncxKig6GEqfx0udCjaQ6ola4dssI\npfnTVexU45RrZMH00hPUNQ4MVehyEqzv2dr5kvm70QswUKV2Y/vGltUdLEJR\nc2Mj+Z8Stg0Ppi7PgIH3YxRwuqjUPbYaRvYBfTOmbsSwksNfu44WUqjujY06\nDecPyg1O19nqiTwtU+f3lCDZWZ0miC8EvKegicx21Nt/z4Fe3bn91v9PAXx6\nAPh75/BdFyu0OFqxPMqKhfaPdfvZgq9mnpig5tCB36OxLVXs6ZOKe+X3bOhs\nzDqG\r\n=ZTsg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMlpEUO7c1OnyaX+o3Qw3f0VAgTnwa9YXXM0BPD6SWTwIhAOTytf6tN7VmH7jl9Ig72XEPcyAnGPeNMjnonhfewrFC"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.56_1598282847398_0.4951870366014024"},"_hasShrinkwrap":false},"5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.1.5","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"47d27ef673383affe8d539b380ace8f4119a4fa1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FpiP1meP92Zv1d19jevQOSylI/s3TDRB0j3ay/76WD2XTs8xMCTn5Nk/YCT2G7V2f4E5HKFBwJfQBaBYOvAJgw==","shasum":"80a5fd420c5cd5092c1c20f734ecadfcd3b53ffa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0.tgz","fileCount":39,"unpackedSize":198010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9yCCRA9TVsSAnZWagAAR4sP/3q5Jyrtw76H8STDb99f\n/Xzt/PX/Y4HF/5qI+zooKKtZdxDv3AvPk1/7rr2Ux4TdSKQOojoWFwNfJm95\n0uElNTHD+YVE+aQjlHd4eLegxa1PlDVNVdtG5vR65fTScAAQUkKw+t8gD8dV\nD/SD1minnmAUtslBas1NbSnjuYxFMtSVMueb1aSyUsNNp2A7n0RWMlzdCYm6\nQgsr2QM/v3JNv9pzsI+oUYWgBSHb0kAWZ+lFmkHcXBAqcvUdmOBPAbrq3Zs9\n+hWuh3tay/3yM+Ub9n1NkFWUpRwgaOcxF5Kl19PCgUFsYT521zp5JE/QCYg2\n60KhZnNFXMV3av5nfcylQXhe3uQrTx9jqG5gnyrswcGRMhR0VqUevcjakxRD\nkBCv1Iwvg2QOCtFbU1Z88sHhvlwp1CPYW6tZj0OAvSr8+DfqFiOlliiujqvi\nKPj5R+7DrUWTN/rzeWkX3MDdb2X9rPlK5Ua5nwWtyp9SkgyQov04kMTulL1E\nC5DL5qMbE1qpncMsDl16R6N6uX3Vrv3tC3XaLB66ymeKLDZ+47LICoFtPSI0\nNIA9slK1kmp731IQWlDt8F2DQWKsJQa7bwN6Vum+E09hfP47PHKkUHB4IraC\nY69FfF1ACdNaEJxMlUwNj4MnkkA85++lr3a/Srmt/wwzgVyeUtugLZQLqW1j\n1esk\r\n=gRQZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEIjFqElbLsq0TJZQtEyNRoq7+43zGQzPa7BrhoVVIhAiBpqmDQF2aG/OVF0iB4V233dS7z8q9FTywkPt5aAPzIxQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0_1598282882095_0.26429045790952177"},"_hasShrinkwrap":false},"5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0","gitHead":"6f6aea973fd4a19c43e6a40238b7280b176f75c3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-y8TZSXI7ahDhe5+4jBgsnnpZgDrkBJtMvRN5HvgbJbMxg4EBvyomYqPZoHZ0hKe481GMKO+d1/mkPUwfykLQCQ==","shasum":"efb4e5f2d5b8cdf3baa60e9ea084923815b932cf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0.tgz","fileCount":39,"unpackedSize":198010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRNJkCRA9TVsSAnZWagAAK1oP/jBwem5aFJET1Enl74Qn\nx1Bx56IFkOWjwFJNIk8JiV9lZFd9hxSJhZCZfXeORU+wTF01RW+5+h5QSrFg\n/PanwEC04OqMqveas37sfDcPHPXS7HOpB91YYPFewd9UlHPphH6V/25YNi3T\nQuoHgBSi1JPtGusBZnBA4VwaHyqyfuCLHEPYySBFB0jyso6MfdZmEL1qOIWV\n4kFR7ZCMj9pdNpbNWyEmM1ImzZY4AuBAnTTZYs+nKDNWTQlq6bQ1GRBeWnfI\n+P2W0N/8sBaULOGU2r3EfCZkVL7t8PG+SP7WrajpboHdLRpY0znzRRwxE7tc\nr18XY+uP5LhjL6ZcO2PGVf1QtW7XRIw64qf81w07bJBYjNs36L9mZHutcbDN\nc4D91idxogo9MTnRraOps+ejkp044z189XXgT38UChwPTkI8KtN4dhY1u1Ut\n3Dsc6N1VCQ6eiD9q4E/+DRg4XDjJGtovau5PGtHUHazrJkk0AL3lthEPtYV5\nCQu3F8t9ZNczpf0ddDI0cFJR8uM9g7lGYBOQPgCjC/LAz2H9c8JXf0pX0eOG\npb8m3eEyd7v7gQNciaLc73VqM0qkYd/Tl0d0wMbGxWQemFDQFBLL+JoZWSNc\n2T1Xcr2nVUGGYH7+dQaegoZEQh+0D/zvGmChDDdBFfTsjzeHBz1lpDSsVdRX\nw23W\r\n=9AH+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8FYdXv/8Q2WtUCfvZEdvHTlX0tXMA1pu398CM1SnmtAiEA9ImcCyHYDu0kZc1wlbKzm+FUKsmz4N29OlrP1DWJ0jM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0_1598345827611_0.8908327345752578"},"_hasShrinkwrap":false},"5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3Ho5HWLLrKPxVgJWo8rZy7LNbuNtLDdOKKyzoJk+xZGQyfadS4O/XYQaBl/+rltdRQdJsvHUcTHenksqPhqRQA==","shasum":"0afac5e01adf635752e18670090e022d1ceaa2e1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0.tgz","fileCount":39,"unpackedSize":198010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRNK9CRA9TVsSAnZWagAAwzkP/0CbCaWn3gzIzJ8mMNmA\nHrtT5X4Z+6a+V+DYrt24QaKRAKp0ehikSAuEdZn0yY3+8dfx/qg5HrKkszN+\noJFwyV6gFV3hrMPZWqA8HhozXOfqR0x+Fboh2/JGgLS+DJIP3RdwPykGWC/U\nNGcTPcCbHr6b+f+wdJkagw0Z0F2dvDjRvO5TF8TTH5Jq3Pdh9msgvmspOpuc\nl+VYkP1+lbt8b8iZWHpyAhyRt3q49kohl4zludOo5+4dZpNqDCxTJlbtRvTt\nqyJRPj79+VRsQm8a1Q0mbg9yETVhgps3+YVdEKr74iE+zDK121esNYdgZZOM\nT37C7GJFE86g5c8BQm/ONfkewr0YCzyQTsYE7fK4EJgK34xLy2wsOKbT48XP\ni0EjDS7TeKTD0H0vkuypIKLwJ7AScfNCvh3bzNJiEbt3kYhYyMRl8WJLs5AK\npPCJ7SLmXVakP6kiF50asdGz/Li7cyZFD23ykSzPzT3uNqkJaXU3bcMzGprJ\nbsFqK5/EdOFBf5NusfoNBBeo8TV76YrC+z04ftMA6EM9tXuqa0V8LlIp6COS\nheLeNTgnlVKyKsKJRDB7UlxMy5b5GXscgFwHRiNqV5uOXE8hmAi0pyCaKohF\nOAVzF3bFOrwqBsc7RQry+y4JJIb1+/NKh58ebW9JL00v/7qqypK5kCLPpcPE\n/VSb\r\n=/fXo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCly55UkpOQ74AdBIo2pFjURMilEWQUYhuoQc7WHQFEUQIhANekv3EEW0XeN5hKbMUpbRviWfbqGc5yuao2GNz/zWT3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0_1598345916984_0.790392661315519"},"_hasShrinkwrap":false},"5.0.57":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.57","gitHead":"020ec4c829b74dfac216be0a1021111b89f729af","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.57","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7hBvfQ1XOSvgVIV7DBHkMvZwdv51imM2GcXBQoX2dB0Mhl0HSNIPU2S3i/Xe3+wu5J+Yn0AQBDqC4AWIkhQ5mA==","shasum":"c2d4db7163b36ab07dc9e139fa6203f47ddfad3f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.57.tgz","fileCount":39,"unpackedSize":198246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRNLhCRA9TVsSAnZWagAAVJwP/jGHdAG5ffvna8+XyTbs\nMYMkB1b54V6itzn0Z+8Yerkf5rmywbZkgQDTnmoZvJvviYmVnFXCBSzcGI1E\n9bSV39T06giQCtvBCK0qPrYl2DlNkhRMyMr0OZzfjJ0+vY4N2m2TOwHbyfxh\nM7loXJ4CMgdKaoRPhMAikpBn7LESg0Yo+cYjDdxNvknW3hyzoXwHqqe4jy2o\n23VRg6jdhIPGw8oiU+ZuMSMtMsD1iEQGXAemUTjU0MO2YnOq2Q7FRgEseYoR\n1lqmwLIwA7ye0DHoAFifKf2rSPn+wP4BnwzGb7i1YQ0pN69xTlk8PpgeMEgv\nqGmHHHtNWUkSjRdT7CNFT66evcI0iWUr2jJCBaGxKBm9UlumUNBaJGyyb9p0\n9uqyRJvIEKSksTiqcsseTR0SR/e4fCDTjLG2Wmb9annSc8B9Mi0d+3WG3a6U\nFTcwx9G0SC1UtIdYNJwz3tlQh/3Qo3/eRaSuMRwvgc0qE31vMpejdrdij0aJ\nGzywgodmWjYUtxhnrQ1zbY5NMfHwt+tCMseHi1SiIG3RA4U+JjXlcU3wfNRZ\nmILQBNHlsiGY+9mv30ykPTj0fUpnNjERNmwRgKz1CiJY5X2dktSGT2wsrv1F\nHAIBN0XgKI4/qaay2T1tHs+47y2ZixGDAlR2l6NT5FrjVAgxtaIbfWWuOd2i\nx6c1\r\n=HZru\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErPTaNln+8eT9TZh5qySaPHPvt1dllzhEYRPp/AOUHOAiBgK6FW3ixCtXmoW5ubh/3JjRYI/qrbwiYmd8N5X4PUHQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.57_1598345952345_0.9980728078460552"},"_hasShrinkwrap":false},"5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"020ec4c829b74dfac216be0a1021111b89f729af","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rNC6lA0GLygMF6gHzmkWqd6DpyTVaGmKkZ/slce544VPrM77YR6dqfgRRexnxU4ZFOX66rQlinsdBxD2vhcnfg==","shasum":"ea126153d40746d4c4cfa4eec8800dc35957aacc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0.tgz","fileCount":39,"unpackedSize":198289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRNL2CRA9TVsSAnZWagAAmuEP+QFea02kTI+TGL8DmbIc\n6w33JDHaELS+RDdcaSAEST5p3T6Y4LLFP7v1m7PGtcITJNXL2OHafTBT+4yq\nl/TqwoVvs5vKub4S0O8q2eGCrNjMdNdoNgcvJxH7zZF/i6zm8J7YW+b/ncXI\ne0ntpqGrvb5I/3LayYttSBrd7bCuCgjh/DkQwRhF2IDxiuwyyD2czdfe1tmK\nswMIQJdlAb+ZD+7CSyhY0gzjL7UOu2O5e5WbzpQpuLlIoqu9PLhggiUG+BS9\naz/R8s6SjyNPvPkvBntdV3FenZ3mONNult4RbXt5+0JKekv0gvUgkfmzLn32\nEOW6tNE+DBVFz2LfU7qH2wIi/kyY3ULPAVcslEk2zODcawq2mTgYJ5zaEftk\nRuuYRiQb06FDiE3t62HjjYFJovqOMr6wYlx9S7LjLuD0GaQSBzI/K/LSrvKM\ndhZyxEP9jdKjtL7wflxOqWIj1vy0okNl66rIKE5BVrMEFRO9oTqLyL/06jt5\n1zEWsbC5wEKbYo8gfd1XVMJWBq7fBarclbLsHbFHz+5m7pPtuAbQ6qM9bFyc\nRL6a8DlWHnSOPqtHUSAsK9du65RoLyuTcFRWl7tZuBauMlKGQdXpEPps+dNW\n43j+4zUWJs0SrPIu7m8EwEFNDKfgeepC6L5V6SrLFgHZ8iwH4FuhKd0nw5d9\nxuSv\r\n=dFh6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7qHeEYVqlIQFBqBOGzKVMEOLSyNAuzFaZVziSd4AkCAiEAt/mc4FevcqjDz8CmWQP1tcqTHMbeRl+qgZMRBwc4tYE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0_1598345973486_0.3219444520878023"},"_hasShrinkwrap":false},"5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0","gitHead":"3669cd02d61e59a6ab56373feb2f7c096c5c7097","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2pvDANNTcUGzzAUzi6N8pY2oChwBUjSOD+/Zt9+TXCr0ISoBLBIYEJLdWBrOoCe0fkhZUb9yTDZGYl0uR41sVw==","shasum":"ae90e8fe218f6129eca5bbfd8378de512680c48d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0.tgz","fileCount":39,"unpackedSize":198289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjnTCRA9TVsSAnZWagAAqiQP/3J61EfbKXMUPNruopwz\nLeY1w64R7AvOpjE0WZP3Hu3xg+dgpUDv8oeMUFuiVWnLltD4nYKNO5kMKriu\nlf6uZb5V+F3sQG2QQ3p8Hon7d4gyBUBeSe6eYaUkDnIJLbC7eoKEO25ifR8w\nb6jtMC/KuiQxAxDipPD02swJLuKvrVcGUQ/mDL9/PY3n7IJyn1uGXlqRzAN1\nKNG/aRb3NrRaT2CHLlHYxc7ZUZDMdJBCVP2HN2Y48tw5nyrTTcLHJiqwODei\nPM11vT+sg79S+KjLfQzG192rZqsaA7TmqhJUdS1udw7dw74WOIUIzPEWgx2W\ndmf0QX+46Cwxq7/jhj2Qmz5emC9HsNBTgin6cyAwqAaN+Kf6LdGpUDSNgb8W\nKikPttyQ2IbpZYJ392dcU7B95UvAWvtiocyYTDwxo0MXj/sA3klFAC5DX/h6\nzyPJBdhq5YduSJetONUgLd04B9wnaCgVSLmmNeafmllyh4oY27jd94Zu4r0e\nPgKZnusezYAvjxi7oRmNPQeGU6JnRdMrq3j3s8pJ8QecsTL8z89KAKuLrMZm\n+wPmCrcH03fNMjq8lwRVQMnWKnNMuEmEVz91NOfW/Y8aw6fzOJ4Q4mkHUqxM\nTkVVSvL18aHbaWIIsUcuKoaE96Ha4IO4VPL4IpLb5iLI+NrH9Nsdqf/S09w7\na1t3\r\n=tMaX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMB4+0qBt25UG2MUca/Ltdl1+EHVXTTjtZic+brXVfqAiEAsOPt5c1MaxPNVb5kyUIiupM6IykHCI9fV0uhJqfge3s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0_1598437843208_0.6018136795780995"},"_hasShrinkwrap":false},"5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2164200218205a02acfd90d5aea1c155ec29d474","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-umor8sHWZzaUdSZMim9DkH775h5NTL3OIZ4jOzQw71tXzpOKcNAuFi/r/oTojIg2cbcrd4hIRWdEugNyBhHScQ==","shasum":"e9f45baf95a4095ffed86cf45ea51c6e845cba86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0.tgz","fileCount":39,"unpackedSize":198289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjojCRA9TVsSAnZWagAALCMP/1yGFGLrUMy0SkRY1qH+\nyPAm1wZK/N1HJMNsUneghQ4zpMF9vqGT8lVuN6gYZKg9936ReGbLzC76JFYC\nyjFHnlbn5LkY1OiySuo2lJlk6dxa2dtrj6/qIeVEWSF7jWktOK19Ws59ehji\nrKk7vchcYHNA4AuERtvy7MWG0FA53xiRXijcmhWepc9+JveH4gjP4Gi/qDG/\nz9DqutumVCmrkGDO3Mltsv5ZsoKL4eIQ/eJCF720IoCtsa6qPLqmiUA4gIxG\nBL1N1MHAUTK12bBH2NBRLU3j60YcfMn9js7QlF8LsnT3G6B/p16kNXOrVDQu\n6Jt9Hm7u8vlEKJ1rfmT32jDvyEuQcwnXjXHUzlOjUzC4hReSRzpaza52x34T\nUtEghQSkaJIiRHGl2uPk5u70iGIyceCHwMMaEC5aytajOz3lFDweUoeb9Nqe\n0zBhkTk0HTaSCIRbQrv6r8CncDf15RyBnLAgfwJeDmMBN0TAps0ImzVywzmR\nV/TKI3mr+Y0JBACuYYwEjdlXU7MtK7Pj3SfDR/wZdQ1sMYHokioJPbz55QgB\nOxM/dd7EGFb+qkdiMMZJBnK3jwoskRhWbnD1MyEJeVEMy07E+0CtxK1Di7y0\n7/YTT2BGNVnrhJydrmNSdDZwLyjvlB/pStcshCu50bjVyI9LuuTa7GgoMD52\nmBVe\r\n=LT70\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEdvtq5aNVBzKZcEMLzq3innC/Ye046jVL5dMpUhyxeHAiBUVCWEWn3rYbY9VeSOlWzrjQGrJx83w4uvJE3PFJnspg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0_1598437922788_0.8803115182223102"},"_hasShrinkwrap":false},"5.0.58":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.58","gitHead":"3df845af9da1e77b026bbe7ee36412cdb986f7f4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.58","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+PmvRelylPO+EM3Nh/gqgpkt7YhXcQbJFVoTRWScAMeIqS2YFqUiAyNKsI74hNyGwmKlsfwBaLN+1lpMtoPFOA==","shasum":"e49b125e99e503979065aa0cfa1b104613088182","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.58.tgz","fileCount":39,"unpackedSize":198530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjo8CRA9TVsSAnZWagAAGzgP/RadVLQFqGAq32/MyVFO\n44amW8wEuPcQLpAjWUsJcqvpS/2ECSEGi215SvVZI69D491Hu19RkdVFfP9q\nc9f+edY9WSs2tMcJ2+Yy1VyX6XeC52b+su6XuivtD9VoEB7gu8L425fJmQfS\nhFYgb2xVBRCIyWAvQUavMbFp/N+B1fMYknI0uuZC4It0GbihpcCAvYfpRVbE\nvdSY+ie20L+DGemjhVCpVh5RM60ZH7dpmC8liui0kCCdpjsw/7ogrOTyPMEA\nF1ce4UNNP5r3achUqZCbStJAvK8Pz5LrT3dKfYxPQN7zwawx2d77twvVfFKs\nh1uCq8yaZxyeTndaEY7doiqwvZ56vOgmUqs+TEEjt9M2uMZAD7AjG07z0UZP\nD4kFUl7BXo0e/3fZkcwryBYSajb6KD2C8wfMl420rUdhm4OwXf2HcQty4ClX\nspa5r/XFJj8uCAgnOzA8QxHh5Rko2vWHCaXOEg8k7xd4CK5FlP468Iuako2S\nBferrgbXmVY9DrZ1hSOeeSpsRFdSVG6jKI5lbx4hpuFH60CwjwwSa3h1hy+0\nubY9vNJSSbI5/QfDz2YGFlWrro4hu3rDRWnHEAEhvJjU2LVoZOEw1PsRiUap\nO58HBKrctoQG/qh8b6JXHCd7mxpozjYrVBNuLlJKra8cAjMkcIjK2BkOfr2G\nm8gY\r\n=L3P4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAkdGIk6uESVcmYs1flRLhtihp2GP9bi0Misccava69uAiB07jxBSfwVsOzEi1/VUlFlTtY8lPyblczFUH9mwvK8aA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.58_1598437948105_0.6409429028277782"},"_hasShrinkwrap":false},"5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.0","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3df845af9da1e77b026bbe7ee36412cdb986f7f4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jDCL66srT+P2ErRL6RAii1G/ldtKw1xAQpyGtbSRrjkSmtY/FQ6NBN5vjQqn/V+cqfWYHU2V5vCkxVpjkIUBKg==","shasum":"55a1a3142ac3ea8e457de0d9ab821c66ac172069","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0.tgz","fileCount":39,"unpackedSize":198573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjpbCRA9TVsSAnZWagAAqbMP/0HauMzBu1XpwJmov+6K\nKGPCKCykqr9wrLu82/KUvlcuFSsX8IOjEf2LO3wOv5tDugrJM46NmAMrEOip\nLQDOG+bjBCqfWMHPm69ePA9tmYM3hwXCrtw+pQT9GeI7trK5z0tL4YJatLtD\n8yjowLNPrj++TFG2sqbHQZJCdJyh4dhTH1Ns5zRdKGIYHLm4xTTH0tv+HNad\nwFeR3cTA85Mpqixwydsallyjb+Bq5jWjZD41dz3XPWbQtkgYu3uS6DdfiZoV\nNt4h8apml3U+Wav24d2OSLFNwnOju0ZfuhLAYWUUeNRe+D0q5gqK8g1t4N7z\nbbcV6TTnZTq+SbaBON3IytH043JGG4Moed1zEqo+Wn6cRnKQENWonVjhN4NM\n3q5V6DXBsWd7IkUgDLrnGKS+25nlixEADKEcW6AT1MmChspyQLM5skS4kBpE\ntZ5maLVPSMiqEg6xGVB02raGxuYoO+Exge+USEp0Ih30sfACEdiPs18b/9dV\nybFyokGJf3XxhcEWdxz/u0NC8DGoPIayQ2UMYPDF8JAeuZK+xFa2MzRMB8PK\nUUpQ9ivK3iw7/J2V1PwmRQs9lfSnrNBunm6ZaYU3ziHb/ckJqRY/8lG8nUSi\nW5PJIT9tNF8k49dypfzhp7x6jibBeH4TkB41JcKkOCekCeVfXXrb9T+loKNy\nlZ+x\r\n=DwEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbbqmD1EwHSSGNsmC/MVbxuYMnhHHhJgO8C7ZkrIGXHgIgBeL8ZhJFpLshX5YDwF4yRvrQwt3XExG4QXYWD4UCJaI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0_1598437978735_0.5169136602677096"},"_hasShrinkwrap":false},"5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0","gitHead":"41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Q/9YUD//TjlzuRIQ4GKO4Mo48GCm/wp17DPcUNqEqE5JwXrWSDsGeGdrhmHDsQ812cTVr+pQ8eZZseQUcV3K9w==","shasum":"bf89521569c5684a6c9098e8826b48e8c8f29898","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0.tgz","fileCount":39,"unpackedSize":198573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRojxCRA9TVsSAnZWagAA7cUP/ROuOGGN1iEpPI4c2a8z\n7KHqe0oOAuu0htajYd+Gdqr7/B+qmUuyk0riFBa74KGFqd+H/66iTw10KuSK\ns2SDOuc7/Cmwzma6E3rafsiy7/yJXlb7TLeagnl1Sfhm76/SAsxLZPBg2H45\n2ek/BwMWUqrMTenwUvkmVyOba5+lZgOPqgSXWMXQZDzU3iU31STtE2t2dIP6\nFOVLlx57+qUp4nOlFc8hfie+flA0apRcQOPJp6B3yCYLZBqNL81/y5Mgm45j\nOabDLBz956TW3cTCImQfRapvD7Nm+7cF7yJKc/SVWk/7P4S8/O+Iu0RzdXQY\nbHkBJck/vMEw45QXTfH4MY57plQeyz/JxmKy9M0zEXBumatjJFWn4/nYR0B/\nRCu4pjOm118Q1w0bjtifl3/LfiB4Gc3ghnBR5dXEcmptpvMpdSw7cM4sIXIF\nmvd1yu1NEdKlCYkJkZwhEnxEYqE9jxNqvw1sC9VjtYTwOrMgax1iAVojeJux\nDXOmtalvhKsJLCEq/bdJQiQ2HS4HC9kjKgRdEvbuiANztTLFDQ708l8cov/s\ns7zvaJbbzJnWZadFRocOKr+nJdR2fBBCeTd7tQ5OV4nJZG6+sS3h+qMF0/pL\nnnUUGN7gFomQJ4tu71U/K5NMPWjRjJSgvMo06b0BwIS3WCuwU3n3xS0a/swc\nDI+y\r\n=K6L/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbI35s1GNZ5mMfXlyLAw0wPDWNEGxn6vhoDWbTgQnQaQIhANshQ2SttZLM/SYkMCHTOhxT3a8iyU9f/MBOXYbhfAE8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0_1598458096532_0.7302304677086682"},"_hasShrinkwrap":false},"5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9fc98066c6b9b2348429fbced94c915dcdd2a24d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6rP2eTVS8DcAb9WrQgnBVvEkBgaKf+zS2ft5OLbb3BDwB1kGBvx/8Lq5NejqJBG9sc0z34eTbXoUF7ePFKXcnA==","shasum":"65398cf577c0dbc7f9c3f2039f01c18444e8776a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0.tgz","fileCount":39,"unpackedSize":198573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRomTCRA9TVsSAnZWagAAfHwQAJASTNeZOWcJyK3w76LO\nI5VlYHOP0AfzrJJIVtLJZwdKQfH/3U35CTldzVkrrSlU7l6I50ZwB/9IhYgx\nbfmL1FMlDvTh5O1Ir2n/hN//OaMQ/sozv7Ja/bcb69i4/lxxEcx3NBJcA2Ly\nvyOgV6nPfCGVvkzLpv2I0vlSf80SCMzdYkdhgSc5ZWmWfmkWaRbDYjR2MMwp\n9gs9ple60icsRFiwNOAY/h9c5BsYvP0dtyZqFFQSlovExesei7IrtK9peWIG\nhrdUbmKszq1010DqwFzBS/K6VE2vN7VX2QjyGCqGWseHW4kvpYvL96gKQPYo\nGDKN9FJs8EkzfDhf1T5YwmQFv0X9aAZP/7fu7l/ISCZjS7TbSQKZ5GkytKV+\nluaE5gVEJtKGE7TMZGpgua5PNxHfRJ3kdgo/d9iQjb1XWeBJFMHtl2sXGv2a\np92llYr7cqU3dSpoz0hgWF1dc9IrVfkm6e4bXi62HbBUL/fKMBrsCwXNW8Yg\nc1muR1tNhI87H5jfw7qKlkcHkQafL/9LyO+UZkPrMOpCur5lhxx46hsZTYCJ\nL5bfVS/xzP2NvVxzIbofEAErQaHydb+q9S7NOlIFf30FU6q70jLDCpr2jZbh\nbJCfgneiKx40qG6QYIcStK50qb56rb7o8Itxvp3QOxJJIylNIuzSUfMUfuSf\nv0SI\r\n=RDhf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjInZFrQbwz+MmNbPxofR53sMahAaui7CLQJzTMzuKqAiAcDqtH0cucmLVI4RC9QibPHhkMzgE2xV5fSqTr/bGB1w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0_1598458259171_0.8899366862198916"},"_hasShrinkwrap":false},"5.0.59":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.59","gitHead":"40096d7fcc264abce29d1f5116aea0dbae2b2cdf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.59","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Aw4NsN2oY8mKSDBR6siGgPe1tBFJHRuulPJLbryk7Z1A8UI7aq+fI4ZBG0rs+kGQgrSiv75sn3im1ZPJrbtw0Q==","shasum":"1909a5eb94d54ca17b8cfe14871cdbd5e764a318","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.59.tgz","fileCount":39,"unpackedSize":198809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRomsCRA9TVsSAnZWagAAWT0P/0eVGI8vgTqd6w9hL+Kr\nAZH1wjwUrveSEEO2t3eN2Rrc6TFQFqTEqoaqT3q4Xh0xiClcxWHo+rxuYfAF\ndtsVF0Fu3SQL+gMByL05IYRSCwpPyDfiybFS+CkZgaUouLbdWl6zDZZP2Ggq\n1YZX0QDdI85Nwpv7IA+ZTxAwdv6e9f4L1I7EKJLcP3piRvZgz29mS8+hGU3e\nOKHyBbBFKVCvvE6wgwliE7fzRFOtk1zwkwcjBRpj2v4BQl1VZhONl50p9zNr\naoSqOiMXuekO5dKthcrmSgGB2eIXGFFNSagxX75QQAAsLy/QcD2oQaz8qMjE\nnwiyWlTSjluJi/rGJY2ilR7zrn0YzXfJqf48sjysG7WBkK0VUZ+vOIt0QU/l\nTGh//WrTn0av947uBExKQvpaZ2pRFCdzY7j4pbbcWJAhyKTWQd4bhkPyydPS\nq8keaGJt52yEdn6YvPofsTGdAUHN5HxmZe4l/o5cFUNmTl/hXc8xvrfkeQuL\nACS7ynoqzRxhBap+Q/4Vp5buQ9jMjXDgoFnKEEaAwolUCXa5QoXt66GB8vAD\nUUh9N68xjux6fQUczOfaqWOntJt3xDsMCzNYoKEhXj7myEs6AahJV8beQu2D\nRjzJIxdKrj0hDN2BxMh5JdJiakzxYyqTIcO9EcMoeY8JRiSSezIPFUxE/TLx\nxLtP\r\n=mf3N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtbcDqZjQpQcbtc479Vvd1xm88rcbvL5YVuGw8bq7EaAiEAxa2QORlAdfgEmZPePc5CdW9+CFqEXrE0feXSHNIaKNI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.59_1598458283606_0.22750832361360507"},"_hasShrinkwrap":false},"5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.0","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"40096d7fcc264abce29d1f5116aea0dbae2b2cdf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-I74RgzjwBM9jIOm6H/b4I431227pNcl2H9pJyBGvqrrX8oRfAE16BNhD2+Y5jnQZWRcZ/1ph4y3W5ZUWzu+AFQ==","shasum":"e2356bb40088f4ac8620b32a3272677a9c6a0e42","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0.tgz","fileCount":39,"unpackedSize":198852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRonMCRA9TVsSAnZWagAArBYP/i1O2iUx6NKpy8V+uONJ\nw2FyRCPa60ovdtK91mnBfCW1HrMp2BD5aCUGkAkJygTgkHWb7X36R83cHKEH\n5JkeytkGUFzEl2MqXOa3E6koZGy94idA6xNjc4KgeCIt+rHeFCKNri9FkR+5\nYMfW+OYOyAk1zp5JnfYe9Wrw85QDGKNAbG/i4nD01uo0dKVXdj7vSg9/SaQR\nxrK9M53/cBMhjuZMbJ0G2cm0AwSZYbrubZUdDSwo5LZq3lNJr6QJP45rkG+g\nxWXlBX9OOz+VllW3WFUgOc8oCCmw/p7X8lcax8XGjAHylSYEOKXbb8NDm4rT\nnU4Z+0/C/zkx/pJjzA1OuGMITXNE5AxDV9zYEAE20rK2CjdrcQuhAVN+hg4O\nxj+ziXyrSkqhHw77wwhishWrAjxp27AhcAnRRGyEpESOnB9x+ljMC7ASCXrY\nLIpoaxl4YMv8Q/cJFG3hCrCa9ajnnerYarF3qlaSmlfjEnsGBxP8/NfidZxI\naf4o+wrUw+V++MuN91HK+qjmry/l+FZ1coVll9DZipPK+osCnE8qdZNiQLok\nsDicRzJqcnJY60yKLiBmIqEgLrRggAqKjgMRRqp5n+qEsJdW2PkbqwiTstCC\nwCwiFkc6oWzWPhYtFVOIhjIeCJAWKH/ZBh0xNj4I86cybrLk3Ejj17zfhZsU\nDD0L\r\n=s/+d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwByWZNLsmcxZC7cgEl9Mcr6Qiz8HTwvZGJO8KMjn7RAiADP4/s2FnM/5b52TgvBG+NPduHnodBoWQe//1Ti85xGw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0_1598458316106_0.11059119174243359"},"_hasShrinkwrap":false},"5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0","gitHead":"e6ee0d3642f07556678c1ed8e000585c6fef387c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-O2+DoPujn5RwTjs7dkou4cESUWERwzX9lG1yg9bwS0H+1CEPc8RAmBN8oXgHj74eZ+W9WT9trzEZwcbH7CucRQ==","shasum":"69d73d9f372871867f84a1ef63d8abca2d98beb2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0.tgz","fileCount":39,"unpackedSize":198852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRzZyCRA9TVsSAnZWagAASugP/jh9kJpGp+o5O5ypbDjI\njX3B0XbW6aYJK0xS+CxQ4JOFVWXTOl8YgubCFZerDVUwHh9c9O9MzpxgkIPA\nCHRt0S5X9Ik1pH1g2rA9UxNbmsjoi10lEVDT9Y82j0g474IihaxRDiLDpd8v\nngPy6FPOLV2GNz9mblD3vIpteAgOkD7N1dwZHvBbzf5wfRzSQbxaY+cT5kmp\nSFSSprpzgLzt7NrG5rrz9PIF9MWgRJhLGbTTTAI5PTrDcBQCfVnz8l4eLffg\nR7rhiPAM6rgk+xVARhFDz9aFs4WXgUZnsIBJFJC+zADGxfErU4Z/LEZlFPJG\nCYf7myddkzRajjYgIrRqniPbA8dIQ/U0e/iZkTKU2Pp0EYz1S4x/qYRB0Xxa\nXVBHg4AOmxKNpsgmzHYsrIDQKx6RQwsOiblJ6P4/nWqFL6qbJ1OpM4E6rBAC\ngevVuafu+mFckndnSV3Yfi2/XMmnVadDOMb+9hVLhWr7gC//sKP6rdz8VG6o\n3FV9u+mQlAvRobKmRZwZYfqJo1OI8pqCxD00KbwGxmn4HJdTWxavk6ulOkZm\nUpiAYyvMS85AIAUAjqS2gMlhHeyzUqU1GNrDMBB2RG62dNAlCEK3S0RycZSU\nQWS3wVs5iXBB12yQggF35JCfLJpTgqaF/1QQnb5AM+wsQfa0yiw6WwNspwgW\niswl\r\n=OvOi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8Q1J/Ivzr1UvT39ETrl+Vs9XkHjyiQbuozogaPPmL4AiEAgcAeSbXl/gTmasF+gR3hd47BtQ5xKz4ZsOZew57Zia8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0_1598502513869_0.5571643587883857"},"_hasShrinkwrap":false},"5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fe43bbf26e47cef7f63cd3c7e326b56419e48449","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-p+JmryHfqc4A1uVEp7Lv3obmNesMe9qVAd1ZD66Lnr4DWrjb32t7ZkAoEHoQSNgHcwrcdxcrNFh8QrCEI3mnFw==","shasum":"dd033a22be65d79e9d5d42ff7d74edeee9c88906","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0.tgz","fileCount":39,"unpackedSize":198852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRzbFCRA9TVsSAnZWagAAqHcP/0RLvEFC/VIH8xqIvV9Z\nrc9l9Lw1bipPyfzKMcpoSuVHJiXtBS0cvj5yKbAbv8vMAdaWhs8C857buZEv\n1QdWxwuwfkJ37FmMmL+OhCrBH4MU5fWZ9QWr87OL4FqaOKnkg9FL5ZZiWIg8\nOrKMdAaQ8Aq1GqvVEPEfblCo95HYlJOxhs2wWo1aT0IwIeznVofbn0AXuz+r\nSEJU+4Sd/M7ayXAqurGvDRsYsI9JEZQG5clVDgnWzhkRFb1ajTKSSGMLdsQa\nZ0YlO6WOKBO6GFycNUr9FLo0XygqI8LCxi3iSAj3dbx61ti0Mi1EmxPFnXtd\ndHdlTY/nTfmUyh8Q3EeDXuwHM6r8++d6eobMSs70opcIRc+cQlZXnniZkRqs\nR47lPhbCbqQ4hUzsjLeACPttElOAI0gWr8+ulXDSC7zTHmqIuC+yF51fUtlE\nfLhOHRLZahUpjBLW4dDPYiHsIAsGtPZD0opdPWpZEATMAc6v54W/uG94LC8B\n1b6ltetuLDQrNZPpX9r7YXvHORoXAwnjnDv/CKPZiFOx2LY1hDyON5gFuIXP\nMbwQcG/Ki4sDROaRTd+RYIUQUACR27DicC/xeWP+R/+TrBekBZN46qrz8fYu\nPM06LWIwz2QUYGSsZKPHLRssKdAKa883MZCHCHMc/qKQ1SwKP4TXj2GcAMFJ\n4yT8\r\n=RrcM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbfTB+a72rhOT5dCdttwLMxJq93WhKzhK5cOkRjo/BUAIgbyJ5kfWPLwm0fpFKsBdy8boYP7RxIj5lLTjAyqcQ5/U="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0_1598502596877_0.7534361659297786"},"_hasShrinkwrap":false},"5.0.60":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.60","gitHead":"68c2e609c1f463741725e8b6509329fe0b66efe7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.60","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IwEZr86PcviFBOhKiAXuutf5RuQzDAuYEji+EdoGB/vRCTg+v99rLTadC2VKrb+tqu+fvvkFcXms3tNrbG+2EQ==","shasum":"640fdd09fc06d61808d00f354c79f04ddb72dc10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.60.tgz","fileCount":39,"unpackedSize":199086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRzbbCRA9TVsSAnZWagAAooAQAJGnoI+GLrtSHXwIdZOf\neI6vGYSOdDZ4CeELb5expU2iW+RugM8XCQcUNflKc/wNZZE95DgcfDBev/+q\nTU9/bfM93MWNXjBB26eVLUEXnDZLQ37+av5FqSWLScOcVwUheSW0bhWmynIU\nDvvIb8KduEAhZ8EzfUrtbEOwJ3H3GiSYNp59OUfAdKdAxs82eJSViMC8lbca\n7nAk7hMQY3mATN8szX5rl+671jhdGdagduwaZghvgsZoKVbey5p+oWcg7Gde\n2GUP3bir8HMp5sUz1HOk2/ZMeeb/uFhlnHqCbFrwGOfbOnHDs+vKoI/e2aqk\nVhEtI41x0UKT5MEQmXctPoB/i9KzRWkmJwXAlyoVif1qD/aw9nlYHRGX6r8Q\nL56wEBJjXe9JVXEKAFELQmw7VUM2YPhhSY7si7Mp/6e4jSBxI3UHZZV8/qGC\nr1mKN5P94jYpukSawDeXOWBENtjxiHIbov9YlPfOSIbkt2c+DlR7ebv5xqx5\nZ30LqsMXkaDMngHskpwkgHqRvI7WlwJLXgxPs2j7BY3h5v5Vdo9anNmDgFsB\n4Kq9izZwWpJ6G/rMZkZzNTQb9FPG2hJa9FyXUv1WiiUV/Q1SyHrHsXdjtv0L\nI/QTYEbli6Gzj/dNOHfgmVz7fJIYkvdjnKXaKqq1Q9z/1F/A4/Oeo150L9Hd\ne8Wc\r\n=ZND5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwF2EllxeHcBxnT0ylaHD6PixRkz/ykm5RR55TUiJu8AiEAniUcwsLr4BVJ9a5jcCGRg6wD8mYmzOt08in7uPucvME="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.60_1598502618458_0.8036155875059465"},"_hasShrinkwrap":false},"5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.2.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"68c2e609c1f463741725e8b6509329fe0b66efe7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-/I+dbsIRsyiFbWk42pX947nUDtJt3XGa4TCZ/FKrnDxxEP6HgFus+GnxMR4hbMIrvdFbijebi7pGVasomTZx8Q==","shasum":"b09b2c72b8ce27fe4ac0f01d77d576838a9ad425","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0.tgz","fileCount":39,"unpackedSize":199129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRzcLCRA9TVsSAnZWagAAHgYQAIS55Xe0V7yyGkDff8r3\nkvaVTuuYHaYmVP4/mmo+lNxp6/crwuRmPlBC32i0xhpiH08S8TOEPOuWXRLq\naqw+xGgAeA6tGRSq22w4m8hcbt8gxAawjaF8L6LSDZT7Nfrj8dC+upCoIv6+\nF/Jofe+1+ZxPzVfdETIxpvv4u7ICb+HnO9QL991aKiX6p0TIdDorSIQjnknG\nwzFbFfXFEr39dR2fFOxT6Yf0pRdKy1skTsxQMnIfc3r0rE33NSQH4N7WC0N/\nu1KqYC6UUjs1zzkGUz68Iv+qa3UxY8J04ui7v5g2mmti7E1z3z0AjTtIh6Zm\nono1w2NN6+zcZ39R8dadKvtwKzXLV5CmeOlxyKwRduwzUwPjG0K1o2JZVxev\n2PEEp2VVo2S+lBko/IBrZPr/+3Kv+pzJI8giC3BWmuv7yvEl1UU97S1UA8Iq\no1AJo6CTqaxriN7Jqa2OvMypTp/Mu7XGBBPP/YtwTLNVC6bLNHL4GCNI2woJ\nvdjJL/0eJSGRweARj5zYi7puZDN/IY3rTQPvotEcgZ04z9tNbLxAe5bQWHPl\nByznTFSKbqHyDIHRZDf0X/lBOnXyprPi1GJFHbEL21oxQ03Id6rXYRQLwi2+\nOEGlcrPWLhu3VphzOhMUXLZDDkLAtT2cwW/oeP1mC8RNBSCP8iiFqA94fLvi\nPGgV\r\n=JRuT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3oNFiU3eMepWOpQpfnbj9iurJAECO9BlwqW7UVg00/wIhAOrvqelKjc9prDV23P8CzqjXU0V4F4+a0eGL0GfgimNj"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0_1598502662175_0.35313247876970033"},"_hasShrinkwrap":false},"5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0","gitHead":"e8413c72da444eebaaf1a68cc30954ea0f15d173","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-nHb2fn1qXlrrjtKV6rTg9XCgh+0zMLEwOmOycVNudKilXUHQS4vQF9T72qfwkQFN+cFiOUSZbjDXyxHkh4xqIQ==","shasum":"72cef66311d63a9174fe3c423a361ac493e9c6bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0.tgz","fileCount":39,"unpackedSize":199129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR012CRA9TVsSAnZWagAAJn4QAKSPstO9ZG373ImQYcQz\nLX41mf1yLoF/FsOqcpmMvDjT1cCIQOJUfYq1nChp2t69bCaBXNh3aYVWMWJi\nv41ld756BJIlTs7WxNPpMVrmHZLDh5MPbxMV/D44lmwXRsVlR2CdTWnw+J7b\nPYMuaZ7YAKVvcpkFY7xAK5no3/TpocgdQOPy7Lw4aUz/dsqoe8OodLcuFQPK\n6bB78OoRPATIxV5dQtqu/CbxHGLcGWa6y/RA9f569AXGAm/RYnkTSRgfXeWL\nuJZf+9DXFvQHleZgDBQZzsXcdNGIHN/3oc0kjSbJSq2hAqmRh4Yqzm/k0/hd\nKVWOcCpN97uPF8Pwhl9gQTvd9ItNQqARcw18scFpLXpOsA3KD3PwjRQ1/XPz\nU9+slDLotk0drcK0ycjJ7iiU0H0+5Oe4MyHnKBp+CykoNALRJkVacu3Zcsml\nQBbZryyB4Tik5SZEbJgxpvwWk3N477EpZIXlqgtQvLlPG7Dao+h6y0RUR+lL\ndS2ResKtV8plRw4vAqgIDbXO8N9/dZvRnI4eRnlsetkS6ZqVgIRavAGUW3rB\nkhw+zy/g4GWI2TWGsjTuCODjm4cvMAr8lRLRvkQyjbmIsW+vYkA8UVA/dKuc\nDVf9bwRUDxYvcxFuJWprReY2OC2Iw6QDFtW7eqQQzfsgnQp5mzsuQs9NtR+8\nlWrg\r\n=cJrV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbsXUeZcQhf0OL0UQfrSqnfT3e+WDjzheDlAEH8+i5sAiEA/8Nih4df/iNkWWy8GIeJmoQO2eQNFiLYGBdbDn1LGvY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0_1598508406343_0.6619423171642049"},"_hasShrinkwrap":false},"5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"41dc08394f1a6ef1927b8a88d8c49f769f8b399f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3p8rRyO9N606hpBBpwB65gcKqEt4h9A/EkB8Q1DIubDoUgatMiXSgVKVHUFEMsVd7oz+x+G6cUE1EQ5HQcYBtA==","shasum":"400a6ef345b7ce9bb6bcbf41eaa8b625b1dc2bc9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0.tgz","fileCount":39,"unpackedSize":199129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR03WCRA9TVsSAnZWagAAUAEQAKRLhiffAuqsk5fv4Qfs\nUX19D+v4SrJG7D5PDBco+WJ7IN9ui80nDB1jIvMF7LAbwtpik0ZFi592rqc6\n6hw3I6dQJUtevOmPbpsZt+fSS6EPTAa6ydm5+eGVbi/yi5MWPvG14QykimQ2\nJ8hlGtIpvV0pvC8nn0j40boNt1FYcIQ80AWSpOFRcgoxmrVQMieUCJR9pa+l\nZv23APWQRJgUvTDd5ZZZVsd6fobJhtlTY8nG+P0EJT4CdNJwiuteN1iWEj+0\nd3jp28B/or157bVxf6pwjvRyCiPa3O/sxtAWQi+YuPaqYuMBPVZNRevL/bjt\nn3AhTmMZoHvdjLZpESxD7Soi54aDDJTTHaLFpXPlqbfvDpJI4Csw9CzXlxdM\nxAK2ygekmIUIfXedJ68CbWTYsdIj68jVHh/+nN0AVJxP3yEyI1ZT0+Ib0d/q\nExlT7EJAH8QoBTpRPYDYBzuv8z4sRkjkp00hCc4QgTKRgw1voK97yEaUz1au\n6Vo9DUqx1DGDjKcDi0XEdQ/FLIhIMMHHua5NLkQX9DiEMOkOkDZlprM72+Jk\nDBQcH2ExYXGF5mrf2nxFVX2k7vF12JrWJppn3yHe7wS6/N2Isjff6ebgftAg\n3jZae4wksatwqO/zUO7RtvPahXhFsMz48vruHhldmlEbp/nYSo9r8CLV15pL\ntEtI\r\n=LSXj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEESHidMhXIKzJ+JR7fhk2VrFcrw2JfcAZLQxztvH7wTAiEAk71w6NDO1MGJyiD88bGmxpuDYW266GWEUYC7u+ln29Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0_1598508501700_0.9603242805290411"},"_hasShrinkwrap":false},"5.0.61":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.61","gitHead":"889731c9671eeef2cf0ef3bcde11ba2c0a989b4b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.61","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-/b/N7X5JDFLTNWu3hCayk6xRlvKiBt18oslcSvbfJOnnsWg9CnFWwOM65LnWcOf6HSd4oBxDOQVoNXe8o30ZwQ==","shasum":"9507e033f35c22079c45db47203408e8a9f0397c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.61.tgz","fileCount":39,"unpackedSize":199364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR04MCRA9TVsSAnZWagAACy0P/0++W8zC9MpOxhvqurSL\nrlUsV8UY+hhcVcM06jMO7aY9ohfNpwzUlXituDUg9mZ5GmcWd/j7Ap5E/FyD\nxu10bt/1PIn4Gc2+GpdrseTywIvJhyPwN580zT/iMI2VUFF+lgGVJC3ILge3\nQk74llGWmHdT6YCS+g0eGkMbpiN437c4gLChnXqLcuiS/mZsJeFVj9R8Rk2o\n+So/mUBpr7ObynWXJx2R5UkbcDwnRWrd68tGrckdZeF0N/ZUjtOLXyJPnEDH\n3zkwaku649MMXjMumlwAph6pYOWUaF2jQwQuJK+DZ7UgZAASHynLKd9rvYzq\nm9lsAabc13WREU0I2q7t9bh9Gku9ZJLBIsDdCl/JOd71Jgz4lQE4PGo99PGB\nqOqPFlOva7BebShjegebduZ5yMABptsh6jw1tP+EWvpmjVL/nGXQYw/SCQg4\nZErWFqN46qw60VG5SVNac+IOLXKldBF0Y05WYbnOhpzcAaqP7Idc6Vez6fy3\nXWXTlr0ogU+EJFpx+bvWTN4mX2bWCsiobzrr1kmqqCpQIMWs9KinvYWLpHXb\nCO+eap7FHJAHEcnqBmNeQTcY0mk+KN1Rw5Gmywvd7CxsM7PtNYjEytppU45U\nKtl4E3xlCKjaAeXnkUvyYNI+qXZdxEUzdvBYBSD38hxNB7UWNXGv2DKFEqlg\nOB/K\r\n=DZt1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGp8XM5gH1WtB7CdHTw1C55Pw+L6/SxVesGlXIzNX/0iAiBcophejiywjN3WL0K3x13k82zGYhfiT/F1ndVXFGLs/A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.61_1598508555696_0.1923224294041539"},"_hasShrinkwrap":false},"5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"889731c9671eeef2cf0ef3bcde11ba2c0a989b4b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-SBirV9OMzvS8cE9BLnDeC0Zd4BU/2H/tNLl+L9lxA2oUPvKtXJLA6ZX9xNJr0Birn2Gtq7gwsbmHI9vt4S0JMg==","shasum":"593583e920156ca55fd0c375fe8e315f632d5848","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0.tgz","fileCount":39,"unpackedSize":199407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR043CRA9TVsSAnZWagAAgBEQAJVVyJ8G7pZwrA4FY8Iw\nYgMtw4UTPdHMRIN/ugcEjEq/HCQsaOWTjye+pkzFTRlLOABJU7MSSFTO+WCm\nSNHrTRIcEheRhEO8nPD90xuyDoTl3kHpeltGpWIvUSMF3bOxvzcNoptsBw8K\ncngnOoCVKdotvGd+7hEa8QDNgAehpBhLqGAE4m+ySMreEU0rVaF6gfAqeKGt\ncLKDfjGM1grbh42bixXCqdqoKlwvkFNh2InXz1V7fElCEHqpr6xLyqXLgO/g\neZbDez5iuQ4niyMTfgyqfW9f+gDzqxx4gdijSVrKo0H/M9p+GzAwtWGMoqK2\nDNSSsZ+hthT3hD6wr6aY0iKaG4kwd17oCRFg7tpVtnltCitH01o467iQWi1W\ni/K6F5trhxsYnMMyPUsx4My/OBQ6n+gC0d4tFoGWF4xNz9fcYaCr5yk/R7Qd\n/5Ed/tLH/L8RnWhpdMOJFowCoShJKA17Jtz/7aXProahxd/XXKDU/c2GGoh4\nWh3LWFcwOFOnZsStXIBnywd1FeIPplW+hIGrbwKk8NWaoJlxhaihrVCav4DC\nD8jiaW9u/5QEX1l9fL++ekWJMsWsJmwm2SjRG3e0nns21E6S+0vJE4aQ9/27\nJBGZVWU8N0SPgkbLzNeNZU0c8Ro3m1erpVjcMxsZ1CkvFpcPRyN4rXVPLLmD\n46dM\r\n=/7LG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwuBX6Lr420s0D4ngRdOscfKq9J7oQLqDrLWPN5+hKdQIgcZgLgDDPLe8alFtDBQQ7mTOi/QMfn8YjZLu9aciL6xY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0_1598508598685_0.5984299829787045"},"_hasShrinkwrap":false},"5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0","gitHead":"fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IgPxzy/XQImw3rMmJMkSOgiLb5HQel4HQZXWIVNUiLS2+e/gdh65gnBRi5tqJiR0S48h4Co9YPTUnlw/J0PBEQ==","shasum":"9792983af8b23b5738c6ae0da1c285e44ee65c02","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0.tgz","fileCount":39,"unpackedSize":199410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR1lqCRA9TVsSAnZWagAAa3UP/2GGBpj2QAXub3ykSz+0\nR96mMKhSKw5CakS0I99JOAQyP78DqsgN8bkUKFWyza2ecdXPnARu9nAVDAYr\nvG4pVqd+SoQXCvmhskyl1VUJ24FKXAPzOCKNG7vG8xCdgKs17NK4R5PgEBaE\nGjMJGMqtYtIOUbduK3KkHY9ZMVVgeaLsLXfungzBLH6plqHUwk4BRGTYsP5a\nh0d65ERV1G6DOWW9Ia+yTv0+bHGqnNL5PW2fLn6raG4gxb79itQBWaNWmM7g\nR1SxpnIUQYo5YWxasEYXQlyLar4qD905Q7Dw49c2IPyiD8csjNfahJAGv463\nxpCL5fAauRwhWJDQ7LzM62747owZarVBc8l6sV3BEIrNHpbVA7r3NZHVosva\nVI5geGnXE8OBtlr8M7kxmcEqq94Njed44DVw6zwpnVLdgyZvLsiGrh6C9hrY\nV8qfPACscfj5jwutM7Z39FjH/STyM/6S7egFIruR6rzzB7zebe3wP/dDlgp7\ngjA9S8c9aWvq/94v0BppwSyHc4ohvYUmE7VlIWQbH+voO98D33B5YK7UrHs/\n1HCvN0aeJDcB1AK6rkw9L5A45+Gcvlt13XYChPr0afTt55b2ovGIquC43SlA\ntM/xie3zBsczzSPCbGQJuwf3tLItCSa28kWzHgRHITjKlhogkJJmyDvUobYf\n9ii4\r\n=txHk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlbRmS+v/h3UdrEcKMH4DdaJ/IrRykJEHygUjr5U94+AIhAObC8YTzeAVvyMYiqRO0pG45gae+zFjk3WLBRy80Vnrv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0_1598511465909_0.3710573924688769"},"_hasShrinkwrap":false},"5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0","gitHead":"646286829134e19c5627adcd5809cabf488dcb61","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-MzBZe7UWYK4F9KHaZY3OjOFZYtcOyUs+5oAs+JuVeVkF417w3LgihYEB++5Sa8y52uYdqcI5m5FwrtlwfxkXAg==","shasum":"0a664972e932c5bce40d953e3393e5a7ecd1fc22","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0.tgz","fileCount":39,"unpackedSize":200836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSKPVCRA9TVsSAnZWagAAbJYQAI1e4Wxj861aZ1SAXVPX\nQqJx9on5+T0xynL2k17heVktQMQ+ibEI6gu6uYw8hNcXTbR1xRGVVtSgnTgs\niXD/iVz9p9aa1HXU+EcRUTksXXzn5K5vtgowxEObTKvV41H287JiZIjmY7kv\nczCiUMN9Kt0I0WNXT/tQlQ+34vMz/ufjzOuMaVxo9Xp24o/R0XydtpdzSAOg\nxEZG3DhqD9XtUXlILVrR0shYjiioRxt25FJZPt40vEH2dVvWtGGXhKqNZgA7\n7vWqnIyhjXOPHui1KPdMaZSVKrwL+cl6jNB1uU8hGtlC18reckOKZzi8XAzQ\n22LNXQIK2x9XnxVJYxBErnWZ1DBmq+45zYKo9cPMIweh2MFzaLNH0Yr8vAFs\nuOplIL2fHfbMaoF85VwghD//btu4vVuWKGhju+mWPJCGBYwMPu/0abUfxHGN\n0gr0P1Zp+gGFGX9liiYMGfWXNY7SBtMpr/TnhqdjbanpGugPAyYOLJYGCQcH\ngFpCVGQwHUUMz40+cPMGl8kbvEyKpA1YNCWsMC9FaPkxkJ+cjwniEFa82C/u\nBgJojj+VZuJys4QbMH/lJwb3Ui2aCEgGh+V2X9BTNdBVE7iEeuMYoCwew//H\nTCmIFzjNSwylXKAomUos8HlhHHJIb8qaPVm/BeRqEcZlshd4dx2JDB3SF8YG\nHuoN\r\n=VCGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD54Pct0QR91VSNUH48SOrQBOuaOQCc8Lw/7LJ966dcygIhAI+XLe1o+Kp0lGn1Y5mLzURsZK57QFsxu3knpjXGCt47"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0_1598596053133_0.1661628956193284"},"_hasShrinkwrap":false},"5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"15ddd3f565f453c73431b32f5b33a93e5fdcc7b3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jIJaCjq+H5jb18OMG5D+R1HOzzfOntfbn58mIhjYnUGBPbWzHTPKBZlW3gU5r5WSYaX5Q7QFEv1yz8fT9Xsn5A==","shasum":"c2039f9985259380dc495bfbc76f32073bb0ffbd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0.tgz","fileCount":39,"unpackedSize":200836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSLy3CRA9TVsSAnZWagAA1KkP/Rk8Urabq2GJnRF0CIHO\nI9EKBpQLvd/8T5LewL+wyb3iKf5Ncvhb+Bcg0vMNDVYor/NAG+iVtYvAfTfn\nZ3suMoFtUkM8NB6Ib3FpdMtNC/iVxa9/Ve5LlMrFVIaqkSXkJtkjJui5KtRc\nDB3cxRlhlYGUJ5v6kO9Dd15Hz0zlZEisCTQh9B5EqKHlNJN3O2Yxj6llRU64\n3F2BSJ7krf4kcL8pWjkqx/d3GIk1kL5yJ8sdQt2GpJv0yntu2WAnr1flPK2i\nu6MY/iMMpUzsde6RdhiPfDkMvxRIzIs3g/jl9aK5pt74qYLUCwDYY1QjYHzX\njwgOxty+9yBoSvAwR38XFqXDTzdkanOM4ibMf59IvGz50pAQjqVV3pJNVFUN\nmjqhC3IGDfbLU45ifS507ulCXv3f/KpM1wHdlJ/iNznLFt9fMbIlrZF8uEIY\nHsgmwX9LvEulCMr6Q8Sapk3GdI0y/Jfgw+YatsjbUae7HhDo1Xpp4BnhGKK+\n7YrABaduWmZzCJJZEhnQKjGGA/RWSg/xww2W4TgcRYQobe0ccxUXQOvU4oaA\nJmxzkrqmPkFWE2i7s6GR1ydY8BJRypMuVrDMz6YjGht7Xt+2IrpGhXn8Jp1S\n40+XbjgfX0AcGWj26lVZ8/MqhZC3qpiUxyXURl78vo1/sGDjpOO8BW2f/wjo\nKo09\r\n=9A5R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQd+B1oJCAT5uVyRJthMDGhuxJJ47KyB5N7JWPzIeUHAiATPrrMWNZ4cgGjgxDol3kbjpjsc4Dk56YTego9uxi3SQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0_1598602423306_0.8421047074539085"},"_hasShrinkwrap":false},"5.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.0","gitHead":"295514e51439c4f677cf22148ab85d306aa824f1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-JkPn4dxXhMfLNh9gWec0pt1ubhA+Z6qyZyE9bGnUnJwXTUeDbm89m3d1wleg9xpZBWwjPPwQoBP671pOO6RzCg==","shasum":"5b9220d840a96cab350ce51ff7efc3abff236a0e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.0.tgz","fileCount":39,"unpackedSize":201065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSLzaCRA9TVsSAnZWagAAazEP/jAacqBbHyqQdpkjcaar\n70KUa9QqVDE4dQbflBaez95KOynzq+olzW9YNAhBSRm17PG7qyq823ATJZZ3\nJJlvCgCw1TC3RdA9whuvfUenDBz5UI6VoX9rVKEKI4YEFzLjNNTQOzzSmL30\nyPhDhjxU10jTETwlVRLCM5Z4iGHkLCly0seQRIjilO9uTVZTSEKo8ZVbC3ms\nMlgUYvi7b0/pVitthJpwrP/jrkMC2XAHyagNcnR8bLvS1C9nof7d2ecDSahX\nSWZIIWKwJZsZnC+Qoyt2YROqTkJFSwnnegDqPoavsZmMWRAMXf4HJfjD/PEY\nHhSqloYhM78Hq1PWn3AP+C/bUGRnp0F9lalirlXtslj17LCX99qLSJzA0ETh\nWf09Cr1jTWAOICCp+lXpoTM/lq0e8gGUPA9o9dHksLpB3KogMFaWpk41VFKi\n2W5W8CimnrbXOUYIjnJ/l747BYsDA+4aG9jUcESsye1tbhX3Kcb5HCJCin86\nWWY5SggP0c8GF2qqnMfRoHV4cV0ydFw+o0LpmPRhMPLeyMz4EgSPEc3Jofh/\n4uyejdenSmpeFVTeO7mXLYltXzR5NwhNSSi9nQy+XCZEw0L8AzisTBORSzpt\nZ5gIEpcLS7NZCwaPdMuUwqdoGXSBV30+MOvqA1f7/A2tOgUdhNw+EGlW33ZN\nFujV\r\n=DdpZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWtb7Rz3Oymmqz+a3kRpOyt5WrwXuRqtjvjbMWJoPoUAiEA3Ae61seE/osxkIJxHQ/UymMs0l7B2p3seJOehYsJMfM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.0_1598602458382_0.3924467726278906"},"_hasShrinkwrap":false},"5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"295514e51439c4f677cf22148ab85d306aa824f1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qK7I+aMdoNsMPJgc+97IqCD3Shzf21Z8u9Zy01DWa6qjRM69jVcy/WsWRcPk2+bhSRuCbGKXoCswy49D9kulcQ==","shasum":"4dcb546a9d186c272828d827a79c907729ed787a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0.tgz","fileCount":39,"unpackedSize":201108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSLzzCRA9TVsSAnZWagAAt6gP/jjgEWw3H3ZBESC2to8X\nNElVVLByrqU9jRNuzR9dCEclEcCRuZeqB0t3kJUzxaeDN/yyovPWDKdOCeyC\nuX6tTCsea9bWnOyJH/H54clR/L5VVlKde+j24EFrs89pgCwDY+A2cLmeOAgb\nzd2XnubOXv5rakHDMaihsTQG4YdyMSJG8/UTxzYAP0QxSUEnMIDHLxTluypR\nHZ/3OsUJ/kzDp5UhCB9+FaHSXhufmE23zU8SS/qX2YpocCQXKiAKdM6xKGC+\n0Ho/VjOrBFaXenzAz9YWZj3NQ1q54OHG3Ip/3CiKJmOczcM1tkmbxlqPjSC8\noCPH1PNdC0QxbSjTTV88RTMmfQES37B7G29vK/JZJpwi+y4yie3bSSgDY0op\n7LhWhiBAtMfkE/9nXVzLjIEL2TlWCJURbXnxM87QF83r/LwWbyUMVE6SwrP7\nuDdplYLDXV7GWVLWP0GzkrdQdyLd124cxg1nUe+Tqq9fLQqtwQZA/VFSGJRN\nXjdf+aBt7vl1zpw68a+zOl3awUvJzL6zVf5cnf7LrRnMTpLKhrtbgE+OEAGH\nb7i19NNqb5o8frU2mK9P9RwPcbPsYFR2dM22hthSAe4ql76iW61nnhKDInAV\nr0VtbbT519skcSPvbbUKz8Q9wRNgfnk5tbTq58c0fST+grlug97jkAD3KorD\nCLAw\r\n=aGGk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZGg8B/QrCezLh0xYhlxpP1RpVPlDgJprOF5Pyyui6igIgbohhbEuZcYU+hxBOuR2KfqtLmbNuoJFREfMTF8DuJUg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0_1598602483371_0.518717278045755"},"_hasShrinkwrap":false},"5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0","gitHead":"a5165ac3e330c1dcb44754c9dec09dfd38d6434e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-hXGNrD9j+c+XhNIvFHYmOWsMDBOc2vfrySeU5dYwLfhU5/xMIIYRSS3VMjyBg628GRbMSyAelp8mLaGLr8uk1w==","shasum":"d17030a7361d3ee35e00d46a4b6285be135ff0ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0.tgz","fileCount":39,"unpackedSize":201111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSL1wCRA9TVsSAnZWagAA1o8QAI9CV+pG6R1hqPwHf5e5\nhzDo4kv9alcyaWKKsW9Lbs+38L2zdAajjAzFlGZXFEXZALzjx7Dz3lLgKmGL\ntXXIHDmY58W6YdR4uBAPYPGCjg4mhvbAJ9O3WcugeKrdo86DBFzhde/661un\nvaLRHBSRa06FYQhswA1slJuBQ2iDAqmKwGiheJSLki+tarKGvf+Nndv0nRwB\nmm7L5l2Kb+7l4yyu2brwoSZ5KOnpxtcakeucTZS0KZMTvu202Npq4MuMdRxy\ngPGQ89G7KrW81Yl+DnFXgtjq1caox4VN0FypyXPewn5iVvjgN9WGsgK+hy7p\nbO/iLgXkcwfKY9cvRAKgJTxzorWC7ivXPsdPYzCj0HwvqcgMG0DEqQ6t/oBo\n9iwdecoHoC8j/VTFER9OYXbZGOb/+h1JIsUt+CTCUY+epL332bb0J9G5O6RU\nc8GBmk6lBs+bGw0B76ltP0ZVw/GmAx1GnWMDTJFrh7YKZAMVzEiXuapYr90+\ncZtvHxArD02cGszNPTwDIU7bKSdhk/2rNfAM8Wnrt5c7d6jhWoqS1ZFTyOiM\nZBP/A8htglmbm9DnLNKtpSWcPRsJo8jdKkhoKN439/CcMlob05pbCNmx3NqV\n+zaUW8Q5xH0/StyRRabUA+/96pf5thGVU7AiwJAVsAFMyxNgIA8cPz3/XzQE\n+E3x\r\n=pUMO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfOMwKxt7JgM3dsOavTNCS3S4mSvgJ7gu/M7BhtbkOpQIhAPxjElCLEoFHxy/swlCe54yc5dtYdujYMj5zp1XwFtp3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0_1598602607717_0.16613515352201635"},"_hasShrinkwrap":false},"5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0","gitHead":"420ff66a8fa01de0de79b23619056612359d6f07","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+JXj7ioPJUUll1RuQ+gKu3MbnXSPXgKlXJqRxkahShlMgaEToMXq/4DgwtWiPtITob8MXh1L469KB1+bwlIA2w==","shasum":"3764d72cb60426ef87086694514e10c19749b63e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0.tgz","fileCount":39,"unpackedSize":201108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTB7nCRA9TVsSAnZWagAAb2oQAKMIHs4y4nmjX+sDPSAc\nHC7fF4UeZ8VbZADAnQ8qoptKpk1Oz4SBDaejkeRoBgJSkl6tf1G9GfCPItYo\n8n8ZkdInAH9haQ2RAXjO1P/BUI0mNB3ZAKiDYR8588Mbk24P4IwFDCO4AYFF\nWDZf5MlnYs8LfDgo3O6l5M/0g1ebYdDLIjPAyEZKX4c/7mHaa8nv9YQfZnXr\nTCz47FddKBJYGyF2mE0EAfzrsn8LKf2e07DTRRcI+VwIg0t3IeGCB6i63NIf\ng+uz8NJeEbcvHn/sD2KbuJzGX7f+f0n0EHGHfnE4KkI3kftqH+A7XI+b9k3P\n/nC+iqadUW8+gnpgSDi/4nw4Y0QWySUjFwdklajKWhSU1miSu3iZoMkKjVED\nVG21wpismj4Gl6iSgFe9WNmMFIWlJbg8CQQFQC4p436Nodrwojd0GzqlTPW0\nbUWt/MOYMP62U14uPJkjctp0ADfSJp717M/YB1q0hYG1TcTDZheReCcajG2w\nMeo6vNwrIorgfz3NKF+2BcKBGMnVUmGruicpHwHBI7lgQ+b7JrvienY0xjcA\nPW8vng5+oNHsGRqwkD9tHcXKBZibaeuPul1vTHpcssH4JvrnWoFpjSi2eYqB\nIwXrA8tAQGqboZFc9njf3Dqx3puGhV1YgQm6qYyxDvrKCWuQbR73kYcc34dC\njqxJ\r\n=nVrT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwx0tbmTi0caLKztDDw4sEDFwh9woYJxSt4W2N12sUlAiAo0ks+9FECHDX1HAJqOGqDuzhsnYExsuL5J50DD4J4pw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0_1598824167008_0.3219074878362822"},"_hasShrinkwrap":false},"5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9nSgD06P5Eb5foPkqIkQ+lSFS+aem720UDE0YbtB0M3KFqkjjYQoD/WTXtw6wk9ewERAJ6AGqED2KJmDriE20g==","shasum":"c4696cd3479d93e44a9552a9f49a22d94d6a06be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0.tgz","fileCount":39,"unpackedSize":201108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTB9NCRA9TVsSAnZWagAAKFgP/1XiFbRe9rMRFq12BSv3\nqObpdck8BGBLuAMroKN/r5UN6A2IVkBelCYvor6sjQTPV9MVWliI7CEu5cgJ\nnT9qJ6D9+Qkhr7Ryldawoq85hBS1QDpwDm/b8AZ6qaItXQ8OOPkqu8YxO1M5\nlO3nbKmdglaCa7suGOfwdD4WPPNX2ZSkiBdYdOESag42ItL2u3/6m6NrCGkB\n22byWhfeEoKhRD/pKAXgw6Nvk6R8eDYT8y8/nEtPZbzn2LK0U9TmnnL194Jw\nyW2lfs+r2uGSxUDgBWahV/Sp1/8JvY9dPg7g65W2I5iBw/M6mPT6Ya132Hxv\nfcW0xaHnwFanFtzWOm3kqFacx+01IuQwVJ32IE1tgZqAoocY9bw+GuinTXlC\nEM6g+HDDz3npsgKvpAb77sWp2Vi+5Xz7WqdPn3X+wsgVgoLB+99xfeSNvbZQ\n0WkQXOUeAfBt9yxVf73wpwAvNapmS1WH1ZPKNz4GQDg2gxXZLO0QwuLkbAjG\nRtpX99xzC6RvqmCDnX4WKpmoiaazqEhq/LS6lK21OVhAMn3eHjrgKIYn5ZcZ\nbkgY9z6LCGvW+aiNpEwCEoDYTNDAAZ9J5m5a7Al2oZsoR9iEybzwnHLQC7/E\nP7dRf54+BjvtCODhR5gPAYuv275nAx1QuNd6WYVTmiGmURrtSyiORc9nQfcv\nkyHa\r\n=JJIf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQqzEmTPjxijqrRCCxeCZORKgK6AIA89GsTlTKCoEfAQIgPP3wMWnK9eW2YSIAGXUl7c/JlEnYjGobtcZUwUIIfC4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0_1598824268806_0.967722625165581"},"_hasShrinkwrap":false},"5.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.1","gitHead":"606f71f58dcc74cd476cbe26f1bfb86625a04b81","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2wxWYqaYH8kbtwjB/V5rbagxbrGeumCy1lFLrEeRR9zqM2ULsE1LQiLSDfeWEAIA2zisPfDbB+J11JqAv+plnA==","shasum":"6d004b54f23dcce6941efdaa2ff481bb2ca35b76","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.1.tgz","fileCount":39,"unpackedSize":201341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTB9hCRA9TVsSAnZWagAA3cIQAITZKlaziBxxpDhRrcVP\nUxXzmSnyxpkKQjlNGtc11OzRSR0b6qPMyh/h6PP3zC2nMtvsX7Fd/pf0olIE\n17t/kuBBXuO9YDvatdZ2bLlyB/mBxaow8yS5pr1/oocTbzTFFDt5hrrhstFj\n/usGPfkoVMuTvz7FiWrLPpMf/0E5lCSqvtVmfhX3p28GxsIYVPNa96XpQgMU\nQjoDwMNF1KHS9zmW+/LsbZrt7MPQLg1QK4Y6j2TUiletuhLoNM1WiN9ILCL2\nmvJAsEi7+iCnmlyUMDPu4vcR/wP43ksQmgEQSwZOSWB3OMdAue1/Yg7VSNdZ\nrkQQYbAEHfRS64tI5+c99cKjGRT3GmEBPXVf/LYRRbf1SKBlh1NrXpg2iMzh\n8eU+C+QSwcxXQJyfmPC0qc3AwrcIauLgCgU7clicmS+1XstP/Iw0Xr2WEm5p\nBGgCs1NiKN+0HDdZccwcgJl3bfDrdgscFoV1xGIaYLWJPqZlseF0bmm+7SUu\nJo6X+taghwbeWf3ESMQfvYc2KsQkTmUZ+8WR1EhD2wla6yhebZCX0cmez6+X\nxwaYt6zMuN567xVimah3vs0LjAVZfv6E6qeRFJHcG7KjyGOJu1vRq6owPake\nl02vvMcjt3vqyFEdvR/zlsFn830GxXRzxjr9MRubn27UstwuGtscPJ9qYest\nOb/w\r\n=8htp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDx/0DvQ6YP0o6DJ6PIRumkQTH1k7Ii4F8ZGuShYeELAiEAoquMko1cNnl0txefTYfkI7C1tXPDda62IJJuprdK+M4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.1_1598824288936_0.350965116549238"},"_hasShrinkwrap":false},"5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"606f71f58dcc74cd476cbe26f1bfb86625a04b81","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yuI03miPXwexOqZxwx8GKWkrlX43264URG5Mto6jEl6T0yEP8Hr5m5A9GhKgg/9uPzckUxM7aPd4cpZw3Oy6TQ==","shasum":"c3046c2761122c78176f3aec8c7f195aa8f480f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0.tgz","fileCount":39,"unpackedSize":201384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTB9sCRA9TVsSAnZWagAAPbsP/0Ukl/wr5+pf0WfMTADW\npL4M8yGx/xSJDu5siOcMH/52oqJP5W2rfvhn90EtaiQiG0p2+TJfazOWvOnF\nIvoyiLMEmMcPiB/HROWZqwW/oJRzGeswwD/a9PLIzpxwS8fN9lCgkODJh21L\npxrcwegeWopKJCfYYDf4/WCItZaFa76VivOMvGEKetapQqFowPI1ZGsY3nGs\nrkyZzavRxcpiBaMUZH8zsUOhYnaDxN4A7VzsRf+WCSDDnk3FlXYxp1iYOlN5\nbDBSwWgJx2rbZnpCs2tOg/YnQhZJkOBE3feO9uqHRPGPuJJWDGehQkf/xBDz\n7DmJoiN4Xi7Lv4GXfK5fDjW64Rfp318zCC3V/PxAYeRf3xK3bPEqoIOgauLW\nvfuYUYzD9i1nfcThPOjOd7NRCx9kvLoZ5FyWXUTfa32gK2gjrqqd1vwo6tap\nU4DGmXe6RIGIBcRSihaEeQ5s+qSqurg+aknCKXypw7Xm+PHNMpGxp/ssyJid\nh+oo0GyngBNRZGE2z5oN6R2HhdC2p80xapXPgVx6bB1N88jcyhShtaKRWkxq\nryoUmtnl8kwuFwpbojKqlcKIiZh5UYIDTIHGKC3LQ7xjddM7QjUsV5CMrnBf\nyXZgJDaG2PVg99Pc4VxHoeUg3pz+PIuLmof+GMEO+zpYUUZkaOAPYXJuFKwJ\nP76j\r\n=utVL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWmOtZwaFyX+zMMFI6aG23kJ7D6e8etyF2Lbsg7NGiLwIgKGndkphKWJDPsxzSqL84na5tuP9cTjNX+Z7Bx6VjMug="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0_1598824299807_0.25689228576934897"},"_hasShrinkwrap":false},"5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0","gitHead":"2b2121dae9641e782226097b35f5c90b8f7c2fcf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8KR5uSn2STFU19y0WrTsZxitJe+4S3zWuB1kCmMVzMJrjUoBlJiwTq066DHZNm04ufe+Xs4ZQYFZogSGqXWwVA==","shasum":"22655e9cf718ea500d2ebbb19485032cb834f9cd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0.tgz","fileCount":39,"unpackedSize":201387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTB/TCRA9TVsSAnZWagAAZMMP+wRTfrky1K5gza11U734\nNhRvvucGdxtOk+ZyTRd3yz/pH9kA0ufgtDrz/SnfcwEThj6vRuDHzLdyZqPa\nEMFCelxJYcLmD7s4u55+xtRId84p3/bJH87BX25fz3gT5YIuB6dfUUsmbbdG\nvMlXrODy/gyNA9bdiO7P/SpZY4JQfpD4l0SkxS2ebKzsywni3ZlQOqUZAUJe\nc9QnyyanckUOt9wRFd7HeCI02PKqcLd+uvej5m9lcBZWMZ6lAONHHWdlDTln\nn3ER+bor7mGHsSDzQagcd7CjMWMkEbYdlL1+SK60hcZOklyemsI3JCxcfoAP\nBYAj4lTFQUi7ozRTw+DiIhfwsn/PIAG2ELMkqv6FRV3c8tA388EZNAvwnt1t\nSqjyfEBEYX3vu2J4T2RexmQkWEOwrW5iR7o0e9kzsOv6cmGJ6bF9lhx+ZKM7\nDNtypUIUnAOKxKqi1Ifmct5uh6kvcGoXvcXlKxIs1jeusPmRSPIffdEud+3+\nrhQjTjpAIQxOCTOWOr5CaPd/7F5ei67g9juhrAiIhNBfnhr72bkIgBAGSRpJ\nk+tzHNUVTKNrESj1lTSB/+W+4AK456VXTUEzalGIB9+2tsO5f+btQvp6bFtn\nl0pw9yWnBX1VFU0/xpODeBXwBxFPcJY0rQQN5E3fwhaME00n3V+RceRxHsQL\ni26/\r\n=3VL1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJ2P3jCnJpH6KrgUOtuleBKEaOSIygfJza2J9dIX8muAiAHWwZSQbVyLWW5dNQzBHAKFLlub/ORUG+0X/HyKYrkgA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0_1598824402986_0.023059649019020023"},"_hasShrinkwrap":false},"5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0","gitHead":"0c0d527525dc0979ae5b1ceca531a02fc1916e7d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KoMyJu7hTex/NPDfcnCU4VhJP/+Z6kxBIcvXfsogtxgu0GP4ivfuuYmzSbfL/E2yVj927dH6JARBD2h2Yhm8Dw==","shasum":"efbf73c87c63d186854a1f9b5d5f9304a95025cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0.tgz","fileCount":39,"unpackedSize":201384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTRc3CRA9TVsSAnZWagAAQpgQAJ7TOtphdQIvz+iobED1\nW2ZHhVwan5W3eyNoK8znUGGxN5MByZZVwnoZB5ls75qw00nYfaxY2xl6S3Gv\nzxZdHuLWkJwmuWysePyQIzwpWgZ99Hhpgvtigi+HUe6lTzzH7BJyzHswBknV\nLhgNidKdwpX4T0vbRkirDUoibjcY0B4O/03ihiouHvXUsot2FVDEW0DWV/Rw\n/f9hhf+nLALBUcZO8On8FCGJpbCU0u8NMor3rz9t751DxYpo9xzzVv3D/hKL\nXqt7JjVTd9IWd0v556bjJ0L5ZxlQ6vvwSh8QPfh2WEa3GXQzJaWNSg9PE8ql\nRzdftTP5kZ4OIPWfJedKWY0DUgKCM8zdROaToEwx31+lPQZ+KeZezS81pPd+\nGwmF6F7M2B0WHYCXoGdCjdBj37mJGC2qDvzDmnrkcETES6LdLbBXxOxM6r6c\nK6AafvwQMgUHaRSnGJjOsg8wQGcxAk5wtWQbBQbO5Io807c8dtvmanhnEe3f\ntOT4pfHnPHAJMeMloDQCdzFyr3EeoNYBPxUlt4E9gkGZ6RWOczBBWB8sfi3M\n8+pC9YoqspjfNhLu2SYaqSgMkW9ny4x3L28RVQJqqowTzfljsbyy/nIH91vt\no1YIHaafLQiYnbPFjTqPXLYQFq90NVA1YyUHPLaZXAAJgAQ5K/y0NXj1OBzq\nmMe6\r\n=220X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfmkObPhOF9O8tijjNf8D2O/LIqD4D2Lxyh4wQ4lX+3AiEA68H2IK397tfJO2aYXEp6fw3tdExVmETKK0AS/tuyqcg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0_1598887735077_0.1210918170774875"},"_hasShrinkwrap":false},"5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"134237305fa77f79d47dcd1ba58047f8efbeec1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FBk6LNee7QRJrsTeq8yRdezp16dMGbQKVRnJAOPpVVghhpZafTARulLPHi7FRE07oQKoGSOtmdA1AbxLLOpgVg==","shasum":"481158fa7a39dcce3f91dbcffb81767163ec1482","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0.tgz","fileCount":39,"unpackedSize":201384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTReNCRA9TVsSAnZWagAApfIP/1qESY1LgI/Sy4b+jMBK\ngAin9UTmATklQB8xQGQN2ix6F3uXZWGkDBPUUQMyrb9NxXo4UkC+jOIvLUEq\nimFPQYpas7hYHAhON9zKzoKkvFmoxuH7ZzJKrCev8xZBoMktLAjTx7GEesQ4\nOI6xWEFbruBx1xkCqsWXgJ8GULedL71suHQNOiwZ0KLv6OZeUBajuVR//K+5\nIUbOyt7ZH9aIHlzd6lHuKQGS6VX0Sm3tj3Q/WzTrwtm+FjbA472DyabUvW8H\nssAfDMvARWV3UGe5QOL91+MS+ROly/u4F7TFT65jL2p5SGu9BZKEllNW4JPz\nfsfrXpBJco3h1SLcDUI+APv5yImhiR3r0fZWZKudNrs6vHG2Rzn4oW39gr1R\nEpeayTJSfwkzcKA074cHHBFs9dBSc9qionaSnRY52fTDZT1mnNJgwW6lkEYr\nzF2AhUMNZdqrgKdpwTbXK1P3uyH7SxFsmJnQgp265c12etlsYAgv84jOxLyA\n6xk6GuDL46Wfjf04VFKnNLJ8FAC0oaBZtf2H/Y0uN1iFXAWdhB/Y91JH0mzr\nHYS7eGpaPS41zd8L7kXD2+j6eUc+seB67mSJ0zNRLHxt96kLwjGqpk2BhdWE\nxQJp4ngpBzYDVR31L3tWoPbVqLETHvE69Bx8ZuDSltwE7UBkgpgf41qYZCam\nCnZa\r\n=BxVG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEafxlPJl5qxuYQBIrr0fS7ZfBhrW4EQjHMOknuGypOwIgfhwvzBQRs2aM9mUmFwjagZNmcNambr1k0rg5Bz/vfE4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0_1598887821289_0.4422278060046969"},"_hasShrinkwrap":false},"5.1.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.2","gitHead":"b9876667a4df71646c02a69bbf36eed7e65946fd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jycBxJPfzU43/hwCa7j/DEmunSdVQUChmY1U64h1ivQRdvVM1d+GC9jg6hRZe61KK0JOk+WARIHzuNw3hkEpeQ==","shasum":"2d065b7e1c0d246a174956ed7c06caef57fa3b7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.2.tgz","fileCount":39,"unpackedSize":201620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTReiCRA9TVsSAnZWagAAxWgQAJpjGShMCaNuHMWvG7XD\nkeCYygBHa06NlLzE/KUvp/ga6cnjaDL1RvoHbsRVkrDoOU1uWiuDtYZuw4AZ\nnXbFVD/zkgO3RXXwjGCO6ppBhp8s5DMrPoKbzTmCP1OxhQl3JhNlKBorIUcD\nTxw+taEca2bBWCLgAIMFH5+RzfQa7cmvwhOJMRtEY05pFfZksm/aONPVDgBo\nh8VqHdHCyTC7YaIynfspmb6TXbR7txpQUZ587YRPtpaP+N3io+PBclTDCeu8\nWpKxCos+wXpVGuUR8HYc1SHoIA41neRISIXzUDtM+D9QMUnHmKu18ablMG6d\nEyd4kZmcTdDzPqP2iq0WY6hiC0/H4TBNH7spMZoAO/gUNO8AKKrJVXioebsO\nzf3evmW+1E89ELZ0n4MPsIZp8Zx9BFHW2KOFCU+ROwHlChr5Af1hor9agmm0\nvJMlBcW97GeXPQlyPzTBsF/s2GXelbXI7dsKOWmo1D0od1OgkURU/lzspoKi\nIRgMuw6+v4+Bmc4FyNVkrxx3DCEpI4Z9m8uFCg/NHrtpBlq7NYe0wPkz0o/j\nJFrJkUjeeCgMIZEgfLp2sZqNjPy1OXe4tO56atlCngkibg6+NTDpt0rXrggn\n2VVGnpl6F0VEu+ocb9N24HLCeeYf1aG/B5qdV9sKAvWaQXO1fE9cJdzQH1Qh\nKKmy\r\n=7JFZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+ZvGZSNmTUvX9p8e2C71Oe/r8dEXtpap1b+xc/B9VRAiBV0x9HZOqHJtb2ZcC6ChbMiO6TE7mFKKirhIMqIX4Dkw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.2_1598887841395_0.9916151535650757"},"_hasShrinkwrap":false},"5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b9876667a4df71646c02a69bbf36eed7e65946fd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wO6g2+GtclnQo8tjRGm69KZl9kEJgJnQkRg/H1maRVy/rjgcSOYccIeULwLeR0qmyGbmlz8y9mByM7hmfVsi6A==","shasum":"2b4e3723b24530c856aa438c8232a5aa2785e447","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0.tgz","fileCount":39,"unpackedSize":201663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTRfDCRA9TVsSAnZWagAAi3QQAI77tBUSpGOunUFTWkkV\nkUUBX2AO5Tb0ARfp32fGTpxxEwFMF+Ixx+1i7dM7p0OXLHA968SQftxnNTY5\naPUx1uFdg8rddvwK4Xn0TUs6+TcQmnQZCuxXAniAbRBaUA3Q1t97PJLxt5ks\nercRcY2d8fZry2OcE8c4e6wiJcmgAa3AX9ff25Jp4G7u08k0w8EZVWLMG4no\nZXPRAvwj7HwZcG4nUIdCOZRE+h4F4puvZloUHaO7nAa36JrZ1zc96gbKdKuD\nzXm77LOqElls/UR7qw/nNQ6cxphYe5DQEUexn4+oz+/OokNahMyj8+YL8soe\njyQfTZhfF5MZn+5M9rfoH8GhoSjqCRvksREctNBJhF3L2Xa4GOPtvDRTrgsj\ncQ89w69doFg2RLaMutSDThDCgnj+VL0lCfW39LRSMuHeRmemDKWeNOuSiw7U\njyoBdysB2sz1i0R1/jkvm1otjCvANYObiv7K/Xc3uP8GiozDEnt3RCYp43FJ\n6WEzplmpniqUqr7c3afmTN/0USFwPdb6M+FLwPj/H2JSlnNtTy1//V5dCmtm\nckr0He1qSICwz6b2Ivrwbs1Gxb3WTdPd4/6gmTnJlQKBUfAEOKqObIbZy93n\nroJ2ts0dp934+US48c8YZ6dpWjI7kGjaZdOcJSbLMe2g2/5+guGD6PJcEnzc\nJb6S\r\n=+kUT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD5f3NpD+1bsmSfboJLQQ2ZV0ROd2P24tdyX3+hLJJ1AIhAMpYYCSC9HJ5teEBwfHrPVOHeMqGTiOWR9JiPYHPmNse"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0_1598887875226_0.20780048049700128"},"_hasShrinkwrap":false},"5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.10","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0","gitHead":"185120422d3ad36fdf2bcba7d906daf8626396cd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-nGz12BEKXs2cGwDALHXKFY9M6GkK9JJkurZPsOiZpp/FVebW22DBiK8ee9SH9g16C4akZ02ZGZqn2IouGbq2JA==","shasum":"56be898b4df52f1045618566a3f1a2ceb2740ab3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0.tgz","fileCount":39,"unpackedSize":201666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTRgZCRA9TVsSAnZWagAA4VQP/2IAvCalYLUwKd9xOYsC\nmAPnwjTpgeyN9HdAbkZsCOe9ebtf4vt9IjdirtVfmMf9Z/36EFcgwb8ZPbAC\nnhI25ILsQiEyRnDCVdHIntwr3rXhytDN8eSyglwFIKEPu2Z6opqrcIrajBOO\n+6QTkzmYYaNxg903uhh/JvBu9M0cZSpJHkOxnhxRHk675NfjLfJ+o1Of+8hz\nUyReT2Yhz+f98okeOPuuVWgBuodctV05FoUZ8HCo+/FyeHvbQFMTDbOZuQxU\nXuZ9Lkcv9sKZxO146CGrZNwSXKO4BMcL/EBUmb2K0WP1lrsRgYhdSwuqnBII\nAqE+tBuV0UYV83RLfiVPPqAfVePhw7aYMtEHi+T0IY0yzKPbfiayfP+wociT\nm2w44qmBk9k6KDjyGA9FQL+PGJlwu5dAbi7xcNWVd/XUOYNU8LzidDCE7BN1\nu1BOfoVnQw1TYS9JMvKk/3T+Oln1qsLKC0UXXFixbQA/DSL1LG8I7nL2eVPw\nx9rQUgqT42dp8c6Q/I+sjje/WD7J/VoFb6KQDiYJ6Z8ZJ/PgW0iyM+VFwC3n\nv+nRHVTwQKFQFfvPQelNCUuW318JDFU7B3Ptxo/M0YtnGakX2/QsP3FLLqth\n2iLoT9cwCZLRAP+zDpdYVHsGgvBJyQ1cwGshP5V03PzKpWGz54qNzm+1dOsi\nXfIb\r\n=5jNC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSfsv9O6XgsCHYtByEMk2zaIQ/zwCaUBf9S/4amKaztAiASgiQWi0nbd55eBfs9g/0z4jd7ay+iXICG7soODEq0Bw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0_1598887960988_0.7787817137229298"},"_hasShrinkwrap":false},"5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0","gitHead":"f52aa519f483b73b0afb4c67ac3467e6411366f3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-/z7Bl/1Rz9XMx5oXFUsT/KDZMsJPsjTp63fqZqhpQNNHU3nTmArOa8MoFqOul+HScMthLnIh9pvnF0Q1pPpbGw==","shasum":"b801d6d4b19250c1f30f6688ec0ff0752db44bf7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0.tgz","fileCount":39,"unpackedSize":201663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTmbQCRA9TVsSAnZWagAAQgUP/2AUacethvhkE6rusbvg\nRPVNKuRuDVXBi7yy34xdTWtuTo/iQM+73F+QuBHaNplAtUzdV1+yBNhtUKyp\nAVl5PRjnXrt0whIz//uyHaXsL9tNeI44uOIqVH93P3eeaT332zbstUCdvfUe\nndQduhtk4CxHEudJMVziibnOSx11bKgkDMGH4sMgRytKE5iSJu2lNcN4xE0T\nbFCriUIOmIOX4yIfvnyBS8zyhkCPIcSNpoClNG/ZqEBzqREJ1JGIxO23UQ0r\nI9eYj4Z0nR0FPsVIFTzgOBeRVg5i8lhWMbwD6X9Oqv/B8J7F8tRAr7K2KjIW\nnUK1gIe/tefHmAShrW2AIfn+2g/LPfg8ySfGAg2jxQ1uHsHL8JGlv066Urid\nrAOeGuv+NQ+wUs+J6X5zpRRJsZasfBMdc81J0TzpF1klOHtUPU6m6q0Yt9Ki\nlW12HUHVUMPV/5t5iimWxngLfRKl3lFm6PlOtZ0e0f4O7CLZs6N67uf4ootK\nzJBm2VaBJLAmGfXTxbwqVkqk5TSFVzc/uy4VpBXig/s5+Gd8fryEvVydyBKa\n5nEGxUV9FT/riVDEdnPmWvDQJG3xH/bEmW2eTg35OypBHvWUkMYCZbRBN0go\nbHG0qBI3PX3/nYQQTTGdxzYYjT5kZWQmsI63q4OBlDX1cNWwa69lj2tmEevj\npv4G\r\n=7JvJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfR6ebccvq4UtXaERlVrU6pjB0qqpoEipODhwcFNGDOAiEAuNefd5zOGtzjU0OkEhtSvfv+N/01JjnN5tzxfqMadtA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0_1598973647443_0.8433407141202058"},"_hasShrinkwrap":false},"5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3f2b1742aa0609b9338bb8019de62f1534b03451","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ujE0V9HHBPiIlQLG01nh3C+aVCG9xbFMrDOsg5qi9JQdAt0Oerfe6attK6mPxiGUA7FP+n+h3j/OH/cMAL7sTw==","shasum":"d26cd07016cd63b58b516076ca8f9bd172f150f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0.tgz","fileCount":39,"unpackedSize":201663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTmcXCRA9TVsSAnZWagAAusAP/1/bnSXCqBO8lRdtZXp3\nR5c7Hk2FSi0wKVpLijQw3jBHZt9cwnH+MKLZsmsL31M85fqTwBM/G0bR7mb/\n9FnEgITOgps8zUCxU299aWtKVkIgSbAtYyRjLa0TTiL7ModqbxJaAh9Chu9G\noCGkbhAUEboiUpTGrjjvi9ebk8+WanowAZG0F0now6Cyv/aEDL0p3287jRO/\nvygKDipanMLNhV7rHwOM1jTSg7m7tgSdKSWhgNwe6b60K+PQjY0cZ90G8eRC\ncsLFB5NfG/Vy9XzpicwN8PzZwqqdehGjL5o2SjA3Tviz4gxVTZcDfOi1Jini\nzHDl48mGu2Sl7x8hoWrTHDMPrQtGYfM9YlKfH38EwrTbm1GyUts06ELlzwbb\npwrLhcH/841tgNwsVd32jdXUANFGtf1O94cGGyma4JV5X1Oy11LV0dtx+ucn\nC32J6626yA1RXO6d/1cHYEHvxb8FzN6z9Sv1Khvip64+4oUDl9XkhQsmU8m2\nlOWG07rayMRkvgq5ru+j+s2sn4uNd6fCHq1DAiZQL1f9j0+MIxFV0udlo+Ll\nxebgyW5A4/dtnYRebszcsU3RZ4mP+EVwqddmnZGyhTTDCr8Ino6VlXmMhZZZ\nOXeNOk6ynoodbtXoMgmydfaLyaEon4cJW1f0rrv0TcQjW0xCGzTHQdo0pbpJ\nTeZY\r\n=UcBa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVwyE5FHHm1C8eJy2ZhvYKqPjBLCB3GZegEvIXkaV5eAIgYwFuwzGaob+65Jk4mJn6+71hlNR67Rjmyx1AcXnewK4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0_1598973719371_0.8100779880402873"},"_hasShrinkwrap":false},"5.1.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.3","gitHead":"3f40fa62548350ae016d283974300c4b03885e0f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QvXTZn0w2+LsS8rhXH+Lc8/eIbxR746G1dKevPAauJui3eNUqGblzKF7irtBy0VviRzlRJliXAEcOdm5xV/9gQ==","shasum":"f69ecb2a6f8a05f5297547536d098984448b9713","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.3.tgz","fileCount":39,"unpackedSize":201901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTmc8CRA9TVsSAnZWagAAaI4P/jXPKOScV+ihhBZF4oZ+\nI8Rz9zU7/dtUXGsUf1EUjO1oXhOcMCmfIDDBcb9h1S9T+OQyGoN0GOtMywfq\nY9mg6qSROySUtM3vBhEe4qJU5EQ9Yz6hpZZHPPSC2lDHKnS3vngb1t/oiDw8\nWo4yrfXgmsqhIHtcjqztoqCSOc3A6G0zRs2bcM7vlF+XseEuj7ek06roYpNH\nmlOzjFTXRG6vSpl9Ez8Md7gtiapOIjtiWZYeSwHzhz5lvuyTKIWg2JKZaaYD\nmyDBE7zL/Mz9+pYSOlR/3DqrbjdSx5dlKQnAyKTF4mn9Sw2HleZs//6yPb67\nIU/DH4V4P8HbaI0yw/Ma/+5jwylncKbXz2NBje56y+QbjmlpjJk4rhXul0Ir\ns9oMrZTq+Wufx1a9gDAbdc7eCxk8DzZHaLIPw4GyKXmcNzXBK++ezzazdAfa\n+8QCLR+YrQtOPiKuJEM0BAD8lKzPTG9qMUHrOTmooqnhDDV2SLoTFofLbbTy\n0dWF9sFR9nRP2S0udpF8ynWFL1w9Kvn7mk7r3htGEiB3KElJ564ggktRsJ+K\nrl9854Y7qZ+ledtMoD/pNWyIORm70VISdMo7CjVghsRUMCVw6q3h4f1kyRKC\nw0SNpqFRVG+Mgs6pp8wvVfkQl8koIT1DQM1CFdWIgdr5JrzqT37YGGDQ1TXs\nr4g4\r\n=rBH/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1yE0HVQ9yflfu7nKUEj34Y7mskUBYc+ZijCwaNAKdPgIhALFtcJvexP2QZdZ9GPdXDaZX5H3bxGgn2cI0ah6vu6ZG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.3_1598973756206_0.9628981319477736"},"_hasShrinkwrap":false},"5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3f40fa62548350ae016d283974300c4b03885e0f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EVlI9BthUCqco357WJhFguG9ENxyCQygj5XQXALBkCPY6hTl+5fNG/vFufbal8Mp4PNAiJoXwYPVw7GEHmSuTg==","shasum":"f3a872ba379c1ac05db41a4c8d8fdfc49f9ca2cc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0.tgz","fileCount":39,"unpackedSize":201944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTmdZCRA9TVsSAnZWagAA+asP/2PkhcDtactdtF5b8o2F\n/9pvPDvPiMwaSm00SGAX00AgtgJc615R+0oPnJeClfghBuZWYX2bXUzeiSUF\n4cX6gRwCBJjjKh8kwyyH7TsnHXUkdFVNiJqWz0Zf5SVFb8oS9mhqjUBAEsit\n+XyS5ayWejdCU8AM7BrNStwQtqWFRVr7E83mfdxIWYorh9EutCMyKVRJZjNP\ngV6MtpsA5nY0lERJt+yc40ELq584i4eSY/wEa8M35XGUQdoBfA83HsBjs0Ye\nckFemfM9iokKe9iRFQItXmGJjwjXpgUPlCjFvxgOOFiS2ROq4cmhipAn5zPP\nhsdKXj/y1NRBjU/KqSNnjf3VYdsZaHnr6b5wAgOGG/GgcY3fzsRxvZ0SEwRV\nqPT1MbPpHiLGvqy1SxNuzc6URQhyLIFKuRWSa8NFDh2OBhDTJGXEErcr4X0X\n2wu+7IOPVo1w/MM1ad0awOp9UQEd6/85uB+SsGjuMpaSQ+4EuVyp52QjATME\nUfVRAZyFxzgJSS7oZnWsGoTFZ2Q8lZ2u6T9iCxJVcM9odVQrQ0xUtQ47j9Uf\nKCItRVp/UCzdxU4X2zn/ASV87QoksKKarJbwMS23gK8oRQ7BELT8P7gnGfAx\npEBDvsCTe6vPM2YZL+M+JMG+SCFpNaI2UVFTW/w/k97UglnfK8MVEVqvqAZg\niR+0\r\n=HAFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCN4fcPxal7vnt/qSZuFQeXe4NARlm85gR5EInk3qPArgIgTk18hvtr5E+0YGaYWn0p4qpNfaTVM1I4r4yxzXETPGw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0_1598973785124_0.04727907618003013"},"_hasShrinkwrap":false},"5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0","gitHead":"ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-u+l/KPjEHCBn5LDfiuM594WX3pDQmbNPsl+zT4a4cnxLqgQZ5ycP219mLGX1LEVYSVySEEtUhdo8S+MpXwDB2g==","shasum":"9af0dc08701446a20373bdad163c4db5d006654e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0.tgz","fileCount":39,"unpackedSize":201947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTmeqCRA9TVsSAnZWagAARScQAI1xn/t7SQ0XYC4pXUZN\n3Nv57ss3mptWzYA96zDLK3UuBaPjapMbB3ncE+5BraJsrbhMj3dFZFm9Uh7T\nZAZLsT2t/NVNnXvxs0zow1Rm1VXvz/3+SBXVyl8jKEOB2+21gBVFStTU/207\nvl05oTC6g23bp/+LYVNCJIS5HiWC7Vq13FerMZHHP7S5MY6E/oxrGyGL0aNd\nElh6dBvo62iA9EC5WYHF7psGLB0C3f3w7bHwa7CpoZaU0beibQFzi0s80ZlX\nA34nW6S7JT4qr/Y26QvV1bX++fV1ceJQzNbm+p2KMisDHyIxuy/P1XC/DRH7\n7F6qufklM+e5IR6q66GbOZDlb13qqcHviunC8GXto4fTaJWNrFOc70tK0/H9\nIAXLTYlmgJNLJ6t0VReT3EoaJFK1qrBv/6zcqPGZ+sa5VBd2alSqRpy7bOfM\nts8M8EhYVOTfwL6pBBbo98860wnMZ5bYquPWC2QfiEuZixPb4Vu/be4EXn7/\ndbq2IJlEJJMkysCJpip5FlmrfGsbwv9EIQTWogEGQcQ94+vl+dWfHhIm4lSB\nQ+FllwmXFWjozA3dxOU1lJ4gaOkn9DztZCMVPtO0qkKwa4U+psZygYrP6rpV\nlEQJ5bmRrWr9AjOdeExV/Kcd8y31nPhg5ZcAAn9mTljP7i0JwzcoWGbomJei\nrTmT\r\n=mLkt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMsGw8PhaXrDrFIhEenzElwgft1Os8p+gjP9vynYSG7gIgItoyggWlOPrTZFk03gWxqBe7Mrbx3SNHzyKDyfXiuk0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0_1598973865712_0.7515987746000272"},"_hasShrinkwrap":false},"5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0","gitHead":"86f9b8db015c54537da90fed910cb6f64475cf7a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CzhLws8ILy7gj8RWAW1ZvSxfJ1CfksfxxWTIT/+mkwZ16jWbEBL8XUwpMkQM1plrOYlBhmlEo8ERyt4QijdmiA==","shasum":"20a043279e6ab8ffc4b932038d12db5d42a9f5c3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0.tgz","fileCount":39,"unpackedSize":203893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT5tICRA9TVsSAnZWagAAGMYP+gMSWGErvV8BekNnn8oZ\nOlXEtj0dY7zb/jEwyOz6Nb+xAG2DjSpDBVDYUPquQY22YO1RfiqqOGa7IwNn\nV17OAJBcjSo4khGDqtaLlVu3I6APsMrfFT/fPsLNYYyVs9Lwjz/FJg2EUPvY\nnXARBQTj3QOUSccDTqA2GK2YexJLi8OOfYL4//rW/eMz8zq5sWpMYrcTNgoO\nQRqMif7/4euP9Kz0OUFxkSBgnY9Ax9cWkKTKz3OkImE1OVuViR2bb9yCD5uA\nc4zqN6lA0cpT0C37M/ZRwIiDOAH1Fsk7FbLt64lDJcsl/LeDZf+ltsKxpXU4\nxbiGk++VkuAOj1hMsHw9qQwvkGENqdXGmg2FYJr/tViWyXBjcdtFeoqplMoA\nYr5dd7noSQwnFzmfsG0emDfOHH3xslLPGmMfDbInNXiw001NdnLkk/RIIKaC\npb31b9/jEmQSAJK0K3oy3wH338IK5/b0ctAEyq/iceoRcAQjrMIOj6GpW3es\nFkQWGBngwXjak06Gn5+4ZhyiYOH1fiMmi3Ho31ekaDLjzkG5Iwp6IqsGWKwU\nDK+oDsQuIiS+NzJfn1TE7dLhAQeOmrWOnvGtwua0pOakF3RlSFSjOz2aO5zL\ndTDmqFdqXR64DydiamtmYI5ZDBKYhrDBFCi2/QjVbfyCG7pBPnG+ugLOh8rD\ncq4D\r\n=khIr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiCTp9BoNzaKot0JzTR/1WO7YvXu8Th/3iub4sSo5yhwIgdCMeIyz+edZMc2gkkc3JfSJyJG4KiBJ5J5rPbPS9DHg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0_1599052615547_0.12386702889971457"},"_hasShrinkwrap":false},"5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0","gitHead":"455ee47b1b665669dbc7627861434c5e933910e1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AGsYXdGdrGXDahDVyKyke24Tc8Pm2o3R8wW6NvN4HzKd6YJnxleN5iyBGQ7oRii932EcideHx5cVKTUutRMpfA==","shasum":"562611a405d4df8a0990b7d35aa1ac28f35fe506","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0.tgz","fileCount":39,"unpackedSize":203893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT5wqCRA9TVsSAnZWagAACssP/iRfNsk2hyOblgaCQctP\nughPxnlTwdwGFbMkYFOjpgQWGlRo9B5JgJScRq8NPL0Hrq5GmwJml3lp1c7o\n70nL2aJhD1dIrefaNtjdvC7uxkk8C9R/kIE7G5m2zWzsChkDSMTnnugN+MOc\nw+GKcqn9lhUVDs4Od15o7q7zfm8Lk3Wn9bx8LALFwUvnm1F3kj0RNNg5zv24\n0cNRsvPfevKHn7KjI33GicYDD7ijwu7bH25e1vBQ1yecmBXqaFauXdIMeKGy\nScGy7iwuoyBRlYH9PLto/TtqkDKOWmUUd+f+BEROqgg8fw3kBpzg1yZhx1T0\nFHh5B541gTBqXLHiS/JGN8Al0r+k1jAnUIYy73K7WZ3jz2oO/FF1XW5tmA3E\naKTifjRipwyxrImACUS0K2hKEZMAGcqOmm+ysee0jPDCa4c7HKAqCgVGW7sK\n+6ckHTeLerwPmdAvhXp+7bsLGtZ8kOTQe0CI3/lPEbXgspdE8s7dpTwU8tE6\nNWszfXKGX2l7hfF5FrYja0vhT5wakidzfyLlnocm/Hf7Lu5GInTUdhx21g78\nqmzz9ReH0xkisHm0e+1eg7Ps7vodmHjaQb8hX28rNAuhlhr2tylneEFVIBiF\nB8jW2VvU2HWXKoB0Q1KYGPR+1A9KZIeUQzc2U1pExLQX85BblhWNby78ztk+\n5fmS\r\n=/CLd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw86pRU2PvBOTYvtPFtX2/qDttqWlPrcX8JJ/mJqPzoAIhALUxHSieFRtO4dtGNbrYiLVXvuAlJkjOPBqkvYZP859p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0_1599052841969_0.1642451135705898"},"_hasShrinkwrap":false},"5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0","gitHead":"ec4994f0f9caeeb7280f72dfcd11c455df990083","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ecFkIIYsKTOagsWm2YEMttThzA+gD3aEcb5rKTNAt4iExAz18DSuk92TRPStdzVsREPfzyKa6H/h1XskHuji2Q==","shasum":"150cc13f6a671836239879f9834c740702f094e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0.tgz","fileCount":39,"unpackedSize":204280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT51PCRA9TVsSAnZWagAA/8UQAJK4NvuAOBp7jqs2nT16\nK7OmkBL7Y/eU//gxrC3f5po77uW7Vhmk9ohBuEPlajOWBDc+WJzDuK857Iad\nltjIU/69GNgHNRR3JQTt2bDLbD5EDpbA82AsJxJjq2IFEAas8GtyaAQrIt60\nsN2rUDO5El2qSslRs3FgKOilfKJjLeja/2rjvbbaC+nsm9+pDQ2fIYHNdQQx\ni1nROOT62TMS9n8sA4qZCedTR0TRaP5UCw9jctvuCHBWU+nvbiPVO9pggHlZ\nggCs6OqSb22fgJTx9wGIXI6/jTIVk3GXm2u3dbB45ytvyfFA1bt+kUwLwUCt\neBdlkddS37ooJshQ/y8cFIwCKMJiRNCxUVxFu83RC0sBiEgc5QQXZl0E4fgQ\niCAETHSyJ/zwrW2PpnPqWikAG5gBGijYJPfHSa33GR2EmZ/6k4w82l4UazwI\n5sImb1zKSSUxfirExneX3hRFGjKAx6Ebo3e3hayttOWg+ZF1fVsTJoSlSNl5\ntk7DfAx5/y6Qij//dSuJJQAdDXdM0D3CotzeCDH3+8gVrqbp/YyviT6w+PVJ\n1multlnv17bkUyviZgNOroScN06sks8Al3vMBktif8ysbV1vzkMddoFPhpH3\nMBcwAr0xvq18CoZBZKBlEwNWM2NnjtrlUIplY6PTrg0DzS/TLPdm6Q8iAquw\nAhiD\r\n=PqL6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ22T2MPFdnHXMnOk4AwhNIsb94zmLdfcgFjEvTw2kTQIhAJSvYetsi7uCEUT2/IgfNaZ+u1kTYQOklSEyL2SLXNma"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0_1599053134825_0.12290840401305259"},"_hasShrinkwrap":false},"5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"89390e962c8fa56d109bb3601fa5160176f2568a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9CIVdaSz31ec5de/FTEPEkRb+EKqkWGhpKsox6LoWTrmWWiywS2ifG8tRi9bbHGsKaImhn9n4/UfuH9iUcd+qQ==","shasum":"6065716bd2416988e7007c118dff3d4556cd4a90","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0.tgz","fileCount":39,"unpackedSize":204280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT53XCRA9TVsSAnZWagAA3MoP/3DrY/gxeJP+LsPAWQZy\n8GjMntwLiKjHaZ88v5ScyNR1U5FyDI5KFvPoawILuqUrE5irm7FxamQqVbPs\nXpuxK0UwoL/MkZdGptY2Qq1DKNdefoH6TrC4DoROiIVa2x1/frCG7vuwgxwX\n/rzK/Q1ilE8JRvorm3t8TqXXQ6OzvIzEzPwpl6jGklgTr5NUlczUIZNfqfEt\ngOpUGdhVntYlqPg6eOuVzN/Ieyo7KvUGbMb3Bj/OyyiHQzVEErCb+dyeiDsx\nLR1nnn4ibUPwhhq9sr1bkzNnGjmjch264h/j9aonkDDEENEbyisnOsH8FExV\nUQMOOFXONhDi0q3i65vrEJNoy8mS/DSeB6LMP7xMy6zliBIWIWwpoKZIMP9P\nLoJUFSkNLRDiFVKfI5kl2wbEsbXwUPFrikQPMk6lJ1j9Y84SsSJPR4A425uQ\n0ze8tdoYsblgHO/YN087rn5dcZ8yCkEz3h3oI6K705NIgMky2+JwoiNU6c/q\nYKsmaPgH9I/FtJdfMtrwjxewPt6ZBiVbaU+srJW+TTHFFdDJCHpShlcIeY5U\nRHrHKuqz1wBqL+NzGTiAP/qQ/tyeqprui0EDNHeTYcvIr+B65LfYeIdKCQJd\npAustJGFFY7Idi/ljndbLfZpQ9x9a+1WlmCzMAFjI30acJqYqTrDKaLPhmJO\n7vpA\r\n=c71t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsrIqiOtxQiiRo1qeEPmpZVTOryqT+FNslm5f1vwWwaAiBdgOYtc5MMD5w4XX9AFs7bDqhYiGpuTpzKHCqedN0fdw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0_1599053270730_0.3409464702523617"},"_hasShrinkwrap":false},"5.2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.0","gitHead":"2af00a5accedf09aeb3951d1cb2ae3038e7f1c27","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vCYYEX4yJuyGiu8tnFQP/eYphfjWa6NmEYqAWBVjYgCc4S8h1uIrZ2S58gnr7Usuaj5c9sWWK6UZk6RPfmxDew==","shasum":"7472e3ae1f46c44953d225f98211914da9db12eb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.0.tgz","fileCount":39,"unpackedSize":204504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT54QCRA9TVsSAnZWagAAeoUP/1m0F5wIVmQGCv3u48HF\nYE54WnJ1fXl/yN8Fm3DvrMJvArqd3HDhmDgqHya8y9cyc0/u5XUGXgHOvNYi\nEKBaehr7fjZxZNdfyyvNCqRYFfMSB7urL8B9uq0bHM7sS7vhJRTWpYM9SvzG\nQglQ7+vQDp8Mc7P0o642uuvJV+YB0Tl31RvMUXHVuuv/YcsvN/X8aJN7Jwie\na9Y2Wn/5omNGxDcBZXr1DDEaob/JdmutXYFihH4bEClAyVzqpoBJrVUip8bl\nfJqi4WpPwUp7MWTNaXvQcwKDpvOcnr+U2+1AJRxeI2xE+uUK8TOutl6wFwxm\nTXJzyHTnIe7qTLJB72iloqUVjIHAGEvR0aDypUL+HLhwTyJ2dis538mXPaxI\nek3l4j+UMXD8zXBy9BmCSTNCUj0SS1ea6f02ell5049Y4nr5Wq51JAjynTrf\nJ22syasCFBX2RopJ5d8r+n8ccbI6U05A7+MaWLzTGmxHiYMVg9XlsBWoGVx5\nHy49GbGKuirCyjFkJ2KbM5Qhiffk03fdh7m1KWwmuEsCkFDC372GZHwDGMed\n86qugfAAkt7eOUfDr0ZfKNBuUBxgMDiJYWaNpyAWzNw2aly4o3EXl4Kz3Rzk\n93+L6p5QPk/Mr86l7fVcrWcwMLfCOZE34iDJujMZEpYzcfmZeyNQ3nQatCkP\noNIN\r\n=Ik8l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZZ7UzSZWpT0evYAdMLp3tm8tTNGEM4kCqV5xfum8DPAiAL13kdAQqynhcNAWYKprza9mKp1TpcX4bHeqzzEm419A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.0_1599053327874_0.7852989055235602"},"_hasShrinkwrap":false},"5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2af00a5accedf09aeb3951d1cb2ae3038e7f1c27","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tA7yvQ2FtHtO+11/jZlFn3Tz4ARZb23DnuhqrFoKdQnXXzj1IBiyaV7S1ODjcoIetEjmbAlXkztrIUhRAnIudQ==","shasum":"62608da01b0cbc8b225ed2fc02a8e5f4290db4ff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0.tgz","fileCount":39,"unpackedSize":204547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT55DCRA9TVsSAnZWagAAOPoP/REN1aSqrMNgrkZmBAAu\n/1Jrbdc/uA0wC2rflYlwkFN/TlKe+E4h5O7Qa2KeJlVIRvvSm1Bb4NIglNUp\nznjWymjXDpk3Q+R+zJXgehMd40UAUBpXGN9pEK7t0gFPoeNtkEOQtDirlBrd\naeuqDAQlieNXX7AahW+G6OmsvVhxQawsBxoEIyeU1vddV1qJWhpmztk/AjP+\nX1V63PydNH1uZyYrFOZmfDYsRHnS0mbF2OrUxG16aRXUL6KlVa6QL8BzP4c+\nKO6gIqCLaE+cbD7aeVlf1In2Vw9DwnP/BD+JDX+1h98jEIxIUKUTyLaYVk7m\nP7GdxEbHBX2HHYITurJi8D/56y0aF6IXDcBBEm6cUpwaZcFQ2s7qv2nLvr4L\nCI1vL5ragqvZu2N39Uuf7zNKPnq6x0K5tR2W6uYQYbc7I05p4pzAZ8LDs9LI\nkTX81DLg3WZIhFZ0RJADNRPE2qVSWpzhsYGjDBQkJkoFUAyguN76TRlkvOb5\nPVra1o3iyY448q2jt3kGZ+RRxwbVUAu00KXblGp3ZSGLKHw66zl1f3K7dNBH\ndurU13qDrdj3g6WUT9WG8zPCA69RQ0H2u0tMeCgKiQljRvUSwVU+bvL5nfVG\nw/4Y7F0dFSrCjgMLrm1yUDGaDIIsxVj8lpQ7xnkFeHNlwAgQvTQO9db7nhCx\npAv+\r\n=r8UQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOn2t+6IkLFma4IdQTrr5GPiSPjI91GyMyHskMqLJeZAIhAJE4aTHJ1a81sb1vsmVM7/tx1YoIO2sgqIImJtUGHb4N"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0_1599053379245_0.1061241506797761"},"_hasShrinkwrap":false},"5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.12","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0","gitHead":"87c6d63da9258a8d0047e8de2ee1c99e1561bff9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vNWXL+AXirKQIxQZlr8ht2jttWX4kyQzqMl7RPmxzdbZX8dLJ71bPIw70wnyyznUD65RKLTvjzuzJGMTNR/UXg==","shasum":"783c6398c6e360771be8e9d5018daa40c24650a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0.tgz","fileCount":39,"unpackedSize":204550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT56+CRA9TVsSAnZWagAAZgEP/3n4SlhqNgqvWe1hzSO4\nWhRLWkeqF8jTEJYNxT+kK7DKlfZ2e70/d/m6Dko/rXX/Mbzz5pFc5tz2yEaT\nbzJ046QAAkS0+cmDWIMlDuvcCDLNZsnvUcw/Yfm1vFRCjYnQGweGXouqViOn\nqAWYPmN5YrpXmRXLSVLj9Yy4csTJg1qMFnBL/XURigP8pZM1xivOcJwbCOoA\nga9bRHkR5TdcLaogKmBJJVpIKema/ercmDNCm8o5TCiEW6i2w3ioG+JCklSs\nTDFto4TjkX1P8Ux4is/QM3HJlQnP0PXwd82fYCQvG7zsjZ5u9Io+LQlwsSw8\nuRREMCDyrm1LYGDKMSo1EYSoDRbVu7FQwxKby6g0dJ6sQBfga7hLMRM9W6ci\nbkWL8kInBVaoyXdgtn2vceUDtr/QIj/pVzFcs6/+Bt7zf16ZNgdZZ8y4gXvx\nUNTN5+lahbMdZscCs5XrFvuX8Vt/CNJy3c+jmtlMVqtrXyEgLfJEkrUobk9o\nsJNFApg7YKrgoxfGLai/96o1qDcqgLZitUgKtAloPS6O7glg1loVLEFJZZyu\n/ygZDVhFOqMbTK53pDPWzVwGoSpLNjFzcShJG1yKCnDKQh/yazWe25YZgVYu\nqRQd/Td2HdY/WmvQNLG6yD54ae1Iv5Gs815PZPv1RZynGN0oDjMia59WDa1Y\nkmZg\r\n=VziE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLQ5mnSxfOVKA9CcuKjmMmcIeb/fUwjGr7+QlAyjYMJAIhAJXVyf1vn0nvRwcmnQ6Uw1j9XrNmcN3sxyjZudvwZlqv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0_1599053502394_0.8819847964810827"},"_hasShrinkwrap":false},"5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0","gitHead":"c8f7f6804c96bc8f04a64edf2c963a11b6948e43","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5wuYdY5kiUjLpQIbm9p9yajlCNjg1l5gC4jhWvokIJrThY74yjvZnhNRSoLoVad8IEb1pm9ZCq/CX1h5MbB1ig==","shasum":"61549cdaf5bef420224b98ab41f42eb1e1bd1d29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0.tgz","fileCount":39,"unpackedSize":204547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQmVCRA9TVsSAnZWagAAofUQAIUcHDfSmrdY1t4C/HED\nMSzBWJ1CQEAClWJVGegMo1DIevdb0r4+5coYLZ1tG5/gCM8gsi/7rieOsCFO\nnxu0W9pEwUWwNg1d7PKutvTKuIgLV8AVWdnErG/35muX0hkXeQA6NOct1OUb\nubR8f8J5UTtLZgJ1dsbRaYPXDSPmNFV/YOv+uUomEYKNeILnrPL8MIRWOs4F\nrtquJfkm9pASZzYUyW+yJQlywO/JobAEYGxhE7mDeO9ZdF/vEmyFCSkxhTHB\n4sAWjWf1aB98OYES4y3nUyYSgedbTe/nUM5/APgIJiInvEljaVoybebWhbDV\n7/IuzQT40aWbc+U6kkJXUcJhowXmCzjEfD25rDzzfcioVMeHdZcYyB2WqBsU\nbjRfXzbKiNv+W3+NZ/KxP81IBhre0J0kCjUsjyCNmcTzBpYl7MYHbVYjIG7J\n9X5Yc0ztRQarjQWKadcia70Q0zQuQqQRrkqmiRZCprbb2z2NW0RhoK4Ip1uL\n6eGwiJwdWN3bs5AKYL6igGiIk5C8vpWPwR2AnOQpKwm1lwSiCIn7YMyLdhfS\nl/GS1e6K/V6jypufE3GKbIDfkiSkeUOAwjHcVLKsOhlVOlQAFV3UfOOLUhBV\n5DBg8QsuqY0PVtDR++NelXMueozcm4T2ml3QUOOwJCONiR2KZZ3V1VgygEnd\nNkka\r\n=jVY8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlJs2rFSwn6bDOw6WiA401FjSu4QkPgoOE4f5egtv5LQIhAOhAziNZeh2awZBPM8q7E/EawMxsJXI81SMGGfDsD4YP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0_1599146388830_0.43530553909373126"},"_hasShrinkwrap":false},"5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"501728920a3f894d96b2b29bd31448a379a05c0a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-En8P9NXG8VjeX9ONphA3B6AGDn8ygUsFJnPVAA4k5IaU83VN9tvGluDMhj94JI1cqW6nlfH1c98S8RRoNVtlVQ==","shasum":"e6f545fa1635fe331371a00b1a7338bf9a2e687c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0.tgz","fileCount":39,"unpackedSize":204547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQntCRA9TVsSAnZWagAAITUP/3nXvxbXB5shG77Ucmso\noHea6m1SEVwKMrtY+IRH1FpUDp0NpDXEmknoQ0JlucYO7KNA7VEwBhbI6o38\ncd5WqxWBkb+v5X7N1QFY0NsA7jzuJyv17yhrHgNq5ywTr2vNxGXucjrgBVlS\nj01PoPQvDtvHMBC8WOzmeBEVLY1hvCS27Bk4XMd4WGYlbIZGXwKA3E9p8EQe\ndZuy1zVzc/NzeUWyG+lQOozRk52/HDqx5eHFfpkuDAZHDmixq8+9jbDpL7RG\nIdWHv4c8ryT0SEvZDkxn/binsosqb8yK8Bhyq2OTuZGWAtdz6TeL0YjJl7Fz\n8ObTk4IgKwaiqa6MjpkFKfb1/o9VwuvvCKd0rDd7yzTT4+wlTOFazER+HN8G\ncFGLIyki+LuZAfX97pX7G8aIGmdXPidJPLmD0EjbO9Frgr6+4SDWFjCp95Ta\n559A5N6fpQCNhQPGjtwHe8+pP2XE2w6Mzxh2XDpcyV+0O0pJ9aX889lUE/bS\ndLWWQjZqR35KqeQ9G1q5x8hQnbHi6J0eOpzNd+kKLEpLgK7WXaPme+UO88+z\n+2cHUNZBX49m9m99IYm1CyUFgkXPJ/LU7wRuvKniqHRm2ngBdn81mH0LJAML\n/3FwfvXuG7q4+7JcVBGUPfLRxdHNg1oUgnXXR1Gbq9FNGZgxezYCP+8ChVM+\nWSF4\r\n=DbZ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBkBRlLkvlACiYm/bqmFOzvHoMm3S04s5a8Jbr2HVICwIhAImbslLUo7Xx4FXVT/bpx1OVDEWLUsVygDANBAkH1Kwn"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0_1599146476951_0.6996194542426266"},"_hasShrinkwrap":false},"5.2.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.1","gitHead":"8111029bcc3378dec78463e404ce941e46c62bf0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5RR2ixk0GpxnT5d4NvnvmS1IuwwcqY26vuq+VLkw0hD+9qAGLjlUKnoLKgIhuP1wzaRA42aZkYm8QdY4DyZITQ==","shasum":"38f9d694067b5554c44152b42926e43976fbe741","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.1.tgz","fileCount":39,"unpackedSize":204785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQn+CRA9TVsSAnZWagAAdLQP/3rWk5VGusdF52310iOa\nzyzRgaEj34WSH5smicRoMJmJH9PSCwkFKe37dRK2Z5hNPR/7e5gza/rpl8CG\nTNON6NYlgcQAb5AyIraCDmGQma04Ki8/5dw6/QLghdZeLAOoUfryB5QqkSXd\nb4102iEUBCtbKbr7NwEORPk5283+V8GjyVcCEoWeZ3fQ+LcJ/bA/TVwJGBb1\nrsnWsNKyvDW6cYtPOfWq6G2gHtEOrjy8k9LdJGOBZpZ0A+8nHFhe5BWcgHz4\nKmk1u4qzI0zYJ3UJU53l48zBd7j7HtCNPrTQJpUmk7QEvz8s+LyXZQgMzL+4\nmCUaKdcQygyLIpLUJolEeN3SUP3wfZcyP2VhyWrQkq2Ae4BV/QSdXzY+rQd9\n5M+vtinhyTeBO5VBoabYBZngNfMWr6RC3uzs4GeamnCWNx9Cjs1Gsbz3gRA7\n+zO4wPSmaClUb/D1AmX9zSWuwNCaNttPvOQ2oTHrHQCX0M2sZEyWmrE0Rjj5\nQ+c7n7WznZ6v18B+OXX+h5pO3QdXeU+2NdrcWptmDcXJ1fLuWjfwkbo2pEVA\nKcj07NG6EQ3qtuAOT6bCTueJqmx6/Wqmo7ZIYsWXJFRmWl8i3rZueX7hbPFQ\n0AsShWD7gRSbcADS4t78sVNe60EjGUlT+E4IadsAPK0A8Y52jt2TadjStz9W\no+tB\r\n=UC5C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUT155MXANC0Urc0tAENDkw4V38PTPhQN9f1mf8qHwPAiEA8d46FLhIjeNtEO+HKP16eSPaDzzXsHZt+zF/BG0mtRU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.1_1599146493936_0.5409970249902527"},"_hasShrinkwrap":false},"5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8111029bcc3378dec78463e404ce941e46c62bf0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5Wp90zPxltHBuQC4hcjVJap22gjFKzKzCbhqMKmw13ZfbAWfgOMUce3J7oPIgXZ3SG2Bwc90TVGADSbP5Xmo8Q==","shasum":"4be89553f5aea249d462675b874eab3810b2aaf4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0.tgz","fileCount":39,"unpackedSize":204828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQomCRA9TVsSAnZWagAAKhoP/20Nq8oWgvekVY8/kaIH\nf1+k9UA9cyuSvH0U+/Kl7wZKt8l58oEEFvVwNDTAk3lUWpIvBY2oKZRIQoMY\n4uzxXxK5mF/D3cXuRjOJ2CWM/++pw2OV4XNzRvHrwmvBtH0g010m6whdi4/O\ngnddrQ9dio7j+ZJ+PypihyhtHN/gtllz6g27ogEvO8Ew+GH2yTi5tOF13fIK\nDyh+FILSJYVNFgR+zR/x9LxtJmXqqvr5mF3Heo6urUyN3C/A6NlDO8+UF+0O\ngttrbqhg8ZRWuB9OLvg7n8A2DZesbdloSBH1TzvnUiW2GtBvaPVqHBMDaFi0\n7Imm3PWMjL01s+6ip0icNgfrxH+ojLLEJURYCK1FbuqjGuxinYnJ1wh0VJsK\n7rR8q94V9lYFb99g7FVoX599LHZXBiqSQoh5dvq2+ZG1EKqloZz0p2d/FlaZ\nZuUsG9TM2cSNZQA14396hg4z0s8kLsFP5Z2cDJwEWg+lZi4U2Rra3vqcy9cb\nRVVzF6UsqVhDGx1Fqs98UoXO+tE1nvWCMC/wGD06bDPXkbwnEBhB8aTfP10U\nHTJu+9IGB1nAGPZlQ6nloomjTuzA1e9hQGEIpMqMJoRRkOLF03HvmGWFQKHR\nva8ytmtzpNxcNYF+IuXBEnwy8eYpe+NMe91HUc4zX1FOHuh075tKF+KgsCm2\n/OGx\r\n=fWC9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4NCQwJxZ3Ght/6/fHQ6LyfPw4GaR6dSXvUakKuiUZmAiEA7Ae5rD3+s5oqa1OFJECGxNOf/m+iWjRp+A9XACnsk98="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0_1599146534303_0.29488050650609465"},"_hasShrinkwrap":false},"5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0","gitHead":"182d3c079dd754ed31c7b44ea5565d4d4c2e0e10","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-x5GNgEKTeFpe/K9trfTrbRL4H3//svEViysOS7IMHmoblD+P4yLaYwKg/kguCMWnBGUL1NqpdXkXNqSHKuKFXA==","shasum":"1622c20cf7493123764f56a1d58ebc9930848227","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0.tgz","fileCount":39,"unpackedSize":204831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQpoCRA9TVsSAnZWagAAWpYP/2IvfPN/CErbQcfHdXR4\nhX7bAK8X+AxMBWUNVRpdcj99lao9OtoLRhgM9OUewykRzexcF7As4zQxIjXE\nIExeUJ6FWbpR0xmThKPea/ymrRGqr2c96CwGgvVdFAaiBAOeholWTXv/Vn6n\nunIu19D/P/USE1ny1Gt+Ebw6HU7eDKfBFKHE3QlmS1GNMs61U+FhGMkzyE1W\nLk34jLa7mtdeiG8aBWL0yOo3BokLMEzgQFdE0ow2ZVMJ3fgMZ9mGtepCDz5g\n4eOBqA25imH37wZIRzmX8m975jcVuXnfoIcA3jEHbNfyhB6qXMmlzsbmMSWt\n8HRSciws9ylsj8PNCDLg47sM6WdRcIoRbNs6FfzLrlJDWywyvbiHcsVj+rOU\nOr7T5zq+rB723JOB5PLgPQnmjkEv1bPDpSyf/Ajef4oQMhMgH+bKGRzyfBuV\nonm9RJU6cp7tOFmhnQq2viIsc8uIP9lxsgyKCK7TzAojnwXiKYnGI8QWoUG0\nZ8l5HrKcnaFuNfiNjvysU8naiiCB70Na/SIRJx93xFeOahQYAWtuJLXKuy+f\n4YbBTb1/srKZxnD2ue9A95LHWAFEc+prhChEP9S3jm680EbNd0v3dLa7I/g8\nKrdveXbw3Zbb+ThhlO9vJlQ5ojmYoy107x4AXj8zquefJRiyLpDo9CZDvoVb\n/rmC\r\n=Xcpo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHZpj2OAHxv4qMQ5TaIte7P/2qzq4ylXSz8k0UhDPMKAiA4eabM/4yt7GFW8GH0BATgw70phgFh4Tr50tjFbPJl0w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0_1599146600107_0.06647673061644066"},"_hasShrinkwrap":false},"5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0","gitHead":"ee752fc6c4aab4e6b565f7a3e98e58920d5a7624","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wnJzwkLUd1/d2GV1UWfj1l92vLoGJHxX1duOdlC1hD4G8R8WxFvXeOGgg0oJawb+sQdSS29hxfulSUJFyDJdhw==","shasum":"a822fbbad3eb2dc2fab4c0fa87ed63e15a10f4ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0.tgz","fileCount":39,"unpackedSize":204827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUeWiCRA9TVsSAnZWagAACqkP/2maSUAL0lwMdFhBTq46\nNONR6b72j0u0fOn+etgAAAW3mZoxYFEVs35eHwgz2O8iTrD2pevXi+jNUaDI\nnAx9XdXXLWPTBk/DrjZsfXgse55Ikal7vM5GyATEtoqIgblAhLGdc4h1PWBL\nbpTMD7zJJyrzMzpQJeVBexnC3zL5I6j0sVBW6EdFMu0BQwZ3GOuwsc/foB/x\nrK7VpfqXfar7P/qACDmVgJUUveWQdPx69+Gln8EnlAynyB2m4eUHurDRI8qZ\njeGcj/XNoE0wySO9V8mvlxoNhombdJ7rvBX5sKGBF/7fMMptm75FQzCTJ6d1\nfW/LDiPQnNXPfTzs5bNJhAx6kSH89aLs05WZcbpqXx/X0F32QZQpauZpwPEg\nGn+woO3s2niVupHApnXGzxME/CqDMvG+egvCe2uZJd2EYjM7QKLwCcnbrcXZ\nxs5usxBy9o8awWuYMNvHtBfGU8W4OEsPRdBMJoFEtg4Q3iHIzF56zUTcWkf3\nKgTnePPigM07Bcg7+2nOtq5pdQ3ze8NwVgVp2EV+EJDb+t+WWV8vpWfzp3fr\ngS9/KW8gjOmycFw+FWujIyj3qbi8ZkjxvrvCs1lNfO1FDGfKSFSzj91ZGyF/\njDEz3/2OzqDlYsi6NwXKNDA5OZGjZJfuByvATV3/TRfJ/FXsQ82fN6c7A5dE\nYtuq\r\n=CJjh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnLf44HIOExk9kNJ/xkchkKYU0thnnFCUDbyuDuSmTCwIhAP2/5C0EmEZWtBctYWzPoNUQsup3EMrI6gPg9cVFTY2u"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0_1599202722422_0.09546181426114808"},"_hasShrinkwrap":false},"5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5824406567f77eee3cd7d1ea2f1129cece54fc1e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-LurjCVn9ab2JA9jm+/Wr+PHMtam8jeJCTeNXhQ46KvddgRr33fOnr0nG0EXSZrS6qp66W0B5DoHgrU5/IctHCQ==","shasum":"ab6fc1c3d779fb49b8dd8609e71b66267f535bd4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0.tgz","fileCount":39,"unpackedSize":204827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUeXUCRA9TVsSAnZWagAA3SIP/iUAOLodcv1ff+dsVF7U\nSX734SXDKtlKK7ruUjVoitmAL8LLI6SJza73AuVjS5eRa+AB/x5kfE9JeNsM\n9TnyU98TKOHJgdGjalney0I+B8ztbgDKwNF5Xyf9A8aKmM5J3oyzVf49QY73\n+Z5GZEn6ttIxknIGF/C3MWHsm2F48gNVaGC5qp+vzljxI5iS8Qrx/76UrQLq\nhTjcv5LLE421LAD3yYXaW8ERd3vs6h1g8zKVk0eLShmYFPgoPZUI/7T1LPJa\n/TL3Dppx9gQBt1PXHcWRpM1GHk9jN51H8KrI033w0LISb234BupyB60B/m3e\nnkGIJv/xAG3LelpAwt+sfyvKYzHyvqpzjmxSkNd7XHZn6f6M7j7u2Wtxg5cB\njHYxCPGysfUfuRZFsrB9lUKU4MLjNWO7tq9wO0XKaI73Csz6Bq2llsR5O4u1\nuN6XhPBWX5UbYj7vTL/ULFyxwXjMQgQE3m9gs+YWqptKvsF58WNeNhyRvjGk\n9jf0wlDKBCCbDNtlwJbtjRfN9V0AcwGU3/MjDuwF1xafNV2sCTD016x518i7\nXVRjK+0nm/6s7tZ/T/sy3SP9dxCkJZ4r1dFH+dASU2OQipy1/ldB6b4jMQhT\nJCqbl/vCbjx+7gJF5rGSmhqCXQxGDheAwX7H8suW7ue1Ios6HWZMZMjRFimn\n0prM\r\n=0Xb1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNgE36cFZg81mxP/P+Bgz7YpibxsgK0g8zKiss7MsnEAiAKmUQgJDNqiJfJN1Sh05kWlcoMpOo3xQZb+k7HBsfBrQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0_1599202772087_0.2197801033588267"},"_hasShrinkwrap":false},"5.2.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.2","gitHead":"686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yJ/+sj5vsMuOuvJqikOYTH2/98S6YTEP6h5NHtkdfMBce+hMPiID7QdJBN//bmOL5+JwShoguuqftCmGoPy2ig==","shasum":"312fde15879eff9c73ab64d6f769f46d7a4903bc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.2.tgz","fileCount":39,"unpackedSize":205064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUeXoCRA9TVsSAnZWagAA9DoP/iS0qfxa36lka5qkWv8v\nxMztNo5Dlh2PJ6iBvI7xMzxppX5aRPTW5XrzyN5Zd/7taRLyW0kSIQIX6NvY\nSbjHycbmJtAJcLQh6aGgkvsPGcC2CkewOQnlf5lr7RF4mtN3zDYxYyLNXBrs\nJ3XYVMsJuX4eCHzmeB/73q6AHHD1pJG4K55/oibdbepUxLPO72LsU+5EkCLo\n3lNWNQBIHAXbIhjVidtQjdrEltDUli2e8irtKlPPwiCtSBQUI9pwkOP1/7T4\ndDcC9Xo5oQo2S8vu5Ik8NkxdEyNmldKN5pjELd/rwToxM5kr4XdTq0MQjfKJ\nArQM2v6DAPNLbDs5X1/B3RZhEyLcVZNUEpyuWynaPY4hdAChDkxbVR2ZG4ZA\nE+bHzcHUIMS0g/rN8KyuFHO0ckXvxQriWTsbAifv4FgI5S1rxPygzR7IXTPs\nZRTrRxMqcFNilWHnLByKUov1NdqKTFq9IopW5GlBt4/UseD9J7LF95VNxOjQ\nQiZy+iCXbi0jFZN9+Gn8qHWJU0zEFXuquSpk/TIsyJTzscgMBwW7UFpmaKc2\nTKVWY6IiEjJiG0Z5JjQeQAqSbg1tdjZnM3Qnk8pFV+Y0bj+2ju15Ei8ATqPk\n1I1BP2otipgBpbp4dm7aEGZYsJQ82c/8Nee2gd37LopjN+9Tpt9a/F/pEIav\n85TJ\r\n=c1xN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfPgjPf0SHLWHRaJjVN1oXHOK/TwVcgTG+dIgXRKIC1gIhANjLSaLqWyGyMBHda8cdfz7DqARlygU1dVeoJokx0/Hb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.2_1599202791581_0.45414519616660987"},"_hasShrinkwrap":false},"5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xLSK8QKZnkg0O+UxklI6r2hD6mWk7LsDDSd+ujvHSzLyLZ1CRofaU09fvBbJH5TYTZ9r+uv4PxvCS9oSU+WtYw==","shasum":"4c8b7ea511fa1982bd1d7860adea656c518f7bf3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0.tgz","fileCount":39,"unpackedSize":205107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUeYjCRA9TVsSAnZWagAAEGQP/RHs8aq3c7mspKizphfr\nk6q8hU+5lm6bLy5qq8DXc/C5Kmp+LyeSyG+zBlyAn1+wUs0qVQPGxZ1qfa5w\nItq5GrFHRf1lOWg95jvinhkR96uKePI0Aj+Y1rvjkFDgOWz+zK40AZyOWY2q\nbsSfZSY94PbeO3edeVXOddthsNTIxbbAE0LU6DGyK5/uDKqkqNlZivrhodUx\nmTl6pgiEm9INu9vyMaPsDd76z7a5bLmvSfHeGcJn7H7m8xtV9tKwegZzdOEk\n+nTOxlBy4XFTddhrYoZ2ytiiF7r2XQrS0e4LmYWCXXI1LXVZsugAu9/3c3/a\ntrHt/EiUIC2B8RC0MNQ3P9oRr9mbCzvc70gFeVxPTGxENh62XsbyHgiW/IwL\nl76LVZJScjZyeM4neaImt7wWy8Xy51LNG9Z27uaCphek5SigUspPxLvKa8jg\ndDvLEAx4PrZTcs8mV4QN3udf6ZWp9EY4tugj3nku+QYypGZa6mOuRrU5vjZD\ndcF/6yRWzJIyxrgvNaPv4KmC9ps4Xveq/mz2NufL2B6nZEdrh6+x5Stoqy2J\nup09jG6mRoTsuDBWYpV0cysl7FxKXc+wi0ufXdY5DJlzdSf4ED1zcmKl7wDa\nEGC7FgabaI6TxfEJpZFUev2eZo4zKS0irg93XGJGEXO57GOkPa+AnjeRD3OH\niLEb\r\n=UvvS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPZoy2zEZS3qtPHQ5d4QP4/FEMI6b+CtJA+WKzCoK7TAiAqRHdk1VRxzKZ90cBR8xX7LNBnC35R5Jd/O4+gRw38HA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0_1599202851059_0.317697964264561"},"_hasShrinkwrap":false},"5.2.3-1393f124224764a8474d6b176a252aef09769537.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-1393f124224764a8474d6b176a252aef09769537.0","gitHead":"1393f124224764a8474d6b176a252aef09769537","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-1393f124224764a8474d6b176a252aef09769537.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kzs90LUNaBYhE0qiUKQe1CRs1FN10+gUugho1neFx8L+hHHsn2GjhJKNzxFduZ5rwaoyXA2IM5rjPuUz/8NZyA==","shasum":"592102af225ca1f15660f8c5f4791d172d910500","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-1393f124224764a8474d6b176a252aef09769537.0.tgz","fileCount":39,"unpackedSize":205110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUeZSCRA9TVsSAnZWagAAxzwP/iftAa983YRS0YJXGHiB\nMbuaRjp7RnTT7/TcxrZGVSkJF+P3B4Mx9y47jp3eS9vTNa3oR4++A8JKQEP/\nJ3QmQLiwSyXW4oYgWYB4awEgE2XjKiCVZCe/M+OI/35+CNKt2huZWG+V1kht\n5niqYxtvDtcSSrMumZFJgAVyDRz/MtpgOlPjdEo1EPjv5bDsaAmw6UuIsH/w\nPUmKYaTmBDaAEe6LUykoDLxOe5LJaUY5j3GN8XpSKXb8AhEXotBhmTFWU5r7\nWlaPCl4PM+CQ4o+xZ7PG4GFHCCNRuse1gFEBf74CdRbx68yeGj/Fgebvy5rU\nGUAds6QPscHHEO+CsXu9fxUjXz84lD9Zb+jGJ0+fLjRLqdHxniTdfW13cw0e\nY+bn0Po4cKRATOE6ZnR7dxOhjTrK/BkGUtWKPxLUHHLSGo2dSCT/w+FpuDfP\nQSzH/y96GeEHIbNXS+hnvdm9K+4pFSdT03jIiIX0a4WWxccQA9aICg7KAh3m\nZ6pwPX/1jTN2kvA3GpnpRXMc95edJEXp1OZd7P67a3cqq/+3wuZrNxpbmIXW\nV0o3ZMLweSP8fYrl2ldN51jGySDfvGwHnls5zxXdSAqJL5bHJRIguVz2mwi9\nmIU57NRsGKzT+4+Eu0zZcA5UKxdUodr7vDOS7C7a0Faq8O19q3YNiC0usdNu\n0X6U\r\n=hIOs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADUmObjqhUyzaeaP2A05TlkX34c9GJEIdEKGJux857UAiBpVocCd02hyHPt1Cl5Ty7ly9A8JAFk+2A78ffzyaZfzg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-1393f124224764a8474d6b176a252aef09769537.0_1599202897857_0.5875741290224161"},"_hasShrinkwrap":false},"5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0","gitHead":"8b53ef67c9fe813e3f078c140c1d541fe91782aa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dg5rQfPbGl/RjgFAUobZmPbIDgbtyTehWdEWp25mo+bV5sEQZ21UN5TWwhnzSL1hMvy9nQLDviu6YANJlsjFBQ==","shasum":"c5293ffc263322b529a604f795a2c3cf952483b1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0.tgz","fileCount":39,"unpackedSize":205107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlePCRA9TVsSAnZWagAAewwP/1M3Dl4NaBg3jMI+1K1E\nb1bbUIUCQ3kMue103lHHZLxQ9mOMdruaAA8DGHn6M2L75rZhwuYA/UBQVsJg\nig2wVg86BsQOTkT5ZOHZu4SkJf9JwtGjO84aTSKF2/nxJ0IbS30VDTm/ULPC\n26pMfWUPRp1aCP40PazTOY5nY90Z89RcO5kZSpiZvsuGRu4z08+ecYNEKJmM\nd72WdwuCCtnlUUQ503XaqOGrCISRVa3m+VJvjLPCDG6N3nCZfKa4+ivzLFiW\nQJoJVWUWIqjxqxlmK2bzfxsOLtRh7FO5Dl0tvQE1ZH0uknCOvoXJjY4QJw5d\nH0heqoblQ/XsJF+DAy76sQHUR3xNYAxJvahejkyrDiQsPi9CPElEZgQIQVA/\ncH6oOpjoMc46cjrJrA/rchTv2E/5Zlbc9x+HHyltUFnJL4IVOROi3dnZpKpZ\nMzxdwMEzHCAfqJ854JoFYO/GMCDibqbXGcbEA4Tu8578IYX0rN4pekG4vJTw\nNZe8jN4cKvyzMA+1tUyYRR3tmAQVe/bqkEY1TiiIkEt3FZ4q13MLXjKvLMBK\nfv1jGbHeR9woCBsnTJEO2CdEvESXVA2OW/l+B62rGuJ6R+FZLBI9f4IpNKlg\nJs7xpehn51syKuPDA7Knw9h3+Bbjr1uwVTR0Bj60cS3HZAeLhp26wvb4Z1mU\nbr3q\r\n=F8PZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT0lrPKprxaffJir1w5oh0UL/xGi4+ibrmgUCIJ1CaOwIhAL+0qhCvKYu9J2kz971FjKYJ5Inx64SclbphXQ2cZ+h8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0_1599494031180_0.28959441253738527"},"_hasShrinkwrap":false},"5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0","gitHead":"9cd95f0a25690302dfe0f7667c411288d430e8c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-l0ZJwuf3jydyFG6VYdM/7o6qLYsMbyVgIutEZg84x38YXLsqmeUjFdoX4pNDgZewMBWw0SS5HO8dcximaBpE5A==","shasum":"3da492110c9cba4a0a6f0eb39cf1183776cc897d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0.tgz","fileCount":39,"unpackedSize":205107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlewCRA9TVsSAnZWagAApTsQAI0QfuORcubgqRwY4GTD\nA0FhrVD0QWFQhyKVDx1GFjy07Lnowe7l8No75508mcCMKCZR+/yEHaggARmu\neHAxIZIc0mfGEzi3eonsrIKJvX+sGMe5Eh4n9o8oCemtI2rmygqWdpm9UBx1\nuwMYr9lsMtW8eskVzk2TNJhuLeAAo1wfv8/ahOxNRP8RLQGj6+YjMXTiKnHr\njWH/XY+EBWT9/2NmPIbAAwYcJcDYsj2QXJuIX4pu0BK52Oq8+wgBaGw8n8q0\ndErUFdp9JcOhBLxnXaTEbOGQm2mWcJAyTFWYRoqgV8pEVYIfKJPiYdFi8fV0\nBEout4mw9Ld1rvtKyE6zLMLKvSKcC/AhIX3Ow6pAOYBgwvyLEipliAFm+0Y3\nT72CZqzmozhb+jnqpYsf9A8Ttl7vFFy/WJlf9z7WNaghiJUIZsTln4Sy2sUH\naPxDZrHqlhZgvjY0nd3OPRW1HKdvWs3+NhoN9I8BAaDytTv2QNNDwtGQG2st\nYYzGTLxCMLG2uDUMmx3lnoDJceKQcIr2/ioX/FYT0codrWIx58z8qEerD8y/\no/V9Zt7rky/i1xpAyYiFoQ/xstUuhinQoLV02qnzS2Mq7qRLimae71ps2k2I\nbqjPKOSFDjvtbUfPtahTaISVlXNiUv1uc7B4Rh5Vz20e+stBRoryj9W4LE9q\nnTP4\r\n=RHT3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZwzGHFM2JRpokc6KL0IADZcnH2y4zHcikpUH/m8FoAQIgfMJSaVSGTmHQrAEpqtLERA89vTPojYKaooYJrrt+jKw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0_1599494064143_0.7071148018070494"},"_hasShrinkwrap":false},"5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.2","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"27f03e2efb96371523a31b4a7713cfd7d5d70a28","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gXv7YDN1epTGFcMDkl+c+mDl/M/dVr09YZgxelHIUusLjrlhjgyrs4hKMXyqqqvvQRwHhOO9IqzIOr3DmLAPFQ==","shasum":"2afc9efd38a3bbee900f3f11baa61c699f3fd20d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0.tgz","fileCount":39,"unpackedSize":205107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlfaCRA9TVsSAnZWagAAXQYP/2PVEJZBr1H0MczyVb8D\nxU5aeWKjv/aVYx0R1ihxliqqLg9/sNK0Z230IqFN+On3pqYEt2qsWUksAuNM\nbrRFKMF7b48d/+UsD966ZjleYzY6fpPHax+V5uiYpFCru3qLG6KfQJUKzUQO\nnRDnVMnhlD3SDCxSOD75fNxHL1xIMbdBEr9V0uX99PQuaxngkdDgILBKU6Ve\nCTS8Zdecko9Bap5EDYyn79HprVB17kl+YMpmwniCgH+b8jNyzGP40J+xknct\nkJ6cUeOr3NBu4T01h+lTKrBm+T3V0EaWOArz5ESybtrbVcCR7uQ4gk2PLQi+\nBWFqT8v3qJ14cz+m67Y4GRwhUe3gZKKEk/ySrIti/ne4ZX4TMLYKcUicX77F\nB6aWtwkm+SpKKSquB7nbdJVxPm+IL5rgEkP5msO3DwLszSY2vgXqfoXvqcsf\ntJm45pqnyMDM3TuN/jYuxvBXxHiFltoN6hDqJAejBhCwkCE/pcsfE/xTnKaR\n8/UXwFXzUR57DAjvYGJU1kGh7lnTEoCSoq4CglRYaE4C2cXnBhJWukK55lkW\nVHm6kxnmkvR0Vr1UZkTKvSONaEhTNEeqNMbvvCyTf+7qbQ+1uvtZRWDNKwby\nnq4XQVLLWFlZNWlSCD3psg2uMxbYVN5PkK+FiQNoVsjsydAiF9xe3bngiPKI\nkezf\r\n=K8EZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/fCODFe9H5nUWih79Nkv89AQwxgelZ07r/rK5pAC8LgIgbKHX+4bsUSTmB7gSNGpsbUzKGb2HiVmAmd7tDHIgMqA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0_1599494105474_0.8813547705053073"},"_hasShrinkwrap":false},"5.2.3-536fe08dc022841a13e311abd875772c20775f93.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3-536fe08dc022841a13e311abd875772c20775f93.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"536fe08dc022841a13e311abd875772c20775f93","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3-536fe08dc022841a13e311abd875772c20775f93.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-mOtJBnMXgz0Wv5dZn6DydTsxn69nzqkzkrNaXCkWioi8uPMZ2IGW18DQT7V8k+yohwGIZ0a5t0JNyl558eVFew==","shasum":"511020c6ec8196d2e630d917388edb55a7a9e384","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3-536fe08dc022841a13e311abd875772c20775f93.0.tgz","fileCount":39,"unpackedSize":205107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlgECRA9TVsSAnZWagAArkwP+wTJCS4Oja0oNrmgh/WX\nupGJLbIq6AETs5jJggJQ2WOMZZsbB/u6vxXe8DzL9pKtAsbaLktt0vyqb+Pv\nL9CceQIysZ2RqyJ0TlNFIh4iaUTaFnqaeYk+Kw13HDILu6/kPgFB8JlXKr/d\nbeXwnasHV/mS4/kf6PQt/Mkx/CeaaADn/e+3qjZ5hJXiCtBkVfYCZG7t46AT\nIRYu2MdjUxnf2Errkm1fEXeBbFGw6YbBTD0T+5kHrLQ1CBDRJ60Z8KJPlAoE\n+IibEGzaMNUInDBr/ZZHvog6lQtr/OZ3W3GyoIYpJNl5uOfQjKgVXpl5mOcS\nTdnkaBxWTVbAVKwPefVkiTwsD+0aK3SruwunsceUmWpPCgb1++J2JcO46sGd\nViP9hVVslTVvH/x4IuWMlZ21K9lddK/Qbg27aTp4mQO0frukwbMpQmm96b/E\nVXPPz1VHQq1Wm7avntNVt/XRBdfMKO1b3Dxqsrp2PpJzcM3+7n0E6j/9bmVI\nRWig/SvBAaQ8fx3lb92V2SPUAQkrItNapGv1VmAqGSFao5mP4Jsfsbu5kvPI\nAIy7t5ixSFCPIVx3CgdoyhBMf38pIbU91X847b8Li/b00VJS6bLxMJu8xS98\nvO1D6wGlXQByDPJgr5mPqO0QRKdc2TheWEIiOCoYQ/FrmrCUwp5Rrve2yhMl\nUNU8\r\n=rue9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSMA/tnJyYzWm0wI+I/gE3H8+vesJSxgK+nIthGrl45AIgT4lzaisAbZJ7v4eLd5UFXiki4E6fzfdBWUvW7Kgt7oQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3-536fe08dc022841a13e311abd875772c20775f93.0_1599494148011_0.27694609420308725"},"_hasShrinkwrap":false},"5.2.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.3","gitHead":"6886a89e2e0236be1f3f26a0c58e9edcccb71771","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KMV0oRmtK+Zf0PAFnRr1O4Vmbw7ITSic6lkK9dfr5XGU0IQg3ruv2hSeerBXAb1VSAnIXkjEoqUEg/2eWLky8w==","shasum":"5f5db4acaa36dd26926d945b82478acde458972c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.3.tgz","fileCount":39,"unpackedSize":205502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlgcCRA9TVsSAnZWagAAqC8P/iuh4hHl9y4Qxisw2ut8\nReyWkrRCZd+DqS81AAnN8LPDv1H/vKp/DTKVIBvjtQSwEMNiKH4qzUN/POoA\nfdh2QrH9lAJElYhxyFdxIcO6m9aAChNJD0j301xtXM89xWXjrMC48ATR9a0I\nyPWsVUFxbk9GKfetq7Lg/5P7UO/SS/nJ4vEu5FGM+DlJSNEO45bAGnW2Lamn\n2jEautkpRUNfBkMXwyHiGF0iRWrX0u7f6sFgMLEowIAxnumreDked9b39nyY\nWSUEKwbX73kFnpfXxTYFuZ6YKy8U2H5GXmrpoU/fmDHOT3wT4jtDXuqwy2gv\n3o7TQX4QcUBFfS9gVU9fvMnsndsPNzIGobKk0PQP4dZZ04qn/TyJvcgBziNM\nZfUh4PUZDKnArmSA1Zmq12aJPlBjvbbvEyxdEDNSvCmgBBfHXUYwtxQopMrn\n0/fxPzXn1fyO/dzPtYk7/w/WuqN4s3jKuBHBU/O/sTcEqprG+DGb7INRMNwO\n5+Shqr8mp3gbTVPyw57LzTPU7lm/1QQddGF8V4cKe7mJ8xcnqVuUFUYy9wct\n7LnqLcXIIRRTctBuG2bYx8IUD0hG0NOzrjBr5AwngHH1RTjBe3bnNp8ppjot\np4/iUbZyZ7cqi/vCzrhuMabEsE7HP0+Zl9l5ZF0VE6iI+9vvPdRa0i/3RBCJ\npxy1\r\n=lbEj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHVMxPjcsptADUrwY993/sYwfnFIfJYqtt2y8FZjOnfAiBaGMsuS17Y3ID5s1AWKhogJZyciPFoagXhpZBqM6JlKw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.3_1599494172137_0.16707681453969303"},"_hasShrinkwrap":false},"5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6886a89e2e0236be1f3f26a0c58e9edcccb71771","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qZYSD5jWb0m83KHsX9cqnrQ7LLC3rySTEzGQQrFvZY/zaoZsJsSd89WJZYZZGA9/pE5og/GfDnY8Ppef8DrxNw==","shasum":"54b3e3dc05aaafee16b0bb1d769c9b21bd066fe8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0.tgz","fileCount":39,"unpackedSize":205545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlhbCRA9TVsSAnZWagAAA8MP/isH1Nxh8L0iAMQIpJ3n\nZwAmPEPHwMjJ6yem4mIbhLsVDJ4Gg72/O0EswvoOoSpqhOiwidYA9hrfbQCV\nQDIDvCmyVKaIk630Y4F86tMb+x4mgtOU0cRjBYhcZJpdkMEgh+J/bS55KECI\nP4xHLBqGCxnht2mst1YS9KfUFxfkhoym5zUq+dYQqlzPLfyUHIhremzx7GDx\nKl9Xy+QOzx4+jTJnSbXFpTuCN4ujw9bYpQqhJUfmocyL9dyuLICta/pBk865\nqK4ugjDbtgjqdLR/dBylvoKgSi9xQszLG1DrD+OQN7roVBKSn9lKjtRAud9R\nzho2LmPiDkRcZ5iNGgRIyCKLVoYaxTtwzO6I1ss6mRIVyna3mYlZMv36hbTH\nh9XomKKqsHbhPI5RWnY20MtixvbmX64NXaqM8kK+bk1gPrRu5R4GtVHC0k3b\nnOj/qo/IsaupB3NCt/JNduHNnrPMIqYiKpSTAyxhuoqRiReu4H7CALFLSBXU\nMyUsSNxj6Eq85f7BiDI3gSl82hzmNPLHqrMPoELVqy7V3MmdjJ12TYM+yi7g\nerikZ5BNw9mogzUWcDLNVhEFm9TuSoReAd24Fr4ZLLkIZiaK7bVjXaV7T5LS\nKXi4ctakUuS9fgPSGsuU3B9HzwbwcF5Gd5DFRXUSd4EWKBcy5LTL1CocYAtM\nxhrd\r\n=oHoO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb5bKg/+NaIc9BHwUqI3PyA8kpSf4PBPYMP5jn2K+oFQIgaUThva66k5U9ycojYAWciQxoCigiJVhTBWAEeG3WxEM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0_1599494234711_0.15901713712123322"},"_hasShrinkwrap":false},"5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.14","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0","gitHead":"a88ef65d1f85987bab0c178044c4dd473490c74c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0ERvVRa8uQTDfNHicxpfXIbe1LMoKRTSacygAqmfPhzX7d3oNxTZnn9KJqtJb71bBqbBtBQTfjx4zFk7vIr5Qw==","shasum":"bdfc7d0060a282a845984a08817b6977c3d855d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0.tgz","fileCount":39,"unpackedSize":205548,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVlhvCRA9TVsSAnZWagAA2sgP/1Ym1t30VT9/NzA2Ur7D\nO94ewYBvLVthEJpUMDTJ5WoOOqSMs5WP3556KKYGTG+4HEuBz2D0XItNXVaP\n5beF0m7zw17R6mc6spuuaNhbqcW0QdyFe2xfGwQUtcKIBW+c9eOLt4cmP0EI\nj8Ko7AahmdWc0fh4+2njq2QB6nVIxWHmUzsyYB4b4FhGT4nigepQbTyIZPns\nQlV0uU9gDuYSBOsWS+S9V4pkXvWjdev0XQkvO4WTIR6LfPQooywifO0um1CR\ndVc1uhK51J1e7jUQrVRceRtGk/c8nUu9w0HFmOqi3L4Y5hbmjvGolWMgVPy9\nttF8r60PBEleP0dEKeD1l6wP/JYjrxf0WLQGubp/RIEJeaeSjHgi/NyWNXdu\n9n4hQqTewp6a1KssF99UxtI9GvzO8ZtxOZMRpM6AxW+EUosZLd09JVV3AXx2\neY9/UBOqVTm+PSZPvgdIKRKGkqJ8BDM9X2pmRNGolsn56HwqU0KNoCkBaHDL\nXQuFbrowWGq6AIKfEmnyWnaPP/157hHGTUr9xO9MOYvk/3ap8j43zigre84r\nwGJHYRcS2TMS+tsepkgrWT1G9TA7DXb8h80r5iCFaQ8MBTbs1GQVXYL8CXvj\n3A+yZygVsJniXIIjmhnW+dQSL/13lj1VvP/k2y98bToQIooVALGZEwEkytZU\n3wJc\r\n=z5Ta\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDic6hv2QGQgfiyXUD+U43uQXB20VpYVGY3KoxfdHr8qAIhAKGvCVoKr9nXtDDtDbAbaL6elAtZWbPXnmBccanbLAen"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0_1599494254640_0.7805558390876404"},"_hasShrinkwrap":false},"5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0","gitHead":"60789e4242f4f043ea80eaf2f48a803e25d62487","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kJgpRyMegOohWghQXjYgSfdINoQxhXLs3yuf5bzuvl5QB6VGSsS54j5qzI6Qo/bAmbZPSzHhLtZxzRMYD5C9lg==","shasum":"81db9790b346809f54667d62e809478a21bcd555","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0.tgz","fileCount":39,"unpackedSize":205545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWEQdCRA9TVsSAnZWagAA2RMP/iaTCCByeqHdqhIErs2p\nwcxyfQKCofBVljZ35Nv7caAo+tkj3KlYITV46CHLgdjSSYx7UQn63xD2oZl0\nh/pQ2bp2J8xVZcp6JSwWDbf0wtAAV2SQlkffR6T/84DNT5lh0gjTA74BSpzr\nPlDkLEIWE3aR1ej0tOc/VbjAqFsWQ8YdIL4CiIvhPVqwlg/eQXTOw4FwBW56\nkbf+dNa3qb+/JnpRfmDtVTwMOtMbA4YF25wTkpK2ztAyaZRdvVX0Rq+U5XUV\nvB81qVGEqHYMG4ddbxF39IdngFzsxplINyPbjAIfY8Q25ZHHeQWbk3hZihI0\nkMxFBbWmIkUpg+x4vxxmm4gkRhR1u0FRaUZJmZ47II3e3VYEe6Yo7KQ5Xl1a\nt+aDqgFkzG42CcPciyGWhVCMzpsFdfKgc0GSKxYHZWBqz1WR+4yzPRQQMTE8\n9AeHA8Qf9CGchOqE4qGG8PCSHuM3n6/M+1IWjuKaiqQQFhNE63h3TDXHXFjD\nfKpDQvdG+WYquJDWYfmH6WQy/G+SJd2M1Zn7QN59+5CvEq9s6n50KdSPvxVt\naC2rrUVi+e2Itwv1ruGBwJQspFnv/3Lzes3m+uTzmuZDI0Oatpgf5xEeLVP+\n5kBpUiyJ+pBy+mrQqbapwmIG2T1z5jI1opOaFxoJn373LxLaTmiVWK/Ulh66\nW85i\r\n=NCYx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHiiRwU0pcKg234wR39ZZYJmYOTdz15HzKwpP1+RFUSYAiBvrgwNnZsY/OPGzVRZnNE+whMsNhkIK1jPy8m+MHtLNA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0_1599620124948_0.6557294176544548"},"_hasShrinkwrap":false},"5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2dc62b357b3c106558830736d504729a9fa02c73","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-SSxmE8LIb9DjuhIL+/v2aBTW+ZSI2bv86O9yjdrEJI+gihjLaeS9G0VfM4f4IuhRY46rwErqW3xoYy1wY4bJLA==","shasum":"f0d648b7f21125ba1622e4364ef1aacdcd80ab59","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0.tgz","fileCount":39,"unpackedSize":205545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWERlCRA9TVsSAnZWagAAVWIP/2JSfyWwA//w0v3n5/BE\nShhuUTQQod+nMqPl7TgSnhyY7CLc4fiAbZELMUPPLYEOanrlirn6OXNwDX1T\nWafM67V92fF8QFMu3nf2My6NXgiEkRUmrtOxyc2MWfefFvRhkodtQsUZdYGD\nWeobzrPbati2d1e9jAMiiGvqjFhlvCMR341fJslWuej/t8i6M1D3ycjiZ+FC\nUyPOR+BbFyi7NNiI6YwC+GgQlGJJeox+Iiw5/AhFWgQEm/XjGC+18oBNwgqP\n5HbCxuvfozdhrH1EHq8zbeqMpqSYvUpTjEFRpwIEd83W9lQxvi6yVBX5wScT\nISov350qhZtiPSuWSifbaBMQINA/OPM1zg0Th4YNyUjZg3GaimCqasV4lhbz\nWx8JWsp0tObfR3jadCooH1agx5ta6CN9HrPBDB+Eqv5GYO4LGPIIN+hKk6WV\nvpktusw2tTYrcY42vz6MKgx6dlrYkT5/9vJRrG3G8EYC+0B9xvOqRT64uTFY\n04XJhb2nQrqEKAAqcHb4r0X+0h5kjNcTKT7n+8ioVpYNdnKXnq6U7utqRFr4\n1H1aZRgO3alg0vHDpCn3SozRhobkT3WcWr310KT9fH06L3GIspVHhHMrCTNW\nAQ5U+kgJUFEsgbTFdFMZQ0zFbQCYiclRClGGyrkAlbr0XJu4yUfCzYT69B3T\n9khm\r\n=vb2C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB25LgFodxd4jZ2HTncfmx+BhoFIvFNv5GG5ldtXGG0XAiBo2xBDjFwQ88KMOnmsLMBxZFHpWVrXC3i9uPXU+MXVIw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0_1599620196989_0.9576302386471078"},"_hasShrinkwrap":false},"5.2.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.4","gitHead":"97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.4","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qBJaVESHZKryUoWpLByUfQEU9ab73sP+A3iHGwgQIL+Jol8uucajjI+YaIKgdIEJXnM3sDFLvjKG01mSmcgnrQ==","shasum":"40c04c9527af51ab2d1f789ff34e93a83e4fba59","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.4.tgz","fileCount":39,"unpackedSize":205784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWER+CRA9TVsSAnZWagAAVz0P/jVyDW3CG4pAzxSjYu42\nKEgOE4BmSnFTvDWVeGRcBsZktmfelShHlpidGBW6abi155toRPDO6fpIrre9\neg43ydkQZK8YgCJEP2IUJNB5GfwVRBNpDAmSuLh3WKx+V86goMN26O9HoMgx\n9b9BcMd4NPyjLg4F12AnLaA4j8DW96664LtHtMVA7TFTxJSlf45yiqwAG4Vs\nlZh3h2sa2naB4BLZb+bJjkhME9nIETjS8Pxf3p+9QxDqTatyZPrzdqKzEAzZ\nRbmc+irZ90jrlZMWsZte4kjYE+41r7QeldV8guAX/mmegjha8LfcYxLz/QeC\nvZ9FpOg2AQSJLOEQsDkRIta12UogE0FrqTfoNcjIVIeNwm/QnA/AIkTQqegF\nfJ0/Y4g89hsxvzNFF60GG+QPsrCr8UdyONuzVRAPIlp4g+L6eB7h4/xhWtD+\n3x+gWPJikC6rNdeXYEA3xilfyo0BXAdCsgK/Vur/r4NPUnA37S45MXpq4eyb\n0rU7T/m2vpaQpZLPiG70hTnF/I8quxzqG0SWMguNiDdL3+wCLfqqcrqqMcWD\nWLbqOLQw3iz1p862zVyoyMTi6hSUCK64m2ZhjOfSy6UO+oYXZScsmNIKP0Ls\nbTTXG8OGX5l+8eQZsBu8nBNzbza2kWkngp4bIdReuFSBLLjI4GhSAXXxqN0k\nNVOx\r\n=11qh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcP2bLc9anS+VaSs+AjEo9OXgcjT19qbUR1Be8VUlEnAIgO1QOHyaawG890ElRBs6KMdlvIwtRqf0YRkKB1dcl7zs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.4_1599620221763_0.6325431200183531"},"_hasShrinkwrap":false},"5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-iCD4/aM0ImSCFv1TJeDKK+CzxncA6A/av7j9hnxjIPdYa0qVGIONW00q0Kw0HdgZORrYRD1mEf0SKUtiL10aRQ==","shasum":"e9e92e91a468b56b1a2a2b9c2dd54b0ef95d2ef2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0.tgz","fileCount":39,"unpackedSize":205827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWESfCRA9TVsSAnZWagAAtXwP/3/MhC/aioV0tPzHy+63\n5G3qG8AIPrufxiXZfcyGiNWUfoZcjPaSVJDs8E1jLGlPQG3sEMTFVEUi42c/\nDxBFqy8kwxfqEXEH8nGHSPhilEjJiLCq62VkShCE0cIbJqAdWfIWxbjJVvU7\n3BKz9KRC5koofT+X/uaH5OASiPUAJZS2+Q1gNmfCBgCgz4rNBxytH9Cz6u2u\nOosV7C7jGhboWHWOv4D+Xk2UbPEy9J//dm8qLskkEyBJDDtZBln4ETC13m4C\nGP8ncQs7MLFukXjW7TJdsyIULYSXrn6qNHfqZYhwY5mq7o6O6Yog46wz+PbO\nh/vQYPT3Hgz/ifPhqtks4uXAWbhmLPat+FH9L/Plqn73fZ3YawY8Iq9wviRT\nvtVIqH4+or7v4BfTxEhxYegS8pcl0O0NXnjY5yw0FtDjj54HG6OvdKwhTE6H\nSnN+3gE71YoIe8iepN3v2uwChGx+R7QfcoJT61SUkmpPME1RD9d4w6DtXBHN\nB/wj/XBFSf8/dM7CF592VOj3bFPd4hBLynRfsUNLCLzu5j4pJg/GSzxEZHGE\nAHYV1zlAnpeLgU41lba7ZDE3gr+oniWZHcy37lDj6zDeyA7lemGLlhrH8qZU\n7UnqSVskvrT7WNplk4w9djN7JhVPIR/vOlvRviN/tjB02JcYqLHzBCp0EwXS\nasEU\r\n=CCSa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFuurEM5rvvNB3hT5YGDB+99n1qUkP1jyIYXRMuJ2njkAiBp+q3/DwDxrhubS0hiNYdoCblauqoNAl4SkPTwzKO3jw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0_1599620254528_0.10079321063945179"},"_hasShrinkwrap":false},"5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0","gitHead":"f0c157a1921d065880a3102f6934374ede452b59","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0U689DBpSMTgHJHaSGt8enONjHC0mqrquEdRlXUN4G/vVRw3I1LoXBxk/lzoin2APtPZXi8pgtmLdgi61/i2MQ==","shasum":"d62154bb9264d9293fbd3ff33f9495d227974827","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0.tgz","fileCount":39,"unpackedSize":205830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWEUACRA9TVsSAnZWagAAehsP+wSmvD9Ft7jXZwPHJDe+\nXc7vc4w1FNm0TKM55xf3xr4pWoRU6wLYXpjHGfa4RvITbsAgXUFSffGezu9S\nC45NxB9tgoI0///josFeDmM/VKXF0QyMp/fIJt51AvuZJUr50lhS8sJO5N9j\njBHGK0YeK65fluQ84nt1krXY6UHxcwXyrdvyK4HU8ZG5+9o+PE9nQLfxstPF\netIYxL869BYxrtBCeOMDpDWyg0Kzyd8iR0iiDfdf/XXiPUIfwl7D+ILMNcRL\nrLJ++p8hzjhaK5X0Uxy4bHmV2LTJNvDgzbk7jra4K8O3UjYHoSQ20C1z8cG1\nof00xU6xWXNVbzBmtMgQy2CDEJfJWHy9I19YKM/e82I6axzUdII3Rt9o6e6o\nflEGt6ZJr0qqGpsTnCucr7GX5ke0WZPRPpsoaSuzPM/AvM5gHMQS2ko/aMx2\nu0H4+bxJTLV9zD2vQVt/2k7Q02DT8qy7gk2oO9VhaN0RB6i3CSNayC3VGGc3\nFNaPuvk8HMeyKWN+9eQQlHJoZR9Cop3oE8j6CjsZNlToNSBKo1KqX4Uj1Akj\nLE9oF1BnDsD19J4Bndh9gxQLQlu95brAA1iePKMwbS1G2Jrr8SJ2Yrj4jOTq\npahhw6eKHrbiVZ0DpLh2dBWwZIPvb5KAzl4/omoyWIjcWyGzOmnhT8MaXFrm\n6WQ1\r\n=xSdt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdqBHNL5acEK2csbgVl5uDB+EojQMLbKVrmjazduNNXwIhAMEWkEQltgNMnt47RNU20EhQV6bEfDtxzzmSzFegUP7S"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0_1599620351952_0.19623676985321703"},"_hasShrinkwrap":false},"5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.2.1","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0","gitHead":"474d12268e86e3e63bce2868db2e313682bb1bd0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4atBSfTrNsyptIGlx/jdyDGlzIG2dAWHB2iVjgb72ToxEPAkHlSFgbtyNqNrbtIO3rEWt9EtN0kQElA0eEqiWw==","shasum":"91ffd718296dd597495d1a6f82070e43aa9ca1f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0.tgz","fileCount":39,"unpackedSize":205830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWEVtCRA9TVsSAnZWagAAlIwP+QCaT+Ovx7ksUDSXP+ms\nzV9esSyL/RQXSXxyF+aDTDcZ8oLSFDrMHd0jTq+eOZjOvsQ3QhqrgrGu/ZZX\n6JZrU2fdtx/4YXVkOaJl9HYxu6w+q3FpxallODXno0mB9fLjC9ZQHMV4Iw95\nZfS44n6fplzUDvMrP62M5TZDm33WSntKGN7tGcUWQtVgi/YYq/nEu5jXH3in\nw8tUAKIw+Rt4v5cNH5XQMMh2ufrAW8Zc200NwZ+mBIsJRG6HEUhpKB8waaoK\no+cFehzLbic5EWfrtm6SzzdhybC5VmwD774XjtyT4Ua1U3VHR3Cl6hxYdbaY\neDaYoavt0nvg7/hwa8KWjhhnAy7hgQu+83IDsoYbXTf70XWFNjo3DTFVvQDY\nI0xapLcf11tKVVRY+bvyvjspVpfHT52N6UPhTcQ7JGV3EJsZW+KMVpCQu4wp\nqbGYgNsJEmvoguaWxS1dNBrFuzz4HxbDDOQBtkAK5AmSXkafaHaSTGppZzp+\njyBWw8okolbJn1k+A7RZ5YvTfaKAb4BZtPscnTMA5Bw8sJOpusdRDWokYelK\nGuk2PmVI1LkZgOu5QV/uHcefC/f47wJQNW71xzgHzn9O6O3CvnTC2BHOJ/zG\nfUVRGn0pDTNsQxCKw3WgVkieMMPfQ6cWBAj7A5Ci3hCaFJqbH0yIANWZjCUI\ntymV\r\n=a89a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFaeJg4dQALEAR9Y/U/1v14K4rFy970UQ7vP2kRDSw0RAiEA5lTdof/HUXtDZ4CnkpFneXPCqbh+58F22LMOljDDnXE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0_1599620461148_0.04944968770189595"},"_hasShrinkwrap":false},"5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0","gitHead":"7f5caa60f75d32e2741eeefcbd166cf9ee07aeca","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FlzKELO0FyftxXq8gfO+vIlRk1tNZ+bD694wlnEakylnYpSj2MHy9hatCQXewc5b+pj/5bdBuEmtUcXQsnD1Yw==","shasum":"40c75e5f409ac543c713de58d0a8d5e2d72b0194","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0.tgz","fileCount":39,"unpackedSize":205827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcCgCRA9TVsSAnZWagAAWocP/0GRGEnzAbOzgSy2oFhp\nplCo8KBFM6BdsMfIfdkmrnA4aHKZ1p0pci6J6tDm9q8h0m0N4OvRp0C08e9g\nevPDF9launVd9M6pSqJIGlE5jm83tEj/6dwGaDjgKqKDP86sIdO5XSaDFw0Q\nU2VAEBU8CP3E72GkwILqEnfohX3vVGRIN4LRJhCqsUS93YJLXEdxxsr+KD/r\nGJoe3LRBHD5VJ8fVKdQLXPcf/XOwpggB1buVlkiEwFCvHj9tBj0d8/oFbwsf\nc3+s5x/uLZ29kK/BpvsRTl/3XHG9mSqPpoAaoGc10QZPwOAKsCluXoLaUB8Q\nefmnJTo/zp4p7+KGi2lFM1JWi8REInOnXaTmdIyLOxRLrzmNd9y/UajsZerW\nUyVMn7O0xqpygD/A4eEm+CUd7dm5S3qOgp9kZAry4pqpxKFTl4rR6dQGu4uJ\nhdOJ+S/jZW2D64bk9Czroxy4TM3m/hUYfnsSud56VggXiHtml+XNNx31IPjV\nu70IouutUNpNrDgYPycI/IZ3ua17JZFCOzB5h5XczrDJV53lF33RK/uiQaDT\npOj6f9z/1AiYWGpZGBU3RqbilFt27umXIujgzJHbaKKOuX8VCTO94FG9U94U\nN1xA6FHQh5/9UEV7t8K7vtOKH+DnYsp+3YgQKzS8vB8ioSolrC9o91JI/ruH\nawWq\r\n=RQsh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6QxQhT2K5a4h4kYXKXJ5RYCEcj4r1s7NSUh1AwuViEAiEA1z7sSy4QDC8AtBwyLeLiU9ojqZCqB+lIQX2cSYRmDTU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0_1599717535867_0.5769514557231108"},"_hasShrinkwrap":false},"5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ca88f6375ca434f170772813f8357d90ef1ad15","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BfLiePjiUHYnY6GVhCNw35m2JPWFeF3RfYVoB+IDrzFmMX+U6//51yUgRsvOSGrhzJuxDmpirhAYCN5ik5mBIg==","shasum":"06de7662869c971b0812a34db46b080f8a01dd07","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0.tgz","fileCount":39,"unpackedSize":205827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcD8CRA9TVsSAnZWagAAt74P+QHk5tESWhRbA3u2RD9J\n0HfuagN3+X6z26x9oa6QZBHnDz7wggggE+murZkHynGxxV8PsCPiaMuKGrIW\nDCUWivKMz/QFRMcun+JgTEbJnSwtezSUgT4MR/MTusFUr35x9hueooMVoVKV\nZnyhe7SV5Nfbpc+crWuvoi3stav1ettJvgHI9oq3hD0thFXMH5fg6kRylqer\n+qJy4G3uZDC3KSIgTvma+IjjRR5lm4C5oKYjcTcm/9p7ZDdF8pG9Cvx5iccJ\nDjnLTMexxB3D60Fufybt142VAgUQK2E4WOOlS0iuiZDghCuC2piAMPaJAo3K\nrcXqfbYPuObMLRlFXcbM+Jv/d326VWkQGWPNiFzF0PUANu/DDhoL6sNTJQn3\nI7+KG/MilrjBv/AoM5Bg4qmU6SYgIC5h8/nYQN+0zzUMoqDDbdhe9o9hyru/\n3H3yyAOLanBgSET/I5i24A4+aH7Ag72RkD+eZRuV4gkD0/0dggfJEfnMV1Qu\nUlkKmxGJlw6/Jy6UxEIGafaS2ozGO5B5b4A7Z2DzmtDHyUZpNWUfJy7ka/zw\nE5l/T8XCbw8vLFJAf36zxwbfotzs6w2TNmhZT+ymMsTWSzvVzlEq4LvJtG/3\nWRRkavSrEKUZtfnWVLVGVD+pTShZtKV44ErTN67DFSwzfJLGw+jRNPtEZkwU\niOao\r\n=NdNo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGob8O3MEv/NDnzEmXW7wM/oxqF3CyykH/fwiFb4YQ3LAiEAgUJGOX1SGs2wLFswFwlLPw9qseWcCr7ZE44FDAvBU8Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0_1599717628031_0.5996595148022765"},"_hasShrinkwrap":false},"5.2.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.5","gitHead":"462e4d1c16a10e0cf0661fcb716203abe5e5a197","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.5","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-I7+Z48ziPgETdoFV61MCy55BQXE2x6LdD11sDx1kOtt3Y7NMnKIDKuPPldkoVve50jnK2IFjo9jl7isq2GguKQ==","shasum":"9a33190936ea5d102fdd87252d2fa16232dba4a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.5.tgz","fileCount":39,"unpackedSize":206060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcEWCRA9TVsSAnZWagAAAtAP/1dMiELSEehnmT+RJRxC\nBtbFT2/6h3NR4AZXT0QOrfarx5LIMSSa9OJ+auwhv8GlSnnWR0GoIYYm0cM3\n/OH2jdCMvuL+lbx+jKgv3bvPCI/3EnoabNH1BKt4B4tAeI1nhIRlVsZNCZXM\nSPhtlP4Gks2/iKgG0jUKthsTMnu+228NRMHJmZ9Fm3y0AJeIgFdg8J9sE14t\nlh8PlNDGvjpVqUx2ucCL9E58JL634z3uKnqLT/m9koGajrgujxpL+qnPZp6j\nKdCe/EQ5lnJt8EYSTltkZOzysJjlgj58M8JFhYEGrZBdYA+aYURRqPmR2qOr\nEK/9s3pQuCmgarNo5zjrjoNkFtQ6CUfNmsN9WOAMu+pWD9y6bsbLedC7A6+i\nlQxbxL+l34gm3LTMdVAIqpaKN3PEBl+0rxyWfFjxm4fJBOBzC8uVLk/GBNRo\nYjIY+ytYrzF6iBsiPWyLQTMi/7IhkfYnnnBm2shVD95oZAa/OnsV625sv0Er\nI2GSAN1K/Zv0+W42OdAahLhx45cyo03GXkr3rfhbr5iZb74HEKOFugO+bfr6\nhHCl+k5qyi6Hvu/HeBal+WiK9uQd27Eqprnly6ltrbnsKa2FYbaqN2yV3T8U\nwxQtuEhxaAVcV4D8ahaCrJ+5l9mLcU6/kezkwAoCWHaiJlcz7rawSKqnLoGo\nNXvM\r\n=Vv9D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7rn3xz03zKLtTjI6YTLGpXUwhXagrO00FTEVj4u8I0QIhAIw+4JshgP23NT6RGp2Toz09r7GGZZrg/92VhnKiuq/8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.5_1599717653685_0.5513809369186846"},"_hasShrinkwrap":false},"5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"462e4d1c16a10e0cf0661fcb716203abe5e5a197","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RUZDFDv7fw+/IfwyqXzIO+D/UiHb7svaPkxB9U8B17taaTAP45URx5ytqV72j8jAJb76hVLulrLQlHFXGfNcGQ==","shasum":"16b22e194f580e7df6c5a970ce4aafa4b1377a8c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0.tgz","fileCount":39,"unpackedSize":206103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcE2CRA9TVsSAnZWagAA9BUP/RaZYXUcBZCp5H61GrOg\nZnavQDUnne89Y2dzcykXtzDZ5xg0GQ7VOIZuy4+Xh7SqSh2va6I5pLFo4FeE\nhXcmhbuSBFvn8MkywsDCIs29UzZmSaIIwFS9gnjYeQ42J4Gkk4Zrs9vEBlO/\nHFtSaB/NsXUAbVm304laZV4yT+lmPa0p+/CqLA9NaONQWGxjkUvYy6tknIk8\n3c+Ms0Z1Tb/TitSz07PQRPdAauTDbE0O5Uk96hKEJEhgsUwSPUHPbbzDNqq+\nZOjy7YlCaon6bYtY9Bk0Kh8hDyfI50ghp/1RGdM823RmQTOq94uIDpmTzQfA\nWJ7apkojfohIvx9FYncw64CxSVI1zvIfkddU0GwxIu8N1jOdVIUMsnRYVp7q\npcG3DBaKKCH9h8ZL2nkchH664wHE2ClLSqsel6GV8gz2+baZbu+PgPD8Nbzy\n1zueP+moSGDfXZPTmwVE5cgwIVDRjakPKfQ9wq0Vj65jSbyrfC3eLpRAtNu6\nGX1msXTWM90IHa/ew5zrcA0aMTeRn52hvU/g6OBDFDcXeTso2WWqgsdk3mCa\nkurTk2fybpfLZCcSiSu7PUVb43IY66nOtl/z/NeiWlqFobTQPyLUc8YPd7FO\nLp8nIiOzAg44oQ98y8Urp/NMcYwkGxzRtE2XYwkE5TgcH3aa53HZ1hqfi6d4\nBjnX\r\n=EoWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF7hGFGeQmDgzxH/5JyxQyDDni2GfXGNYF8r5L5GmTaAIgUag26Cr3SZnkegbdonpanuzQIZuM9XkSTIyZMSTP2dE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0_1599717686244_0.5962718531604343"},"_hasShrinkwrap":false},"5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0","gitHead":"2302561d9aaec3922a112cf16d8bf0914426c30e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-J/NSF2dNaH7rY0W6dh8s8mgBuEw7UCYaRpJJL9tNhEdFuSCb+Cf5islEvfLBae3LZUMbx6fWHBLtJ8bnAHgCMA==","shasum":"6117ff2485f527a9dfee9c7ec40f1030aa9c97f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0.tgz","fileCount":39,"unpackedSize":206106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcF7CRA9TVsSAnZWagAAO1AP/RcB5GUp5Gtn3MPX/1fF\nNhIYjKDFNF5Zo0woJsaGAjTyBM3JORIyU5ivHC9aq6LNOU0DgjrsI2C7Fscc\nlHtwbr1wzxVrNp5GrMJUGLK5LJfYbuJ33klsBZ5E1sdc2JoS0RRceaukTzly\nVeioTKcPPP5yYiUOsdpDUaLVNjfPl6Bi0JoB9houdnYQXQlPUVT2ClcCg1T0\nXeKqGMCibcy7uYnzzh2qcOJnW2tAOJJjIm9cBTI40S2Yt5MfMgvTTDXIyQCE\nk28AlFtaNYGIGnY7zNtvPxE4LswPZDHIoV7Ln1zrblqCH6I1SgAmKcuTi9CP\nn20/0MYMzPo5DsHdsMMhoh+X/xAQwAKk+dcjIJSPtv9kgEkg+G3Yx1c7LqDd\nSEbBWDHT8S68hJdb2bJLk0l2AazZOUlS6IRrfeCvY8JjuLaBkA9WdtweWlRr\n9/qChoPk6tV7gBan3nT+tgKFYS83la8JcNv4f4+D+iTf05NwggTXmf2h89xk\nJXyfBYViI2T0QjVwDXpR0SULnGQ5m8UKllhaGbIR8+oeKWQS9gcOuI+WTntx\nAhvwhPdADWbH7UgVlqJm/IIqAkvJx317iAOAQzsfbzQXzP9aT+6FGPd8tAKt\nBggG443CwjSr5igJHxJILes8gLM8nim0T8qEGFvzFEE75dhPjPfT3myYGs+w\n2S0a\r\n=5Stv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtS5tJbIJrNmxYad7DGD64ZELj5h8M/+/2WfKMQ2mySAiEA7NdF/Rzq/Wdn1m+5clrgB1ibGMF4mVQZq+3qZMaP73k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0_1599717754716_0.977050353172537"},"_hasShrinkwrap":false},"5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.15","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0","gitHead":"acb14215b8c524ff9806b6b044202426c69b1753","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NCPACWFDufDjptnoFuBw3PNvOD3uXmlsZAa9KPCvukNTe4jylBErr1rBVxAQxT9SMArCWjYsiZFjn/uQNl+ajA==","shasum":"9a4c5b60614abbd0c9c81bfdeb0c56a9a10dbece","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0.tgz","fileCount":39,"unpackedSize":206106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWcHyCRA9TVsSAnZWagAAQ2kQAJEbg0ycB445rF8a5+xQ\nDqZEp9VYGH+GSO8XR777fpG1r9+rfUblmD4ShhJ8zW3Dk9xqMsU3VM4Q7BAf\nFrTYvdaJcHTWtnhasfBVUspKvxe45EbGDSfuURhic0WCGG6pKd6XJ9G22oAI\nPP4cr7pwTxCW/B8/mYhK9PT4ACNyMZGoKQg2vgJ4USjJ6lpnrAtwptpXxyGX\nEUxuAJTaH84t+jX3mPbQNXmRDv2vvZw3FEEbd59IEbgwUhDawPGphXOydQAG\n5gY+LuBFNTtr3bg7Xw1PmUX7CwQzfWUFWn5pRDVDGqU2ej2YcwSnE9ieHgTH\nQnvRRDIHP/Uk4uVwa1zU4eoF3ToP9nJwK6i1rVHhnz32cIh3HY+RedT/9HwJ\nP6JIjQ5O41jKvJVL0rIo59pMhOGhcoE7q4wZ3cSVwKBdA6pYJutEbY/JCSas\n4XaibWLpbYrghlvChu0ukKKextp4HjIRyIryqqHDvnhRSdz44eG4w5w2nhuz\nM0OD6OpnxecO0wg+nU7ijtsVkhrGJwKvDJhOtROjYtyAbVADfSTgCY3pD6H2\ni+QqFcRyGQ6uCLBQekc/keg/rcJzOH6qZjgXQVfyI4dQyDTJqkWJC2Bdm4dA\nvRB3COe4jAnOGwa3LOvgdvuWcnChVQbjOSp97ovUVLkKRrvU9Og+B/hOFum2\nigIo\r\n=WzAb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRSaseTSuW3Um1O+fm6Xh+OIKTgrB4LMk411mBIdWVOgIhAJ0jMFP4amXELaT8nwS+hTxKp5xuxp2YTuXzNrUDlADc"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0_1599717874033_0.9969289219548576"},"_hasShrinkwrap":false},"5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.16","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0","gitHead":"21ffb92218e279bccbc642df498655751f0f446f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EsrmqH2T+s/wogtdcFsB79oPDOVs43HDBWHHFLN2ox2l8EBon1LjS14dZC77y5wf0EeTBXq/aEBVJfvCIqjjqg==","shasum":"19a523697df86d37443ef5f1c64f6c9e2d9ad0f5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0.tgz","fileCount":39,"unpackedSize":206103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWgvjCRA9TVsSAnZWagAAPQoP/0QtxZF/ESYq5bsJWxaY\n76T55XUxrpgDt2JufYuLGM1j27rP5Yi65jImNjLLSRZsKBf92PiVwYru7xyB\n4a4p6AutBlfke9RcxTec3fwsfWpbmCVwF7FxOLhemQ8tMzGlEPyjYF0n+Xe8\n/Ks73SpojAJoffjvfzxZ9sHiRzpfuNFoWn6FcM0S9E5BIPdEdtGsBZJ/g1cA\nlWGvkaLkfJ1olz3pcn0pevbpWyIJMe0HQyPvwmQRV3qzjLm8ODpuOaVr2xzZ\nReflDVDktCzGqCWOXH6Sp6sXbxE5gscWra056+YpUXgE+bDAjlfXT1YtGUOT\nYKo/M9DUn0n1XYjBoXgRc14T1xbnQUChkYA5wn89qOW1c493tioQ/WaHouC3\nQ26u83krbN3TYKmSBq0IDQ2ZGAR1i870y+O8o+mGdyYL+pUCZP09b39bJxSQ\nSkI0JDIQCEbXtN40HfSmPRtwx9RruTmEQ+CZDG26FjQQBsjPWMcP+sQbXu7e\nD6HuCTqA5NoezGqv8W6RGzo0ZzejtrRL2b7OyPeked3RL0i34qHpnoDOOehW\nglWxXHRwgfhy5O7OYaLEVYqLRONXdBSFqTvkYoq0c93/P6nwNThZo1xyMBZ/\nxGEhhBGw4DDttlP07UkONi04sKB0Wk74JaoyVZdsJq594O+Kf+WIyZh/LV29\ns8aU\r\n=2e6x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy6S4Arp+kBiQVVEPjNrlFUDbjegCpLfZSkpsmEEmqWwIhAI4WNFRb2pV5T2ip3ya2UOI39elSkeSgElIWcL5ph4bz"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0_1599736801731_0.16058801544463464"},"_hasShrinkwrap":false},"5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.16","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d46693ac91c771660e8f9f5ca8572d75ab643a55","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wzaT8Y2bYYh0Let8lP/jc4xHz1rlHkdbEjuxzciX4U675x1+TV+ly3XXiprcvm9Ov+J24oris4qBEFdHtXQyFw==","shasum":"0e920dec1945ad91b0a2f3d6ff58ba2b3c6ce27a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0.tgz","fileCount":39,"unpackedSize":206103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWgxACRA9TVsSAnZWagAA/7YQAIScLg23yWTzcILKh2gB\nMrDessrVIdSC5MUjNlHkBBsR3cRUaOyjKWq6I5CM/YVWl4Z8loUbb1CWScgP\ng12KZbjQUPf7TQzk3Qx3DIXPYSe+cZbNN1PCG+idyjnhFXzN5a+WrERIFr1g\nn50f4iXMiiWhTA5fQmpYhWygxoY6eC4t4OiRp3kvNhRr5NrE/cHeoCemUTMb\noP6D0RBlaBsjgeKysQAOE+nC2lz6wTCDdXCAbpFVTWbLY1uhjboE1Xd/KXEB\nxD7PfnuVUGePc/szzxXCE/porvr3vvlInRWZaOUYqqulLlcBTSis9MGi1Z8U\nx4LWo5rPGy1p5iM9Ha0zhIIFnpcXK2JARjevL0+bzzkkPi15N8zXbnycYdB0\n/mPQ+Hroncj1SZyGIbNQSjtosXIP0LaiV15x7wco6dyKkKdj4rvmywMWy/0b\nHsI0cNdyLJg05iUyZ6y+dQSdDyPGMFnAmUhinbCtcveg545lKbms5MThU5os\nJbqAjigubawkRpMPmXgDiT1yQi2CAScJdW/UR2TycZu2b5L1ZzcAGPvpU8TD\nGobVkNp8P2VgQ+/EMh9Nj0xQafgGx9QgAFj8gdd/HhUYsPpFVvppqnMMULaY\n47sss+BKP7X68wqLo+A8U+5CYRoL5PdbMufn+uTv529xtxyko6EpGtX3NpXi\nFPFW\r\n=unNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMP48mDFX7HjaJW0t0yYjR9hnin+BIKc031Y+IGXctqAiEAyZ3O7GPIh/dU5KiJeIRRQ5/M7CACmVGWg9vu/lgcun0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0_1599736895528_0.45783974665279836"},"_hasShrinkwrap":false},"5.2.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.16","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.6","gitHead":"47196f42de46c8197a18e7b66d009a2e2c29a621","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.6","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vVh29CNsbBBEuQm0UT36vq5Ign0haHHIrw3GKBrWgWHS9AdKGYbiUG5hSWdp//VSXGryEFnEkcu0pN98IDoJZQ==","shasum":"0f73c7807b5412c66cfb5233eb84e51ccd131213","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.6.tgz","fileCount":39,"unpackedSize":206342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWgxKCRA9TVsSAnZWagAAQzsP/RJzprLN2AOR4TE6dq0i\n45CHf8b0w3DMcXDPbCR/cT+SL5PImM6BJssNqYFzzYkGMOnYWjlXY1TpUZrz\nDnzC5m4MZ0firj80fV9VFzu9GI4Z19pxHCK0+SSr+MsZh8VOW7Yn9kgjNC7O\nHuZHLEFZYyPepFSgNPkot9IvPV9zTd0K2vhjovVTA2zG3slUTHCELQTg6ivF\nXS8YX4lhLEFrpDnvEgdKNy9F77k7mrUKPnyeWzxoV9M/Xw0fnjvNCa0zCckW\nYi1ar4Zj4ksSZD0YliRCDr/P78N3Z9mJvX4382n9Fn97lKISXANfxP5yESqK\nnG5rY2RDLpavSyb1DK34OInxirurYxQV9YGSMofnXYEDqlpqR6pzd/dNJeUA\n+TB62VSssBE02Shq+iB28JW7vLp1qP3GHHj0/RjVJ8v7+GjezJrP1457BVnf\nrzmDB+M3x1Niv5wUFwQ4K25b/g5h31GIzVhCP7FTDHWIK8i9JQGNcE5VGDTJ\nsO7YVv5IKxIdlXXPneRFxJ402IxXr59Jsbi6fliLEQMGOBJbZa0bAmydOqOM\ntC5xNPvBL2B9UYdKgCp3zMGqm7eDWAL1FYbVQmX+SImE5KARyxddtOgpa3nX\nx6wBVUBaQ4f79SptbzGAxggAt1SFwhxzRIkI3IdE2yLZxgXJKRw/9ophvva9\n8mmA\r\n=1J1d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKeQgxTCCy9jhuYcVCh5S6LWGKBG7BrcUc+UsOGVJKXAiAQfabDpRWn7lUMOaap+h3FXRQAGfPk2fEt4oD18T/z/g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.6_1599736906148_0.7456479675843384"},"_hasShrinkwrap":false},"5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.16","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"47196f42de46c8197a18e7b66d009a2e2c29a621","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-uB3zMclwo6yXD2CpFKCx2BGIxWr8x1PPEOLWDdp9H568u4jRTHjCBCaNfqWgY3Bu3oWAcfK0uE9qMrfTeDSZFw==","shasum":"259c7b8c3fae0c8080adc45a75a8e59937f34162","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0.tgz","fileCount":39,"unpackedSize":206385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWgxvCRA9TVsSAnZWagAAapwQAJjWdFeHk2Yi6CHZOxGS\nNPtYug/Oh8iUFAyX6qJpvZPLMMXiIsYmrOSIo1ih5KEaTrxk7LQ0tPe8V8oa\ntEa07gAHnyZ7m/OTYnsGnUYvqM29mpGe/wJTFihOU/wzjNTl7NZfmnkm46MS\ngs5E2vUkQfTPm8zXuLNirDSv4BcScsK5MTZ0/m35M195px3INDyCCAr9OBIO\nstJUACljJcsNK9IgH1dVZMiAG1utuQVR+hLc5FLD3kB2kE/k3uf1saDWAapy\nM2DtUlpvJo9sM4CAucTN6Xr7lSohpM+7WCdZ7Rcgh7XtpG3e0FIKoQ5x7/gh\nRatP8rwjYQe0HUd/NvNqOnbWSwT9wFs9myS2aZPZlEjdfrJjYMZL6WLBeAQe\nlmEsW6R482kcY+WRG0p3QHZKnTaVsCdVAevKGnpgvKml+0RV1Epep4eiwl6y\ne6H9JGHCw96hYwgefXYx9mCZGKAtHh+JkdMTD57EGHyoNZQhN5SORG0nejRy\n4/WFoNiokWkgVw1dHYx+Mjqw7n98NsWv+umcCLElsStDKgCaNedQSiFoADMf\nAHFuB03ZzDAV+F1Eb7OuwRncnXK6eDgAl/kVgXC773bAy4coukooCF6IDodW\nEESxPBTQd/WkIIEcj58jrEG0uigvImWjrm/Jo4rySEfZklmep5sl4DwciAUA\nT/6h\r\n=oPbC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCOuTdoYkqxlugoYlc/eSW/aAnktksOVn8RiBHC9JkoQIga7HOHqcGdpEuFCJ5tlFD3Wu7rr1/ZNRKAhuBMoma2Ow="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0_1599736943050_0.8081641403987019"},"_hasShrinkwrap":false},"5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.16","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0","gitHead":"b8444d08cbb7091527508b23695cf1db37b534c0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BRFkrlKo0dRIprZs1g1O35K0/ZHazYf5fILQ6pAuAoUrhCt3P2OILfjCsA5v5+YVjvZPHdFhcSMQDc+LSuLPUw==","shasum":"d58a5f92cc78510ed31f1caf7a7bfb864752fc7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0.tgz","fileCount":39,"unpackedSize":206388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWgy7CRA9TVsSAnZWagAAff4P/0K2KcbXyatP8e/kCQUv\nwhENh30pfr+BkH3Oybc8j1f3TFKY3wgHR1X902srPbAWU4aebXf6tijQ8Wbj\nfHeLG6avpfwKB/etuz97q1mgNLk/w2Pmx0CV892+JX0otyCnDslsRaZY+2z0\nZf0ds1mDpz/AvtO84Ieo4FHm/43KkiuatS89+UDdpVJest/VYNm1MDlbmDMg\naAo1IIYxLRJDn4p+o1DBJJ3VNtSsUNIMeqV+3Zbub9hN9VGXISPnynE0wQaq\nLLy2kwv66I1IM/7Qqa3WRB78HCenXDBiUmiXPB+AR1Hf0rMUMMNU9sf5mlCV\nPCIX2FCFgcLt+wXgYK+MFu7JX69et317/YnhW9G7EwK6FzNL8ivJMfB3LhZ0\nHV2tiL1ghZ54Ljb/zDhwljw5pIsLvallHgMVkRmXbtjcHAP7wdBwAcvyQaDL\nqw297b+HgENUlSm+jns6n7upZn4DrwaptZpyrVytGQV7qLKhzlCZOzCYgkPd\nDAU7o261vH5sd6pE/jTPXMRL/CdGRoJWlFYqAb8V6gGTX7mgLci7VuEUqyB7\nAYSyviGSy+299Ja+7bEimm9oAZ2MVrNo9u2CGM6ywdZDP196LXAeEcJ8QiMX\n/6GqItKnjwtZ1Jf5WpRGblEnkCQ6LtrRGKL8t1wq60fkHsQax0f8tLd0V+/b\nsR1r\r\n=bQ/T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/F1tBEVxAg4S4wJmnYhZ0+oH+DBmr7JNPhc1YKl4PaAiBzcILwJPUXpeYTovZBTG7BbMEm3V8v+tbhYUEkQyOH6w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0_1599737018982_0.8989382575135347"},"_hasShrinkwrap":false},"5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0","gitHead":"2f3a9980655567a02fb2ea3a8efe47fb4f0739a3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-DdW8CHmke2882CeSMkyDQGELrvR6pWe191phXkJeUpxaqCqwGuUnsaJki8n8Wb5qK+Ha+37XhWdHQqDUKk2M2Q==","shasum":"5b521fd59acc9935fa43212ab62392bdcbb4e066","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0.tgz","fileCount":39,"unpackedSize":206385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW3+VCRA9TVsSAnZWagAAzwIQAIjk/QlfDh+kggs2MpkP\n6dMZUg/gMhMRfh1+4eFB9flOCwVPPuEIhAuMB6Mzf6tvX3EbX/oQsRfTh2vM\n+qYZMsq4bAjoB6HfMyxoIQvtRyXxokhEq2L6rcjvXRfeM9SgzU0cK3yp/EGz\nQKS3Z9Y26g8+lfgonR+e+YBph/Wo94S2RCCzRkH9B4Of+OxuxgLXysXr97Dm\nMPlEircGnLh2Gxhyr82DwzPjGdqlD0R5Xjuf8heYasiMMx5XXyqQ7SfJZu3L\n6Fy0enoCAzNCIGG+XMCeP6Y6VAChW4SqqYEL61dVKSI5CpaONB3+/RmZX3vb\n019wttWi567UG3STYvLwemQkKdk5sKkxEV2MngpuQsCjLFYkfgpTAfHOdNzA\nFzZQ648GYRvHbCIRP4v53xO14Ze5gs6VK1dtAcvJAsGK7LVqT5izSZ6eZxHJ\n9QeeqJ3x/RlTuDtHsQQ7Dp/NZnJ38aOW8okUWPndgSNWLb5Ry+YN0JGkncOF\n+Xpu7wR750X0beEfsHe9nLF73TzfiQkCzwKki31qAyvTa5uxdgcUulTk4hlF\nsT+z7LmBuO3f5gfVbpkAqyP7wL30lNxG6reC5Oa6tLQ1yja5DjbXdgz/Fwhd\nQ6j+9TWmTGKRNs6rEcW3OIFm0BBGw5g9gSDn4qUjm4pAXFRVvipy5j4TdBpX\nELFe\r\n=Ot0S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWIgjDtbCGuFWUPDUaxYkdWB9saGxmPWksUkXCw7kKaAiEA0VimFUWCZMW9790O4iuE4qJwoqaWU8XuVMcwBFFe+MI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0_1599831957171_0.32746347455326474"},"_hasShrinkwrap":false},"5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"01214931b241e881925b770f6c0a614f69dc52ef","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ca+GpNeHS1xZ/ozgE/DhfZAusAI3BLsSoFPWpy8OSdXDMVR1NIa16Zzj/K4nimWWJ3IFyYVCoEVyj3TvSReKOg==","shasum":"1146714b5041bbe5733deeb8dabf107f490ab3a7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0.tgz","fileCount":39,"unpackedSize":206385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW3/mCRA9TVsSAnZWagAAdlUP/0KiBddSSak64kKsFrAC\n2FzgpYB+oc2MWTKm308isj1cqahBmSbtyGDg6DoSB5DUfOkoYtq2V7aud7xl\n1nwoNixT4KeNR8tXiLKnXV24fnYrTVrKSiqzequwa4oa7jTT0WUz+n/Wgamj\nlMgdUa2YafOkmKF/T5mOz6W8TfoKNXCLQZwGPh25D+oqKqzq1XG1oB8sUN6t\nSrv2ytbS58KNl8cW7z+QcKdguNWvA4UfDgSU4UnYPjQfeW0LI2ksGRr1u3tH\n+GGYtgH92ai5+EXRTV/JLn6dki99ZJtIErymiq6bESkjylPh18NHZIpLq+FW\ntG5svJrJjwPU+xJTbfbWuFrFFL3B+2mjwFLRCfyX+A+MZRtURlgxjui1W5MG\nw5O/76cE2LsZgEOS5ihddQyXZ88I6wsAI8/UA5M/m/lQHrmbv4cWLrY0x+Id\nl55ucHMQliy0RcmmWKLsraLqY2I/QdNJR1wmKeOSReZkiM+JXjg6EiT+WPyW\nkeUXZDgcXh/eOHsxodYQcVBURtZ6bsu/7K8jWntOAy47wZD5Jr72QkJsaE6K\ngarX9muDpwW0/aL7o9ITPWZb8oh0gdS9uED+wrQ/xI11dr06GEigXsbSrUUj\nBIU1mSQt4JX/S4MoQthry9m6T0ZHxyhbVCl9jcfd11NSsk1Mr0WSyKgFCtT3\nWqlt\r\n=iPEE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7L/ZjM8o47XU3fT3JDuHc35aHBK/3RsuNnyupB7srvwIhALieIyDqrl8jEz1LCeb4SDhT7m1LxumUs1pxP8nHwiaF"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0_1599832037687_0.16686603961395963"},"_hasShrinkwrap":false},"5.2.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7","gitHead":"7b0066857b7cdb9946977087fe9b5fae28109515","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xgAXNT1LXJt0w/WczNjyffv0/eFOWL64OiP8JBPYR93gGOAM3EqKOCuei0LaM2mL2XRb5DzOa+NR99R2sSXIbg==","shasum":"dc03f0f9d801e4dc84150dfa68ba682fee0f1133","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7.tgz","fileCount":39,"unpackedSize":206624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW3/9CRA9TVsSAnZWagAAkBcP/3ocJrZa+Zm5OSYTyArr\njqQXesSgq4K/+jamdRkKaz/u/grXTeJtqts+Wocnq3s4jUEQrgtCulw3pBJ+\nEj6IXUhvSA6fLEVYStF6Otp7VSQ5TyUjwHdKKjCkqpwplUxSKNxIfwrJjehg\notJOhCVNZlEw/xjLuy4WE9F/fZXjTo5yfvasQpn+FwIQGfTyg08o3G+dQgen\nflMGoOb+gin2nt4Oo07MeAXVrknH2q5UFWg3Xs4TORDIWlMnXaNizsScA/zv\n1Er0YxeHeicMO19fgzj2suhRphrEf4UDyl2Zx3X20y4nFkyyvsaw9+oVGCeb\ne9i5oITvh+P7uXphzIycEBa+mNOyLKhnMUtUZeqcVRHCq778Lp/SnxTUxu4R\nW3ZBiFxo3a3j1lCj312hy6t69RZtu+xJPmGk7k507a47NbzilnxWKVGrfOdh\n/OoB40voyzHGT5JGI5mj8LFpk2MREAHZzgSuZakqkx/ftNut1KywxVFN9nM+\nsl0noRQeTIjah/26cF8wJj/XzU84hullCQkW9/WIqdfVVffKYo5/wZISeohO\nFgqUgnLuGaqlMcf5sOUg89BnEDAlHqZqDJBJIinNaiUxCg9Mchng1voMWwiw\n5Z3NPZPfyR5FSN7gceddXJM7Dm9mv9ZzQw1EE7DYFMqtuhUhW3HpdbexY1ep\nWkC5\r\n=8wRv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjb9RuPoh6ZGWH/qZMT0zs70USWSZ5SXGDP4ndcpRJBAiEAw5AG9xkHbi0P7pkDAkPvnpMwnKBdavcoE04JPfQp18A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7_1599832060517_0.46541896250830517"},"_hasShrinkwrap":false},"5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0","gitHead":"f6fa686b424c84a03d9920f727fb2634db814f7b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+9HoYo9z0041Q016SjI0FC14VgnnjpV5JXg11/Lynv7/ZXErysIOuWO1PhUcGUOt9l6ssqljstgSyqoaa0sPqw==","shasum":"59b71462dde5eafc9851e31be7671f20fedce340","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0.tgz","fileCount":39,"unpackedSize":206385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW4AXCRA9TVsSAnZWagAA0YMQAIe6DrVWLqrB9QQuIBuv\nXgUInSrdKzMfUwPzWukAeUeReKBe6scjGL9BqcXiv83PSvLXK44HiMPmsaIy\n3ErAc78AQhjzQXGx+OSLPzHBioQQCesqGzxSX9lWXG3j/F1E1pPpIpkLqu6j\nXVKh9jJQXBytCZTAB2oaKHVq9tGXoc+4LyoyXnmhIx/zIQ7qhWu5VxvbhMFq\n6RouGWfO9L++FimzyYxm94ALO7RSSdOJWyqj0p+T4GjGS2ZCeYcQtUV/TYb/\neQKU4PU0NAP5sJcWLp3zv1EeC1WjqjuWcWZRarRBIc1SPsb3E902rJsv1mOJ\nmsrfVsjkaCbsEsAbi1n6K76Xh5/HZtISX9gQk1eEJpYL98wC5pjORzJ9lfXL\n8Vy9FiH3kZQThGz9JqlAro0g9cda+kP8YXtZ6R18T81bZw3tf2Re75CSjaH3\nrGuxRYtevX0U0YuiT0TnMOJlQReu/kG3gEwa3pePn2+zgfNAduMwsiLABzjA\nkNZTYbMqzs0Byv2ZL1YISSopbYFQsbK9YFKTclRGOOmYJaWXycILRr1ZN8vv\n4vdDMmEKId4JBbKFUZg3yRcJxiU9WTJ6Qq8Kj1G18hqdzJ8qHzl2tOrtgkfv\ndV0ycuIV3uxUnl5RNs/z/SHZ8MHQIjmOjogegBSxR79YSEuVL4GVZ/yxf9rt\nu7d9\r\n=7u7m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGGNJehaP55lwX/S5UqFwDQyvAOws6m8nQvOGI2KyxcuAiBpo5fNQaX8beEfBdLAcyPdWb4IZWjB3A18nVaI/oQ5Yg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0_1599832087128_0.6964632285669587"},"_hasShrinkwrap":false},"5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7b0066857b7cdb9946977087fe9b5fae28109515","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-/iMtoK9DhQG61F59GaPkbh0MNSp6Sv1CNY4tZWlsL2sjIJoBejqfuyYErGX/4RTYxljD0XQ6U5FrbZwFuc0zHA==","shasum":"069473989bc50f36940507a875508a5b45821c66","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0.tgz","fileCount":39,"unpackedSize":206667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW4AkCRA9TVsSAnZWagAAwkQQAI8bxCsfcS9NB2dj31+O\n6YKWCivQs9Waqu2zq+87mOzCBEL61LFxEESuUC69XcAwSPRzxDOsVMaPN4FN\nimkoo4kt1ieYBRTWB1uR9dYxKxoEW3Ifq7tJpT8UqFOIp0iXlCQ9SglbLXn6\nPiakiZ0yD1UByjs+BET78ba27mPcBaPO3qiEYg/S7s9mLsh0YKxL8ylhFa7Q\nwAmq70cUGMWGEzC4U1Ht2biIeU6naNbbtcx2CiwGzHt9cYa1dq6rCwr2MDsB\nEeonVFRJWDbTSxdDUO9V6RAzOdb13KoiwbEFQLkqMMM6a5GdBhnoSp4Nc8DB\nb25rYnBob5QNGC6KtELcJmZfcw354vIHZXxYsXDuUMZmWZ39zMc58dFZYSJX\nISxT3OB0NG+ZqMZm63TEv83AB+0U818+oXPpx38l1NolrVjUKrSqukwtIqqc\npgupHyPHGaMgDcu4VQwaRiq3ZK26wxuDNfXqlHLX1vMaQAKEyCW/LqOsYKLh\nbmDxX91BlnUF/TBceej8kQ35Eto8wOWznJX1Vyqs3zuNIwMp69NBjByZ523X\nSrtJzUldr5eclkHELkKYrR2s56FTKgFA4mdpNluCXDPPlIx8Edl6Du03sgUg\nYrOAz+/OrsPh7R27AH8MqXHPrYeEiree54NKRiOR0fwUggvrHWWu9dbodG6S\n/AOD\r\n=VGPY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwCZuS2ipFpsKr6jI6f5peDqJ1JY9dWCJi/GcI8EDbhAiBNDr74czcU6WqUgSM6DzYFlWb6lcDJPPTotOvrrEYPPw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0_1599832099738_0.4876984285151367"},"_hasShrinkwrap":false},"5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0","gitHead":"e351a56af21cc37a3d26115f51deec48c721f7ea","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2UrYd/E8q7NgRb1w09Iwx1NNOH5satibCgm2aRJsrYWFPhIo4V6QTWby825pnxZa3s2nGAwrdrKQgYkRyCR+IQ==","shasum":"af0b5316dde7e626120766c0a97261cde9c87714","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0.tgz","fileCount":39,"unpackedSize":206667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW4BmCRA9TVsSAnZWagAASaQP/0cVkrWAJmq5rxeKDz2l\ndaxhKJYf0z+2Y7RvPogolGPDI9/EDhrMF8ae5D0+VYmTxgMhHcsn0TW1QsKh\nCXBC0tJFF4DVgTdIB7iAx1aLvMQj5sedsHwEPTJVlMikVXkJIeEMqGvdS+um\nglarLxnTpMNWXOcY2gAnZOCjfTX8/RY0axfyo1B0Fb9+IhHRXQamDpPJVJEG\nzRWAbByXv/0ilAfrF65PP/YGi44RmMQY+KThyswfOLdYJc85/Ck3xy50u32m\n6iWwy1bjsjyGwk0SLt6wVYonUMWz+FCgHL9x5eFt7tXCN4yH8cFBdFU309ig\nUyGsGk/37GUW/BVd+mZDtV08GgHbP9IgufXVZX8oGnEbimeMN53CksmpoZ3X\n9jsJt5d92RXswbzqwjstqUMgHDwLn6BrwEnVV2jsso+SgiGT8B9pBn+ZeX9n\nyQvW+KHhk/qxLVF7zenx4AGAm3pecHrJYKFoSLESFnbiV/oZsguo9ZEJF/o7\n9awa1za5ZVnjrAOci4NBbxBubgLw3HFLeGHsJ7J5NtawOnghIh8fbjogxq6F\nhImmOitvxlwOM3Igr7pNGkpFRjkSVGvov1NKny8y4rLyY02jXrU12zjIK9rT\n8dxxctigSgLxvKbMbNu0ZDQG8EkcLtTZ8mbs05E0NHgW9mqRz3XL2PziEhRN\nwrNl\r\n=qnyV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBA9vCeqGssKKxnSiHAyrfZ53ppv/nz1NL5fe9bjH8dBAiBkCfhpPB+KBsrgAwucqj1PhH9W5jBHu9N2Y4AqluWphA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0_1599832166116_0.12205486516722419"},"_hasShrinkwrap":false},"5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0","gitHead":"f4ae59451e3b6f754c7c1a2d23208a0d83c353da","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QMy11dHz6jKMz5VKC6a7toYFlZWSOks5hSJ71XaVVfcr5ykL/n3/TrBX9zxZbsSjXBgd0sOvMdDOPX+IGg2mzA==","shasum":"b7c208d4580d3eda1f29dda8098ea201088ae1aa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0.tgz","fileCount":39,"unpackedSize":206670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW4B7CRA9TVsSAnZWagAAP4IQAI8CnBN8IWUlIy7Hft7x\n0gDrCDVy7KD2HvyrFYKDdeC7DoPIjjyUFc/aIs6IMxtKSK/MpcJNLisIDc4h\nQ+HHcA1eWN+BjgKxVUzjwgHM0PqMJYF/aKcfAMChQkFy4Gjf+GisvjRbSfMx\n1/dbyjBmfGik2Qy8mYsraoG5SUCe7oInaopHaILbEsHfVtsyC+dqRGwpmViw\nejnoJtVFGdyoXeOVm8A3SllE0yAAhDJFdyonoTexHowkBSc9yRMFu9JBxtSE\np6xirCD7JtVsA4N6Y1X605+5UxGEVyMU0t1Igk7fff6r/rxfrNkXZPs0q8AZ\n6PVZ5Tf9426/ZsXLEHnRr2NIrrLg2tXi7oFeUeWmKotd46Nb7TJ2SBJqHszs\nly0Sx9DW9t6xvl/Iv25L9Zij0ErNy0b6AKmH2cz3+VfbWb+fmNlTZD+klznK\n28khV7HdlKwAnfgSdX8PDhZswNGdhoeRkxyFw43j2d9F3E3FXllfwam0Fnx3\n+dkJAicrXU12t7W/YoMGsrE3oAUR61JDE0patfacmuhFYd9QsjPi29/esGUM\nsyMSjqRzSc7P6SlgWvD9MC3IsRsH8EHndJZpr21bPSWMrKwZD5V7abf4OBgC\nqDBpn1lI/PTLKpBdvexD6az6jsuH+vDYSbf3TQiOW4Nn2IIvjQaOJvT5kvu6\nxKwk\r\n=VadO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaPnyOX6gH6/8DHOqZquhUiY1y59bm3YMXskRwMNxL5AIhAMu2GIYUb3p8jXdhLyzylIcaAPyT4cSwTz79o8UeiCo6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0_1599832186466_0.6948450788979932"},"_hasShrinkwrap":false},"5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0","gitHead":"236ca8a5234771e00e5761deb5ca0fd9aa8768fc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-flIrY50txtBIs1UQTGlf/XuvrcBXzKeQNLbklHYjEel7mRQigbj5rStZiWstnInjQ6FQ2+nqFPsA6xVndykr8g==","shasum":"aae3d0967b9a3170554c2ce30807388c98bcb463","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0.tgz","fileCount":39,"unpackedSize":206668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeMGCRA9TVsSAnZWagAAy3YP/RGGHL+Av2Gh+OCdUowr\ng5/TEFIW2YpVd2XzP2aDesaH1Ipww4R9sspkpW6WiSWEws+ZpG930hnkHCL2\nc3fGy3XV+89e9Fm/jGm30Fo2qlLrcuNu+h+0VigFWV9Z1fZgkhSehssv2BF9\ng4MQYOaiDjm/v/magzTwLz4R7F7LQ9/V8VHssWJ3TMvB+vcGkZNwcqZQkKNy\nNRqC4rYOqOvkM5MvzqAK2ZTGIvpX7IMepyGJOsUAwQlDxd+5v//E9UOphRVx\nJ4+2fH6Rpns4kPWhMxyFV8AjyMwNatrOhrY9lKsZFpM/FTnGtSyusqqTVmix\nufhcA2DM6/at1vbHuiZSvkhvDXHI02VhOcGFiC9STlotES6bA84w5GwsotjT\n79H0rCdjeMMqVTZkE15JYC0Tvma2l17sRw3maIKRr+1Va9VZYNoykAIR+Zen\nNz+neHx/F6a18fTDgHG1eaZbSVY44L9Td6acMsHBhcRma78zgfIoxbaKOy8t\n3hNhGbleDfnbW9fpWQ3ZDlQ3TVENQmRCYW2IdRWTI+wrMsTgEv9spKgVpoWf\nCUfnxxicO9I6sYJ5X8YJ1wK3xqfu1lgNsmFffG1dZx9lt28Sbiwb5ORzLsow\nDO9vdU2afZLDxMZzPJM4ewpPcIt1N7ypLwUE4JNTt/0i/sMIYajmS4f1JwJa\ncb0S\r\n=S2Dy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFA1fX1maDARRKclc9sf1/avLA+374OFDikREER3FngAiBY5B64DLnUAzJE9jynKMEvbukvKhCKTsfDpitXyX6H8Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0_1599988485821_0.11969498566917958"},"_hasShrinkwrap":false},"5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0677a191fb824b905d85d0a87a28b5ddc80c00ff","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eAa+T2GFQJdbH5A3ywlAwdcsXg/Dn3RLtrsmgFs3UzPfjJHL8ltxwtGsLB/URebRndBJfZrp5jFHsXeQEYIaLw==","shasum":"19c9d4a70e460b09c98d8f6b685fd6b2ec5fb11c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0.tgz","fileCount":39,"unpackedSize":206668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeNaCRA9TVsSAnZWagAAjxIP/11I/ohtBsyHiB78PNn1\nsf1QyFBcOJx0XxVOvSj2KKKIU+sp7zUzrX6Azg3sF95K3rzyawvQ2E4xVCMz\noUMOMQJV9z060NgWOi1chjEn844fovuykoUXzjYbTG/JXd9HAhAZZ3Jo5sO1\ntv7TeMNjIgzOq1ieKuOYyMjLbEeZGCcGffv4NIj1qHkKsQYglHGNzlUIh15+\n/cmV5PTdmaZdy+RhpprsiUij/5ziFyMgw9qoYH9pCBuiiteAJ828c0e+nCFu\nlvjP35GNTkTra54Fbqwd/r4V6i08vES0fhuktd/KPifVgPq6dFjCZ/zz9/ow\nMkrhQxgH2wKVHGf7+B4TCZPOiORmbabq1iykrywRS27Dm1J2eDgAe5KdlhRI\nMeFVICv0IrOTTX4j3JFcF4wW540zrA0H5jKqF4hOVjGpYyXQyKdmdFoR2Mtm\nDBx5UrS+ZwBr/jr+qqdu3wgx2UXHddIQwzv6Q+z4sPukGI6nS840V6YbkYwB\nX0ALDvrjCMw3BE19PpUNTsn63tFjIWaMtVctRRKGQu7nZ3QMCn4YoxvW1LWw\n3plpXEzZdCrXZBK6jDGng7tgMEaM5LBCz5ptVhUkjkJ7BGetaMNiJ37GieVG\n5sfM+n6Mcl2NyHR/cKulA4PdUh0/e+xq5x5a069Cm/uVFqktlPtJUddKGgQm\n0eNL\r\n=x17K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEkF1i/K+tYlotbrfjVvoIyyQPxDIsmXgGpZ4nTJ4loAiEAv46e4cHjJQwTKkGMmuLDOjSo/WzkDS5/JfkYrouFKSI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0_1599988569568_0.36996803106005793"},"_hasShrinkwrap":false},"5.2.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8","gitHead":"0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jjXg1u1bldRXKjkYt+6CCcyZUqlvJ88iTRw/3Kv/XKeAWXK5kbB37vlPHxxxIwlAzMf5HKcctL4Vdafd1WxDqQ==","shasum":"3e457779a65400633a7e610bc9656abdf78f07f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8.tgz","fileCount":39,"unpackedSize":206907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeOACRA9TVsSAnZWagAAfnUQAJJk3kjJl8AssdIrwFC5\n4uPBskwDRNlEnl3kcbL1K2IcJH5iVEdXiWM+3IJCSVkzSzkTGMdc353eBl9r\nOCu3uP+dOA7MpY55T7PSZWgvmO2R+9/CrYBdsmZhZBt5LpuUa4BOISkilWMa\nCPua4PX6bNEDhoeO7OXXa+W1+UVrku+BK60fKSAQ2PR1NXQ4OJLMDClO/CF/\nJ4SdecmVNSih0Xjj7qmV+48tVQc/nNpU9Fj4AJBhSSWkQ5e2UoYaqn2jbOJ4\nXUkynA+V+iFsV/aEiaogMpVO7Q21giDyIb/2Tjrk/p+bWv6EIiuQbjAi6RNM\n4vbCO+Ejjmv+rjMDpjQ9GbAY5uq9IT1tx3jBFZCKwl4f/pXfEanazpJjp6Yl\npnbUsaemsU7xvTCsU7TTonm0iwydKRkxsiAhdElLHKLD9zu+QZKeT7/O29FT\nypRJ0ge6wsOibeuLy4jbwW0mXzITTPDFMEPUmsD6dGJuHg45eRj7We4NlXbF\n1iz/mzviZEPYFL/ntldLycs5K6nyi1QRuK66vX0FNsGXKOz0+qLz2bzZGimf\nCe0F9JPW98ymHp/k/N40TNGR3UB/Qi+GlTJV9uRJWrevKy9K+k9UWgzvdrdN\n+P3lpUqCcp/SjYHt+swD9EDdSz2Mt6hsg/1WJGu++THIfuwYNQA13AoM5iMw\n3dCc\r\n=VeXU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgp69NtMcWdblAT2dQ5pwUSkRvujHIPhNykIUHJqH6qAiBEqb8N5Fmuvnw/otB0IHb5TjfNKk5ViXQzFsXG1wwv/w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8_1599988608039_0.9961263525957158"},"_hasShrinkwrap":false},"5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0","gitHead":"035a21342f8eb7a8198be702559d3e37ac012574","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qrSq67uvvlZaJZnP8jXU2yrqwuo3lD0YC7Esok696wHdysB0yLZTGe24wwAVEIUlmfDnCgkuAruQZBwraNKKQQ==","shasum":"227c5ef63fbb54855bed14a67ac1f6bfc8001c53","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0.tgz","fileCount":39,"unpackedSize":206668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeOUCRA9TVsSAnZWagAAjqcP/0s4o/1VT9+yXi3/MSdP\nThIYV5HPysBnhHxhN4E63PXAZXX4suYCZMHnbkniNlseD5M5Jb3o4Jia9yBT\niuaZBnX/ZzKwDDGe4IHtJUq59+tPeVP1idHD/3yTGFxSfjd0ZZkbCAI2Cw2z\nU2SMilRVIvsv/zHnl+2MZhbtsGkI7a8Pr3WXz1uJIEwL3DLGIpPqoyla1Y2k\nbHb0axV0HWIZdp9fzZtktIHFojkTAcHlzQ30wiMpj+mzL6zpVH7SbdM6OiIt\npZsNilj0D9O9NsMUZg5k/yGJjcqxEJ6f84dRz7wGEUr+va+CvM0cT6xz/gsb\n3fOAdSwB6vrTGqGnG4Pf5HE8mUcRo0MU4PArdPKiC35/9JNfogWRSoCiqWQ0\nCbh3gvA2cqztmV+q5g/uHrqx3EBCFyYk8l8LjgKE1raFrbOYxGxvKtmy22Jl\nV+oi/LYD/04vUPPSDmSCvGdFiMGD2ndRimGEqzXn5TofRWph0zsvGS7fgdy4\nxK2ztYc/mK90ywmiyM9ayZPU32ohEbpAo3b+g2i8EoyhXkkgFfsAuqKR2z3H\n/axCOwLUi0dasj0BrTyIhpOAA+qOjX8YYRcZ+U79+/eDrF9E0LVN6ykleRDt\n7EJr579NyuLDuDorEFf4Eg6Y7ysVgrCA6cJRZ17lW3CqIF3qGBK8kPVwUxPu\nwpeR\r\n=ji4E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr6xvmT1wTw3FaNrbkX3v/vJiTWZ6QIgJ6E/qbnIjTmwIhAIz6jWyfNcZkxlWJICdE+T97F8T7FBbmjGY2nxM0jt6u"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0_1599988628192_0.3580306793691963"},"_hasShrinkwrap":false},"5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NnA6B+iGoTM/E67jX/LqGbftMggfS+3lG3PrMRvznQsL0IEa0texys6Qy2aGT09aeN+CBhGC6eEO+J1panzuIQ==","shasum":"1d82580e86e0abf5d3b5f82d0cd8025a57649570","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0.tgz","fileCount":39,"unpackedSize":206950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeOwCRA9TVsSAnZWagAA83QQAI4/nExQOEcRDl31FXbA\ngbE03OXIYLTDPBPrxqb+QWPsbbOHkHQJV90IHlXX36Tt5nydz9MZH/qEMrTG\nkfkTN69uafejbW87+PNbl5X9BQuGtp0sdAntInpmQDFjA58FbXRHFOXpaSWD\njvm0VlH6G3FmHLNGVb+uGGelvp0Dto6jjS4+NN++ywxc1qKyn3xHrOc6SNYF\niM8sdbMxEG5d+db99McM6Ay9z8tAyH1yCZ0b7kz0XxOARZGX+RhhbY+Mhtae\nIoaI5JMvCXeY4iM7Uor9Pzf+C8D227q2Z02a0bzM47+jcbF3umMIZ3ZmQtZM\nch4HuukbLuloV1z1wB7QY9pS9jEn2JFTawZ4egENo05XIMEaCwoWE7dP5zfd\nlR+HsYxU5Nod4jFs/Y4EMUGMr3Lb4BH0Mtow6OV+dA4weLffDvNcWYfU1IBB\nhfCK+jUsgtB6OwbQrRKP61bafnOfYUstLNlnXj7bWMWom38aRy1HsmvuGHWh\n5W4YyisyWC1Giun/+tfJ0kQ7gQn/WoBDMV2YUwi9VRRqPuV97DKvG3MPjbqb\nGM6rQqiEPAVUjnL/XLcZyRVCaj+YYKh0tLEcREdRyXJBkc5VjfJE0k4tZgG3\nxkm8A/7v1SxnKrtXlwVEFw76gWd37smALt1ys4wTbXtO/tnDK+0UG8vJz49q\nFq6/\r\n=r5Ub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANbj9aHVP2zzq+p7LlwZdA+UOuk1LyEPyz/vIUnDrOOAiADT089GrGSBgWGtJBnpBEcXFK8xCHQ3wgcLNgsmDeG7w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0_1599988655820_0.7696422020169831"},"_hasShrinkwrap":false},"5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0","gitHead":"d313a6a48dc69752444fc1e174ea7665d0e808d9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YdasRWQ3cOGmx9WALg/Wwz7/2/zJUEUacD04RsrMsGhspe7Zu5jZwqUx/6gidc8cGn+Lb2ODle1Hs73NIl7mnQ==","shasum":"4399e698c8a1f4580e76570d026d22cd46a4d8a1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0.tgz","fileCount":39,"unpackedSize":206953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXePNCRA9TVsSAnZWagAA1iQQAIzLEtLTxvy+zVMMNQ4E\nvOUDkqqNLVVI0tGRRs+he0Shl81reeSOLo5WI1XTSPdjkEgaMJ+p0gwvkApH\n2SGCWNLMkdKfHWWU34ZdzyAeVotFVawOd5kKgG1U84BDwHudz8rsgssMBLla\nOUnA5Hc1U8p7/CCD/xrWEDCyBkzYckvrlnbq6ICfv9NoSOWCLS6Dkb4ejp6L\niodjUp9Ez7ZTB7Br+97o9mAGXbuqdWFU/T2CI+Htk9SoRN/GV3aMXwsiSTlF\nhadRAnrDN8l7To1P/ggai0+LB+DOkrbos0rsiKQCh1JS5TDVnBeVKvOaTEiO\nUzQbUDg0ltTdy1pHL+8CPX1uVzR+4ndh8tdTUOSvbxegHe7sRpV76tgR8SX8\nqaQBZ2CHFeUAO4pY0rP6aIK8OLTCTweic5o/m3Dnw3pda4B93fsKuU2FNwH+\nPhZdaVtiIAKDoDFmmXnxGEsrjdPw3tZiLtf8r0hTBz3YWUpyJWRGtfjLZYBc\nDGMkTyfYMASo2oDhBMPdrTteelhc0l0ut/2V8gif3NqMwjn1R9vg1/3AZWS/\n0vtuSfwz+BHiiXdeuB8p9ZQIckZSTEZHHyo2m6WOwzU8rSM0U1wKI3gy61Yc\nKBKzk2RYupAC99L6CcqflT6v0TiUe9jyJYt3daHS+3HulX0WrSXQSAgywNA/\nR+8/\r\n=93NM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBicTvnxm4St8+XVS2cj+VaTn4hrlTGXRmQvFXuwRZh+AiEAsqozykNQxiw+8/ZPcs33Az+DPZtHcVSsk9Sj3hYnysk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0_1599988685111_0.44456697925552335"},"_hasShrinkwrap":false},"5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^9.1.2","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0","gitHead":"0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z0v/Ej6Z6dLCsIWDN5Hbl89p7BrGQZDUqRLewQuqcIdd2tM2Ks7K+IO9VCWIPStKgpaHR9hYE5895f7taoKeJw==","shasum":"88ae43f7b69c9a681a7bdf80e97359c087cd75df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0.tgz","fileCount":39,"unpackedSize":206950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXePoCRA9TVsSAnZWagAAHkYP/jHzAJW2FN/5tWV1yqFE\nTseyKb9EXv9E66IcwkZu1nQweS5pHZdR9nbo6ZZDs/49pK3OZ6uH7kjY1OSH\nxUBbug+QzW1sHGk4YTdG3SRxR1GCeuA2hCtsqcOQydz1sABoBUk4m1lejKGi\n5Eg4R96pxymvk2G/M//5P+URzYb/M/3IRPCl2QdhGQQYaAAVAvey8VQ9jTj5\n4fXF6tpQOsdP3zb9EOMgNFpZ0Ny7kf/AGQ5HQTBDrgdHOaAZBNCuJWSrQZP1\nlF7L/yHrdMY+FkOoTyM0HlNYC2PV3Bz5nKCCJ/aI/cSpXaqMDTCqYesJ9Y9K\nbSs5m/xwv0AaB9d03tFXO3N5sZvlb3LzgqaJHFKYLtqEf8KXiEKi6K0qeSUg\nz37cyJMoB5lzRQdu5w8zRDG2bNNelHQlwk5R7+7Ree7OToZFfVlzY9TtUKwe\nIrsUEyQwY61qX0+BnayONVFyk+ruOilWM4Y9PJ+RaoGYOjBZPQ2PVuLnAc56\nC4KpjCPFukUWZ/HZFPP00HR60L343maxROQUcsdLe+EryF0p8ermbGzhboUp\n6neaL17itumQV4TPhzrwvSzGZLz2unvRHm2UjAAzeOrUjSa3m8nRi8uU3D28\nCxoRizK28lM+13stvXj47uxBJpNFPvT+xPwn3oQoCpHON363PAjYlW5dBf6J\n28PR\r\n=4Gls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL6pkPgcnyBMzNMHDebh4DFvgikyzqEuBEyWIKMmNrRgIgUS9kJhRYHrxAC8oIGUlwPFn/Npv37bJ29guIaYjY7Ew="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0_1599988712147_0.3977853949979604"},"_hasShrinkwrap":false},"5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0","gitHead":"b21866d3b5530a074945aae00230055b146c96a2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-j6V8hhpnc+agGbgMSCQ5gr81E50oH5YcjLoHzXaZGBUeqjtE7b6TJ+Nw8l8ETjdd8yXvbMDINC0bGRITnB214Q==","shasum":"86d3685371b7e8744566af2c010b0ddcb6191abf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0.tgz","fileCount":39,"unpackedSize":206951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeQmCRA9TVsSAnZWagAA4VQP/jbDf05ge/pW1VkXbPAS\nBmaKnR2JF0szdlhhKIj/adBOTKLh55YUKJuWJ8CoQJLKNv9/idVxHntEbubQ\nE9TUxi0Dl4gnSVuiPRKFKMEtddqEGiruLgmYAn1hxWwlxWhyTxCiEJaxwic3\n1DfCdVMPErxR+GhDpUIVOLejrX369IK72Zvbi050pspJdLP9DQzoHyqxua+L\nIP3pOhKAEPnjPV27kYa0MbRORZgKLUX8kZvKxarx1p6PDiyGuvHBsWnDBEfX\nXMV86Yz9H97epW4mN4B8lyTktN8WfEdTzb/lKKRq8uNGG5OUn3nU0PNJOAKw\nX+3hgXitBHmftqqm0z1vDs9mDv0qMu9DHXOgl0pmuoXmVSLPTdW6/X+AHmkW\nOhPb4LHNTvB9/5jLpVBup1aF44nqBBiXmY6Wrc0DEhpWHWNmMllk4Ax99VPA\nVxEKlJ4xKrSxhvqHU7kO0JAuThoZPBfixfXubNL3FF1PBRIxsXqT8iVot9jP\nENFhzbgKHuAym7Kwa/DNNHCIj/Awl9J/gaUP/kBKSzloxuQsqXwH/1jvFVdN\nXvgquOFG3m197gNvghS8EEUVgfSr458KOVuGHs6DAP3Etm+IPSnITxJFia45\nnMj0xKRoT+vWkry5zvYllPr7ejvPMyzRJcVO5CKobGTE8wsSBw8RiaNKqF/9\n/d7W\r\n=A14W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+yOxEdq2P725C981wcxAvFzYZ9qjJXv4GHZEi7wuaIAiEA0Ff8Eyj3l63H1OzO9oBrBHNHlWuQflCeQ2j4ICd0/K4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0_1599988774441_0.537589198970057"},"_hasShrinkwrap":false},"5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2157e9bf99f47934ecc764a1662edce3d0811362","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jfm+D59CYZ6P3SetZbJrqjCKxdQ6K4us+JLcRagLJuInH9i8OymqQIpnf4uXDyh5NmuRRWjD3yWgn/FGqmABXw==","shasum":"5d6b0b9445f40c23c8c21b74ecd6ff70f815e50b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0.tgz","fileCount":39,"unpackedSize":206951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeR7CRA9TVsSAnZWagAA5YgP/1EBlbhI3m3PnoCfwASQ\nomD2RK7V5Y6s/3AWwBGtoNupYQaD3KJLshOYStphXiCY9DFOWMeVVRuOoiHp\nuYwpxQsvPtLtcSYaqenWTxCXU1xn+gbRNW57IGqRoiOnNBrfx22MS7SJN8v+\nd1j9CVHMsRm8Uw1pcIcRina1FGlOiUS8O72faOXH1frblDy0cWuQ7LLXPz2a\nJUffGl2lRikJTMIKj47zO0POb2LW7Ejn/15pkgQJScL8igskNnOMFlxmNIBp\nUdL0WNjDWzGYEgjV1UnYyew0JYuL5C8b4TRy8PEvNpGAwubbQMz13KLrsyvn\nY57xoTfqz107yjcuFFeMNfYbVBb9qqFr9zbzc+nCtvi/wphLujLCp8Q0nioF\nFnTKnTRGVKOCpNrSSv+zG0Uv5iV5u92VwADPc7aQ8Kw0e7QrF3/jEsVmk2io\n1GzMFGVafiJ9PiRv6OJMWelaQZ+CeA1Od/l16rF6mbRtUdVneQWjgydyGdBB\nRotRbU8+aeyFuPclIcz11Yn8yxCl841coWNCJUe+SOGFkzTiqhkTs1jsNVUq\n9ravhdE5py4q1HH9NY1Q7aCq7mZySEBBT+ezd3rGNP4R1KAk0by7QLoMU961\nXVT1VHIlAUSUsfKd2vx4s8qH7ZFW+UBdHRZe3j9yoVML/dSh5H7+SiHx4Aq4\nMJd6\r\n=o2Fr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQo+oumHMvj60HnnsqCLIoC96pz/rRox41srg2hSMGhgIgeugOW4XvEdlpbq2+8282tdjyh++ut27Ny/FA6fH0KSQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0_1599988858981_0.5984457120759525"},"_hasShrinkwrap":false},"5.2.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.9","gitHead":"18de16c2e4bc7a04c4572233bbabd74fbf5729e9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.9","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-o2AvB/T+/Xigtflp0xnmpKLBdGIbgWMK0oQhnk18ogfu6+gnXKGYAcF1zhU5NuFilOnoWYVfLfn0DgEIj6Q77A==","shasum":"8e81af2ddf43ecc5b25b72874c4c07dc766d5d89","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.9.tgz","fileCount":39,"unpackedSize":207206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeSQCRA9TVsSAnZWagAAF1YP/3Bu3ilDZt8vJ9EXA4Ek\nthOf3kf+9Rs1B0hSQv+I/6zm4Zz2s9uNAoi1ZQzTY5sXDCtB3QxyD/i34oDE\nju4sYHWz/zf9qPltnAej0zA4WB6UHYNGBRkY3AXXAhoarHvTszaZjHyUSgfn\nqa61DvrwRI2hYX7fm3Tm2bnkCxIOulPLqIqDQ7EHPDlP51zZJdBwjqoSSE3S\nmLbISJoncKhUF5PVC1bqXpbSwDioiWcyEIDdrVuv/T1kjJ9W4njaszU32M3a\n4/MHr6ddLpZ6l6iJTA68Or4e9m81KUnBVGzEdqyE5qxb5dViI8nxg4SdUnDi\nhkca3/YZHSXiNcUy0ZSs3QDU1xtXKMRFsK5ffXC/80i3tYO8TcWUBjWoK+OZ\npGIALRLqT+XRpA0qfyBayllCcAiJqYs8TnoegZ2jqPr3W5DE4COvjuazei1y\ndB/CrVhkvvEwrR/KFe33k0rMlqSFpopjm1qIVQwGUZw5e2Qrb7kyhAkm2HWq\nG32kSJbCkqSMtdMSrQPzMKKwj+mBzCwXuBnWx6NB5yZpJvvMWTP2Iong+K1X\nH8H3NFvDG4J9mOSz/7yYcxHpxG6r+aBqiGgVqN/kD37VcBZToi4jjCT2KfCl\nH0YrLAl1oicLCbA57ka9y6VU7lXcf9AIo6/oZpdVe8JuFVRgcUzVE4Fneji6\nf348\r\n=DriO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZuDgyGsy5HMOdw+rEpIW/U8KHjuxiO2FHCtGj9q8NbAiEAqyx9GxKKXYmnfzVXlfMI58RwhmatBFh9iXf8NIKEEzQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.9_1599988880059_0.3537853171609653"},"_hasShrinkwrap":false},"5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0","gitHead":"f352050b800a87dd308a9722b93e678986bd3879","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dMQevrFQv7L79Wy1j6rGPsNlR9CtamrREGEO6wOfaHYexxuIdx45v4MjTZ/EKfyC4OMYfO/qDQ8QynjpmrIojQ==","shasum":"13b3591a36165e7f53c17aa18f08f10089a1cfb8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0.tgz","fileCount":39,"unpackedSize":207250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeTLCRA9TVsSAnZWagAAStMP/1pj/h69Z8TIW+pEt3lG\nwaESZMpaWws1zxj7GUK4OCysnId92OKWsmORDJWFMNgLyWHKbs5yTTubtQfr\n588yx2AXEDkNNq+sC4dWCHT17ZpG7gbVXW08OPZHudeQNWZTGRkmZXuFTxL7\nRV3X6nu55MRB64Ev8U8cTrtFffYZSCJkx/r1QhkRX7eLck9E97Pqen+s2xQk\nKQk/KHVyjJjmF65V1bOEYmpwc2dWpAadruavPai69Bn98mrOsGBesNMy0O9H\nbXhsSye/dNoOKt8rerSo80mpdy6UTHJfbXum5X4I8bwcs1QDpX1TzVqEq6p7\nfKiXoA2xsvFvSJLeTrZnaRNWlqnDNUz+zDKkINGcQnb1udU47h4NB1kPGzbt\nrtarwvKo82G4LyfvimEFnmIU1MShZcQidfDlO21kZUtoeEZuS/iaP4afRf4w\njw7q4WFSST0hMdWQBJZ4XJnG1rzQ9X0CHKfMBMI0yCVfGcnzV9A+cxi6EDN2\npm9Ht+6z36RqtMiePFF3O1j9hWKx2NiAcxPSCOzlFxvUdrT/psOfLrliXTbY\n3qUc/gHq4o7qHUZcA8hZwFV+1LWftEr8rTx3IrHfE7cDH9emR6NANZ8HZ5Fi\nV4Xek0efPIesQ1DfjOph8IaxMTjPKuuBACEioYTdladadL5HnTkVzxsB+0RH\n7NgV\r\n=zJ57\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUNhZVNWcChxeEBAyqyvG8x3V8J0qCd7ejQVqy7xW0eAiBNQc8F3jaGWkE8s2yhHfUJN3RLlfcUac4phub3onCHig=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0_1599988938812_0.479045621474963"},"_hasShrinkwrap":false},"5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0","gitHead":"8830cc1328a80da5d4ae1e853e67da770680d531","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-aQ6sNnYMrquIlzSOdWvShTvVQQ38pkFY760ocAZCrSHOc++IC8jELNXt6HlhI3gOGHfIt/tvTwVOS28ArLfTTg==","shasum":"72632a62af087ded1ca5b3753b4c6e2e32722c5f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0.tgz","fileCount":39,"unpackedSize":207253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXeT+CRA9TVsSAnZWagAAfYcQAJ/VjRAGX/WB5b19L5lm\n9Ad741JV1clpQ5rp07Rrh2EkezUZ8bpZNajM9kk0mmCztpGk6bec7rxSzb2J\nf6+oSxZQo8yPKxTfzAWA9Dhw52hXr/2G7UDKjrCDmsOjFWhW/7ad966Xn//N\n7ABCaI4p10ciEtlfUNTS3Ta+JtYTTIYM3+hISbPUroZS9gdhI+JXequJJeOo\nSgTN2lJZSMNPXes8Eh3P6aiRL2vliB9vMU8qIHLjLxoHGWg3EiqXlb6JR/uN\nWGBg2++tOdP37cqefH+IBlxrL3HvREtrgrle9ZDydlKJtq7SnZ0Opf+7z7Zo\n3RTAFshvB+H1YFYbRAwGvy2CREI6zEgiLViHz6Dez5gHaD9ZyCe8Ezr14ygE\nZhhpSJ49yfFtQpFzqtWp81RvXq7AhpUWXgpdXmYOjomAZhej/wYPlJ7NP1zz\n+3nuz0dN/yxbw9ymoPJ6H2Iy+aFG5jV0ztYNNrEzhYj/iTaZipX6SgmcfMVa\nU9+hpBKHF9LLfQonXMAuOkJG745k/lDBW0wdfS7HQjK+aWQ/xdeb1NF/1B/H\nCW3VcfuyEnzY3pWD3JZvC9+VRATCLxzODcmDffYs77JXy4iAYzlwneSD/Mwf\nj84PN6jzevktsl0GY2BbRHOZv/ZZz/B0Z7VchmA6V3+E86P4bI7Hbg/GkE+c\nYcao\r\n=HA4s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2APjZlrxgpLGiQdS9OF1+7KV43FMrQv/tVVw00tlsQAiBluiMvt6/cc4cWqpDfFESWY93TZt38FSbbuLGC52rjsw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0_1599988990271_0.8368331989543798"},"_hasShrinkwrap":false},"5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"18de16c2e4bc7a04c4572233bbabd74fbf5729e9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-s27iT2F8oXiAUAROCNtyDL5hF3Xe9qJZhul1scKfc0H5sqjx5Cr7ZNVg3hQFtejYyrzukYEeA+P2Y4nGzu2Lmg==","shasum":"036e5222313b1b7cd1592c9d26b095ab1e7c3d6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0.tgz","fileCount":39,"unpackedSize":207250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXedECRA9TVsSAnZWagAAhcQP/1vYGHyUgOqRJYqqDGmI\ntZI+PIoozfFFocXPsptT7KET2B+xjnIItjWCV2Qez5M9N/TCZTnTFraKKYQl\na73/OU9DUdZ3Ln+WnhMiwhu/MzG9ySgogFfiFgb3SwuEs3kzDOme551aSb0P\nH0OY+x2AYqvANAIKUcpIZOHpj5x9cm4fxJxvdIQ77yqTS3dg7GOQP+xNNka7\nbyVWwHHFQyugpT8YGeAu6p8Tk3sRbjNZaShShM7EBjyPyt2MhgtZ0wdo+90f\nk3LCXAMfwVsh6Eo04SkRiLZuMqw3ET63TZwYg4fw14y6XOAwXqb6Mu0Du1cN\nDyR6+TwKXd24X/lM6/RB/xTEnMBNxqQ/ctqabsrkMIbn/kVg+OOIJnM/72Qy\nibok2B3TZDoV8p52bs9t4UJiBkbg3L3DadaKe5wmgSV+gjNWZ7sWOS52yMp5\nCcN9KU4ZFgRiOSmX8WjR1LUo8tc8RqpqJLHYwZAksQM9p1HOUV7DhAOWH8pR\nwWk8qVDWmKh0R2MQhP5g3S7CX/OV0+9jbVQcQVjood9XI684jwCYjbFRXRyM\nnLAl5dtai+FiuGgA7VUxoGJeDgSaDRrxIl72c6YQIzTMF9l6TWlw4jekoHn1\nVSAlnBGjhg0xXA4MWwZ8R1AwAofbLY/3iwIRVSO9RJNCS2nfnB24aEkRKN6H\nGXSN\r\n=cZSN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIHejsp58tW4cLVMAtPoVilf/YgGkFnXCMRmcJY0Sz4AiEAxgTAB+X5h3tE53rRTwTev8ZneTfCZPrN6sr5FdFuRDc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0_1599989571773_0.48442725447514534"},"_hasShrinkwrap":false},"5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.6.4","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0","gitHead":"c0e32177ed2fe8652417f2f57ab38b0cc27da880","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6fabTEmx6xSqcZIrDhhsemqidfbIsAz0i2PWTH9FT4Wc2oxk1Df40DCvQJxvGWAvDy3FJyiTnWiewDo2ms4bnw==","shasum":"fdd6caa6385fb12bdc227019ac804a84d9a1ae85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0.tgz","fileCount":39,"unpackedSize":207253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXee7CRA9TVsSAnZWagAA6KIQAItYZ1VPnqpoOXpYL7BU\nJkRjvGUg7gOsvevClnECjziwxa4WQvzVvD4VboTpayetaR5zS1Lg3lPzTl61\n/7htT/O1kJNPpmoID6dv662722L9veGpz+OLByCBi3ttW6yEv6ceSpdFG7u9\nWigcL+kWWQqCgxiUMETIvrT3igTf5Esaqy9wuEdqQXbY5bCin8v/Oysege4h\nfCma4Otgt0L0Dapd9+0z8cQNY9hkOQh+N0G7yG0J2P3jcalBHw9lVS9PiBdM\n78UnVIVCeqcUvEM76tMKGTzIq0X6TWBX1FvZJcLorKKVgsKS+GBqaO3MmLwN\nOpbxPQxK4ejfsHP3RfONQiV/waH9OBk82IB98RfkxbKol+1P1U8oXsT18YC9\n1ttoZOWYs6XGY+PFCTd9+g+iFIjBkRynJPPRzhCo+fpn0himfNgp5bu4IiJz\nOs2yyY85KSAtfL5hf7mKUwerIeKzgwK40QERo1RSnzA8F+5t2a8A4MBMEgSc\n/X6qOqWwsJOvVTVSauSpnS4iT9/7tdTxivvHcfcr8Hv0nGcp3TLPLffyWzGF\nmfjhx7D8QZpct9zj6/JsLpp9O8O4p43ZuXgt5kxAhTUh/HYtXl1WIurFbIXZ\n1M3BKVrNrWl26MIaj3lkDJP7dPDYhCdkbCRkRwgxMBhUP9Pm+1SIY+jo+4QP\nOLUv\r\n=NAHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOdmoSLHRRFGYukhp40vyWoVWKMtqmo09gWhp2rzY9+QIgQSoNT6hvchDl9gc4jXYVGB6O0VbKy13/zXpZXxhaou0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0_1599989690908_0.7612158255017785"},"_hasShrinkwrap":false},"5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0","gitHead":"8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KQfUfRsSnHBDChVjLfq+NfCVzGAXZW/f53vEieuYRmOnjhQe/o1HqNIQQtxvl8KZAR607flikWHSJqpJ2z8YgA==","shasum":"aaf2b5ce28448592e2396cfabbd2cbbdc9f014db","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0.tgz","fileCount":39,"unpackedSize":207251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4caCRA9TVsSAnZWagAAYKsP/0cX6OPIB4zgP34Xf+hY\nH+unsPARPjhFaoq5/W/HogsXbvrfXSPq11u1CKYkI8l9W2hM9BDrblGex0AU\nd5UwosTsYTCEw6K4+4Sj6JbQJD0aQJ/GTbXGm2rSxGAJJTdezslSiJRhozGi\nZUPgiGFmODer7vUPGOvxamRQniCHxQBQA5XfZf208xIg2LmQHNo0arq3gQ5e\nZIjp/T2wxlzF3o2g2lSQktzCVumd59dQRMGFeJV3pXA3OXSUVHApIoqpBpji\nZ3rNIrC5keoUQzJeNlEJSkUI9ZvdKe4cBEPqB/aMFkLAzhkQHyrSXZPBWDk1\nIqXSpEC7WemT+TlcnHsVLApbNwfZDghvXraGkJlG2/ocOc5vWeaf566qzPmy\nN7Umswdl7NYqdPkz7hLsq2zgJPkMTkyP9nqDzJbt4MJPz1qraSPQPMD3h3DS\nOXv/u5wz7dbg1gOj1KjKuuXXyzkNQYHQZ9VfryKQQZtRk7mBdKeNb6dc4DlY\nC3FMceMqzlTtyJK2ttcUnOVAWnPxwvjQY8SgWuW1/CQbjYGmgMnO9fdjuoYm\nULVIDvymC2L/oR4yg0G/aIoKmPjLMCPTtBxFOq8rWsuwl11cwtj5vI86jogk\nBMY+JmHkdho/4118Jem/MIUBYnMmY60/7kBnFezNZdGvpZ1QWQ3iJasSR8or\nnPHk\r\n=o31m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEx0NOirfmFwwjNt/tO+fxaGUHZe1DCnUclo1PpefHN1AiEA7A6DmuK2Gq7JIMvX6dKXFWVoqz5V3DEcNn1dXtpGivw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0_1600096026004_0.22265393839448633"},"_hasShrinkwrap":false},"5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"02ccdad55ba6ab4da8d548127ca604d6af34314a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wbxXfYfi58oJaQHhkCQkBd3LiptbonlMuy1T4IeEIefvo6pS6DX5jIxxLR2xTJl60vulkz7GP10/ogxwFoxdiw==","shasum":"964e664256c201deb71beb3df89ce4310a160ef9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0.tgz","fileCount":39,"unpackedSize":207251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4d0CRA9TVsSAnZWagAAOlsP/Axs8hgyQBaU+EpFJiX7\nxahMAhAiRoQlSPvYl7wumSbqoBLE5i8lRbGU5xTay6R+/UJIpegSFN7Tq/S3\nnaukzSFR49G24hXH5Tv+I8hWzk+7+Z7z1176xWBPpKhcecgB+7ETn/wF3mYJ\nzTXav4Lotze1ynBt62iXK31vUIJUQskcVAgb73Bvh48auhqfsXvxxbNYsKp7\nGdBwvuTJUDYhom+RtwVKKpkhVBjZcWc+i6ILsQFtECbSd2KXXMYEbDMP/SQZ\nZ4Z+S3uaxX5Ag9evLn7YoxfD2kaR7ymreoWSkpppA5bIz3D5Vfb25ZdHrTwH\nXkS7RAx3jIlcuUyNTQvUGo9zIpooxR3njHzV8H3HEcj8Qifdd57x5P/mtYya\nanKzypUkoCo/7UJLBkeWBZI+pses697UaM2SLJteqHhHynot3F7aiGJkmU7W\nPQelY23QTlzCZGo/mzK2cg0dxmfYlL3RWWFF8Zrv54FK2WNAcaiS8iS7hgnP\n5Ofhyqt4xJqtS6UZ8BIuyexPexu+jdbNR6wX53/i1yYsmmyylv30l7Ue8N+D\ngb6JoBDs/DMl513wqytWsc98eLUIvhVriDb9rUe2RWcYF+GGrqHuNdwdV/bR\nmbnuqjt8aZGEvr6QXUfwD7ViJnFTQO9vLPFwB1e8i78eSWo8QYR1RaJRPwjp\noCXN\r\n=sFI4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6t4f+kvCn3bBsjuu/tGbufiLL7lLVYMF3ZQ9UcLLSnAiEA4BoSFrL60we2MkwpWeTehuz4x+dAI/+ClWd+DffxNGg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0_1600096115635_0.6976796655136634"},"_hasShrinkwrap":false},"5.2.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.10","gitHead":"f507bb4e8522f0c1805997bd0926e9bc6a77d416","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.10","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UJzw++mkfuW3x0895+zWbl/ejVPy+zQt7R9tQ5zcQ95S9YUzVxWfcKNNe9rNZ4Sb4vbIHw+fkkST8z4BUmoNTg==","shasum":"79648c5e7abf0ecafaa63d703ba64c10beea69b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.10.tgz","fileCount":39,"unpackedSize":207490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4eICRA9TVsSAnZWagAAQboP/imIpI9jP9KQFORg/N/W\nN+K7Dq/ycCmpb6c30UrMVJ0pctRyLa05kRTelgqVA20C804bRWQaKuwUybWN\n+/aQ7wsNowqCF49yzm/NatHVdWMNCKfgv/oHyDGVYRHEOd7PKRMKCQ4u66o2\nOoHTkDjVjH9RQ8SzmwRBXNHUC4jcegN8rhIn/YSna1EqF2+Er9uiI/lybMnZ\nt0s1q/0heiQJARV+vIiSTLOkORWQ4hw27H9O/gAC1ORZLzF80PQc40j5akpE\nDIzDernuC+TlaJ5ZctJKtmkFkJo7FPE2YOZbl5IdUMxesgg5uGEFOmGgTKvm\n+EQb/tTvzWrSW7p5GbTOITjCTfwV0m07VxT3/JW2pDhSm7ExZUVaW/+bK81A\n+zkmbqa7Kkm0EICK2s/c7cX7OEOOddZ9hN8ZYtRhqEBKkuXgQ2RUCH6CEkV3\nDdPIzjF6NZRu6ldhLo6oPbsZ/hGwbe5ckVGkIEMO6QXyHa407N8BlzkZTFdm\n6CDNkps3E9O4Q1Kin0SEGYJ9HiK9DvedS6btw5P77LMsP8OMhOb0XoVAxwQc\nP0H65sP00Bb6nCw38+7mH82ZUzAgKb03UcCIT3tH8KIKWSMMWjWQKPGe5OGX\nbIaU6AqXV1WtHJoDXoyv6syeyVCseVX0pBuMGIL0yD7wIRhQv7MUlGFeNxqc\nBywC\r\n=53ro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAygQHxYnOulIh82eK588y7MjaIY7BHiOsOHGwI0uLubAiEAzLiCtYzziftwHduK+u7bploT/nl1fZywQPaIq77Cjy8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.10_1600096135710_0.28179987727155376"},"_hasShrinkwrap":false},"5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f507bb4e8522f0c1805997bd0926e9bc6a77d416","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wSGkLVvyblIZZZahaGF4feSFmTbWST9SwNjLxfNGXn6FdYr37mwURoQ9f2WVf8B76nhjN86jjxmEKUaxNMGL3w==","shasum":"f7d1829e40239a3641598e2b1867a3aeccc9e604","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4euCRA9TVsSAnZWagAAlDgP/ApQih30zL8uJNklBFTs\nGwUN3CBPnwjH8cd2Eu2IlpO+Ejff0gQ12n+BDx+f0jQ8Pb+4RSCkX7KY7xyY\niuh7Vofd2Qn98qUV4VUiKtj9tpac2w0OOkcKEmZ7t8ttWaY8IX/t5ZLOMBjw\nnEPk7gMA5/PwLrAwzHC9KA0UpWqlvF+Z66hlBgTC7qYzAcnOp7oqrdkO7Sz7\ndWl/MLS97ZcnkGY68wSAt8Wh3X9Xt0AMXGC+4J8+LMs5T71M9QGG+LB1W6Ns\nqWNVMpRZ0q/IBBYyFdKDMKoLt8n1mU1R4xaHxLD0j1npJHSw3M9Qeg7cIhIn\nbbhuYtfWhbUDxMDxIVxcY0LaHa9Zz06bIZ4kB5xt/E2+SiVWmDSReus2oxHV\nsgrzkFWBmOQ8ynOEbcTJOw88yM1G1epz81gS6eQZPRRFJlXsRJDfNKSip05C\n8FWnntxJk9dVlXEKoBKsJts2kxGLAFt8LZ09612jNpDXr3LRKyvurjh4Psco\nNW8B9yyRsRRpH2S0nk0/wTZvUvZoc6V3q0mzCRdnD5ON0YCL3v5yLIxv+/yO\nQc3T8NCV0vj4ve82bTDCcfUOfjMIHaGUZnoRl9rkjoUbLnreODP9GMeoyvGO\ntjGA87ZglOUWoeOS2x4pbHUMRPNta2lg09dT7P7naiAVpT4QmXr7tf+WK8u7\nzpGD\r\n=PW4+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDd8Q9ZXb9LOEmE4s+rNgMakOt1JGree01GRStvZdJ9YAiA0641yxVA56dLjtyjJm28Sj2gMohXnL9bTtVn8VuIvcg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0_1600096174360_0.5250759504439044"},"_hasShrinkwrap":false},"5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0","gitHead":"f57557765b28eb223cb0e08a53a74074dff3a0aa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kBKaS4m197+4ofwx9OslWTG2bK/IuUlLQ7/Dx6nY7ZyvjSKSVkx6N7+EE23bj6GZhNG34W5pqDRquVbP109lvA==","shasum":"839e67363d44809d5246403e76250e700123ba04","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0.tgz","fileCount":39,"unpackedSize":207536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4f4CRA9TVsSAnZWagAA1YoQAI5W9bInfaNryIhnA4gK\nPbv9TnZCwFOaD8X36MxLsDdq7Pdc9rNczwF8N9rvk1/KflRUMdpbJBRAiPKa\nxSWy886CPJ8QYV/6Q0HiYyt1J3GW7ylBJvH0fu2URzuU9o6ejSFL1woL6xPn\nM7tKFuGCqazVdYLgW0/tjV8hLiEeCj5X8KZadiZK9dN/eWnNhKJpWrGpHST8\nUh72kA2Z4bOhnuK1KT0XUs9QfXWnQgsGrA7/aZIWl7CnoXMGQ8998Eci7w4C\nlSvRgLxthUcdO1fT1UaeDwVP8bABn8J+rlE3Nhq+1Mu+s6c7jTQgE6FHsfly\nv7ho0RSprAd+f928cw07FIoc+qN5FrCxCCTcI1VzT8K6TYlB9u60p+iAGHIc\n0OIftPTxu4xfEUtr5yPNg96ya6oQMUfzkAgAErlDOZOXUxW/Hc2iUqODljMN\nCYuME/55RiXlRDLAgbDI11zvtgGkMNjs1sT/NCsECOZNRCSuApz/pWZy8iHH\nf4+/BMRg3K6LDgGqgDqBwUtC+LeCD5phsl+fEvQug3phTF71GMQ9qlnkzbaN\nMnMfcip3/TdmFkK7Ho2Yzn21Q6njMxF+PaJjTotgdddtnTEdZ23riGQmB0tS\nlClVlCXh0rRiokH7uZrqBJ6hfxk0BacUhTgkmZzfUykAZTqCoWy1y96YWRou\nPBbE\r\n=r6wA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEa9QSo6p7aSHoXEJZDog+Ol+No8l/wOIIv5epPeaiTNAiA0hzv0v7kFp/YCwZGZgS7g9yEIVg5+ynjADEl4WGtsjQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0_1600096248453_0.7604033372952457"},"_hasShrinkwrap":false},"5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0","gitHead":"4a980c889e9147bb187addc2086ac554749a6680","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RpE89SDnGW6DdIyQuZWcKz8CcamdjmuAw65MqniqjakudWyvuO6pE7oFzL0ysOIplKhs81AK6bK0TANOmKtOBQ==","shasum":"13ad62ef4e036739cd16c41544e928c808570d43","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX4jKCRA9TVsSAnZWagAA9VMP/AxSzWEvTmt3NslKyheS\n1lQEjGqInaYk4ec3K6C69eI7ymwe9V2k8LYuJZHObJw2mGOPs69rfnAeHA/c\n8Fc+080ye9rzJ8GFwpFa+GjyFP5GFb16Eiy9726DM8HmdaP9S2bSvMGVjUiq\ntsAttMeJ3Qsw2ACUMKu7FucCjcG/klVSUyxkm0donnzRnz/z4lEBV6BLrj1S\n8yRAWiOQScOuA1Kxo5j2IZmqTzT0kH8Pw5io5orm1sarcOgA37LxUKbto4xn\nElvIdSzEclWEyCprw3b4KzV5o7IrwKAcLkKQZZdhmEm6H92holAlA+fp+3TI\nFK9LuoEG7URKDI7TUJszJzm3v7OCLo5NIWJZJqRcK48FmkCNp3vWj02bbJVO\nWip+14CqlhMtIJIti9bb3jfvwKZgxShIB/RPhEyl7U/ZUFvhZSn7ZL6juS7M\ngdtZ7ZXqbM7oWMSVMMQEKJN8rlxsvBMUdI9Ym+Szc3TZxgTT1y7qyhl+ZSte\nUVq7FsfpcB1oz0gLFr6W2HFbp0NIX0AwCuvXQxJojARadCXBHu0d6ntABMD+\nzcvZxS72MD2Io3DxrsTtzJGphi+8RiVRv6mpYw56YUosXqTNi20vAg8OjEll\n/ppVWZukvYpIjH0dtzHgj0DLg2P2+wlAPUXHAGjHFY+ilJu0knVkfR+P4msf\ncBcG\r\n=Xre/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB+GRO469+m7IrHgMbceDSjrbf7RtxvO01HvdxVeLAZJAiEA8rgjqJgp+LjN2wEwEjO3hKMVKuUmGG0de/zWRIIiW+0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0_1600096458382_0.66474533151705"},"_hasShrinkwrap":false},"5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0","gitHead":"ee02d69043243a080eab45b85c5e3a0232b6cba2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QJAg2mBhrQjX5VE+ZrWr+n4iYVeG1Bm18f1srZOOk7TItL6No9Cu7q3B9tJb1ZePivAnVngCLUi+TfI2244R6g==","shasum":"44bfa12ce31e6318ee273e9808c85420f49c5f80","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYL3qCRA9TVsSAnZWagAA1OIP/AhhWzu8/UfRmTo9J0Ae\nqzkdWYvjkPxf1XABgctLQ71XGj3sntJChezZDBHbp6Ka0eJSKOJBkKAQEQb8\nRRrTwCwuXZGIip3sBUbizJOFoWDaP09uA2gml0oZ2zmTqjeKJgIaeU3VgU/6\nynymocDBltfjTb+BfdupE/764xOvRUwkkZJGyPdA7LavqFr8McsPRwAhzL0l\nOZAfIZdVFSqT83YO0uEXEhgRUX5mRbI8rw8WxHFyZqU9lGiRa8R4jAhrZ1ZC\nkHBmFrchKXJSO//83EuxIRczGnO8OXwzRhHNy+2Dgp+CadJr3mvSJZdRIpnK\nKV9vdfZk9q0Y08YIjyh4XSJ16l1tk1xZ5U4EqJQhAjaHRVsk9Ugzak6zjHPm\nOb0yw+9oXjQXOhQHgt2CsqSPKwcVWAp5PvcbNNeP/eKrY4EgjPV0GDES6L0X\n0KvZySXW2lvE2yuhho4iWLtI9cEPw7KGNv34xILq8B5VsMH2Gw/0tyjDwG3x\nsXPGVIhXerLg9C6qz/Mp0sXfdAwG/hQ335BrkjlNt90AgRx7aRwPtLI8+Yn0\nJKnnoELIVBOQ31jAILFAm1bQVPIFQ5lVLjMGan5Gc7U92kt5saZ0wShwuZ62\ne8tN3e/qQ6COmqqjOPZgaZfDK0poCauyCVKS003qTiA/CBvfeoFlkZzfVnJh\n/HTF\r\n=/UiB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4QLZPmpn1K/DM56GY/O0JAdyWmiKq4uFo2033d4IoaAiB6Zka41p2glv/X0NuPjO5urvjNGZwVCL2H4PUHNRFeCA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0_1600175594118_0.38438912001632874"},"_hasShrinkwrap":false},"5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0","gitHead":"72cc112c197c803e771a1a0aa46b3730827c5f08","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TuRnoJESkDl4eywOHIm0BJBx6qcAtCz960HrM80qaRAWd1oXp93rM6goNf5jmyvDpz2s95b+aUPU7YPKDQoZkA==","shasum":"32d59e91982e1399f9d302f8620cb62a21c12b47","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZp+CRA9TVsSAnZWagAAjcMP/3i6hrQNDzH+nf/LBNcG\nLGtX/J16vDDedGfyw7cx+/LXxiI8WQLgEUi412RYjznwpzJDH3Zj52T3ycfj\nT+S7Q8iL4NxCqYHwGCMwIffjkKs7yq1VUyYde1LSkg3obZMqVt4qNjTzSA4i\njfYEV1bqa9ErHUfpwV/5NA/lpzCoglAKi5cyjGcfIIF7T5DtTH031HCagng0\nKgfnw32VO/jz0rgJiY8bPglnlwYC3sHXJ9AZYR/Q4Eisn0U/xXikOLb4c04i\nIHkl8D94E3h/F2c1+G8n/lPQnURc4gpeQ888lyiGf0NDqN+XngAf1ZjfDRUv\nGlYBw2tknaHWB/1FZOASlkqbxuY8bd5dTsloaFTtsDVV0tkKAZK8/2KqHGbU\nqrxqcnmdH1Ivf3Xj7BJ5r49iVZlRf6LvEOYx2TrAmf7QTIQ0wn685K5yLLfP\n144IVav0S+77T2Y2pDOYF17OovfhVS9spY6HZbrt3s94j5KeUUxvy69eK2Nv\nLMFkT8urqwsK0nkq+/a8i9xKN3JTvmoCGqD2GKexWKl0sh7mi67oNt3B4A4K\nsL/N8S5qfYFLxfWel+Pjd2W0YpVBKZSslhWGOQbwJ8EcI2M/j5MUuAb3b8HD\n2C83IknegVD6tUE7o/j4pulv60pKKCXS59VdNbg7JmAq6S8YcfHXlWnR2PvN\naAiG\r\n=6m9X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGX/5D9ci6WhROAVAEn0g0npG0dzaP/V3I/Getyx9dLqAiB6V+9PW7LLm1JpMAO7Fqgs2n7sGwVqUZ+mrqgtFGaULA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0_1600232061914_0.16159799532333752"},"_hasShrinkwrap":false},"5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0","gitHead":"54508e24c6ef84a4425384b71ff1639ba6b8467a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-45hezZUwtHyr6oelNNq9ntC879rS58az/XE9JBESZLCNkjVFvA2TKJTxHbdzK2B3/TGsny9rdKWMX4QmtzHxqg==","shasum":"48aff57c5f86ae76d6f983b54a77b792c2122871","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZq4CRA9TVsSAnZWagAAAQEQAJxCC2ctltkCq8ur5Uix\nWXH5YII8IzF0kHhk2LjKzfsal3fuuBfqS2jDSUXxJ2nD9f/Wvn/D1Lq5FGm7\nY5xndVwm7td+mt+9toVOayg5JtRzSpbHglyoE0ra+A72iOspu2UxTLv5Ayv5\nzFPjpiXj14y42o/f6yLBZ4u4X44ie3XHfhqc1b/TVpbkZ10KEnpbLfuO0xHJ\n8PeoVOZQZML//PAV/HvPa/k6v2tq5RzB4rooEfPrnkauoTWeEAMGr24rjcbZ\nLEkud/NePZgIxNVhawY9/EGek3IYnBEq46a1SKMUB+ZwvVJzsycTaMLTRqYr\nwAr3sdZ7ouQBxrtCHddsjtOIo/ojzhLqjm9SkUuWCcpIWQBcl0fhNPexkEJr\nC7fRauD3Y/0GLqqBZVw/HHhEMpqBfrc1D2uQN2kQ8GqXg9FLFqE1riUWblVZ\nPYveJkg1gxmFbGaW5UZVQaYA4Rcr0wDLposS++HUMAGq52AQavtbCGlQ/OJ+\nppuB2p42RwN9Z4GhgI5tzcsaM8MlikHOeE6E4homDSJ1IjD5aZKBmQkTcMeL\nkNsc1kHe4VOdbDOz4ck9vuQqxWDTei3a1XEhSfoUyW/Ia09vYW7t1jej1LIt\n+v0lIIl2bJhAplBM8EQUpHndEe5mJmTt6CzCLf2DlCqXRdn5tBiMMQyqPJzY\nx4Ah\r\n=9kiW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9BNUoKXN78Fsd+/ugVXWtY68VSi3j2FWd+iUAkLn+dAiEA5qVodwjPY9pkmt29QgtYAvw2tCFa1vz8XKKSedmU2B8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0_1600232119510_0.6206062379422816"},"_hasShrinkwrap":false},"5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"41945273a90a47cecd71e370248ec5aa154a249b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-09sOGFyzd1ooEJAp35Smym8BDzcOk3pAl3SBlaOdj1wiufo3oX7qL0ROAQ0QEr2UEoWRBmTib0riYZJKwbB3Pg==","shasum":"9525fbaec8bda41d5718f2f60fd1953bcc5df552","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZrTCRA9TVsSAnZWagAAt9EP/0vw741JCTJ+eBFEse5n\nlvfzTVavuxrXp8TrjlJIRKIoqW4KPBLruRQVHtvv69+cxd/6X1uBgauLhcoG\nE8/meUS6NfN2XLk/iWqtUdY6IGGAT+U9Q1KolSGx2+/0WXSrsRSXlHy8l+or\n/S2T0Ej33kDjXIkeN8NYs//pD29/tCM1Badr3HGzKKg5605SnVBJB5DQzBPa\nFZHMDORKz9tkPUS4WAhC4xSUIDJ4M59N2gnuRCfLRP5jIcmQrNNV3EztVeUP\nVRHH0U0tPRO7RGSZb9Oo7od2C/KDepiaxIoOL+cb8xmJWkpLiQgATFKWLnMB\n7JEV7YhT22bvjcXrtalMX7SD1xze/hKiryv5/R1OJabyNCxUVTXbGCXGO7jB\nk861RbRNcVc2zFgom1+veJvWJvIbxtxDjkinmEtOF6wfOVmJBxt3ufV3acaT\nv5yiEVmsuA+LZyotazWZiLTMlUgzIySonRS//azBIZ+1AaJtNYTzv8tWa1V2\n2PgypXbaZ+ThgP83v20zsQOitYkLr46MYsk62Lrglp7qrxDjVCoZEBdZKYFx\nvaOQBPGUkjsuJlldMcTWF9qDfzXUkJUoNedTUNSfeWm9vRu07Jdu9venktbw\nA5z91m/ORs2/RMMa938xCJ1FKBX90RXn9fA8EdSYaBjT2HA08qEg489VLsZW\n0wZM\r\n=FQ4T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYCT27J12Vn78S5I9t4P2Qj7GjgpzKNB8QDUfJwAxkeQIhAI+J4oawfnkZOHARQpJrfGeKuADViuvK/5BIBp2NDkMG"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0_1600232147260_0.325057034373609"},"_hasShrinkwrap":false},"5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6cfbcf4d3d8a88b63606ae823ec0e12c05b50717","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-98+gSv0Yi5XE6te+BovugZtbX8CtSyZqSr9pzpHSkHOg1CZIoc9/rn2bAqV6e64grV1Tf1Tjpg4WIFwK8+OTEA==","shasum":"f891c66398208ead7f3ea93fd4ae04fcdd192238","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZsHCRA9TVsSAnZWagAAWvwP/j4GRtycmRoHZW1ViUi5\nBtTRvHT0vQjY2DXNDwECgTm/UMF3Ll6EJD3QTQi2v/lTOfevRcyQDNeR/ZuA\nizym04FwbuFPsGzOiZuu1Oc2WPY+5OPSvhUVdMpTO7hYE65mj4QUCsqMUmSE\nhG0tAyo/s7zBjPkIH7bem/MzEHWrcyHKv0tkqet72hJotX2kVnCSi0qHpm2g\n0juIZzl0dkWK66tsHol+OGAharJgcJfUa2Zuz9hJoELDTVf1Xrds4r0JQnOO\np3Isazrk/TJiMR9zF23mKMqKOvSrk8lPfbMC9LDQSDUAYRElR3Vu9FigaqsG\nCV8trOYTzqEyaJbi6ogutQnu5pcpR47n0IvsyWAAIHjJMXKbPq61+QqUw1A8\nygr1je+6NzwZnbmQA06ffljUQh+XkzL3NQ7CIqXbwJX3ejEKX69swPjxqNiI\nIczS0Uo7iqh8CZ46ryQp3iUN0OR/78KNki3Urz5W4sOFURsVVQJMrE6BIrSB\nQeELIll/Pv2r+LxW08PUm3WiTK+QFNbqge7MFfJEaBOu5AvsYIW7axQMewJI\nWmhWze3LuTGekpCJIIlotUHJYeWt83PfVstXKrDCIz054iDECYt4bcfwJJNl\ndPwWaV9uIlQucEy2sUZuSfxuXSaGLQoNGGWg+6mN8pddnKvYgw4CII910G+m\nKvE/\r\n=O1pN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyPtWqAMSyV9fmhipmLkUAHxLrx8vUikfR42C3CLwGIQIhAJuv/KW65hwZZalsDArqDGr1hAUfpOxpaj2f007EW3N+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0_1600232199245_0.606285505317091"},"_hasShrinkwrap":false},"5.2.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11","gitHead":"3412feb4504ef670bb011149251ce8aa7d783259","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FEstoTA1f90/BuKGcJqHM5ARiLNPggACQeNHYOJtle2UA+3Kybi0NEibLdMdRcTlOdcctOA6MNc8TBfs/lKYhQ==","shasum":"1b7f8d6f51b77b17313b15233487a25585addf17","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11.tgz","fileCount":39,"unpackedSize":207936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZsaCRA9TVsSAnZWagAA/ywP+wb23Cs/WJKNBMcZxN+5\nPEJye01BWMF47SPg2UW5IMB9xQP/dU8oVm2HorTUGlEE4EulKZD8qUIk01GQ\nKFgmOzKm//kinIjbxN/oWLeQ/bONCKhoVd2GHuE1yuKMe65SpGMeitMJXfLW\nzrkSmRaa2hy3KiPz1vXYXI46i8EWCE92Kr0eUt/8eA6l6VIqPDy2aspElzDh\nLW7oIESpqhhoK//CCLvJZQasqzFDffhzBGJ5wFrkVQJcPaN7RAnSO5vLJQ0p\nMHXLt8iNGcytjDgBOAPeC5VfYbTe1jkib50WwGGDjR/eS7VgjmjJ8yb9WQyT\nEM8ICAtkXkt76mmYLj01ExlilvktcWNkwYtt9G1GCkp76LM93l8VAOJV5YXr\ngQf3aeKFOV0tLcU5BkDIVtmeQ2ZvfgasE0aYUQ3F/TyKrIoKNcCpcXDrrx+T\nreQ81QiErIqB4CmOJCVWBitHw5Jskdk5i6wdP7GHaq4gY2sm0zuc6STEpgzF\ni3q8HsDAI6A6LXzl51yNGd7SpRdI0ezlDDOJ9Fxsob9+tHzeuP67ZFxITuyV\nvRix03plyRX2duwllX+/oXhfZauf7fyql93xnf7ieWQPx2r1czG9ViWrIWnQ\nwo24hClyWeGiGm9+kK9xSonbCTp5ETGsMbVSArgQDrcy/A2XYQB2XinXjjte\n4yeU\r\n=SCyP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGV7PB81DqFrwoXJwqkD6rZNEu1eRY5a0IEtlotsv+leAiEAs+SV+RoPd+qr7ne/QiTdNjPyhfHd/zTCT5OeY9q5Eew="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11_1600232217503_0.9183145340325602"},"_hasShrinkwrap":false},"5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0","gitHead":"93432d8d9c97621f4413ce0717115a826df12c5d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-60S/82W1OdrZLp4fxdA0ZqNr/o74SckxGGLMQcv3eBw5XwJOABB8xF5uuDdXPUQfoZKWhem8fMBDQwPw/TIGvg==","shasum":"281cc14d86a4cc6bcf8b001a05a562231812b730","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0.tgz","fileCount":39,"unpackedSize":207533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZsuCRA9TVsSAnZWagAAGDoP/3hYOOyJR6A69DNQ8iCQ\nx4NBdmlpfZZ6P2Q2vXI4ftJdtfvmI2DU2+k6q3YhjmStfxDMgM67vwbIQlRo\nLqauPUmBOSXoLAr6k2pE/3qy/SzvtlRkgvQvMvQYR1RziSanjge7y5pqxnNu\nttgt9lupFif2zR0wErEwEJ1oVAPc+S8SrGJDvH6xeJv3TWhOPYTG5bDu2ipd\nhwSrMuJ4cFHGK1C1je8TBxX1+ufdR4yU9846739MXoq41DdnsYvlI/B4fsto\nkjhVQ9Ea6yuYJpEB07yU0gIf5HgZPBFLR50CChqeGfp8tNlowCB3o7oOHlxG\nmxY9vWFOU13lIrstQMe+qDe/aHdMlXoxqUoW5KK7KRwDcJdjmcU1DvYjaEFd\nbWXT8Jv/HB45c1bHGgulQGwlWbq/vMN0PS8uMDxsL+lHRw8Ic2AYo+MFgUkC\nHES+JnPxfJQibXqA5tnfYWlOGJfMOHQ9qpflmDM31Pawjbe/yQW5XUOYoacy\nK3eDA3cJpbzHIZo+RRmEjcvr2IntfhU4rJir44EtyhcU/2l6FVLdqrOD/1d2\n+6uc7wP5UzN76M4kw1NQCDDmu1+SKwvvcG5is5cfMkdF9NUVaaw5k/m1sjAe\n9PcAx1vC/7kPwAVY5iYRDRUU1LNPfVTtMxzCWY9jOrqU1bznVKzCidimBfmi\nCLJY\r\n=qRdn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFarKwCgBxfxgPJZoVVLvYxBZPGuWZ1DNJdatYq3AwOAiEAk6Njgr4LEmmafcBGRwk/78kt1u5+IkL9qSafe0/Cw4o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0_1600232238053_0.8386769085505499"},"_hasShrinkwrap":false},"5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3412feb4504ef670bb011149251ce8aa7d783259","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-T9J6ZhRTVrveGD+sJe499J6DZfo2WHQFQpCZJQzYYay+Y6cR4w+kyXHVS3ikF9jFYNtS86JolJtBhGtppu0pIg==","shasum":"74dd2f4e7266ec91fbdf804328745561f3827480","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0.tgz","fileCount":39,"unpackedSize":207979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZtCCRA9TVsSAnZWagAAch8P/2twl3EMz0pEXtSKvPNm\nCY/oeBXixbp6BhOyh68GDBgtmLnWiuP05yqr/5M48YM2i6T3epG3yV6zCVE1\n42DH9utO5t/oFvG3wmHrc4uxoNHTXgUOToL6nuDTXD7b0Tx++46ReZy7sCXQ\nnLZzF5JgUjReBteeern4rg4rUSCL+tCfVXTG8O+ysBFRt7AU79ijpEYTdUK4\nnmiW5t8BkqQcUEsf7za//I5sCWYiakxZ9W/rYBJs4UEnRQrzuqKrXaX/rKRy\nf90M36XrhiJaPjd8q4aaNUPMmAznmJ6l3uxgnBGamnYGLZs9CcnNkxkvSiWQ\nufXtLx39iqlbKaD/IPCUrKo3dGKV3GwHHofcSDYS8S/tu2IArpfCgJmiBEyq\nMLDVK5zM8IXYK7/F1dVDnXv8qPsn+VpxSKnxMiVYhdXkcHG88w4N4+y5Pt60\nXmhVobb0ATgdALSuZ7wtoWMKiqRD3BVKx5mdPTE06RELTWH/ZW2C5HP2KBbQ\nGT283nMmL+BtcvW36ctGFQJyi3islP6E9HNqniioYlSM7qScap8PmyY7WW/Y\ne3tFd9x0TfCte0M5PpGR8BEIJ7zjO4lIep1hy8OLr1FWje4eBvqApXlzq5rE\npMR0+HXZ3F4Y+vefzQf9HslATsC3NMEAluREh8zimX6MwiytDy3IvwHyr07A\nKHg1\r\n=nM8H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZ0e52xirwtrr/jC2veELI/jIHD6JdaPziir5cQMf87AiEA585nqa8dyTwL3SjA43DIZI74q+BZMC57UjA4AY/o0eA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0_1600232258004_0.5936457503445849"},"_hasShrinkwrap":false},"5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0","gitHead":"7a96bab22b6023556d520077639312fe4fdd8610","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TPTmADnRwN8E1HvpzYmiMgEf5Dik5b8FVzE2KzpRDcMEfYVDFVLrm2r4cOa9tGhwMq72bTEAhT495stJ7bxqPA==","shasum":"9d4520228b90e7566217ba6b79adc439e1232106","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0.tgz","fileCount":39,"unpackedSize":207982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZtQCRA9TVsSAnZWagAArekP/iciAq4ogYTgZcOX3XJe\n4/YFgLS6LzHunbQb2Vk3KoEqGpm4qrMzTY8lgxy995CQPNdjH7+3yI0Utgni\ngXaMRfSPFjdld9bEV/CQkeaImtA/Y9ibNdmdBlaYROCVtEv4fB+TG0+ToVD0\nnUHKHYdr5RCJOs1S4HoGfM9b6ewjeYZ2qBhSjc8/aqIc/OhzKPkPfGeY7a/9\nJSVWmoZZcohT8Dj/9lU99w8NQOdgb6UqUrDWVP+de1zuqJ2wEG4qNJ0gkzgn\nF7eLBVCfZG4wmUoLJk7zld3BB1Ft0s9NeP5pNjHofwDBcwO0jRsgj4pBIfeB\nsMrczSJOnNKyEZkvN5nlQmx15j1whiHOWReTcwyOEYvQwp7nBB4b+cRd+huz\n0D9hWN3ModGI41AjjpM2ZvS/8j3YaWQFLUSu/2glPCcylEMFwpxXadfpOEPG\nDNuHZv3hU2OgRM79WxZDTEn94zJc1vqv4GGgppz71DYcwWyBZ/L6Y9cffFVX\nWI4r5xpAQu+GDQk3zqdEuq0KjAJciaVvEu1LcOmttu9DSNgfNuLHUoduS9Rf\nUeKs8PjTNlCoblUNo3+A7/6bSKPe4ObbLEFWYQwJqhg2f95g8ykAl67f6q0a\nOj2GkZ64/xWvxXoNojjmsfRDhpmKd8WbAgfOw3rwWn2GOR8IN8fiRxVJo9o3\ncV5R\r\n=rJ2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrP7BeQBzldWk7HNnVWjvjzLwGJycaiWl53NHC200dwAIgf5t8M5nBO3BYz6DYfMB5V8seYqlY57vXJ7xoQsnCK4w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0_1600232272085_0.11501851465162205"},"_hasShrinkwrap":false},"5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0","gitHead":"a937394165f876b9a61eb7d13ac3d126e43f216c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-P6FrXcgy0UoAKQAlMjFk8aanO88Au3gkeqfbq2AYhgZw1meyL7/E6azSm3IxilS7sgLswQxpFpKiO16v2TmPhA==","shasum":"c12ccfee509dc8c4f160b13da5b3f8f5d46a2152","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0.tgz","fileCount":39,"unpackedSize":207979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYZt9CRA9TVsSAnZWagAAyW0P/2GQowQfQqrDMpd4uauR\nihq5+dDUnB9eAzrtOOUJeHc3GxbDuSftf9BJ6N9eKg0Tw+hFlEOqXh9AHOJd\nWuVwuKTdfzi+lkpebsPEBUHDnL61Z1QbokJWHo5+88aN9B2JoI0oEGRZzOwq\nfKf7wmr3ATuabO39n/L+hcgP782pJZnPSX4EhI3A4yNChA+02echrQZZ1ila\nQ7RnD+mCBID/fyMU5zavToy3VZqlwNAereeQVmL9b1cLOc8nSLrG5N+hKdRS\ndoox236+AOer5Cljy+24adZKdh4xidjMQAgT49xZOBAC0Dlkfyy75UdoELj/\nybVErrc74MsvAju9wtINare+jYo9QVCKrXhHsrgXcL1CheeENiYWFEFI7yga\n+pBbt30Zi0mWnMhiMA7AqdpaQTlOVgxxMeEE+cS2IzWxiMDICEO/oPr455+9\nI225UgbsvxGBC7Rp0doYEymyIK0KKEB4NGuRoVxDhRtaq6DQIY75Ssd+4NUE\nYGTMPMd9lOqBc0RenG94m88N+vLEiXIY59Cn8cFv6PdMlf102+V/0vcZ2vF7\n8d5bMEYQBEdMogdSP/Q1EubVnRfLqERjVOFFuQWzlk7TWNO23ec8GV4oQzbC\n2PAVCEanvrr3hO9Y8yx3LnWeUlNnlaRRljSbaqh7Woovqjo1vrbeBtz3vba7\n+dqL\r\n=Pg2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5gTnyi8l0JvhF9JaNtr/fzOKxK+mE3HNmB/GGpTRnOAiBOFIphJc9yae70ROhvElh+xqccBdZULC7YaWEQS9Karw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0_1600232316486_0.8966999708377443"},"_hasShrinkwrap":false},"5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0","gitHead":"03419b13e44c761d6f364feeef1e4f38b0aa7995","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-MbsV008Zx7QlVfcc+bzqVV00Qp8PLSu7kURDTSiDngkgZYCVTVEn3rqmkCHEgJP2MpIHlst+yuZn58RcP/aFNQ==","shasum":"cbb0528bbb2f3f8c8ddcb14da25b09cca4d477a1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0.tgz","fileCount":39,"unpackedSize":207979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgPoCRA9TVsSAnZWagAAcuQP/0t3SwKd0H68wyzlLOUe\nMx43A0i1f5KXYKMG2fcN5bjd8eTAJX/g/8xSgJEPXVSpANwhpdavDVhEigzj\noTYQkfI3EU6/h0gT0Qvfho4Ji3xv3BbTFnkwnh+rFopy+O1O1IGhNGnNJYx/\nmGURQEt/+d4xRUc3sJO+DC1xWjtHP9QqegcYrEtUhJVpfjbIKGta/uVw5D5f\ngpZhsUKoSguSTpNlIJip/Fzd0ZEuEKR1+A4PqsBrQMdMjNYRtFaH36Gz69mj\nhjmMFj2/tH44u3q5O5XbYwsun98TpkU84Wg5X34TnKN4JCuJUl1Biv5SAH8s\n/wpEn90Y7GOd1A8yRvcqwPI322bILwV4KtTtmKrcKYNMHL1iJ3rNOZ9IHr+M\na/ffgFMDLKlEtv8bc6yJfJyckbzsgYqusLTuJhA0+nf6nzwuqu/KL7gqaRMr\nq5v3BYccYsR3FkA6DUPUimiqVNZw+bJ+wAozNJZAr88YGZv7ga6srrHLQRYz\nxbYwcmNhqa5T2fLyAMp6DYC1b3eHmMMBuihm9dAnEDWaJ10DE41S8jeQtXcm\npEdTSmnilb4kTqPm4ccYBxSCKbFyXZUnooYTApA8+jod9Y4+8aROHnZRbYSJ\nEFNuGuCTHFfpQB2msScPLgrubom3q1L0R2/0twKHr+K5q0kVMRxprw4inGNS\n9RQl\r\n=NjUY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUoy6b0IMEvRnIy8YHnVjtPBlFSlaw9Lhy13sY4dmiSgIgLkGpdIxvG2Fdkt8FrSlngm6fD6JJnkti1Qi22zj1tF4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0_1600259047553_0.16956288553709875"},"_hasShrinkwrap":false},"5.2.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12","gitHead":"daf668462e4a1d09ef48b83c1152df9f11ffd29c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-w0vtHoX4aXWP3YTlvSucOgj8moR/VPPr6rPQkYB2iWbNcI2KtjQ/+4uDKikd7VS0LxkAh1G0RzqO/6Xu19flMg==","shasum":"778f62731008a0cef5f16f27574d2a58d219416f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12.tgz","fileCount":39,"unpackedSize":208206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgSaCRA9TVsSAnZWagAAll0P/06oHTndTnmfyewJdhzT\nxbLKWvukZaeHniVobxXdvOwj+EnDf2wUmkmigzqzrOmTkNzN8EdVtP7TwDJC\nw88a1Fyad4Yt0sJpkIffwJeJjenP39GbVAzZrjOR73zoIFIX5e22JrRnL36w\nsA1L9hWWcdNFBC6CE9hHEi6si8GhZYuA5aMIhNxLNda6Ih2sDsuB5tmcTsgN\n613s3fDbLtWekQZNZDWHYC4RMgxjQBF0hnY0X+D5PjlZ+nY2DvVaOxRgTHOM\nSJvkksJMcyuV004VJyrHVdDm5Wfq/EEi++yVXqD9PsDe56hnMhStCIJ2Pbsq\nWdA8kPrd2dI+Ui+2wJwhFTO7go1I0wawzTYcgYXxw8koU4sju9IEBTSMTceM\npNq88dwtR5gktIVClth7Z5m9DJNMR8cHoBfRaVpPL5V7uYHTQijkQQklzF8x\n0XkRXDVsQ28+4iowXzzgdr/VXOKxn9u+bYoBeOB0XuI5oSGXuZQ5wHPK/ZGT\nBF7M3p+1wzOqE9djtITgERF7BYckKZO7+Ge7qGIU0HPyIGOdp6y8nU2GXhOg\nJfLcBCzlaRJmTs9Io4xPVRuqIDma0Qd4qvpxBhQknlJAQSG5lgpv5zqrKK4B\nogbQlTQ4SKW+WkJVby7ERbWkdJqXlC2TDPq48WtWHW6O3Kem127IO5DFlnQr\nLR/D\r\n=3kJc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA68ozYqmBDcaF4XFWU7WNGcHLCi2SrOlrfuUX3Btie/AiADVvmDps0AY8oaUKmD1euXBscf6zedBlb0Zje2NVi7LA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12_1600259225895_0.9518481466592876"},"_hasShrinkwrap":false},"5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"72c00e65707b4a5ba69d5ee33a23a12e8f29f309","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-t8nqx1KJXxRcMtR0EU3KB7T9U1uRqV14g3TwQ5s9Azqa1Q8KnLfEOJ/DwX+siPYgev9ERvTYjlJ8kRK8qWxyUA==","shasum":"0b1cad1c8ce4083fb88702e25681cd56fad86af6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0.tgz","fileCount":39,"unpackedSize":207979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgSmCRA9TVsSAnZWagAAyXEP/RyPa7zhZBFnglNE7W81\n0emWv6G3av6zh8RMKOLanbJ0A121VMYqVp/tEaBtlOooxMoi1SuYrjv0szCe\neFjOfAxsGwgYsk/OMKogVvJikOnJP1t8KKZ04foAKT+n/Z0H6qkuCKsR+Y98\ntRirFLLPw+MkFZKLwBQ707IsANJdKK6X5SyiUcr/rNDggT+QY/PF4q4TPdUK\nT6rPszcRbjEdBOKGyYANeS96nxNiy1E4kjxdS8hyGkKIDi3rt7QlJJ0H/pHV\nCINTIFfUQzbE6cJFrO9R1SfiJ1AV+5ef/MYELtIIKFvaEu2WRQLGk7NMRvOL\nSma6JvpS13aCm2M9fhnq2LUQJFk6LMJ8qF1uKxjKhpMsaIXGRttLcL9jiCY6\nizgt0ZFNzS+l1oF96ZXdZrDked5AStcqMagVvsrKx5fjW1aOqMagPgXnJLSo\nVgnHvmd+y/bWliXUAEb1bLUQJdNKtkjhPBMuylmAfS1Z5TqPbPkyLdvJN962\nTtUsfnk++j6kzw/f4YtYhzDe9v5SF1hlcDb7QniiCvrpSWPMKB6HzSz6l5s6\n5Q9NA1/sMku3NgOWQUQDhAvZTwfxvxKFFZ9ffU/ZzQeTcCyrTA+KDzaa/9QX\nNLz+eFCG7Bf+CnjOWYsCMwBLapDydAETNMYZxCLnpS5Vm0wa3PoQMq4N16cP\nyPZn\r\n=hS2I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEG1dIRjJ8qJi7EekyR7XTod6itRwfx9F9SwP/hPYJZoAiEA9LHnOF59Opg3gpdPXx/kmN24lDsrCUeetwGhvpbM4cc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0_1600259237635_0.9837090670584769"},"_hasShrinkwrap":false},"5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0","gitHead":"8f87ee41553baa8ec3bc054a2be17fefc1777f09","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dKoA8Tq7NbAOKnxQyHbR2CdPalZOiYWtHQjHnlAFx1ng62DioTb2WDPIxE7isKvtFXYnZpjZ/EotmRuJ3sikHg==","shasum":"2a00e329698d485e47058f92085976eda7ff8626","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0.tgz","fileCount":39,"unpackedSize":208249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgTKCRA9TVsSAnZWagAAlJAP/jk7n1HTKS6Xd3OOGBBI\n3hKhXcFRAybGLlUHq2SyX+QvUNvxrHp4WaZ+Q/Rgg26Ao0H8nxgxwV+OhEvl\nPkPWteRxAYgslmAPoT+oHK4EwxPBnhzplxIQo58jvyjuqmJ+C5DiBDNibHg9\ntD46UcLJtM6a4EhthG4PBOAAcX/L7d/ma4BEv/05tn3tl78FEPnlEkhPRPsX\nes6ZTk9axrBl048f075u3AQu/FQ1NtrZf/fV9rezarhAtgQuw3mGwM7VNvoE\ncDWZDQbr6BrmAW3s8cuST2qAB28Fy9XlLSc5rIl/Vv+YeFrVFpGT6Uhd8fj3\nkVHlszgRO3MIJmQutvqS0M9/PSO8CwMSEbtqvylGcRIdV7F8PfunrfxiK81x\neR91ga7F7egDtMUnDvHbU2C5XDkx8rmtzSfDzYzegaBc/xPT3x7aNR+pvTdn\n43wFbRrwY+Y9wR9dviCtOaaLJ95qVEPDA7Pn2igFI/kJipH46OSmhUbCBny8\n9Hak0zhhrBBHTLuXBfU0/GuVJkMY7Uj3JDr7pPCu7ySM3RMEqVlYKZAAgdlS\nMTmZ0ICngIUl47sKPx+UinEmoGf+8zvZAh5Kt1PJdOyGxxFQTRVx9qaq91Zc\ncsMBKAUc3FJyQxbAuQHSwjbXQ/c+rj106G3xCdFLB1SagSvXB6KmPDox7UmB\nxqic\r\n=7l1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLkUubZKZDq+9fXp10idrcBg9BIWwMEfiC1Ev9ZsdVhQIhAOMPXA4wnD6oARl0UkGcdnBeHdx/KATbNaGA3ZubdS/w"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0_1600259273866_0.20938386263836084"},"_hasShrinkwrap":false},"5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"daf668462e4a1d09ef48b83c1152df9f11ffd29c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-pDxrQYuq92PsX4BfLk3vag8q7TPQtBL740VfYa/V1JZQqjCtlpRH3bTzRATBj92BREnDs4gwz6xpqzQ9wdScuA==","shasum":"d3ba45a8bc49d2fbb362aa0ea6f20862c205601e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0.tgz","fileCount":39,"unpackedSize":208249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgTzCRA9TVsSAnZWagAAasgP/3OaLBiSx1PYFeqCmQOZ\nyh1ACqPiCWse9/TqWa9M0cvc/syNeXGLzsMgg8hn8arpqPtCn7a9mULEjZ6C\nN2wm28+kSsMJuWcEI3Ah0VXeRJp1WapXuV2exUbAVe6q05RqOySLcSeVNAJL\n4r2CCiPe4bAmua0ADhuRPhFuuUYL6a1wXoMcJBAzxzzic4qf4zsmjAHliA4c\nFAhEpIOpRb8BEgOLgigpS8gbotqVj5JJSzXzyULUl7Feroe1mb9qq2A2xKEO\nT7/TUi8xQZSwWCedYHu3iXB6EC5kQWD9WFlLqdymATXE3hRUs6ccGGBgrXrx\np47RZFh9D2TaBbyy7WTLHXDkMU5Vu5OSdotmkvJdcYcLk3twJidcJMfGiE2l\nfaE+ft0Kvu40w0rWWVEeD2aHhXoyLFfTitzvS0ZmJn9ubLTlbIMQ3fefmfmT\nqh0okncEBeaDEGdfdDVnIW1DwP/atoVx0L5QM3x3lQPeR5c8UhDsgXZymou+\nNYxKuoN7d0ny644OpoYRoDzUx7/Q4S5wuEF+kzfWYNZsbTMzQhryiQ/ckF+w\n0M5UkxJ8GNSVzhih6nodflhTnCIlqnsO73gJBUsRW/fl0zETeVduZLPh3asQ\nEbl8nUne68vxbmBOmQPWXzfPdxVy9COKydUpcohuoCiCxFaOOm14wcFfUphq\nW6vV\r\n=ppXN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7pioAn2OjPtWYRhrommi36/+9+Hn4/HpDb9hjmrS43AIgYSixcjJZJYsrnqZ3xvcjVmEGQ9m1UHSV+q6pJ9JwDBU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0_1600259315435_0.4814968442663705"},"_hasShrinkwrap":false},"5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0","gitHead":"9d07c803563fab8ccaf919ffb229d00d7092a2ec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z89cDs7NtpTYHpLLgzIO1K0tm/rHtWVNjdquZfz8/iwj5ul3jHILwGIZzU+Vp/qMniRFBtN/+SXnWwc5e1HAYQ==","shasum":"0509a5dd91539c3ce1c03b50cfd2197a65e1e5fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0.tgz","fileCount":39,"unpackedSize":208249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgUTCRA9TVsSAnZWagAA/cYP/1aNrDwNmif8JAuL8kF0\nLQi9uhGr8VEx+wZzKcFxkDXrPEM+cidltjqDwvzXm8b34JkBiCW7UeOPEQsG\n2hDV41uPmmmsni6b4FhpCdAu5SnSP/wvFelzw5KmgZeYucR8Th5eXTJ2Iwlb\nApyVvlTDA7grAcG+UCVHipMJgGVPlKiJxoHvAHHGcSXBnOOfFJbaLA9yfp2A\nufYJ/5JYOg/ivO0/ZdR/Ww5vhHOukQfx/sa4Isr5WwSYTs6rtM6sZhI/zDCn\nEXkyvd9wctwCIwfSg7CXVPnnHuOEQKTtr4eYGSBxgcZ0W+1Li50rtcjXtmmB\nk7CWAWWUuNBTO9fi/shzgkR1O5pN/UcvpTl4D2zP0Ub/tkwz6STxLbE5Kr1V\ndg/lnOkYx1ELW96LTBIh9vPJ1//SEJe7h+m4TsrKtlaV2YaoetN8ifeZG9oy\nNToAHgOC6IsJUrS0sxZa9RLHHqfA/tcj6a9SUam/Eo+TFKw4B05QwG8hd2qk\nSKm9wkAtd3NCOF2qCheGiO/+MXgx9OlcFvMTgKOjn7nnU2JzhxH0XiFpLnih\nRjRIsvLP5SPRvzVBrlKQFaClQasoI5DCLxz6qEMpKjDQJaiChRT8HVr1sXt9\nzopWR8Vf5nYb54kB0r8WQxAKIldpvGwJACziNDSvStKhbaR1JH9Ez+20lk77\nyAQ4\r\n=seEW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA+SNtFYjh/GzBUvZGoCHlBxGtmC5dwjnFajfhx/CoVzAiEArqWZ89S71roB/wYPXXy0ypx17cUWG1yR9EoTdfW5XxU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0_1600259346637_0.9494102213009199"},"_hasShrinkwrap":false},"5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.3.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0","gitHead":"c50519c6ed8a4be50b5207c6dff8f583737392bd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ok/e4ePxdDWDmHsWwlRd994SMW7mIzhpLZICWZV3zKMjARjCSfmv1ogp1s+37hCRC/7dRWVw0HKrACz7gZKJ8A==","shasum":"ddc59065adf4c1ee4b1b5336293d63aaf5f683bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0.tgz","fileCount":39,"unpackedSize":208252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYgU8CRA9TVsSAnZWagAAbbcP/0s+7Hxg2zcZN8cdWAOp\n6n0RkdZI0eQgpEZkt7PCaBg7f+IVG27kb01cgENmhXWxcC0rWemOS/S+yw8c\nnLlP3vT4vAk0CpJ/YniaBYko0XqHDKB9DV7rHRobijf60yfJGCmF/MI6HQ+w\n47marNR3iS8kBPs7cNk6+gqErEA17JJu+xxW0inJk0v3CcW0eTjSiXhlRxPq\nCLUWpUQ7lmlnWqvyQfPl3zd0XRbKmEVweByVwVZ8O/aM2QVRAPJ1lNTCF9z4\nvsTfhtHFPMDQjpY7SQCE8PUUSSU1o1vCDAsEMaRnhdjeOotss8ZnLcmVG0El\ni7OW2p7MTAf/U3VnxLTt9Lqp15utGV1vLLfZjHvK7ze7lz2E5eRvFmx7y+ja\nXVJm8pmsmAomANxG29LbwfqMfsea55IBq1NnvXKHZ1R76+/HvCJHKmQDWbY/\nve9EXEVE0n6DJFoeAWIVuLvrSNyPChH4HfUsBTLGgiozWRXH8gHK6X2FE7pZ\nN2Zs9TMCZbVO8JTwuikPjecMLoE/JK+6EZTFFd2yijYGgT54bK/dcF2Qm0xB\nllpaSfF2t1vAnA6bQlthpuZi6bEqQs0EMn2AS/pQKN4HDtAccUTy54EZCnFQ\nEbxVe3456vB+2sySa2+GLIeWfSQjSZ+olJ2Nal9KiNIaaTQgudZf27S+bsnt\noQYr\r\n=1sy5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4gesfR+GTxjmnYAmCEYQ/53n2KGhgSPuMeGR2Wc6TsQIgUUy5PAmtCw3bzIMYFD2o1KOzyg0GkGpyfRrabNFAFfk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0_1600259388447_0.44579493422515903"},"_hasShrinkwrap":false},"5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0","gitHead":"9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2+DkTHWMjeSzojA1nFgkB2vCu5EFC0huoCK3lIBXNvQJlF+Oof4VdFSZokRWRn9aItDjx8IQ31ICakE0n3FCnw==","shasum":"b141ad544f7744b5299866aa20250bccbfd3ef3a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0.tgz","fileCount":39,"unpackedSize":208249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2K/CRA9TVsSAnZWagAA26gQAIduZIq4QCkh8puL6kSR\n0aCsbj9XSIbzBHobuSPLmya70pxL7D6fTCdezfl19XzvXWii6whL6g2Tckjc\ncQaNeJEhuDNbn/BFbL5pCcQJBLDeQksu9VSKpB6OhiR31TTx3nZUOFFLK3Aa\nWmKBUHWLlSbi+ogzTORl6JhUMGXhRyX+HyKZ8znmM03xexSQCq/Rbr/R2o0l\nHK2JA69VOkNgUxrWJV6v/piFUMA4ByoSz6xVA0gewvzCdoA1hDdTEh4u4f0d\nE2OawQrF3ggRJ038U5R6tLS5on1jiJzufadOOVjwsl29P5qbjqFvp3UEiMUM\nWtYYLsbjWYZqFiUvS+VErWqpkp1hmgp8qfh9Qmo/nVx95jAFCtugFzcWpLa9\ntSKRrlsBqA3qGbawEJ7M1kG4XjSDiRrd4YiZa8IM1gx6fdly0HxX0eeQPnrB\nHucC+EZ/Cpjn8nhxQHYj6aq/+YehOAnEm5Zc4iMvmrzRqm8wHRZmzCjViNGc\nAB8M8WcwrtSBQLvEo/57/8q59QRFARLb4mEHLs34WrGLXMG338OKWIk468Ug\nFsnLTd6ZC+NJS+X5pyYQKz4kKJ24Haiki3aOs/uKN45n37grqDipF74CJ9A/\nZHsGuzqeHL/YDqijqlhjdLLy0xnmf2l5ZTLgz7UzVRVPbckHCF+VsaAmVju4\nO7Bj\r\n=+Kop\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyxv/PeslBV24Ywmb592NWCqJzX2LXMFksF+wmO/nWDgIhAN0AIYCr3a1/jNk0YH0S7Nm51VJG8wL5YCkPB5YwAIqH"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0_1600348862722_0.4845463620974608"},"_hasShrinkwrap":false},"5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"83921addabb224d8ff654c0c8bf3b73f0299b61e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-oh12EsTg2nvq0tiRUILOJ9oDN0aQZ24ZEBX/PPXwMggGW1smiXi2oT8NnpETfgQ2skW8lmRtj7OMu4hcWmalWw==","shasum":"5b25dad9547fd6880d0f25367d5ba45efe5e5067","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0.tgz","fileCount":39,"unpackedSize":208249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2MuCRA9TVsSAnZWagAAvngP/1HQqyQUhG+kK6FhA8b1\ne7u7PaL9pnFXWYWatKNpm+50qhzRC371yDnWN9+alKASlkEWpfnqjSIGGV1i\nt74DWAuGRfccq/bGGbr2gbQnFt1TzRG2Rw/vIHt92xXs3/ul3jbBU46wdPlT\nswkN4DOaIg49h1E4Q0OBaRCD4W5ereUVpiG6BpysKJxRn9W5gGFoH3nSBo5N\ny8nH28MPaQ7g+3QimQe4h60rV4bxQKLXTUP8ewYXj/6J8b2Vc7v2wO1T1Xkv\n7fAb/P7q5u1nJqrr6QFZ2QvjUIU7K6RP4HNdRRZNARu7jgGjk//Fozp+85+F\nMeQvAoTkot0yMSGTI85HvTK0HkcGGEzwbGyxqvJV7qqmI10BGGtyn99gPOmd\nrndcwa6QDPFYvhFXboORD/P6sWvqiiqy0BdNGXfEPYoWbiHMlqLRoQpx2sZ3\n+pA7P3x3S6WydtXk7b+SeJdJlhfXi63DhJAGV8v3JR5dI1wwAEvf3li8UpDn\nvz5Uv/6tGnKcP9caHS3a3j+xkrPfOi0ibHsj+W2RrsPd+m5rWSnfqNAb9xDL\nLXEI4efqFtpgZ4DbOfKb5iZorHh6iOiwfvy4JVP27pT+eLTL3Dr5CbIvMPD/\nECtk8Vqge03/VxsLd3Zguj72whO+MnFVt8AO5GBkW/QrKCyNYQab4HRIuM/y\n1+4W\r\n=SMZ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcZf2LxVRI+9w7m6aY73r0ppFMNo43eNxOjWM4TjOM9AiEA1CMJo0jTBd6seGsqQzvQBLJK6cGYpAMR7EkoHs5E90I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0_1600348974163_0.10341931421585948"},"_hasShrinkwrap":false},"5.2.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.13","gitHead":"8d4be2bb5cf1be02e681cd7d30f50666d347ce62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.13","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5wfk/Kedqn4e73/mlZYrcCcc6HRLAL5uqZvuNXj1o9VUNJKddh1VLgqdYvDx3YXJsPNF1mi/O+OMGF9ZXlvCNg==","shasum":"dd803f1925113d44887faa3172f06c6471d7120e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.13.tgz","fileCount":39,"unpackedSize":208488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2NECRA9TVsSAnZWagAA45EP/3CLDoSho8bR8ZPuxXKd\nSUHQyNfyi0KEola+r+bU9hYNA61t1yjDBQi09xpAhYcqPL+OV+kDxoV0tqwQ\nUkn/MXP7p6HvpYv90oMwpcLQ+xk3+LUCLzYehxZWq7gwWKvXGq59PXUK4/nT\nqrir/bHi5MQMsoOlNVVrLbfO2pVpaM0fzrsSIIMD0D9vQkL5L2O0Gv5gxUeW\nHYpaAmiSldHs0j4R9Y6/pDytSO0YbxkqVzqTBfeotPIGugN12hb6ZXx9WSQb\nDvsQE7cUJlu8D0g/sHJf9RagxQ4Rv3QHNLwAYI6CFX8JKeUF4BlnFNJES/0N\nEkUQwzPoN4daTycsgXH2twI1+sOMSf8DuoTYUab+10nF6bwA45J6Xv1QWXdA\naYu4FOi09K9W13LVpc354kQghF1dQonhwu7VWVuHB0oRtrYXuRrfYPgITZNR\nSJJDoUxNv+LQl5B548KldVfNM9p5V6bX5IkGZp06/0rpygvDAXfS8DRM3XUF\nHkill3iAFyuJ558gkhYwPt2l5w+pSnaD2EplTpxUd4Tj8WSk3bTtO43v61DR\nUmC0M/wnPXEHXTZKoHOf+aM+IaDQrddEn9QUx/iinsoQHxCexOeKdpZjY07c\nEVzQ73ptjSO81if0HoUwvml36DnWfg/wQgxC/YcxIxh5oumUWZP1saDnwxop\nXqKm\r\n=t3Ln\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5NqwVO/7x/hpnTH+yPusf8Yf7MpGmR8l7MsGVKVUCXAiAfKpeO4Eeqf+uAOT7FYfd1BmgFdTIQ3rWXQKKjyioa4A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.13_1600348996169_0.013834999729511965"},"_hasShrinkwrap":false},"5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8d4be2bb5cf1be02e681cd7d30f50666d347ce62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ovOXJqXIgBkn65SxNo9v6C17d8PVfmfu6HQxQeo3C1ERxd8xBLZ01Y0SW1wzCJdLVmhXP63FMzTl/fDLe+DhsQ==","shasum":"8b24322b91bffc0554133da5980214aaa4333aa3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0.tgz","fileCount":39,"unpackedSize":208531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2NfCRA9TVsSAnZWagAAPEEP/i7r0O5GBDC5cHk+hQoC\nSwMaYWsYuPE4SjimblUlyB/b4dR0rN62fj2UMl4xTFjCp4rUBXgnCzDbTkAy\nY/d42gh3L/z85fTuwcWqCbXR6O/uGRAxnG3iH6YmQhQ8CQZj8uuWQ/X5j1UV\n0WiZGIJDxA4LUMv++jvm50sOAj+kiyP+ow+7q8nH0fAZd+Ded32+4Lg+7IhV\nDdgnHlJO5spyWsY758pEUk01fyfk9diMwKaEUxnzbExsoDVdaNTGUmTFbCyC\nOg+4ojoZfEO+FDfme5WpTL6QRi0dYGZbzEH9mcd/X1zY7pddaGvZjSqEGfcN\nZ3rpo5q4ivdVvTy1v+MVjoF4yrOqbv1FXBpftzCCkpVr2yaSiTSPApHy7wES\nzQK66nWXktPlmrhODU+1uqTT8mO2/GuhgM9p7VHkjO4MbeAMOm6phGuRNgJq\nryKjRobpJd7x0Gmob3UJ8Ynti3uMiXhC8rU1XIkjfsaWQOv45HRghDVPlDTA\n+MBcEUguvzNLN+nPDc+j7I3PAHHUA+W0nJf/CbZCDvwy6LczBFZC3J1Z6CyY\nBwxO5/7DQUCHpzoTTP2FnyIojBD8BfccOJa/NHcEGVOJl1b/ZWgrjpbdWvNu\ntpLdstadwH0GUp2H45mGKcN9mOykbB8NWHd4F3gHTeFceHpKaukh8DtBRObv\ntGUi\r\n=lDM/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBI0shKOEqRA2jO8XutHBjHKXnip9LZEGqMAj7MAFsaaAiB/e92HMk9/jPJboG41UQfOCZ+KTQ1h53hKZs58tCCyEg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0_1600349023484_0.25235759428293036"},"_hasShrinkwrap":false},"5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0","gitHead":"1d85dd7ff45412e8afb4164c9ee867e6ed5f4275","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dYWSRHgmiHOJ3rcVMLkBIuWKBi7GdssPA1JxW5pZl6K9yntWDNT1gxekx9wsRhfZzf7TqD/4zLi4MeqUnBFzLQ==","shasum":"63eb4eb9d422ad38bd35fa655a14ca90df95cb26","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0.tgz","fileCount":39,"unpackedSize":208534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2OaCRA9TVsSAnZWagAAhN0QAJ4KcVx6s8iKrdAQIS4Q\nk37/mH6GRhzAuKzas7as3GVhBw2/EFptOzIcRjceWBAevww3RMWnwxT3520D\nB4X/miKu76/ivFwb2B2iAn/vkv8pamCVhlixA6NwZ6gqu/v810lRInQ5C1xs\ntF+hwvk+2QcMOi85BSvUaNzj496Vqs6vrTNOE93vh094aRu2zQ9yteN/THE7\neSjY1zyjvQ1HYOH2Rw7ykE85lRpueMd0+czidj+MwhRjYfpaXmwiVtZMzFLQ\n5T9nOEHNaY9ycpT6mWEPHSNHqQFij/SIX4HNWpHrxrkiL3g7KUkFaL84cyUX\nVlZVshCKuyYtBQop7Mkt69a0yoJQaLIIJnbT+4Bpo/nBNwK7sMUOk3Vfzbaj\nyznRTicvJGfZQvAcqVOItxatLsswDnmjzpb8RpvcF13t6Vs19Jt1ujWxjFo1\n3E0MQluStey/UJ3HuPBGtMO4LaSH28Oh8Ddq+ikwFCQ04VwQLiig4/rLtyiW\ngK1zTJ40HsSVR0ua50Tr6aq4tPxGpWCL79t/eXfsTd2GBihjlsRN12lr6WdB\n2E4/L5cSVBMcpi2MK9EdQNZ7YqVYLqW35Kh3koNPAU9X3fpcGHEZklk2sZrA\n31MhWsHdAEQw7B0DkiYHsyVX5ycHpZxoqar+naQ09lInLmQDdUBvTi/fgdn5\nm+Ou\r\n=zFUj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFygcY9qsJX6P95Fopt6J0/l6MJTZqVP5WIjdrhOcASjAiB1JuBODMjOoaj9ZilePhoKPizPRFYos4qkRlcetJdctg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0_1600349081737_0.841673869977378"},"_hasShrinkwrap":false},"5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0","gitHead":"63315757e0cb732960aa4486b93728f1f8522cf3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ypkn7j5b73tC83VMm1NtmZDSnxOOExYp/v2dPOZ7KfPWxnAKrP4wcEXqd7VpHYyTWjPjQoFlCEZ+p3fRwuraqg==","shasum":"ba0f130bc027c511e4940278e9ae0b369ee22ab5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0.tgz","fileCount":39,"unpackedSize":208531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2OwCRA9TVsSAnZWagAAznwP/jMjHdB+IGzHEeehfaNJ\n/dxtQ9zoRF7Q8rMH+rAOELQaT7Wf65d9RMSe5/3RczBakficKl/6Z0GIsWo3\n23EYJjoViQQIgLa5rIo7VoCYbNBb3Pn0qKeDVfEgeuu+JE1abd2xIowQvg7P\nF4h2C/7E2mGaqLS7xxE1OKPVWnwemu7hWUn1AJFfdQGQ1fZD8GaKyIyi1tJ4\nw1aHkeCw6URcBulty3rHc8ly5ZO3gMBpQIChZDMORRVoFfCNgV1td3W7AO9o\nm6leX9zeohGlC8ryV/Yatse1cGvmj35lKlmTKcBnwrbt2qiQEzJxTb2/90OZ\nqZ76+66ekM5YxAtRycZRAk2Xj0atznUzDQPIkiqPyVkBaisu1I744SUf5l9k\nX9dm+bUc3Lxa2ViJalejIabNuJoVzu7D1Uk6L2MQxJzBcyXq/Ew57451vhzA\n2KlXjRnQGJJebUchakWEB6FwGNfja5b2RpjQq1Kw2Cacqul/LAe7ZYYa6oCQ\nntChMpfZbJNvuiCMGg4bkOw+ZKa6ml2sneg/JZRUg8LXxbUY/HNLQWHoc0nK\npAY5G3TwyvLPapHGAZtyQosM4T2RhfLbqQMNHGFuf6tDQgH0TuDccJQJXMPf\n5HGjxENgFS//L97zdJiA4V2kfTb8NVUNHAZzcNylXt7iy3EYVXnrFpk/NlKu\ns6U8\r\n=Vijb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHmXPkUQVNAliN6EVofNncTo+2y/a6FmiURsapBgai6AiAXGZr61DNxepqS2P52EupqlcnDq0Ik8Kza++EjKNN0sQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0_1600349103642_0.5612639704376998"},"_hasShrinkwrap":false},"5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.13","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0","gitHead":"faef6a92d86b627c786d4f8368d13ec409c08066","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-d1HQcb5LAhn2XjkZxmSNnJ3HoVNfgCMhOp/QC0nCHypRtPNI1o6jwP2fZCLZnEwQk03JZah1pVW/lETZQ9mxRw==","shasum":"b9274ad12a88dceaa6482c1d7a7243e650b30851","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0.tgz","fileCount":39,"unpackedSize":208531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2PUCRA9TVsSAnZWagAAlzoP/A7CSWtCDQiYhbQew2iy\n3mj/44JZHyO0e3egoH53oKlfqnLK12IJ+nMQmEtQnSGlkMogN9QkozVFk0O6\n0BZMa7e1xS9Ire0tf05hlyv0rKaGIRRbqUn6fY2e3jETt50P6FENyb9EBM8o\nwCHNGgCR9f/lUvCxuJBL1HckQosptH5FD/kYsvtXV6UOmZnMtc6FtLGbeJ3J\nuB1/WtxpfITMGKpQxwSS8EOSVx5SIpcfcuYQpoJIaTxyCGfegEVv48NTO+k8\n1NgAoPBcvMmgbEJAwM+jOdfuYBpXALwFp8w1Ok4TsG+MzgGY5xAu1FpWlz3E\nJjRnMyFYhUYJP/oLLPmRaTTYYo8OW23JRIzU3j2NbWhdg24d8XDZy7C0cw+1\nZpOVvTT7zogmZei5cOT+FJz0ntXNL5bHaNAE3bvL+FXSJa6peTU3XFWV2T79\nUYvdGUlYJ+oGKGwHwG2RAKfdzZdAgBR9xd390qEuiv9ZnDoe7CLcX2gUoBRf\ndnUMi+Ffv+00RKpgjsF2tf1MGdr9RqsFiByFD+pE25Q/JsI7DpyZALiqQDNS\nIQWMOhT6VQ7WbDK7OhPDvPu+aeBpByk10MTCAu0T2fJkshgkYJEWuikSBvGf\nC0ajNor/APVRBETuyf4sKlb2ej6iZMjO5clTYZRVBNIb20CKl9SgL0frxtVs\nB0/K\r\n=iE1r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQGsNoxicRZbIWw0k7g/J6KYTf1NwQoev+DtozZSaHsAiEAnnk75sVNZ3E0YBhwkHU/9u+HKtk+lnAI87/Prs6gPM4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0_1600349140394_0.6440324998827514"},"_hasShrinkwrap":false},"5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0","gitHead":"8c504294db4bd5197757e625be1ed02cd9c5ed85","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-giwtlVC1jiluf8DQnzkAKdCBaBpYraMrPuiKVInORI3Ne7Eu0tny/q0dZIyso20zw75oohffFheDl9axjFWdjQ==","shasum":"fa492385316973045b636b8f3e3766c9069daa78","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0.tgz","fileCount":39,"unpackedSize":208531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY2yfCRA9TVsSAnZWagAA1DUP/2Z1QskcyWKKrr82oWPy\nXTXTJ1nhhBV9U5Yq4sMz/Ia27FhPegZTb16tXwODZjMA0ZC/iVijrIUfWrfm\n21BlNCZRlMjTQKiB2y4wih8odXVxV5iXTCKBe3eJcvViNZ50cfqWptPZpvR4\nSoQRSYRRW4wotHLHgCWMLRelhyK3Ty2Mr8wPttc+0/MV//VH1lRa6ikRg0ig\nOm4U8mvnSZv50LTkRfXD6Gs8MG4FW1D/U0J/iwy6GrsP6k6iVqpEv4fQPC6C\nVOGG26CnZVsmzuLJckqVwvXhckW86awGFTsWZMCalF0HjrAs6KzWZZsBfaiR\nNzO6kIvoLZpeySQAVPB2tdeQOyCAll9SpuGlSwv45ivMctaji0yYkm2HBoH5\n1rQAtcDmFSy6kjEUPJBpP4zZZjb7Q/SxIoggqESAuzdQIg8Ec7p9lwmTh2N1\nOxuptMWiF+iqgxsE+D95g8C09utHtVF3NLUg5+nDUIVm8ff+MZdftgiiTseH\nCvwejoDSRPCPptej9XxI/cgSDODYWkEMvc/eVVNmHwtGtYuouxa4zRzBKj7F\nhc1yaHBXBPMaWxfSB0HXNkTz0y70rQqg2sJk+JRebsfY3SsuJD5jEnbCyiE4\nzrt9CgY8eKIerVQGdtMk2ngfRZr79edPCNpUG0hrzT+xOTaaRSoTdY2g6UJV\nHVc0\r\n=UylC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDby+Bok0+PQrKo0jIp8BjXUXHKUfKCrb2Z2PMBO9t+PAIgXHjnnclDuKO2wILq4R35ySezcizMC+GU2eAkkRCxdMc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0_1600351390733_0.6691246195593343"},"_hasShrinkwrap":false},"5.2.14-425e80f54c923495367997e184104857066c2359.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14-425e80f54c923495367997e184104857066c2359.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"425e80f54c923495367997e184104857066c2359","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14-425e80f54c923495367997e184104857066c2359.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0q3blc9amtgiiyQDWu2YSGY24mdkmxrwocZ1UJkYUkxsz+CvZWbi9HtkxUrU4zwvYlpzqY/EEH97/YQA/gKTFQ==","shasum":"df66b25a7df72f3d35a43666094ecc97a8756c26","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14-425e80f54c923495367997e184104857066c2359.0.tgz","fileCount":39,"unpackedSize":208531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY20ACRA9TVsSAnZWagAAYckP+wVwaeDv2GnvKDH2GICZ\njr87++2Q9rkTNp/r15QZPZkFC256JH7EMcDEBb7W/yBj4cmqUqTtLcCG5agK\nsRjNifbPDtzZtNsuq1fThwCUBYtbYu2ArTXgNsyXLZY/yTBjmdJ6jkJIbL9N\nKCQURA4FXYmPQzH2ZrkNWFc9Df37hlh3wqClhshfMF1Xu0Yjnp4tzpajJKRu\nke5pXFBswOoTAvof8JTJmSg3XjVlxEoauHVogldbvl0b4LN+cWlKe+XDO1CY\n2Ic0JKv9iB97v3gzryFqptiEJzVhGoN6SCOID+mg3x2IG71P294sQlGFVdnK\nuC8GIEhvwn1CDmWAgBNQn7UpiEWJCJXC7ZF/vnoL6pmQ7CZbz+GjGl91tJ/6\ntHr1HUEX95JZXXbqeArBel9ihSVxdFbbq+xMufyDm46vEkouEIsWwE+dwZEe\nFK3Ultse3BLYQ+/WK66aXvs8Lro77YxXVS59oKNKO3XEZH/yDo0wcA4wjVrA\nAidqqCe0xFpA18MOvqW01ObCGI/MXzkFveJQXL9dzg5vSKjuV+byO//rC3+8\noXscdAMrvqUx/s27BkISK9zzd5enzJQNgGzzyNPeOraKkM+pHiC1dpOoH6WA\ni3jvLFsBeTCJ82bBjHEzOkKEnqC+/o/ZL4epHXPjUc9oBvU1VFgOmuuegyv2\n7sZx\r\n=QQij\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTa/igy+sm8mMtWwttY/Tse+6Se0aF+2c63Y0Fuq1srgIgR8WoibXiYUcZwnCTs0SRbNAzpFguKbpoWVaA78hNYWI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14-425e80f54c923495367997e184104857066c2359.0_1600351488235_0.05952339017453734"},"_hasShrinkwrap":false},"5.2.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.14","gitHead":"e507b5ee440952ae6d43efc1db660f7b51eeb87b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.14","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0f1IXYp8xxOhQFK0VEu/qUYdDEx4EbkRFCeAWKory+Lr2kVLYPgRlsgZpVXMRJznQCQWWNlJMC3xMU6+GbcxRw==","shasum":"05f94243e64d147db4a0215582f07e3ed8125314","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.14.tgz","fileCount":39,"unpackedSize":208772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY20YCRA9TVsSAnZWagAAwX4P/2NRCK1wQtiXS9XOT4HS\nDTRcWXejd0tvu5pLCWN4RxDLJH/nTQ0QrxXCuMbMlPIIiJvg0KNHYIQ65ePp\nzCvxSlJYTdFMMvyMpXbBUZm8gt114NMnp+rDXgDBcyFPs1CtaqUct+9PZMIQ\n23rwxENyNwHohErqqwwl+mqOOo2KKRGwfx2u1MSOu5XB+PaJRt/jboc16+4m\nhyZ4kkHTWdxYRpmuFQImRuZPdzJvgql1rUAtLUKNwIFwBT335YAA0SJkDxPS\naHdHpOZ7oLFRxZBRzXjKlNkAHDUdw8IYS+ihVTS0lpWpz57EZ4EE3EJnqYer\nfUNNlP4FX7m+iDZ0BdX/epP+Q+bsLw/nUJ8lvakphakN6DdzzVetqZpM7FNx\nM3Kwz7WbJpCDDuyQihebV0kEYkzFmOtKXN5+U8A/DTLOK//uWBtLtBxCpEOF\nRr249Tgs4XGW5TJVm5Uq9GsNqyslnP8RHT7BCmqqNAJ2SpEfcu0vvcCpSglv\nwmOt1vE/R52lWtz6DXXnwQq/Jo4dqxZeKruvRZyhSaSBESWyXNpO8H7GJKbY\nvggCK4JypGl8Hb9bvrahlNP/wrAtSTCZpO2HAICS9PLBkNBmr/lroq35SxtP\n7oLGc9VCLQMQBoMf+mQHyH/6m6zr6W3wI3SktzK+dlUNky+m+bIc4iAsay/6\n12aZ\r\n=AJ9r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZwB75JwH7VL/ylGmc1qVpSjbtCuHfIKZIgvyPgDjocAiBHjbWQwbLwfbzqnQ51o6XWwwcoDg1K4w8j4VHbm1vm9Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.14_1600351511733_0.8108977354943632"},"_hasShrinkwrap":false},"5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0","gitHead":"c8425123a0f451262c21f0f5630956d78966eb9b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZDRuW39fG5O6WX2ZgngJ5ErL6y1apwbdBQkb+tRPNh/ak5aDQ5U+fhm03UQWWonVW6a4HqrSRSNHuBKSy07ABQ==","shasum":"5efce6ca685153ced78b82c9b5c79fbbd16fddf5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0.tgz","fileCount":39,"unpackedSize":208815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY21ACRA9TVsSAnZWagAAKaEP/R77vc9y9Br1S436U/WM\ndhs1B/Lqr3nVjZBY+Pd3kzKk2xvqqTNZNHCroiam6T+5D7grpU0X8mdq0/C0\nfk2H3DD9z2qDQ244YaQeldDJIG4YLev7duauVZBly7AwfdMjGaKqy6ve3OCw\ngIukiKAt9FzXjt2hAox3XzK5G4Mspwy4lMDSp0PdcDNJBSvuQtwiWODMWCom\nnpSVYh06HFNAIjHrrucXmQ33jhnVolLGUvmn07OJAXEi0sTiVyZ/zjr4SprB\noA6mY+8ghdpVD1Cglo0NYDU1zWmeQnI1xgKbheh5ot/pGmGRSDlZpsRL7ahc\n3GlvJM+R26kQKcFsmrzvTRGCpi0bZ5xCdWn3ZK7xXYDFuMnzrEyorq74UKPj\nPPePA7VpJPZ7gSlaSBRkUvy5nTophHX6OcsKaxHuoQWrGmdVJrVVcaJoO3yN\nWJUlb2c85iD4btKdguTZGTnoRw/lafp8v0Xs58etJWbSL2umnJnA60/c4l9H\nuMEfEsYYweqqzUw4Qi572DsLQVGcHa6Nm7bEIkXr0vmi9I5HPndIdY5uV2nK\nVKhQ0Fv+UQVBOlKEf+pHIk8rQm0XSQ4GL8Y2PiqXq81cDLldM3b6o9NkQt4p\nieXuY9tPcalR7fB3uuyfXTFckTw/ddzFi98qwfBLiw9p1jK264E420VDLgas\nB4a+\r\n=+nBo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApepKQogSX1lTJH4zZ3bAyAG4qY88TNsF72CVtzR6AiAiEAgFGIrEHP9v2OgXWzyxDZPikgjakMUXoOpM7VdN9yRa4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0_1600351552292_0.05979468878631522"},"_hasShrinkwrap":false},"5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e507b5ee440952ae6d43efc1db660f7b51eeb87b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+cYkkDJuXzwZJC/qSNad5dI2ed3IG9FeDqfc9OJN5NNKRy9uDO496uC8oQ7QLHSZCe9Ip0IBfBSAktQEgHxrgQ==","shasum":"d5a36267d84fac1c24306c25f401b15dc4e942b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0.tgz","fileCount":39,"unpackedSize":208815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY21XCRA9TVsSAnZWagAA88cQAKJKRuC7Xb9Ob5fI05w0\nFR/1Ts7OaMQ5U8F9j0oHxb+DezOHun0YkSxYnQYNJSBz57y3CkAtrnitBeyC\nL+jNr82oKadUA0khaOB1t1pkoesQ9i6eQ+BMYCbKVLnWCpxeqEt5K3KQoOX5\niKyeR+4uJQZ+ctkUbma92DcwJ6+mzjQrwI3hkgjLnvnxzwUYZE1Kc4JZtWOI\n487Htm+FLKZgeb/1LPyO56lFCxN7cErx3ZE+eN186FHiE1Pdmx/3O/yXyn88\ngftjQop+2odfxIxfz55+b/BNCdmvXxOn2MowWz6IQ7rHEGOi4FHRUVIL+hon\nF7sAVvGQvJ5zDBj0DR+DWRqksPQOOpWSXsv6FK5GvHw8nBL0ZhLWDvnhjsqm\ntmvbkhRJHrk5w+4ztIJ7CfxE+Q039tvpdZPS52xSlL1+FFTKGXqH61lR0w3p\n6twLqXIB2jCLE0zlTcglWDpapSkPv2BfeDXUDfTeECM2MYjztD++m2iYP1vr\nshAylVw0OVF/NVPnddwIq5NK7Ui9SeMY5XTCI5qpYtCIrKkCC3S+Om0+uTYP\nscIHga6BIZMhXUMm4yQMrkgwDhhVHL+kR0MBem+91zYF6d4Ayx3YcigORSa6\nJhFEryQUDBat0ISDpkjNzwMyt5UlyjgS6M1Ze2/QJ1Zci4EVU+6yLinIFx0g\nS4ST\r\n=Ap+U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpb/iuEIYQoVxwsk8r2UVozVDIKeDzTnu1Sc5uhn6QVAIhAJFl0MfiiONhFrob5GP8agLJOCZeOHqmh259RxX20huu"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0_1600351575201_0.03515889483771417"},"_hasShrinkwrap":false},"5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0","gitHead":"3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Gg1Z4m4zUC0ZZSdX7a34LL5y2HyDCWyrUImavdpjet4RaTTgmDDEF1RslevIPEbJXUnvGIMt3/ktkVpmPFwOZA==","shasum":"cf02b4bc778ace2478fdab8577e2b3e43c4319e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0.tgz","fileCount":39,"unpackedSize":208815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY21zCRA9TVsSAnZWagAA8KYP/3It+hfxD4pAJJ7SdzjJ\ngtDilp63PELjMjOuC9IDYOvwgQLT3xBJ/2F7nTCRCEPILNNhp7X9o2ojHm/k\nTwUDzw/lr04hz9wCg/luyerYD61US72MJmF6gGPlACX5hfzmHfXV5BmsP6AN\nHtCQuqQMmfRxbid9l8K9cnUfkwdLI/vmdKvMnu+61lzaAsdz6sV+FRWj3ye2\nUZ2o9RK7Tr1HlpvUASNAei467r7gi+1xPYOv5s97KWoWi2aRLf/HJYaukbgr\nPmG3U8iNhRB3QP2JXdy07xyb+o7zi5ARGzIOzxGgwvpWd6gmLkjidCV++PjW\nr39wd0YC0eCZb+xjAjW+fUeuustedUk0CByBndIWrjsIz5WZsw1enSssIER0\nxoUSMN/aMlr2ESsY1PMXBf9kseI2BUaSw+ygYRbUHxYfotwEOH/N0ComOUS8\nX+OIBvOqkBeS9VPxV46It8FqrdanNiKelQl6o+1kiqjLOjOcvA9bQ5mZT9Hs\nk2H/Sjw5xFBzM/ldlWEIVKjT5wQNbeeippbOkhA+th17A/Q4rNbx8v7HTEYZ\neEMENoXu3CxQcNdiEDbjmKz5x+n7j7D1cSymqBMD9ng3gg3XCRvxxSDSXXSy\n+Br/7Vv+itIFA3IdyYSpWwiCehj2cZzWPDD9IwmqCNRdx6/DLIUe/q5tFGZt\n4kbd\r\n=sM9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi83S1fbLSFNwcU+Rss4kKR3/1FegYWlgMHJl/OYl7TQIhAJcoH+QdXsyeL/SGcpTYVAjADODBOgUUm3qPRO14owDe"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0_1600351603056_0.03579430173035303"},"_hasShrinkwrap":false},"5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0","gitHead":"193d3fd174496c8ab007e133c0dcf49015884473","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-MlubF/Y9JKPb4ZU+UdnR5wzBnPtq7Z65a6cnHH16wLob984moy8EVXRtFKGg5+ozd35nuayUnhQZgd5FOsBVyg==","shasum":"d79493c42f5192051219406d91c4737ce351c41e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0.tgz","fileCount":39,"unpackedSize":208818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY22lCRA9TVsSAnZWagAAXPkP/2P8qjPDZ7kuQi/e8kED\nFreT7SERSvRzVqfXX55dqG8FpNHA0bdHvRW9NizkqwOf7EVhKRhWkurC9jY3\ncfLyFcX8QlsPkV3DuA6Nv0+pUuU1RlqXFFP2wDDkSIjuORSH6BNH+gWNWehH\nmQtK0UyQxgBdPZc4xRMXcg6m4aI6IdLrEGAH1SLKszcA7dWIZoVSqlszAsL/\ng5aPAq5UNTdji/7DvsYWIXjXDMYXhfeOQ+R0GSp4HOIun4ECpZIAi3AW1u20\nTACDa6QSDle84y1Wp7XQoRRMLu0IQQENks9SOU7bheT+5ZLseTBmv0K45ZJ3\nPuSRYk+UAPYgY322ne3UBNkeGfAgvIYKXYXiZm8kxAH6tckLXTotygtpox4j\ng0QixqPFPShUPScvdcd+d5YIxrBy4Tupa4hCs6vk79A0JtEF0hu59jm4B7H3\nj0YFNX2hDveZY83onnfwvSO2VMQlbUJdC4sF8gW3nNWjI5woai1ShzlqVV5U\nd6gxzM/5J0xCwNhc1huA+xf1craqK5+KuHwrzQwX0RnZCYBBv0XfhTQ3LvXU\nwkZExdGryQmwuD7njdrzLOhVUW0azRBPgC/wQ5yk0KD3IAlLeBJ02ayyr9bI\nuq4V8yNCuruMmWdbiVBa6ycfRBL4hsRnCH/1CPYsUXXepDJyXSiLLIaV7Sfu\naYph\r\n=HmPr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDy2I2PaV5Odt+uJaPBNWjSw4IatThGM9khC9B1fcuEQIhALTfDItmiDJ0nH2hrerKWNOyD55APCzGQ3r089ji+uZb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0_1600351653266_0.6727979726310556"},"_hasShrinkwrap":false},"5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0","gitHead":"96dfbfea8a89cedf4520c586f8031f5b105e0caf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-hAY/NjbrjTN93PKG02dZ8G6qPvn3diR6W/cnRoxewsEuuAGvpiIIpOZ1w5HJIsPi7vt+558oIfWlj/nu1bvOnw==","shasum":"62c0937fa39d83fe554477ac5862c1ca3d4912ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0.tgz","fileCount":39,"unpackedSize":207154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZHQ6CRA9TVsSAnZWagAA+IsP/Ro6Eqs2aKn/KiLiMQkO\n1CWynjH5FoNZCWOkg531Jlz3K9evfl0Ho5OcGhlZJGlEw3r5SRNrvmE7B0FK\nazBQiq0yopvzdtIXulDMULFSSU/Og6HU1AxPn3AjGwv97frP24n9F+t273Av\nvFVGKp/q5hydXnXGxF1B5J9HzcQLLy18Du8dwr/XSb1FcqybheiGTnRQYUwk\nCPt5XaMTGRfpHrrAHnOy5rtdekxPfPwnzOh3QcAWzRXGG94whMvC4Wy0KFwl\nYnw1VVm9ul+hRRy/j4YaMVooIARqORs3gM8HOgbUTVseFp56f1AN/cC8Z6zx\nTmVA8xOG6XIR4alWYIXEE3RJhAI4/2IjBH5Gj4aeq5qOwTqxPyY1T0Q8hp7l\nM9YQPDx5g2BtIbrcHHyQJazED4FPJvQZjCArGHxacTzdpPA4WX3af2AzrOpL\nGBirXc7h/7Snin+ws+kKFVJLOVrvr+pVgEshspNf/F1V85AHvCso2GyGc/pC\n10wvIVdbyWKFiD+aDds8/hCQqchQy/V6Tpg3iLk7+e3xSm1siPje2V0pzgd9\nGCJGF5ygf4bZGONtG3asLkt9mHiFdHkM4dKdthuV4s2ns87QGAUR1HLKX3O9\nbut5hIu/MBRysXyBdFxnN1LJs2zCl+cbFK1DeXV4Tn0Uff38Goh4VWhWPitP\nQAli\r\n=sTHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAMXbzjhkWKTDu24FKeF5G0jwVCOPojQRi63HUuGnT/AiBMtvWQRz2JHdQrPIJjmwMqU3CBQZtnShjTBzme8MYXzg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0_1600418874217_0.03871847770731618"},"_hasShrinkwrap":false},"5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0","gitHead":"795dad87a18d4a917786d9d597a3bea5ca0934b8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8tsD7gJcrNYLvVi0kLFPUa+3in4Q8MYU//F3n+K7HM9M5q3MwWIeR6iAgngtUYYkkksstAR1d8rnKXplNA6ccQ==","shasum":"8bf0b7582924ac578e13f256b9011db1873a818f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0.tgz","fileCount":39,"unpackedSize":207990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZHXsCRA9TVsSAnZWagAAwFkP/21fM6+74Frkng2Iw/xR\nnjVOuENPzqMbJsJhhuBEyI8RVT0OQw2DMzRoAFmQUD4bZFSM2A8Mr7GVekHz\n0YlqLTV6W0is/LJsuUK0WlNr+RX5GrqCHGrZX8FDlWq7WimlAECsy3F1jXHL\nNjNb1IhAqZnI1p5HJPGDLSHki0AErEYNlPyGWq18stsZ0S9hahumluMZry8q\ndpbOjQGM25LfTaVDxhJKukb/gjp8cHoEDC/UAv2VWBmlacaTt9WkKelK5xmN\nJ42lVKTJf6o9vkCWHgc2rLof9mc9ppNBmQVO71pnvTHCT/BVEWEzyHRqF94R\njCqrELy1tX5sdQjPuW4iz2ACaQSyR0pK3RD/4xbQofoiFEYaXS5dEFfZUntL\nNTK3W9EutLdrC1KB4oH52u1LZ7akH34+dRIPRpqyNTjms1gKgcY+VMBuhooM\nuqE/sCoeAzkaIPfrkOXUQjlaPA2aMuQw9i56SMWgaZlJWrFkyaaFTdoffNfr\nosgOsfclvHNreiklKBXnofEZaVCYsB/bP2QrLlgZUbwoDRLGu1+oOOmx4SF4\ndY2opbENkz96VpRRK1odMANFyAsydo558hnEGkb9RQzibMng4pKm0nZNaDLU\nG8InS9RzfqFKid3PxX8N899f1e40ppogijFjLz5h04xRunZtXyXPMiC5oAqq\nO+4J\r\n=1UvN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVEmm/8HOtdqRqoEzW6m+CC2dTAi0BVV22d9CXL/Pa/AiEAsnkAiSMt8f1GxHypEbNxwvEQvu9xWY2ExIYQFv8LvUc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0_1600419307906_0.5830499953193031"},"_hasShrinkwrap":false},"5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0","gitHead":"7e4a03d47b590c93fb8bd8f6f073de5b6b3da921","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-85JjW1PKj2MW7GVN6uBdA+13dNtB+yjJVrQ7ImbWUKV/2ICv8MTDp8Z/xPSVVpWv37GBFC6b74YrC0VGGRKEpQ==","shasum":"211aa2b0b5db4178782acbb1cf2a67493e5fa342","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0.tgz","fileCount":39,"unpackedSize":208467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIF1CRA9TVsSAnZWagAA6KUQAJa8XsqNMtV8+eeC4fAU\n2agKrvJTRkK1HScOvegNM47D0orqIES3nMbpK6wVxdSe6xVC57RI4MQf9CsN\ntTX6TrVag3g3Ukgze4oz2GFIWVnvHFctAPF1NdDiXKHN1pzj0zgUFOoEGEc4\nvt1l7h11oEAv/nf0Q/wqlfo3tBm+K/K7b/7e8Wyirl2tNi8ajpixtARuhZNH\nRVMd4kB5b/b6qwfre5wy7NnewOyi4VNmhn11kqlvvh376sPbwFNOS108lbgr\nMJtQAyBBVktmq6iv++sRMAIPCEhPnWQzENq5xMXr0f/zSxgPxZ1s5hBjkqmQ\nEUfF1i3UTMrwtlTzw1SACcHj+YzcRQxhHt6PnjLo8mknvOfR4LtyKWa45cjx\n83BI2/8HJk4MMpU7vSve2xiQisjKl8uih9JvwmKlcrN55vV30XrLRRP3NIkD\nOvkCKdWZorLFNSB7vOanXbtCHqmNgku9Wq6NN037k/aAg4VpcAKQsj7Urh1g\nrMnhTJrWQRjz96pAwsjUKEtDbMdWxFC/ZC7C7iyf1HDPAFu7VGafLeUTqigG\nyCDKHXnXSxtbb4/YixGdxNvWE/0N7zqTJBQu60+Y4IwCKNQ8k8Bqf84HXpuA\ncKAbxQr6e7s/CjpZk+gxnxdOw06jNhfs3qj/Sj5bQe0Zg+aXiZBOgkENOWHy\nCOJE\r\n=xu3g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDArfg/k+VFHF8J2AHn4ka07LZv0oYAkA9+UO6j2Y81gIhAPUytukd+K2ZngdES0+O9c9/XS9/KKEMTq0Whk0mg4ZT"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0_1600422260756_0.34895645411257226"},"_hasShrinkwrap":false},"5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0","gitHead":"f8598d1af1b141452fb77daef607da67e7d8a71f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1K+0Y0qo32WXrZNdghHe+2ENMxx3txsJkLWwjcp/2VmCdtgY5U8yUouMZoy/Euu5UdHzyKYpXOpvVuK1DlI0HA==","shasum":"1ed40b53336fdbca8625b499bc6160abd22c71e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0.tgz","fileCount":39,"unpackedSize":208123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIJqCRA9TVsSAnZWagAAuRwQAJml6aVuiRZ+mpHm9eTk\n1wDQRK9fhr/xR6SEsWyOhYwZYw6vVVkZSQw8Vx7PKvO8F95SRF8Ih7FuTLCY\nnNGrpCoiWNUpYG9QslUKAMUEoyBRT4MLAxnbl1+2Nxt64pZtYIqU+KjABK+l\ner+1jdYnJU0lemweNv947a4WVFEceSqIO55hzsxghlst0ii7FB/0RZ5k/tpP\nf7CDlCpI008vuraERMTKmr19U23HF+ahKWZ+mDkiWnMxyBg6+K79QbdAx0qn\nDT5NEPuHL28gTFOJwbpNokj3LfWg1ydFE1z9GOv1INdz/JcK7elqgzY7Ij1q\nEXgSLJSGfJfIEyPWkjKNJ/HrxYvAProbe0DHQsv/QXZ0V9v1Ryvqrqzd2BuZ\nj1y6oa2AVpPJk5sv9Lf4vuoTrqV7VWh/rM1AjRn7DPVOl0gZBrAL2v1aUJgO\nWtuI2ThHyfoSEdys4ELZ56ITM5ViLh61BPyUjNEkF4ec72YK/G4rYxDKbVc5\nv2NAEMhaACOhL6DhmGPQwz3XTLCkfhYIXa0Haok3oFt3ruCjPL1OJcLqUmJY\njpwZikpGGos5zRA+xUW/WUr8P92MrBX0pXJTb72k552Ms3y4gOtDhvs4Y3vU\n+mot46Kk8pJJOCtXNypeq1HrLGETGBjKduUAYwWSIg2NLgCwodN1RNjtxhiF\nvyRV\r\n=FYL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMzYTsxpkJjMpJnOMoiSjTqtw9Whwg5Amaaq1tNK76ngIhAOnGfIMHyIfBc/wg/cw6wyoo+VYG/ADhewsiJOeZHBQk"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0_1600422505537_0.475501735575093"},"_hasShrinkwrap":false},"5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6d5450d84fc1780f6e1467f90e2200f1d66fee97","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YgC5rD0W5A8R59asAIna1jRI0QpB3Dg7F3vI3Tc9oWj9+NLl5ajJDrPB6yQO/37z45xuUKLrO05YazhCYsWoWg==","shasum":"c8e7e24c91510c789fef62dc1797f1c6b2d4175a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0.tgz","fileCount":39,"unpackedSize":208123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIRrCRA9TVsSAnZWagAAE7oP/RV+sioazYRkgoNTMsVm\nZRLKiZdE8ZziMG4RdGWdhhr4Q8zufVZL3Zi5CCxOsF7hhk1cNjuB5DLAQFID\nmokNqtATVBmNjly4R2F3ryfUP2DG03+dNPo53l0fZf2VEibtjANqU9pv4tYE\nVkuwL+d9XplStVkYOvq0YMtO+ghv8PajhusuFnqhTHRvwPR6pZ7XuQuQW51a\nmvZgbRM3Jmwv0xKLxEIQum/R5ZmlYiSO+iYxPOBKVy2G8yjK6t5gLgPEcVi5\nfw1Pd8n/GOJs76fwl4bGKQ2cHjTlcNnS+1YqljzoZWPGPnUrfc8of6IGBsEw\nfIBn8WK0Y28FIPj/fX+BAyKsddRgtomrQRaH6spg/2F2bQBHrifvIPmiqXR2\nUOhzh4LERhbsJdq5WdgbdWA6fMB8hkY96GtByC6NMdqjf7TCLykoFmwHFAm5\nmxX+8EqiA6G5z2H2VLkSTHg6L+t+rwRNtmazG0i4nAJwR3hMhhK8EvcLNYiD\ns21FSCoxE1njeAxWr7abWwpukZuuvmqt3rdKT9ndqVefb26ld9NoGEzjoYfr\nUdEhLEoX5K8aIq3rxckoQXH1cPEnuezkuG/aAQEUbUAMHmbZTedjsEJrdRhc\n1ILCNzSuETliPhTFEez+7dHo6mZUezSQqebmJog/3e3v+tA7aKgj2iU3MsNy\nu+66\r\n=Rzvp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICEVWEHUK2rgiywBC/Wi7CdTGMcXlYdXABhvii7DjXeqAiAcqTcsXBb/lyfarQirjC6GC8+NVkzJJHX8SU2L21ao4w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0_1600423018823_0.5180784364123878"},"_hasShrinkwrap":false},"6.0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.0","gitHead":"4cc6077f0b865e2587270a4bf4c522577c754ed5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jTha/ua/d9paUO2wiYgqm2j7ngKDiUyxOnUkBJMPMQho2brB+4izPZhMBFNbrINUgy/XdNPvHznJ9P1+0uTUxw==","shasum":"f6811707aec7e0cb9991e0c28efd18dad50e5193","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.0.tgz","fileCount":39,"unpackedSize":208433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIR+CRA9TVsSAnZWagAAuUIQAIiG46EO0TA65/qJemwu\n5bM+fb5tS94SdMXQ/gfKeQbQXhndeJ61B+Hs1skAShZvMQDVX4Mp7n5LwZiX\nnvQHu7d+qLpZL84rpyUz8sojZQJCL5WKzKg6/lWmmVBigCS+zSkswltsSGYD\nz0ffVkSL8VEQKpM7pxrretV8Wbi0vSLJcXqVgNwp5pnSMeust3oV7VDj79oL\nJOrsfNFTnRJ15BnMpCBQYPIsdzUNgY5EzTiYwzC3G5za5m8oejhHKJZ6qOkL\nYbtTAmON2ECGRYUxTYDDwEA0nsdjQeXXlgd8Fyk1wOb6MzvOJr0/xhWIEX1s\nvgc08VDuotTX0u+JOIXcw5r2VVZ8H1KCQUNFJXjz+BQrXX9OjNH9ffDywrZx\nUlX6r1f3bptsL+N6+piIH8BAdBww1dxV1+lmelv1Ndb/fiuea1m4csRM7Tlx\nixJmBucx7zzFDIYH92//aDSRZJin4tTibuw8usIeN182k8VbaNBRhXK3yI9J\nwbD245WUdyIg8ozn5pnGChXl97kj8jEwNm/Ccn4ooff2Ap5HlYurDMS5nfaI\nMELyckxZ79VZNOdQ2qaQxh2xtr5hOL2NhowhENfeR+Qm5HDPh0xk3bgv4VZ6\nPD3XlXZCP6OfKVGAvHitK+YbEZDLToBfh4seJQnkE3xuPXvchtyQ+6Pl/5sW\n7szv\r\n=Aid6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwnMkEP22jru+Dm/i+MWmz+1djgOiO1ygA4lyci8ItnQIgBo8DyQXxtNQPiyb3IUuz6JlO1AQsSXUxLGqOPhmGoC0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.0_1600423038286_0.9385399933267913"},"_hasShrinkwrap":false},"6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4cc6077f0b865e2587270a4bf4c522577c754ed5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XwgK6XzkwFYMtexMDIitEEeo0wDor1uD15gxUg1C6agmkh1aUaUtIun0UYnSOZ3CIv3hcoPWtU5CrFogW/0Q/A==","shasum":"080d99d222c4b035c4a4902d41542ad58be447b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0.tgz","fileCount":39,"unpackedSize":208476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZISlCRA9TVsSAnZWagAAJ0gP/3h7maLlWe8VWJALc1+O\nYeNJeC8Lyx1H5IR8rPdBxanQGL3ThZdNxGPM7JEtoplFNyc3Yj4xnEkCYkJF\ny0iPcFTI1p+WxS1vyYztULdNC4khnErTabww66R/sHd0z/29L+JOeETUHNwr\nuvCao7AxHfLnmWXiYeGDMfuundsAPraW6imphKbqX4vJsXrkyqLtah2s8T/3\nsh1LoVfCvdb7Iqwj66TqsGKl0K734iGdNCMY3+tQN0S+MGGkHrreLOhSbYYS\n+4ApQAF3hJNeSEYq2drnwh/xjv+NBA9HW2YtRZtQGl0vk9CSd6boAN/zRbW8\nRmNq/uaXzkjLLHva/NCj0+uGGwRIKuF9jHXKs2Kk4/+6r1nZp2/+aPUY6GVm\n/Ul0NCuK/5u6FUomT/XHS33mgWIAP/ogtt8osQ5kQY91d4OPdcfzYJrdNYsf\n65KtPlVF5LnrX2l/pPUUSfwMPgdQe2F92fSeb3fWo4mDBxkpvvFxwT+rkfqG\nOryONHusHxlE7wCcq+NYkryrfhxiaKrE1pCKc+tNuMmK4Rt+j1eny5vBIWVl\n0Tms3BkI3rnup7QDnQmPHSXIfHQNjmb8oJJFqDUS4FCWUso3Xegoae6B3ABI\nbkVRJYi5NDqcbsXOJOlqDCf95j5t4gh7KZIrZGYhu+UzYHVAHHHXJOdB2goU\nVqsM\r\n=pDQ+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkF3iZedBn5jFwMJcyKiRyJspvbSgzthtnJcw8Ls3s8AiEAtKlqs1JT+PiRpwEkRkBpmOLrCznypV/sZ9ICmuLQco4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0_1600423077181_0.6880749509552515"},"_hasShrinkwrap":false},"6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0","gitHead":"320c39a95df4308a7458b016f8e0e2d7339ecb37","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8nQwN3Wmz6cV6ZTrFLjrqrTgV9Znw269c69GM2e3zuNBIFlegE+JdlQ/EabWOfO0I5ulaiDtiPfbrjiQiopVtw==","shasum":"bb0a72156307cc86d51b8ab15471d0ea3d118fec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0.tgz","fileCount":39,"unpackedSize":208479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIUiCRA9TVsSAnZWagAAMjIP/1odsNMXShAQWeSF5RUd\no1DSN9RF25uSjf2N4uD9660Avt/VCYNZ9O475XV3p4MDsAsP/s9L+XxzZHZW\nI4EkyyJxZVJ1yFjvorsyiyG5UBBwfjf/XIbKFS2ThzMSgOuZzxNYLj7MSwaq\nojp4RTUc9tZhdkrA1C2uYo2d47H8BhF9MslRd8IRf4dvJ5CzpyAvfHuSMeAE\npzzAlIxNyynLrDZfhxhSNccrU2HiWP+jRA4qelBDfT1Y8bfZ0nHA9Y55A6ur\nA5eal0tEfFAe2A785xC0FSLcN6Yv13GxbJeojStbQ9OUZ++6WKuwfgokWlzO\nVB8fXBmqdwdYvVc/HjaJNoU98OLu/B6RREHaYOO/IgdDHapesEWSIt6L9oBM\nPRaRAwrOn0d/vXspRKR6GhrBurbvYteZm1j6F9Bpm9/fQTUUnT19JESi1GQU\n5mLI1XtSFiusqX6CQx0wc3GKKCvteelwAWgcsUTCZqRrhwOZK7f2bwkGtG93\n4dZVtu23+Jpph8hLnAM0E3Gh3SSa+0gCxMBjd2Ly0/jvG5nms+X6lwxwce7Y\nBRS+BZNuN5iYHH0td4PMz+Pl1BiHwToxgaSZvGZOoD6qHMrlCWsIIWnZK2ZR\n1Z2keZpD+Nzm88I08UOq507q2bzdRG1XUofsDhgj0j+U/w/e2Ot43GPRH+kU\n6mI2\r\n=pV61\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1JiAfSZLgd2Z027FykL7M99nm5lhOVafWCopZ4UiyigIhALFHZzv00IgjaBcYJRay/v4vuwj0XRLbEHs/u9ejDMpb"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0_1600423201416_0.287695808867408"},"_hasShrinkwrap":false},"6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0","gitHead":"4b27f1b4519f8277a8063556e586dbb7d2bfc6cd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-HTfkCVqNsPDWYQ8+My3VVAiqD9l0DQEVOPWn5Xb0bP8Rzn42DdwiDCNSyISNUF+p4xKbPA+JQ62bReAxmp0L8w==","shasum":"58fd0282a47233642fbbf24a169985702442ee57","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0.tgz","fileCount":39,"unpackedSize":208476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIUsCRA9TVsSAnZWagAASbAP/1lOattYU1pPMHlQIG5E\ny5HbWjvBC0SjOCyHDZ6VwL0wY2PXUaFT2pse7LO9fdMr+1dtCaCsrseasbph\nT54o3eJLE/JAVwEthZXnHE5O85v01KXSTgrGpduJ40dKy7ZwEjYZAO25rISB\nFvudTL+OE0VcxGQTGdcDqZT+3/cvIZVUjs+SJ8Gwen7kT+zU2JxeXBuEIBIV\n0BKTebPqWWeSYPGKJF2tIhtxixBRCrSg8bvO/NCv//hf3jfhURqHNnDP8Egy\nUEY7n5IEEsVfLUoM5iM6T7XPL9vPU/ghnLDmzL0fsdgxJrO4CJYjherAzAvf\n/yBUFU7c0cNBCcGcPMpyDy2GsUpDpjENgb9pUQ89hUNiWNhNd5AP/83/aOe5\nCtGX4S98B7LHCm9mqu0kPgCA8dwLpymZ2d2xGkv2GWakvg/Wbqw9YL2IqcYr\nVp+txkXJnMJxwzGX8sGY+T4Fe5dDbguKSkj1A9A0+2xjGzlS6TZxVw4Xy9/9\nT+AGOUaUKT+tSLZaJzcXBIARiSKysuTERy8p9wXTPqFc+EY2V50SqQHtV6Ij\nKCZUj/piiKKjCzthzdSX0bWZAiUNZnxRcF3l3D3FgYeeIc+7/lBnUCZaXnRp\nUgJ2kYhkdHcWm1z4NLcQl5MH0DbOurGYD33msLs1PQ4z22I23RlXK2yKUfeP\n+/NM\r\n=mhCG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCi39VSyl1IF2d/NFHG340W8nrRHlnCjLCosvC77rVBRQIgOAlNd5Mv8wbPi8k/VzE1YsonEUE1hxXG91mXbh42Ds0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0_1600423212040_0.8575657592083832"},"_hasShrinkwrap":false},"6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0","gitHead":"b3be4b8e242269eca77670bafbca98e14847945f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AyPg01L9Ck2QV88RF54qcFOPetfuy4YBSftuWSP7XN4an0XRr0xeFrcpviNhrLJegrsh0NcprpszrzhARvIxYQ==","shasum":"ca64ef9302a722bb97c0775acb31084be9af39ff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0.tgz","fileCount":39,"unpackedSize":208479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZbCPCRA9TVsSAnZWagAAgIYP/0Sqkp0SmPtDsKh6AohI\npUL438ncbg/zdsqV0BRu4kMdEz9UL6GOosESRpmz66TNw6nUPhsfFZvi4N0y\nQ84Y0Do0a+sv6IQ0Tzv/uxPRIw6U8TKNcJ+B/OeV/tln01aWtp9+1gikL92/\nSDce39N+R1CpfgS9v4zq5w6iSVpHdPwPtwaCh+3aS/RpfbYZ6uMnYl48xt3S\n3y5whDP/052BiF7N6cXG14m5mobmng0YETE/mtH3PN7hdkJUMtIvBmA3QAgh\nqsLwOadCgICLJXOvZJM9VSvMq0mr5skX+zdXbuAigOALxOUOmN2a2ikCj6q9\nOXpn4a/60m10ChsWZc83qnYXlKFhERWtNjHJxrq4lIjZZKUOlnTDCDd0btHu\nc7G3FTitWswYbVhTxNxLq/uyPZfg2LZ8f1xij4kxb+muUToC2AlaFnSLactZ\nVazSIMgq6Xdrx07gIn369iKJvISlik5BMicLOUNnLRo0FRN343aDLrDQGfJt\ndDGM2PBDM0FVeZcf/pOv3BeBi3QMhVYgswm2MF2TEDsgQiyuL+x4Kg6g8964\nOpXXoRXNBD7QvBbgzj9yxuBH8Q1GhTf+p0QdvgHJSKk6IA2VHpZ0WJHOlOcu\nzu7NGcdDBZOfW65vM8du3IKGecNuc7fYlAQPe8cNuX+Ej9Md7eGrkOCbZx+k\nE/n9\r\n=/XXs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIVKU/oZrpyQkdjNo1HC21anpk14+FLUfy5n6IRRouxAIhAOrouWzyGOUD5nhIsj8DG8CoPEeV/xpGyBXmmdOuJIEA"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0_1600499855312_0.12418089461339443"},"_hasShrinkwrap":false},"6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0","gitHead":"cae40d7c6a07702addfca1852bc4fd54b7d03b67","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-88I3WjEfHjFYsWjKaYlb9M9Rw4rIIM95s0Ccx4O0RhURrk7K5oL0q+f/ddgmJlDWpI6Jkfj2c6mXJu7FzS/SQQ==","shasum":"7d7e37cd4c05b7fbe47237d912b5596e57db7858","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0.tgz","fileCount":39,"unpackedSize":208476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzZ9CRA9TVsSAnZWagAAzGIP/3VTkCge5iOiblMD/7H1\n6h/GjuZKT/s91+GLsyQeRZVGeBAoLZ2C7Zk0z4ilTHvNDGvi/51n6M6k04cQ\nfHniY8rWL/gQ9UndKotS6bWgcJFYGPw1jdRcu8Ac/yCohuD4ojrfAdSHMENN\nnikHKY3sC7siRbMFOdTbi4+eT2othMD1HGT1fMqv3EoMI5NuLO2Cd6jj+P6o\nSDV68gNprLW/SP+tI5gjdw7Ib2Ea1kmtyxnvHf9iyDvqyEbzQXpxiUPh982T\nxel2af9TS3rywc36PU80lCriGZwfv8+9kZe3FKx2G8CXg3QIBW8l5U+zwM0I\nByKtKR6WCYrsO5r46iXxlFZBreHOr1LobdHicBVsCf9doOb6YpeZ6NodZQ6s\nDcSBvx0jwdwqe/izrzXTdxp+JuAlGXpW1GXEQiph7z75JqGZH5Ce/skd4J/a\npPVWBzW9EuU1RJZKc6pJ3OQp3vu0CqYJL/NX5t+vdK0IKLCdskMtyWqz1mF3\nwC12poeryIPDbkNgX6iKW6WjW8W8l7JyTBBYmqV9xiN6FQPERqONcvDpw0g4\n/w4ssDeF0X4TYz/1FXd1etFpzTPZRHFrsG2gywi6DJlynXa8CT9we7zXOcCn\nkbfWRoU/NNvAFAtNf/Icj6H6F9bAqOLklj4Z1FnZ3I375HlJQ9Kni9lgyw2W\nNZBX\r\n=949p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqZzDcoZydJshmrIXCxUHb+r4plP6MUpJ137TM10IzJAiA9ZOGgVK3FexFmP+iqjCSEQFqZvSB8AsMcn1Gm2MbPNg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0_1600599677427_0.5496321543063734"},"_hasShrinkwrap":false},"6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"02ea932a20351e08977ba1d36bd86784e9eb4268","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-nBWTSTTOS3+2T20EQVUCB8Io2vwHDujFtfuLMJ7pv3RbWoaW4vXpdqYjepI9QNweFJthgurQcGzVivcuIXlwrQ==","shasum":"8c25f9ded2695ce98ff5bcbdfeee76d2a902f512","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0.tgz","fileCount":39,"unpackedSize":208476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzbLCRA9TVsSAnZWagAAURUQAJgZP3TiLuq9wFwAVrVc\nypCs2Gkt1gxN7HqIDu7V+wO8tt7a0/JlvP6qHmgSBZcsB5GEBXZFWKo2jGBI\noAywF1RkthsDY7WOF2u1L7eccF6kt0K85ZChc6cF9mGM1z1WKZ70mcnwfsjr\nsCo7Djs4Iwew0fS54dMuOlamRbTnA0PsbW55lJjIqxTxqRL3tq/Shy5IglmF\n296tzYfXK/B0+zIZRUipVEqGhrQthgqqQ/OGWVO7xxr1MRL8JMhRPvJFGRK4\nI/W0umuRaEs7VNJJ0TV8doMkSem0bLsJU2X/US70G2RlZmYDiJsgEnOa+JjW\ntcxznlqqn8vhs/i+HbhuV8lFOxrNicgrjcLIENvGE2lJgpNarX72XSs6EiY4\nz+UG5qFjCCTblAJtzPOmog3oLTmHAXN0GKefyHFki/A/zc/vJh/dHYkD8Xjw\nQwbzl7DyZ9pM7kl4BoDTQsIOxLq31SI37TFgGxsRPYrS9T6bq2t2JLbqoPkJ\nkt68mDWf+nfwuEvIZYrwSGEpmH5j2R77YJe7DV3vt061opd6wRL7Hzk2BlcA\nVhfqHxyubZ2Eyh1u6x1AGpIXQIiRooyTV6yl0lQ1xvk5fnfmEw95aBtInSOe\nxoQxBQe8Kej35CUjm5X+86a8xR8ME5RT6Qb8gLH90Fpes1AWUpdPnVFYW3tc\nb0ma\r\n=fl8+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqZ88y3CE0Nn1qzQ75vSUiFUd8isuPT3XlWJXInMzCPAiA0PeYP+MRLD/ssCrLDH+hFSxo9qIUQLeJDrdMoP2VcJw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0_1600599755043_0.8863368494410446"},"_hasShrinkwrap":false},"6.0.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1","gitHead":"72565a2de63ed50521087ed47c47ae27cb3e9315","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ynKLYKTCtJW2IATcDv3SNX08sjnnbfMQh433A1OzTE3WZOzT5w0Z8NO/KA6ORip/3iJlOITScJq6tqvt5h/fXQ==","shasum":"1dba259d14445d430c43119683db2c9fb5c3b9b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1.tgz","fileCount":39,"unpackedSize":208708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzbuCRA9TVsSAnZWagAAzHUQAIBTYAhmhqK89Rn2Sdwe\nFN958OUJourpovaXfRW4oNgWbDlC6yLBT3STjCnzHXqNsPkYHZFbwDAhv5VH\nN72DnCVUouvhEicAe+QlsYXtsmcDO+3n17eGkHRBRKqf0EwZVj6oXj159sOr\nMX3oZuCEeqDVFRZ0D3eRCyY3Th+1jX0Kjh6ylyWInywqLopFAbVK9sweXOeg\noDZZgFOaJjQV07SfrrnIo3YZBfTx59KzdFRqM88wAnHoPuBLVZmTHIm6ZCch\nh/By/+JhZ0BOn3uCSwjXs7+wtlbwX+e95iEz1XdSEZEpD6WT9TtLgCR6vSMF\n3NRaK8mvCE0zVQmHqM/apOBrfj8VYVo7nT6Y2y+FY8mKMesNDhsnKrDTgRoY\n7NBjZlE1lbeadjHaO/3G0fITqhB4rkmczGBfJfsR0qtK28MBEE8t5M69PVI4\nszz2MYipld/tBMwckA1xdnXvca7+R43DokKwc77eoSJYYrJi5i9HCPsZ0vti\nn28SkDYdeuBOVTV3ORPHn492XYgYtrzTwjxoPJAHffAs+lG47sj3/YfgQI+z\n0KMRbmKSD2QTizyFECk/AV8rR18Rhz/6YNguuwvo1Z/l3rI/xQsEGCKFxxvI\niKYSwjfGW85iwBphxXZlsu0+ch79tOvcs8bVUzaIYabbw3851m2VEh7Kj6iO\nAtQ9\r\n=cJjM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH2vVVaCNnsqFwjsqiVK5TFtOeTZqf1pxDYbAbSsnfOxAiEAiDtvE9EzAtuW3DZJPCG0uf1Nx195xskcaxZwLQWHJik="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1_1600599789799_0.6757031987291087"},"_hasShrinkwrap":false},"6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0","gitHead":"9a05c1fc14ac516866e2a58304681090f1236579","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-b01NRRdS6yB7EucdkwAxsd4020y+t9D8rlKrUfdU68Nd3nwqGK66U9vfOY30Qn06TPMgmfK3bNcgvb8bLfPoTQ==","shasum":"ce6b76d448e36e2f933ea98c420ac42ac2d96962","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0.tgz","fileCount":39,"unpackedSize":208476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzcICRA9TVsSAnZWagAAq9MQAJbsWwHg++qqRWNMxjU6\nk50kCOu8ylg/Non9Imju4pOC0TZtORt2UHzJyZsklXM7JuheFcQjVQjj0roO\ni8QKXSLsSK4911TqwUMFFZ14/cOurAyU3y3tDdnXZbeDa93yHGxhFlFratzE\ngwL8mfZJUVjxDmdNha9WO+b+rwvPmsdsbM7A+KhSWsSX7hlAqOVuHaOMFCyW\nFPD/J+Vsqyn+TvyPxSNkJ6fyp11Z97K2PZfxAOBaRXouzWGkOH86hF8EgOJ1\nBILjKyTfibZQClS4cTlwgBl1WlxQlWYu8UyfL61ghwi8ka9+7MwB0VlHzWzP\nBZUx/O6ArNtbhNb4C5BId9AEKmC7SU+t293iRUrRucQqqc635RHt6X4AsaFd\n4oGcfSa2yoSukY7Zh7cLCl8ZcwcQgQN2qTLhDUUNTPdEYvtbiLvBdpJ+wUf5\nXY7vwb+UzxBNiHY28qDmrV17/FfaQ0xeb3y4A4eSBbKjh1KM6f9eUQCVpyhr\nWtx5WF1uZ4UHmIoQ+bOq52Wc002ycHLtBPjmmXTOEADfVay8Zkh9BpXlQc9B\npI12XBISPpb/0JR8LNq4L9jQr+bbn0jD12cN1qGBY7aiglVmNXTcdO4dKx+S\nbx9C/8RxsdnDsnU1jyqbXCEkHiXYDO9UftuJq6BRYCrKl+oOrehRbYZkiKaC\niSq2\r\n=wX2U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCh8kBRkoINNYDbYloDGqck8PRF+Fey0nut7N2YzrM0JAIhAIJrTWofV1M2+F7jwLCiVL7CqUP8gmy1NL+9zs4RP2UN"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0_1600599815806_0.26181431781527875"},"_hasShrinkwrap":false},"6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"72565a2de63ed50521087ed47c47ae27cb3e9315","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-65qNgyPhWg7FTwS62Z4HAwneuMMVDL6mh4Pw0IV5v6m17gwU04SyQxWeUO9RSRJ6jne3T7VGAVvuWmAQclEtIw==","shasum":"ddc6cf31d780347668b1e4bf73bce6713ba1d811","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0.tgz","fileCount":39,"unpackedSize":208751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzcjCRA9TVsSAnZWagAAG/UP+wXdDpaNqmRYaGM6poio\nmyo3bTden8nDCvbOHzTQckzQBjU0d6j7XA8qnuH2QYym4RaPkeGQzj7NJn90\nU0kWvwA6h+ZeeOm0gpYw9Z7flcMdmshbBl1RxT+uGG+VW06rfVak0P2eSviI\n9OMG6V7lcj0cEbkl9l8uVA3FFJ6R506r2u0Phkst8LPc62uIplL9p/Wvte0N\nkgG05+Q/AS4oAsil4VnqMVwPe5N4qncUDU/YhBnm/yKUiwI0N9rMgZRDkzvw\nvSc0ch28aDCHoNfCu0phE11n53BLLJBoFOGBxoVrUcUfrlQz6RIy0OeJTmuR\nqCHalGHH7I7LBpO6qshh+H64DZwuVd0LyhjbuIlMQjE+b+uimmVoCsNgqnw/\nxMpivkHVA/8nQfO5EllB1DR801QN9xeh7eTb/5efJSAb5LfomKaRhvOckOMH\nAGZDDbrOyu5mlr0sYPiBCvW7AuzZ+WP4f/T5NZdUVby0wFu8+kuFqNsCFzUI\ntQzyCMv/q6dEqIa7XpBNfChk74OiaVvCNs6gAdBxbEzeyHrcMBZSGvJSEOv+\nkEITIOv7qvarnxWRsEpKofAcbjaRNYpfSB+8xNbHHLX9tsFv2XL0quUMlTk/\nZgoAVxeiUdKe0U5dN6yWyhpOg7GO6oFrjQFDRrBJkKwx7hN3oVrOYTZHeHiw\nkZ+i\r\n=YFon\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1GdSXoyuFG/xYIhDIlG+/fkInyc5b5nIM5fX39O80WwIgUxTNHSFCmJsc5HHTMHwOGaeIDhJn0Z/4NpdGWQVvxTA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0_1600599842886_0.1521480929563339"},"_hasShrinkwrap":false},"6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0","gitHead":"15227faeebdb77d36daf83028cf30da300fa9387","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-SNL5wrx0UDvstC8G/+OsAGourTdVRg7Hv4J9TsmkAVXho4tSNwDQSjB5bhj0x4u/8pio4RVjMv8hXK64XablmQ==","shasum":"cfa7f02ba718853d5b2b08dc054796b528b0d545","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0.tgz","fileCount":39,"unpackedSize":208751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzdTCRA9TVsSAnZWagAAZZIP/ArIGLqQu2BBX2KetCtF\n4nlFVNnTrAEnNo3CEFX9Pnp0akoGnjhbid31zoeQaMuKi1VUvs8RYEJ0AcTg\nq/1uubJVN7o0bbQf2V9wkOW9ib/93aQtZsBxOly28Vr0XxiFeuQobtw11qgb\nu65fDjTjhBVdprkvq+Q9Tb+sUOvkfWmeFi4SpBh2F5TDLlriSMuNHRuKAmhX\nzlweYWW3I+GaQ19VhjyHXaoRsM98KsRGQcwbg/D8zY977PXUN9ra5oly3y83\nsA0oPFQWIa2Xa8zFb9koVNDCKxIB3Go1PLk6bjySjaDsqjBMoBIgQUyjWm1m\ncShY25lqnA96thdAiIqOjgdm7Yz2tFpn1q8uTK+GeXJdGbIeJ8kbNircrceW\ni0jMKKtEf4YW/fYWmajtRzfTt+7RgjJTumhGG9Qu8cLwEa6z92W80Q3Pua9q\nFCVdkkOOQ2GpGT3VT3Wa1IFnxFFVVw2odWJjr5UlILQqchzKNJoLSEyOBUKq\nIfOfwWuo15Ezi2k/H+EGwFlb5YRGzt8gY3DvIqUHwNFtvLqrV7X/kLLLs0Pe\nOknbbNlA6ltxGy91z9c+SYQS1mvaM8BYFaDcx9q5vaDK0ky69p7pBa+KX/KM\n8EETU3qsbupCSsce4y3aWinIZs+Wn8brpLDsmXHO5z45F69h87vOp5S0zNLQ\nvRsn\r\n=L49I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFaIvNqj5cqY89Ot5FZSBtYCiXVF3PxYzdp9gA4cgfwPAiEApsJLO4K8nDFKnfd8ICsWjFFLLqONpEYjZckKLolf9iA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0_1600599890794_0.3974309206863109"},"_hasShrinkwrap":false},"6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.10.2","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0","gitHead":"47ca7420ebade50b4fd1d742d59fd212da42fd91","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-nbQNkgGKxC1L+MIj4/DkHgtXURLqgiQl5Mo9TjirzYYgSpVnHRq47sWRd+YA3aK5RZCB27xdKFTDpjD+MYMVbw==","shasum":"0fd57dfe4196089e6c24541936e67c360552911c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0.tgz","fileCount":39,"unpackedSize":208754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZzdfCRA9TVsSAnZWagAA2roP/2DRa79P5PuWy4kCNTDZ\n44Ng2lGuPwDDiJwiXODdmyvheB5OTsD6Vyj6hMQq2MzfreDFc4dC7laMg7VG\nP/x4NEMzA7rPK2iFG5jlKueF1KsARVVKCy0QyD0UBz4HbC/cUXUUny/8jvnz\nk/tiPqHjYksAKIpHKV2ut+jJME+Cq99vqKLk8EZlx7vDVrj88kB4QQf146Hb\n/NpHMjDNCZocG0mvtU5bvOchH+Y1Qp2MyxAa5a78ELFm6cHmL+6m62OTEBNZ\nYbKK7XPmVmY7LR9rBjXoCVhO59RnvXrl++HrFgMZ2qd+4KqdOpx9xx/NByR1\nxqVt/4Ry2ON/PUwm0XQXjUpy0ULT6OCetY7LltToBwIiOZ14UqFP9z0gndQb\nD2r9Yw+N0n0Jvkys5WKNrzaBlZo2jzaG86eECaFa0NzWi9dRe8Gf6Xx+T3v7\nxXyx1j4Z5QcLh5rjW/wwsIIEKS0SpBHYh6hpzN3iaOXMfPM+bUBQwkujfLCS\nRBO76KePH+Oj2T5eA3VVXirfDdVB1D5pH+WpbbkxNGkB2+RX5GTu/6dlptoW\nQq9rFQZlMLFSFXPdgzbJwgutmH9P6p9d4IwEnWdAWUscDSt0+x7duw7MAMyM\n7Uvk6+Zw0u3fcGsCguUSerFVSjChTuXkB6bDzpce5GeTUyD/1xeiwRsBP1yu\n04eK\r\n=ognb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjjtWAs8aju8Ff1ARN/GrES6KuwsC4y3j+OSFmeN74xAiEArZyaSUeekeo+NnRC4EiTWbG9n88Y1B9HzlvpgU83NdQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0_1600599902530_0.4596592424940389"},"_hasShrinkwrap":false},"6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0","gitHead":"51909e01e98c45826878cc22c831b95a3d82a840","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RKv7VpfokWw/b//56XTPR65wBu+kWYU2kjsZ47LHwlDSYy1Zv2gXoJgPMvI10z+4lxZ18TrPdZFJFPnHGrGO+w==","shasum":"1c1455ff3c693a0038dbbd48706b618c8989735a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0.tgz","fileCount":39,"unpackedSize":208751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMOeCRA9TVsSAnZWagAA2m8QAJrb33lSUj14hAMFGtYA\nAxbqRWi+2EsicK9npm/ZaKP9EqE1qKK54FoYZ83LToCNXqOYOoRpiaU8OhHy\nwzB+vb711hc/OVUYwbAduFjEOZHH7anvai3SyA8UUzj3R6neL5+45UYd6NKm\ny1J4Ozhw6GAy2Dl9x8qM7jvbc1RLEzUkkRCCEWzX//1vF4ZnrB47oytCoReu\npKFTMAYwo4mgZOe3koWNd8aJcOhAB7PMnfmEZL0R9UyLuFXnAtXPq6mDYdS4\nVMaBa1v6Xv4TtialGmw3pbppt+4lBlJoeEsUxBJnlf6sci7oE09QoLg2zrup\n+6xsvNpdHxDvqmhFxZZQlgRES5fupuUt+xRAj07gqeiZxdLVO1uJ5opT8YCC\nBe0apHY3KQi96vHktYpYNPA4e4w6Oxak3/i78r+eDNN0/cT02f/FSaSB2NpI\n8/zYj32uwZezUB/0p3VkyW/Vz3ugvq07kVe11w3yqHz5UpWRxcsmIUbF/9R6\nGd/tJbTfKGYxrQeltXHA1Xr3x5esuwBMU/FZ+uBXWKNDcBf4KSpuspgfya2q\nrEc/dd8At2dXfQyLpR35/WIQp4DKU4ZlrQFvHK1ieOcOUj97ejo0795ML+3X\nYViFj3T4/RWCfx7VYamPKxhmh0kY9mlMtL36/zC7o98vPIA76atqABabJpFy\n/Eha\r\n=TG1S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXINUErxC8VKrmVJ7RkaqOL/nTCQHLER4fxT6F2tOhoAiEAiIKb4GrifyGPsbiFmveEydIRVEN0p7Mc+h6+cxpZyns="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0_1600701341434_0.9013039391086681"},"_hasShrinkwrap":false},"6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6e55035044d56b4c3b729bb2ebaee58f300b93f2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9l8chz2+nATbEjh8WAx1+P2+BM5RN3vxD2c0cJRf6D/L1IcOOOXOT+lnEKg675J0G1R28Fqj+DAk3+5BQMwcUA==","shasum":"c14e6c2a38e79ef11f5ec490f6cbd8df69cea8fc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0.tgz","fileCount":39,"unpackedSize":208751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMQrCRA9TVsSAnZWagAA974P/31EQCagvufAcrDDJSbG\n6U/z+VZIZBUex57NIDk3p+QCIHFoAT5YZjDsOr1yO62aVnBIAMQ58vF6PXq8\noz+ed1wboDmGzGr5ZNhvoe9iSR9FKIvJbg2y2/WYvifWAtLdLiIDMlBnPlrk\n8pLbY9BNJdJVX27UvrlW2fj4wwPEiwPaq/GbYZ770rgQtM5K/yncdi3d16c9\nIIFQbCm1Jrphs9f06yf7X8okkGGcaTsfQ+nao5yuuXS44SRd7Ffcs0cm07hn\n1cVdclRD1sDwLSjDJiEhQnnBCYyng6rgojEyRS8ikRFi08BzdZmJ8VWIxg4l\nwJ+Ft0AH0guMVWjmzzet58e0e7VZHanrBFbd7C9NDla7rqke+eQZTKaOgcoj\nlO2AnkoRMkF/SIVEn9L6xlkFG8fYljEkNxah1DtUgZN/OU++6Jq0e97MBLYg\nQW/lXk7qhx4qvGPfobG4Zgay0eTRX5TWF6RUy4AfiId+L6dIGZpgfuKL5xsO\nF6LK8xtkhVDNeFXQNV4qyqsiIOZpaWB3jk6z5rO2+8bNHIAvYZasT+v4dzHl\n4E2Ha4JsIvXF0t7ScpkDRLnF7Mu7NRahaO9ptgTIfGrxxW+cfyuab43vb7om\nWSQ65xMdudsCkFyh8KzWCImLf5d1dpfcpnQknTMio1fUREmQhy0d0av1cYWX\nfOf+\r\n=5KTy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTGCbA8UCwsHSVfaWk0xqnK08X1Xez7z76cxuZmdWZ5AIhAIjscRnQydBLY9BZ5fBdFT38oa69HGu6FP9OpaouiB5y"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0_1600701482709_0.7841133781682437"},"_hasShrinkwrap":false},"6.0.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.2","gitHead":"eeb78fdaabcfb6064b927de6250e716f2f93c6ac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eBmv54WCSeS/jthfY6pNM97rB+R7iUUEmkznsBc52+UQ/AqtubYpKQHpbdHLtqWR7OJspiuDfZVhH6PYR2dqew==","shasum":"18f667875c7714ba7e6f5be52b47344d7c16ff67","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.2.tgz","fileCount":39,"unpackedSize":208989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMRCCRA9TVsSAnZWagAAjOQP/iQzd0grvqr0lzxvdQUz\nYLriqAFuEKO4cVJ/lvO5vzt8j3V6ZhjV0t8WKNGPGayjUt+4ZhHm569cQZsQ\nzAkJUzrdUgUOxuVrGz1kTqdiYJG3z8eE3OtCCm74yQYpifk7Xqp5i3B700Co\nRKTVnz1OWQ/xr2CE7T3CjSoVlEQsQsje4vI4e4zxEv3SPKbKa8dCW2sLUGtF\n2J8TurT5tJxFVT06lH9FvTg9Z87q5t5KUoMiwXEq8v6+TxN9BHD/LXgUZj02\nFZQmA0bYzyUDMHd54mGCbpvEL/Jy+CZQuR75RCQXQgAdg4j+6Vnl22J9m0U0\n7M6Ey362ZAXllPh7UpQVb6FqcLhZlhfxs9Yhq6g0vUZUDQjzdrLmd+6eaOSp\nWW/r4/W6Jp4IQcgIyFMKPo5CAIoFy71YII+YUfgr4P+cH5WL4LhLreve9lws\nxf751bF8slVOXgag6JrETkDTWj2mCS5wdjyMMf0B1RHtDITYqT68xIQKDvQ+\ngAeMOhSPxIRMCIm9EhVfKLYIWw1LAaZtYQb5xEtrxkIDYI1vXMSGRHpLcacX\noGMC8UuijHWRL2RFKeuCgAJNjpIsgJsno+aVjVBokYAqjm6ujBAwtJX8kZPc\nKmSczEe7KDQiq8aOnGy76HR0gHw9CDyFKHaN/BNoJiOF9z8Sp0vTI3xZqCNQ\nC0JP\r\n=9Qnt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGLNNr/0m1sIBSawLHWI2eiqgLcUHZ71qloE9INhFd5gIgTUovHVMET/CMjI3bwdhYS/pNUxEjatasaW0tU1nyGUM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.2_1600701505661_0.4450748233700146"},"_hasShrinkwrap":false},"6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"eeb78fdaabcfb6064b927de6250e716f2f93c6ac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EIsXYwGmnRYH0BdPHhMLpoUgvAXu3mkNZUamReoAOZyLQbk3qkyctABmsxhcxKXuqmNPfFJqzOi+8mTbT+ehkg==","shasum":"680ceef354c0d1467d45ede47f325aff413417bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0.tgz","fileCount":39,"unpackedSize":209032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMRSCRA9TVsSAnZWagAAFJQQAKHONnQ5/zF/npl4OMGy\nh7Gx1djURuGjjnA7HKS/z2xPJVVXlP0cEne5MMFP2kefmLbEo/qBqD+dzL2c\nNPHWA0hpnA9iDD+GA0/AvWv2uebYaRzu7fxbWGSStSCHi6MgwBfWIah7eKqz\npk+YD1/83/Cxhf+9pS/PKcwFlQROwy4NDjJ18mANpRhH/T9IQBk1q6PAQ28w\n485Jdhe1P5zI6VuLWsx5Cb2aQJNJntIXsV/VUiSSGftENHe3So1NHgwthJuG\nTEQn6LUlu7NNgGhNueWnZ/3cE6IIdj6qU2/sKcmFJ73bX8EctreVLUOR6Lh0\nHB3p1U2MPUXnzbjwszQiL1C95inUuxe/bdPs0DteeJg7MX0RxJWatn1afYVj\nby7Rz1DrCRj3vzD+ue+UhPfv8vQz34i4lUU+odkBgm8rts1kp174GA0BUC4i\nxI7Mi0izuSRlj3gzhxgmeRYngxlO4FuAvrCUdUr9FS8/SV2tjCNI6os+Iv3f\nBjIVnszqOJJ/rUmk3x6jpGfRxtHPoo2WqbxVc+ujhM+b4i2d46P69xQITIVG\nnSN7T73jlH4zw/OUGlRw3+CjnTaRIANUGnyTeuz3/0l7xcgJwHP9L2qGcx9u\np58gHgTi6T87xbmGr4U09JetzMOPou6z1CGLwyundfJrh5hoQjja/8/vzDxl\nqbcE\r\n=kPMG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUICML/x8Pdp2etCyPGq8CY7z6ZzGji9h+2RXqHFJ88AiEA+kER3DFu2SrG5+zV1ledhqTU5pC207n/1Ts+NCCWBU4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0_1600701522228_0.06587373293763732"},"_hasShrinkwrap":false},"6.0.3-622f633579553712cdae2a5237c331ab02a83717.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-622f633579553712cdae2a5237c331ab02a83717.0","gitHead":"622f633579553712cdae2a5237c331ab02a83717","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-622f633579553712cdae2a5237c331ab02a83717.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QJrLEudUhC2y7H1k/SrTWbmE5rkILJ7CBCX45mDKMBwoD2HXzbGnEM+2+qcrXpTC5AwhU+tE5ma5n0eIfmRGlA==","shasum":"732a30a9adf92d308e52b5eb48ec59536b3ec585","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-622f633579553712cdae2a5237c331ab02a83717.0.tgz","fileCount":39,"unpackedSize":209032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMRrCRA9TVsSAnZWagAAsagP/jhDVb+8DzLtEVz2Z1oc\nXqrgUbOeOn+Pwk7Cljr6nZLewWeHHE49oC+rFTPMHs5M5kmrc6UlQpJV6Yt1\nk54TFR5AUj+lyeeR5Q3lG2ZN0SQ/o3dgvSMvF4rmgsBeQIx817OmYKfo5Fyi\n8HuPRclOu5D7Q7cprYvFAYBSBuMKbVCnWgOPpdfzXv98eUcgcPfI0pM7DFr9\n1xZay7qENrCV6xRVFccraDi3vo4mxHCXz4vwa4QqAzEmKT72OnrUKLmvFV6M\nEK1co9pJ90b5QbQSxOsRvV+FOk0wkxKl0Pkc8hoDvH+TVXefE8pkfU5yuQWs\npsLrR8x/fdY/hO+JEEFWm7iUUwhqShZYbqHGzhNZcq6YCGN6DHR5vBs6EkwR\nBlbgrfVSxQ/dcBZSDyHO5Vw/0tQP/uWX8abfcWEpOb4YbUchduZ1hu7bRyor\nnYhA3yCF7S27HDCBQUEX784fJWo4yXvEiC27pjmcJvks0wNW9+yhFZqrD2vR\nSm2nipSH4xnHW6zS+dh2YSvoqlY93uUbbjtbO+ZF0YzFEtLD8Rbr5RH+mskf\ni7AbN28Oq3f1OM06v4nexmWNCcwcq1V+kOLAkCOMlkSNvyHl7188gxAbmrH7\nGsp/l4UKlgzJZXFVsQeX48apPdFbOgMVXVdTwg9vS4fi7JJwRzRt0Ue9HIFT\n/ts7\r\n=yIIN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyRvzDdUZ7WzIcxBkaLv57VMtrHuzv47C169lVi5e6rAiBuBiZaLH6SibfMnJTI9MW4/SwTEdUXgdoPjODHgOSfYg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-622f633579553712cdae2a5237c331ab02a83717.0_1600701546971_0.1367606881827721"},"_hasShrinkwrap":false},"6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0","gitHead":"0c089addbbd6c451832f3af0fb686ca4f022cc81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CcJEyFr9nm4G+9C0SrqoZgfR+0y8J1HjK+cs7GPbnC1YrBr7rACDOtgATsTyWydiTAehRhdNOikSbJpK5Xj8ZQ==","shasum":"14ad80f6aaf262232d4ead968bc1d32651913045","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0.tgz","fileCount":39,"unpackedSize":209032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMSeCRA9TVsSAnZWagAAXGsP/jY2rA8vDx8f7zCziUP0\nlqdtqmVmc4HpcHA+hsSEAnRx56fcOknG1qqyifgU+E2FAXoUjp+0ZQpUZXaI\nHkv4q/YktQALRfyvdQlvFsyyJIWEeM3/Jc0sFB03sfC9NMoXtJsg/GVk6EnL\nDC+UoTC81PnVji4s+et58u9GXkhnbEwdKOzWG7xogtvNy3Mi6mjilLRP+AZ7\nsliuGmBg3OcLoKViEv6ZuNcygMqRMHf9lShhcPjFCeP2tcUwAHKrTZg7KaT7\nHh2wQ6dk9VjhcR1CgGJ4H+zOI6Z+/d7oQVh1CafJwUetJcz4+Z6qdfZsx6n1\n2TDpegSRW7893JvYPuOAkzMMHJoQZexTXaHkG9TGI6HuuxJyyuJULebMIVx3\nu0d1S5Bf4vjICnwkHhTWYVMvs11RyhpZWIk5vp05m1R5H45d78HKSNCFmBmI\n5Kxf+4y30meJSGo+Yp3gp7Ed6zwLlsGfQGObqS47xvz2MvrtCjfenbYxam28\n1FUuyyonO+W6fRNgvao/W96RNOcWSDXbFWSUdFaQUL7IhgcNA861SK9C1eBs\nop1lhvnDJNq/HuzCpEosRyHGH4/4I0wz6tzSIO0B58UxmmP1HWM0kIddl8fk\nJtHCznpw/S2rmp3xTnq2e8oilq/9WYRg1qDW7oQXNgjftUZIF/RM6KY9jUU0\n1ouW\r\n=wXSp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFqN8UdKLa0X2nXi9KrPfY9sdcbzpMglI+umNpNzR68gIhAMqCy+tOAIaozNhAX4ExwmUe8uDxTi1mSDgpVDYqJGwc"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0_1600701597716_0.615589145941096"},"_hasShrinkwrap":false},"6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.17","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0","gitHead":"cfcebdfbef511169be8e7ab857263a6b9b36f6c8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5Fw7I1zSxdsPDnjWXx3RE+VqZbu3B7Zb5imkmfydiz0VV0AuUbR2W0jisKCCVamLqfuUppl9LI65zDro57qA7w==","shasum":"b2e73aae28d6fa25a861b0968cd206818c0d1403","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0.tgz","fileCount":39,"unpackedSize":209035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaMS2CRA9TVsSAnZWagAArRIP/3Im0rTDW1QFQCfKukTe\nYNDUul67AGHKlZFeroZLz0DYl8Z4sPbrbiVip4hmzXYfCMuK8/RdmesDekCQ\nD4hOXIyND9+rHx1FhS5bMhsJIQUGWQRaOeyziH2z7L5+OQQ6XBFEpaJUI36U\n4LzRSY6SX03PkbqBs0rXOD5F9B/wuM76lYJE4ypWBt5j2T54HDVJ+vKfiBvy\nG1x1nOBbFaT2EsNosWPyCNPqXWpeYif9BO/sZEWEqMMmDJI1WXAKeBSqK4It\nsx1b3XhKaDgcwOqLpeoHxhUbDyVp1vPaASfnpthCowh+Xi+feo7/hibuAqh4\n5a0/G1Z2aB6eTQPBB8xqkJtmzrZZCT1axzlkGf05Ehi43lP9ShLPmr+KmzZa\netsEF48JkxvD2BRXW308cszHx0pkrGWBHY69JfBhTQirjOJ1OWtUQ+SMT55W\nAwGKxWqjVk1rePsVtG5tzu3yqTQqrt6aR/Y6xoYXaqfyTqD/DxE1fSmnIEW/\nMvdElFVzMd+njLB2JqSA++IBCrAL6BbwwMbZXrtW6XbFPB3Z8FuqNh8PQaRl\nkkCNTHCDU9qHNNfy+k07t+BY3GuGFCIp9qgRURBoPZFVVAMOMPEVXORKehX7\nGatSbnzoaW/evcsSDsayflTL+kKnCJ+PnNTpFkrsxQ/UlFkdYw1hbIFEj5Gc\n+w5Z\r\n=QcWS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0zOPhzdlVSEUqQsVAmtdWkVOnCBq8Ec9XeMSyVw1HbAiEAtBBXKM8bmEOKLZvek9PReLL/BI/CRmaTVlcKvcoasys="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0_1600701622316_0.7805218980755007"},"_hasShrinkwrap":false},"6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0","gitHead":"a40eba5bacef2d98ac73c09060ded50460638a8c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yxw2RcgXnPECIpffgxC1CzPkMPAvQAB4eJj68nKeD4WmCVneKThJk0WkHJGhNiGJtKoD2eiHhLytrce8Tuj/yg==","shasum":"59a2e03c39308819d18c5bfd73bc68774dfbb7a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0.tgz","fileCount":39,"unpackedSize":209032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaf/6CRA9TVsSAnZWagAAHlEP/3Fp/28IRPlHNKrLS+BX\n4i72nVOs2h9ETRiyQT5i9BFc/YYGGF2mbNqsbVpkoJ9BCxkx2zXsjtKjhMtD\n02tHVMbAbPHDOfdO7j0jvRdwChHrmfcOLfARTqSFEmKdUC6ik67/+MwQUOKy\nLVO+XXi7jlCRRiTzw5W4ziRUX5x4irRobdMa42zRWIf5G5yUmr/6d8SCF4Ew\nUYJC+Z1I7ZERCX5dt/maq0bbC76OAagXHHL6hZi8GhS1KxzYoypc2rydDg+q\nEb8Ff4UT8aK4xQ+LmkXNmOST8iX3KljiXZ74nGFKEedMtbWQ5Hgk1STZN5+c\nUsbXv0lWe1fquuB0G+wwjwWWWvKUNV6Oudxv0oZX/e3Yg9ISrI2OZ64NBpBF\npRATgRk21jeWUBAHUBeXr7TJE78S7f8E2wIkJH9oPhsbGiDQ6Gi2DVdMNKsR\n2TBkJSX+aBZJdfPMccc3FoDb9EmuLhlX6ds5vV0G2rpFuMG4FliPhHGZe1JO\nAcNvACrwnJpxdmjBS2kNwGBoTkTBCEj+UoDGqoOkIpGMCMhM15Xc27iI1ohf\nYJ+3F9CznHi5dE8123UnUeUsmrUItvL1KKlum1pxtvBfS6Wgdx4uZ2MJvwpK\nCcYedyE9u1zQJiqTCB7FkdqR5OB75dU17+4ifgUIMokJg5F+37B8dp/4cfmE\nnN/o\r\n=PGAl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7fwhoRYoB6JSEeKvjN7eeH+U4QNNBxLMH8uvTO6wslAiEAmM0xf1UQpV/fiqZv7T/uoXmPdVXlYmGLmCZK0cRfVSM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0_1600782329985_0.5657388199809079"},"_hasShrinkwrap":false},"6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lQFS5x5HTnJZaKVRW3IiyuW3NKQnOesQ0o4PUBpEHBMV0pDAZPhQ+zQiNWc4THmnJO/Ov6iqOR0PGj8qf9W+uw==","shasum":"d7188039bebed62052e7d487c8764b35338ecd72","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0.tgz","fileCount":39,"unpackedSize":209032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagBFCRA9TVsSAnZWagAADJIP/1Ku7qd5GsgzHsNLicyj\nSncwi5ZevGGxgCahV+PvK4woGOOAGXVyZUjFrATPsS5uYosorr7uSOZRpm5v\nl+71dKBl376o4m71eTNPeQfg5afmgYnBBtLptsl1cyEhx6dpWVGxTZfiipuL\nId9o8R6g9MuRqt4bPEnopfdO1CIEcjgUxSVj10DJiqwWrZPkyBqR1LhRHdS8\nzdnuPeNCh7qF7hHvNI5wZKg+7xZRzp7DDh8ohzSnLa0Z5/Q7aso2FMl7ek8J\n8DyH9O1pwXJRlhogDBQt+Pj5fpBNjgor0f7DQNA3KlM8ChfUBnmBM6Y6Zo+0\nUOQJqxBm/y1+cJBVNoabPXqu1xgxJwQso7aol1EaNVWajeSwRdcLcs9Q/sOJ\nNH4GPFn6empiQdWKyabNmYLvLg5xW8fNSykaZ8bDv/j3eEdxreuQAmnrnoyr\nbWVSVh/H4G0Z3a/UJMKTLKO1L8zdvddXuw4BfREdIb0sFfDfp8CNFZmjrmcF\npyCgVjr11rUXvzorUDOAr+wO55xAX0aSp79HiUmUnsZ7K4IA+9Hnny/eDPCB\n+BiH/aZJ1re6gcuaL7krqyXUjo4E+YtNaeJmPrqiIvgwc2jbT24IpRPhtfgT\nsx0RQ6Ku+WZNuPnEDbLMmjFEcaiAfBlJ0lpd9adwntclOWtbwmTzgrrDwcWg\nKFi3\r\n=ANPf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEncYzbixC7lmahFZueIpc9r6OgJIhpUfzUWYna7C/xQIgLMTHSILNtTBgukGay8jFb5zpmEfFNJg1pntrTP6f2N0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0_1600782404741_0.24539235072805754"},"_hasShrinkwrap":false},"6.0.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.3","gitHead":"b7f05688af2214bd3b772180a4bf82d9f4cb9ef1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jAeyfPmakPG3wbpX8+/bZM/KFqDsAogeGzmuasnNci0MzplVj0EauEiLWAxeQb4OPi26ZZOXdnTjX5kuGHFBhg==","shasum":"38f4ea0f81c808badf3c5da83c1d9b804a5e2fea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.3.tgz","fileCount":39,"unpackedSize":209271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagBVCRA9TVsSAnZWagAAOD4QAIKgRAcJffkF8o5RD9wT\najQUdRy3+PE7q0xh8eZkFJsMaNfuEfdfwHP+4itl8nQXec71LMYdKXKW78A8\nTy8eZ99b9FSvxcy8r411aIfRSGIJT7m2Sh8ALDmGY+unFYn68PoSCOWISqky\nRpM3tePUKXwIOgMG1p733ocf/iPghj4YPbdJjypqj6B71hG1wv6f85epDuK6\nIugZlmyOa1WaCoeopgERC2jSWI19KnwJx699EacslLyTPDdOsw5rTo0nUm9M\n4ID+pe7m7klnlmwifCCdOgPDbbZIDy1c7MAOE37zSaukU7EQSDvhIIMcBzr4\nGpowFgdGE6UnS2HfdbGJGXG9Yi9iaBjbP/uXRiAJU+El95m0go+/+IlLGQS+\n8LIAO9qMjU2j8z4Igp6s/Fy0nmjTcdzI9Sm5O/L9FVLrGy0JuhxVki8TM8XZ\n+y+wExQRkuR3qtfWJ/0opQhE9h3F9Dv4wl0/wuVqDmdmImWqtaLb/ZDISex3\nK9DM+u8nVsUcB3kWuMA+UAyf+CPH+is07B2YSb30jROvco0RWFg1fnZ41HYn\nGWSerPy7742s4ZxXOLZtoDrKPI/oWW8ELKeltReNlpcdsTM5f+YEuI0jgPO+\naemTCYccCxNp2vcQOAYqjB9pErx9JN9tcavv+fpJWVO3uBZMWHgnHTkT+pXx\n/YmP\r\n=nUQx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCS3X7LbMR7IAng0vSOCPOMLP3RoT5s44BhlovrsSTSUAIgdZcRrlOvm1Xzuerh4jbttFr+92zuRAE5U7Z7HWZCshs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.3_1600782421290_0.7761824447143004"},"_hasShrinkwrap":false},"6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b7f05688af2214bd3b772180a4bf82d9f4cb9ef1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1NBnfmmn3m1jUujDJLHPliyDYP3r4sXgM5hRm45NSgI/zfWkKi2+6H4oY5GOF67Fo6ZgovnGJ3o2l27aiESAjw==","shasum":"831b924741fe4dd644e1168aea7b0a6c7cd3801c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0.tgz","fileCount":39,"unpackedSize":209314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagB7CRA9TVsSAnZWagAA/tQP/RWZ3uZNvuUMlkdMZd6s\nGGnfMXWYCVLHUeadlBatzBRgssJnkgsIxkVoJpvAg3u2BLJfLe82dY877v5S\nz45cqoA1yPnviMA6fEnq6PmbAYO1Jok+GTlsg1FvTvZUsa3nsSN0QZXW7Fou\n2bozsIjw7fqVyAnrvdk0ELm0s6hGpGL44gv2zM52ThwM0/w2EOl0tXlCd9h0\np6OSCuqhki5kmUqwtm+cDriCL2O2yfrTx3xMtv5vjBg3fyfoZZjE49+KH8jO\ns64tQ3IssUhauXEAWc7wakbx0VqJSHJHe5U81PCpa6LCzVoNZR67wBlmoX1s\nF11DF4MztGEFv8HfGvir84V+fkoSziqkgVwk90qpZWXZc7bzQnJtah2rkKbG\nNsu9Upmq8ORn4fCafjQyw4sUHrqiOarxosUzhiIqwABfaqviujBT253rHAxp\neC71TsgsSHWT57HJGa3MGMUpmCsYgA8v7/etmSbPYbyu/CeLEdJRLpy/GvSP\n+mzy4ssDPrvP/2YKPSCAKCQHgTxH4TmLlgOEL7vVa3kl6ZagCs4AkLX0C/gE\nLVJ2rEoilQzK6Lz1bodXY+I6Y32HYsPsXhyxoUu2frN2Yf6eXX4VvkOWOjep\nCk7hlhMN7x8a9jE41OPZCddldIa0j3X4ZWHTsIQenbFP+1EN3iMFVMAZ5esm\nYsiA\r\n=xIUL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9G+d+FIYsAjin5Cz6wGB14ww9d0SWd53T8HBRR7fzLQIgNduXLm1V0sJZM+3jp/I+3/tmkO1RJoLUaQBLli+FIPc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0_1600782458964_0.30641851323501035"},"_hasShrinkwrap":false},"6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0","gitHead":"2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4E6Kbd3wLpRqdymG0O+IWn14Bbbr65WUGP20/YzWneHe9AZuFMldLqIJrgansLZgGiC8ARFIke86xWICwfNHug==","shasum":"a1fcc85177701afc4b92934ef472415222ceaa4c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0.tgz","fileCount":39,"unpackedSize":209314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagCbCRA9TVsSAnZWagAA46EQAJ3iEMjpYQY//FL/+YT4\nlFdtQAZYYwYCAvud2WwqWZplRfbg7gllWzw7b8cCKi1qUAJ0A5ZUeT1wOX3j\naUaRAoFObbXCImpq/AXGY3AA2jyxg18T82vPuFcHdSsaifWNATUvix3MptTE\nx3mzugR3yheJIIzbiY8lrE3Hea17JcmSMYaemWf0tNy8ayPSrCBO3nDO+NWn\n7ZBAAyGaDszafRQm1o07sI8YuM0dGJD3nmzffLM4U/LZQwLKxVcRZuM5ict5\n8upokDikev+QajrrI38fjColkgiaco0olTUUAFTpflLHeuhzz4EcoFSi1YqF\nvt6ChSeNM/6x3pX1fq8/gJyTHcPJ4FIVHSbmNy6VK4aaRpxw1azkW/7ATpjz\n0QaOZlifEFs6hq/e5JmTyg2cgU9gODb6lL3cwHymrD5aTvyhXxK8kF/pZokh\nioEQokQcCYELdxE+6Lix0S+A/Yop1fSEbSUDOfj5fLs6jTjse3GAZ/uVBviG\nTzP8lh3wr08u2UgqyNmVIFfqXM93ru4OXitG2agm84KWrygXJTV/r+CstXTb\noYZ2feK4rkeH/U8nrnYsIZsbKs9xo5MzbwQ05c0n/LZTbBIx3ervWW9xIAwo\nG1J+LFYe5WkMlVvwNUW4uqDKOTHhAl0WPpErAFSNbbnjETwc6IF491lhBW2M\nPHLg\r\n=EJ7Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDIR/Kws+pTpNld/c5NRH/qj1Tbo6frct8Kmn7467uygIgFgD3S3Zm5wOWfN6aja5I+0NOXnOeBUkPqXDZ+kghC70="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0_1600782490555_0.5721862010657075"},"_hasShrinkwrap":false},"6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0","gitHead":"a749efcd018df691b481d9ea9246c6fb0262520b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IlcOY2fmrOmcxPOJDFMcMgP1MWhzosT3PZp30SthS3D1R/lY7tGQGIU5+nmf0CzyfNLjNTzbWszQfqTRdnaMow==","shasum":"026050e0b4e37d6c33a5a5ec16081be06718ec8b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0.tgz","fileCount":39,"unpackedSize":209317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagDICRA9TVsSAnZWagAAA5cP/08xL5NK1wTcA62FghLi\newEOMxMnuRqLO5M7LnfmdnKtdvrBiOo+o8wWAvk01fa5tNwDDss36Oi+BCWm\n4FEA8XKKaH3+lq0pn48/Y1nX3VAdkKcKSekvdlYmzWO68vjnZ/904xaWMeX/\n28FgXMrf98P3tzwhnAw6o4J5AzV9V0hYBOISor9jb1TzqvzRVuvMDl4Z5FlC\nHzZMoj/n8nS+3kxVBANRCuwpl5QIdu8L8jZsBOaI3nbSyQRn+hn5+DZ9ELDn\nPkYT33VOD2avLaltTYhaI+oJmaagrTSk4xkTkeBB+/hbJLUjivWefuxC18MH\nQn3B0GQQ3CI7x+s66mEGx+dE+2MJIP9yH4AArwvY2VNROiuMKMJs9W2Il17C\nl57gtOvMu31TQdiC2zI8Sg34pFdSP81VYgo04CnA5Evk07L5e+B5I1idCx3P\nGdjLseEoN3mqpk6WeaoapxC4e72rrQFr4KxbueUISaHWuD2tdCQy3yZRgqhB\nUS8erL1q93/+vyIdedyxD9BuH/tXm7otQIISTZ+bWJ+F8VENmoRddUYRw5xB\naGDDX1xcYB1ePiEdGu7camJr2wElPNeq7DTq8q94GQrIfcoX4YE3pSa3YF+s\nBef64A/vG5H4RRX1il2DzkP2s58vfMNXWC3dHLlzSQ9XiUklXI0aHSOz/K5U\nuiP2\r\n=SIVc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDroohJMtbHHCIiDlWCZ6v+bUevFSzcrgJW4jDF/MXBmwIgZgSjrVHxKpq+J8khXyLv9dYD7+bj+8+5kS7QtBL50Hg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0_1600782535567_0.29503243697800485"},"_hasShrinkwrap":false},"6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.1","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0","gitHead":"df7166b85537d7b5aaaa4cee9078fbe30a42fde7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-W3tuIwLrlBSMUgiyh9r2hpwudHYgdnhdcV+KB6lw2f9VyPs+NyX6jPf+muChVM/ir8RSSwDtkYYuMM5z/lO0bw==","shasum":"1fcaceccd76f828a4996eefbfa23dfb2d0d5797c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0.tgz","fileCount":39,"unpackedSize":209314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfagDYCRA9TVsSAnZWagAAgdEP/j5zkBnvKH0RCGQWurQq\nzELwr8CFTsxMh09YZ+ixYXBBgWeNQMd+eTYp0kPXHlhevyanY7cmA4KAhqIU\nipPeLvZ+zSogkrAIpTLKf9mXGyE9Tc3bHXLICvk1bL+uszUwGheQaJBCE3kD\nyahni5tnbFfWrt33zc6HccfcGTofzh4h7sBHUAZjgOEeu9yqTpfyBKquy6XY\nfSafeu88t+x2oth7XHcUuRfNv/myQ16IoKl5Hfgqqza8OCBALLwT1miDD1Ea\nt9NTqx2ysLmrX5UQnrHBYc7nFD3lWfU3plxCxXs2kE5FQm07R1Kf/1uX/Bmp\ngVP3QRj5fp9F9PaJMHX+MQEOMCcU3f7N4RG4EZGPHd93MFMNTFdqf9aP0Nd/\nINRZ9OQF6sl5ePHUY2f/MKd2jzVd10Q6r4y3Vowf7zp+4S+7jrQjoqtzPncv\nzVxLBKcFxb1qFKiMPYmQ5dGTkPf6+p5vi6PEfCCriD8ynciaUhxDDcZwzW28\n+7/7DBug2vHNQ/j/wDfTKQlXgArijUINbhL1uhVHhjoYmizPYQYZYeh9VUbg\nSaLOfmcCGCbhGQZ1z8mjSKH9a40ou0OC3687GJKgjgHntqt+1SL3i8UNdQIn\nGNQuQ4iLPjn5hodkAvpx2YzMIakCl9QX/TQCEgjlJkfF10Cfd9dfkEmup47F\n0+Ou\r\n=QQDA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOKv5vkUZCQmfdhzOqhl/vhGnXAxy6uaSJV5rO7isYMAIhAMwG2vjCpy7egl9CJP+nhn+ynqqAy/m1o/fuDnTTscfi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0_1600782551777_0.8448046477661266"},"_hasShrinkwrap":false},"6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"37af33eae65dc9c4f15ac62f8950233420aa71c4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0jh1njut8xySgYiYvN/41qXhQwmPkcOiaR7ReKYNsGD8gzppfz6aRcwTYlukCCobm0sjnFu0XqsXbQMFeCwHyA==","shasum":"eff9c24ced36b09e7ae02f48e47fcd0b452f9406","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0.tgz","fileCount":39,"unpackedSize":209314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarj7CRA9TVsSAnZWagAAJAcQAJmESo6RhPn40FglJbY4\nU7CWp1Qq/x67coK8rioXp4v1dtLcH0sqymLO7mBuZR0vS5XexzL3jHvLDzEX\nyK7uzvaMqJ33XeLWuAZtPRExkhd8LfA0+dqsJGQCAQYb/m2BHTgQ4eGJVN9D\n920rk5BSyfyPjAaEMHFnBB1fekOfv3OyBeDgVvs/txN+sIMHun9Wh2GXZiiy\n+wrehoZRwBwnUo3WLNbsgdvh7BTajKYV+pr7v3M/oN22g+xDpayb+Ru1hLxZ\nFl8RfrNLmvR3Zfzw0PqgOj+dXkBFuI9ovLyMY00P0grMTctYYa1YnNp7qYV4\neB7WSNY9RY7TmsPJGk3lgs4SV0+Nyw25+j7V4IJ93TkucI2veW1abG3V6Gi5\nH8AAhjhB1PCHBU3/qRp265g0zN7ivrYLSaPKd9ejK8lqX8bJAhymogl3hF2p\nytxcRp26JPuRcQqZOMl7LDgZwBHWnGxKSe5ud0GCqjC3YWZlQ+JGl9VKkmcr\nKetwiGBfjEeq5eMI6OGDShbTdk/lFG7HP7SaveJ2ztmcNYgsXxbqa6ExIBFc\nDEPtaV/DaGHdlrRz0xUBrYoPRD1BEgPKO43n45v63gz+dpqfvX9TscZaaT3l\nGAiBW8/Y3t0S4HDLhtA0XkiWGeYC/iT7MCnp8WBD/7Ezx9ovb3Mbpg1VeY7Y\n+Wmw\r\n=WKNf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/XGGNfwVHVVrUKjylh9bNJoWmH4mtgxBwJNrqbQejPQIhAMk8KJbN0JrOhd7EMTmbZ/omphF3H4sy+yIgm1AKuqKL"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0_1600829690467_0.8154611401535226"},"_hasShrinkwrap":false},"6.0.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4","gitHead":"8d5ded70825075a55226d7927f9c6dbff8db62ae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lzcjfM44nZz84wNJZUUmokJjpSkyY0Mtsy1h18RXdVnWT7q2Q9LBsGq7R8Y+uyxrdNUbeOmIQ7Z0iYoZhjWAtQ==","shasum":"5b572fbdd6b74659bb163e7ddf928bb0ba0a6a2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4.tgz","fileCount":39,"unpackedSize":209552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarkMCRA9TVsSAnZWagAAx38QAJStBTUQ7OCJPM0WzBBI\nfHsSB/8RIdyX8hza1QG7qU0EAJt0TVq0SqQGR0FYbvgsbW8SWI/455F+wV9n\nZ8Le/Zxgj4TPvR85yAoLd5I9Pag1SgJaCCyBLv3fm3txGNNdtVYC+gJxY4Vn\ngSfPgjJ1lX2WwPWfO2+/6WjJDKSv7Rl9MciiS0Nsdun1kyIrxkDm/I/IqOHN\nCo15k66lkNL94IKDoCfOxqzCpPULlMUtOmnAumaZER5q0Qm/jhgUFkf047NA\nXDx3DLfZsRl4X4VdtkPAD86bzuA1/gPyQwnXuIrn70/t5BAIFyWGlvMiafGu\nY4WX4zhncT96kjk0dSHdhzMaPC/KmfoGy13+tfm/UJWY4yiAcWKqj2Y+53d+\noLE+frpo9myPHesgEYFpehHI2858HeyEDFJSzTidOixyL+NOZSyiM0IQ6/yK\n7BTAQcuG/mpJ+NVM9onih7PxDf0RmfWDOJ7rbpoD/SzCVBhlkYalYdv1s9Mi\nCSSFAYz6z8NInGAPQV9GfKVV6CHdzXmLu8Wo2mb1hFgeExuaoT/YuqO+KNN5\nkE3qiksohR0AtvLecUvMUMqi84jcL/2BcK7bnTi1pPOgR2HhlvDW+3LuY0O3\no4yfxPM1yjw1RLpjx1QxoH6sL5uIJNnG4GoEY9HzH5maGy5K5iExeRSL63mh\n/Om7\r\n=5/s5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTUIVCbW7cXdTnzyJGsjPpcoF6Dy8h5UTh36WmbHZ8oQIgVxA95+PwOYPzsmW7gIt5Iv7XCJerRTyjdLjgzXVLLwY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4_1600829708027_0.8116331810846971"},"_hasShrinkwrap":false},"6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8d5ded70825075a55226d7927f9c6dbff8db62ae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dfLJhFFjYm6fQBO6fBeGdZKJmkdKoWc+RSlUVems8v3rJ/brW9XMif3EgJ8Y5gApw4Zw5IYyubg8X/yF/ZRRgw==","shasum":"3b857b47ac5adbed6bd463b8eb0bfd2352c77ecf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0.tgz","fileCount":39,"unpackedSize":209595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarkuCRA9TVsSAnZWagAAdMwP/A3g3uoq35R+aZKyok5T\nCOctCNmlx6eK7h2XFJbvQzuL6uUYozKmFL547CUZJl8aFrKYX2oLS8yxwuzE\n6H1C2NubTbtz3FT0xJ3ne9flJRIzb9KQt28lPMtA630U2pfooEFkgsg6e5pY\n1uqZTB3GKEOwt6nWyIjOSXqmggG2tkdeK6urWSCECwLPM39JdXHGRR/azUah\nIXa1lZWf49nGKS7Mo+IBT4B79ZpfgYXOh8qpB0ehyDFvndT5VZmEPBsoKIHu\nEWKNvwl6DRBWMnj81aXwO+1ir98QM/F1jQLe+d8+SBXhhsCBIHOUBx3TdQvE\nsJGNwdKKmI2Nz5DJ2wuVePXNwJUdNakx2AuPvT0cHP1vxRU5+NxiLf/o+gGw\neCJVu4NnJUyQbBKgIG52WonN33AaVci1HbizQ7DNv7ZjBf3mU/6oUcv6ro46\n7ZE58nBq5M6FtqAwWEBiKwXisBco4JlZ81tWdkQlfobYdHj2hRI5E4Lla1s8\n4lwCvbBa6HBczA8dmblSTAzGcMRt1lh0e1CnmnUUK/ZRiVUSgo5KJznWrCaX\nU47KuLkRSEq8zULY0MR77It9V0ccb3YnX7cYsEhXlJW7RVZcIRU1QFV8LdPj\ndrPNhYlt5IgJuau3MrpGq4C9N1cvCqg00BhL/95r6SrnVTch4xpTJUvQc+cs\n2UBS\r\n=clsF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5KpbecSBM/67NUfqvARq2vudu41vrJQ+x7+MmfuWQAAiEA4D9H9vwPeUApQzG7M/4WihOA8axIeRh2k+R42rDhO3I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0_1600829741705_0.23452133865910807"},"_hasShrinkwrap":false},"6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0","gitHead":"8dc3d09059279cb402a07e87bd77cd938c3d570c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RNFFItUsMqcxk/C/MI515mAKPxPz6lCeFwclxZk6GgEQiCJL7nlS/FhOszTgxkHflmMvYK+z32Y6lXTDH0jZrw==","shasum":"9770ee78f97a89d3de8049fda555af87f013c15d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0.tgz","fileCount":39,"unpackedSize":209595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfark7CRA9TVsSAnZWagAAc/cQAJtnlHz2km/fzhcOR3WM\nQpWo/EzR5N+V4LdNK8BATnN1AFZN+pGNFBIhFFdGqSJw6db2nME/AeTi1Yfm\n4COmDHyS18w/18fwdVRrV4DTfB9BOYhoWp24MoNeRyhuQACOxqgdBp6IXWFn\nooJprW6vgF31d740+V2Av2BzVduFRGWO0lOqjT6kfM7goS0qeA5ufOfdza4M\nI796WtzVjdRZm8uzNJCBufnSiFw92Fe0zIyqCXWpYIllNbzLQWJCLG8ny3pn\nKXDECa4BjPzXbNeHuF47HUL91EtoXmHBoKEmv+PywQ7072bD9FURGwWSEiM2\n8+ITHNQgXRQcl5cNuDzWEPBBrE60PEVgAoEs/SEs5xEUga+MeG/AxM2PomtX\n1mqK2jUSDwBsSP3gSmwku8uQWy0gZ4uFvBrNQuirKfpy9DhKKLcs+xYpL0Qs\nr4Fir0Q+IQzg6o6H3gXMkLpFmcIofTnNgBhP3XhxbnrJWRTIgr1vvTCMMt1+\nUMU/Hjv+bPOoR6hQ+/LevEUP5xomGgRDzLt0Tc0PzGjhbyT9eQNvag7RS+Cb\nU1iyI/hf3sClkuwAOEsgzqprabBwdpirswtZICO5CBzQc6u+SGUzXC7RXbEg\nXgO48bE7cDuGWSXvIU6p8s66F7kfcdv8/Bxp5lz9UP1MupH31ylJIgprxdGe\nvUQ3\r\n=85uS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/F+QgSTyuYJpred5WF/k/olNzrmva6V8CPh2TFGDjfAiBGVY0VfMIIdsll1KogQhi8ZKuc4oyLQmRzONciPHtEmw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0_1600829755156_0.38388542274376114"},"_hasShrinkwrap":false},"6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0","gitHead":"4bd78648500ff1b6fe1cb4e910879b299feec2f8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BCGAeWO9hg0xYfsfcEL/T962M0f1OseRml+zgvDbs3PiAYnYxGqXmJ2M1C19sQj2c90rz17SnG+ClwJ6Ga7iAg==","shasum":"869fa2aa98cb14409413a3c2c4d75df68447aeae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0.tgz","fileCount":39,"unpackedSize":209314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarlTCRA9TVsSAnZWagAAcNgQAIUJy56tMeAlrJuZbv5K\nI0KfqRqGofjo0GnbRIJlHgAfQtF3u57ehAVZFEBoan7zgfnOJV+g1hx5lJec\nUnCDLDZF+bSrmrxc8DdUsSogv00TIiaiPqWHqLJ/enWPCgvxj02c+sDFQiyo\nYPS2YWlDm8dIv605L+i7+bTSVpn9MQiniJ9pDlX70u6nMIQfW5/Rxs0eUFeP\nXs2eR/P7TCo+6ymCSHBNoVinmVRT2OJ1IYa/bt4lhgoFhgWgqZVpJ+OH4UNJ\n4p2psqq4xVp4LqYDglvTbyDcz9BRPoXhJ40Kk7yJX78AGGLgCadih02T3hdQ\nXHZCDQyQ/xDYzaEu6xOoLSVLYYEaLWSazSuKm1dEIACX4bxzO3MODUokazoU\nqGscIKvp+RdtNVflSCm9vF11kTF3s3zy9K0PxtqXrZlZmqpGSbucyc//PPid\n1Hzz9LFQ8kGd4Eypdds8hjWrhaau2xn+WORc3D4oyL4KcCLKYi9t8ZNK9Do3\nfi6zdOAyPtbSstthmgu70FV9TsPYVOaHqeEgIrbtuADNfecqzXVLRLofcLfP\nq2R0Y6oMcmta9QcAFlPm0GNkIfmz3HJZ3unPgdNlp33x2c9eG8WT2b9pTshD\nk0HS6Hlqu4xdC5pWq+Ggt14rEBq1svUERMnq7zB6FYd4tZfdB74vaU3bh0zT\neOv/\r\n=rNxt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGinSyCmdj8oyBXIy0o2vH/mOWByHSYFc/RiSK0Uw/+iAiEAnsLK7Esb5TigyHgUN1H7IWh6r7DUz8tLGk7McMYVsFQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0_1600829779270_0.5608983980854421"},"_hasShrinkwrap":false},"6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0","gitHead":"bf13f3a2cbad5f6a028384ddcf776ea171cb213a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-554FixL45yWx7p7RrDe+NDLcXYpQRB1ujQsZjBM+wCSfgw6ek+uQmDOx6IWGGX38ADdu0eaaQWlftHGniX81qA==","shasum":"1f5afe70f0872cc876ab2b7dcd69883c6de9233b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0.tgz","fileCount":39,"unpackedSize":209595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarldCRA9TVsSAnZWagAAa/wQAIysT0SKgxCHnmth5FFO\nfL4CmSbtZvMJLPI7pJFBsFfdiBOpfMsRBUF9Q+Meur8NfnBl3d+zVQSndqa6\nAsQwaygsxLocco3zrB1DUUUEJOvIvP5vgqIc4AZaVPT2OO73fwvAmwjc232q\nLgjbWukYdltBtIIe77zCwQ+3yeBL1nkrwEuODcEuTVfvPNxDh0Gyq26LSkjW\n4eXy8tIUteKgE+IMGlx1CYQQ4+mW3zE2SmT7WXrnN+MWdwjYihayv7KuD/6B\nxnP9NVYqhaRusVqD0yTNOkOUfvK4fIAh3WnjTgXFSkHKV4h5W+5t0azFd9Ve\nWzZvFQwj2keJq8GhoW0Ua8rF8q5pxCZt7NXvVCKFS4eIMYMFVhV572VeIrKB\ngb5Ia4aFoUNusYzaxKO3G2ED09aGrdx+vuqzwQbfgVteSJzNJXN3t+zKRqos\n0dZkTA9KzdmV3yIYaatq9OkaU+wS9ohGV5CMQaAf8ESsJK1nN7hWr++LkrXH\njvDYj/YItxKm3cWlEwHc/PYpekIW8v0wG4plOiJLXZ0ylNpyKghU9Px0593A\nkWAFFhWHAW7982p/ob+dwCUPppaZ9XRPaVzrWah7X2agFFuSyuYqtq179FuP\n8dI6oVYXTkxbBeOX6bIuJhVXGa8uAVAn5aNdGUpIL8mggAyGgjZd7gK6sT4M\nVig7\r\n=hcli\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEySp0oX0Epy9tk0Nxrc0aoeMfxDvIgm8p0rO8sxwoapAiEA0Unz417AoqalacErIPF/Oj/b2Bf2OmUIZMROGdsM7rA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0_1600829789088_0.18170564767774255"},"_hasShrinkwrap":false},"6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.18","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0","gitHead":"41ee58dcce8b430b0cbc5ff91b446616b68c9dae","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OLSHfShzMCYPqpPprbkz9yPZBdd0jdJmgT0b/5x/Ff4HdRVaO6s3ovi09+/3v7ncqf8TEZ4rhXkA9/9iVsV0yg==","shasum":"460fb1ddc4b48728ee1a2e92fe3a353addb2d877","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0.tgz","fileCount":39,"unpackedSize":209598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfarmACRA9TVsSAnZWagAA67kP/AlPjBJMsWEVx/W/7dBT\ntE7H2x7HNjQIqgv9D5GZbaQrOc47Jq5MTvdEh6vdBaoR6LQoJ/dPoM1gLZQQ\nq4K8ydBSh8lXNWw7Yvjy4fP/uFVyovJPrZCewS0t1FS7VzUt6looKyfQwMit\n5bSuV1LSo7PkoTa8YrzCCBzV1oiiaR7ByMGjM0yUdkuyrncUUGNq37PP2qAM\nj6VuikM/8gw1/o3PydM2KUvaskW8mI3lRcCRfFLWiYZkBdQOPCPZ9iPI7cDn\nDS0DPExu0rBrB4Nqspwg+76PQnBZQFLB+Vn+bJSO3LokdSx3ZGRjCSDiSDgs\ngCFNxfNIjjL23zy+rXySZZ2CCsRCjtOOiix5tCfo4L9/RFVb9lACvTazUnGh\nGSK3rx5PGaVE7oT+FGryaXyPWwOM/m25ljeGRUNpu0tXqo/d7P6WTQRu+qvi\nLVSGgWBV03LCsQkDrcwcdCj2666HWiDpX+RNy3VQiOQjwArHrkixiJ8sSYEi\n7UAK825z1ZSBPwLUTDYFxv+NWSg01oks49j2sYrxlq80QturPs3NO+EoX+9G\ncJ/gcGOqdCenTFC/0EEJDGqdQTuY5pdVegQZusULOfWn0zt5Ieyb6jKZ57gw\nZUBv2G7B+0SVvo3wqpJC0Lx1l9Q1RNJcHoHNgc224kuCUzI1nZuse/033xfR\nwD0Z\r\n=PY/e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbooLrbNJoCs+zWZfbJeNkNxy+EIKdPo4+2ALkwc6o5QIgG8PvWWTdMB0Nxv/pn6PofGvadgexvzwueh1XWL8WPTI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0_1600829823639_0.2769878044706495"},"_hasShrinkwrap":false},"6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0","gitHead":"338adf6ed288ae988df8360052c2607898a5e28e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sgyeFVkDradW+XKIcEF03uUvhLt68wVgSV8nCC0mqOfW3dLtfRdD5ofbGQfurP9XVzV1N8wVA6/LW49pErhEkw==","shasum":"31bc99a4f1dc2f57457978116800cd5d0e9edf45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0.tgz","fileCount":39,"unpackedSize":209595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf0KCRA9TVsSAnZWagAAhKQP+gKfsoS82vHhkaL4gOlZ\nvsXyw20JaDWGsk3WtXWgLNIMfSf+7qNg39qXIZn1oPP3/gzEc2+BfFR7GA+1\nL7VyKg6u4msLfdeEWbyKoUu8POCttnyNGn2ftHOSvv24psSewiBACmGZoypw\nEI5QCbOux3oAyVs6qRc4TfpxGgdGfE3aUqn38wWgXNZWTuv6Rt6Cvj6e8ja0\nRmwfDzGQOO+v/uv4ZPLuxYSRKpy9kJnL4zaM0tDyIgjgvvNumXgSGYuPyk8t\nVXVYvdBx+ILc5EqS+oLfoFsYNtGb01hm3MoyTuWGrhLLOPQzp32U5YFuJrRU\n8unrwo/SavWvmwy6nGnbWwtgRQE2XGavo0IVbvSUnuXT/hY0hNdf78GliuN3\nfF63mJyYKdYXbYKn0rsSBJutJRZLQckhtuhTMOouu2CGD4MTytSzuQaHC2xz\nEzLegm04Bcb0D3/7kn2rbWptf7ItfIY/jSAV2cTNNL7nPYxWDo3UzIJeYFaX\nkAj3EEOPL2O/M8WqKDBt5AvFGlH4ZoPVjuy4oiICTRF2rYXqUizDWQaUrbVs\nW8pX+HxeOvKD5ltix4mEXBjmzTSdK3GgXaLGo6K00gOFo7KsRDlKU8F0cqLT\nnYMwg83WhXV1AZ4/ubrzu/wuh0i4OVPiDhjIgXXOp3PGbo7GsAbFYsV0DNng\nWifs\r\n=C8Qs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0iV9EDxOjYVXcnoBLRHbZlRG+3kSb/i/XcjXj10j9OAIgW7eu13/X3gHmspwRQ+517OkNoFEnDicqfPPTyd/wv7w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0_1601043722145_0.2710976984139579"},"_hasShrinkwrap":false},"6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"141e3bf5b6d543b546e718311c9ecd91f98dbba7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rKADcQkbhtkCK7Geo7VVXChDnB8wZx7oGyJxYKpLSK/weSDvynMV+vOnPfps77XMuffRFfMZlxM7ae7qH3BHUA==","shasum":"cc6c7d6cc47b3066fccfa80b936d37a081c68c8f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0.tgz","fileCount":39,"unpackedSize":209595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf1qCRA9TVsSAnZWagAA2msP/iTMUWnQlBG09vZgj6fL\nyI8wW/sxFlWqSWdAYcQbPr12wuerTmhj+79ijifF7Cqbv4mC/X+8zzhAf1fb\n1XibM5MJBvc32MwP2+BLW/ZUow5F/Kq3bt/7u7z0Q1iF38NzS0wFp9uoXcsc\nhRu+wWM4DqsI7cTr8TrKgaJiO5kxH4XHRg+GG+8FsirUZlStRTF0CAc1uVS2\nrG3pSS67hOqlvtqbOmhuY/U0/UUW3wU8tlD5PJjXicJr1sXNFYk77EhBRa0Z\nChF4sH90a2nsQcKeyUH1W4b0BvL+oWEhQQACvHFSVoPTyMu+0mCu5bFIPQKF\nxp8LNPW+QD6R+p2jHoqrT69RvhwE5cLxwWeRAYd66wGmpmx0XgTDPn1g8ZMe\n6f/Mfz0zVqTa88cHic1GYEMrCXShTkv3F9Vp8LeKVo4t+V433rJawkP43J9c\nnvVxp0SIvRMcxTaOkEsVN/RTUwVKDajn+41AVzLilDKwE/UDk2Sm+t2JPGVS\nEsDT8lrDBga81AZ0d38yjz7KBlpkI0wyhLwtKeAF5gA/1uFnG+gUFkI9B6YA\nuWVsVPSTr/bFOaQAVt04C0YquRuJhLtEBjeejDxvoAXZ80tRBQdVAEB+RKhN\nlJOtPe0R2raREMdQvfjk2lE8ygxl96Gk8VI9xz0h8Uc4GBiwyHR/+hruDBdO\nknyF\r\n=Hs0w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcQH5LxnmniLm8d4/Pnv60qKUWIsOK0LzkmYto7Y8zewIgWZGLhpG7Ca2U/U2/4452xaLpLGnG03H/fOQKo37apDo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0_1601043817978_0.5708940758978609"},"_hasShrinkwrap":false},"6.0.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.5","gitHead":"064d7b7bd7cf61082d89cc7a4d5369bf688ca91a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.5","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6JfDr6aEb/WjXziNps1wOHVnKpjfmfoh/pvue2hUO8PmtL+xpwa1lpzDvnwx8hneYx433EM/570QIMm9B+3TRQ==","shasum":"1d106b94f198a63c989708ae3f2bf47866ce7a93","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.5.tgz","fileCount":39,"unpackedSize":209834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf14CRA9TVsSAnZWagAAE3QP/0cfn7I2s9yPEmAhlR/z\nS/1389jSerUZBZcO2RUX/5VwoU3S2w43zDKQlEda7x1+OfEBhXlP6U0a7TS5\n03RC6QCAFsvIG4IRj1C4TMsDBUTz7nxVFF08x0O5eI+cY4RUOKRwrrtdVWYo\nFgBn+ZgMQW576Iy32cROnsVVRedMm7uAOIWx4nNAgBRZWghFkSsSCD+hfPLL\nVBL+/CRVuXu66StcTkUpE1jm5+s/9u0IblxCTrvgcNpxu0eMd9SN3BCju9fU\nyb2PiQZnHW2/Is29e9BYWvIUVPyx6rHmUcj4D55E1xzeSmfy9STS1DXwpo+0\nNWeGHwLnHmvp0xy526u06qEO30knPGKsFD7dGABT7HU3WFgSG5mxXccWfYih\nz0SK7ViUBrFpnkEcotLXSQdtqD2LnCwMR9+ad19cENXPajy6LnWbMCbnVzDX\n2Tm8ZWfz8zmo0D6xw0RIyb8X3YavRp5RU+oPhuYDxThy8PDAhJgGE3yZOW1b\nP5XdYnAHR1tgVhMbUDEdAdZhJfyZfh1rJecVtrmYHX1EJNwCmUqozjk6mHaB\nGsYGL7vy14e2kjMjkXuBzSLlpCPJyl9eYs1dcQSdbUfT5+OueQe+y2Lb+vvj\nVO2VYjHNqzGHyIu5ocWKMeQyZfy43JEwEiwmqlTpAmpYTPaHjauXYTk4DEo3\n0Sp1\r\n=ZGx4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzQmSnT2AbrEjpSKdOfyqFb3uX1sksAYJOAOHMw7dMSAIhAJW90GyeX3XexhhDIdJGqcwBYJdLbd0sHVs1S/NyN4Xp"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.5_1601043831742_0.8250525662543302"},"_hasShrinkwrap":false},"6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"064d7b7bd7cf61082d89cc7a4d5369bf688ca91a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7gw33c8PSsBvvYli1HkmePX4VFlUVK/EdGmVJqZ5rJlBQ6p4kbSsGhGc1MAbPWNw20sKjA+mQxPR+V8yEhMWSA==","shasum":"d8d076333a63a335cf34c72902ef11d7c056a35c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0.tgz","fileCount":39,"unpackedSize":209877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf2cCRA9TVsSAnZWagAADcQQAJf9ldDAvt0sSbiQMh6K\nf9bF3W+JOl7qTUQyh1pdn4vq8k1ynQUrtA9sofRPDQr+lEad/jeUaAcItWBf\n1VFAnBZ3C/N0PZGS4JY/RDlNN4Xl9bpqiTcoOR3brjmq46uyqizSnK4v/dPj\nkw3HkFA9ZVHiE4i5bR3LBFi55Pu9Kc8PVhnJ36a8NQ3TTqNZBhpc+IxZDwRD\nVf3FbKoU8NgDyLcfgo4KFZzAKAyqOFyzjuy/Zr5O1Yr2YZA5mN1A4GdzKHRm\nS0w3ADBKlAS4WOezaYf1yvQHvuL9u9jzEFQbH2MXj6Ef06jm3G6ISIj+00e1\njGr8yHX/xqghy3YpWJo6OLBtr6IXuJ/4qqh2k5LDq/uRSMi02EoYCQryO0kp\nR3O8FW77zwbo/Rc6cSaSEQ4CrdWHYKmjr15YByPt5VNrOhJ9oMVkELXhWqWz\n98FKkQ+Yyj9B5M7MzgiSgsJ5LpHyeYZ72NNDefSF9uaVqFWfKSHALoSjpU3l\nRH6Nz8STy61D/cbcXpfp2aaQGWTE4Q2b8d2XkjwBK42BofCpCOtQUgKsJfZ/\nf0NmB5aJr6fROKTDdvSe36SSaPFiM9ndUlWcuhR1hLbH4iqxWk6zTfftYyi1\nxmf1voa70i0AKyP5y+qT1WzzoMR+zhQmZsxIckjL9u1UA04EokM31mgxL3kS\nO7u5\r\n=UgcT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWPRKVjfitZIVhAbcO1ZWtxMkCvyj/3BxaAs+fE1+TzAiAflgEWezRNyT15v48q2XO0cF/VS2ANE3W2p9+nEte2QQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0_1601043867469_0.07337115320357257"},"_hasShrinkwrap":false},"6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0","gitHead":"6f111248060f9cc83405be108d91c4de5deeef6f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CiVXz+cZ4QzwGZHMS3vukvOXDVVlQp6qOVcB3b1W2vmXSniVkNGxkljd5Gnp7fxgnKAxUJ9WZONbYA6Epp4XhQ==","shasum":"e0bf22f15a711543fb43ac0b9618e1cca7de8e0a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0.tgz","fileCount":39,"unpackedSize":209877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf2oCRA9TVsSAnZWagAACUsQAIy1mPa4a4eNJJV+Gc7s\n+tIMcbOw89hh7eEjQ/h/nf9CDpYPbYg4FcNMGAmOfjEsmESiSQoZIpoZMLxC\nQLfHAsbYg7Faj9OSV7y7zqVimN7266a5mVuTyscfjeRl5Dl4KCYAXvOB81fP\nTamvA8yzSEKgq5SISX7h1XlVZbHjia00ZjF/9pujm61+UomFwVAzni3H7DB+\n1KnCKZxswQ1+XVSsMr2V1Aq+ENicNd4XATdExmSEbEjBpfHhnnMvLJqRSj84\nNTnhFNl2rh0P4qPE6Q2tvYgNGtGjvnMpyCiTyMmVkpyvBxB6oW+cPW8w2KqY\n52LGiI8OmIPeiSBJ63YgNLtjvCPSk8YD0K1Ss2tv7uYEls+2zMTH/8rvAl9M\nneOLA9mu2wvKn/V2077y1JnaDFckI8J4bCCqZ9pEtymRjYc4rE9ALc0kZBw6\n+jL19ppvY9BWPVEt1bhZQHye5wNhGZp7RekWPaGxVYXWwwaAhzXY/AVh9cdy\nb2FL0pvnVeEm6WVOXFhaTSjtYH1Z3JoqfI4rvuEQFQWQe8p3bQaCDC08dBWq\nyQX/gfCBuVac5ZqvhSOxnp6xkrh4Hsaphqy9Blt//iofMKbCYy58CKUCTLrH\nXtYDrDl5KT3HWKIOamEHD+FfMlij6USLGK836ddWZis9TdfN/+MEfV67FiLT\nOOaP\r\n=2JO5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBqjTYfAA2a4KVr8b1WsOdnrbFLfaQYatyyPBx3gucAVAiEA661wEZeblogCw04okMiEHwHoceh1cfzgwnmZvmweasU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0_1601043879938_0.6304501451595976"},"_hasShrinkwrap":false},"6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0","gitHead":"a2aff24b1d9775e665f530b062ab25f208486e91","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-GsIpDoCRwXA6bTwlJJFOhJSyTVZGGZJhE9QAXUFwjD+0bcIYtWDnMZZBWKmxxuB6riSVEjDWCGwCukGKJ/clXA==","shasum":"3eb43b0b4a6db35f82ee442e78a227055c98b6ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0.tgz","fileCount":39,"unpackedSize":209877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf3UCRA9TVsSAnZWagAAyFUP/RQvb8yVsXpuXHyOodsv\n3YP0JZdGHDjHXX7z624XpKPRDbhGi65T0lNwpX+ly2ZrekYCsDr53B3Wz4Xr\nlCqhtmageaOwMU6cBxozYC0O5gBDUPferXZIHcyNiFegALz33sNatv23mFj5\nl1/WySK5voZ9JT6akBUSXXI0d7PSUM2cwVmq8/4u68B/fD4Jv9MsqqeVXV0i\nbuCnepfTddjJXk1SF/OawQKKId5ACcMS4SwKzBHIs6IHrgAnJK0Aoo+YmW6O\nYUfsd/JYX4bUxrQZArwMgCxFcASVZAuMMhy+ZiHAPnQ8TyO+jWSPWtz6pGMG\nbcIW4UkMzYtiaNgV9fIrOO/iVaI+aWqrXuoDWh/Yemb31OZNb7Rl0XJr+naR\nzOIS5d1sMUr0M2g/3+SjIWA40LLlVa8hiCWYS14D7llZyoF3DlOA7YOjVYWA\nNa9yxKWF4iH0iv+U20u7G7w0WUrLONTgahcyO2oDRdvwuB9yMFDmCHEJrkgs\nrXLS6xaPal9r1EQujqk0yt/XJZCP64yn2XkpX8bfgfARp34HD1bq2qwOLe3X\nQMaK4stFLcrtIOUZN0zRyYJK2dLLhO8PWdluR3wxcMzNfwUXZJa5fWJJmxKD\n4IRO5N1wgfRr3eu77c2PAiiXZVML6SHz9105WE7MTNTEM3u1s6Sx+n8m4T17\nogpp\r\n=i/4P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrJfJcEoP7u/x3ExbEx8qY5POOQ1G42GPxCs3Ngm5feQIgHAks90NnkdUVqKiHSkwJ2OyiGRx0l9nFEdVRGHVIEl4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0_1601043923884_0.9025908082274308"},"_hasShrinkwrap":false},"6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.3.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0","gitHead":"a3d4afc407db4f732a28b773cf612c58621e4c8b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-pc3z89qkMj0en1ymqzauIMWNNIZZ2qTkDWt363l16wu6b4vTivMn6y3vGGURCCjZqfbD9+eat+hF3rW5PfCSZQ==","shasum":"dace4dfab6504f8a7b5223ca8889112ec913d355","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0.tgz","fileCount":39,"unpackedSize":209880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbf3vCRA9TVsSAnZWagAAOqoP/AuUpc4wem+Azf9elUyp\njoy4jT/xnKgCeFNjZM90ucsfxrBu+s1y9I+zBGcUibJRsUv8VxURGsUoN6eK\nu3gU6uxqXbLF7WwToM/sQ6Nym944hqRn5C/I7W7g/9nFFvnAiDHrpsyO5HC+\nBYFcXc4wicDLQ4/VkXsTopTcIX3Xd196AnP0T2Lgs6Rs4X8DgE/g8L5z/Haq\nhjjx/sfQtL7EUDxBXywp6NtKm5btZ9qfE/uQhW6g105OFB4kWCfIEyiAl7+A\nMuxfufc2cnDIjV+0SU8vVb0AqPBkMaijhR1OXmxky4Q8DTrsGm0r2GQ+W0rK\ntGX1qI98TvYdNOA/uYlVQQ0T08HKmi+qSHII/AX77TxYYPiJNhHRlONT8Spl\nzyds1ES6PgcNcN3/gWs7fu+/3CW8e4VOImhT+XuPsJuKqyoyiipLHSy5Ahng\n2R/I5t98c8Kq9pPYfpAXOCfikoh/GCxw52KzUvkKgu9DgHlBiSHN4pVSCT4q\nA5w60yks5jjIFyPMYdwCwCrc5CXfX4Ef2nLl5ZsKZl48Eb7D/7YONplxefs7\nGXYXZYod525QI2xv1xFxg0IjbDlWmjxh3YNNN4NanfekTdQ+jeR77EcCD06Z\n4C0HjLhCyPR4FGK6O3S/+AEF/OoKOyc39WaNgnj7c2/fVuHTN3a6X0EJYk25\nyPJh\r\n=uFyJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBw6g0nDhh/o9XEd0ggHFA35crA1MhR8ZBDeEseO9JdgIgDd7sBnXQ8+nSGoDO0p1hFrrrukpT4cSHfgIoPTeJh5k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0_1601043951385_0.4131564779760115"},"_hasShrinkwrap":false},"6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0","gitHead":"2dacafa3bf4156deed0f7daf7b3f2a495340bfe0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-058rGxpXqaUCf79I4Bb76XTr3yaHY3zSKhkr19AObo8FXDFu6mDLxm8e9Ylmk+iB1uUohnpKfPIEFjNY/uJhUw==","shasum":"5cba69c107ce214cfe145deb18e3db7c4463f7e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0.tgz","fileCount":39,"unpackedSize":209877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxRsCRA9TVsSAnZWagAAoYEP/iIK43nFfQm+n2mR8Rix\nhHDB53S+93gHfCLrM5+ppZOpdRL0Ol7TZGmRYbjUOS1KSfffHCvHOOpTMdRI\nwgoqw3AeaaZFa2s30nNFj5ajahXY0olVupZQT3mvru+o0GBt00zQCfAms+fP\nWQxjSxTs9AWu0UrC8M4EQ1wwSaWHPo8cdgAXGXkWGAM9VutdYynGLfrdKXuZ\nDH1DNtDufdC0V74eN8kZKo9P8jbYLuy/NY3j3ACjE8FWEeHA04EDEnQWzCVd\nwQKroZP3TEY3maN9ZuNEA8bH/GNqgw9JXZPOShO0JK9MAmSicpRh5LEr+Yn1\nXYiawQPRYu6u0W/jCrupOzgoy6w4a+tXWyXX648HPd0N2t3zkKWJP0OtRWYP\n52StqcWOCFGFicM8B4RRWAQYbVFqZ4XTCaCwC1A9RZY6irt8LTndQPjxhxNr\nK7s4lz7ReK+sPavE4z4GJIjIl+5u+tR7iJrKoh3NbqP9Me/1d6jSreId03Ky\nO2cqYb3jK31w6gvn+X6mpFbb/sTXp51Qp5NSjLZ6HdR1OWylCDuXTZxQnRSV\nDwnAahq2oKxHb4VGfCiHEiLM5445Ve2XGrlkXxCWMwppPfFc1d/tk6ipsqgB\neCDiY1nw0IhzTBfz6Aj8cncHXZKmVwkPzieDeHNtl0q6LrWTDv8GzQ3XuA+G\nb0PQ\r\n=SswN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQxwukZB1uOpSKQtQMZiUzBMKqD+w3nMUgmaalH5ElrAiB5DwNR9uy9ojYmmkBntwxsogLvoVDhivGuGrzjVrr1fQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0_1601377388369_0.996788261712231"},"_hasShrinkwrap":false},"6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ecae4685a04ac3c6d61a61c03464de3fa077b84","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PXiQgUCKxB5zE7j/bC9ZA81z26V59FYFUXvCS9FScWGLcO5zngOMSXFRSjSpYA+HdJ560P79s5d3QrepSs49QQ==","shasum":"28c1b5f69d7662752183bb358ea3ee43aa6d7a3d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0.tgz","fileCount":39,"unpackedSize":209877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxTECRA9TVsSAnZWagAAiTQP/RPuX8oD1ua+oxFWbyKm\napa/75/yHRu2ptVjMVmgP0XNvKv+ogpPjY11lUX2EUAizcdjhE0nDNVy5Dnd\nfH+qB7aRwZNlTS8mfgXSZ6T58z0eFWRyp9iLsi2dQVvXbpwLBlS2iR8jNx0w\nqwp8AOgxbWKyVkKK+s+InhMoxSkyrtwzZMXUMTa8cozduf4TY5qLiSTc9/M2\n3cC8PrahgNH145omxylwqbuCxjbHwMjdqx4+YTB/Dip5olgBOk9eaaomWlGd\nII+xQx54YoJMzgl/u4v26H04LUJ/f1ip/3xT9ccvwvdmxDdblY2xUV2/bCBh\nQWOablc5OC+z6nCqym5mnVh1SWXntNYVPmK7HkReZep3PPA+Wim862MAVceq\nYHyUxWXqgSR+ZaZagV/UFYWmnQqFEce0QG7WSnj7OkkFrVsN90Wsqw1DSx6j\njD/Ukefx8pCFDXjvgIg2I1+AKdTQae7Gf4NJd3Nf7jRh6/kPyemof6LtEwjg\nwsDe00HrGRNtqXMGMpcVqayUqVtbf6nQuM8WuuYpeO5BNal0UYirP4BWef/B\n6N5ePorcqfKGI+eoLo395orHJnHTPvwQiWjdmLQV0lhR92Nmg5FeOhhPcRm4\ncmR2LIE6Q3TAq03/XgnnDT1+ZC7EM2/Xiow+k+zd6onM/LD8Uz+3xsOxvSN6\nNtgp\r\n=G8uH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICN3gk5zmU2cLgqv6a62TVeOwwahfVzThsKa2ZjQl7ccAiEAgGQ53pSB7DTB9pafF0zJ8Yas96GVLjgqm/U5AxumEt8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0_1601377476181_0.683342676332839"},"_hasShrinkwrap":false},"6.0.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.6","gitHead":"7a629f85a1d5bfe2e78da742664cf42dcc76dce1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.6","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-JH1e4vgDpXH71BnEqtSwhew1L9P67vMBgFzENlSul6D5Jlb1ZVEdwKJhY2sf2CpuBPOuC08XO/AI6rnd4xwicA==","shasum":"fa4369dbba73850a10acfd2436a88af768eded78","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.6.tgz","fileCount":39,"unpackedSize":210110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxTdCRA9TVsSAnZWagAAiuUP/isyeGVRsdYzU0R8jKyl\ncHCFiW11Rz5jPWPCNOoOQwEMZAh3AdKvRUGy1Mhz6Qh42TXqnZYbI81Il+Id\nF6PFffCD/l/vIVTtDeWUQQTrwQko9nQHOPPJ9hR2bYObtRtfWjxP9VF4oG6f\nhgjuKP+6lGJzt1/Um8XkmJWDKuFOwEVOPEQy3VgNHHh1jj8aOa9PCpwxCttw\nMVq82j6BeEu2iqdTUZTQSPGoclXexleu8x1sgMRbW/JXqPdaTioG47RgLyI9\ncvKbqaKCxtCIxLU05pF7HjioXRFY38xKydVioH+K2HykQY7Iz+ee/V49shYE\nuER3RQYjNjV7D5u/1+KMNxYuLSZ8NW/Gof+KsRwGFiKOkCXCg2iJV+dfU8N7\nnaDhz+gfVoZfL/dyOwMyCEi03mckcmfFT+dfnT4uQ6bUtkCroSqYW+S/piiM\nvePOkqhv9EHigO/LGvXWL3pYY/31SnpqXOMo5E/lj0gs1x5qPkHab7LMcSH/\nw8NoX5miqJH3rmZEe8kPx009/Nbb8Kfkay57Hw9x2JTgrHuXSjtqoyzFpLH5\nNMowYk4t8GBSapU2mNFMp4ZEZoHF5EzjbO6mxYVOPdfRXG1GuPA+SosU6qJd\nEH/DBGdwMm0tv75s17jthmDCuHgI498srCGk1aN6opLJh0ou3rJndZ8MsLiV\nW7F1\r\n=LagE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrVPKRcSWWXvqQ4pxTG909k2vtO0I7ZGLOh1BhqALUmwIgJBaQE5CwhBP0y0MaECpOdN3C2v7E1vi6Wik35orEfGw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.6_1601377501292_0.199487410415923"},"_hasShrinkwrap":false},"6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7a629f85a1d5bfe2e78da742664cf42dcc76dce1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jKqoMBESLN+e/BwAJW9tM4POt9RjoHUIPyt/Ofvks3m4gffPLP37dRbDBOnxFOWuikYjO030iVEZfXPmJJJs3Q==","shasum":"0425238661988f85bc785a33381fcaa1a1c0bd27","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0.tgz","fileCount":39,"unpackedSize":210153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxUCCRA9TVsSAnZWagAAVe0P/2eVneIGnGyWKnEuB4Sv\nYDtm93y/hpyIpz36Pe55LVcIoFAq5lAnd9kTyn6Zjsjuz9YQExRQ5ah8GClO\nsuheY0cZEt2iTAoifSE1b5/JzNZC+PdWCbmjPS44kveGKGclvftJeepXkuSy\nJ1jkz2+rAG1Sh9chi9QmNy4UudU1nUjEt5s5p6DLhGHAtEfnfwmPf41jTw0d\nxU27jtvyX6UmnvOaF/B9y6pGW5lXU/ud+FVeYbOkc2I1IwyYkcyz99OoxtbV\nv0isZSEXBc1LEkMyJc+WBPc8RJFnuWWDJlLXSIgWOtGia03UmxsN/yYXODsn\n2ybWccChoPwwR15zXZiZlJ94UE4qsznGKFadVHKXpZ0m0pVug9w+InI5ND6j\nIzlAkbASteSscFyQEI/a4wdo0go+kpKlfgDdqWYvNeN629W7PUUeWpn2lpFj\n3A5qAHHs5Wj+TEhSzzYqd+LSVJdtB1CtavCf/yLQvlMushdn2WJAmiPUuefX\n1mXKWK8jSfDWgJ2iuc566CPvyaE/eDQZ01KIiIUR97gvL2Cc2YjrvpsvJs6c\nWAk8MBoNJZ6YxFawNN2Yo9XG145B19nF/j0LLo4+GeOso6IEANSEOPrFoNBG\nVKX+zIx580FqCYYBsH8LUw8WQ8uoLgr7OVlyYkSeCrJVQvZ5PKz8fHKPAe+b\nB9iJ\r\n=bWxg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeuDsTpwBRf5ugNNnj7ujj3LPnbh4j5Q2nj3h0PJ/MPgIhAPtj3XF+ccHGR8o75OLzOh1erm0gIB20nUDxr28qMgtX"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0_1601377538361_0.21038749103277965"},"_hasShrinkwrap":false},"6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0","gitHead":"42453da9dfb0844ae82c7becf551564dfa39c35e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rZiOkE/5Tw4d16WLLTlaEzTwQEj655nBExs2rJu5/cEV2Cmi40YqDd1sSqdncs+l4kmiJMkoNMMSI6GbFRqDiA==","shasum":"50dfb755570b5768694721920fbc16c85ef6ec15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0.tgz","fileCount":39,"unpackedSize":210153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxUPCRA9TVsSAnZWagAA2GEQAIUKvRi21PwLPftgvEbN\nIJNLaGncho1BqYgE4fiTJLPtKlNYCwJz6BYYqsBhjzJGFmvyYT0tbc/CU0Hw\n2vR8GFxb65WvWDLK9DqIv+3P5r1zlsS3OwUzUMJNQI58uF8KTmw4Nz8ICa4U\nUThKydkijMOW27/mHMhJvjfgOn01I743xsrezw7tL86KX2t6SBbtEi+J7xmJ\nyDi0PGxihUyZ9w0wTIha2T2HVRJo3NCgyaBYbA+sh2gh7YjQTGbBedtMGAY5\nqu2J8xOFSuxBaebfIm0k6WOFi1Ke9uM9LfYlr/njAXGOfsFT4dn0lTuz2Tug\na+aImHFzZGvv3GDAQIk9+ddy1zaIfuPo+51lYMv0609r3HKAjW01RldpXkjS\nuzDBzfgT0J9kvIzVSt1qzK63e5YoBwMOErQ87hQbkishe4Rv2FGxVCDFfz3/\nfpTZxrrDGcbw8O8NtG7ElOC8M7sT1rQBylpz3iKQLLSqBkHiYkzTYE04bPoo\nXsudQpjwe1Y4s/ZMgfU1tDXaJTvCwnhsdTOJ6nlJZeahHFtk3X6uxFt8FsuQ\nwjdrt4Of3FZ5TYopCr1i+s0pCBXrda5MwBtxNmX7/b0HZuEbtufg0xJj/UYI\nkeNHFhAz1LI3bxN+owidDNyPAjMMGJ5MpLGCYVVJQtKCe8Hpt4FlVqZvpLG1\nQ0nD\r\n=R+6s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUyRV7l55ZRdn7L2Y3IJGukwmYFxD9lMGOf3z99e7cTAiAT7XMEVbwfov85MbhmzbwH9j0aGhV0YXPX7sUMbZGtSA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0_1601377550307_0.5832175019904331"},"_hasShrinkwrap":false},"6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0","gitHead":"8d42c70370fccfe9394834eba2d8874bb9950c8e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3WjtDpY7VEr8QvKZ2G4sgm5qRPP9c9nX2PpHfld35iEnizsrvuT6ZRMrwigssK67T57uWtAOe6AU0ICiF7xVCQ==","shasum":"f6dc5d213ae86952471853f749605f77c719c86a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0.tgz","fileCount":39,"unpackedSize":210153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxU1CRA9TVsSAnZWagAAuX8P/jYXQsLpQJdj3RjbnWwm\naA6hCNI6EafLIXHRBzIytZGwH0S2Do14J2FvSZW5pRl6M4dXlmwzV9YtnjGi\ngnwrhyk6BIjK4Thz0JGH9TtAjJwnxDg/qZvrHUNgKBxSs+RMOiQP4jCAr8j8\nc+gX9RiPV5cAImPmGJfQ+vuNGa4ycGXoIsgBkKawjL+w00JKml6LvS1/h6O9\n9AKSg4vJ4AX3ndOKmTo8W5oRC6IWTBAXQ3zBDezFZpN6oMqsbqQpEUUOW9W4\nU2ek0JMyoavNdqkQpJJi7jjzGueqXYMn/amoLlsP3vf4BBBS4qjWJQJleDAI\nnVfZIDwQ/bxhX8GA59XwjkESzuXISUiQab/eJgjfv8cM7/3nJ7odKvxT+Itm\npFi1hwtICsNi3D5rDBoIXlyvP4lTAgabEVhnn6IdX+ZYFCahmYO41sLHqSWS\n+IBF8UAbgkUWA1J7I9MaeM+TlYvYABlv+ja0J1bZsEJMXg+MHw8Izl+koIIP\nkBqhRoZCigw85smBCWQXgU97ZqQHWl0gnayvEsmUjSisAOIV0kNeDIMtOw/T\n+NKYrRQTHo1+RDdVAa92UkjusLtB0kYr753XHC8pFsgeZeFpbrhqaTn3yo79\nER6ztlGquZtB7ai9Sdi3fEWE+WXa3NKUjpjKtdFGQ8vEO1Av1Yum0P2UNXO/\nMEVX\r\n=CmgR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8QqkiJtNJuHfYXOzAMivqx0RxBvsbh3Xh/aLnk69ECwIhAJyQfJxDTtzcwdXWE7aLrPxkXHOdk+jWUwRO9D3i5Krg"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0_1601377589099_0.11586265825909892"},"_hasShrinkwrap":false},"6.0.7-7e390735e515f7041c07850940eb240133c722b7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-7e390735e515f7041c07850940eb240133c722b7.0","gitHead":"7e390735e515f7041c07850940eb240133c722b7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-7e390735e515f7041c07850940eb240133c722b7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-icw7JjL6m0oSSNqbP3e/IVUR9heEPAyQjEFXN17onNO7LNGPKgabDGeHdobLGqyjH/E+kXaAjesIXo2XE3ZvEA==","shasum":"b406f21dfd9beb6db7f2b493d2c496798ac6b35a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-7e390735e515f7041c07850940eb240133c722b7.0.tgz","fileCount":39,"unpackedSize":210156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxWGCRA9TVsSAnZWagAAGYQP/RLPIQbcocd+GJ5O1KG/\ngdhg9o6kBBSV/Lq9falH/DO87rhrMB5pdcJ+M2RH2hVYxCyN11m/8EnhMpIc\ny7Ql+irB6idCAI4OOnYJ//sGimdBmejsLKcUhFsmXxKtTdmLMyGJU6SF9uWn\ngEzi+7Q5BOsDG3bvKl+JFiWmWDQM1YrBuEcK/6nWB7296GR46lWs/XuP0tDp\njdWaRIhIUXoxqXD0NjI1qTCENQHw/aaF6z/Y7B+4RR6eXbxIkfvjB0F1EWRI\nVmw/nqvpezc0HsQUiPrzwyLqcAsFVK1Tt84kBR/VAtDQREKFJ4Qpu9oO5+sV\nwJFjgdD+sVueQbBPb1IIrfh21YbxmAlGSAyaejYhsofjvtsEH39H2xQndHF0\n7IlKqz8gIt4rfzWWwML+nJvKnBOj1KWS0F2c4/v+SmSPxOhVC3gp/AHRi1R3\nRDNDK2bj89Khm13AV0+oC/1rjtMCdjkVj72zeK2TNSQ5CbUTP8dg+DR0v5b1\nIH6xvFP9P9bQsITVXa+jHyjFlQD9f9Se+yGcK09GPK94wJkZJwS1TolVkgZd\n5tFx0XivGOjVuEohfzVtOeeHKKIgpwDc1b7Vms/SxniEHY81DuCekF8gOjRc\nDk/5fQMmLIKsqGX+jR9eiwS6LkS7ENWiuQQMuq1KG1JS6bzxnTkkKqlMGCP9\n724l\r\n=H5JQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBE4Giik/3sA9EYihMtE01gkIVTZYRCx2fuy3kVBYTCnAiEAtnq1ENFLJM2kyKRIFjI9XNDi7ZOACovDf54b88Gjf5E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-7e390735e515f7041c07850940eb240133c722b7.0_1601377669959_0.6965547008576212"},"_hasShrinkwrap":false},"6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0","gitHead":"0916a185c8981bfcc4608189e78259d90dfbe768","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-pn7vYszBUrauLdxzaMse6/qym+5bq8tsYS7pcUXBFJkfxQrPqg8b+34c/ScZKDtqu9M7egEPTNVITvvJuA/GIA==","shasum":"7aadbf212406052dcbd7de24e7f5ffd17eeb0296","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0.tgz","fileCount":39,"unpackedSize":210156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcxXRCRA9TVsSAnZWagAAPQAQAIGF5fZLWWyQ7U44i4RY\n5nv2kx1tWPn+tU2ZrC72ONBvka7p0BRf6bpMI7ioYt3w2+ADxnPVqXZVuQyn\nr2i7sg3IaagTq2xMxnFB28cpDtx6LxzoGYttoBy12haQb2N9D47MuGfR4tf6\nmzO3b7KxKGDAgnS3r1Mi3y4oEdXQH3jwA4BDdd/a6u1UYpIkV10OEgrI0vFa\nCWEwchc69o0wgds7MpvoWYe91iSD+WOdvR2ElE/vUwfIlZAIqo/EVf/fdf+i\n5qCkCWJZNPRLTtWaf0wkUst6a4r57TmtMldx1I2GF0SQ297wDnggzRI3zlZR\n6LTyrXo9wnolv3RzPikhSPDwoAyHqyOWVUXDKUT65wq9F6LDBuynz2MWUEvH\nWCtMPv+ulZ0bkm88bbwfhdSt/8cdLHJcbPLATDtpAIOYEjBBZRMYVKOJnSgk\nVIMbTe0m6VGqVxvOQoakw/AOQ91dQzSKUFoiIOej9ZCqoa5Eo2jcQ5ivVOwW\nl707fNYRq8IaVV7OOuSIw6gAPxzskMR9z+GmUhPh1pVQ0iK8iH0lUWBJF28D\n18M7IMovk0wB5xsEq8Zusv0XHkNSUj9Y+lQWlDUlXgT+OeZBN+8ZAVD4emvW\nHh2Z8ivmtWaEcsaE+qxX+f30DWfawiBUrTJBo5V5MNODzQn1l5i7sDD5zKIr\nUDN8\r\n=fmr/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwLd3LrXHNqNmzIW9//FLKz5S3NbArXZ2wxMFLBboijQIhAOSYPgSpBHJecub/NVI+qBwC4XoxDBbZfo8I+vOiLIzB"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0_1601377744648_0.9568209346957741"},"_hasShrinkwrap":false},"6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0","gitHead":"6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dWXt4jfc1Kqfb0rzKHdhzAv7JPQ92RwkWedJgyHg/IkTAYgK0pTVBPbZM2atnZQRVG1/g0SZWJOKKkNUnZ7C6w==","shasum":"8a4e743009d813321da8b6a05aca0b507d2846e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0.tgz","fileCount":39,"unpackedSize":210153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/kUCRA9TVsSAnZWagAA6noP/AzH1YmmggOhmz3X8tay\nD/V6ET7aF1NsXfg8yEU6/ZHAd9dIuMq/2eYTcKSKF5DpEV/vDM+xQCsSiYQt\n2N0SmoKzFn1J3t/8vL6YrTZIuWD7xfqcQjONA7eoCHP/QSxDFBflDe7M6xBE\n2z1hhgU9nX2nlW/jLzvTPEYKJM+sf2zC0jEDb1kGKw+VhYOM2ORhq4Yf08iT\n+zH3haeBnrF4ktvYdl7g1lMG8yXNFTbFSYa78N33Pz7OwwlhsqJ/VP/EtPuu\ndBCHBFbWhxKHzB0OdGBzPYeFWbDEmZ7hsRI5mJBKO4cxkV0XScw3OM0m9N5j\n08falfk7+Ne2emzZk2UQsWTIale9RC0VLwPShNK4+SxqIDqY11XW7vddrPPY\n8LH/RTO+8Lr+1UE7yQBZeLPjDiKHIUPQ+aA0qFncmf5WHsU+mbN8mV3WKTjD\noOevl9inNUer3couUEIQt9qyREwWPHXo6/WcnXvxyRF4ed1WCa8lGqw8GAx7\n0Y23+5xjpewf1WiqSYrhburuhlBMC8lB9NU/QqNnlUOwXDoSV0MWhiYmJq0u\nB+/Nhdz5GDr1CI/aL06L5orK2vL2uHsDzy6/kUQkVLrkh4FvsXEsBVVojLsl\nCmF1Md9HIm7r7CtH9GleYwaFHmNkedbCyGTcM4zeM1sRhsGYKunVuV5Sp5Ly\nVNJj\r\n=Raid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyPw+6msomX/rF3lBZKOUnJs5BIKCjPmIzHCZ/FN3l2AiAOteoDmSfDTwF+T7aegIqhYftPJ0N2wYXlYQ3dpwPm+g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0_1601435923881_0.2179472087003651"},"_hasShrinkwrap":false},"6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"63a01a5a6c847fd8809595c6dea12d82e4ec45e6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rAHFrBTWD+BqsDqtSgJ5oJCFpkzRxqS8m0g5z85JaQKIsGQThsQqMFYPLzVgUWQamKTopyIjjzO3v6c5gstxrQ==","shasum":"7b7e06b9ce85409ed797bd65f37b332e47acb620","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0.tgz","fileCount":39,"unpackedSize":210153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/lzCRA9TVsSAnZWagAA87cP/2giFVJQGFSkc/mvTVWP\nxsVJYppNzPdx/dKvF8B5SzKJC90RwkLw+gN0BlRxhBQSsavomHa1lqKTgIn2\nzGfUr8zm+K8qmWvI9csh9xE4CnyHhYoTt1VidkOqNrA7shJY2uLCAW0nc6Ea\n8Idp9MSDEB5FLDDLWPR7IzloHseuGWQG1a14V4lI9JKvaWYJt8sSXKaZUmIS\nSTHOZrYfSqCAv7Tup7BOLdcKZCgmZwVQKnY8FzXYJJKXsRJn7F7TvJHaqA6N\nxCyBZbX65hWqQjkFQbCmLQeF77hqWX12raq/dI8TdkJ0Sf6JhVQiZqIgrasr\ngIn/FzxHxTEwO7I93WDg3+GRoWDMPXl6mm7VM1+RQVTvK54TLaU0JL3ZHIRO\nkpi7NQANX25RSTau7WoxucmgojRRlvfmWqnJOCZPHdbBHITjKJnQmjeOygDU\n03kEMRGjwgaa0Wl/N5hOrg1Wd49pM7iiXKswbpiYzNS5Jjnj67BhiI1Pzv1C\nFXBbdtfBKGIIrTeZe9fEDD6uYTbnpqwz/8OcpDcHf0Kp589nic4Jb1Z8fdfY\nA4ZXFlOZm8WNKn8GdsvRmufCt9f5Hi+018GZjZBF+f6z+vZtbxFVriF/3p12\not8wwjZ4GZVjnsOiOn/2yQr9r4g+ZdLdjvnPSGYGrOfG6NM2hrUEkguvDQeJ\n7Rp8\r\n=x7O3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4Pufkl4bNq/I3blmRRaMhQQL+6iPjbZ4q3oS9m1xdSAIgK73RMgO1j6/TUapr24AP0YGn/We0KmT0ofUgof7rOGU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0_1601436018939_0.8943860845259164"},"_hasShrinkwrap":false},"6.0.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.7","gitHead":"520e6a7f11e4409dd82908988ce224317a4dfae1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.7","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XexUwpmZvaoKTWPOO3Dg2Ppat/kPvQpjZtwilg28vKC2nq5b6msm2XOYvo5QkiJCf8HYX3yA0uoMX4HGZXCEOg==","shasum":"adfd4bb3ba23579e744b368af46d57c4fbb0d348","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.7.tgz","fileCount":39,"unpackedSize":210385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/mSCRA9TVsSAnZWagAAWSMP/iexKaBiDsQWYyJqXORS\nfIkHYB4R5ZCVlajaDbuKKSe5HTA9XSU3yum6KRKnA6N05R0QFhQIDM1s8KlV\nESdy6rROYciD4Nclleuuz5zGJ96WM3LzWt3jr6oPXO3E3S1pzvhh3fZUqVCr\ndxMZbkMTsngMKQmDxk9IwwawKi8IhUtSmA01emaYINInzP354lAl3AKZVVOx\ntsC7zOghx8NI/B0BFbIBDFzRG8BXNVeFEw4iXQpXd7+ZIzzNxTq835VQ7/mR\njep2IWsFMmhxoRtVDDgseK82Ax+rjDAySSqhe8GU13Ma3QxVq3d7jBCgrYsK\nSndIRuqnBCur2HN5fW1LdMBWQ1zd1MqIY0Ymo4/2xi+gqllXRxZqk9IY066Q\nAYU0zYF0qBZsGh7x4rpqAoQw49xViFVHz6HahyB786pL7bEDH0a1e+LylOsh\nVst9gtmPlGdDRwAxgOVNmFdHnEzkaBxQ+rVi1MaJdziEFVnm7K+9S3RzFl2l\nEVUwSSxnECmPbdtG2t1BuEcZGbJQbKTx8OTDuXA3Q8UPzGxfKvGH3Y2pqTZU\nwBeX864WBy33/yVBRpHMVX/XFbXrHzz2dc2go2DdL+0izBQV9WCURdBZKioL\nOINIm/8n4xPDHRp5Ye8AoqbLoC10qwXu9h2Y3DKqcDTPNBEEdOaDEQJP/3kM\nq+lz\r\n=up3G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIECB0YacgsyRXsnPFO7+cUmtqja321FsYJ6YKAk5C375AiEAr6NqU+FiEesq0a9/I5dMNnIHycu5qLA4fW6wPePXFM0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.7_1601436049371_0.658676226007199"},"_hasShrinkwrap":false},"6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"520e6a7f11e4409dd82908988ce224317a4dfae1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-WkeCm58ExxdwZpDthJF/wepnMU/b8a+ZFN31kNdacnK++6nUql38fHIna8kzFIeTWr9Ymjcbxs2ccCvHcUQhDg==","shasum":"c8eed5c7d67d2ecff7a5c47c7491ff93b2ce245b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0.tgz","fileCount":39,"unpackedSize":210428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/mxCRA9TVsSAnZWagAANEMP/2T7j3TB5xrEu/bv4qbW\nEZv93W1+FMxgby5dt+dr6aQpiy98gz8DPmo7qYHNGjUG8/nvKnooGoYOi5uw\nTSnFwh3guG4MG3l7pMNLIN7xWUmJFkXH61MKToExrolVfLgfoqKH/Gq5h094\nCDVrUMESsIKufFWkxXoFK9QZ0qs2aheccPHHiCyax0rwIoHlhWXXcxz15rYo\nJ8iJnXzzpmdGpaBPDfZ4RV9R55CPilFCh3dAwrd/c7Kt9h6sf01VOUG/djhq\nUnhfaRh9m883B0Hi+cZwqCEXISNNGufkm/BFsKY0pLDbzR2kC2L35KLThcPT\n0qTC1nkyLiqWbRkl+CQ+uHxeY1ZJoyVZR5jHp0BCW6t7Rg2lb/1d94tVqZX1\n0kLhpK+oRw+WoSzofHbSTyS6zwb55K89EdPs7hBII5tJ67Jg2E9rKzHPUDlg\nZTE04FNnLgl08tt8eYDRCMO8oKBc8bEbRIFmuNUp5PT5HLOkOyejiFfEqhgp\nXejHktGqfTheSWn3cUUBJuHTtPkEyyGrCjktzVm94C3Hk5KxiPQ+384R1HXl\ncFaiW99C4cQgoaVxgrmgjDHxn7/lnjTLSHO+vP5ZwnYWuE3RI443Shz2dtKr\naZnJdVDVota4QXPhIv45oPRznKHo/9U+O1KjHtO3vKjA7Kl4OHqFPUJ0HYOQ\nmGe+\r\n=KT7j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVJNpi0pGAXuOPHxwtmEnUobSB3+65Vt60V7MvcGnypAiEAwdZ/meYWQHN2YS49L6reEGemtwNIQVeSZT5JnN9PzbM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0_1601436081245_0.6972553820182981"},"_hasShrinkwrap":false},"6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0","gitHead":"3b4ee7435d866aaf04b6be73b4657ba23d4fec89","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7yICr2ts25/jU/PPJiAyHHuhQxhblDuCC/paArbwc+/UmmFY1OfjcHubW2B7YN0YZDTdQoECV87AaAj3SYjfCQ==","shasum":"11eec4235937e4da884617d5249b2bf65cf95f0f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0.tgz","fileCount":39,"unpackedSize":210428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/m+CRA9TVsSAnZWagAA1G0P/ii5EiowET+UGQLZjtS3\npIFTR4+E1Ii6Ans3D4hMoSEX9EPX7qaR17usLJId0bTmcKpnY6tzWwwhcT4W\na05MscG1kwQ2zDs2EX+xIcYiHBo3OoujAEEqiQfNpn9AKdDXy2mS2+G8q6S7\nWFAPasrEvbEkHiYrv1Ji/V6xdQ6fDE0tcG2ig2ujYOgrGvse2ZGCFHt6PAW/\nihkeWoQCXFtpRfz8uQK2h+rYuVt3tCKgVxGyiOXrR4ZZyQY1rVQ6cHW81r8x\nIhlnsUTIp6gCD8nt7HKkjW9vdCnh9QuuRYOdJ2OekaWJnlEhMqf0dh0Ec/ED\nEk+vQTlslMw3kmaccAGEedry3WK7oqzaalimurvQvDgX9cBArjPZuBs+bs6G\nGlRJsa+frCZAITJo2dCgIr+Y7FgBU/bwgYM22437rkssmnvdFVv+0EhWeNti\nfE+2l9rje+sZ1E5mxlR2z2Yj9+UhsvM7SBVlNckG+T579tUHa0+3TwYv9w3Z\nbgUThJISb4RTlnmOsyuYygXWx7kCb2OtYahz1jOi2O59l//VcVf4MQvjFreD\nQZvBHtHHmmFJMG5ZcRh87G5jLU//Ot4AujKUSESv5De/lsfIuBSzc5c9ET+4\nS+AWnxSXt+BnWzXonM6CaOAUdv1t/8R2WSD4FCf4ct/hnjuQTWmKl/3YYRKl\nE0TY\r\n=hvSQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvTV0zacHbirl2BbydRIzcOnIGg8E8f9CmkfG7IERl6QIgI0Hu/RL9AFycVyv0KNDAM1uMJBCs11IAiU3JvJpnQd8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0_1601436093434_0.08861774193685412"},"_hasShrinkwrap":false},"6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0","gitHead":"42be46481666f102851ccff90367e09e4d7071a7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-avqelynk/X6vfhA3sTqhLPlBgI9pNd/M0Om0oaqB7aJ8408kwnw3lP+lliXOccHzmP8IDM1YR4qsuYKrljEJUA==","shasum":"a35d3b6bde4e058c1180ac08adc1b9c06e67d8c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0.tgz","fileCount":39,"unpackedSize":210431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/n4CRA9TVsSAnZWagAAypoP/3maLR3ZoKQAzKCOwAuu\nNC5VdBggzRWw0TSh/bujxMLgA08r/OsjfzGqh7dK9c19mnoxK5yBnvFEIgwN\nfIsiHvObd+xc0lF2POPPv6+giQeBS7OdFUdhVuel3Y7l9VF1hFKZcAJyulD3\nD+ssPh7z685Jru7qtKGPzN3Gi8ozyscS8J0Y7brVArS+JquLEJdYeb9fFJnP\nWZbA6vHMpnp2FSn5AK/aXXkbLD0F5QjOS2gvQpKu+htqu4osCyBcB4aCsu+Y\nlq/gOvsF+6fz03MxP43yRN5YezukTzwxATqpOG/hF+mPfwRVWSp259PuB2Th\n9w//zx6cZWpBcs0w5RQTlx/iZTiOH8wr4inTe77mT4P3jtB6H+P3EvBvf5Yd\nQ1NEO/g8QQOZ4XqyIGBoQZT4VhWqD41yQ+JT3zDym6DkxQVaWjtsL0cfI+kK\nxXDKhnDXdtxqx7sANycbh6aBQDk3NuQ7G+JQdbzXLMZ+/+F196K2WjoatPFL\nnQ5KFI0MqbupRYwuzc6hbbGzduB6EQb9REl0WyL54JEFKB5Ee6PjhT+Gje7c\nM3TkK4tUa2ZcqErf6z3/49adM7H/JE8kHcqlqSvgB3SbSHFSHTBGZMacGR2p\ns8cbuSKgbq2MAfmDoEED9XdphCQT8j7hf15PUuMkmGYlUhUpISVFidb+J4Yc\neuBP\r\n=j1zB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPUlA/ujQNPNwIOUz7Hm3L63HXamjwTUblgjLGhvy5gQIhAItowAh3KpVeJCHsxY3K1McnWcuPdd4mh0LKc4OMYd2k"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0_1601436152276_0.08471394536642296"},"_hasShrinkwrap":false},"6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0","gitHead":"ca4cccddf69cb82b63808d82f39c2026b6f01e09","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tefpCmg4pc95tPaA83lrVg+0AetYGC5tK2XYqqjC9s2X1UHsJR5+IH4w7W6fWy3evJne0hp2Kej/ucfkr7DTAg==","shasum":"07f95e637d124cebed86b3ef791dc8799cd5be8d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0.tgz","fileCount":39,"unpackedSize":210428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc/oKCRA9TVsSAnZWagAA/uoP/RgQp5gmE1IdEteRqJ5V\nMOsUIEJk0hbbUMK9U9jrgeMf4eGPL0wabLjn0zc2ByR7rGeBymUj3msHkmeS\nJLXrM7OsLsBAZ1irIucmufC2gXqgvaWhECOFtM404wyv0nxLkc6TNdg6/aX4\nv8gW+wz7uQlDWVJE7/17ZdVLa3O1DvnzhwJq9VeMoItSHfzwTVhpsCxznsUF\n5VRJPTIESwtIvkbQOfxOeHvz2LjHWgmgr8rPVwuw3cTE2ZsSFNlA+EiiGgO7\ntnH25QGPJjVYL+nJLfctrHx7AgUL70FrVRltvbyQEjILYTCIH7vML/9hGefN\nLUvKRQL0QODVcjHimI6qi/sVpx3lZDh6ddlW8yyESkBP9o5/LN2p8N5igfPl\nolaqhX2rJYUlFECPLmY4ljBfLfqEYYi41VdvoHTZnhCF0vdIYOmMPMrhFkrM\nlnzY2X+BNLAyZHNc+q2Pkr1XHFv226j0YFIPUgeZxyW+lKKlZ0WcTZUOjrao\ngOwhdrhv41FK3Cn3snr1vxXFPI1jqse2SkJx3PGeWzJk/jQjBI70gIvtA9Gc\nQNup4PQ0ZEwdJQ9bngGmye2uQgZqs4U7NygAJQKPHgDXzrp5DcW4yAqPrvvd\nJofFpxTL44sSQxOtLcE8XIlv/VTML/KzaB8nNyKKB3qCJQ4Um+7myaslba6j\n2hH3\r\n=Au04\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoy2lUy17vM6E3Irtb34toXS1XGA4Mo5b+LwDuRU4DfAiAhJw9V4gwUNtSaGZS0WUwBcbFbVOXuPcDZWHDI8bdkPA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0_1601436169945_0.27970753418005456"},"_hasShrinkwrap":false},"6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0","gitHead":"5e4b63d2e45fb83d7c0127dafeb67f4e5a569654","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XdlFOzacHFu7+Pt7ISuDFCouhxuGDXNVMuPKzhgae+oaXC89JA2y28AGluhX6bVtNzgOH2LPgn0G0xZ0cNpCwQ==","shasum":"ec49c1d202205e82da8c0aa68bebee53eeedaf65","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0.tgz","fileCount":39,"unpackedSize":210968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdvqzCRA9TVsSAnZWagAAzloP/29Ukha79OvwsQB7HzGq\ngG5sE/VVEzPFt9IAx5tj5BO+95coioYYG9wikvoSFzjF1ZqMhPOiGhF+GGyM\n5owLWeSNqyMi+Qi8A8m31JxgB0LSrwmi92TaZeWIAOp0nq7YLJ1v8Kc6OUj5\nbhu9Tbi5wGS55cbttXze4bacn6vTLCXTmwcz8jfVWTttYIsvnXADgBeuRUIj\nlpzhVBJRY0cwxC8UyUrheODGE1bQkoURD+KG5cts2y4SN1irjIqqpcZZSXHI\n9dET6GbIaNCT4vS20Ogwf4lNMYJS22fLRrAI7oidiKpzFZJ1n6aMRP6bvDMG\ngWyhLQ91ox2bfhJntVTq+58f1e5hdKWf8ERVVH8bvc2TINP3YCDAPMgIuWID\n8ILlgOgBlL6nrm87gcp1rp2G2Vl/QlE0HqvhivG6ZHxGJOs2HhC7WC/CXrZt\nOHhqWWkWJL71dk5qXoEN+WiLo08Ix6NSNBfRtNNquYS5M895rXG1wTuOaT0q\nM/aQJbIE/J5BMAztIuZxbJm8U2+7ISJINdMftD6KHc5u8CwC5lZm8oRH6hYH\nNkNrBbfeZM3PUjiL+EweIMfW48DAXTuT0AMqiQf7/VdMFhiicrygdU0gxPBo\n80sfoU3an01lL1HboNAkBeHLI+xTQJeoln9fH0dOj/UefFY4/MhVPFwSbkSL\nu7kb\r\n=Lelp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5Dmj+g3yH6ND0pzcSNyxkTPzefh+ggVOGLDeE1HA1HAiA4if9Xrgpzeg9cJPaiO+91jM196svlLZD6UT2IhZ/T/w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0_1601632946902_0.7333150219950797"},"_hasShrinkwrap":false},"6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0","gitHead":"6e286d4dac1b97e5716d5a14e604c8bf817abd86","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Y+4D4Npw+JnmTsS5uyVvBttJrb53xYR6isJUNw0jG09bxLy+OCTLjgC6MNreVkQVV26qaWZFIKn3/C7JDo2/Pg==","shasum":"c0347c99c8bd593bcca72690d2a35dbd48b92bb5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0.tgz","fileCount":39,"unpackedSize":211644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdwctCRA9TVsSAnZWagAAiTAP/RBYMp4BP5BMWSzE4oJw\nGo3xK4QDqGImM6x4YPSnaEmcu/LJB7QCUtpJt4HcU2EnIOCeP80nENwbhBoZ\nC2L6PzTpT2GdWHueTFGdNbUI8sumbuMG7nWGNGfGVzpqWUHao747JBDw0MCA\nJme/zOI6/1Bq6218al+4kYQcgVmih+JR2cEffZFK0ougrVcKwohhOXjXOola\nuIBZYtEyD5YE1JU55LZjSq6MgyLvj5htqCwbK17MAqlzI4LQwH92nbpvh87D\nD0Zd+UBiXwv4Nk+DIZGRLQVMGoAuE4fyY1eOsHKgijN21zpoS0uPKE+2+jib\nMMEeV4yg4K9qp2O1qoCngZyEs/0wnUiHU7ZdFWpdl0VSNhAfY3f7nZ5ze5Fj\n0iABnH+btRJgUNQYuJrSvd1xMX58OV10tur3CFIL/Q96LN/w87UkYTov8ylX\nbFIL4//fnkua5xFcRS56G/LEltBpirnbcFMgNT8d16M8Mc+1X/E62Ghcfx/T\nQAa/NIPDcrUJ2WRUUe2QQk9yR3FFFsgp+MoPwHgVVN/zVmVes96blkVOuOsD\nBjArFzQkh8Fc4FGLIxdr2X9GuM6SKAWPzs23aCzqc9KLWzx9c9vUBIxc9u0F\nZXoIYoSEah02EMmEbTt/BUJ4gC5GO79Sns+Jm4MFij+dNPn+gvWzU0lI9sbk\nMG6y\r\n=+cb+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4YEt7BwPPQCMXp/PyC7UDwvJ96mI6OnG8rI7D0g02cAiEAk7DCyWvbgv1Bq5fDSUIkrk9pY+idKXLbcf5NCPK0ecQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0_1601636140864_0.6765266816529669"},"_hasShrinkwrap":false},"6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.19","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0","gitHead":"bad34fb81e3983bdc40f62dd6e8a36837416171f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-W9aA+JdhvS6CUqGqABG168Fj79BF1UvTuEqs3pI9FTRnS+SkvVRrzyW89WR3guEsV3FNCjcFYcOMi0UTdhzrSw==","shasum":"1b8a9b62d4e7067534fb4711f7e7b9ad94980bbd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0.tgz","fileCount":39,"unpackedSize":210968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdz/KCRA9TVsSAnZWagAAafgQAJvPE25HoQNSbT38EAdx\nazYng0iCZUexOCW4b3dJi4m18P0I8z7LYYBjkI58QN/tmWZZ1zChuZPtw0tz\nnvdiHiqQxhQEEBudR7IyCkQfRg8kaWmCNk3TanoEMHEb8gK4szQvddKw/Mjh\n5PiDoXhKXHq3PJkk8lwQMh2Gv3kr0zvcNC8mv4khlFvUNlFDUffWnNVsDVEQ\ntDmh6y9irUnCcnj0fhw4SIH53cf5KMZSkwqLb7RSwlup7tEjrZa6qlnB2EzL\nD9ZvE5ZPzfr8GiUSBWjftrh5drSG7RntKlIxFhiM1hpWTkyZPIjlaDlMgOJo\nOUSr4YlUM/CJlJQcALUm1W57hiZyqtXKYSkRBPp1DRA70uetoudCwBMbhcVa\n0SYl0d/J3R2u5rPMS81gxJcwwa6OkMRf2sybn+UEKySQTjfRoFaISqJ/JaUL\ntLvxtN7zbc5fEAHwYkRN5PqpLLzhAkDO5SXQhWmJ3sz1VaiaEbQmefP7bIIg\nBiKETQZehulQeaFVqArI/Aoqyu3IqKJWUlEQX/iZTHNlSYNnK2VPck7Dnrc1\no6CurZRx2V/HEa4f33yI6/NyIJ90mLydKprwT4lqgY0TGNSb4mvrjfJ8dEzS\nUr1AcEss575X7xbG91a4lnijif15aSk6e6UeIROWg7Rlb8dfyAHtPh1JkV12\nqFgL\r\n=BAo8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClaQoB60uHFiwwqfLqRAGa2B3kylym/46FTLeeK9seIAIhAKZUwhpsdMOqtytjVXa38ueD8rMo9P0AlsyoTtCztFma"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0_1601650634335_0.05360058148827984"},"_hasShrinkwrap":false},"6.0.8-15face595b0593a78367a8ae12dd20088704a216.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-15face595b0593a78367a8ae12dd20088704a216.0","gitHead":"15face595b0593a78367a8ae12dd20088704a216","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-15face595b0593a78367a8ae12dd20088704a216.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-M7ivXKVAkDqMs8hxJ7iW2U7QmiJk/eEdT5kkw67xFa9+krJUf9sb2OszkqAZ6LEmuHvI+FOSFnLaeuEYvzuORw==","shasum":"7549fa84e0864d5ebecaaf772af540fa6e647f85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-15face595b0593a78367a8ae12dd20088704a216.0.tgz","fileCount":39,"unpackedSize":210428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCZPCRA9TVsSAnZWagAAz1cP/3cVw9VbsB+aTZKUD0gu\nDcyU3RSjwVJAMJyf0leHqIc2k/OI+eJVEvLPmu2M/7/vPwRrnt7h6hAPBvwY\n6Iq6bAcpUYF+wTEslAJM8X3ArFr00GggZTUYSkzzQA6fBXEeRihpX4vfPYZB\n8emme8s0XjroG7Uko8g0mT2wJhIiyjC+WQITyMglFbGbX/lu8FSXvzvDKj9Q\nXhDCVyJ5SwSlqffbJ+EDZ82GF3WV8YIKmxmGwwDlGCLyckP3RyA/zwuVtPih\nZKQ/v4kvezoQEdu5HJld60MvURzW7evdAZ1MVz4UQWS0QcX6vJXbp4Zvy3SB\nxVSNbthkFE1N42VrckcHsNwiVPC5lF+b7iePmPdfKPnGfpN+KchaEc5L3z4G\nsL8PEJbmPQflOky7vCqa/lxi9Bq4jKqIWbbLuclh3LRkM5GnLNVf+osKwCkD\nl/Q1E8iasRGDEKn1PeXKlqPcM+NTSPXFUNvxvchif3d89F03tikBXiQdzRe7\npth3wM9cUNafBt9UHv+uigrAzX0jp9/0SvFHAS6udymLuj36xaDmn36Iuw9O\nnfuFxp3w+XxrJcdmg1aFJSLpCWeFNnSUoD6U+Hw05M+ADptx9vEnUXEH2LVK\nb9lqdxIh48J5BFl84xp6mD7HIKmlLozoJpoyFbekzbsHV0VyaElDHU1y/Xya\nxDYO\r\n=4qW7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwgQ8D2XGYWhjWnzPvB2HOcxN2FyJMXN3WpsIJvGzflQIgaOfKKVPKWzzEjDSZanv4eu7x9uoudjCzBy7M8a+BjsQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-15face595b0593a78367a8ae12dd20088704a216.0_1601709646984_0.4799491209127722"},"_hasShrinkwrap":false},"6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0e8104f321063f6c887bba7ba63f2493b782f649","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8X4YbjKualJ/vl9ihaLgoi73+Px864O3Ugp9+kmOQw/cFpZASWbZ+ynGSnQgBXHB8FhGGCK6iRVeGlelS0Al3A==","shasum":"b30c6433558e17f779fabf3fd73be5b836ca69e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0.tgz","fileCount":39,"unpackedSize":210428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCaeCRA9TVsSAnZWagAAbIwQAI4LALEFKvns2ZCbu/tU\nU/v6RpwgZWZKzLH0NqTTo5gmsWE6Uc7dE7vvc/AQ1nPSzT45RBnBV3Tih4bn\neC0Dv1p3JLIyxvMRQgd8bPv0lP1Aa1QAj0o7IYdTVn/4laYOcv0VLepWeHA5\n61TzHLVOPeOffP+NbTfl9+dOt2zoXlt4/kuBn+hZJcGvcZ4HQweXWtNXG/yB\n8opI2ruspVIqLXTDwyvgepnQ41NMoiNFF5+dSiV0WMc4VWVqALVqWNHPS3/L\nMIy6b1a1uTovSS8nAxiqt6EdyFhxalaPrO3yS0DhBsm/AD4f4+lGz6cT/0AN\nEtImhgMyeyJsnzgDtZ3mKYAwWR+vc59i4eTaUxcqFTiW2Cx8q/vBc2kg0V/C\nBbrstsXlbDfvlfXGW9zLbsZyQQmtdqFYT3Pw02S94DZvr/m/ovzTiQuf3pg2\nlGApyKMC+tk3nLHENPryuf5Nk7dyyfSLhTWd+RZsU/BZQlc99c+VzRVIus31\nmAvxLWsz6pqZQelx1sm+Uw6NLNhD9OE95HYhyfZypNG2jqxc++S1KrX9shga\nC3LhbDHy+7jxsy3a5A7ARmi4T9oULXKttxjJU2SnjeV/R9f8vR7U16QeIJxH\n22rC2cgHVaywSaG7lnjDZXFb+G6OKdM213W8+xPlLL++Sv4El4JEdIPq5Od/\n924n\r\n=yiw1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9lAFN3hqysvQgPrTCvMYwIaJwSoh+uhkBPooJaDXRzAIgTEoAiuy5U/u1OtS3KqyvZ3ywswGabAwovfw2RiKxD4M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0_1601709726123_0.11433011532510906"},"_hasShrinkwrap":false},"6.0.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.8","gitHead":"eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.8","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BasKw8bajgQ27meBtRCOrQ8Hq5fLKR0g03gcA6Qr0z64rFI5T8IjWIFua5inV8dOZHIGRyTQRBJ7ePvY5JUMoA==","shasum":"7e493f22888ae3f382d7769bcf60c01c2dc905e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.8.tgz","fileCount":39,"unpackedSize":210667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCa3CRA9TVsSAnZWagAAcYcP/2V4szBxrUg8Bmo38pDN\n/czfFS/pHJ8UfZgcm95wOycA1TpatyuwgPhEGlZxhfrVoXTPkaV0cJrw8TGo\nE5dxaeWZkldsf4sj4+R3r8MXLhZo8yrS8a74B1l0z3KriywKI0bnqByi+Z0k\n/WSQrOEYtPxST9HcZPAzXwQUt7GL76jSpX5Yf5MlH3jMXuD/tzZz9psUVzrd\nSjjCcFzjMGu1TtlKta6KJNQyALZF7+4/tZ1Jb/Kis7XktbaN8gbr71xr6WeT\nTTgfB5r565Ei1poV8V5MUFsxJu7U0bdjHN5fAYlr088Te0GPTNy111TGZpcr\n1xb/DmqeXzPmGpzFaRyKqinVbPGI5igq6BZ6tTa/QxyHKOzpt+TvlTW5Cr1A\n7uArFhqv/zYDiSjHcEBGwZkgTJ63Tml0XpC6WSy+QSbwxlEa6deoV8JJBhqw\nrUsoAvVltBxgG0mhHr3PUr8oy/EumpguuISxrvE/Zlj11wmjLy+YCmjYf7gN\n4HzHnd5gWWfd5SvsT+HbFHCsvb70GxLCTcDK/Lcqul9McU6U6sANdSTzbw6+\nof1gX4nkQFX0qaLDigqipBgXV+on8uz9wEPYepu/vcyMCi2YFulsFLovCKZN\nM2YwZEevXtvehnF9J2HZJCKckJ7rF0fwQDQee27s2UGfb1BbJXbcALg3J0IZ\n+TZX\r\n=eiRa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3OFEX9rImxwnv/X7ChRf3Jc/M19uAF1dqZ6Wip8csBAiAW2rqAlwzBJexgpLjyIBkNay+EmTvK9AJOS6Fzm1Tpiw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.8_1601709751069_0.6120522384522806"},"_hasShrinkwrap":false},"6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0","gitHead":"ee751f51d0d588a5900b9556822800e2dc8cdbc6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NRw/BgOc0mKtQcfOJDQj5Bf3Sf66fruC+ZWbyDQ1m1nMMQYNC4oSohkd9V6+qsa50P8qPvLk8N+PAlMBdWxzoQ==","shasum":"6ebc210624c32ee7d120af3f2b236115b89087c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0.tgz","fileCount":39,"unpackedSize":210710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCbgCRA9TVsSAnZWagAADzIP/3hff6IvbVNwr8CDp2lx\nmPZdWgtgpJrxqybpYuMIVzZowK5uv7+LbRziqP9Fwxseg2U+Ioe3f2EyVM3i\ngz/RCEVOqXG2oY1UQPBvh2sVgIJ+gagrErzL3eYUAeqy69UVFZBEQ8UEFT8K\npvsOVjUgHOjSrD+WXRxXmGsQpL6yh7X06e7VTnSnccwQa3m73/ZhYDO9UmYi\nTH1+flVRUx5kX62Yd8wM/Avf+ZFd5kDzYN9inzRRkeU7+LWZBcWCsBlwrFvT\ni5nQgHZM+9hvKh4S4PvjIlSNt3Fu82hGIR5azeIxw6UIw87XmLb2DfAWrno9\nRAuUvXWExaKncy4yER4/1vpDuK927eGmFvuvX4MQq7XkmH/AQwZcGulhDLXo\nG109noYCRaKXfGatVz3PmHj7g9OKBHNRvZXPsQvrqe5zDbRQ47v/w7fnLT3/\n/Qx7YVQyIaFU1NsJEfefEA9VokPwULaZsH53KruTSuhAtCVvlkzLKIAALKOr\nfcp1OdjC930TA0x3bC6/xTBObUc89lHMTe0i7mpK3lWF/MySkFteIlnOBPzJ\naNj3o3mTkQ627Hfh1nU/Q0otPC776706/JZXVgeQPZIx/XlzbRHb+ILB19mz\nhwQFfLTxsneNUcasGVD+e07seqUlwoiaKoUXANktG7OR82+OHMlMuC/TqvA1\nCY8c\r\n=4Bpj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSRQz4aWUF+FPGDUY9aDZO7BvZp2ORPk4H2PTExr9euQIgcAr62BrFFRo5WCk4U8+ulnyV9HzgFZOyhQTs5igvi5k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0_1601709792149_0.1403398052632323"},"_hasShrinkwrap":false},"6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rU+S62yNFyxUvUuDim5ybRloeNid8iUt2pl20RnbQ19j7BPto0b32D/EPgERNLS2c2HvqBrb7jqcrmTFnlv/ag==","shasum":"7756dd84955f1f54b356eadeec98d2ebfad21377","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0.tgz","fileCount":39,"unpackedSize":210710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCb0CRA9TVsSAnZWagAA2VQP/AugCaFLwlbKfZtier4z\nyMJOjOsbez02LSJFwrSb3ZEpvVwxpaoe2AZiKMdk2OIT8dt7XYmuSJ/eZd4U\nwKmaFDUgWadxDYsV8AIG46mN9+pGZ2Hczq+lDx8Y2ckj1deXXM0mYRkVAO5k\nyhHUphsbgOAcyRxhS2Gb/extI/WjddQhJiRGwlxr8r8EMQjcr0IIOJsYgqss\nsKp1at6zdXQY1HOm68srOosRyPoOmt0FhArhbDc3zQWZHyqiqj39rg6tNk4c\nPe9VCCiCeFD+mi0aiOBED+R+xuXXmyYe95v9Xsq7p8Xf+7aH5h6RFbw+S0yN\nP3Xo77zb14sgQjoKlJ4rAyZNMoA94m85MsMd4DDrJ225ZOjoZSTnSudNikg2\n5DPplUXXPFtpVFxPujiJhr2q5W1WwScfmW6iuO3lSRs8DoWGFDJqyvC1SfUK\nEopnKz8IDMdre9jCcvSOVrG/pXvxizlz2vvoqKzZdQm4sQK/qF4+jo+z9BHU\nW2GF81uOLovP/Zan/RKvLdmDhA8ydG7ViMPmDSiQpSGY4dC0E7jRxKTi7Sa8\neah/YRb4ZKhd0jHPO/w0hLC6gsOdGY+3aa5ywg2e974tJWO0zXrsXheQrXA2\nKcZOd9LhZF1T1oc/mWjRUetk2+HPFjrzG4dEPfcbm2CdY9KDRKjo0T+K3qjz\noByA\r\n=mUfz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDueCPGm9K55NS3NJXQjg5lRl5KWeuA9V8f6UqACtaDpwIgT6cKzZGUi/EPiqrN0S9u6Tf6ncf415nZf6UU/tmGWJ4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0_1601709811532_0.15370069884666604"},"_hasShrinkwrap":false},"6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0","gitHead":"c9d4dcd3a4f9763b21babcc922559fc2fc8d545a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZvZDTCc7PkCECCHT9F23u1pnjusyOVrL/4SfPxDyv0T4uwRdnbBnpuslf6ODcfAuC9W08D5bL57IUrIShO7FUA==","shasum":"fe581c20c213c9bf8a503656892a54c9daf32d57","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0.tgz","fileCount":39,"unpackedSize":210710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCcSCRA9TVsSAnZWagAAqMMP/0iPPz6iTriHigEe28Ds\nJYfYbcTTUTj+LtW3eMmVQRa5O6kaDTcnFOf9CozQeueGXGUBVjonAVraT7FZ\n+Wa+y87sVKVrcEikp0CEiKiBCYAZrPX9RnEcwdfrNJxB5Udxo6VV03KU4tiV\nxAc72m4IhuoY3Vx0EvITj5oONymL/4V/Vln6Pt9M08fpkCtYJTr9sDM3oE2X\ntkKBkNKJ8MzkMAaUnw6jTvsu7OtXQD5C+Ti6aUO1lQnXbNPPbji9IX7/Iv/H\nHxKOvLSXWmYcCjgrRUSuKPhseh05AQyIPx5EhmZ2JURl/gqMZroiRzK+REf8\nPC3k72P52NePwwliMJxjz/hcxi3aEJ/33E7QBxj5jwrc8mrTLlrhaQWOceMO\nntPC/MS2jsznLns6KEXFJjfCpXSSgp052VJLUE/fLh/AHkVhXuybnHeM7yM1\nTIdisgtNJSq4KHl8xca3dBbByZ3nQdRRAP9JsAlV8Mehv0MDRmd5HDGXWVCo\nswcdiZeCpjbI4ozHcvmVlB1D2//geKm8b3NYIjx6NVz01giEV8MJMExKyRhY\nXE6pg9mAvamON7Lbke/78nz7uEMIbXu6hIj8zsP/crDl3YCBtyFdMqgFxHdb\nfEk5M1Z6ITNYo3VV6Z8o+2m92FlZwnjqk1x1Khw5s2sPDju5ZErbt3Wb59zE\neRJl\r\n=X2kV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBge/5uiOuUYBMcx88WBUjJFArTWcLCDwUxFJ3Omj9toAiAISeoTP+ERl6Wp4Kq7Us3meQ4UV58dnrpVJZryW74VZg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0_1601709842375_0.862238416499109"},"_hasShrinkwrap":false},"6.0.9-65f9f4207028b2373a7956d3506002f724302705.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-65f9f4207028b2373a7956d3506002f724302705.0","gitHead":"65f9f4207028b2373a7956d3506002f724302705","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-65f9f4207028b2373a7956d3506002f724302705.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-P46bmzU9PBCTjvn7mzlGJB31IC/DttbkK73QhJ9ohYLR7ZvbHY4xlg6LMHwUsWH+CYiBcngSMiFJ3wct37A7OQ==","shasum":"f4288d21345cd8e87a595c317f6f0eb055bff269","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-65f9f4207028b2373a7956d3506002f724302705.0.tgz","fileCount":39,"unpackedSize":210713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeCcxCRA9TVsSAnZWagAA1xsP/RIV0V3Tv8xf+g3EPXkO\nhoHAcpc+CteA4HBH9j7aneuO/bbfpopY4HSn//rOB7dmweNOHNEljiRckHCl\nvR+je8Lj6Jw74kXfyP19UPQDHFqHnRSPecP24aaPG+1EDOAn+oV+VEl9vlSt\nDQVyZKLdC7WVMHoo50499NxTv3uNqEsh4XsZzpB5CsPR70hgV8JXVMOpoHQd\n6Hsih0Xvis9bQQe89qVwhilhpwwmsKoa0SCheIwVdJcofsiE+aZwssJy8/u3\nLExGVDulnsex5dgGhlgd2sMwjnmRy2nqwDzuicy0u67QlJFsZTsRPym46sJ7\n5QYD0E9uleQxsMCxez7fopbSvz1dIG0SXeDb8qUTRHBCZdPWVBEcOko5E0kJ\n03EGu7o1kK5iCgTMAYwj0AzSLrhDZsVWOSrDCyjWTUnKfWoU7/sp8XePfXXm\n/vIXhMiHE2FDsuY//OE8xppRduJiNZgCrA1uR3gPgWb3lkGJz36i7BqdqDdE\nKXxiotz3vS3UG4ecSc3/8qYpsG084RrzhpSQz1hz6Ppyw+fN9lgxWZ7zRfgx\n5BmOH130nXVvvgRJUA7pF7qq78MOiXrRoLbY/QScD/eW0+0VP5/SsHGxxIKj\nApp0xxR0KAv4Kus7Rzinv88TJuzCeC2Plt2LBqHSCS042hrBlLNSkLlDtS52\nMy8t\r\n=X3PW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7zTNniJHJd7dJGmKrmT0EasOKBozYoDcBAwjn56t18AiEA/JzFJfoBY3Y2CA/3Ss6pVS2H0Gb5W9upsiNDA/PJFII="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-65f9f4207028b2373a7956d3506002f724302705.0_1601709873124_0.022081531553698408"},"_hasShrinkwrap":false},"6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0","gitHead":"043ac58580ae05c167b7b7ddf7e7d45e140c6599","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-D3JfANmFOjg+SKjfVD0Pn7Sr6Bu2dnsKjy+hCEW21TGaXYtvKQZEHBlhnN60R1llG+jeB0KA6VUWMFu47+ZJ/Q==","shasum":"6c57a575eafde86920bab4236588bd3682da0660","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0.tgz","fileCount":39,"unpackedSize":210710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0dGCRA9TVsSAnZWagAAmhIP/1dnj2Nst+Bne9GVVrx+\nfmSI8t2HiJAOQlhGCcZEeQge3yFK//Xw49OUX2BGlchVs5gh/iR0diuVsZQm\nv23ZlDxc12hlKVOCLSayEHUyxVYjohmEw8eBpsLPgNMicEdJDCABW4aU6JUf\nOa+jQw8KZWb8RRRR6HHlq8xhgeoMZdov6yAJfPLLTk7NizZGoc1R8scZMzqw\nYg3mblx1WO3rNOsu2KBz9PWWsAajcfB+9fvgv9vI+9OU+oQ0eyPIdbYfF9GE\ny3Dd9tzE/XyfZfUOSZ6+mR78Rgwm+i7shZcoksw08c8x6mJ2bN+xyrLlJgUF\n21XS/tc0/xVxYMg/x/D2LGK9u9P0i6s+pSPc57uMf6XWPewFgl7FJoIBIO+Y\ne73aNzEGX0saD92TZFIgaDpvHhbW1cmplLT6TgpG/WE3eMK6eOsHPJcFA4mj\nBLG4EwWpJ6ELMyoJxRVsJGGvFzwhDM3ANz+/Xk9zDE7v5/8Ca6+lU918pU1X\nAHz9br1xx1MIVK/rge5jmTlEy3cIDRlXejfTiBE1G0A3xmphN+TtyYBcxgnb\nX/1XTQvhODBsK7pkGaOs0ib50KZRbkhbHZhAFaRUs5oHJqzVoODoqCKpFkNl\nm1Dz/dm6+aBsNjFmlI024RVQMu/d0FXL3imfBLIocgtVRQdx/2IRjA+nIyG6\nkLIm\r\n=ktbc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDbtKfUAfuzz5vtuSMKQ0pyrwzEhHkTUkDBHv/sxoCTwIgFYVsbD7ZamvzDIBrGmlqpv737A0OFTWFnLbRfDFTl2s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0_1601914694073_0.7766467953584661"},"_hasShrinkwrap":false},"6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e66183feec4e52b3d4b9d2245e403503279b4332","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Y1rtJyRTJ4jrqReOd2m4pKHK60rjQrQFubBQzPJP/E2ymdjgC3Y/GDSQGUp1eZBU563ousrGRQN+QSnVEyJJdQ==","shasum":"d531f376cd3c5375e7d0f8f18cff18ccb440b0e7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0.tgz","fileCount":39,"unpackedSize":210710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0enCRA9TVsSAnZWagAA3ekP/2LCRQ7IO3Oa4axrYxcS\nEdXGQAjRkO9CL9jHmnJonWpasv/Vaw5FNs7zZBSNeECSdtYNDyyBnhWRzirl\nTvA1DbL0kuUq1QJKTBeId6T0pzRskJZ7dBlGo084Ah0lDYrvhdI4CBlgoykq\noN/pZ3EemJNeiUHcW7pWh5GqPsIEFzKoQTu0ZZviNBW6R3grJ79QsZ/HDWv2\nPfRHSoS0Cd5hx9uUYowvciWKdhCJZCUizgbr2RoB1m//W/6Dr9Gtr1iIgjVX\nP1P3xWvjLIzbRBgRnlQtG/1hPI54142ZOEwQtBG/I7z7QOODzCeIfBx3rTk0\nPlpZrjhMiSE7HEFYsh1afY9cUEA36gBfVVvxhrp6fEFvhQ/XSZEdenGx2hsh\n/wn4Afjt//+7JkZlf4HsW2hlM/BAhc3b7V8PZn8JNI1T+88590JAMcMAj5xn\nThN0N272dM0p/AdxfPeyAl+15d5+zlXAVTmvSxfbOLlalHCBtL/VVqsG6UjC\n+vYgPRgtF3wzBlid6mjxVLwU9HMu1LhYhJG97PKRJ4znw39I8P07aEla/AvB\ntyOKPciKfod4YCiykPzKNlaE+SJI7fbKuFZK9QLj/3iIXRIy9S5N/PD26JY+\nAwXQ9Jgp9/c2yOvxfFicPRmFFa64eOp9QkP4YGw2QVUWPeU+s2aoczslIi3e\nfmtP\r\n=7C0Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBmgpN3l19jCDCfdqs4q03rAsB4tOgGlTn/3HPcgZNQcAiBpVwYN9jv0HN3b1tTv9OESTH8GRDhht4KQ/sECkRaThg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0_1601914790381_0.09496182357286731"},"_hasShrinkwrap":false},"6.0.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.9","gitHead":"c6effa7836902b1de4fbcb3436809651de464be6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.9","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0/776u7arEMVudUcZa9fed3prX/Es8KqdKaIrCbCMKAmSvxZ3RE2KTJEYGYhQFkQ8vTYtX7W6qpLC7pMEBYiFg==","shasum":"f6507c64d9de707fd1b89f8f27b4ff80239d89e0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.9.tgz","fileCount":39,"unpackedSize":210939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0fDCRA9TVsSAnZWagAAvLAP/iDPBumPmT51bpPmqeZ5\nZeGthuHm/O4rFEv5kpSZrxHyvUqJnx1V2OzoplEVgFwxQkQcbXy4cPT5sMjA\ng3DQENBvHmenxNtFuhGpYw6YNBxNEVy5tIJTOSbYobnkvQu5HkNloi+fIbZW\n3DzT6cblZUuARbAhvGYcFfSJc896vDw746O7iA1iL5ljEsj3vtK/IMR4rViR\nlE97ukZffsvdXQAoZwI2Pp7WeDbhgmvXQE8UiumqwyMOPNG50xQMxpKOsg5+\nxO7NgRyM9m9bo58YNNtEdstoirH1IVAZ/UUl0V2I3kP5mVyun+/6qhnpjziv\ngQLYaTb6fQUSfpEx/rF6qWao373mIT8AAXLBkx7e4iUosJW79cNx7QP3Jjs1\niHU+xJc4bmfMFiv1OdlDypKfX/+8kn0aDfZe0IMFwGjrjKXBCOHWCZYfxxQY\n/0/uQ12XoDuBdeAeVVE50asRXd5OCpToir0GOErajYDFtre8AzPQtA5neVmL\nYiIJrMRY6i5KsIcKjFElOTV+R9tWBWxWc19RP7bs3t1xEC2Wb7tT/k+jgc3g\nicHBiF+Uu+u6ZgxgwMj4i2v7TytndigUjU2znGvy0YogBTW+uLwfibW684bC\n1T06PVgfyLqK0C5KLgS21jsjU6AW14O+ROWsmhcJe8Q+Qq3wQssunP7LxhDz\n9558\r\n=qEMN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlNq6Eps3HIiAhL/9v0yUog5hUAGmZxU5kjSGqtQrbyAiBiH4cqO0NB1H/GYGqoH+YVtIZp9OXsSxMqfnLVgWj40A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.9_1601914819211_0.9003006033764622"},"_hasShrinkwrap":false},"6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0","gitHead":"b3e8043d2009f641ea0efdf78ad5ec02dbcc539c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-GLKUInBAWP1deW/rEKfipLFpU8DilGd/2S8dWH3ZeWKuajj94Trp/xOEmEBLHT123hthLqq/hWVsWZFGGvWqhQ==","shasum":"cc797cf787012869cedb8d5bdc19506c6a19e06d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0.tgz","fileCount":39,"unpackedSize":210983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0fvCRA9TVsSAnZWagAA1wMQAIfSoYi9e+oqVKbO0Zhi\n0t7buUCbX/nYLNNbS+mplPxyxwnYYva+7mcMv1DSL8oyUSyR6VSO5UkribJo\ncJWeX4XutiDrKsme9NakG1d+goY2hYWHPF2dtUyALtaKhjlW0xA5ffvh7rs+\nlnN5UhQum4D5kbra28/9ItxYOLs1Q3hzoxoQpMrqkpfUtji9Hp+cO01Nr49P\n7LO8ydWtqiUUv/mC62AQndbG25LvOJBktlsGK3BosGq0hBsI61jrezmDkga/\nsGzpVN4ZfLdt4FG1eqs9bPrXjDvEGUfzeKLy1CR9X6jNBfz7s5eBKYzKAi0B\nTM9GA8XY9lVwHc+6gxuzPWnipPNIRQIeaU5TCjG65tmf7ECBm5icZ6Ryg6aP\njWa/RsoUkNl6DgJ945i0fQ7SF5cFMefd8eq50nWmwGoDL9C/AkdpdU5O/q51\nY8pFf00IFaPpfiSCskgep5DoHhORiB4RxLcwHL076lnxDOzPGYE5WcQL/6mQ\nDY96cNhf9j0cyBw61QjU9sj0wYymNdvksfJz+smIbTn0Me1QYELEqhCaXj+q\nXRhbuii2fNELz3LoxWC494Pu4d/s8vLtpShHeeRCBIo+BCQSB5OOsL0LB7sK\nHGij9gL/OH+WE1n7wJDdtS4rctE1Bk3bZTxIQsT87mfNDJAnvJm3o4HI3UP0\n5069\r\n=x8cL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQuqmHXhh+AX3gT+DCT+qfd4as+yhiQATwK9LVfGm7kAiEAkeW3J8Lq4QC5e5GkvQJzHPwAE0QfZXVAL1X2IgeNYcY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0_1601914863310_0.8136526528150649"},"_hasShrinkwrap":false},"6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c6effa7836902b1de4fbcb3436809651de464be6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bNCFHUAdLJQpR5QU8x7X0WEUo1AFC3VzkSbJvhSVlJlbtwJ9lvzFyv9ys4kuy8XTTRSRt+kZpqg/OfAKV8IOuQ==","shasum":"212edeaeeee0879cd6bfeb561a305fead211e534","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0.tgz","fileCount":39,"unpackedSize":210983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0gICRA9TVsSAnZWagAABFcP/AkiyRbwv+EMhnJFb6+E\nuPiDvkaV2rkbGJ7JjRVtSy/3LPyi4Iq6osFo1WYk7SB2kw7FxpTMxX2tiSSL\n3koi6/ht/GiorAkFcFrOJbX+xVRnL9rewyGO8sy9GPaPdg8sRCrD+SaF936J\nmjk2SBKMdl4AIiNiESR53n3OU3JClVII73Fq5ASXVuOwq6YgVtN919esiIjk\n68v3td49jgBbNROL7i2XPMtX/ZmPiaeyyik9UL2hRmIbVyp4Ujfmo0aBV91F\nHWnlza4w/VXdp/LM408muMlXb47Nwx/8ua57EcGrGX8IuO/mMLIa7dqIEi/A\nvSBUAbTUO0VdxmcxHRRRtkzvBbmoU9IVBl97KH6WLYQdpfGQDm8OtdGq/c+t\nsYyL8VV0Xv8VNx0+N4h2vKR/l3CutZLKW1jLUmnyWJsl/7MYkdNzaIFa3hiB\nvIp11qlQaFwLXUnJzY+NbtoJRyzpPIaf27b9v7dwG+AipSFhTPfQCp3j6sum\nV2VK1s8IfHdin8lNHrbjF/ya98AkMSpF23zNNN29iCzcKVm66e8MHgLycUpm\np9Ozy/Q7E630pEvU8NmhD8WnkS0Thk3XrX4Zlg5aaq2ysIET2VlSoA0jGkSe\njhFZqlycvFnwFczcAgYcOnx83UTve0HFrQ2wc3nmVjNNG+mL0UUfaE44JuS/\n6mwV\r\n=9zTw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdkOyJPZXIIlW+bpgD0v1tAKiqL+tOHJLM8I8yYVzn3gIhALMXdOdcIVZ/1N9Bh0ZO2sPevRfPx88l4sa+Lt2W7lTZ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0_1601914888183_0.6093421867384168"},"_hasShrinkwrap":false},"6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0","gitHead":"0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Oaz0fJXQYBwO7LblyJlFG/lsCnTQrCBaigiHH/rSbx/pFhhjavBLF5U+xpPEcLJd/OEFVxJHWoFKyTdWUJ43mw==","shasum":"ac38e1b7408d2b5068a9b6854ab7d4a5e1336ff5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0.tgz","fileCount":39,"unpackedSize":210983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0gnCRA9TVsSAnZWagAAhrwP/i2Kmp079zA9gNusR78H\nCCHSR9Ha02L2PL/v9DT8VCB3k7nCLVWL10M1s908X5IlrRNmSJt1ZuhxJJ9Y\n7TP3e8SmyzTQTbjUkqqPyxFn5WnSsmkeQGwuiFNRxYDXJPAvncjP0QHDhEnY\nlHjStIwtxTlMg2e/xkL/qTNmBxIhXH/WjMxc90C76q6vfMaieLdkdPyp56iM\nLAnggmc2S/I11kZ8/RMEevOtNxdye11ZpzAWHfVNNKRbu30SbgzGfpLo48TZ\nG6ZnvCJEeDml+4RddAslm5YqWQQTrpI/J4Oo2n/RyxlofvDglj8VLPAqTaaz\nw/s86QTaQZAV+2BJRQkLPh67p1EMk4v7wMcoGzCh8Q45Nf8Z7CXjo89+/1FP\n8bknGI2oG3CTu4EGUcySG8HM9CBQuyxrN3jDlSp4wSi+FsnVS3KAwThaUlVv\n0Ui1rSKqu7n2kei6T+tNFJEpbFWTl1eXvO7NU9GlooUm+bLijtwf7joiXtMV\nHx7w1qYjmjnVdk9cJJZG4+EIrXM4CNk/e/V3wljuzxn2QCpsP4PPuGtRtC+9\nhRqqic1x6RRn8IgU+L5Ps1EXB02f8ntvfXbLeD/Uo/bPqYvOcXO+m70rDe/c\nP3osV7fWUWQeNMxoi5beVEdHTdJo4Urze/kPUooZxMKvGydujb5r4ktrCmZ0\nKjBo\r\n=ZadP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3sLgiQaOrVltD2S8Tw9i0be/tHUsFo2rsnNTFIuCM3AiBwj72TcIG+e+mCLWCWmXuYZRfSQGsEu1zJiYK4e9/yyw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0_1601914918615_0.6633527655444471"},"_hasShrinkwrap":false},"6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.2","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0","gitHead":"8f853141fadabc89845a633d53ea8e23b482e8ed","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IgZa9pY07eGefmRt8NIygm5FPpeDaQgfewqTc2SJyguiozJeNWOLnzuxjw1c1GN7lyiatgwq7Qj1hOFxb9w7vQ==","shasum":"62d9ca4aeacdffba6f86bc794b96654ceed40b2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0.tgz","fileCount":39,"unpackedSize":210986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe0g/CRA9TVsSAnZWagAAMr4QAIC1dI1+Q+dLyAFOIlBF\nfA0+al2jEkhFi9xA8r67XjbzYX5zgJMZ8l+KCFjXp5DaftJmyHEco6K1beW1\nXnD7X3faPfyKCeTUNXqq3OYMW7pzELOh2jF/Vl4SuTHY+963KYWa5VZSibt8\nSv4aQRNps9jgtIkwuCjJ7j0EI4a0E+pNNOsOTIGjiGFK1l6znqw3msipTQPf\nOmcqPRdRc+mcdn14eM3h/RywQN7Fc0NGN16zb9cwyRQCfshP5dSHiFXIFdLl\nzCnDS3hn5Qy7P87xXzEBpyDQmqTtC1yT1/VqCuUv3L1GzrsH/BaaFLsOB6Mg\nGidbFBE1NjS8eOddsyzUot9dSLu5if4Bs8xIPeoHl0cCPysqW4Tiv9XL8bmD\nfnjXHs4lQ52LwG0AtHzO2/81B1aO4pXZXHtDQ2Zf+RcjgPO7kzW6kGlVOV5b\n7XbyTvj0ZlSbh4J5ohQFTTgMktocMr4IeHFRCotEJXqAIZJwaXt8IrGGY0f5\nVQqgln8OiP1G5yfosq7KK/tUCPSyw+pmB9z/j2XddBEq4PzBfezixXfTv8YD\n6j73SIjHP61zOaQ8lx1dfXWWB8RyYMiz6e41uEDgnkdS7LIGYz2g39iXOa1i\nB3gS5j0h+1RJHjW+1VgWyqHYNu4RydTd0N3/Rynb0vcn83+TvEfB6VsNPEBc\nGugk\r\n=2Swk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD5D42aZnMio8Or19aTuXcoO3GqYE11/3nJscyKpslBQIge6UyCcWaS4nm6K76aSf+VDuXh3nwy02/v0aVNOTJxWw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0_1601914942474_0.021273651708753505"},"_hasShrinkwrap":false},"6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0","gitHead":"ad2843894d2dc1c93cf77c460fa3a1f587be1e0e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PthiqWrvhlwHpPlASRnTRV07fSZq5IdeuXgPq+qTa1SJbGaLbm9VQ4dXQ0hGBJL71m2Ine2y/eTfGOoj6UO/Dw==","shasum":"f470c18d7ec883df080d59eb92d0b01d41ecf667","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0.tgz","fileCount":39,"unpackedSize":210983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIVeCRA9TVsSAnZWagAA98wQAKBa06eun2vkS51DnwsI\nHKrulO7NVpMtz9c9aRGPNdSvhB1S09DoSxlbllqaFnlN16JCJyBCz4te47zI\n3lRlP8txhIQTx0xAijFy3NneIETvyBYV+FG8sqYSB3b95NUPy1F+s5yEMbsb\nQwLAFuQj+SayCvqHX7It8WDFcYY/gI9SR+gNCZfp/yHtHmUW7b5j13emMxIV\nF8OBCY2rKVCrCb9iKKaCC+LCjrbcVmHoU3TIaHjkl7Y7WeaNwhtWHsnWA+S0\n7yy6dtAPzJanTxxAYy9dKW3nwv22gfA9zPv4EgQDUxifB4lU9E+syX6OsYj2\n+slEm4ZWMUN6djYP0rhFgW5CZ/9dZO7UMpkBgHQXbv/yoY0YDf5/O3rLgrqk\nlxFDFt32W/fKbcrppWBTVbc+fPVtm9elAFaiFLmdKu05eeE/odeyj3KRGXtI\n65DAQxgajwIOn/e9JnDzMeWdtOGtTQIybBApHz46A7tXN1GpXslJbY08td0b\nNMkeLS/d77zq8Yt33KxxC4jfnGiCUstPeJf+mqomSUxvJX1WGSfIMkszdxY0\nP14vTiNCL6a3aqAFVAfBnx6hGF+pDXMwDkHI7FkutHpf8LvEGNHoTykk1dMb\nDw/K23ZSEzcJ2WV1eVahryOPLc/JokaVzeEUkQPmmH3fDr7kgaenpcUxkXG1\naUx7\r\n=fizi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgkuPYnsofo5Buw4h4Wo5x0k8Oa19AwCprC8l7miw05AIgFS8bmQEhYg0YPX+qe0vqhckzqijGN8ToT9VWyHhldBA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0_1601996125667_0.17718808435986344"},"_hasShrinkwrap":false},"6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2b758fa25340a36455a552f14cb11031880d1844","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TqmOPPkrh3XXcbLQhPv1DdIFUMN3+Vhrr4GzU2Nvje4Ah+fM+HakrBcHPwXRG5ZtoIBAGYix92v2zbV+FXoC5A==","shasum":"910c9db1ce10c5d3f6219dce09e1105dc306ce70","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0.tgz","fileCount":39,"unpackedSize":210983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIX4CRA9TVsSAnZWagAAKSEQAI/YhnEA619mYC7UIuCq\ncJaDyrjfhWiFaZPuxP7Y5wj7D6srOyY8d2Hr0EnTkMhnhZ5AJHP15z99rML6\nlaARxihcjj/7sw2UBtxU7FnEoq/HY1vVuZmQEbRwGaa7bJAC8z/S81phHRMl\nZmV5Epq1/AM3xgF9aMaWTYiedxDV0uHGnyV+Z9RWZzT2xYPdGNeRoukgIjIo\nCRN2rC5mvQH/paJ/RbJshA8U2+/wd6/BQaIqGboKVxuvctNXbpSbcYKd5bIo\nhjv6OicgxT2V4jiCY4EoH7XZ1byrRlcXpNlz0nLJCNF2VB6nBE+vtQTqpDyq\nlePCuhYc18Fwf6Zpr/+405EV65kEreS/2jklzilnRCHMZdhYEZIjmaM0Fr5T\ni2DwbNO8h2nY0xehTMgMeWmaJ+UshX116N6DT7NWdc55Y0fFGi5PVUAgf/YN\nYPoDNpcJI5aak6lKmEcT/j8Pl3NFARuucDd2cPnJwUNz5qi4dN44wjxyfAtv\n2E5K3svfxVg/lbJSnRpSrByJMScZ6DpckPCOki1nu8fXr/y0b5XQeGBfAOyT\nUKI9idr6kzB3F/e6YhA2Afp/FB+HQtHgNGUFX3OA1vAXjPiG7pgQ5CANbor9\nznjDqJ4ugPZAMC2NE+UKnL8bL7EuPr4TAgUf77ZBBBnQF/yxEsjuokgU+vZg\nKQo4\r\n=g2TS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+kfCZb91S7EDTXmJ9Sj/tMoR45fVJUJQzoFrohE9ejQIhAKmvFvbnqXr7wbg8SJaIcJtXLGlMcW3CO/Ez6eEJ0Nvd"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0_1601996279869_0.6998329070902423"},"_hasShrinkwrap":false},"6.0.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.10","gitHead":"9deb10f5eb81108201e22cf4c2ec2bb11464a8c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.10","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-LAFNr9lhmYIW2UW5aFtqAfBTidSNSvvCWmP6seSoNP8OJpH02aeY/EGbntUC5L0RJ7GQLvgIP0Zs0acXc/ITUg==","shasum":"089b4d1fb866b3836f96d2a7679e0d1a014daf8d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.10.tgz","fileCount":39,"unpackedSize":211223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIYSCRA9TVsSAnZWagAAK74P/0swOtDbJBchi7oUE46Y\nV1D4jL0QPTY03B3bcGflRuxQe+wGD3ndg26oMXKT3J8pzOr7otWMc6RLD3w0\nJA4knJdbTshY+HnTX7eqG3i6xzyCpxK8WH1eDa86XFrA9lFO3CFUhiu2YxHW\nKaSx7cpoT/C2oKa4f375bpxidt7Fbh0RHMtWh4FisTLHfupVkBbwAOX+2w36\nFVvoHnD5SsAGRelTluWic6cJD/iMCuuYVgvn7DegHGg6QFQDeHLUsSuo+sj5\n/fjm6AY8SbmNZMIGjEz16Jn8DNckyCLe+4PrNlHPWxbLY4iCN1Lr9wq5C0bJ\nWZ2uXgVMd2T3lGjD9F9MNmhxm5M/0VM8U2dTL/TN10iV/Sdwje9IKc19wUJH\noU0C8qqquHawcBzDaTG20hMycYit/0FPmvAjnPoRC3MrScLG9V2kx1TgyL8e\nk1UkeAclUc1kk7DU852Yhj/1iBIZChBOGjPoixhCy4O9vrxRAfYu5l1hQjfv\n/sQqmqXMm52FNI7Nees2F8MIx32vcbQervAo4NkMzFf1bLG7LgGDiQ8Qj7aS\nBuRIQ5rVR1Uv7xA3l+794ebDGxxWEE8US1khdnpBthI4oCP8IbzwWrbanOTK\n5Dk0r3f1KqQ/d/HxgKjnn5yHwoIIqQG2TztBa8U3TKSKk0n0ymadh4k8pERv\nguXn\r\n=g7oi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH11ynLz0wXp13rXv3d8aktEozwma4URz9FdeVS6+VnkAiEA1xRMXKljHB3WSomSYyvvt+VFZmDct0jCg+lts8Q4VoA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.10_1601996305674_0.4255784335706838"},"_hasShrinkwrap":false},"6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9deb10f5eb81108201e22cf4c2ec2bb11464a8c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lXfWMf+Fjv8T4x1t1SzKgDEAGqUlOnxNEbE71yU/J9qSkz0wBfvE7xAImDQeDuC2tuQu8FMcQ5k1ku2PgfKv9Q==","shasum":"30a2c40c8adc06f0a0573ed3c87a90dbd0c5ef5d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0.tgz","fileCount":39,"unpackedSize":211266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIYkCRA9TVsSAnZWagAAgfAP/1kdyksM+Pgr2Cxn3n7Q\nroxckcDmGWby1X1ExKPYDKTNDWFbKDCLxUIYqMB1o2RTAojC9/aviKYkpVSd\noqZA8s5Y1bDKlEyq2u33MSrZC8txk35R7Ma6HdRRbdeNd9VL4pAfGzGQrKZT\nx0KHY8Um1VAeaVHkzdWj+s6Yeccj8feA57x8wMRHg6SDMePZ86qlD8RuOFxb\n+Orlg5DJ1ysoHWbhsIPiI+ife6m+dBVVNK1X95ov4v3CLJ3HF+RrL1rRXEx5\nYiN+7GxN0jqJYCA4xCwidNBT9N4yk97aixUa52paGZXNJIcqmmhpoHDH4vwo\nUhKMQMc67YtHkkvAlwxkjXbC4CxamjP7HDeU9DF28iV2GJriI1KuneoWhx14\nZHlpNXBt7q29hFz0ZhKDgsoRQevMw8UmfpGdsHrtjfohgqzGjgm2LNXckzZi\nScM0K0GJpuZ7u2KbB0H+UPKg0Qu4s5trKbKV5ZDzc+7T3lqaWkNeoauUfAHf\nsS6pyI6cWgE6A/nSqEbitNGl84A7PPwxTwc0g7ZU5BJoFUhqcGhLfKF/AbJB\n6epfrXQsHjwEFtCOi0qWQw8Xfh5BLIUWzcyOSdff5HOdrOR5uPSkKIQOjzvL\nmVZHh/qatnBZnCscUAugo0476xBc+zkZWPF3oyZ/VDjeaY86W1dYeO5JtcPy\nljAf\r\n=lm6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNknRcCjJMnrMKLQLoTAXJm4slBgVLWJc26NdAsmPZQAiEAvjuC7XMA9LRFq+7yxw7W0vdJoZXYOneEGwZXxJk7tWc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0_1601996323992_0.6382595178596979"},"_hasShrinkwrap":false},"6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0","gitHead":"aee3a0447711badd2bb3ce8c94882ea3afa5d1f2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6mRNDZoljW23oP92dTeqdQtnPaxZVBHfb7gc36SUghqQmGYBYGWImNhPnn+gZG3TpxTEbK3T2nh0mHgYHDrPhA==","shasum":"f6fd306e18473c04ab854c6b40e66d0195b58443","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0.tgz","fileCount":39,"unpackedSize":211269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIZACRA9TVsSAnZWagAAQ+QQAJknb5RX5NQbPd7UU/eK\niGvp2EG0MjkvYRiqCCbw7ULqyMCE+mlMZQy/mzWxwL7OEfoshiXrNOZdJapK\nYzqIQSSlYSFmUQBOGjdQiYqLUfr8/B8ZvG7qAanz/LnJTui4KJpdEbgyNHHI\nmJPRB6V9zfqI6kLydT4+nQx1yidF/VF+2Ie42M2wN8oqqy0BTJFU0IdOSDoU\nGwjMeFNESdslm1Xp1sS8woFprrAFvtbAwt8UI2mAT6Xxm8YbFUq1NudHj78H\nNIFfQyVxGoaQ13jjb75UnD3QQzWIhbNnH8XkQsD/bfHv+Bmr1TTGdblh1Xwy\nKznGvD1ZxE86lxogfeEcLFRMj8b8oec8XNqOSaaO6v1xqjnzA2u+kataaE57\nk2HLnt24Rn5fO836yLdaa7Gd4F36HEnxoHbyaxDXHYqcIXAEg++13ymA585G\nc565DiZyiZU2kaQQYZz/AlvmwgLBEQGbqzd0yUc7qfWUN8zG2NRw+7aNhv32\nQYfE/uvd7QmLXNFpssitYPMO7UlNb1N+d5arPiqShoqpvI/92Z5nTRdOnnFb\ndI/eYQrugzkpqmsfGOjjpvE3KdRjqlGGxjJ+FdtYwsqQNKDChNMkYJTbkId1\nLM5FKRPM+KWSTxT9GwA+YB8PrLef2osYou72tqJRp2zQMwC72HZCiH+SuvoC\nzsPz\r\n=Ndq9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp4XzgPihUn8tJdq/A7VJSps6NujTCEKe5UI7VoGJW/gIhAMEfPr+o59CbqbnK4rVZc6fOxbl0ppfni4Jek9GFvT5+"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0_1601996351853_0.5642673931652122"},"_hasShrinkwrap":false},"6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0","gitHead":"d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ObZoa8HFKNAk/nKh1KGAd7jASuILYe/Choayr56TDuJMjUR+Tx9nREtDzbV1tgaVRmWXjHZ+JmGwOijVJgbWMg==","shasum":"baf1be73d669faba41f634175411bc184c174fc9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0.tgz","fileCount":39,"unpackedSize":211266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIZKCRA9TVsSAnZWagAA+lYP/2Lb1Ru0EJzvZNqdt++S\nGFIGVVH5hZNv9sk7Qme/0alsD9J8FbjxjyR0grIII4auq1aT6vKQ87v9GRnX\nRpGv4vtKU8upkS8qjAL2lUxt/SvV/jTr3pN5XcU6XriR585dOGyhpvUzjljk\nC18HjvWkX2sfrchXueOXrqSutFDA/aMrWNrgNy5K77WQMfj3pcc/yKIFPCXa\nnbBCHMF4medNlxgGEEaObegRJCCUEn629Z8t5gDvivVxl4EB17RqpCo0batZ\nxwzBWjapRRXnvdIiGfJ3+7e5n8DxsR6DOsr3k2rKguiC0LtjhyOBZJsxDEuM\nqt25D0o46Un/bzA6wTeY04B/uVJKAwn1N3rlaHA9YdXyZKbFvgjV3z+BP+Xn\nxBhSYsgieQYBSJeLl2j9koBAPxllPv0ikMISQ892xXxnFPiNQaNgivGXyDsM\ncThe4fQCcVG4ATrYSBasWCR+3GQxC+uh+bR3VuSL40GLZTqhMDtj1SAgvlfJ\nMwNZk7W2za+wtMMHZnALNR5LeM63xCZLbhMlXXB+uRg6UsWhdQKiP1nCdTDp\nb75nD+P5kIh3j7hOulNPQXXX1shebos/FSPqTMkB359nNVqYqECV2kLMgpe3\nMX59phqCYDhrpgI6wGOEsHo6ebO2IUaPYeUIWHc8zMzZg83njBLPsvRFk/+s\nzO43\r\n=U31N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFd9+f/alTM59budPpJqmK71NhetbySQbkndkfdOkgWTAiEAw01n+q7LTUs1zwHb/U/Hzan1j/CHxVEezZ6fmOmvtas="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0_1601996361545_0.6874286820954012"},"_hasShrinkwrap":false},"6.0.11-95be94001c016d510456d7407b7842211d93a298.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.0","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-95be94001c016d510456d7407b7842211d93a298.0","gitHead":"95be94001c016d510456d7407b7842211d93a298","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-95be94001c016d510456d7407b7842211d93a298.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BZr+mdfcn3CVTwwe6GN+Q+Fq4vUQFDcd9RCY6N7gjy3bE2CDTUxbXdA06UJQU758RKSu+2ykQL5S/lzwJjcCTQ==","shasum":"e57d602b543529d5c075ad2f60e014a79bfdeaf0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-95be94001c016d510456d7407b7842211d93a298.0.tgz","fileCount":39,"unpackedSize":211266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffIaaCRA9TVsSAnZWagAA/OwP/jsaIu/r85mErpm2pcgd\nDn+7jP+L62MfOSKykLNvpQXdMee5s9M0gVeN4JqAOEV3mulSMAhN9cnSowzC\n6sE4kJGDJEgS9c40Q83u4siptq+cS/sm2VTGzxWuzNaL4+GV/P5efjIlIOo3\nD72aWC6sFI+6D8Z948UKHoDh8KC6INAO20/jJnnsmuq95LBCjitq9tOJBuyQ\nVo8QMC1IscHMNj8iFygmsgjrtdpiA42ca8Jhjk37ElCdgCsmpzEwK0Ozg/jA\n0nv1iJfvXQ7d3HOEUzZWzmEBLptQZT5SiSw5eFggEOdc45Cabt7HQnUbWXWt\nyDvQ3q1Df0Nr8NvmZ3ZWrGv2bFQQ6T1/I5oQ0x73esx/Ws3+PmhpQWrVih8Y\n0NIoJzpNbgBnZ3XixjAA5SmC2a0EqVNsfdLn2A/Y1EM2rz1ZrilYs2XNTLUb\nuDyeBysloWT1SWlq7k7Ll3KYhyEhFy6TdDKZ94J13pbviar8h5gF++pXf5vK\n4fqAiRf2nTKwL5v3gyiuJCvKzJPAQkK4hWn8U8huDy49Km3IVHuv1u7LBG1h\nOQrCW4UswaqFH7hE5hxz2FTs3wt538zswR8HdZPSuYDBHM3wH5ba+cc7QwgN\nytnbpG8jyNqben6gs79cxnU7YawgWazKcr/MgIsmHndaPoKJbWi4H7WyEpQ9\nIb8E\r\n=4BHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6OED5/VpeNw/+wdezOsl5Wpouk/WOVis6+3R6L3eMPgIhAPVj+yKJcqZzrdvoG/Xu4QXXZpSEjlAn3G7APechiS+Y"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-95be94001c016d510456d7407b7842211d93a298.0_1601996442297_0.25934844363656384"},"_hasShrinkwrap":false},"6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0","gitHead":"d6277c846ce4bc80b252e971b2960e7e922c941f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-x6dH3LD3oYtTXx4FSErcvZd0VDO9Pk0Qwg56dDxbvGbEHMbS6NyT3BZd/NfXQrZ48JS7T3KyY5Zqlf9X1zlP6A==","shasum":"4c273f635f48053ee6c8525a406d45e74b3a48be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0.tgz","fileCount":39,"unpackedSize":211266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffVqtCRA9TVsSAnZWagAAjG8P/02nb5eyPTb/um95yIUq\nPxE5xbgPkv09B82wnej/LI7/vfpuRn+pjGji+H71tQclvsPn2yf8AmjNio5E\nYn85C7e8tj7S55Mht2EyMl6AuRzwxhvcMGnGZ9MecJOy4h9mhqcw96nWLeFD\n4d6NloOBQegWfTIpXxvyAPZZH9vaJJIkpFyNyg1HtDeVO4QgXsZi9ke1WSy3\nfhxFRk6M+8IHZ5fjEElrOYgtvOBRNjlNbLhLn1sK42sFJJGZYmNYGpPa2VgD\npbDtFgZakwx97RUdadDbyCYzfXiqcwgWnpDIzu84LEkfRseWMWtfKq+HPb5p\n/wg6Jb4CM3xdqZG0h5BUIfYbSJbO/Y3J5qWJGSYR3sJXNcB3YWwNGTcm9iP4\n0B/SXO9jSSbUKBbMcFSJE8C62hKKP0lJ0sFiNxT3VywgI+7V386Ktkko5mkb\nlHCtyUy+YMPFYqxMMQ4HGr7hdUdNaBv6QR7GvvyhudlcFwkeVVIsVC4rB/o0\nnJdF5DaXxTLFcclHT1uN4qDnBmCyCI2c3TV3q3TX0jWawHS7y0AvOIn8MEue\njy/aY8dXk1EIDCo4e0FgL8MC6wlMafWcxKzi7N5UgL+tFqYwJ9JTGYrUtwMe\ntRyEZqzqO61KhWpHMNYW+OvVYKSpHTe14VWPkKib6ly0goZGAFYn7N6cz/Ie\nRaqS\r\n=8itF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7+kZokuvFwMDhva3XN2HW6GPXYedxZ+io0Rj3FjjgiwIgZotCoz9+JYsTg+cErV9SaZH9lOHEOP4xl7wgnj8RDss="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0_1602050732665_0.6794439231130076"},"_hasShrinkwrap":false},"6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c5d4690e393c679ac4f2035da5488bdf187fb881","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-zueKheRt89g9Szzw/NqrZJzKV+EazbIsAQeLPKS7s6s8fX4k9Us6GWhFYx8m6NzxFieOS6TRalQStC9Ae15ijA==","shasum":"775925a80c30ea6ba84e8e4dd9902706b83673d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0.tgz","fileCount":39,"unpackedSize":211266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffVsMCRA9TVsSAnZWagAAHB4QAKMF2HR/7D5o93JZ7VWZ\naFCtHq6VT+sIDKmtCMqsT03gwT42zfvoWOV6jP5dvW0DY5n31EAJccKFxvSJ\nkNrrf9fKxDCznaC22OBZ0p+n+V4mezcVLhwislh/aFtqd38nsn1+ZIJE1PKH\nAZ58GZNvIwIe/h2joCgSqsatpXTHzBb8YCHJdImWrskKEJH5DeHaWSH+LSAW\nKjjJh+xL/h2OuwIa9vQMh4yddfvdH+TThBiAeCCLy/DfMsE6cuLQG7u2/rHv\nN6Z3EfC0vo/SyR2vP07gsEeuOtuSJPxhQTRCCZirXjPdaq1ydeXLfPsKTNzw\nQ4yvDO04XdXbaSa10y2S9l3znPg9fsXkHPjEoOSCJ/hWrqc4LSftfIk9dnPb\npRZjRf1Y0Nk/bEd03eV0pUBxnMmvUNI9sGV3P6VP8btP8fJQWGETvvIFG6c5\n92ZecWDI5UFcTT3H5n9eZzlQMjJ7xuzeA6kf/07E8Z1D6cL0uDQrzTep952S\nq5Ydlup+V9MU/OoJOYrkQFS2ATIj2nGWNABeHx0NItRe2FzQYMjuBEXtbnzJ\n2xoMkgDGWJNZvc2W9+LrkL+8t3sWJwIbdsFyxAopqaKE6Ej5qH1hGvnrE/eS\n99Kgh9+hAvGk8O1sEQOtKPPapUgIFhp4NvLtBrNprKY5L1+6joAJvZyW/r5t\njeMW\r\n=FuD3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm74xBg6cvwltOeLDeRZNY7IrFeAGN9ISOVYQRcFF6IgIhANgofKbqnYpYMsY47aG9UJRGv/emwMeu8fBQUL34iCPr"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0_1602050828348_0.15804587068237508"},"_hasShrinkwrap":false},"6.0.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.11","gitHead":"5f4d45aa288e30f2025b87b5e8b704b0b153bb7a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.11","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ofx3VPlLnR2itIpDo0U3gGQceMkmwarM3EXVuGzUOuU5h3sznf68sU4Fkdkvzd4IlkHeGEhTqllon+OTME5jqA==","shasum":"19029223cf97c0fe0ca369f557c6d0161b736a0e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.11.tgz","fileCount":39,"unpackedSize":211498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffVseCRA9TVsSAnZWagAAENcP/RnshenEEaCz2iGk/nLL\ndbyaj5dXA+cefddXdhHy6L86tK8sRIEx1ncS+8aQpqb8vbfrpLNX8eXW+nS6\n7oo+U5l7n/+Ilf8vCQhmLudFt4xfoZhQ1B2zQwijIod8bUY5XfCPgWCTTFzu\nGUM0q8FwhiI2HrUsiKH3bcIRDbSY+oBcQ5VLPriexdP2flCLDdJIYuCltQPX\nS6jC5R5UybhKfoV/m6dqmutDL+GNW3wMXalJ+BXScXH0KUap1LfeTX5Kosl0\n4tAWxKSQD0gC11GwBhP8R8amAG/eyj+jDYCSdaaHo7eu0+/rIfGiwUc6IX/V\nQ4m/T4oO/9lHJWatr8xabqN1KQIKdvlu5oEMsRmp4rvScPhYMRSvqNUELb/u\niA/L8H91aV5XaYbuHi7X3alTwDVa+J1im5uJiKyocRExjNzsnV45qL8GuLqx\nRXDOPpy1WTwrBhWIZVJVYx3FusC/TEigxbk0j7nNsX6EygPFhneg97mkcoh/\nxeXWG7muTVUC01Npe6pTIfLR/JwGTA6LnC4dCaDazMJuk7F7c2yQjlz34u4M\nHd32KBN/ECsq9w4OuLwTHNI4QH/DiCdnLU/bIgoDYpJkO5tjQyxUHaNVsTUr\n/o9NeGT69xm7JvVz1TNreDsGVbPWNFjUJHyZ3bCtJ0W2kjlvjtaPXNnWDgOl\nPt9C\r\n=LwRp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcGOMXrAbdGWrh3kC+jVjrP2f7docybpCnKKnZufnjwwIhAMxwnJhCvuEYNnIolZBdbgHJZZicg4HTq0QAMI0928Z0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.11_1602050845819_0.25797367308750285"},"_hasShrinkwrap":false},"6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5f4d45aa288e30f2025b87b5e8b704b0b153bb7a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rpRYmcsVmggxYm+ra8/fc+WRPBh8poAfqnomWRet+RTYgkFdyLUqEx3EwND7qZLCvwiqKAaKcAEprGOZKX7QUw==","shasum":"8c734c46ac73983bd35c25f60468a5eb2f396f51","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0.tgz","fileCount":39,"unpackedSize":211541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffVtCCRA9TVsSAnZWagAAePwQAJ3iPEa3fnXFyexX0EwW\nG+k4vE8GPY2J/FPkd7B/AtI+/fOiedMrFSzSIofOkmZ/fpjGBz0YAAkuQgRq\n0vA0+NoEkWc0bd8XdhlVNxrE27GNujAcZFRRFR0NXGeyZlsjtCEq9UKtwkl8\nSnqlvavWPhxqHAsnvu0uYB8H3jVZdABfcgCWgbavOgn8g6PIWNgPwynCGMHW\n4iGaMpXW4WsGYCPJ+6h7JH8GPjkgd8KpKJz1jE4kRBlgNdXXWmjJodzIAX4G\nBjL1wiQi64rig7jpMhBBM1O/MUX/2GvOSEXYwATb687r5KwJf3x25CdQdpNl\n9qGmOwq+OzR8vrjPcu8bwXdIuIx4q7udIR4/tVeLqGMloo+0pZ2j2EElYx/q\nqNa6A9waC0Rmc5/CeiCNKy+SPwnY3MzbAEg524XmSYYlhWoSQD2dOIaV1Ijy\njQCV4FOU3mTEuR+wSeSXJiFN9kikolXsA/1J3QKdS5cWIvguB3XCJ1euaP3i\nPjLHD7Fx3fwFSJ/uZag3YRGJzRL68ZHtVVj2LCltcaHXD38YMgiUrfJr93oe\nKy6QFpe3/f9lcUUcyYCOdmHN2rkMm19mdVLmZC96mib8MJ3SzT4e7F8d7Bk2\nTL8xJpxkM9Y3/FJmjHdtOk1LnOluKVJZLYkk8szxPQTv9Yki4a6FjvREH28t\nkfNH\r\n=1i+b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAqgLSW5OjmAUebnOroho4BaEa5mskukHQ17Ncqs5Cd3AiEA5qLPw8a2tZIzkDtdLDE9vUok/BMT+cgFAvlVWWUE2LQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0_1602050881747_0.6567512272429519"},"_hasShrinkwrap":false},"6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0","gitHead":"74939a768e748be50edc937207f4a5f9ae15684c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-l7UdjVJIvxjxPCn5NIcDvfKZwY79k94w44lT8UL/+puBRnaTxMX/NqSyurDK/9/3xqcHTlJEMr7oE6ooBAhX4Q==","shasum":"486753880a8978c07e0c20f5928fc54328481c24","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0.tgz","fileCount":39,"unpackedSize":211541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffWJUCRA9TVsSAnZWagAA+HsP/25e3hCgRvL/rfKO7SHF\nnmk+wLQ+ZYN7D4HWfmFO79e2ebDYs5NBBrHWVFjRamxGEgv8h8rG62Nnhrt/\nCk0b1uYtHhxeaJehpfg9LPKwn1N2AR9KxWA3nIQiiW7xCqeo/0tkXfIMkJJ4\nuba7z5a4yAT1cJlmgYru06v16JnSMT6RxHcjUl2UBtYOfDB6jUYY+QIhTKQ1\nAGE5NvO0NmtxqtNZY0WW+eprBRKjVT0bF6USfVy7/j5qqy4B2OpMK5QcxyFr\nDZPCuayUpbmoqv2eKP1IwTOX/hpH8CBe88fGfKad/OXJGhjPO1UknuTKasjo\nY2zSNmYb1SHFC36U3JrmOJ39Uh1R5wHc9U7SWk27U7WDaSLkZ29DC7kf+BFI\nGukf1qi664noZIv/F8bwIBdEwTNwE2AR8vf5rIfLgv0dXqBHJ8OXpLdNDUKC\neMdDajPDfUr5j0700+fJKJvSCMb5OoS1tEFS1PmOmOFYJbAM7mSShIsYrkni\nW22fOHNCsJy7d+BW6XT67IGzm502Cp+eNakNWmxn21HdU27ryr41CLNPveT7\nCHm4mGSeleiDMnGDtq0v5yiYJDXgfI7KgpWdOm/AjEEMhrRqQAC2OYRuS2FZ\n68Zmn0GRxepG+CoqAji6H9sowjb2erpiZkoafuabWSpPUHuc/Dg7SAoioQEm\n4UQW\r\n=sXUr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBe/ux3rlhMMmszL+nDIVc0jm7jA5mWz5jN2r9mPKHiQIgDkd4zw/3T4lpWHXatgHaZDlUhMySczu3huyDyAMj4S8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0_1602052691355_0.12643169911011976"},"_hasShrinkwrap":false},"6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0","gitHead":"d839f002589fee15f6e05bdf6098f852486dbaa9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PTD2+skAGz5cRLdS3qsXtmh48xQLHk6HHXQcCmR9E8I/UndKAY1R4q+0fX/iuZGuMSsr03nBVBvRZ/z5Ol4hXQ==","shasum":"3936ec38d02fc882b1c2a5e1022b08f32f684db0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0.tgz","fileCount":39,"unpackedSize":211544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffYxtCRA9TVsSAnZWagAA5nEQAJvpmKs2wQ61s2edlx/x\nkKYG4KCdYjryVrRpWdgeKVGoLfyUCsvpctaHgQGWmHSyiEkdRhqXgx/JcnNV\n7v1O+2jBFMPlh24quzMfTQm7LrpJwsu4Dshvb1Gwsn3rMZKFgzYIkqBVm37M\nL09CjbgdIk02qAMvug39SxWeOu421g8ssaIIgr5Cu2bz2ZtGljzht8Cwq8Lr\nRKLf+vdAoKEC+l7VjqjMv55ST/AWpTI9mP9xNyz8Op5VKve2dc5wJ1JMQqEJ\nmHh+cpTm4soaGIumUxPcryaqhpkrfQJlpUxW0XVF98Vj5sTCyin7AZweacBJ\nWP0VSf8Rvl8taeC9urIToAv2XjGUW94YIG+Ql1TGDBHsoDwyOrDMLSPvpRmr\n/pG14B0565NKUqTZEpRYXfKeUf5xqnqsz16a2w4Eu9QviH9A495+c8nYqthv\nTeNgs67iBrhzq6P37g+Hi59MFOc9SqS/fO5IFe7D51jKsLfrSxYLgI1j6QCY\nj5/iU09PoxBCVrOVzxBwkQFmF0PLiH+kLxoTisQyPYdZFeaTiUH4LuDN/wcU\nNjEP1LX3459vneTdQmKvaxZ4IMLhevkLpkAMFF7d+VF/ORDVXtegAu9tkik2\n9XnaT0m5C6MixJgugN2jJ9EQxHUK//0Iy5J2zOkwY5QFgtyFxANNq94qNsFi\nHKZp\r\n=dhkL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICk14RE9pWx2CS4yInsfPMKmb2tO4+hNd/rEE1D4kfmfAiBuT8z7NOUQaLC2f7Q5i/uVUzkMUg6jTJ1/UFvM6PCRiQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0_1602063468970_0.2326256512462206"},"_hasShrinkwrap":false},"6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0","gitHead":"cd178ed4eeba69b48a96e31d7a50014a52b0df95","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gKg//OOl8PC0YOmg3gkqmOm4AHY9QI4A7YjEODNiA6nrzmhmuDDkSVIxYOCMT2MAiH5zA8eNfsOvd2z1wqMYsg==","shasum":"34d5541c3db28f5eb113a3776eea3d128918dac2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0.tgz","fileCount":39,"unpackedSize":211541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbEbCRA9TVsSAnZWagAAbj8P/jTMWIHEDgugKW2AQw5g\nyUDVtDPQX84R/KyRym8MkyGZ+qtooUrCTjhoSh4pcC4sAj5NpWETRE7+owAQ\nL0HhLE4zlRGfyxt0lpEbA2tcaGT48WJG03CaUnIE6FThhfSP8OTjoegWYzXO\ntujInChh1vWBsw7hfMWm1h6rRezCRNeHCGwsoL1mtXJXN0WywOgTFIQK2H7t\nwaZX8Ms+3xS22PfnDwWREUDWhbvxGrOC7Q/W+pFpDrkbMKhADBDNAGsTojH4\nCR4tXusddlUNVbYxNO3R+Hwy1HQpZOU24qVl/Wpt0Vh9qqEESpABeybrcFLG\ncfQWxl48CnxO3GowiVjn+/XHfYCgLls77qB84JwOuQXJWUHH1l49kdWmGM0Y\nl1fDYgC/y2lGdqo5/t2IZ8ydU8LGd/lpxSjifWgIAfp1dO6MnkSyAVE0rrKB\nVu3mXEWFBQAu4ntcvmbSLEqDcjqNQJ6JPq/akBDcfIaUz1WY3ResQapW5+U+\nq1HzONSFaBGE8CkhJ2nkmdUcLG4NFdoKuXjZBA9xrvEKCWVZfpwFIJl/GEaQ\ntXHsczD0zvf8jSusedUUJbKSn6D/cJ4ZGCoXBZobyKc0M08GWa9JMi11SgqZ\n22rIQuXDMIK1lE848KMERLr/ZaPyVdkjpdhYF7LwBtVR04xqhobsSrxrBIiC\n9r/c\r\n=APsX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0DSxSLuOD0UqqFH7oi/0Nlgeo/CYPImPTSxM4avXxAgIhALchtwl7fmJQLNXh4Rw75W1aTxgBJTgUo4Sn90n0pJA8"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0_1602072859136_0.4895904401122113"},"_hasShrinkwrap":false},"6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d3c1a6dafc82db029bcbd347dd98d0b23c840093","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-A7xz9ewKqPUBTQHU9OwxfdVCoM1odtRN73FpH+b0lf4SUGaamoXUB4g6X3jtbrGIRCqycfREgc2JcKjY4XOocA==","shasum":"207e1d246f3356a624e07026b1478a505d0f57b4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0.tgz","fileCount":39,"unpackedSize":211541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbkzCRA9TVsSAnZWagAA3zIP/j8q99cOKK99NUv1085l\nMBX6viUSQJ+ek2IMOkiEdzU28EU7JHNDEjUO0OEe5nhASGpE/5OlZIrKzgmt\nfrVobzXp9+z2WWzIBBpyRn8aCprcHP7phWosSTxIVKHvrg3WxagLJgI0mvxE\nzT53LjTMLphUobUEJuUZ8AJT7GEVMTNukSwNKCgjwPQkaWh9ZDxsHXDqORYz\n/ODtoI8PGVe6bW83PXdHEjhvfacuv+G8xK3oV9dy5yZaVgW0uGvuAkGTleU5\nBxGp5gwq5jLDlI1RoquHCAs5exSwCr+kAij9U7XBhLS53qMCxZlkKntH3urL\n73VHp79W18L6KMoi96j0nL+1DtmEC4w89xAAkyIdhiuOHDfKOfAQrDK+vlcZ\nb8w0+LewJfvZ7QhYxxYGASbOZywhOk6P+pKyOKH3ju1d/5hSCZgyCtVkoJex\n+M99WjXP0rN/klFFQ4hfhzUzSfjqr/A0j8TR1BVmCyqiHTyOloaXgvpA7rDA\njWYnNLBxhZJykQcGupmw/yLKwN2tyPywfRB7doGBm4GFSBxY6raP46pdaUDb\nN8eU3T3+dfzw+OdcdFNGDKe50edRBJhumcRB1Ye3OJ/DIdZVt/uEo2suwWPx\n8KMIR5aBNvXFSujzhqK+UxDZLjpIPOsigtMEKKXhoCEF0cwnxUv+AN06UjpA\nAeul\r\n=J+CV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+bCIApXj+vlTuvZt7usSVrVuhjkP6vN4HPXEkcArsYQIgPTuaprj+qiYA7AQa0RL5pvdrutl5KBaa5l6umbxKSAo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0_1602074931256_0.432094064126358"},"_hasShrinkwrap":false},"6.1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.0","gitHead":"bfae3addb0a6402ada56e936c7113d9252f08ac4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-afZDi0sWK5FTNJFfCwB+EeVd2qxNgR9dCn16QqU6ui4A48Dha/YVj/BImeXU9/S0elbTu65NpzhA28wGV6NqDw==","shasum":"83d5be9fec2df717ff2ae11ad31343dda08683c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.0.tgz","fileCount":39,"unpackedSize":211757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffblSCRA9TVsSAnZWagAALWoQAItJUfpgYRoNYXTZl4hN\nM2eT3F9Ot+wzkspukMgQF2NsLpXnoAXTpvTELFOzugpfhjJE8MLLLB5UhCa1\nsopqUsYibB9fcDk18t2GjCLmR50fI+1eqEjBuGtiqpKPMBD44gOy6w+Pc12C\ncZuC/0ZUKhRY3Ihc3mfEp6oAfZM8eRSirXlhxUshMLtcLTQ5nHzZtcsBmMxW\ndRsufXBKiAz8eSbBq/p0w1l9nhb6pjrj7mJBITmrNX5VlPw7dEGOd7b8MeeB\nBPUGE/nVsIa88F7DZXySdII4Qe8CMrjQpPps9TMqwqD6Io2S8tfLRM/cj0Yf\nzxFdEMPwb63rGVjxqVR0rwQAza94rYw1gI0ZjPk0TOJOf2DljvcXbRfbTxDt\nxsZNw/bQrAOYqmWx7HPNaxE0oVk+ETcryz8rCJ1SDHuRTLB/Wl2DCpZguZNP\nzsnKw4PbCusyOHXEJJIT5bbcRAfxUEQkr9Xg3nGWHFGkpw9Ul76JUGubWdVM\ns7U9MsnvOxXenozrkLzCj6lWVAyrdBiMFrWIMC6WuNy5NUO96ke3sVj4Zxu2\nc47+EzRF/Ug7tIuPq6ixgdN0UklGA8jTgsgQzDgZ2PXwPtRg3SAtYPUziAwK\nLw1/Ce8csWzESJ1ff6+5cU0Ni1gpT9Ab10EGArZwngHae8mHsbgOSJ/nGkID\n19dy\r\n=DVgh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9C+aIH6T1qQHyGY7sKnIug+R/R4TvKcNdT3vFPXnfgAiEA24Myd773IezcM2I1C+cTb5mUM1WbTGo/KS+BBJsrpBQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.0_1602074961656_0.25469844426574895"},"_hasShrinkwrap":false},"6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bfae3addb0a6402ada56e936c7113d9252f08ac4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4VkeYGnh+dBSyeWA0HFLhwbl4KrfbNOUhdEP2vpzX2x4Cg+xtm9xhAMX2jk2hqoYGrU59e55s+7XzmGsEU90Xg==","shasum":"76cc8a5d88ffe0da329071f7c8c119b558fc987a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0.tgz","fileCount":39,"unpackedSize":211800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbl3CRA9TVsSAnZWagAAoa4P/1Rk+TJfobdnKapYWUXc\nmAt2Mpj5K9Yg8fXSEzqSkbkZPGZXftnW4i1/5yDN59iiZs76+O/auvH7Xp1X\nuBcmnxfy83J5JL/DswG1XsPynBZlfAC3z1b682xTHcXbOjUs8ZAaElia0Lom\nSxVSK4nzQoCIZABm/hMh5axUzR3eOHXwn5dUO7UbrRxDk568ALp3V0dDnJbt\nMLRriEa+jeqe23ScXqcHZeH2kW45peGOyibPtrQnTy/9tij5fp0naINpVwfm\n5xAgPrnEaLSHeiX86UbquqPyrTTV04H9TJRfjvoGBAvUS7eJcIwoqeCDLv58\nPrI/PpKX2SzrPiMeZSW6gcUanr/vYlvDFOKHshth24jO3r1Vwakd+7IBpfXc\nMKzD1ktYON15KPr8psJbh6Py9L/Fj5lNt2WaL+D7JZntl1tmsg61pkIULLIO\ni0cV/8FILTcTdlyFRUuC7TAUuHhtvJWWVYPI5kwnXJiB4YMQgd/lzLRY7Kue\n1SNeiIYkDml+jqhFgxufp6+S9u0s7UwEPj4nK3eiz4vxOxw/1JjTwbImjTzH\nLV/2frUBmNf8R3oFwP0SwPuEc1F+9TzoID8+msBws8fhEaCNyM94mED46T38\niCd/h57o7XwWG57f0SI0HP2T1SALnGB7/Td0N/AqIJVPCaiydQW0XtsRrBfr\n0l+G\r\n=0fdn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXuC/lF/DaUyipzImBkuf62ruBtMpZ3vgxah/5yot7ygIhAJg0bdDrIflE6AkVawb/ert/r5Q2ksOvrSi7H9QcRxbO"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0_1602074999090_0.04080060671725527"},"_hasShrinkwrap":false},"6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0","gitHead":"eadc0ee8691d3542376382cec64e93ca25553579","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3V2yC0KLHOBPiFN92pjJYQO3mVJWonmYs6qIjcoCm+TpBb5A6ayC8axoRdVrDWJTG+UBFs1+sgp30cU656qcAQ==","shasum":"1c3d1a14568c87a366c53146cd733cabcadba4ff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0.tgz","fileCount":39,"unpackedSize":211800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbm2CRA9TVsSAnZWagAA7iYP/2e4GfEn2VbpgG/nnnTM\nSE8Rq85mqtOMUurTfXYus4Cj5n60WaCe3cgcvXZ8elp6h+eBPkcOaZleZX7X\n4g/JGtp0yXFS5EdmlOzIBSgRuL3g20HYtvfpIcnLC0htFgjN81dGikh4sNF7\nJaJEM94ZC88ikugMgFs4QjFGb++govUP1FuE0bu333LIoTIWL8wcHAXVkHYm\ndpzadpMeGKF9uNZUuzEA/6eDXp36kmnPKFIarjjyAAti1Eruibu33ztvh0pU\ngd0DhaTEnXzPKdwogom0OZ2guaM2sy5U0gpSGocvGp8FapdkzkJFGgk/9E5O\nTfLcbNO8SRKcZ8w65Zlp9cpx6z19RBHPoT6f+/fGn2iHGEjza67TJcZgDRGE\n4xZtteGHexjVx0VHSkzZnhierED82NYPxRSpfT9Zfi8iIkGc1javXc+ecBYr\ng5UqJbRl9hqLWQzJzV1HxHZ0ba655tpvDAv3vxBVS/bH/GWWopnkSfKj45wx\noGZtGIv8hEfKWzY0UBejCOXUyHe91klJbsf6q47RVYJcD3upyV3/Mthbb3hP\n6wHWwzOL4hw+ArtkJ1Xo6TMxXjYzThJ/HcgSbWFA5VDRfbdUe/MrrZS1Ga+a\n8TR1dvPkQfRRY3zg5BdRAlXrGUGLlSfAGpA1Jg5IL05aC5t3SxFXMlB+UXVV\nvNVf\r\n=o9cP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRFAxgfJQkQucWZqqFrWyL46xOdXOUTm5zbJs6BbcjaAiEAx+xtjUuO+Zqv73DriTmx2dEcjaFlw6X+VFWoX3PN9do="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0_1602075062269_0.7135315652717897"},"_hasShrinkwrap":false},"6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0","gitHead":"bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wdeqIQU5sv8w+dpndzO7+Wxc8jK8F9XCf1fHOpPMOULNI2Q1WHPEh7xcb/liYnvMhksv/JUG+kyW8qN0gE8Pkg==","shasum":"eaf4f628625f5d8e01ac582b576ee80b50adf2c5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0.tgz","fileCount":39,"unpackedSize":211803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfff8cCRA9TVsSAnZWagAAxOcP/38PLgsE8810pSnJorZ9\n3ZZMJ4L72DbDnevrBSn8p/9MOibueSjfaMr2j8p+xuh/elhRTlazym0Ncy8V\nsC1ylmDxm0ltBK7Bkgx58pPzung7FoURH5M32xMM5nIj2dIXVdrsJDjPv/Wd\nMw9pP0x2fMhURqgpGtrjIl6jq946kFYhkwHs1iKfoQcZto/wbFynrW7dR90i\npqrdH0U+7vtc/K10eTRtllHnJDIC4bgP6dfqT6h2pmATCzlbBLvpRP2infoa\nj7COZP2we3K9fRXlBnlXPEoaBGnPi4LKrS9+stBJ0V+mwOqm4ZiV3UPAIgAx\n+S0UOILpozJtu7frxRMWf7UqEZFKjn+KFbjY8epfRI6ESikP/pOboMus4+8m\nigzQm0NkbAcEqhaAnnXO5sgi90tdB2rPR6JQmYMLhrsJXiq15R5WRbaR2YCu\nC1CpztPz97EZZBUXtLZ3M9VM1feiDDGcKVNXo08VGiyRGUU+0nFHIBSBQ5/R\nUr+c/0j8KLb1T75PZpHC/2bp6s7Hxxkeiy7qZqK5IWy8xiAX/X3YPKuDdvZF\n9GH02I8uub/UOwG27DgM5AtcAWUscl3+Q4X2PaSvYUTlwog81vkdDdYw8lL2\nvFU2WcXzCqXZyzqOYoRGDuD2hDGImHIGcCzUJpus4RgvCNgSaZnqupFRcTBZ\nRGh5\r\n=Yrnl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYdgLLUwNzVyHFuaduIk5iqeyxCmj5cHIDYJjsjZ9ajwIgCwooh9mJq0PKbFeml1sKOuIw7b6YA9NlcV6my0LF9tI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0_1602092827407_0.009478663458394099"},"_hasShrinkwrap":false},"6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.20","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0","gitHead":"6156a8b4366a92f1b71e6aab00deafda1fadfc28","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UmWQPlWN8JoUC6gSdSfltXYBKLXRKcYr2QgW1ESNEZxZJ+qIiBlho8oXIPqMJTwOwSh0N+BlgvjahwXdOEWNJQ==","shasum":"12c0da891c0f0be4c5230feafc830ff7fdb8b4b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0.tgz","fileCount":39,"unpackedSize":211800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffwGMCRA9TVsSAnZWagAAjP8P/RIFCw9uTqaHRnqAajDr\n2qHyTCgK4I6+HNrzs96LSEwnXTwAuOJK4IFk8S2vc2gSaphDnYlV8MEzDU52\nPyzG+flUTFJjzxONegRgRY07Bvv8NkOvRHad8xfyyVhAHrxLB2poYKwpqYV8\n7o8VsEj/Y0lGXtqzfb4aBRUxWQjCdb7nh01ZSL6quSCLgyHafj9Ll9zZ88h7\ntrksIlMSd9IF669pN8pXzRhMPTeL5aKQ4S+W2MsP9jBzhV+qUSLIs3TdMqzW\ncjNQA8+Gxij5E3j3gQlMv72+JxkhW9GHZKB5gI4jEsamTir5AWnZ2qo5x7pE\nRx12/sq9+OucvDQg3bArbVD1Fb8hc7WerF7vneeBto0qlBNf8v2hbIk9DM2E\nzkOsy7XU4OWBFnDW8BGycjrOf7OC4u9Mmx2uHxW/FO+t8/WygqFaxy5ASmDK\nCzosda2zA5TrgpKpV+g8mbqMQMwuqItAMdLhDDAyXiy24Jm69RV7ntre3E4o\niqDdvb9L+j9t810wIIHHF9fGM1H3NkA/+33t1Fxs1BG8/cp7bKXTacTpzVdT\n8hm3WzFHCPGpbOprxkofR5vnGUpl1TwGQx01aRNHv7f4fMMnMZBqGk/TyA4Y\nBsCn1eez//zp0HuhreLSx7WpLXUddOUE9mfnk0eblbYdzcVEC9rTnUjYWMkv\n+ljZ\r\n=bCIG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZz4DbhTJ/VI6Iw6BphdvSuCDhvbAmGyU3mLj5gIleQAiEAiqIo8lmHTfOf9TUTpf4q+OJEoxtyxlfCvcXgu3xebIc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0_1602158987517_0.25465844824211303"},"_hasShrinkwrap":false},"6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0","gitHead":"bb7ea0cf3147459bacbbe85107566e4476c7c166","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1cs/u8m2EFd6cN86TUoeTJBYN1kggd5YiwB14tMytx81IYAtoHymFDDhQooQLiaEYhhkwB1y4qjGZddYfFtVsg==","shasum":"9ad66fa653ba2f79a06792366f05635ee1d8e5e6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0.tgz","fileCount":39,"unpackedSize":211800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxp/CRA9TVsSAnZWagAA/6AP/3ssYui6n5htT2zT9zYM\npWhowqXzLJJohY75zvr3HPXOMhqJLAs2v089aRmPJvdwONLCGGumJsBlTMHc\nhq013h57XGaPDz+QIFx93/GtKfN41Hd1S7kK54eSLPaK2ahTJg8md/iT9zkn\ntlo/8AIG5sGGIEUfewWdqlOUtBT3mEGUqT4Ohq2TEzq2uHtD3lF7IzNte4I+\nORRQ/ui5YDSADe/JFKVpBrV3ermZyy7MLEx1DLBph6SOub7OChqT7iAyioLb\nKCv1r+yt8/uC7b2TlQYM6Vmg6T9pes3nxa8F8EdnLx8x+DcRAhLLSO0SdptT\nphXpPS+OviF8C/RJGwZNtfOBlCExOzWUbQN53+QT5steaS5UuSmXeo89I93q\nmXMxX8L6Q8R056TWlHwhAy4oeuHr3sKaGKZIsrzBvbPnIRsB+nmcKZWIbmI4\nT5xdd4hzt4XJDpoWMJUn5N5yXasqkDpRg1kQ8BuuZ+qmsx1H9opKRQSeZwBB\nTK6Jy9pfGWQbccfXLmjlkIDHE1u0CyWiVdFvke5WOC7Lis97YvPWt9ley1O/\nqvvHgNjWpOmdEOBPfG/qGsRQPDTMHSBThdaYsnX8yCl5dD2Ob1kndiO9kWvk\ndqlGAvZQrsffvBKmuDFGJYkqVCqOFwGQ9PLfOKSZZWeoEJ8kTKeoM0Jj7Pad\nOtRF\r\n=9fgK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDh/zTvhsfcH7b12UXGxoT3bBUGsnJmR7R8JwzkUoe7nAiA2ngOgiBrNJTgtQoNNXvWdXVMpBzlfq+y4lrfdvY2PNg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0_1602165374245_0.663275038482906"},"_hasShrinkwrap":false},"6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5491ad11232358cede5f0abfa7bccd2a916cbbb3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xF/ilmE3wGXC2I2fscPse1670OmWoPypud5G/lGjjbxsoyOluTEuVKtF231MbuVaZY5GjNJKqqZDq2kzziq8IQ==","shasum":"ba0dc3c4576a2336b55393908f2b4577a36f8645","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0.tgz","fileCount":39,"unpackedSize":211800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxsGCRA9TVsSAnZWagAAEn4QAJgKDSpMfpdx4DWBLEHh\n6HUp6G6Er4R3DzlGHyB+xXWOsNhO8KkWiDakkPXpF3NlkAujGL87xlPmxGRg\nqYNDCqyeTP/KUTh2humRUMSRLKFl/Ao7ISjyIn7+xaLAhXQoPcNMS3ui4GEB\nD2b3tW6dHDjWKx58FBHHzbEG9RlDwm8jXY/DAFa4UFyTGS3zO+6YOBjfDOT0\ndGUPW45RntnGNm9BTrY6VlAFns56RG4b2WImEu535AtVRUykNb0qlPsa5TOG\nMYlspWH4f7EaMQQtrDKG/7OvaS0iQeZkpdsgRrz3bezhfU7V8PimTvk/Juby\nXGphWtUnFXrg+hUDVlAx8sMUbWQA695z9vZFR59Sw8rEpR+nbaZ6nfnO9JeU\nTWRpnUrhOt/9ejJk/15B1w5+3dJAPbsPeseoYu5SJJUrMP/dJa5xcOP00th4\n8NU5BDmES3KyqW92DRZ05K5iaaYut4M0Un80DI66tRlK1JnAihw1a4bKGolW\nIXIyBBHekRzjl2EOSZXho87CfnCQ0dZ21CC3OM+Edl4fSAgbIzg6sr6oN03X\ntt7SyLH+rIeF4Ka3QOQMp3CC0feo5+8PUpKwKac1gr/ox4TrfV+xS90WBES3\nNAP/0rOMH/BZUNq7KBmUqdOLh8Uo99/wVo6Igmoin12ItsMZqDTs8xjKgS9X\n5Z6V\r\n=tT2p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYOXzFrW/vegwKUnm4RmoyiWWfcJUm7W6OjcMppdH62QIhAJm3M2im3yC5VKVytewo83Dy3Zp/DkXtjQKaO5k0voCo"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0_1602165509892_0.9350792858551993"},"_hasShrinkwrap":false},"6.1.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.1","gitHead":"5bb196ad5377e9bad5cbada8be7295ee8fadb6e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.1","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kgeIfqx7yrF7AQKEE6kOmTXpeWr48NGHRtRiDm1TActJdxQ797Vsl1PESDMMwVI+ZeV/KRCxhvATY5I7iJbVzg==","shasum":"1cada9eaa76bc9fd58012ab2723fbbb8b0cf0b25","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.1.tgz","fileCount":39,"unpackedSize":212039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxshCRA9TVsSAnZWagAAOK8P/jH2pXgvzB6IjZLXCke6\nNhBalugL1IEDu0xCmsnvOIa9X1J15MvlJ63xnMb5NPby2diNgjHMF9sflRvT\ny0frRne16eCzz4V9rHhN6m3k4Q8GxzJoLtDx5HJOZg+RGNcyrmox7Qzco/77\nSBwQuaWCQBpbMn9t+pNAsZYv22jZVDqCqr4YJaP08hMXpA1hBNKFFZFHblZL\nb6vm8ehUAeBxAsIADDaPy6hLJrysmUakXf62VmWYzjqlpSWPZhG90SQENHgO\nijXzl41UE9VoTxJeEulJ3Z1xKtH7bG9jIWOOJBmnQ10lottjWtwpc4EVnX8c\nho0+KaBE8WHZh/oq+VnL4GMIVI9ODAKOx453MsHU2Xj9vRwr9RUbxrwdUiHA\nDHAHYQVUoNp11CzJU5avw962+exyDiX6kFmVHMk+DAlVDKlFG63u3fQ6Wn+t\n3K1pvYKuVVCn0rkBrr0k/brYgwPgWgjxeGGaRuJafDKjt39CsBR1GigU7Zda\n+SJv2UUwFa3MidK1IoQ44P2zJaJNSgXWM5zvws+EI9MhkZFTfp6HKhVAC36t\n/ZEti2GUySS7XTX9mQ9OkeySRKy9UCtzmBSE2aLW56W1ShBbo16XmiKaxJPy\nXHrXgXOrpcegiGKCNs4KpXv7GpBdQOfNeLi3CptISk+hid4fJ/tgVo/vyHtn\nLUL0\r\n=R3UA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC3EV7HkQ2+u+3MUlpS2yP9TQx0hH2oaF46d8PxpcOpQIhAMRkXcDvF2mnqnUPde3bLyszvbqtO/rST08T2Oc9l8fS"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.1_1602165536785_0.4252547480867972"},"_hasShrinkwrap":false},"6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5bb196ad5377e9bad5cbada8be7295ee8fadb6e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-mvXBGORYvmZSSRCuXoOMQcQ1+rsLMwNcl1wUutgxcFSaHd+JI9eSkoLZq/YT7KHPUreGvnNqs5H+hJjbpEtYvQ==","shasum":"b1d58376fce8380d06c587cddf2b478e3b04f4df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxs1CRA9TVsSAnZWagAAhzoP/jNXjySRrhg5PKc01oV8\nKfekFaO0mCntH2jqDLcGjA1ASFzL1FBPfEj6A4MNU6b/qO9OxF1Z9lllyptw\nr/TcpWixH5cjWPnwmkNwX9DG3M5QkHeyVXz7bFRCUtkC40SJQ1Dr4vEO7k8a\ntDZnoQWy53coxrsCy/cNE0fh2JD/peoibjbI3CVYtRTjPrWcgl/l+mRHU8VN\nspj5P2vSr9TAqxL7lCeRapwEaQqfLdS6+nMxJNdyeEQR3OK1DxO35hBuSpyy\nYxVbimHfha+NeRviY4r2Q2DPzAJgqo5fM5EvJgNQOjmU/oTgE/3kV2AyrucM\npMa1go5fHVbVYSVwzyWK4lu4HDaC/wFw+CaaDRm10FFkLz5+hb3DYClba+Ra\ntX3ZNRQO/0AsHS041aZzoqApcDhIsQ4LTvbaKaG/7B87D6oG+8lSgOJUCBZ2\nBHilGpijv9+lDQtlsKyEicgvY1t4wq5xjE+keUljSe+4R6O8vCQ4LeAC5cm8\nXzrT1r1m6Fh7UFlX9N3lHCB9/z5rgWA+ZFWAClNrG1t443fBrqHeCrmP/tgM\nDg3mq5ksg/pBlohS87p53LLc43kMyaio44X2sJdtR4ZqrnyDv3byq3iiHome\nWquSDKpmCcJ6SJTUcMnHPaNm1jpYTmerTmaWvCQVh+cWfrDYw4eTSNkt5d1A\nKhda\r\n=R1ud\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVE3PmRtPYkNoZL6wn+/IcINZTX5ClRUa6SoE0xYRQkwIgTQ45kDS6kZhTY8upeKnwexbNXUXMlrXzm4UPS8BIJTY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0_1602165556772_0.7098382286780487"},"_hasShrinkwrap":false},"6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0","gitHead":"164d45873b50e68a76ded836a8e19ba3fd42f8bf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kgAx4jP6rquMwEGESm3e7sidgohg/PM9nzMbk0f2GSRKfJIoLjSkBDWb2qqdQNmj5+apWljtFJqX/trMcer7GA==","shasum":"088fe00df7f80a19252f207189901067088a1d1f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxtACRA9TVsSAnZWagAAESIP/2P8n473xDBvT2yu5AWO\nCff3wOMN77MXSsVDm9CA/iMcc0379njnW96RTM73x2Ym5foGZkEpuNbwTD8b\nZKO6KXY8+mHQMsTqUy20hKqy3XZehKjBR3xoz7Mp1ZIqo0EQUImqL8NewqqC\nGtcpiIVXuT0Pb4CLqWaoeT0gg4F9AYXyxaXLDeOIWMOiuQkwIEd56a4+BBNC\nVogHnnHPF0CNoCtucae9LMGGw4dv0QE9OLbxLEsH1XTGUODPzbr9LlHpcYgX\n+yTQTKLQqkpbufqKm6rn2yVcZCOvzhMi57oh7uBBn3a18VFOT31yC+w4v/OG\npZtTvkB++HzuwdtZ/gTFCTK9QJxScIyFKlyplxwVUBhviM0IO8fo+IZ4MAUj\nSBWEO3TZzGRCuhxUuerBFybstT3/RwAMLbsN1VcbEk87+6X+MB9zb5XVTGoo\ngqsiHPfSBNfUZwQM8QLDnDasu7M2rNVixfY9cG6UVZ7V1iyBElDGVtsrSqGk\npwYh3CPgzHJMo/NOjZTarexhA/wM8SaJ0WhrKRiMJLCoqSFmrUqkQvmL08PE\nnZsG1L1sFPFrSkzk37xbhEVvwZYy20UhPustaorQR+hMcKVYHXcLANOyj00V\nfegn5Hn1dKMI/3pqwi0ISS/VcFx03W7LkTlJHDIuELBCDTuGnvsSuf6r5xih\n12eh\r\n=+U87\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4pyW/awCTXoh7Yr8sGeliYBg3iPZ1zlse9SKChh+HowIgcRrxLFKQ7QpNS+zcscB5/Q2+6GZRz4r9xNUPKnqviDA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0_1602165567918_0.8427971687786406"},"_hasShrinkwrap":false},"6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0","gitHead":"8412f941d3c01d5547bb81bfe4f375591750a98f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-k8UegsGZbebfeSNx8zWl1TE9ub/hm3QbcYJUza7P1CoI5vQjysFKMOobmMCNSKz1GKbHIk/zFtLW31lh1+RcCQ==","shasum":"77ef507753c5f47955141d5a000e84500367a12a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffxuACRA9TVsSAnZWagAAbZEP/0q56iJI2m2RIYDbNPCQ\nns38UvooCSygyM2TEhM5IM/zRNkEkIH26uPiR/3XdUdlrq83vbQc8BcK31w3\nkSVRWUevoRPPrwDOhKiEFvOw96RpRRYQT5AoK5TA4qZRVO4gS/lRNJ4bvrzl\ndf0YQuGX8iYJa84ApUDqcfeRyBFQiCavSnH01hjJQDzYTq7miVBupP/l8S2C\n6sWrdqZzztxDMcdhsrLLgnyu62qF/G1ir9SgilkjeyVIiDu8SC49fAhpBoys\nYX4ZrZFQiMMOXp7CcIvcviYCEzvJwsQpOgTebUVBZm+zg/ZSv3MOIYkLLD6f\ngAKeg839PFc+Uu54U70IQOBteUzE079q6/zCIW/fKO+JzLb/irKKajUVaOP+\nzZoRAfjbMImC94zqcllUE0WTzPV77ojSY47TQEjUIvON0RHqy00G5RA/Upwf\nErDrVhrpjFUxiogpG0jhr6+YyHXnePXzseVsCZn6tZgys6ZzH/ceCyBDlcrV\n4FGu2RI+VfByHodyYgylcXUacPCXINXlBcP1Pr9LRdCSKeG17KAUoK40G42/\nHzGzJuw/cvvne/uFi04cOvcerG4a8MtogWQudZhUseBPY8E+CDEYQpWyGjpP\ndTXYbgeMCg6kyMiau8x9al7gEh9uP+D8XRYkUTecqdjcwEuo/JUFCW0dDlfp\n5OFA\r\n=cg1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXQki9grHqZwaqRUyVo6HmhJN4JS/FZEv1JRCL66LvWAiAg4pr3459th+EEqWeuafFZlGS7y/X53WjUChmkEMaaGw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0_1602165631917_0.8356968769093001"},"_hasShrinkwrap":false},"6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0","gitHead":"e638a7bfcad6d6826b9355fa2d5ef0048fbe680b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FC6yXVHVopD8/tASensSYXc9+94gex/ndD4X6ddEKO7MX9i0tJeGPrQTztvennJGL/j4gNJIpmvUQ7S3q7DO7Q==","shasum":"9dd6d073db53782274775ec56426ba52cdc0d842","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0.tgz","fileCount":39,"unpackedSize":212085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff7H7CRA9TVsSAnZWagAAkWQP/iydexOANL9ovbCyMBvS\nwumOcIrDwLXRdH1/gEtMRyqCmtoK3o4noHJ5sB90yLdkVzyXX6HoFnz5/roK\nazgry/fXoAeADHEtfFgTkdEtkBaKLwbCVsR3p6BdPOgARNswR85TFJYkscth\nIqD+ZNkiQDFye0P2AFbcTg1M7EAyo5FJ89znJaToOYr618vzb4THVwQSKPz6\nJv19UQmWHyLcLyuDXZtE6lhcdSUSo9+QqAgqoo1qiCLKv3qZ4F/M2NokM5C8\nJVwmI13fN5BkiL+WpWL1F8FEquS5QFVlzJaf1fWChWAFqreX9rksWALVOwK+\n11N3jIDat1F/vi2aqlvucJ3Hp3CbBLYcPFX9TPfVVUd26oofyNKuS2HdR0lE\nhz7NHkgjKk/1NzRK0UUgu90DS0bcdlxSgBuXw+tQvRhlXRJTVKBTDFzum3Yc\nRc1hfvl+H8+O3sK0PdbxltWyXJfYPb3KbIYai0ecM66GFw7B6uy8nqe3qPgB\nZoMetXTc6p/X8ciwErSd94KGXWCToFPKMM96/yhI3i2SlUC2eLYinld5CuBk\nGrn2uaTwBSlEUbLpeQ4oKP3MG05jMMkPVy3AOtSVWt8mj5W4SD3Gan1/Dtmb\nSpIIzj0a9iNjbkv/OQAzmvfRtBjMS2ktSSGMWHix94hnNylRhcmKPpKndcZ8\nI/vz\r\n=h1tM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBK9aYsfzCCslXD1DhQ748cyBnVkBnVuXk2YULy0INVUAiEAgnrSOCrkffymsceDUi6th2149Ts+XL2QUlNiOuTxAW4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0_1602204154786_0.10233674855392838"},"_hasShrinkwrap":false},"6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.5","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0","gitHead":"2aed4a2226260d45cf9634fb2fa7df7acf293b7e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-T3KWeHUS3LkbvSwe23f523/XQp7tl3IWnQz6IL1+3UDm8h3qiq/7fzTOntMpy0apzBzfUm5B0mBFeFISd6tOzA==","shasum":"4ccdd2f798462eb3fdabb83cac83fde71a7968c7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJ6oCRA9TVsSAnZWagAAykcQAIn6ZJD2DPSABTOBge34\ndWo/Dxx8M+LFViv+r7HdUY7UWGjRYV07aCmNtm479q+sTlpExJHmlZ+SIjri\nX6G6O2A48hDXYI3Xz+6rQi52VYYy8zzUG50xz0RMjrVKIaBGbbLpdtlqtB0e\nskrbQ9q7Xifp8YlCtOLU7FX+xz7zHcjQa52vxO+rmaD34sdcIgu971J8bCrz\njMfblQcRVyOQeqGMj3VFa2+SHbO0SP08WoWwnSoNS3+T2UTYfCml1ShMHobT\nAOSnXOHEHscrSb9hhu++/+xfh42VtsEcSBlvLkSqxiPW1YpfO0+YAZY9fdtr\nHYPAnHzP/O7Q5mPSB/wD0T9+ni7zFm/6pm3YEpiDvy9ZyZGRR4xBRbIRy2xQ\nt8rl6PEM8LOWYM6YrOQzVwNBcT917D0tatOkxn5AnWx9Q60hHS3hrB2MYcpg\nndSJxt0NGmHcG8Jbc5a0Pmct6K2ta6Y34dSZ4TRZiFeUtAdf18llNP4OrXCe\nRsEu8v18qdcf3E9LIoHjE3YMt4D8vEc2wREQ6IRJsbN4ERMV3+nkX+ZSLMSl\nrJ7GHcQwlksdX14rW1VWb/cfksPONcaqGlSjjpPFA1Yop9IeTnbLq88tC5pQ\nRLmlX8nwEbRfdOEU4TQKkSV642QXkQhJcHVKM6OsK1ww2Dm0O3l9ZYiQ42Ef\nbuMb\r\n=V/ua\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC6BJwLQ2iojmSNRCHRopsp0IWqNUDcqJZmpDXEGJeEQIgVVZzyH+qOq+LC7Kh79QQx0zXZynW8DvChfB89s8xmqQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0_1602264743566_0.8431927351596229"},"_hasShrinkwrap":false},"6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0","gitHead":"278258f787eda33293c05fccc94771a26c1406e9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7XwRSEtkwa0xe3hwMGkExQ1WxR4kgxQPzNEOCVMOMWs0krITbfN/8f9z60AkMJn/0f0iXLLCIPJvEUkYVMx4sw==","shasum":"3acee26def4ae0144ea426b66171e5eb322b6623","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJ8fCRA9TVsSAnZWagAAdJ0QAJaLTFAFpUgvKUgeCi5C\nyuJy73bJjnVDpTyjKo86b44ExD1NEq4HcfcQTrpbRdkW5McVZ27jun4OkqGr\nhdsfUFeikI269E212w5rObL9S/nRyF4y77Rn4OBly6v97E4xkrr6ozVc/aE0\nkzMNpDahuGVjeF+EeWCQAMr2GDaho56QyY134OTtZo0Xjzh5cEao9YzDKZiH\nD/Og6htI9cJnbSSjcLpao1bTbnlK10hh8lZLPtP9AjKmOF7A3A0eiOlhAwoO\nYwt6NrXH6PNFuERcRcARMTH4LbhVtY+K9iYht75z2Xuhl+CDrUqyfr70hRzO\ncuAxfaLseMg4EXL4+me8EQWwLIgf2w02GkGuViG34BymWoISbpaniGQXmqMp\n6erzztKo/fzGHVNHppSA5bP+yhkdXAxnVwXfDwvYtsbCLhQqjVDXglxnMnTL\n+k4Qld0uQ2ha0byzHxWiZso1vICep3Gn5yuCJ6q1SqsSGYjXaPaQd0TXlWMI\n4yuY6g7e25/ZtisiJwCyOljORFlPrplQBlIYQksXVxm7ZzuukKaozQim7vo0\nXXE+g50L/WGcpYQF4XdRXmjIUoY+1kl5zxWRl34j2nPonZ5rS2bC3UkoZIhc\nOv2bOeFuZEmrCC7IaMdng5xdxZyC0QTN27omMgbYXtYYDVi4Ed2yiqZB9VrO\nyIGX\r\n=gNXA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNhiAMFvd+F+m5Ca8UHD86GzFDZsHFqcjNd2GQLRZ++AiEAgbwwpKXq7P1NgusaUSJLjFw/5hZFfALz7UeIuBHN9vg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0_1602264863004_0.8165680182366815"},"_hasShrinkwrap":false},"6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3a91487be63331984ac61670100fc7affe27d1fa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PYPPjBBIYsFZst8IF4JGuehwwiPVEGz0Vw2ucPQY8NZup52pbgdtsUfvBNP5sX6mROuKftnWALq39OtGcxxsbA==","shasum":"5f568e429268684713efd627de2d7a951e7ba8a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJ9xCRA9TVsSAnZWagAArpcP/0Vyj2TrhXKeiV79bk4w\n8Qx1ApMvISeoQyaAwv9L7/XCnKOluDyGWxnqe1mX1EIquSeFxJ+mfKugfzNm\nmfK8/nix/ElJRIuOaL23YEQkRNNnkU5zRsxekOaz9j2bbkVb4qTwxUJSvgdQ\n+0csdMTDy1ha4csVKF4r+zkXBy283A6gLpd3Lgx74NeBu+KiAwuVstMsciKz\nVfF9SgsP+GUZSBSF6YtBgOu6iJZw58+xlB/wvEk+nW6Yc/0jPrLY6vxLCs/c\niat2HADbeaHvxyYsbRqmmm/7E+xJ8I0gkWMmLP36CK5hXxdaKfciQtfgoVNB\nRiYjHseOVCBh6xgQgUJYJprZGeod8oN1IdHsOZe8nsYlRGNj5wcFx4xNgQa3\nB7m5sU8k46it2G137xIuzyzU8om4fijDosmrywGdoSSBz5jbstypCV9aVImf\n8pp5+mUdxiyZ8TtNzxCU8j/8IGMsySXrCPyLWQcg5y+3Cc66JSpBQ04rcnEc\nqp0+6K5n52y+oa0+kVEFmVlafe8Qggvp5ezbcYgXto98Z4Ti0krCReF+DZAJ\nG6vC7OxS0StSZWTBFR23U1fgFurJT72rXzeZakGB95Je6Vsd0bqckOg+1rRv\ngArZ9TU4rfICpXs/8a+b5KlWu8mCxXRvtXumYPCEYfrj42xzGSBPUdgAf5UY\nJdfV\r\n=hIOi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIgbVHMlFw/7EAQxAA7x94eBWGuPOlZDhkF9noAYb3MAiBhP4beJw2d78+2u6K0vwpUK3NistGlI4UCC1dYA3jjhA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0_1602264945014_0.6270188218068387"},"_hasShrinkwrap":false},"6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0","gitHead":"a4d7685c21ed6b530140c7fe2847d905a429402e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FvVJo+Y85vwkXnU4xIEJ2cqnPp0O0pE9r10fSgJcxiMpXPB02E8cSg9ljA++ARCy6krIjAFb+pi8eSbG4tpXbg==","shasum":"72145771dadde7e8c13496eaa02036b632a18e28","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0.tgz","fileCount":39,"unpackedSize":212082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJ/LCRA9TVsSAnZWagAAqegP/jJKfMf9cegL8shVlYjF\n+EVygRojdcEFiB4c//UaO9dj4arEGaRlh6gP9KWI9fPqaJZjaL25NVT3jCeg\nM8hTkWZPD7yjEdnbyXxt1adeAysZg2Zr0O6bsDMiTE+yxszpGDQwOeJTi1en\nJ0ezap4MgRMzikkOCzPG8PrPHiQTpwF0EqlAa5yKhOH65FIKkQeoAket58h0\nCtuAPcISKPunD4eoZL80fjySOasRrOsVTHsFPlFKsBzlwY8cAxH335gdVp7j\naWmmx3WvJNBoR58RcA7pw7JglXRzEcPqauYJGaVtVEJuft5RZjnV3XwL3Ugr\nDhaAraW1eCsm5HWzEv6UO8q+VJ8o+b/ILs3EONC+BLzy8Ttf9gziy8YvHxSd\ntege3pkeMEdiEHCLw3Wn1unYgYyihxgVHA+5FMykfXWSknIc9PbJT8VNr47P\n06W3gnJSeQH17PP92f2KWmyXnju0bJa1eazroIMZ3hzF+ggi9kElPDoKjS6V\n5q2zcvdQakECHpvk2BDBmjYky8hqR3qO96X5znJgWFm7Wl9nKMpbdb3Bgdf7\nE9F8fNepaXGFK5Jw8mmtPtxzqmNYdRZITnJK5/2pXwHS66t2dtZx0zheG0LF\nY49NBrC2y4xPt9zO+yFw/1Gml8KRusMKa1XDLJWczIfi+av9c/oLvypzcAIK\n4FVx\r\n=kvDE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5KwyUnJ1i105X2CdIJKTQetpPDUSFEp188lyLt9A6cAiBmwBBvHsgdCHiGPxVsg+kPIgPofUe/z7hopnk5EP+4dQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0_1602265034574_0.1749289469112596"},"_hasShrinkwrap":false},"6.1.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.2","gitHead":"cddf65d96ae13fa9b542fc78e6d409f4b6cc842c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.2","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Eq+9HD253gUiLhEcWkvcUpXwCvmfW16UTb0d7QHrDOcyR7gmexom/CeJxZpNFuPw23sPYmjVpYIlcF1GVNQsig==","shasum":"9b56ba937c2ca7191647ba33735d4eff11afed39","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.2.tgz","fileCount":39,"unpackedSize":212320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJ/fCRA9TVsSAnZWagAAWlgP+gLAB79v2qkFYWCzsIGh\nK6Iv5aBhl/0BGzdzIrUurEHKhhZzmcP5OXswGPb9LpuJkCUjcsNop45CSABb\nEKBZyVE42BY9ozMSmEg+hF2qv6uK4GPzv2f65Ii4aER1VOkliMbHTIaBtCbH\nqaEX+QO/ZqeOVnNXvFBN7rB0kofI1kwuxjVjs8Rd+pXdJJG9Sram0lR8pgs7\nTqnix2ObWqQgCtIYbkASquBVxgbx+Mz4jDqE/1PVaehRk0kJGaBDxXLJPY+V\nYDB3uMScyt+h4W3DWiBaFoNkwM3lWvBsVmTxSB5KaXTbU+t6r46V6YqmByuu\nRUeeXb25P6bzWmaHLOdlxpcshb6w9bOoarQ6Fhu0AaDRMQowExK4nvIr3C8M\nYtUI7eMMj7rmzl0Ftl4lWGSoRpFMuicS1V5A5If5jJ9ZrLIi9rTJiuDOqmfy\nBpy88KEf5czh7qYjKPP0JTDCdEn68Q/ylkKoqZi1Sq5dmmifagINzc+V1o5N\n2HFR8qOYTmCHRU546ubRiL6IdFIE4x7TRvkM3ZoMM8E9GpfV9OX6+VseVQhE\nQbCLW9at2akHge8KeStAbKAmA2uVi28kH22JTjrhuQywQoPF57c8dMapBBrs\nVyQlLs/oZcx/fOS+2taz3lbQCyZ7+fnbVsNZphACDONECUqLT9XNzlvYzh/g\nhYIV\r\n=5r92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPZSa6cyEJCNLpX9kegMSlapo2UxHBIB3zGF1HgHxNDgIhAK/ngRwgIXq0aawSy3pbRhtjQH7rNMXqjdapW+D9U4JD"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.2_1602265054823_0.22880599924363487"},"_hasShrinkwrap":false},"6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cddf65d96ae13fa9b542fc78e6d409f4b6cc842c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+ldawmKtbC2YIzCHBfBzXQ0SgM/Z64+HINNoYGFiofHgLq9RWfKWR0IoNs1WZJqwAYggZ+2c77D/CpFfribqKQ==","shasum":"91cb865fe111ffe52bdc198faa2b4d9be6b93a86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0.tgz","fileCount":39,"unpackedSize":212363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgKAPCRA9TVsSAnZWagAAoE8P/3CLGM4GvNk8ZMw1xfct\nOax0dj60AwXVD3+2Humi+mA7/ZjQzzkbHGvcZXibK4EmvkpgWsWB9rXN+oPX\n/1QdAvybfQjXQJo/ZtYYtYGchGBdRl/ihDAJAz+S40MhIjC00nWaY4Me5j9M\nesYM7Gw5NzScx3lOlAgw9TdLSvd7x6am3vLAF7Extpwj8Mr+RnTIcJTrOt4K\nHeOSz92zPdKjiG4jDdIcFkvKzFgRP4t3yYAs+KCRH7UP59GNOA+TD5SZsvGr\nkUALrIugAm2+F1r7nsz0QkKJuAiAV8mZEUU/g8xBy1MLTHdkHRH51BMbgaM/\njvfmz+yzqEn+9iW+7PSmGgUgGt6vUrq9hsyqkCjdtr3vCaFL0cVDtAslVze1\nkPY/9NeW47I/CS71rSjbAvmCgZUcNpygwb+bkFkwrJN8ZkLnsoR2XHwq/qg5\nEmr3CgGQI5UEht7REdhz27XFQfr34FFX+UtnS7FqykeagxCzbQKevdt3K8K1\n/d/kWnTEKveui63uqcpm+RCX8S8x/EXy+NyVE48wYb+CRi+WVkSG8m5FEEUF\n6Wt8kFPJZ3Z3sqc3C+4K/FqTWxpjvVueBFEHBye5nuoXhD+lw984kkaHJNXz\nOIJK/0TkHpPtwmqNE1euS+MgLc1tyFKo2IBuWRdWhkfNQp9qNiFJo+wEsZ+0\nsvHM\r\n=ecNT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFdFd9ZUTuyPyDNp9jo3yYq2QMkVqZtWwpDIepyAaWDAiA9Cxn35d3RlbVjkZsd9xGCzkHxxN8x9S+GLJS0phzuRA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0_1602265102604_0.9041236356204345"},"_hasShrinkwrap":false},"6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0","gitHead":"90361b86cf6eb5f3ed4ffe19873639d8f045cb22","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4Q87GqQusW7ehRe/MV3jiu1SdmQ0IWQeNd8WpsRfiK4KFx4OEUjKV/9HdzgZ0j0Bt0tjAjgrcegfw+y0dCOeMw==","shasum":"2f9173b828c4e7e3fc7dd382275a25fe1a0a1e7c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0.tgz","fileCount":39,"unpackedSize":212363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgKCQCRA9TVsSAnZWagAANRYQAJXDRXVS2F+Dhrm9W5LB\npZdcNkAseov90RFZlNOdgIW7QQim0YprKAbJUyw1NaEuTaAFHieQmVwdreQ3\nxvAfQMvK2D6bRq+UKxh3PPutDpDC1M3U7GsElQsCFaiRV22UuW0tBscZGDj+\n2U85yzHH2hVnzJiqkU+so544TgsbTbW+x91ZjhYUMFpw4jfRgF7SCxGrYm0u\n2y0IboIVev48yEus+eUCxYesk/jLN9tF+ugpLHAoJL/r8HZnV6AOmbZfKaGo\nlPR8fXvNd0OoeLIOLYan/wW0h2Yzl7vZhh0hKNfS0zhU5qQmq5JldtlBmlnC\nSek/M1qIYLoEjp1/x/kO4uFhH5WNJa4xuHOc885g4Y1GcY+0kP4eIPMcC1Rn\nPKiUy+uCQfMY79pcNZ6ef4St1g3Jjbzuohpa9NdJbRLCdXlk7EBdmWNMuc8f\nKKEtk4iaCjAevO6FWHA8yLH1ICScchCkshSi7Cd73a3CFgMdMVNHszJR1fyv\nU6LJSv7yqe7/SRghprjq5BHoZw8nI2T+FPp4mIp6NkCp3kQKmvPUdl4rGm1A\nGMTt6DTpY7oXhZpy7HhH3O2+ga7A/MKrkzcAi/DrxwULKmim7FR0Xx+3uvFR\nDtmR8TREPXTC6Bz2lwy8C56UiTor4qINREKpZ0IDofUAqUgFk8VE143MZ8EY\ngYbu\r\n=5Cdd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs1YYG2zwszUrSQGjiATyDM0WWmaVTMw5M7PXRlMrtpAIga4SXhZZVc+lO74e2lFZMGyk/ppGfue9gFfPiZt47FyY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0_1602265232060_0.3242756864238583"},"_hasShrinkwrap":false},"6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0","gitHead":"0511a7ae39015886b26cb33857965e70c76f0284","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-hHkMDIuXKZJj8/FqsIMnGY9o20R6jAp1YPTai/8bChbApHEBydsOWBqC4CCGKySOr4CZxPOR9VhPecHuDv5r9Q==","shasum":"934b7df3a44f6ae6e5dde35e4b0879cbc9f4ef2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0.tgz","fileCount":39,"unpackedSize":212363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVixCRA9TVsSAnZWagAAr2wQAKUPvp6+YZOf3VCbZMob\nd7QnFuEyJJwgtGjE8tI9iADk0/hbsV/Mox5HXYQTdcgWccXxkcYmkloQy+aF\nd5QgUxe1mYRP0+Uih7+KFcebySVG9JwECJ+W+/0r6aozDWcfsQRDrGsLvCxO\n4qQ9KbpzIhj/bf2WImRO5R5XZKnqiZgD9fKCw40XnKRarXCHJ8eGYOQtRTOO\n3f/G7ACBWq+478b4tbtiYwXu2pb25q6N6nzZsW056LcfqYt9cS6NT2/OJZXV\nAzm9qPbRtQEc7RTo2eslWvRcSYwvHPAXWLN5LxM1adRUJt0ytmleonTI4ZQv\ntnqcmc5uMGzBA9KVeWKjscIRyj0pdi4cVyhxSyBjfl85sD81jIZhRTyoagm2\nj1pfmNNR265QNyDkiXUqiwpbz1g1kU7mPUBPGh+TCTiOckSqFrbJyAGJ8LCa\nRLhqAsaZ0KejTg2kxr7m03QL32iQTqLycvKLE7hsQL9JtP9ei2iElovkFLKQ\nsb2KXudLegr8dPnP3xfQF1RPqPN3lCcOWOoVKqVq+W4Clmg3Ye0HTnw7xM8t\nYOegQQLjjAyYVB8Ym4JZrbCjw+uTJR39xymNZ1JREzCPOPQr9D4Jke+QIAb7\nOiPrVGQHszS6OPBm5DONKpmGWTeaTPmeyBnFkRCIuqLrSNWzlMkQ6+PEtd+v\nIjRW\r\n=xr1m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfVXjTrDdTizNYcCB9P0vrYMmyydcDmoi61G9azJ3WXAIgLf+W4ODZi14+a2HKii5SI+PIHAAZDcYOXf7PAXuare8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0_1602312368349_0.984650107047681"},"_hasShrinkwrap":false},"6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.21","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0","gitHead":"9219382970899827aae19f5a8e0aa0ec84697b13","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dn2xYP8D3yt6g5S4xsxinQ2xqMmpRngHU+SPMDLxANqdD46im/RldZGdTiaJ+SR0LdN6c1OBiAvU9lJMOfSu5w==","shasum":"6a1a57e9dbbe91cab44467d491eb2c7d3126d149","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0.tgz","fileCount":39,"unpackedSize":212366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVjCCRA9TVsSAnZWagAALVEP/ir+ISLazxmlpBsmJFpJ\naC0RnjIeNsl8p4nQaU9WUQU4/Iq3v3eK7cSSWXCYFTEmZlSj8mKi3Ukc0uD/\ntU6zJD5uYmnOLm5xMOnPyd3XdUtbEkEL9agKCp9tZR9Rvj2nlpai74cf5iZh\nw4Idvws4X5IHEPd+u46cpTpV4QS339tNsl//Tix3EEWlXF3L/bgjrB+6UL/t\nSJFVQ7z3n+lhpBD7ufbGTT7M1kLO0wjWHvTGy2Qgq2XrPtx5+jmO7vcIOBCr\nIfFDwBQav305umcR7mtGk+STpUbH/V28r48rOddSHpZuNqR1aaz/a05EdPoc\nAIpYHF3er4OS5a5RtKQGJUGmNCjwWY7p8vwAegQVfMaBpmorSz9SZaXMCWCp\nEbMoZTVsjsNnzUS/vtYlXXfrbFXDklb5IsW38kQayNsVyl/eicn+31OXIDOA\nsZnLYuQscDPf4wqAapjEYPEIGaNUYfdrKjAUWLpCX4vWsL0JtDfqd1wzTlag\n6rIHnWYTI86GdSO9CBTBS7DWNOLAcc88FlaDjJK+g0vPezPeDUrVdv8JmVmF\nhWe4EoyrgcCfKlU5RRiP8P+cbcvMGhwKuya/X+1+S4a0rLd2x7zJ4R8fPmdO\nDEAWc/e7mif1nyvVVXM7+GJMkO7s/OrK5LvsCWx7WuaX7pRClSJHXGy24gi4\n0z37\r\n=T6GE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpSMUZqZ4pI1a0WwNbP8T2dwiYCFP48pxt7H5zgXzZTgIhAOmP7MfHvxIUL0d4PsRIbPFnPSdCyLDsL1FDiSFbibaE"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0_1602312385914_0.061267688238028306"},"_hasShrinkwrap":false},"6.1.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3","gitHead":"2d449530e6417d4334bfa573707703b0c654233a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xx/EnWhqdlCX3Tey0Ds6Tsy6dHu/myOxPvtiq5WWjy2zhqNCPaaeanVBX+t18AkU8kCxG3dIJ9RFiuvOMo2FWQ==","shasum":"223b8c3624d489c4d5ac9352b1cafda8aa25e156","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3.tgz","fileCount":39,"unpackedSize":212602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVlVCRA9TVsSAnZWagAA5xYP+gPgvT3MbJCOs+e4tywS\ndrbZz1G3h/On7fsJ4V5Hwnw/A9U9jnll3DdzL+VcINjbggH2tkbYzYPrXMZq\nGO+Iqyev2VRhjER3olfPDjWc7BApLR6vrL/OlB+tVJc8fHVpT8O3wO0ha45e\nTwbHYrygJBPyKkXSLAyhd8hwcF8TjKJnXmhl8MsQ36e/Zcj5GnfkMP6LhMEL\n6fv4/6fXsCY7GTnlXLeOqYJmnaPWr5444QDukwmGtQxUxlxNE4O6IciKr0PS\nIFZ9uCRoRPmLgHjEiGE9WWnKkcD+iFdGSIXobtOmgrG4YFd6phjEM9HPbSgi\nXT5X1Q0emc3IoVhzjDGsRf2io50aSYVFKP1W0sr6nzMvw96M5HC36KQdNxm+\nlBBj6nM2KestdQk9ODPkyodtZCQoWJ65L/ImT9MrSq3RGUz7MSZ8f+Ay384V\nZXNfdtu/kx+BqCTR4oXEdNEMdWdDjReNPvjaZXRKoB9WrIjzganVx7GaWpZc\nmTDVL3jjPguwy8DDuJSMOHDNEzzIw+gZIyi+DYgbor71FugXZmY0wHv3YHi0\ntZkjSqJB4ebrz72RZxBGk493lUMayv4kqBLjy/duld4hhxJJW7kk2+wqm+TW\nGcNK3EcqNrGE1yucf/xZdf2TDcWrfLxVkBu8vRKHzc5PtVdwJSHe6d3gGzow\nf/Uv\r\n=Nd/Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPgkIamCoAm+mQ0GcCZtpiADioDFmbQY5zdoz+fMqGagIhAMv+zOjnlehP3ymUaRLulN04IyJKnqq/ir0SCtn1a7YW"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3_1602312533311_0.3154675468000112"},"_hasShrinkwrap":false},"6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2d449530e6417d4334bfa573707703b0c654233a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gWGGgfs0GG8V0fm53mnWppXLlTpHcCToyI/yj135uqhMSGv3aTZItSelmMACAkRPMwJxM7aIBbhgeR21GeC/+w==","shasum":"11ed0b4ca9fbbb61128d7fb6253befd5404aa8f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVlyCRA9TVsSAnZWagAAnZ4QAJHKdfR4dNmANASGgGTU\nMM0x7ag57HsPOvRqroDBapMH66BsHjzLiOb5Qf55FUcwaYUv+4QMop61hKHn\nZ69Rq//YX7f3VpxI+zac6IyYJT6L4DxEtryTso6dSFGjO8CmiuGKwo2ckSvF\nlVqxM1fCccuAE3TjGGIOLtAjjl6c3KGi1iKm9gPXuJlH4OZ+Rq8NnLZUveLP\nBOY8n5JQMm85ewWc7BrJEz+ExAj++9O/YOkzB7l7mnXgHVo8j8o1dvppZGaP\n6GbtZgnMJR6iKJVqMwUu4Q3v7kUy0FYxx+WG7lSkv3piZtliO+xUOFgcfbaF\ndh+MNm9TNjf7M/i4T2QfeKBlCThqIu+uILregon0yGe5Z6HoMMBYnDozHu9P\n2DhSIVp/XWbdXv3rVpbba3ZTbnF2V8Jr3BXIsErdHm59XelzJ/rLQQvVbT77\nVPmU6hHaP4JW4pj90MugexDTUzcT4lMXQaKA9Eq5FVU6RrpNUA2564DBi2Pj\nJKUIRl2j9OJ0Hj+hc904W408iwbMvlSkerI1etf74BXyxd4RgSqhHiUvvDPw\nxvTV8/nyAMLtWTIuk/1cyXfrflDfbIqFZV7SXOW4RorhE3ATsfhZEDPjzUaJ\nGW6xm7Hpno8w68A3E4PO2ceBigXRTWFDQK1qY2Zu80QeHw+j7+VqeA26QHEV\nizgC\r\n=KhIv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFg0uIUW9gIsg0peyHlTs39wedYaojzfflNdJrklpYCIAiAIDMkkBeFkW91mVuaw4hz0fawgLf+t2dhgXAX8CJWQOw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0_1602312562325_0.7129846280045531"},"_hasShrinkwrap":false},"6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AwswUSFKx//2jG8tNEtgofBwosPhhajJYOtiCG+InZi2jxqExq7VR+/dXrPaxTx9x6uP8/l37GTiN/U0b9LJCQ==","shasum":"a0a66be6873172556badec71542715b1b4d69f2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0.tgz","fileCount":39,"unpackedSize":212363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVmECRA9TVsSAnZWagAAgE8P/iu58fUKBPqjRTwoA1YL\nIPCEOP9DIIviO6Crg/Slpmi+W3kQ8zJe4u+/HDQFJMhyRl4geL0V3D6zcvS4\nK9b/unzthbEOX9sLNHviTVAYdxGUScoiN0GyQbl/iw+3g/Cm12KgmBt8dL3K\ngETNyquDfp1pN9dt+Nunkmc8ycApJCmbbQuBIyyPy0BHFtHXPwGB+i7aUCC5\nMPCvZD3W1pLT5RlSiezYYEZBh/qIcoq33Kwbn8s260OuzLidmt6PCQ3Xz/cI\nRFUl6MOlScWoA2l1GVqLQCW3rGvgQ8ChDTkhQ/PsJkchjq6tgdFx4x4yJSPO\nSbQT2Ibd7NWyBq0A44g8bZK5yYC8q3meWeBgaVzqveEGEgz96IFKmYSO/yin\nkhwMhTBQoZ83GWSJBJ/JWHW9xD87ywn1qBjOVT/U91fxfojuGkTWp/2cJoud\nLSGF+XMxHJCB2sCLyJuInmhOhCTEDODvR4hCZZoa0G0Ylfaen/fNWq8LbMK5\nJL1EWrsoGtTo5G7eiiJcllJe5IGSuiGiSElCOEgxCYO4X2ZW27HpPeZfPdoE\n0Me6IXlCPOddjvVIvqr39mPY6VxH89LlBkl+GvuoScQpcOuuGYUZbMhuAubs\nx6Ld4z3CEJ1XwpIPir2VujtZkUk/DLmocHI7JQIgHnir2GR11/4XVLCW7sDz\nWF0L\r\n=PyWu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrMYv+OxhVLcNMdTHjBK5bLgQNg2Kl0EnsJq2UP3hJNgIgWmv+F7Hlsre9JW+fyy/GIVbj+9Gyntzqm8pZOpVSPXE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0_1602312579598_0.4742477755184884"},"_hasShrinkwrap":false},"6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0","gitHead":"7788633ccaed6604f17d049362b2c69da86cef06","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IRT8H9L8yhis2C/8CjATfaY5aI7H/dftlwzZl3ia7vAg9yPM3r3yzIGr4/PHeKgrz6w10cy1dnCQzTo2wod3hw==","shasum":"ec9aaf70e37554c8f234c535bb6274a8878e0994","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVmOCRA9TVsSAnZWagAAFCYP/iiXtTSxWN4qRcud6qA4\n6+u+YjN4IHMfM9lxIUNIIJeYl4wSg9IjP4lYr8Kf8Om/dq91Q4TprODWenZr\nTmrlOfUE0F0Vq+V94o/fA0zfq5ygKX14pwP9Tt9lnquk/bvoZhwOKRmRNGST\ni4CbTZ0QNJxibjxsu4vTDeBGHuxpSj+X4bzDOAnK8Lg0heTJz0i9N0QcFiVH\nUQjPVn0RKYOase/BKFIFy6aRkSSMBwSPxUqxht5S0XEzYuLZuf7IiI0x/qPY\nyMEFW9+WQS0UsXU2xqjviE88puI4mbL+AmRlDUX76Szxf85wp1Bj7pJ00Zem\nD+dM8kkgmft6LKufeaqGs784yO4oX9rJITmeEG9QeFk0hNnV7w4J4uiEJICB\nalSZ1FefRnGS5ZgnMBc6PZwHedd+LTAMoP/o5bnyyjo1dpK6ExD4soK6wxZi\nR6uNOO0ix03TRoZnde8XUDSRy63IHdGYnLUfCTSTQS0OgopMplFzXRgtnXHF\nMxvgVKfzkBLdhH46XNTd3X4kB7I/BgqTkQKoFQ0f+EbFx7p3zrATlNS7NATa\npTwqnNu/izSViR2whpqKAkIFAZbsS5SqBRG9hqS3emN3v5jNAW4S+OaOKpRG\nebnL6Il/Fh5p3gB6Gccb+UKMcNVG1iU48ss8sGewacCGdF4fWIIgxeMjGzY8\nxvg5\r\n=r/Du\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmk7X6U/5zojoRmx0oj7/Qe4qHB5Z1xfXbc23QgTmkXgIgBFLP+XTVNRrLyV/CL+BlCAYPOsQ8y+sKsMcc7RCGs3o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0_1602312590195_0.6818194636543682"},"_hasShrinkwrap":false},"6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0","gitHead":"8d56bfee33b75f216e94b419d9f81091e8d9c327","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Vfcxfqpg7tKt4o9wKxKulvkTwmap0gW5BOZbRAj6gD26UC427GW7bGuMLg3879RBzr1V4IU33d81C3hbzqB2Zg==","shasum":"34a55ee9040417bd6f16fd10dcb7ed441ac768ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgVmsCRA9TVsSAnZWagAAPiYP/Rk+aQH+NorvtaLNTsOF\nhRN8jEW/01PbXxToimkMMY9q36Sy5P/o5V/O9VtTV4pzqCO1oQ3QEbKKzAGA\nZCNwXLgpa1eFypif5BOmbIEsyrmldX7VGMH6I2ATL7pjN3/mhQ6TQvLDK6Xg\nP9f7/CCNPjGBD64PVgAfYzbMOMKHfoovn18eV6mbovRPVT2RACj3XXalqPfA\nYWIEZ7BkCuoa4OOWzdnBOQiz4L8ovUJwX2o2GVnVZzTeCw9GToiuchWWEnQF\nfUBD1iYBtZW43MMYkMFEmLJ8WHF3GUc8NhBrusVL6QsU6/21K7NJY6RPj8UY\nBiuF8L7hgG6nDdD1ndCla0nVguCJdW0XzQkhMCcHHNYbtF+qUG4lTryAkU8T\nlcLkinwgK+o24qnG9rGettfog8E94zPvWz+LwG3zFr8xvbKcGj5c/bKCALre\nBdbue9SRWjMUUUmxqfXxyyksxBCFdFgh+T1hAj+1K27AQvIoJEZ/tPxYuK0L\nI+V2SkAtrgTusgaZXhtxeucwa1NCS0hbBI3Yf1CG/4GiIRyJWMTbyWc047Va\n+Hj6Woah8dwCaNsskImYBAweia4X7lV9y3CNblDQ7uP1T2EFYostNgLF2O6J\nmY50lHg5AqIaong8r/um3qQvD7/NFsUk6o1S3E5JygsNVX1jrC6Djqsw/g8b\nHeRb\r\n=X8a5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD8MbomxuBzF6yZQ9JiKCU77N/kxaxRPx6lgKyuYAX+AIhAN/AOye0vL5fpQ6McjZHSPw8u8vH80RyGVHIQDViQU0A"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0_1602312619673_0.6984207336627368"},"_hasShrinkwrap":false},"6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.2","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0","gitHead":"bd9ffeb5595c578c4aeeac05d611728356d33c11","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OX46r93bf1901yrqLR2GhN/wcGKLc8wS6a7IstXljO7Q6jdUTch5sMicsopyahJHlJtjNpc9hwR2DB91jEXvgg==","shasum":"bc5d3e35fd5f1e6b720747f0ffedcfd0bd8d9b52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0.tgz","fileCount":39,"unpackedSize":212648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgnHdCRA9TVsSAnZWagAAHxoP/A2sS+sBxE5gtKkKygAN\nog7zLIGvXS57wBR6CatKXkOTZdEpq59f0enndpAxb8ckz6/MFaKelbFD51++\n7CTosN/oWofRDVLX3duxyy7gSdiWwgzCB/gfZGaw/Y6/3TBx+ZytsOmwqeTx\njC8vkvQCf7yiQo2MK6NxKE1noRSLoevv9+lqjqe9eC+Vem/VF9dq302yCeJ/\nBdxunCnlbALjkMO2YuOxGSJc3KO8thSR77qlynShjXTUfucbZjtm81bGNkbJ\nDSHmnYdfUt2795ZA/CUoMHQxMCXznKDWT83VileDyvUP25Lc+/YdSbBop4g+\nIxxauDH/xD7QAoDADCM9OeAvDu0HibyuV8m5p1mY5WfhzejbUK3D+DB82/Y2\nfSO9+Kf7Ug0qR7/fccz1H4t8E2ccnm6fEG0WuYUwMcrfLLAncg6JvDoxK/7E\ngCyGV1vJ46lfiiHbPBAN/lZdD2gxKyfct3HCBEPc1UdRPKbBRsGY0dfEeFbd\nxYGANyhEsQdHpRR+UBca1gWbF+sDWc43r6Ht3y8k2+C34qLBclHrm73Q1GhB\ns7dpgYDmZkkDkyfcyHP5gIchT1mWS1vXjmSQ+p5L+0OahWpekgbJKgfPYyS2\nij6LnbFFRBplFlSKWGwdhRcWAaxZtujh/uNgKRgtjPUqVnipCt12ObchCj3x\nKoHp\r\n=dUd0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWQifEXtAN9QO8dhwE4vDAWGoXGQp6DoqSr1CnPQpEaAiEA4ih4ECZxHCHOykT27PTRZEawfxv05sXU2ohjy4a/b3Q="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0_1602384348580_0.5421449184237601"},"_hasShrinkwrap":false},"6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0","gitHead":"b453e091bdf0db8adec5ac79128a95c1ff00449e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-6eHhqKAZT5xOiVGW7YmpEWf3ujsvIq1ZzmI4PuyH9Tspdx58TyRMVC0kokNohg/dYM+RWkrPKh2twI3K4EBbsw==","shasum":"ba6e5f388a87fa028a014c8b43e877ae0bba2da6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg0yGCRA9TVsSAnZWagAAD3EP/2IEa39zp6xDOAWPQ/mn\n+m/vmfxeKmabS3BCa3ditGi0CJjuhlRt2ZKO5bAE1g/yDycRlFKuWCe5ZGLG\nCVB+8ZgvHPx6QJPJxnYAiOs1g8yc6n6CUbNXta7KcLkP3Q6y+SbPjOORtLYp\nQ29lPGuQVj+ZjhTCFi7qGQifEDKUUNCw6FujNVpBnAbIl8jHFbHb89POMhgq\ndiUSGTkrbwRUL6O2tAKlQWlkSz13QvWGc770Ctj1pP+cHNTSFD9dVxxXkgqF\nIIyLs/eZz60eF/YlMIQTKLddWRx8odKQ9VrVyrO8xIbpN66baU80PhFEMgSm\njMWKG4Uw/sFmwY6r7iOMw0ZVuO6OV0ixqyxtsNFYwsQ9o8RzVmbo1yFFociB\nqkO2C+fKHbfdGWkiES0MlJuHlsyxzQDqUvDQor6OAiu9CVT+w5R7lYcExRI2\nDt4WOzIHIkHTB/S4ubQRjnVkeHmNCiKiGy0jsUPcVObQ8PoVMkSTjo6XRHvB\n3sC2TQVZNJSEoPeDB1DGdWEOI/x2ScCYiTBX2l3rVfbBHOD9UMH7OleuEY7x\neyJaGjfhPqLIZXmWU0ZzyAl/gCAHTZQCOC/GPtRa+Jl67BT27ntkiTb2bwQk\ng8xPLI7WrDg5pJCcJTgREO0uvqG5ay8tsrHXpj0XPXXkB7yGpYgtO22ryMjA\nesYu\r\n=uo23\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZdo/n70SYMXgmLd0S/QgQjwc5OJG6H8HiP//IL4AvCgIgb80T+yHQLA8WK1NxfNRT+mN5unUinLOzlwiH+AzeZiY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0_1602440325975_0.9548726885832546"},"_hasShrinkwrap":false},"6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c7daea96cb3c2ff49355ccdf14276df36b8bf6b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-SOnSQnu26kkiGOJ1c10z8kIo8EymAzpkk4ETDN0mf7D6j3yAd50MnciUXSYrqruemCJteFWMD4LnVgfyDPMBTQ==","shasum":"5bd066f7a8866bf3ec083c159e255497026c2a8b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg0zYCRA9TVsSAnZWagAASRUQAILpCZ1LTVnDf/qjmoFm\ny1dZz0k5EVUnDOGFjcZWpQvu8F+TQ8fGGrIisLcDLV72QNfd3oaxOWxs+5x3\nD1ELNlhTFH+/67G2LP7kbSeSYEXFbnPYi08fZ28nhwCIWrWUXSNVQbRxKj97\ngHwYmHKW/GF1yzP2sEHHqA1iymK80tNdMjXGvGHCCmMdaqf6vwRpzTBlar8N\n8IBvPDLpw/0Z/4yovfmn5LY77BUW0aUa6g0nzQd0r8qVc5XCRJ0Rl2K/63Yq\nQZllKkbqU4aeCcjSFejAnux/o2fLY9ASdd+O8iz3zQ2XyQVYlGSl+b6oo1xH\nSKO3u0+Sq30HrRXcN/goUjn0z690ce10A8NHihCmR6AU1j5rGG5o4gHiPYBx\nPF5KceWGafl1xeiRNWf4GhjULLdmxcL1WecW54aSZwngv3l9YfHLDbJ9dR83\nGyFCPxTXJBqA4/Cy+yDVaTs0eVB/Iu27pc1kRxVtGf+5Fp9S21kkCqhweydG\nDssfiyKv3Z1xixWmj3nY/8lWjfnyEN23kzoSY+7fbM/mpSe728QBcXSUHL1S\nbk4ggcem99Z0jvcZPgm3S6sPIEq5o+CcRtduqze0RLatdaAHoKrORvAwr+3q\nk9Ay8V97DsnW78AL67Y/iCJ4FL40FuZCrPllAj3DKm087QASM9OOLuQkwTW1\nB+2x\r\n=vcxY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDsotHwoKwgVTgpOiGftB0up0CJEx9/8WSSZvnQoln0AiBjIj4KceGC1mREqR3UTRSTy2N/704GIPWQ0qWVyfAP6w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0_1602440408188_0.7099296752621751"},"_hasShrinkwrap":false},"6.1.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4","gitHead":"46231c4a3f1957165ead5d059a56c49627f79a8f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OQvbyhFP3QNe38dRxtd1o/6BsLgvh1DrwRJMM3cPZiHBf9m73nxjivLCH01WjLYvIiYY6H3c315uEPEJEOIT4w==","shasum":"1eaf19ae754250cf6aac155b79985b3371a9235e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4.tgz","fileCount":39,"unpackedSize":212874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg00gCRA9TVsSAnZWagAAYBsP/isI8/PC2321x7kpGz9E\nfscP4oP6Z36fADEpV+dRApntJ08nOg5pVlYpI9fMeO4PneAeqzYx60wFlJDk\nIGXFzcQyPSpBYPLI8bsus9VwZKmtrD1AGeMYEeE4uWksSlvZt8kYNfrAXyko\n+L3cX+oeSCI/EJdNbePYZvvAnp+jZA35P6hu+E3HuWUITqhjrVB10rYqxr+7\nDT9VJts0P5p2rxM+MqTY/CzX4JwI++VkyQg5DmZrYLp5/VrahDBGUyNviFpx\nUUvReopGFN1G09j7ShwCjfvuq/nTb+Ha6Nt72ATxenbT6z+OL9hx6oeowVkR\nDj3s2oCQmWEKqoYTHhqk09EMmFrN0Tjq+X/j1a8Bn7La2/jCQIO2dsFxZf5n\nwltYDPfRhB/AupTITYbsoWUg5u3+TdlhRt8QjuwgRpGGyIiEFsiVeJSnJ6om\nq/gR2iC1U/OExNeiLgqw+ZPKLuTDnkR7qu8vW6YoYt5diS1yTPqYSATdiGIU\nMRy6kM8hnoIXv5c0gdweov/cwSjmccft8ewS1H2yfV6EIoqsFZD0SbA8ariM\nwn4yN3puj8wjs92+Sm6kfGWv5SjsbMOXK13yx8J81oPfc92z5j3m+YOz326z\nSlPUr7upNjYE1Z8MDp0d11P7Un1sjJ/yiwI/nV2JDTyykQj2qhDtm29ZYhqG\nbg6M\r\n=dBRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL3FDjGs8xJe5/26bqn8Z4pln/7QgnESXM2RUGnXZmBAIhAKVs4D2t3KJF7JT7dmIKr4a6imQqZM5a0COt1EtiKxdw"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4_1602440479369_0.07413691340154727"},"_hasShrinkwrap":false},"6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0","gitHead":"819d4f3a94a78782ed2d01ca750670750c4c7647","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QsQfMW/LdMKtWm83kvvdl8Rqpim6v5Au5IXU8HBb9p0ayOqAvLovN5Tnf1fAmV7O/Rw4cp9ixUAdgm12aNPtgg==","shasum":"7e8e36f103c4118268ed6ac4aeee68065852186a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0.tgz","fileCount":39,"unpackedSize":212645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg00tCRA9TVsSAnZWagAAFf0QAJ0fgPxke0VFp3JAFUFo\nAzTHgHDhmVsBFRYqle7wdzfBv91/OJEGPYx/0kn3DfvbGeLGF41bXHrwI7Ur\nSsgbVKvnQ4lFsS7hxG/mHN0vcfBxRpVhkwJulV6Kukx1P+jXTQ1s+wANuoUP\nbaK+T9DuYDBUuhe56FhbqmiGeQTVKlTIxhWWyoN/sdrBY++tFjYkXLdgtpz9\nWIZd5vNRkTYU9oDvkX8Czc9q4Kxd6uPj0EMxc7FvjGDltwnRO03HLb3hjpYk\n2mqYgoFLLx0u4DNPEhGAx3wXeR2IooBVe4R9EaZR6vJbN7gX7v6GlxDBqCII\ns2ol3rSNY6fknDJg2zXh59+EjWFyjtVD1azU/tDiXb+H2/oWBTFZGGrTYriF\nKxz1nTtPvi5GIUDXeSUNDZ1lnggX7/v6jclFdi8CcUMXDj0ioh9ZSJA3pI8Y\npLh7rP+W9+uSlEYeopyNsGEAALDDY0nXQ9Hb/cbJ/JV+8mn4/55um5X/9fEB\nqhEkRHVobOa1xstS8bSIDqDOgms1kYXNQJjfRUiyi+k+aT11JG+9N/5DfYC4\nz3npa4r8aU/uolPcRBsbs9smexpiYYNQFvwe7sXc9Kr2TZsaNk4ID/g/yioa\n7L/W9uwJMo4LnDJmzYxZ2ipBFCpbYIG7h3Aq/t+4IvdZ9cNrjN0K2Rs/jMwP\n0Djo\r\n=EqmR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVknaBjfr03NY9mFopwYKaM0aEE4RN6oyIEWXGOBbLdAIhAKebozBqiqW2EWDOcjEubDGbUXYEwNvLetKsH4bPVE1j"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0_1602440493063_0.18717950056877974"},"_hasShrinkwrap":false},"6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"46231c4a3f1957165ead5d059a56c49627f79a8f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lRGvnw8LrdeCfZ5QB07UcA2cYrLL4aqfkna6u29SJkXbQRNqS78Cxnltw/s5Sva0MJCWN/NNEvfTlVk5zGOPzw==","shasum":"4633137a1005f3a96bd08343f6e2741988099cea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0.tgz","fileCount":39,"unpackedSize":212917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg01PCRA9TVsSAnZWagAA3UMP/jHn9SQ3o7LTW4DU9TZZ\n2VJIuvWz2QpiZZTT2ES/1jrDGLveahYDzD+LC8T8lzJJ2pzNKVL27aHSRHsH\n1D+4Woq5x+TDHqIuBm5HsqiYN3x+e5/njiCxoaZlPw80HIzK5o6eImp1tb5Y\nBt4k/As8Z5h/hYAHdzqVlJJbIZtv4XFOZlCe4OqgwDc9k+SVIaMSS0bhnsW8\napfn59qiwmGJaOxvuRePn9A4NNQAZwH5MwMQmMwcSu3SNBGszPVxlcRCNH44\nGd6G35evMiCCL5Z/PDI2dPTYIZoXwvTsNCv6MwJXPTN02fGTmZfoYiE5k/gd\noRgEll8Dcwmqx/kicDZU5mfmJQZk3snHSWSMtr6xDNHHoGxGYI3pRQtw8ku4\nRbHNKS+e51hwfckdNEc3ND0oPErCvFy6AXmlzbKdK0JF1PXEnT+CP3oezHkq\nXebuVuWoYNShJP2VesmTyRtoiReikd7eT/MJnK4XFmeWhvs/Ubu36cjAH9a0\n7YDGCb4hmBXxG40qHDRTWs7/zNWI0aUGM0UwUqeNlbcArUjpuEEN8m2e9gwo\nuBG+yWpJoflFTguq0DFhFdpMEcx6Iw9/63R3Jz6PUD4ai2G86K4BUdBX633I\nLUI+SgO+ROpLIWCcXff5WIJmqPG6QOjj5AKehT/qFXr4GO9LD7aPUhc33zpJ\nA+4I\r\n=AsMy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBAeAofVYovvn7hENpwW8RJxyVwoCwECI26VgqEqanqAiBV1avUCXif9u1JBnCmHszlDRbBZjo/hbp0VaEePQyTMA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0_1602440526890_0.9423057034573195"},"_hasShrinkwrap":false},"6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0","gitHead":"f54dcfff0e428bae95374ebeb352b9fe3f64ce72","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QWNtiPSpkTr4xbhGRf5/puACLvFWtK2DPmHpex+LFvetIOCOlb80JNzuzD944k5q04hymg4McaCVv0Yo6W43qQ==","shasum":"6ca7d93d62e9a7b1f09ee188548682b8baf8cb57","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0.tgz","fileCount":39,"unpackedSize":212920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg01nCRA9TVsSAnZWagAApiEQAKEXpL56m0225h8cQ4ah\nPNX5MC2PILpyIQKJ9NXRbvIP7SeDb3Hxpqf7vEIKxsmbGhwITgddcGRjLudF\n1uEadzndvICrtXR4/Ds8YkpDbZq5SumtieyxEhEr7i/UWr7gHE6XJNlOfGSI\nv22Grj0JZDWoaU6N7oc+UK/8+eRtIvT+9p8Jv5yY3ErZzGwt/3f49TgmZTt8\n/SXkDbGJNSaIgERNjjlN3i6HLg4EwW1zphr8dDtT1//t/5bu34YjPz3OePq4\nJLlHipxHAots/uPYxNcfIUi92zLmPIMr9TA0yhdFRvaDlOC8q78RvKVG9PcY\nR0JnhlU9ziunh3ZD04ZT+TmCwd79MMbBflktnmuw2bHBiBFM4pQnHvHuRiNs\nkmx5YnqHu1aUvhRcVMXSCbh0i0rfrrL0sJVfRAmbWs2YuhyPzY0Cr8+Cr3qW\n+3JHQX9cIL9qF4XEkZ/Yzn8XYtqJe1LVj60GPhDvA1wQWnYAO6lI3mT9aaC8\nfklXTk0kdpxWTz+/Z+U33KYu+dFJcIgVvjlujyQuF1zbz77TUhVURkkgJG8l\nfIsWNEb0m9fXXE2sTfTMQYLGRKuAclDIsmD0yWG/nrZF0rDKFhMW851et3rg\nfxkdtdaml+dm2yey+zulMBrLCKQQPc0aP+SYOSgDME1hIiVYS8sKq/MqxUOv\nsDH4\r\n=iNsb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiNechqw9kECttJRRn4Uk5NCPJiKAWGFWbe2legxUKTQIgOz4Vpb/P96/4GOEZj7ALJCWkLW89zQUM2l7rPcfebA8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0_1602440551003_0.8986906304761966"},"_hasShrinkwrap":false},"6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0","gitHead":"bad737f98381ac83ce03d201ae1cb04c80a2f1ba","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZOsKGeigsYXERuVF1joBQpeREm5fmWw1dG+C9bvEG2t1yzaa7dYoxVJIq7PKvyziOSbgCGAiy3gbPWpPSF+X1A==","shasum":"23ed483074ce5060e1d1e3724917bdf3e86173e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0.tgz","fileCount":39,"unpackedSize":212917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg02JCRA9TVsSAnZWagAAF84P/j8M2gzX4H7z3KV9Pmqq\nEG9WfaN2gHrNrQ3ak6A0HtB4ZHtVdb1ghDtTXmyfV5nQoz379ylmkCtFIJub\nxOrCYVH4SYuyr0YlAs9djZy6tQXhPQLbHwHBob790OhsGfBOYp2QoSIx6xNy\nrS+4StSF5qWAmu0rK9Fhz/GR2u90dn1zB2u1MVXXdlgGKPOy299L5ihDtYCW\nbteP8MqgPgtNNfngOYCB4YLUwZKjGirrfEeJqN+g21bBhNwploqLE5hG8vBs\nPzjCWtxg1aSQEmm9zCd9ZElJ5Gn+Ph7Nt6IjJSxQakEFLFgz6ib47cuug+M5\nzCY2xbfHVclEweikjq24fzgwwiY4uRurrmj0rYpwBI7txZMRm5HukWrXJZFh\n94SCFUFY6mBEk5Llw2Xj8FjDgx7+/O9P8LwASucPaGQhDmEGQQhkVyvGvl2j\no00qiCTlDBCX5EpVE7nj91B7cDsWiL41O4wyT7E7ubfpegzyVXtjkiA9xRIU\nsEbbG0fn4r6pFNEz6ERoKpzJtT0paDobRFac/Csn/JpJLc4tscWoUjOChX3z\nMB/seSQfO5AWoLb6l2gOSRFVgYNkWVA5pvahFb0/g6A7FN2ul6b+lACX8VcA\nIxTWoT80m3jmpXnPSNQaYrGxYlpZmRSB1+vl/EKV23557C0dsUfbeWouA/Of\naZdT\r\n=r+m7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0dQLSywrbvodEQkBOtqsA+LLJI5BzJuEShus5Ww+QXwIgTfLdvntIYgsrmAng43Phicr3vFn9VMebEpxqUB/a66Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0_1602440584363_0.08831033211942829"},"_hasShrinkwrap":false},"6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0","gitHead":"b37a02a64d6eca0b2d8032062788850934ea6425","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KxML9WpMGNpymhNtEMPT/vSs/xCBgkiv8JOZ8me4qCYzvE1ZNZvmuTWTwATxwWddl4vun+O89TUv92nyWEz2lA==","shasum":"f13d2ee0edcdd36a17d3dc2bc144537911dbe15b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0.tgz","fileCount":39,"unpackedSize":212920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg03hCRA9TVsSAnZWagAAmSQP/29lYrUQPAh62TNL47Cp\nq4l0ZW0J3PlTgaAOuE9L/1dawAIs2G/uIY7tpu73a5yYvBO9dtfxwBMZXc8A\nUeiIKWH/pH6L4Y8InYO6Ycz+NhNo1YUifUrtmIDWhLjZ8LhWNBALS/H/1wbd\ntB5XOe1tHGh6Nfz0remsmD23PtOd6dmANQeC4EVhffi0qWTIwHt42tcmPxZI\nHVEUvBTCFImqpL/XWsPJIpanw4VseT6V8KAShHE8nOz0jOmbg0C83rHxRBCb\nKZeSftMB6Y3/so2H4ahCFJyI8aVkJyjuAj06x/z6sLwQhZGFpriof9b9+bZU\n/007emzJn+CXh0gPTp7Ucy5IMYQADCBvh3MZeqbehXt0yvVHcx+980itIZSF\nF8J8QPkhICBeuncRqxAeWAeq2yI8jZp9DJe0VRtbpLoYtcFVs2TVl+YwuvtG\nWJ8ka3wL8B9iqDiGknOfdSWh1ZQqDjXeKrxDBuG4r4uH1jyNZdSdUHPVuphv\nMNYRG65rCLZoiyfBTIHw87ysr2fGNdj9g4velGNtPHmzkDDO+kT3l7filkrW\n8xTpHioIafJSMBKxtZhl656mqZhcUkmLUdoEN8OKDYHcEJd+v3vH/VYMuIxT\n0mx68s+iGkBmArvzAcXIiwBlEYexxFz1C09SF31xqJkdtV1fmOluS9ioStRQ\n/AfY\r\n=fzUP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKDs/QyVQNMfgOVJkOJ6dpmoYUHT/1dt+mhOVnY3NG2AiEA8jfn0xP0GdNf9IqAQhV9lsmnSqOC0hpjtrzsG9D3bos="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0_1602440673029_0.1832868044564202"},"_hasShrinkwrap":false},"6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0","gitHead":"8c054d4d1311ca3a385a2fded43502143c7b0874","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bqFfeF2BZa+w+yCot0togQtlmiLesYTyceDFsp9sFVuBhxY3RH6CBR6FWShBrobRKA5Qt+R4e7wXaCG6LO3O3g==","shasum":"5015663834acbede61be4455897d20c240adde97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0.tgz","fileCount":39,"unpackedSize":212917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhApzCRA9TVsSAnZWagAAxxEQAJ8AQyr+mIvBgcHxcOyo\nfJpNqwCx0Kj/y9V+F4/+o/dRnPoDJmWUJmBpjO1yaZjqZJzzyIDyU8wF0ug/\nXS14ZYcqwM5zIgEfQsqThjo7FX2e2q7t1AVImzlQKDhttlugCmQi8OQYRsnj\nZN3ETFJMzvsVkIMg0XPugWqGlyQ7X6ZUOWooPFNt+bgRWeITN7h7DYW8bM4P\n5VPLwBZ39DRtgdan/bC6iFQKUDXFuX0e/PNwBXEBugn5x2a+FW3t7lw623A3\nVSB2tk/WtKYvGNDsnzf8/kHSnRsu0t5uNKOFpCk6T0fX22ITMz9SpkDu2Ogk\nZB/OXXrIq4ef/Ma4methhk66gzkdHMFtQlHls8WHR79qK9kHXCckYHR07cZ0\n6+w6ZfCz48r95XRY1KJhEGP/qyqDUXIgx9YeF6JpQ4PgkoRkt4AO5m2QoL42\n6scNZHjlhguPTa72eQbF6aNENvI+frdc55rKZjdHOQQy80p5cUhrTHxDUROc\naa/tSi31cn48nZXdxyyGsiW/YP27Om8MLESpOD3RU7KPFmMKL1KyW+Zp2Q87\nYvsnOI4uTf/pAsWP614KZlCmA/+6Fnf9ukdC+C1XBptgzEtzfeyM0BOlw4H5\nJVlY+p/uTQSduvISZDs6aKXoOVpgYMhYixsGmkEmI3PGXJs5vWupcbtdII+H\nblsY\r\n=InpH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvkosZfUidoOI7uSbbREsO/dsw6MdrOd5AA9d1SSd3OwIhAOtZSul/iKvV8SsJRBboOMRJUuFdKB4mJ0HSsQ7Y2pKM"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0_1602488947090_0.5638228209701324"},"_hasShrinkwrap":false},"6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"acb54f80d3a68083a85c16fc0277c161ed4c8abf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vILOy2YsYCiVxMNhGOD2ZkD34EJW+aF6zUvD1tPrCEMIWTYyNGgTdLZGX/No6QcvasoRju8/3/eYEHAX//5mpA==","shasum":"62bb27844fbf4829478b0c4806378230a6165073","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0.tgz","fileCount":39,"unpackedSize":212917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAwDCRA9TVsSAnZWagAAC34P/2nEC/4iP6RLUYH2zZZc\neZQ8ACGmlHEvwGHqHVgZbdK8tWbW6cVKPzxcaYLuHg1EpDcQ+MLHCbkla6lH\nHGwNUA7bUx+yLNKb5LZB9wkm1Zewfui1uJ3ipyRXY4/nR/srkQXv8qP7TRdl\n0U0nG4YaGNVDknPIXoDVScwovQ5g0M1JuW1h6uz/Glh6h4FxsVS4YQ00qUe/\nAMPzXno1c+2YLkz2sww4FZNtsqQ2G3yZk33xFHSr8dTiENF3oj0QBw1tURjW\nAlpza+FYPEMs6BjiQEFeYJSGKBZN40EVazn90blBtFnotUnrLgyEcwRdbDzr\nfozIKX/TdWy5d6X7QI+eUZ5UEfFb9taqJ7/H+qBOltgFV/TsBnpt2frt2zBq\nIEbN9B9PuaWdtHAThvgUIuEL/klYkPNhFm4m4LPuq7gn8pouCEBv2uhJvGaY\nWoB+EVWoKvNXCVE7IogEi/E0TETgRR7fp3rlUd47CGCjZGUyV7VsVm+wuOzQ\n50lnhC43hNdEaIeepjKJ0O8e8j0rvTAETp5O6eodyWCcfn9Q4Tz1oaYmIQQJ\npD1Wh8qp1knn481mnzPtyC0J/Jleo1wLeI1vD8iBcCPN2dCB7Edg1PnIL2hX\nJwQxhZnGvXzJwmeebLoAsiMYHZ7Lrch1WgjqA5Ev/77rxuHyLRknIEMohoT3\nihSP\r\n=cDAN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVBIvkIalJZnRqfTlQwfGsswaJd9f+HMqKWbGUlR8P3QIhAIcPQ83cGlFy/ZjB3X+a8rzmM3uarFDPCwBMfYhJdTUN"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0_1602489346526_0.4621049139210225"},"_hasShrinkwrap":false},"6.1.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.5","gitHead":"9d8e2bc0690efe572e70bf9e5a26f858b1542114","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.5","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xiLpsLINvPmESmX/3ILsk+6Hw1hFxxwrOL3kqXdC+DnLyLy0xDQ2nUXYZBD2uASCaOsTae6eyp4dOBRu9jZg4w==","shasum":"fcdbcfe42fdfbe909e1b78e92bf67dbfbcdf33c1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.5.tgz","fileCount":39,"unpackedSize":213162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAwfCRA9TVsSAnZWagAAIyYP/At3QoaMppWHI2aPbxXt\nuKQLzrDvJGnRebab+d+jah/cCuTeUjcBu9W7T8/Z5Ch2MG2NEl2HEMKgJtf3\n1HKIvIh0rx0l+L6XWxwugx+quRDaJvk4AM22gyEjieI7VVg6qzArFj7GTykr\n11OQpMDQYIchadtKm6DpRNBBeDk0dsJ99yaGvnaz0PUwvpgRHZ5PcbZfDJsI\nQnRQUFjqKx1sDl9QwK7HxJ9paOl+wZ5vBWOVH3JfTFvAneBLz2ZJOmX5vBSi\n0x/5U0ScLXo/gHv9IC/5xOMQ7S8abR5HGnoN/VMB8hLM6KyNwesWYm9DIUyw\n9XAOeqey3PCzwqdPPQBKvsvw69t1t5TPy02W9nubOVb90Z9qvAgVfYYzpgB2\naf9qu4fG+1r94nc9FC4hYWkJ7A6kPLWHvAVggWllaOh1zN8yrnRwH37D0Z05\nqFllxpxz7pOySKYh5AHdaYtoacr9AogEyUSJIF5rtEIwBGJdSgmfbLBViRzR\nuMxv0Uv0KYMdNj9bXRBDtWt/CSX2GZN6WiWMzeGYa4Q8P+off8mofHZzJ0g2\nfmVpPPp2puOi5VHDmCmAPGexWyBO4SEfnqLWa3yQ81yLpuysMjKmChXkOwMp\niIeazbUYsyzG3AInaFcR/gOOqXBe+ahdE9QEYvwzoYkv13zTHnvJ2pyTm5Hg\nNZAO\r\n=NuVY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL7Z3lN67m0qtpGQ+YkxzOa10zVgh+U9EbV6+qsBLk9AIgOxvftIMgcO5Dq5VepMe+XUijuPhRa+BWrJ84i+H4qZ4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.5_1602489375012_0.19522485718290894"},"_hasShrinkwrap":false},"6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9d8e2bc0690efe572e70bf9e5a26f858b1542114","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AEDNg2eH5jfC9wDSTeKY7fGE3NO+EORQ+JOvCyXS1Z30fyY3wOoWrKY0L9/Iyx344xZn9qmBRPHhxwWD8+ljHQ==","shasum":"7c8182593b13c2858149a9acac6b5fec044d7fac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAw4CRA9TVsSAnZWagAAKkQP/0ExcPuE1kjQzSckyVfe\nlZ1bKv82NZKyA1DY0MxhtbYvUXaHYaH/lLYKEoYsAzRIBpV1sauIwNW9G7Hx\nPke6HIiQT7oG4sa2nJpS4HjMUDbdVvqh3lKk6jOWTw9HSQe4HJCje3oIoejS\ndix+4DWAnk2ZK9rAeG6srhH1Yx4Q8S8Be4kh/Y21NTi/5TjF4HEcvqUOCNtO\n/yXAXTcFfY2Q25KxJbOM35fdZU6u6ZEDnCFRmRD3EbHs0SLs4gGxA9SkYfjZ\nE+G6g11S9qHSNTsjbdCVZS2Y0exoaB9Wni8k0OIx8wnP4pkC8CdMeExUohGt\nGiJGj4XglRRkZXfN3a82LvqVjTLYvjyoxH1rgNCx9ARWZ2x6ijqeb0D5jviu\nzVYNcm+JNA96nh39aUMhNVi5wmfjBGWvL4YNYlBOXVDXilpi2W1nsdqlomII\nNiRer7N75lvSTGJGj7KXc2UbFLLoRUROxdvHQrePMrBtcDIRqMblZE0hKoiX\nHKyNBESco4r8H9adFwFIS8UGbO44NykuMZxIB+ZmzrvMEJET43fjY3i4Hm76\nHrkQEuFYWJW8cMQPOkWoXuIHZeVXLR4nbsShUOVaK9IahBk8GeehieS1V5Be\njXM6YRDzYJFGIZXI8cWvTYHxTKXH+J0C7xMey4V6J4Euia1iYS6UJ/+FPLYz\nROzM\r\n=YkX7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuufCNooxDqBHV/MIpzuryR2p80y0fEXbDBKSezLGJJAiAA/FY2fmc/U0L5AeilA0NZBFOV4roYbYjJD9k1hj/oEA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0_1602489399814_0.20237640129479195"},"_hasShrinkwrap":false},"6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0","gitHead":"3bda81e71eecf4adcc048912e39c78f8f5b62278","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sA71zw8CAp2qsdStSPYQqitS4oSGjmrSEWsqH0pI6EvPPSV70mp6wQ3izwgZ7erLnQHgh9LABSIiKxZTPHOeqA==","shasum":"0e451cb7a5b0eb74e3fe8823d85d1e4758a79c6a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAx/CRA9TVsSAnZWagAAmz8QAJRihQ83z9a+klYUJlPx\nev8oCIJ5y0bsnScpTBp5yh5IV0k/BTgGDoYqiueY2fSD15kmsygyz275aGMK\nLkEbFV5MLmFBw3ijzRk5y0aeMkibnH0aX4Ujv9fnNp1QaGygehEyneXcaHIn\ng+Wbvsl/YHK5lWNI30o6sfTDjvjlZyni/7ekQ+ODkD8unRDRa2RIbk27rRvx\nhf9wB0azkjxxUNZzsC31z5TxJFUY27AR5c/pOFZ38yFqjg08PiWhzWtex6mf\nXsof4MNUfoqMl9HIPS5kbVwzuViYLj0vj2Dh+Zfc1QeeA7ueLeuoQhXxVBcW\n7/izfV/jTNOmcJ/gFeglzu5o3vaRYtKj54w4ot160AJtfzaHkMS3G9GFfhgT\nVZ8YcEg2v57u+JfWJ+S33h6c9kH5giqhpEn/3DBQuB2wb9EFHEXp4iqFrcPP\nhfXXroW6ywXFKL/qDCAc8+q3QC8iK64mKgaEJx/Shk81gnoYZ//M5nmadFAw\nBuoIHYWI01yKnV75BSfS6mARD8PvBpTAHuzQ5CaaYyFibGVCde8oiwWMdrlP\nnmhqJLq/G4nK5o7kZ94w9q6ux0ZZzPFrzi+SJM08zKfRKgjIvXfZcGNg7bP5\n97mQQha9FirlmkpqSoE9FYYL2BJmgfvBaWBWDLPDvWqBiafQN08GRQztYlPN\nw9Gj\r\n=fkA9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfoq3MZAscxSaWdT9IKsjIKptcLvyADzFivHdC1+vOOQIgGsZXFAwPKy1849YPH03DxMQ8MRPWnsPB2nMfWLvCPI0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0_1602489471345_0.8369531753806849"},"_hasShrinkwrap":false},"6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0","gitHead":"67ee873bee5f20e22801dcc501982270beee8479","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4CQXCb+QtEEriX3XINduoELdwGprOkiIZUjdNEeSfUKTsJqJT7DL8gbXao7H07YH/kJVOt1KoDH4QiYFY0GCmQ==","shasum":"017df474e8e7f7596a9b49bd597f935fee7d669f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0.tgz","fileCount":39,"unpackedSize":213208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAy/CRA9TVsSAnZWagAAwh8QAIONEULVNKWKTxgK7LI8\nQB1DM0NW3vaxYNY6iHzu6WzsR2RuwEx0ccPjx/3PbnwWtKjIj246yzgP4Efe\nCI7guoEaifyxTEB9y2eCs8GkFZOjJTIc87/wwfwAsW7QeiIwL+jUVWqXbEO6\nxhsAGQOnthrlPzfE9LYdkQFRc4gtCDnD2FLI/KTGy1AG8gooq1lHv388d2yr\nLMz/IPM75uSoFuCvHMo65g+bdE1LWGt23m36Odc0QScCRnFbxd/xkiohCzbk\nQBchEoeuQubIeXQQzWRYTnKEIgY2h7+fvUQMQatxqWATXsAVBeUva+UI+t2L\nIE2p3pzzWqxRHjaiCd6JRCXsRNK1RCUHb8OFd9aFjxXULUre/QOZ6id8jtD9\nhhEUhi2/PfSQrT9qMviCoD9d2n9jY8XvjPx5ankDPhv9udt9CigWrtzmzuV7\n8Q16YKp9u6+AO57HSzzUOpjUQjol7WWLdL1Ul6duwBcsJF8LVoaDswo8L96R\nkcsNCkSTN7SUovA7ifMZpmHW7o9yt3kvZcPf4DmDcTyyiviexDk7i6L6Nblr\neBbivo8tYwGtGzzLMBjpQvY2/7lsqBikCKFVHuCeN8oMuoPUFJW0yWqA9Kno\nH/r0kBUoFX1mfsftXGY3QdxfVrWZFVHIWSm/TRfzRF1fWyqInsm1ElzbSprX\nY88o\r\n=sJvw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEpezM245jJ8w/ULPCpavto9/2K7al/eKXWrmiLF+LzAiEAl5mwz3d7+Ge2dZIG/NgY+MhrCJQHR/7LoLEMy94amsE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0_1602489534856_0.9561896595634183"},"_hasShrinkwrap":false},"6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.24","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0","gitHead":"1c3794a29561701603c7491579987f76ee5b0799","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-SaoGLZCrssTLvl6jNFc6tuL1bbOF8S6dEagiI27BE4EcK7CbSFWcTKTuAP5n8iRf7rf4AvgjuNi0f6/y0vl4LQ==","shasum":"d9008f25e8d403eed897e24454bd7c13d9855726","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhHSzCRA9TVsSAnZWagAA7DkP/2A2zYi8ZmL7tIUc3+fS\nsz5BkuI+5Xo9D7PkvIsazIZrCp/0knysYxZOlWgQ2TodEBctnX/Urb/8Kmyv\nDo6FEdMsM9w47ee8ileOQRMHN9kORq6Ol91M+aeA1qJXfiOli6F6/XXBrV9s\n8h1tKoSykcjOAhFIWQnnOHPO1ns4UYWJJ8s5bfCNU64zy7tzdjOZ0fNLjGWU\nOup545Qzgf+q4BW2iYOUMxbY5nUUQlyeV6GiBufR7xjsouYgqxDlDxTybOiO\nmwTCJmHrrw84zL+bJeHtW2vXWwkJkDRVLwNj/Fh8hGgjz5/ab/RTAbcSg398\nHUm/gNFxbf1v5gohSUMWSSqMX0KoJR9K9ZtH4vAT+SLDNZMP0q8BU/1/2Osl\n0lgluE6I5xL09Qs3FrFdbhIsQGQhGmuTMgiq+sze6LRrTPYNuooQGRLpqydI\nttnHru4finigvy53KnbYnqpaJZJlj6ZDJ1PkZ7XXttc+1hYqQHhswo221b7a\nApOfz+3kaiVSXOpFDNYfz3KWxqcOpKNShF4PjuOYg+15cAvwmOcRRKBVq5Lp\nFiurq4cMJ+Qd4xOI2mVDIuGU2p1VPFcM8g70ofmoGh0pfIrjJNgCwhVlIe31\nvSE1+2jJfawYpZdsRADIIXcfIW03jxaJx9YPydeIY9JYBC661N5E5jFKhIbo\n+Bgz\r\n=3k8I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFli7FhLBoXrrrEIn5XIbgLGIpnK6GSovBs+z+WRm9V4AiA4KJZIwQR8iIspG2yTJJkyQ3VhmOzY4+d2CHzR1LNPPw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0_1602516146918_0.4885357894096538"},"_hasShrinkwrap":false},"6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.27","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.4.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0","gitHead":"14584d9ece93249663708d1e0961a1db123c5775","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-aigJlqX1C2VrjiHiJwj1qyhNUjNkVuLgW+2eHmLOzMR2ONqSoPrESyPRBbxX0B3XezS8ccnA2H468cQ1Lu3Itw==","shasum":"4febe212a00ae4da2630447d4691273c74df6eda","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhlNsCRA9TVsSAnZWagAA/6kP/Apzc0NhklYaFtzGAn5N\nMz149nr989xLcCj0hDvs0U4Br/KvwYOf7hOmUSnhityb+qMV8XBlZ4JAqEP6\n8A1DrlClOyIai4ld18HFG5CVKr1/ZtTyXoSkiRyST4Z5Gq/egpJ5yycikExv\nmU5QVQNrS4qTB6VO9N61BJQNs/1XYnY+JdgDjinxkBvB/UJh2WiKKluU/Z4f\nUce2SR7B04ESUMsaMgzvfVOXQEU/Qv7IOh3ifNzMvtIRtCa2xkD2SeAOtl0C\nLym3pU059jWH+sFjHA4RCqFZXxut1lKiqIN5GLHLIAgXJFO7oznvr1Ml24FL\nFCdRJtOEZeTK2apDHrkpd/njRV7vuXwwtoSmF6PiPv3di9giqFBNDAYbO+Cl\nAlCze2kvNpO2SmZ/g/0t8LdxJmOjVZNYYrnaTkfeciYodtiRxKiv1Iq2BHF8\ncvPnQJjx5eY7tevznmLk/Ob46ATFn9aWwIIRA29CBpNcfNo13HM35pFuyG3a\nuU1YspkWQTTAHl85RUbUCo8Yav0y80lwKOW/mXgtZep6RmGlIaixw91oKSEY\nIf/IZKDzBDMAz5Gayr8PoGgeQerDpOqPkwIxlTEpkQ8zjg/+3wFAmc6VgznN\nUp/1fmSFAV4XC+ftylgW5FscvxEXhFY7EagFqH6kNM/QBA3gSBo5Ip+Xlw1w\nEHaX\r\n=SSgf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2To/yDVDyNNrwT8+0SBP75HRYhVguOm74fzMO2o1NjAiAjwppmt8q1aeAStpDdvqqeDooL183CJkNYwuR91t/vhA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0_1602638699116_0.34469490634936384"},"_hasShrinkwrap":false},"6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0","gitHead":"a2ae36a626e3f7d794c6bb12e76d23b6f496cc49","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OLh5Y8H7AcR5QBvZt0N//WBrt5OXwZkjujB+7qgngDOocWwKHDd+zBgjORp7rT1MQ0J5He50up2cCzNWKMZZlA==","shasum":"b590115ab5e7c5409505bf31cfccb43970dfb40f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBSFCRA9TVsSAnZWagAAU8QQAIQmDtakMjlI6RVEzflX\nUG9DPU18YzB7ISNkxRpkzae1Fiq46x4AN8Un8mjfZpGstxkd33LeBrD03tYK\noR7GFi1rbR48UnfSkAXGYng/k91VB/pX8hsJdTVcrzkaOZZRJqZYrN4AypzR\nqLFRBbrG0gbuYGEUh3hUFJrQSSFj+SZhjmCUIMbh2X1yoZwWhQS2h8TSePXj\n1oApeH7Lgd2seKiv96DnogEpy82p/kvwH3TysOn9cOSOas0OkvoBrSUcPYQb\n060Yq5/sX1DNSxP/0/wmIcD3hUGhNauMnFiZ5y/Mbpy0BEa0WYFVso93B23g\nYza6a4EfL6akE+hhdjwsOnx+Fg8wJyaQ/qFv4o9jOQxatS7sZZOvVimS6L91\nS7qUodlKzoI7mSVza2ty+te5jJwQne0Ta9JChuYxnErLV9vOee52RfJRtQ/7\n19lH14tlvYK+cvZWrhmTIaAsq6EwzcIN32PcpsY5WB9n4o46cV+BntFttno3\nZXl2ABQtpn3pW9JucixfbhnD6CYQyOw3jEfXSbbbCGAgIPG91LWk9eYnwho/\nbD5q5MpQJhypi4TTWeoiQRBYTl7zZqaICGmBAQhDxRVWYWFH1VxFuK+j58Or\nVGTqZETPrX5nzMzeslbwkXlMotVvd4XmfV4KEsdiQ0HCQ+wN3ag5FslZ9OjE\n9aak\r\n=BDnf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhvrDqzxZ0DCP8U0NL1X4mB+SeM86DEt9vg0WaFiRzyAiAt1uKH4QZLC+mLuoBOphMmg2irFIw3Xvh6DlpteUJUCw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0_1602753669136_0.7988165417291"},"_hasShrinkwrap":false},"6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"614434563afa9210c9c87af7cc10bd3a324cd56f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8I2XTagspLSNyjOFATC2QRm7gM2vlr8AUKM6oiE3mvUhu4IKuz0iQTQ3rZeeqE87Gc/mBJh2hzVNrEY+YM+g4w==","shasum":"942f99c69b86d71f45c15b9829604d01e20230af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0.tgz","fileCount":39,"unpackedSize":213205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBTLCRA9TVsSAnZWagAA2lkP/0bmDibWLqmViWK+fZRH\n2GpZiYR3YnAkoeu7736WucfjhrK7+vHkoXAEynUbhpira4Iobyaf6iTHVkOE\ntFNzZMMfRF3EMNOobNjLrKJyAxzWDjIiktP9brJmuOYNR2d7lfKlpwvqiMS5\nk5fnD9ypemLO+MphFp/DD/ogMxg5w7k+sViCiPJeIp3bqiJLwaXdrcoVwF5T\nTJnPsSu4AfLkuDUU2NnIuj8NqUMzIwBzB8F6NuqEj+uEF1zAFPDzjLGfHgHr\neC1csqt4vbMbrFDL85+x9wH6d9rBOugjY9KB52zQffEaBiFZ8CJD9SUwKox+\nX6Yxkyqu4LdbwlMxAskWgEysD+pSrw5jzis71bRhXW6isi/WD3n5AXoOVEuw\no8zOBdRovtzLULzCJsh1YI/8DOY084rKdg3S0C15SO9q0b8wI0DrzSXptK4e\nLueX3BfHqYQF7Phj0YXHo/bcBPm169hlk8MVuuIZZjWtc+fQAVA6HfcOW9Em\nVMU8Uj+cZU2zvDO9uB9MDLs4KollgWU28kqpmh9wGS1y7SdG9EUsG97FNB0U\nmsLoQgNxIg2E84fGdMAhuMltZJRAq1yG789duzA3oNtt8ew8tP7TYTtA0AWa\nbusSSEDlUChVI+RMd47B17TfWZ1SunOpyYcI4w33ofquJorDaMI8mlF36+b8\nxaq9\r\n=Blcb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4DZRrx+2qsKC0zMTiZbN42yavEDTqoUqbCmFnfh/GXAIgTeed+lovgYyY09vM5FJrTUDQxpR4YAo8JnzLKN26gwU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0_1602753738816_0.08031642969556585"},"_hasShrinkwrap":false},"6.1.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.6","gitHead":"48a68082f261359a2196488b12c0a01e72491eac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.6","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZjQi8FFhy6rykIhGlJmCBqsf2n9JizXHux/AbczVBxRaxFSE80chvG9hKTgrLcfpuJgDEL7oLlWtriOohZlmoA==","shasum":"0c5f4dd63cb3628110f512d009afba5012a435a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.6.tgz","fileCount":39,"unpackedSize":213438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBTeCRA9TVsSAnZWagAAk+AQAKCfLVoU+TiSysJuNtXs\n/j7qhrwzYmSaaztKJJo4W/FVpMbM/KRXt3QjIvPNOlUoKlJ6MvkdYBTeqSbz\nSAUv3O7X5a99w9JDV1OSYjgNAMUB6ZV35ZdrF6bR9vRnk3WHxvDyKXutHgNj\nDC4CkvPhvSh+ouwLYcyMePEcvXtxNoupQjNCCSNk+4CFVZ1qiWHC2mHprr4p\nPWVLOSSbATzTR1hBs5o35Dn6P2OubH4ik7c5ZvvooNrhRafqBMuY4FNJbQ5s\nehr0ucLF/cue4LUt8WuKi+8V0HSjvoi4O5Bg46bJCWYSzyHvFzQQUw7ecg5G\nxa3sajmC010sSjzq97t4bex58pADS0RHrPDpdVd+ejz5Xcwg44LYerlQW2bW\ns7tB/alI30y7rOsslA9qHxboGOhM1a7tWFK42JRux+sudswFWjy1viHOeg06\nbfxnT+pvKBRY3VLlFP+E7/CZJCBghfKakl36jSxmRW+Gat5pLAGB/W6F+Tvu\nt92dlx/KzHXN4DULglGdfCHZO/abhy4PDr3Y4k7PBw+o+5gYCJkUm0RB1iO8\ntKR9gP/w8h1oaSTnLXC8D8Mf6Ef1rJJcVdQitqhtm3zACxO5Dhdz7vjZiz1T\nE5fyT33IZxp+isuG3r12/lzo7dplS4ufjjRRG64yomciSG3k8ToKdJEHEtdv\nPHiy\r\n=SKSb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpvDJBhysIAfz9Wm9ZMn3lY0vFjfhSs8uaLEHk34er7gIgQmHEBOO/i0XGU5Oue84V7gh2V+jio7Dfc19ROs+myJY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.6_1602753757940_0.3267220866502314"},"_hasShrinkwrap":false},"6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"48a68082f261359a2196488b12c0a01e72491eac","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-WFAxEi6Zy0AdKVNCWI8AYlA0eOpvXgWDTxcx/BvzBAlMx8jba+tjnk1RGqgikzaijdT3lAntzj77K+g/y5bOHQ==","shasum":"a862142b240b904fbf09f7fea7e6d9410b44e386","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBT5CRA9TVsSAnZWagAAdKcP/Axp6c7V9G28SdDRFkxS\nhWMTEUAmlnCHc48T1Xe4CGn95hqPLMH4iUYZH8UtXfVSRzYVrb/zCR698JBE\nSV02Iq1XHNAM4lBYYbIdzN1hh03hY36Y6zIF4ORFTpG8oXJAjXAIlTK0bPzK\nmdP7vItlkK4jB/4Io2FToOZ1TNzcRzBVusJqJSQSxnLa6CcarSZVPa4KootD\nRN9OKPObOun2C4Q/VG70osku+OD5p6g9biBD1UV6QABYuKCaC1JqDrn5Kim4\nKaxY5Z/3CoLnIWwsbJcGjgkvbj1nt1UbHXVmEq0YSLydcoe6qRIHpHMKGw9W\n1LWPtGMm5dPlcdZeCFWnZTDKLxag5TbjyN3ne/ZmmWji57WwxJW2Ck0Yr8+e\nVvnLcH7cRRv+lgpbuszeNzunPFmUgE0cs7Kod4Xce70u+IJNNg5Ysmg6oRIV\nmeM6+3MRI5KzBMtb76ciXGX2HgF1qplrLQslOlRenrnhvvP07j0Y9YtKGFb7\n0rQ8dz8MZgvLofiFpW+f47g2Pycwzzp8yVF7uzcSP+sDqibCSlCynrW+6XSt\ntF6T/oSuaYOw7CnqkFYwQjpeXWDzM+VoE2AEGOjVfHTsYyyAg5PiMIRdL2fw\n+GiIX33NZJPCwXQfGt/fgoj7NjR87+5B1NFf6VBT5KxiiBkx2WijKfjvPREI\n68oG\r\n=tkUE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9rpcQL0CLNhlaTBGHltOrJPeTNaBs9aKHqss1alixfAIgS/DoRZli8rKWKjBTr1Qanumqs4HpCVLfxYnDxEbjBc8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0_1602753785193_0.1036141884195132"},"_hasShrinkwrap":false},"6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0","gitHead":"cd187aa69b0126cc74a35371553c28a21c5487c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-czZCS0R+MIZCOIe3in4o//BEAwxsIwaG4gt5VUGbgvIXIl+uSiUbSrOKkk6QWkH/VfHW05hSIvfJPt04jY/zOw==","shasum":"7c4e74b5027f6150fb71cd7abb96f9a751e72da7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBUICRA9TVsSAnZWagAAcMcP/0ividaPl0Gi+8FXMsqt\n5uKBEESUg14QL2bAbwbGH+ZYHglmfqXTKaiYfzM6uT+YDp4CgCT1Gs+SJEj0\nl0Av3C1ePqiFaDA+JWLsxqi+LKwUaxwfZeSJXfFdxA5Dxfyu+XBo19RDxZlC\n6uN+17hJcVImH10vhryb0wRnXn/P91Rj4OU4JN8dsnem/7YMCtSqsgZxj/tA\nEbULEpNFX5A/ErcNoAmsM7/v1f+AC9M9/GIJj4ouzBVUorBOg11ucWF4qdZy\nlHu1b3LTyCCKzIvKKUt3dMZnboqGIRlbF67L8+14EQo3npkOo0g8o6Lh4NBc\ndtkEXuBDZelcZ2iotdH22DGw9eiG+jTcqKaTvgFPjvI1LHR1CgQYBaVCdMSR\nhgjpmPv5T0CA4P5RYVcN461AINInVb81dktS9ak/PrDGJE81LQXPAMKYKYQ7\ncyAfongY0TiXcZg8/7AIEVrHRKMU83xE4AZ6rqsktingutTDnf0OjYYNTjcC\nHT+VfKN7VznBMbQPb8/XLgFaDHZSxwutpFWxzDMA4PeD+50OWD+w8T45NEDx\nK22vLSLAgGsdm5UQbKJdCQB0+ZFRyu8k3cWssYVY4D553VKfDQHw9PFTFVy5\nzKIy7DVTM89F27WSUKjs42og68fRVhM3qB5rFqegPdApL7TK6ngCNM0JQ9zS\ndgsz\r\n=b6Va\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsuheG8+ZfI3kBh2UsFvrn8dCab0IZyLzERmBf+cP8bQIhAKZaJstQ9i1QAe0+HuLG7RJgRvoGoKK+X5mouO9n9Kzl"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0_1602753800287_0.4124972756238068"},"_hasShrinkwrap":false},"6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0","gitHead":"c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-g5YNDPiJjK1vNet+8Nlub4onnSKkOnIuBZMvOZ2ZTyGKCiK7Psq5eXZzzV4Io4yEqE2HFikcq2YuT4PdkaC6/A==","shasum":"be0435bd2bf3853f5ac563ab219d2a1df1296896","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiBUxCRA9TVsSAnZWagAAGVUP/RXcJ1eGO44sVHmExMqH\nwU3puTcjnu8F2/ThBop9bZ+tnQ9u+ndfe49MRiI/q3C1xH3MihmTPpqRCLS+\nSmBcSglYvUFiCVLByqEAO6QRp4ul52TXaNotgzowSHoDwuxXSnscA2xay8fr\n/J+78qh5adkm7iTBhs67p8iM7IYjkjmPQtBUvezm1mQa6yRORH6n2XJBz1jk\nXm0wVsxVw924bqJGJ0Dltp2dUVDBB/0V/e3VzHxvUe3NhjJIDgvj4E1P+g3e\n6tLwW/p+R73cMLt4LqcRENFzYKGdjjvJh5hhqPbZfqnU+6pDI1ICLnXCpCi/\ngmIa3uMzLqMKXN5o7OpsZAYRf9xUF1s32DcEq3oQ/i6ZDw/TafxzSMlN/nM+\nlvFFQ2p2SWNum9kYsmH2qOTbkLaamd7KFqcvBoaWdQFHuxswDuijwtYn/efd\nME0oF9qHmq0IXEh8Lo887ugBi2LZHjR/38Yc7fIhfbPk7LhUSzCxzFqnIQLg\n7tdtewz2Y0o0w9+u5AguxLen5QJzBakNJhRZkt0pyVEWyPHp28K1ciSmSzsP\nn29iCV+kXibQY4gesf6/PVQjEpB9l3PdjiFMCa1zptau5IpmM9sn27PkgI1i\nGjLY3h3bP5vIYRCDCWHPxgCLAjZeUZq1cgBO9jbp5KMsoHNLkVkroh8VjWuX\nmqbn\r\n=mP6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk3F2oPCbAUNmmYW9oN8dIfH64+QlwFCUME0ANdMMfPAiEAoIZwy8BMljSCHV7nz3YCQOZWS1QmxB8153RCUv5WQxg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0_1602753841281_0.8502614005722704"},"_hasShrinkwrap":false},"6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.27","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0","gitHead":"ef4873aea09c6cd2304139ad8365930cb48faeec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8nr8w6d5/rxGowjQgcve57p44Mq7qcThfFz3myPba3JMz5CoDelQQl1enf8Z/Kqa9gPW9jivZGvA/lFvOIcjXg==","shasum":"fa8d0d8f9b93a5e0bbd9bca94595350f8623eb99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiG5LCRA9TVsSAnZWagAAd8kP/A5CxequRTsBKEuSSQL3\n+Hcvx9R7DISy2UsSPqp1sO0T5scLB7K9cLdEQ4aL2wUzA3H4UYILPhihyyLV\nLaCAtZlfWYyXtgOLIEtulpNB0aDQzEvRcXoo29UzGePB7U3ZskJeJOan2jsX\ng+YZjQ9+qYPSvm97eW6YBEkh0EjZGyzNqiMCSv2izHP78AuuNnWT5XDgqrF/\nmskd8ruJb53hZNb3EtOxXVbLVbrnH1wd0XJq8ICm1aRhQeHSNf4FDKmja2cH\ndyHgJmD1oZiOIKxpf8KEMunzOs1K26FcndQyArCDGwgceo3GDM4PfLnOJywv\nS1AnN5L8Ao6OXyzWuAjCyk5s0MxHcPNQnSioCQeUMZRJjAZ0tVI8j+NsJMuH\neeIdDFFSayu/fT/yQGM4GAjyX5BCXOTP7OluXRwUWnsZ8qit3uBdxVm56I0t\nzwZe/R4HTSdt8nk4t/cqhtd+tkMie8ckY2ClisTNk9YQQawJ8OXonLrnvTVv\nVnYENWAoQA1aY8nT+rUDBnVcKyazIhgsyAke4pl+1MiMqYO7M234z/eR/XKt\nhj3BFMZyhXS/AUOAsRsJisboR8zbvzGk/HC/CnseOMNG+UVXxoHBg5kMUetl\npUV4cfgq1uvLyI55vXHee/csmbhDhxgMlx/roZRjzdeMBaQqW4osWRpua8XW\ncW9y\r\n=nvWT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRRRPMziZNGjWfmF9U4+D0x+HVS1NmGlSykZNEpqoSvAIhAMSkvEPVRTZE3PIbElWWTEaV3MkuJSNS3cMfYjYKjvN9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0_1602776650965_0.78745490049923"},"_hasShrinkwrap":false},"6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0","gitHead":"93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4shMfAsG1mrJ8DFG9f5jTTLw3bmFzqeZyoDN1XrA3wSOqga/yNPaaiAvMhomOl5xdgC4AjaHDZeuUhIgSErJEA==","shasum":"abe957f5ea1ac461fb7d0eeb068f0e6c83246ed6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0.tgz","fileCount":39,"unpackedSize":213484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiHDHCRA9TVsSAnZWagAAuXoP/2D7Jt289TyXcTFBZh9S\nkUTO3tnre6lWgyEPIZE6iUZLZrBL6VpXVLdWDLhOh2lEsHBKseM/kP6LEasS\nqm8mhFdOTqu/MglmE0OWRaDI3l+QzcSMGaDJMTEhsCJow3pA830D+T0UK+OC\naobR7lPNlxy+Ndw/zqqK4EES1MRoCADnVSEZPev2gTu+nz+02Jx1Imgh6xCi\n7SD3bSRaQj26VBKq1muy0kY5kNH06mEEpcrblervvU6AmuFCLDJPXtFSsMGQ\n4jMDGbXt3hACg4U1G5AWV2zArboizEsrSRCTbc5ejiLZ/lXnrhQHz0/5Ce/I\nOhiJi2lPSAjtyHZHBelBJgVTK5G3p4DAIBxStQSo/Tfvq6Xd0/FhbAL57xra\ncCbbbGh04IqdPcCpA1kgXUIl0tkt5BxvUx9d2nC6yfooZP1Kva9tCY2gixMG\njjpbn9llhumCSK/2ib3ECSXsto+bbFOgqhGpEvLPma61e7ZHD1FMliDQwPjG\nlvjqxGXbI5z4PAlpxq0wKQ9kDx+QKai6h7dvuk31+MRKc5Vv7RnyDeMqfnLP\nNhns7WJ/7Fu/FiWSPvwU37QpZ4wfVjvS4reIiBId48G0WRqDfWFyknX7y0Ph\nL+hRu/+7OkwIafJlb8Eg8gIoMeV3zQmlkONmbaAOhC01GLlzNABu6K8+kl2o\nuSTc\r\n=FxSE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGpGJVFT40Omay+tN+ZO+q0GX/Wjueaa90gxZBZJvdHIAiEAh43XV8nI/eY8odFEDTfOOH02Pv9NkJci1P2cRJbB80k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0_1602777287362_0.10021559356947662"},"_hasShrinkwrap":false},"6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0","gitHead":"c496cc34ff6f7decfb8c95c7438a47effa58d1e9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-LDeG3qV6IB0/KGbhi5Ftogk9Cx2XBCTSKr6VeBoEA0UYXSQI6s/YYuFmUTGmQXf1GKKHlL7/U0PIih8dzXFSKw==","shasum":"d1115dae55d2671e7fdfc63adc9fb078934242a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidK2CRA9TVsSAnZWagAAr18P/1oYg10NrWTxOB5ltEVD\nwOUcxmM3J3pLrl4OzpINWsiEosVENlJaVsH8RZmWIN5YeGsjj2xmlPfl0dDH\n191xwibOEX4qiz+4theAZe+ZIUHMy21JwoflMwoL8P7J57PJXwR5Xslaqi2v\n+uecfLBolLZnlV0js8JzTRhaSaYbE0d2MUFDxFfJovm441niWJNw2V5ot4e+\nyTvM8e8aVdt1XdexQIP4uXhta27zOVTruz2QXiC6C0Vzm2Vew/EtJNms5+dl\nrKCjuawZcQPLZPIFsB6QM1PaWp2eNfwvUCawE1FPfe6PWtTwtwQqpbvR8IEe\nW72eTDKo3cEy93ns2kK740W0kPl0xkR6BpT8UAqa/ne9WURg9SK1xHCeott3\nJewSNemq+DRKNf7Akbgj2ZhyDUpYiowTJwoWhm7bLvDHF28Rd4K49WQhWb3N\nzOTmBDrSeVPgYKHIOkDQiqOzWHOGSa1TiIqZH/luhYl0zKTmJ70hCURC3z99\nxIpPQO2QGQyQs9RyyE62gH+cYsVtS/g8iSTx5myuh4Bke3h/KIQ5Qnumf4Gr\nuMP2mIDECCXOsGSKgJuci33gUEmY9E4uEneEA6hTgbbrXMVnN3+wcXgqpIW/\nzEO/XRP03mtVQ/5LD4vYpV9IuhrUAkpGqxMjLocsbEDdlXMKsxQisRU9CbVd\nrucl\r\n=yGyO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtaXCA8qOAwCrlG9edXUyfcVGbDX7sXOnfHpEyYxL+XAiEA8JIhpRca0QDw1TWXYOwg6JbIrm1pWcBwrcf2u6kjRGQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0_1602867894147_0.39487383863080705"},"_hasShrinkwrap":false},"6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0","gitHead":"d22b206e94c1106c08155003a84ea808300d9a02","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XShgsqVkChjPX69HkELPg7LuOb8hEddHFNe3xirsoM3pDxh5dyxcOlac76dIg37JrW5OCtT0sI7JplCRllGJHg==","shasum":"d4bf660783e684a6c7c7f190f8e3274d479ea1c8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidLoCRA9TVsSAnZWagAAlSMP/RPGtfxq3M70iCVJbZtj\nNggK2+DFA8vj8rMR7v7Hq3Hsmifqg+yGD+w4x3ygzz+6mtb2AuFDIhNhphv7\nuTRU0ZpnFBiwBNvZbEFJn27/uwM8reltfPfryUOec/qM8Cegh08UdYP0Os2w\n8xt/hNz67ow5Zo+dMs7xOAitxgGWQyR01w49Xf0ayNBL92DeODkVlH8DaxLi\nXZ3SAgaao7gv3UTCWHH/SC++jKf1mbliI8vFE5QhJJyYwfJvPs5ZnYgJV5G6\nmEs/NQ2Gt2I+BQw+YoiSHoEWlJV3InJdDDO0DuBMfk+dGpbaic0WbaqWe+T2\njbw2csuoiZl25Syq08R0ws6bX1Oujjz/CWSyTd8EzgNOZ0zrawcuNVkRlsPW\nrwg+E04IrpJyBneoKNoiRWRh6DuTNAmK+SwXb4nHSQ35Q+k7pThUy2WAkM5m\nU8XsCeoqaicbIVqO7U+Em1AGb4gsmoNaepQTsa8etL7qqvvU8B49QEXVHnMZ\nEFpOxSjxJ47riwgOBgeIg27EngF+u5J1osgQLEuCFxzI1L5OXMLMmHu5/8FZ\nGrPR0+pGsIK2YS+opAbFYgTVpNVaok7Kg3I5FyNlsoXpoWWeOFq3rgBZFDCO\ndi9JfNanLd6igPPdPcMAlMtNuQmEXkgL4PGaE5EIv/wrzjtX1dbfPUDlQ1KW\ndJqN\r\n=GbEn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRkFcEA1jOgDj+kzg3nGADEAhL/MQJ4fm/IdmG7v/+TAiAl3QtKwmYbIL68syhRW1I45RnkQal7TpkJXDYviDMX/Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0_1602867943586_0.06649997729796797"},"_hasShrinkwrap":false},"6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"32840c2c8c452876b2827932287be9b6e4074c8d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wb1CD57dym9GsCawFlyEw4cv1gEmgKJ2HgVD+2BvWzujMpOIiJtgmItXC1Ola3H2j5Frk2PRCjqd5qw9YbDFUw==","shasum":"c831698dc71f5e42c4e94acc59ea8ee83f2c4125","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidMACRA9TVsSAnZWagAAuXAP/0bxyD+UX3cqGbLgA5rV\nIPW8RN+jGy2xz0HjtJ/Yuewosz27xx0Tdssaa2FIu72TUSMBHg1udS+G0KzF\nVVZBQ0zXglA5BWl+8V5pQgJ6Eic84Dc353eCmsZ2pWyf3F8Oqst/DjYmEdlN\nPBBfX+kn3dyySqBvO33YiYLIBOdWXV6xw0L5+3LCKHe85A145Kt+5D8ztPPz\nl3VSCY8mAoEPLXh+UzsDf0+VJFVkWMvwNnTJbjemer0rCISJYivUn+uPYGlY\nlr7XjsVUAodYHQNoRPVLRznHx4M9aPFWb5fS19LaW4se5UBzu6r+ad5CEGBQ\nf30WIPY84uZ2yZEUSBajxRri5Tm8clfA5qGoFcOtYLgDH4DwHVwK10ROwy2E\nNjJ5tMyVKihjfGHpORduA/a4GvIcHPgPMTSFod6tTm+kpP3wSFd/yEVfY3Ku\n4uk3htBz0BRLVlkJ7ur3vQsrpF20sY+/Y8xISTAY0uTxSkLFuok9ebV/CpnM\nF83ow3jA8igjkUMlcPOBXTQxGaF+s0isDRDR+Iq2bbsf9estV8e9yFuKixq5\n+MqZXAr5Wa6SjxVDSqFW0H1is5oH9tzmNReyxMjUFCuELyF3it8QS1WUHYEH\n4ykuP8Zu6byxqIv2ReZ/pb3vhSYqv/Ic7Bs1nQfn52S9wEzM6YxWXVmlj9wz\nT43Y\r\n=5qP0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzKX17hkZJZxXZaC+VofQ/vcE4TXt5Zwvq+dO1fjX6YAiApW4AYSxvyuwRXVc6ozEwAH4QFUEYFeE9O92bOQAPzKA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0_1602867967392_0.11089318414325722"},"_hasShrinkwrap":false},"6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.8","@types/ramda":"^0.27.28","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0","gitHead":"54b44a857507a16b009f8ea86bcfcbefed9f4982","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-s3UpBhuLQOjlt3gbf6B3Bi041lvL1WzkZCs976Uz8A4vQysUHU7Q+5J6H8Q/611VT+/jGJ7P3uTvdjJiEt0FmQ==","shasum":"a0fc2ecdd963c98383d1eaf8ae1369c0ea38cb2d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidMkCRA9TVsSAnZWagAAf1IP/3Iaa7wq4VZ2D8bNIrWl\nkVIfW5qNHYbjjSPV0QVdO4GtXp/GkO0lV/baBJ40LGlb+pGPvjqrKeeVz8OV\n3xNpC94MR9VXNJqLJmjVlTpXZrjMC0C+sx/gFqCd2T3WXUhpGbqwxCDLU4sQ\nrAW5HDmTWM59YEh7vZ6zfcmxtNtP6kzYSDVhVxorRTMNyhR6vD/jPs6e3KD0\n47rWYqeTbVDAc/OzYHnmEIi4yZ3oVM2NH+CyQvTPkjc+algOPjoC4+30McRI\nLh0TMBVXLZhpDycreXAwbarlXvg6Q6QM6oDMRplXSp3/0ks8gpvH3xQ0NwL7\nt/jTDazh7hjELMTe36OYXkbRWVDSCiUtl+sPaLoyCw/syMtgJHPhvFjhlyf7\nqhmTGL2zN3PGhzIwUgwQENe8C1QEjnJq9i6QqO9UzDrhjXPaIoCjT9pJJhmz\nWTmDcX97nslhX1PNJoYnKD2PNfcw7uNIaNQJJGs0VYwIsjqXdaRU8aKuS2Wi\nYuZbX+Tq7jDjKyrl6xF1WYNK39t5SKx5LTYpssSj4/1B8ZGkxUd9Ztx+jHEQ\nVGTtc1fU/qcr3YGBnFGmG7O93I87xy9QZiWG6wvWvILLY/R1ZbjcOzG/L1mb\nFWGSmOmq5UxLwrQcvAL6ruGOz8kQt+0A/JV/z32UtrQlN66WzWPXRUr8lxmD\ntPyN\r\n=AcTr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqQXtdKtK+932qRe0r9iXNhvx0+nqwBBxEGAuKvIqw2wIhAJa7V8V0AZrG78VHeWBkkqIIeC4TO+D4PCVlufzBRHdp"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0_1602868003729_0.6789331970851378"},"_hasShrinkwrap":false},"6.1.7-9f46206645ad4d024793ef893c0320387954d455.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-9f46206645ad4d024793ef893c0320387954d455.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9f46206645ad4d024793ef893c0320387954d455","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-9f46206645ad4d024793ef893c0320387954d455.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-E+HGBclcbAmN13NLZidfun8BgT9+qZygMSVR+ttVtTUkIBFb62+OHPoUXf5tUSI0ME2Ph9E3ihIs/aJ7nM99Jw==","shasum":"9a32107f72a2b814e2ab32d6df3df4c221520015","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-9f46206645ad4d024793ef893c0320387954d455.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidM1CRA9TVsSAnZWagAAmhoP/iCCzb9fqfpN6n48QuGb\n8lkYXjwXS1s7FKs7cCrcF6iJqdNx4qw7xtJvkH2lkTbUkJQ0jTGRnu0eHQd/\nEaXGWvxNdFCIp1S/++JdfEVwzwlJDzHsO2hLj2SsotT0nWnZdvvst0Lj7rhy\nLHN+/g+gXRO7gPiDn6A0rcGpPfpY0QbOhO5wtNuIqpkDsGEnL5x/TyIozLDC\nPQSWknST/xRFIC1OLf+gGpv7qMyIMmFPwKTGYYCaSwlf7gRGc/sCs/jZlaO1\nFYPdXD6nPgAaRGyPoocSgz5alNz5xz3+Fp17+c46N1sBZt/f+fYQf1VFwJtX\nG7Coq39V2+SZ9UK7ICpY1ToHxvbWD9WYkCqQlPmF01ltWK5lcyxfljVpCOO1\n9d6oL2ylASCWUCQeSVeLma6VeAGciDc7U9R8WJsDzNAp1Ys8gvRZYivLgTRO\nq39u1ZKmomdpcS8wXyj3df2S0RFqxY0TcBAGZC+xaw7soun4OmSKJh/FaqrX\ns4URMzwn17eixYPZ68pBKIhv9LphPx/WRUojeEFCKaz9vN94CafC/2btpkJv\n5xTBwmb/Rk/V/gp3OCmk2rT/SCn9+nee/RL+cCTxb2Ra7RFEVACvAnRAZaxD\nYmvoF2w4DE9jsZZSKelVOn2vbAkQaTtAfRnTqXNtqkBbN443H/U99C2ucT6b\nKfHS\r\n=hQfe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgF/EciKcj4yhYjebtjd4Y5Yn0SXGG+RkgvcmLfEpCYgIgVU8AEUP+mcoTo6nBbdjasGqYgoa3TvxZ9bJzG1LXS3I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-9f46206645ad4d024793ef893c0320387954d455.0_1602868021126_0.1897898966954692"},"_hasShrinkwrap":false},"6.1.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7","gitHead":"0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-k5SQQkxkxuQ8Kp8xq+bPl4Tv9FJs0jEHs/uWFSGM6FmiL0rLF9f7DOnMDigZZNOGXxesMQ2x7WUEiiepQTQt1Q==","shasum":"6096a9d6da0e1eefd818efcccf741f5fad150f60","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7.tgz","fileCount":39,"unpackedSize":213886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidNECRA9TVsSAnZWagAAcBUQAJAv+Azoxy4ffSM5GS+2\nbeAT4vP8yTRSSdjAFv5BOM1C0pjG9sLg4lqiDGEEXA4L/laWopgdUtKLzZgz\nK6emg3tpKkfPUMDsx9jsTx7DWKMABW1c4G5R89QR+rKr+G+Zosy9ijeGYYV9\nZLcnJyx2q5ow4nGopoxQ5LRQamOt0SsrUGlYgQ0r02kYx0zzPTAg6lvQOKJJ\n0H9S0vAuRNejpp7+YTUc2eDmS7AGnfnJ25xZxeFs5YlWdDNQyDCWbu/kZ5a2\nCoV5bnfwj+kZgO8O+cJtK1qZwKwdjMa/Ztiom1qmFIp302G/GIPqXmKC/l7E\nrnHcrm6Iq+TuC61cxsbCaQSDDrTw6cWfAXpKKBFdP9XJ5nL3gA+Ukz360G6W\nTvXjp3bG9rAFqYVKSovSXhO7lSOLNxJXHqtKTJLxtfoAY155Xgpnvy2ipYgn\nPIMtQvAWxySyvCWSHMxfIQS0T47DwBGwrc8ASswjY9LVkqlKuZgJ1lBhelNH\n70hA3jraXZ+m0WwZ1NG8DRmiVMG8K9EERCSrnijXtSNfCSfQsIWeSpShegtB\npi+iN1rDOBoJA1PQ4jHVszDH2u9XiwpDwhY28oHCB3p4h3hkoK5bIYJHmG35\nwIRBdZi2jvxM2YyJJFJHLw/t+DyeCz5QQsFTda5P69VEcKrHlOGQz6tpuzgV\n8nQl\r\n=2Yna\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9F+ZmaUtIrfdCb2cZPzEQIM/GYHQDgNzwcs8crBrBpAiEAmb3pZ1OdlmIz0Au3QVxzw7hWdE3ayPMNYwQj5zXEVnU="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7_1602868036087_0.20874935033924946"},"_hasShrinkwrap":false},"6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0","gitHead":"ad1fa127da3d766180e493a1c775aa4c6a0f2ad6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Jl2NyCYcY95LMH/V3f7x/T/ak9nin51VsacwCS7EoO6weUOv1fQidDDQnJVfoBfCogYmsT7XBmw2RhIBp0czIw==","shasum":"1bf8872073e392eca1d67f7413752aa5ca858894","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0.tgz","fileCount":39,"unpackedSize":213481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidNcCRA9TVsSAnZWagAAvfoP/RFKuf8zFn0uF4KlqX4y\n35cBlimJMXqi/L6y0lIXZ1Nx6Wzi+wcXtXIWCHCJY0TC2WfUgjX6jvKvN6at\n/7gjZ/i3snrVQVXQRQCJoa2KI6RRhlQL1rdGeUTZInDx8UIjRAt6NR0aXfZH\nNZeocsWJOPdhcj/j7ijk+6B/noXxSa1UwoMbbHXRuJr2DlFYKW2N2awfpiW4\n/VXZNQeEYks2Qc2DeMJdDz2IaRtqs0yeZKccJdd4zhowMlc6sWU3GxB7t/1y\n7e2iyKx6sh1ZS90vXY6CFfzGAn5XLXH+UX25jJ7mfHSrgoOKGA9ZRksCDl1v\nUpvAuN3A7o7DVvRRNgi8hT0h7/erkHCmQle4ywcQ6oeiPI/gDRJbKn2Hbiz1\nAvoOlM+0jzP/8S9l3FUhXcYYzC3v3vHD61gxPhykzBivfsDO2JbgF2byg1hy\nNG14ktmHdvm1VgmQoF4YNDfhddqsvaR5uGaAe2Hp0aKaV/7v3AEfWLYo52sr\nMogsd0YMJ8so3QH2qMQis1qMGc2qaoWyAzj5U2mPSuI7OdE4ZHzstEIjxxTX\n1tUIRWxbgfl5yD6vCWZQcNm+wroS7wa39+BorIwnJorFOmHUWJ0cvPgwagLV\n0APlsxEj6Ang9cBV6oRciDQgouSm+cOxPN1Nj+c2jbrI0teoZJVpJK6lKufr\nL5DA\r\n=bUhy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSfnS2kffIM6YoWRoWHj9pHf2S7bhUtrY/nec4dujTTgIhAKJ0zlhjvXxRNscUqzWL3bwdhdqcohyuGPF6CM9tr+sy"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0_1602868060272_0.8914614341405049"},"_hasShrinkwrap":false},"6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eJH5Fq6dloDlHlGSDdHAyc78d0O6zsIRduUdFr3v20TpjUGACT4npPsba02xQbDkpy4JGe/oiVF15iX7BXiKJg==","shasum":"b16ec3ad314f8c60073d5e02e8fada5c8bdb9816","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0.tgz","fileCount":39,"unpackedSize":213929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidNuCRA9TVsSAnZWagAANLwP/0zvjw6mZL6dBH+mdPeP\njSspFSP4Opp82aPp4/k8AhuOVXZwflQ1ImywgjUETxNgWI/bs9g8j+KgVwsU\nR7GrEa/XxrzPhjm1ogyUkiMsPaBiqB7tkDxukWPh4sZpe1uoMkZmi+U1C+1k\njftC/ZCKOGuo7pAbxR06ukEfI4SAZjXHFgf/nNnMhJGJr8q0C8ug2aeh+j+C\nitAZ2PXGHpzkDRJNpBommwUEjfhihpuvyxctRJBbyqRd/tcw55iQiXmkgqQM\nkcHmnIlZxfPjs8VvnqA+eVstHB9+rSGJetjfXcReZOnR+A2M2lTWlOqLLv36\nlt12mp65wbt4b9OLDTKGjm3K6nkuQY5S49TMN844+pVjgVoJa0SfhVxEe3Gr\nArw8nLLyNqIIPBCbj46W5bjNKc5o3QgVxoNx8XneeS29kjv1qe5CpoBb+AjZ\n2Bxsvjhm4pAEwK1HCzaB33f14vE8L6ZyX22wlK2QjWbaW7vaeiKR/iR27njj\nkeSHoH9/9oLN8rjzXOiR/DGG8FT1IeNf7lB1dbsOYdzStCpD+S948gQeI1KI\nn0ZMgp9N2PKtTIpNXVMF3eHuT0y3+xyJObLCf/k/Gt6ebueLPRk0lYIiMtXN\nGgJov9LftSLmO7xC9ilzdIqbXNTJWksILyMgdOA3Bwz9oRMm/WXAHOmMTbKA\nT9R5\r\n=ZM/Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs0basYPbodHLdtI6Tq2xLI3tS7v+pKD3YQjrpU5P5kgIhAOcNFUMfgEUsszBoBFDwHlOBHZj+tK/wv+ebr1KRpDGK"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0_1602868077883_0.3121890609671176"},"_hasShrinkwrap":false},"6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0","gitHead":"7edd69b8b1239b4417535b35935d883f22eb72f8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-c0aJtqDPLWFcIfkotlHuxmToVZUpQFNp41pJ1JO003xqeFUALyRNaQxKK7MXwoQjfc6AesVSVP8smPYjX8iFzw==","shasum":"a771622fb4b1a661111a5c7960a606008c238901","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0.tgz","fileCount":39,"unpackedSize":213929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfidOWCRA9TVsSAnZWagAAfj0P/12NwaptimjlTcGiaS4o\nm2kS2kkgmOoPw962VogkK4s3L+0i917SpVazoND13lZ8O75fclHxhg5U82Tm\npJp8iSzqvSAS1tlcU9PlP9QikX9kjmgVMVlY5dHyFytjBdHwWgct2NT17tuK\nsY5o8Gh8Ug0HZ4F4OMhJ0xjsBEcH5Af+JRZQee7vX1R0blgWQg329kOlsmVm\n7GeKJHlKt7LZCcL4ZDhNcgnXVAIBk7r118NqU8NGYMgSMudWzlGS8SLHXZLy\nlfILEIx3pW8s6tNmIP3mlfPb2cTTaePSdc7iOKuSBCBGAKstezDeOaD503Wl\nkKhBdyCLRY8Opsvl0UnBGipbHAwQJPIV1c2n6Kgb6yucOYGkeoL63KBf4AnP\nbhCcSsUWa1xD9Owc9nfdMeZtB5a8u9Nx2ssdf+kTL3humtwFHUn38kL6tHqn\nyPUszIQwK/14+mjbh+8y491fviHayHcm6nIyp3LYFDAlApplX7FuQtYRak0w\nTlklXY/8Z0VL8JzHoR69pQRYu1Xk851IS4wTMxOmoDciCiyBnK+wSTj4OAVj\nH6nsl772f2TTkOG1UBYkefBiSXhC0obomr9v2Uwj9zJxdCHaiicOezhfPfSi\n7/p6Z6DMKG/CdpEvGRV6F4yfOcoCkMewaOaZ3JyWWn6Wb4ff90bakjtgzcQ6\nwTQq\r\n=6NVx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhZyuDOKk8J+hGzGHs/0ThkPiLewSfzRXMRUdEMewpSAiBTVNpr/Lum0Ob+afsgrBFWhao1XT46cSZX6oacgZpymA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0_1602868118051_0.39741889120159835"},"_hasShrinkwrap":false},"6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.9","@types/ramda":"^0.27.29","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0","gitHead":"68c3d47832fafba0437edfdac0d97e183dc52460","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-DTTiYMvPlsNzT7DyW+jxM2DwzeaLUl5jv1eqS4BUeIQPjOBrr3BqupcSr9bsJ/Hw+hWyPBdH+TblALR9T6wOgA==","shasum":"5541d13572135c2179c2cb870506101d394be2f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0.tgz","fileCount":39,"unpackedSize":213929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipRgCRA9TVsSAnZWagAA7ogQAJ7bHsVrPnY2RfM4Wcez\n2huALa4Q4FLejOfRerirV4fGRHkrqeylnoRDPoecSg87eg1y4HLvJc2a49VG\ngIOcZZu79xta8iKO6CNW/AjCrDc2y7XkxTYIFMj1g7c07VlA76oNZ8GIeq+b\npc7wJkLrMGsLEl+Hekjfl9T+OMYF2hWEA9WUvldYA/cNqmkDfX9/pp6Ru0n5\n+2xngRhtMp/CH9ABKbES8PQNVJDqsl6e3AEvVWqil103KteX87IgbfcIpDuJ\nceLjiqIObm2fQJbQR/FcVRW3x/s9kaKPxNyh8Cc11AWXxgHhQngKcm7+tRHL\nPPmSD+28rppcKW+AkZu1XlVebnDrV1DIulsPVUqUSUz+4iFNSVdMckYoOkv5\n9OHKNVp+M3piup5QqZ0b85TEGkM/tGnWpgpq8GmttAzsIW9Iqq0Py8fPSK1v\nEO0OUv09LFUApfR8nliNStQW6SC7GULamv2X6hiuLjJTMo2F1LtzZPARBn7m\nnywtnLOKy70EueKQwS5mOaz4n1RqWSdF8oaFlgAqHMK4wNT3IYXGxDxgvOHu\nqfj3hEakFzU6XXOk9UdaPGZwwH55/aqgrzcvCe9HxrgIqT0zZxdL3qSC6zAQ\nDCcrAjyjOprm3MMdtFvANOSj9algWp5xfbgqjBld49ssnM591XjWvmcv7fEh\nYoQb\r\n=JzxJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVQMRQ234f/aYdPS33zDuJpX8wvnR6UzEBzaUOZAQIwAIhAKRz5XLTK/gKJ0bzfTr0Ss75uDWMBFrsxfsX7KJmY4/b"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0_1602917471516_0.07440801557611998"},"_hasShrinkwrap":false},"6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0","gitHead":"ce5aec34518ff75a309238577a445aeab97bfd16","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KoyKM6zoQe9byveFqRwhlN859sOfWrAV7nQm0rBaeg5ecn96Mp7v5nCqoga6focWnyjwtwlF8DrC+Ob4VNuhCA==","shasum":"f587de02f640e23e32173f5e64b365a54c77290f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0.tgz","fileCount":39,"unpackedSize":213930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipT7CRA9TVsSAnZWagAAyIQP/ixVATOEqMfopHV4AGbN\ncyzgU/xzmyIjUex6b3FpfMsp5tmxaB6kNl7qNVRjpzNrC6oiUyVX5fK3YWIo\nxg6OlVnhVMVAjXUPpVRHbPGMRvUfk4krOa6I5nSfFMPbQh6owD2hnZZBAT9b\nvOCjcKryJbn6vfs0gbXJFeCsfJQ7651eleFRB8plB6oQ7CzpwaVbuV5l/FM+\nlnrZQyZ0UXmiddogj0o6D3cbBS2PAN6nQg/Ylm1Z4c47TLKF6CP0Y3WSXGAh\nc5To+Q4p5NNCpgtvkamTBMZGXX3C3guQoRkwfClTbHR4N9zspSHIIX8Su8Ut\nSPrRTmO4hvVpWrSpgZQoB3IWyxUcS8LSr91AgOIsvhUm8rSvst7EFH03DIS9\nmPSyJaT05m/80pQtKVaLaK4DxXUuCktCvWMpUL9HyZZJ7a7JNvsL+Ti3Mtel\nRqFkcZlzB4k+6bWJPhWQChfLtEQRgh5a/K3Ibz5gF0cAHyZ0cUh+aUINRtKa\nFnKjPLgAR8A1hI/mMhulz6uwSXq4IHcigfzzrkK1DeI2m1stacqNLnGFpwSo\nzT3gWIc80tN62tAn91CfzwyRTttJwlhYkpE729w8Jf8NfKTHVS84ljytbpIp\n/ZsqMu0Zm75NHJlYsXtPu1ELjjHvNFZpXmjkFuDaNF2ibYNuD9AbLF4IdZZ1\ntf3R\r\n=rrvp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFal6ZHyou4UPa+CS7BQPgDFM7KcGM5fTlhjWrog8muQIgP+WXwKKzQzv//pyGVwZJpyzGQNrOSILAWd5fWVUcf2s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0_1602917627347_0.5130460269089061"},"_hasShrinkwrap":false},"6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"66fa48d21e2d916263ab9dd05911cf42345c5960","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-i5T5cJq35j+CiX2zzpzkcNsTUjmgY313SBEMtmZqIp+8FlCH18llAk558nIDJymLnWxh3iUKQGCrl/ibmkHzOQ==","shasum":"34113201bd99d0d3be4f80bce20e0586b142659d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0.tgz","fileCount":39,"unpackedSize":213930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipU9CRA9TVsSAnZWagAAimcP/1i8tlGiO34apB8x0xIN\nkkg4sfaEQA/2NOKRVBru64wGk8P6rwdqaCiHRuIemj+hh+wAx//ip4tHTut5\ntU1pXHbQbQKr7R/slHREO5v1VixXmZH+qHNjujrWu30qH1ErWHDg1dNkjz8y\n1R3xS4VUCWBYfqTyy6/aswRhrvQ50jUhasicLBjGFPtl/c/ui66EEKWTyvp2\nBsDP72YpSbBF0sbq+C0pDC0rkWAAnmHZiSvvMVt655vquJFEAwAhmuVLYOJh\nYLYt6qizKD2FpUBM6gUMKGATc0O40q5I2dPZ1Ewbz6SDoerztv2Mp0Pj7RvX\niv8sehGFTpi6lA/kvohbtca6BAwfFrT5QBLaaeFwD3HdHDkYVk/SMyR32gAv\nPompnTJcwVC212L4qW9U09jcKOHZAjaAtFVHTwaOvrNtGC4UAueQ/vJPK5Q9\n6BJsrs6z0INVEovv4OSmuStB//JNdBRPPti38Qi3fmTT7hBPIkvOnFrfS7c0\ns3nUwT2Ha2f2uG0kgPpVruuPCr93KYeBKTih0BV9QY+Cqm9DE3ojSCx6Qnlr\nUXwiYD9GWOZ2E+7jq+Nsp3jWpMIt4Of1NHDm3vECOEymiiLa7x9TizrvVYYM\nzt9sGx36b1iWkqlkf8nkEWMRm0ZZOfFkgujoX4pi32wBkNZWhlvYqOahE3ez\ny4QE\r\n=Rwcg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbGX66y/ZBLcKRspRSZ0zVOHja4bo6oZx6mpTzzPrTfQIhAOncj/2HT9cqTUOdOb57thrkrUhxzlTDXNL4bDJavzEx"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0_1602917693019_0.14114561904042677"},"_hasShrinkwrap":false},"6.1.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.8","gitHead":"81dccf2d450fbdea08989110b77e1c642dfcdeb9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.8","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eYBueVyP2mGl61e8m1ZPpCVVePuUjVTYbtRcDoQEnxeA67s/Ol3EvQJHspY8KFr3VpOo+LFt5CmXEPJuJXjl+A==","shasum":"ffcd02c7f0a301bd057edb740d53ad76fbbed1c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.8.tgz","fileCount":39,"unpackedSize":214169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipVVCRA9TVsSAnZWagAANBQP/2WpKoMsb3SNXmGZeP37\nDIKv+GvbZfY/4mCxou7ODRUiXTkBwHawMEcDGPPJreXcWxWXMot1ScNBz+Xh\nFzwHWiML2GvcJibbXcQgVsC7G2CpT5WBSAeXrur7OXmgDiKMiRDJrkwCCGS9\nSY/6gL0EFMUq3/KV2PxUtq401F3H1Lz7bsGyON9T+g/z4POxycfOPeCA2t9L\nprpAXE8v/gEtpwZLETOjlGsBNHlqjiRsgvk7nYa2830PhT8gh1fCPrl1ESj/\n37qZ9bqNCNCp7M0o/415ReM6OAN7tXsROeAtwa3I+k8atmHT/MEVC6vq1aPQ\nyDLHVzsCK37FhXC7Tb+qJTvAXpqew3KBfr3QF9lyAHQHEheZ/p/aP1UVxpkf\nw6AMZU8ATSWviuos6H06PaqHPyON01mbrCZ3q+Y5cWwCWPSlIoz6jzo2SfKC\nKLqRKGgDg5f2EiZZXyJ2TqKMf4rimUgRdG6dyNayyCR7KjSECWkv+2rgcmkr\nb2K0ETjSpweC7DjxEtQmWQ+iHVErvZkmtXd8VBQw5DnisokJp/N1iV61UQLq\nMl/4VHo61uaDJCPx91HJ5IIlmWm0UBfO+yvUoBGe1ZYyyOnv7EFXeKl1ICMi\nbunDlpmm4XXnBZLsS6K/WopG5cAJXxWFNYvL5nCGYdUqDGiJpOXwCcit1zlF\n0nyT\r\n=DX1q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQJEljdRnJ93btnAHlWbd135RluWFHOp05+Ga8vP+aIgIgcigA+nI12DXOSHbaacR3OzB/qwrHsni1rEGJzPF21wc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.8_1602917716672_0.5873764684900222"},"_hasShrinkwrap":false},"6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0","gitHead":"b302bdc95eda3f0acf0df7d1643ae7fe6792f546","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0OcRHq+KQy6a3Tdcxo12nbCtSDdAkKi5n+I0KKAb7cYZ/d38uLad6RhCzzH1kC+cz+LK/IFxYMJl5dXWbTG0aA==","shasum":"8928943fcc02e6e1dbd5ba649aa159f1adda618b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipV6CRA9TVsSAnZWagAAtqUP/3Wg8O7UYHPJVc1yN6V3\nJLIx+St22bADGO5efsQocl5VK6XPrljOxqHDuvuCeqVTABIZ1ROgUXsbq096\nnsvzBvt2bLXVaPg7vyjeYQbyqTwxM/OdZJqMk5gfjUy1mi2yoP4y1b1HR3vK\nGx3DRg2Wbs7xL7bnCLtA1aQyM/4bWOVf269W/s7+1tTvRNM2ifPJ8uZ3Hnx/\nc3y8c2HIdxsWMNRNGiHs/RB3+UAJl4dAPlybI8wCgO/EwNOokWgcyfWna1Qe\nHRZ7mvCHU8eeBuZz8x2+8IoVs+9yOxgelKZzPvlITYm8ZOyqg3isoY0QR33m\nzdrPJ28hKzqCOq7V9xl9rwyu/BZg1V9MTfq+6pAvxYOg1GZShjit/kjMBilz\nBNDYKUHhMSjkcoZB15+byDkXEDgRaElQrUrhu+6JOEXnytmP70mk4753uSQ+\ndukhtW2wS97vE7iTbBy6D6tZrIbgIgQtWd6BoZPYDyqAMmc4/loT1lNq5dAM\nW1+UHc4fJFIb7PV2gsY5YEDbY1a6v5LrewmfJVpRh5LBYVIYeTvbuVugySt0\nTT3mpyfF3UuLr2Xb/5YRodGpLh2nq8R3NszW59AwdDxxIAdrq51bKgd6KKM7\nBY0WpY1MEdN4nB5cX6a3PECiOT+/1vQuX6HOyRfej8sOym0HwG4319+XlWLV\nbS/P\r\n=dWtM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgpW0xMbKj3GG5iGkpdCu2SqJFRn48Oh776/WbjhKR8AiEAsXWTDhDuMNwOD3CABWiZM2l2o1lPco+J5qwNmSyE/M4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0_1602917753571_0.6597971227410253"},"_hasShrinkwrap":false},"6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"81dccf2d450fbdea08989110b77e1c642dfcdeb9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1i31oJOjUMZgY/Iw/6YGP6mzGb76CeBheDyGeWRzxR/dACAdzrcWWCsxleIdhtdtgX1hzOtIw1AZdhfwzRnMBA==","shasum":"6e9c52a2e6ab6e858d89237567c97ca221f67323","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipWSCRA9TVsSAnZWagAAWfcP/2F0IUBbii+3ocoWByF3\nh/vc/9tOoaxTCci+E6UfiknXlWMvc4RlMeD/BTVIH9998aI7vNoH0zrxEf+T\neUznfHZmTbc7Zll5hVD8d+ibdClsTbRQu+tq6MQHbrKieVUhiZtSwaMgY4AS\np7IUk1ISrGl5uHndodVw5NO1R8MmrogGqr58wCVrgKobOddA0LEQN/3TmDuk\nLYtxQnC8xmrVUKj3AF24SIvVPdWClfI7sC6A7O6sHnXFZkApQlRKcLmjdTRd\npukbUDnW0z6MNDyVrX6faVgJ5X6MKAuv/XvXtL39l2EByDgGMzWBIy1SZNLu\ngKw9PdT3WzYXYrrgu/ePrj734HVYgfUR5XxrZqkWWsrMTIuBUQKhnAbcnQVb\na+L73clFrxn14353uHQcBLOfW83Au8dndejLdSbqrdjRUJvu7/tVeg6k9cvR\nTfUSKy2EzsCWpLNtUuplgsANOnAuuwrTmUtVuQeoazKjI7udCgtrV2ZvUnO/\nrMpzxDjPHXxbPKEPew+wMUrv1ovCrJxc3zxmxPOwcKJFzqO8Z7nHHplm02W+\nVFlEszftL9HhJEMQRaTGSAlpCSdrN9ym4rkaR0oQbX5DN47QsjVcfKqpXN/2\nfvnIkp54DogMEkd+2w/rXTaMmUi2K+0QhV7y8C9rrw/wfh24O5XuxHJap/So\nFNbN\r\n=X7wf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD20CzS7bU3H8KM89gse+HSv8DECYmTy12w5x/MngUR4AIhAKzMc2nNHNzjv/KM0Cjydsb4bfrM4qGFlmXudfVGQt2d"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0_1602917778167_0.9270629466592801"},"_hasShrinkwrap":false},"6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0","gitHead":"5e7c3890f290f74ce8e9f089811db7a8c133a5f2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-H+EHBLyQjZAoYlJAiAkQPrmvhEFTE4DwDJNA+XddB8qUF2WnSJVGY6vu1fz9F22aLXd7U1My+qZL/d7mHEjkAg==","shasum":"40f2ada805967f2c284417f0aca7f1445f22633a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipWcCRA9TVsSAnZWagAA5DsQAI5iHBuEsx7RU/bBWYhc\nCI5wTdIfOQzbjDwOkzrOJ8+maqBogHYKI1RU4CfPT7sHEpDM+8Nj5/0rkDTl\nfdNJHiIQHFZiKdH4BPWiqTqfz9Op5TJZR+PJnUjb3HO6JiI9t5OPm2hdAmy7\nRGe7l0Zof84LyQz4aFLTrfyv2t5k22KUdenkznw1GWarrRDDcK8vX+fViBYE\n4Fg0Wnw4bdiHM6f+IjAouU/P0KZpQB5Zx/pX//wJEwO1HEHAjjgt1owXMIrr\n25l0ODzDfVoc+larMnHCFsMRQlYzPGvwSTCfjbZRzi3KOb94A/lQgab0azSg\nBFHkiIP3MUC/wquz3L1NGs27OWIf52z81w9A+i6pzZzZ5aPMj+oCG4cLs+5J\nmazWJiwqKAltu6v84bF5Y0ENXxMoVFbhrLUgKyaZZwNXR+YyM32jTM4YUXA7\nMgERrC9jFGHOr3LL2efSqY/4kb6GgrAXpkR5W74q1uptgVOmwsua/T0qftPL\nTRWvZv1DK7/NKNG4Q7MxPjDgNbFVqJ3oHUYsmMeXyf36qhxb0k5cY5GTePnW\nmDAkkv4+VTUcJ/4DNvAbw4rQ/C2kg6FDkaoSu3Ygzdg6N/tIXjtenIMiixVe\nn6XKGYQ94f5JxjToVFdGmN8fZPJGOTlgtIo48IrCQNQRIYfjKhVUpCVmFt4k\nwHPV\r\n=bI3F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDI9SlpkBN5ti+eb9CCtU+Qx9+ldff++z2WzsRsFLykTAIgB6zJsL4OmNvCouM7LhqP9hEnWE5Z3Jn0gOUKXDxDdjM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0_1602917787583_0.6767168178457856"},"_hasShrinkwrap":false},"6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0","gitHead":"7ba495c75020880c932edfb942d26e0c62d66436","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-v91t/JezdOe2V7sOb0fnZVGnPYiidi+LATSrzFpbxTrGRuxhZkYpvUmR3Oke5SMczzerhHmXrsGJhcmdesNWDg==","shasum":"c6403ac34f57b055671e90ff2804d871c34c864e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0.tgz","fileCount":39,"unpackedSize":214215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfipgBCRA9TVsSAnZWagAA758P/3YtglL1sgSBr4SCsc6g\nzdihWK2dUuV7NDsIYMbDzOKzi0FurLVjGbBXJLxQ8RzgHa6OumWtPwBcxEyW\nq7Hf8/2fD6fg1ws2KWW9Mm36BjKCKibCoJ/apHgbcXLRMQF+cX4Xcr4iPNS8\nPetgwl/pJ7MoxYyTeutgCoMt7oPadBgiIkSZYj7+aPs0SZeKZI0GhEZ5mob2\nvJNYxAKpcOjYYazVQciqSk5nplhkX4rocLSYpajBw8J7LtmbPj3PE4KIGq1C\nbL7BgEswjSIUjIdgeAPCKRWSNuKyFowIFB57UwBFxPigsDR6AiUKpfulSF1x\nreofAvWS3cLr5dGbM5h3VxoznUXUzGCCiu32yXGRDe0o1DshyrO/hG9Nxv1q\n0+pHhz0v1WPunGorlK3sGwg7+cqQj4Qg5a8MdNPTqFv1ndwKP5vzfxKBuUM5\nG8wTLF46JZlklKrcxSruowH0qm9i5g8RqItbeIvQcW+nBBX4KkpRgBx0PkrQ\npW7dcqSa6oJf8e0Fcw2QPmuqSg+KeZeTr+jxLVgwm6ZJJy9PaKWwXYjDUrBs\nLQM9+ij3Nb8QQ/IKJwKAnAA1ohHHTyPCCiyxxFvpp/MK3RWOaR8eONWea3Yr\nkre26rP9VGP+91Sgaug4ST+L6ezvLyd46iTFKEueIxpxtWvxK/yuow0ftgOa\nh6Qv\r\n=JZ5e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSBheuKl5JF6NeNhGdQA00HoJvSbnSZ7dcBjT13b+oGAiEA+ZpCYyzQ0Sb84+f7+IJ/5SukWr39zbzXrHIJJrWSMi0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0_1602918401339_0.7652745949664066"},"_hasShrinkwrap":false},"6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0","gitHead":"bcb249c2783a5869a8185428c9db1f321980b00d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-96w/+fls+dLq85IZ3R4MKR3U5rbFb+ZZqYvARww1OIT5bnY8TQeaCsZSgmS4kjiEt6EqL2+Pw1shA4o2HPZUzQ==","shasum":"174d96b8c94b044158483ee97cf1df9441bb117f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5NpCRA9TVsSAnZWagAAMzYP/RjumzG+PBqHc5b/kBmv\n1AB8c8inhL3plOoXi9bIQ+9iFyPcm3JVkG/wO+493QWOUe9gpsDdzmvH5sdl\nKf/eG0vWhcT+Wz5FC35mdgFV5oIunxEbQRYR5Y48eI6nQUy5KSdHB8HING+h\neeXDnOMXmDLUAUl4os+QQ4v1KMZuUBqDI16sVbkuTzeWmiIM8P3jp7KlwxGW\nKdFXKDj6bxskq+LV5l2EodfXn4l2HlR/DLJuqj4dohL6Nk9/7qYt/7tVRPvi\nMsK4lYMTWLF981hfgsz7ql1Gs7FDGa4dZzh6sxxjQ9UnpUOJaCH+9Uu9eQQ3\nelFHi/vCLXkTQSgvmacckRRYBla0CEpvDGqbkaZbofXoPvUmnZ3kUziJei2B\nxLICq0yUw/LARlBpCMIEtHwcbfSnGg5ixPAUqQaiwqCgImjLilscJGiAnifw\ncbrpgcr6rKUDNV4jlwqNiF7bB2auK6D4HnXguOKE+Y9OgPE3/ImwcU0+/YNd\nXgh3vloFvjJHE9zVl+tYjmo+8/Iia3TdFCecIyC8qzfTBg5tWjjAtmycIAyq\n0QZVQeYhQeoCvO238ZwyCgpTSjQZg0uvwc7p/OY4UQKyQ2PWcPQZZsTgMSDc\ndL0ebTA7pm6zxX7pZfAlHa7fYu/bmgN9NCPPuNdLjgwSPBEQBecLM7HOQp3L\nnC1B\r\n=gu2z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMX4fEgj47T+GBF/xyPNUascOIfKchmdSF2nq8d0ea+AiBB3P+9u4XYE4ilq9rXPKebH0jj+P8iPQhacm+SvScv4Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0_1602982760865_0.7440553242468599"},"_hasShrinkwrap":false},"6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0","gitHead":"469ee7a81a714da7e8f33726a2dc4c92f5d98410","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vJ2tPI/WBmFsPkjIqZd+HxvRCrmOvYxxkhaelBO9UOe11qpMIXu94v+FWoealkqMuurMHWfSpGQs93Iaee0UKA==","shasum":"94521ce68ebc9c12fa44a44d16167157b31790ff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5OhCRA9TVsSAnZWagAAEb4P+QFER2nlMsWOsq2stV4p\nKSSNkhTwSnQEo7rf+94VWld50LiMI4ehyNDWADx3YFUJZwl+cmNer7A0ARXa\n0SvDgjNX3G6CauD+Cg21gelAFoBhWRzp89LGunVq2j3J+Mi4zgy6KmVPY5X9\nK8UHWrywyL/X7KfZi9XGx9Nwxj+wtFJOjKYyid+OoI+5FkccQ4g7AYJrtcUX\nC3gRg6EcFjiTmi66SMuVKvFFJlsfq7mQ74sRj1A4YaK6ebun5U2JRjYFKMmf\nGXBl6u04bioe0/2JirJ7XLRaN5NW5sIEHsl02dNqb56Qcs+MWQ4Gv2ywDDg3\n+KSmEOa73juu9lKSYtrbWBE2O6n/vhKnoJayJrTHZY6WzxhMFYFyohiYJrH6\nlHjwsUdvWMVlvYt0qLyy5oU/rFqzfKZQrYbruIUpjse4LXgdb5I7FVWKW0JW\nOXwGSfJkjF4Y0837b1RNnBn+9Wy4d2QfvdIR2rCp2BuMq4frOcvwvCqjvff2\n1MZkRSxlGNIBXFl88vy5co7L6ZRrA6egI6MMJCGInlgi2+yVS1VlE0F2dOlj\neKp/7q77prGBPoeYvvNuwbQFIq4J4vOG4KLKIvRZkdnsYMqI/uWadU8Y6sd2\nbv9ORpa3ERp+rw9ZGwhKUikgS0Vt3nx/tvJqSx5d8mOJOgpezsTgc24i9mmp\nlYji\r\n=ooWe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3F0Qcceffs1VLZlkB0onYnBeBuSfoh+XDos3PXJAorAiBOgMDDeQqVFwer0fyRREUVT7wHhpK1zr5GzN/0zkuaDg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0_1602982817208_0.9685255128486192"},"_hasShrinkwrap":false},"6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cfbfc5791f061dff2060df886ea1c20f0a60cb4c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Iz2BUVYLvZk2aNPDKRNIZxks+Rh6Yzfh1tovIHi2D3iALcCT1LnaCxjAWjhhqc7s2nFU58ZJ8g2fplo3W+gjLA==","shasum":"9f0fbb477526df57017a3efb56df68fa300f980e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0.tgz","fileCount":39,"unpackedSize":214212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5O5CRA9TVsSAnZWagAAv68P/RdWse8x/fBYfb1i3YNh\nTTiGTF/GVoOPH2OQ4f5kPo9mmmztScwwK2UmYa2jtw0yMi7bEZv6skZ5cNz8\nACrQoeR15PkbKHsUNn+IJ2EHesHvBafEPdhXn9OEFEACCR7ebDaLKyzvdqLW\nMmXF54lkl92V/9z1n7DDuKXeNGY4bHEvPDxQXM/ACB3KIxm16cDjbmV2z83d\nMsOBhjgt8FOUDQZtQbaigD2B5H9tPxyHq7NlpkjrCICw7HN8QQwlTu6l9act\nrNbACjbHMec+wUtN8eCf6gaejhLP9/am60Qe87qD2K4aNVmwicK5sQIdLrN7\nHnRYzbFfa59PMjlNYfhMpH7D3TVW2fpQaXmUgWThEk28Pn4++8OnkxPpzJ/u\nHhot/Dil2gK3WH3w16WzPTXdztY+DYWV0qqC0X1RZivkxCfsEygFv2m6TK0z\ndRqILX0rTVsah0YJ1/1X+lIFxj+8CYMMlmODNGTxB/1OBA18CSxVPU33RxNn\nE6vceh1j68iPQ69q1ut29G5Vm2OUmyeIwJ1MWK8cq50B38/ak3JcBLSZVozh\ngsOG134FTygXrhZqajXdfGCjQ8PqgYiZe7fkzZpGEFTH6DDW3ciK5Sn68NAz\nQdf/QqJH/4ENtzt0IdxQRFP4xUy4jwVvq087Vesbhx38Y/V42RIBDVvfy5Gp\nhPMe\r\n=6+9t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHNtV2RSilaxm+0xqShIoMTPQCUKyCUiC6few836L1bwIgLogSJXtW8bQRdjiN4WrZXNWB7gwIYATBde0yjWy4Cug="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0_1602982841091_0.26327539879910855"},"_hasShrinkwrap":false},"6.1.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.9","gitHead":"ee0a0c92f7348428975c1fc7f28321fccd5ffe59","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.9","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-iaRyd6/zvwGn7IS/XxTfTYXIFzNI6Ii923TCfFw3zFBoB7FoIa0zWkSyU7sS5glOqUg97gNUg03fHiDsrVCUww==","shasum":"061ddfd3c3e6a3cf027a926a055edd2e0cc2012c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.9.tgz","fileCount":39,"unpackedSize":214448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5PPCRA9TVsSAnZWagAAD1kP/3qtdYpIZKZX948gnxPx\nHu8C4v4n3WVl3uXxQxjuu01nB3ieCjJjaIqBvi3WWCsw1Ha8Qt2veqjSitne\nyufk75FqdtnU37pg5QFTs6+2yg+Y8DXRCYM9BB31HzTS6tyUTHJS+6ndYegB\n5ftvDSmhcuREKfIPRFj/j+ayR9a2MfyN4qzuoBAEiW1egAlrN9dcWCvVT9n+\neHMGwjoBDFvlS5+Yd/qFHUqBD82pkn81iyS2eAauZRmO8VCjySwsseX+bx3e\neqbG+Ti7Ihn2cUUogDG1EkbdwUgtHrEfJTDWVT+6otGdlQGwu3oTHQbNpuRe\n0QjgcOLZeYQRTjCGVmpA7AZBwDL4kpp+HIpX+r36dn/jyHs4YowFv0NLRSOs\nk+b2Xmq8JbuDPL8xdq4QxtSe7NSGYMvAAfQeBbSiT3rBgXDB0BDP4/DJb4EH\nXohIpv0Air1Sv7znnaf5Y+L4uBJEpDUo8ckMrcyWMZLQ0LTv3cJ2Lq0ra6+O\nMI1Ooqr9iDTJJX3io0qaBqBEX+jsoxVLAJ1Izvo7FRAhqh4UM2EBp8LC7A5i\nrc0XYnFGInNZUnQQgLeWer8Rs/I9iiePzVydJ48awTpJSsVX5K2a++lwe+UR\nnEshQtpI+EqOI9Z6rH521C3AomXe8L9x4rP8h98kHTTyQ09Zct4CS/7XFjE4\n5Wnw\r\n=C6h1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYVyFW5NUdKe4ozwPzPy4IM2THfaOrrYkMjaKTYqV/GAiEA9boKn0VRKCQ3Bn4D0gCCrL6wne1F6RQ8Fqmd/J0mbc0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.9_1602982863013_0.1224528055048375"},"_hasShrinkwrap":false},"6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.0","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ee0a0c92f7348428975c1fc7f28321fccd5ffe59","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EQnXZ6hIH2HQTeXkngv+y2LvEu0e4In9HSSpjsUwj3Xgvbc0M7slfjxAZvXh3hBhtVZvOItTEb0/GETeXtW2wQ==","shasum":"3c556fafe53cca047ff17ae4551b2b52da2c47cc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0.tgz","fileCount":39,"unpackedSize":214492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5PgCRA9TVsSAnZWagAA3OIP/RQ+6boXdeU0a28UNwL8\n2rPwhzEMli0+qvRcuJWoi1itBtjhHwNDQazeGaxCH7+ytTA5LQCCSNL5RztV\n7Sg0pXIjjmceatmn3oPmLGB2RtP/bXflIpz3SbWAkh4UQ8sxwADW6Y56KfLd\n4IT7KYuzb1l+ht8efqDJL5bMVjvhhZACErW83CLdxOJZ+3aH5Xz+B4kvfbOV\nrcvEt0erCZHp0fhVUYraLdesWsxIN60Gw8vvkb63wzgem1CXLsP87fYpDEaK\n5Ep04PUFdbv+pylZN5RTk04246VMfF58sE8WDw+jOoPhi1w8ZVVV6T5VLBT+\nyslKoX87tjnYQubpRRWprUzENu+Nvg5OHCrRGoH7OHyRtgiSxgp1gKTc4jid\nOIxAYh3Tb69+maBNcdeLGEIDruhD8GJjzXqrAs6E6uxYoNe5aHfEMrBHorgm\ndEMFX24G+Tn8eoX8GL6pyAu1/u1uHYwmXnD/h0dIaGZSUy07RZbbrf2Nn/JV\nBFTp5NqbvmSSc6hc+Y4nxYt/e/vOaVqN3fs304NfAm7IZAlfeU0bOJGXPMlO\nTaSeHTPru7CiKGia99V4trpjkquPCHKMbF56LP6+TB3endIpJFhxKYsgWW3b\n2ThN4aDhf7wdideVCqKeNs+7jiAyEnxeh9kclQfeuyF0XE0dHPX5QAUHtqr1\ngTJZ\r\n=unIc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzxwpBRpHb88dw4HwvCGW9LJs/G8+xOIThP1YukBQN4AiEA9BFH/vkh8oDF6Jx9n3tvLnSeXKInTArBwBX6MrNxGeg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0_1602982879981_0.39818536501499646"},"_hasShrinkwrap":false},"6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8414241844c745e7853bbfbaa59cc0705469098f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qnNwnSNpgKng8+k1ZOmTMW6gfB9Ws1Lb+pqOazc8cC2F4cKJJ+AV/kpVDdTTtHKUyKHsxH3/XYBB4KGN9SqQGA==","shasum":"667c07966a36bffb51fa11965134a4078d09cc10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0.tgz","fileCount":39,"unpackedSize":214492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5QDCRA9TVsSAnZWagAAwUsP/1xVwo0zhSWvG4hFc19q\nYn6o2JtH8UoiPcOaDUpru3IgEyd/xTjt824qNCRfz5xNNUaqUK5NEKxD2t8c\nHkhcLmNOAVUXpsscTKsdB0hdFBxMuA3hyjhTlPKtWYAAyzDRNs28+S/5853l\nVS7I/s4ksNN46AIjlnGC82OCGf2pM9sXjtenVj74vpn8KGcFTf6Nw+IZaWhM\ncKE+icvVAVp/6eAfJRpMH2cZnAZSpqYrT8l4712vOKg1LHaegoD3dFKgc+Vb\nXPqBmS16MbXTRvIkO4FGyYhTLpBEEeMCLlhMK9b5yHREZy1ZxiSJPx408OUz\nivtLSmeRMmpnJ4BSK7ypEkhWVQY57YbsHHvgK7GxE0nEVKFb7r45+brCniyd\nRI2ljk0dg+2z9oGAZ2wY4xQl5cxrkw+/zcd0NOJBN+a9tWGGhrRgajRPlxGu\n3t5fz3fdIjYICJIYM3wej6h1oMscH7NpQTk7HTfRMvTJ1pTp0+mtkyZQ05+c\n4Z/o1p8tFDqOV9uoql0ghp89QfV0N+pqG2lPDCCegBmW4L0eT+a8Eo5aR83U\n4sOZwKWX6ihC1oLuhljmPkA5ERWOrip2rQa56Q81HstnR1J4fY5p8S+jqb+g\nWue+B4vj1lm4PmmsC5mdjwfyv/9QaEhmnlrcRjJhKJYpXvplRLHGR+/gM936\njJbX\r\n=ilUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChRPAhSxqqL+QvoKqgNvhzSc33WY2oPWUbVq0bIrw7gAiAG2plbUFvIfpOl35VW+LgV+q75qmCc4yDC8An+GyHT4w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0_1602982915372_0.6811079053242828"},"_hasShrinkwrap":false},"6.1.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.10","gitHead":"602276b1cbc29c32a87634f8922b5bf4e700acbb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.10","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-d+zUUvBARhrv7OK8hLMQjwGPjkJnBKCcc6ajreOZ2X0vTU5V5xa8+K7/QBLdqPBPvAVi1M3tRo+xmftb0FrZAA==","shasum":"6f7b6a9fe4dc8c2fc9bde4ec28ea822aac78140e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.10.tgz","fileCount":39,"unpackedSize":214723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5QbCRA9TVsSAnZWagAAvsYQAJ0+AYGD4QWytA8Xjd2n\nRELmZI1pb8VgkEpya+SuDU5JXXWv2NnTac/Er/JGaoYJuGwgY8676XoQ3RYj\nRq0QPsMfbkQlkHEaW6J0wFh0GOW0s8Va2hz3kw7v+8xu8xknC97cBacDyukw\nzXnHHmWGE5P35RI9UKv/SxahAqpv6OXoZxVNgrALD+TdIQh4ig/6xgBAQgr+\nVsYyvrZR9pIJfmoWYfPrC4rsRJym6xILLHEOWUJtNM0ikJfpUZzYpHVwDJjW\nNRFTPr7d28ffO7MUIVwjpaRqGW2wlG5mV/5GROt4kYkf2RRuKL01FAqnOc70\nRH88hLktRubTNavAlOwgdztkYpRgkWsHwE9yBjuNSjfKzs6snJEfSwnm3Ww9\nDf+LueaUu9HFilXUIXNEFReokRxngwPPyq8jrkkRxIAHdVsJlLvA7xQakYv2\nyr1bWcBkxSg/HM1rSC9sCxDR8c+baSO52IVnyWXXez9awnMI8sDDqGHdusUE\nvjWBT7olYy6Sg/cowy0vK6LstsRPgYN1/cnFjxrSTgg0xT/zy+2H360SY0H7\nxgRDVujP0MtzG4FQm9gdQzlZ6vYRO3Xnkt0u+CSHi/S/xgspaKpGZJ2tJm/j\n/GnCubj0dC5RmrxX5j0NqbHpKwpDwPolwabRzByOWM515zKUqOingUeS69LX\n8ZtR\r\n=Cjfw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIMdk11LGcfJ04PsR/hNaxYh5de2m3j015aJaTUo1kMgIhANZPOYrIYhgnjY4E8C3G6hTV+IjGvRLb7sAaLnJLpAmE"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.10_1602982938956_0.8476537304245872"},"_hasShrinkwrap":false},"6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"602276b1cbc29c32a87634f8922b5bf4e700acbb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-fBYC9kz+N+4irBl++sHczyVRogpszYi1xeZPvOIp24C9Y5velqFo90nNsWhroC/whaLNOtxsozoVQqyxhbPtKQ==","shasum":"1d0ee4e4fe373698676a88848742ef7c2094e818","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0.tgz","fileCount":39,"unpackedSize":214766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5Q1CRA9TVsSAnZWagAAmlkP/3OlFbsVdkByMClIiwk/\ntgNu/LxfDnGOoEgy9ZgAB4e+c9Dw2nuhvnHr79DkMPoLD5LHPynAe3rav2Cm\nohfCv5ArNOiSV6QBF4wBcvAz5wjqpRVxSlExa0DLrRNNnpUTJkr9hYXCR/CJ\nRC7QE1FABl8PWzdAhztZqDocSZyjEDlzJmp4eiZaHmhrJatq4aCNOJQktTFq\nC3cKZ0wUy/Mc1+NHej8NO2ilfoTEyeqa0aAzKaPyfpSPCQ/lUuGZkFpnwLzO\nILSG8l6+qdcHJ6NbRbrOfeC6LxmfUbalu7A4dQ2fjmy+9AGPNMtjGeoAd0gO\nqykHTLLpgMU2e4WnZ3QHf11hs7ahhuRlGzj0AH2o0db7kWn9f83RfTF21R7Y\nN0XnEH8ifIqWDRfvqFMP4qYLpg9lKD1BDP0JPw0UHS7a81/TOmUhfPH6vuv/\nzFetbHNhp5bC76hKwFyXA7Tda+j8hL1fGs3ab0LFB9nSXOQL95zkpe6wBNkm\nhXzm8R05HgwD/B8u0nJbdrlbvme1H3SSxzVAJrgFxbI3hupna9U1T+rrtGC+\nYEwb/+ffeXaASvmTFkEQ+8ZyjVxxGlUMJsbRLZWB2AMIwMFevS4zCpT1cnVN\nMKH9Bop4+3/aqT797TGAh8vQTXpxYyGLS80GsVrNm+bVsRutqUx6dKK4ONRZ\nfWJT\r\n=MeYr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4f6EnCzjTOmJw1iFqpAZONd2Z9z8uN/2OYILsHvhouwIgREAjcVOiL06b1KNgK1eeZWWWhxivTOx22IvUprP4QHk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0_1602982965167_0.7211986501816079"},"_hasShrinkwrap":false},"6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0","gitHead":"16da805a4e8574b578a853badb1f229d10b8f528","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EhgKcufcMF98+L6MNoYzxdb1T6blgp44bgG0/w/4DLJt8QLNVI4PKA6vz/teSiKrJ9MKOggRyiueY/GD5+noDw==","shasum":"fd9de69dde312f6197c8e3c1b49bb1f6d8e00aa1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0.tgz","fileCount":39,"unpackedSize":214766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi5VGCRA9TVsSAnZWagAA6S4P/33xUDfOwgC5tB7eTn0J\nOnDS2xGe21CAcoa3m688nm98fTPG+hLJMVG9PCFeG8uWCdqzqxKW5oX1HYP2\nU5j25Lx4liEZkCtZEaR5StQEIvKZjVH3Ht8B6dkB8gqRc6aTS0GJFJB/CGbt\nfURRHpWRL2N9ZmnDN2EuMnVspGaTkpiZxUJjxFppeVJmNPRE4g8x545z0Iya\nb8DV1TyzazTUPxfoy4ZhVK6dZ93pwujXJF+xf4KrMTh98ErL949cxrMeq8mc\nD6JUVqBMtirXReUjrLavwa9gsPlm9dqMaqdNooTmSvUwdn9as9B5o+azj6iK\nBoxUB6WWRUNoQVfVPefRrDWBUwFqUg90N/UqEY3dSYbs/Hb8yaLoMsNWW2Pw\nV4TIkl6HGYUq5yVDeXLxmbrGh3T3NfXbUi8+vE1AUFDzsbpub5/tjo4H8vs4\nuYMIDF7t9pjwp9UKc1sMk9BfdgPdUZsDu5lv7v7CTIjZ9rResh2m6I5SqxK4\nilL34IItqAeMyVJpyhaivn1YoerSoMckrNeyR7587jBrrovWW67gUxd0prmV\nkWYQq1vs/NG+60Fu141nRl1f0rsdgydiAaZM1cKZ/5E8RH0JXoQCWJUaitlt\nZXQcoTTS1hrz4tt1ybemAgAEVxD7x55KZHjr7EDlD2j9I7sdnlKTeku8aacp\nx9MN\r\n=N53x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhEllkDF5X2BT+C4P8S7xE+DtZohmvyCcmnXLi9Wls9AiBNvX0nh2OmjO9n+hAXmk2OT9XD0uYztdTogEM9dvMKNQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0_1602983237465_0.5396886110354755"},"_hasShrinkwrap":false},"6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.29","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0","gitHead":"25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-HhUpRI+Q/3tqrUzGcE2drgjcqBOlVjN6C58R5VLFrMkh0AbdL8aMpXZTcTjBTOXVaEAUIPJZ6D/U5Q7wjhzg+w==","shasum":"4bb1d22adfe833efe96dd5b475689a1a2ebe0c2b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0.tgz","fileCount":39,"unpackedSize":214766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi8eICRA9TVsSAnZWagAArkMP/jgiqLcfEGyPJNWkgYKA\nh0xe64KWAoFyiiEAu4JF/4K/dqpW7MBswDsI1RxKPs2ineTz0pq6WcDhP9vN\nT0pHPZhqeirJBE56mU3l35wKjYiPej1BsCLeFnYqTCevZsL5ouo9DjjLCp4u\npOCvYrsrb/fDwfwBnZwNg4rHsGO1viKXBbkAVBpCHuGG2YMg2ydoJxTBAiEY\nJcFT/8CdqvRElvyf3B7YUn9KFWU+PW8mU7JWSO4vGEe6/2jMYjV+NXNLbmSu\nONwKi4+KaJ2Xbhbo6s3oRPP7XrfXY1Bto+OTIz4MUf9U85aLDe2z2E2nTn83\nb5+iIAsjqPCWvjGOOFUMq/+efatikdmjWNqmV2UKMhFhKSbRhTQM9QGnVZNa\nGGwg5HKTy2WFl6JyKtHzmNeHcl9MXRd7Ov8BaKE4k0JxZU7vQRR8RDZalzzP\n+yztXQrCtam2dbKs3qRZhAtNPLkeJZejqWRjbw1abZgpwKCnHtxLEbwzHlRW\nMVgagezPSWCw+8oqw47jwkTDa0OjCM7lcr8DDdTDwmLyiKsV4pCI6ZHBLpFw\nDgz0LIoQykXEjXXc4FHqPG7QvnNfqmMBk2qDQGE2qv04wwO9h41tB6e+pPXn\nNna8j7LQaQ0r81GPfUM/z/LbGDC8wHRs2wVlh+I1sv6W+BdpKlQq6FvpVdXg\nmLpt\r\n=tIxa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGkREqFEYGNn1PsPRh4t9mKohENzf3/hZ7gR7FugiO6AiEA5hnsrRw3Wp6zxGEDE5sIKvaaVLFLZT3n/pb7BFpbR20="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0_1602996104309_0.1878742656966388"},"_hasShrinkwrap":false},"6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.1","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0","gitHead":"94fa9fddf23c3d14305329b96e0881274dec61b9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vyG/1KLI9sOKkFAJ3TgUD3jNOoXpQaLZDKdukYpQeE2EpdC5hts0vaq6L32M5KXUlCYNAwoW5AAWRqKcMte8qA==","shasum":"713f3d2bdc1eb8342dfb2e3eb0bba434233c6dfc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0.tgz","fileCount":39,"unpackedSize":214769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjG7tCRA9TVsSAnZWagAAEMwP/RyGmn11rFk8PJMlKfid\naa8CQvBIe4T634RxrODPs1NFQD/Nyhwwgpg3iYYp6VRKaGoMQ84tHy9xrp/S\nVFh2MBW+F7iUTRer9GOlQflh0ZsPOJ1g7CejTU+yrBEzXU08cq3uhE7py4/L\nwmAcj6S6rdqHjQwH8k91JRCU89HHh+p9ItgTQte+qGn3U+ws0mn6Q+v+j7Qb\n3mxRe56fwXpGJ6Usvh2inyt1dguVAdUuO/9Sqi2Q0TRTl4XQuv+FyXbXbBeb\n2tv0eXvUfzJ9A1BgXEitNaEJsNmVIrqsvZ/13/C6y76zoI7TFfROYpgaetWb\n2ow/f5OGy26CAJP2YYLP8N/eMkc/zk86BHpUXmRw8S6nr45fjodcglVeBedL\nZSJCYzTaYx0MnTB1jaRyTlBNvZRgpzIp2+eaP+OkhfZ2Zl+5fZStW9im0iEq\nnKCWOPCR784hM77HLIfk5ex9sGfP3XFNx9EpS5WJpPjDlBS+/Vir5dX6dfcC\nNTBtUTf4w/ygRmMOjrhtVvuAhtzvAXlA0K4+I2oflxV+VLgVCSSt/XiyReQL\nBkk4qeWqOqQi8QoImUlzQ1y2XY40waJuywbxS7u0pWzMTi3Q9ZjsHVU/2C17\nbXc2DtJ2S1LIJa/7Vu/jsTyXQ0AdY/zCU37Nn1J6fDa0k+12373XXcyLU6BG\nHFNJ\r\n=FMGj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6T8cipl2jXFH7zMJaJreQPcMD7rgLZELoGRyeltRiWAiEA7bW4g+znFWBhhUlL6WyAOCyzUgbe95Ri38jiu9IIVk0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0_1603038956471_0.705070688181211"},"_hasShrinkwrap":false},"6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0","gitHead":"9af53f7bd5ff4cf5074ec66ee157d07b354d0c86","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YJ1Lp9HauJW2OvMbVVUf3wd0hsC7TM7Zdd5j618h2Q1m/rKFyFEAR+6u+uXsj3DPpLkPr6shOC50/00nBa65mQ==","shasum":"aa4aba4d793041f1aa8af8a532d5395db55d3b9f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0.tgz","fileCount":39,"unpackedSize":214766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHNBCRA9TVsSAnZWagAA/YQQAIfiK4AyYF9YEhxjlky1\nYqM6H57Pr3rNhv0qZXO2Vq9VlBDPMzY7orSpRYhU1obcAdiwnKOhCXqgo9Ze\nEyrw2/55VnqAACmn+/Z0gI2HHkhVyTTvYJuSlgE/rSJ7mWBJxjfPlcEiXJfd\nYVHg3EshAZPUo8Qv40wNHsTdNV5ehJsxrlo8ZmjFoYyOVSJf7H2dvrJmgK6d\nKU7f+7p2e4v9ngYQm7Dqt6tKp0zMcXxw1t9DL+Dmub1ZvHx9eo+U/ghmkGFM\nxEhFvgNVMQPLOvZW1y9bqUaBUHpJBvzQg8AwFWyl92nmlKgXViwvoxXuZPo6\nIVa5s/o093+r042dKC1ZbM9kRNeODIKwSo3W8eoVCPDu2ZHzuPpCSLXQthjr\nYuxWmysBkoDJH419otpvZXt2KBe8wqSqEMQduPaXxzroHyB1cFDJ0ZowPIyq\nLfC+f7h5A7vuuu5DzDKH0UY+DUBYNQfM3lhGVPqU7bdQKJKSalYvV2wkCc7y\n8liDlWUrC5z67mwgp6o52+k3Kitm5hcBYkGV+tbhXRFFOYNGixd5eMelLkU/\natqwpurl3TT10PXTIlzcYnxjFmrtA5Qgaa5TFXqeY0DPZhKhy+yRRi3pPucx\nCEypSv35fhnpBlOmAm5pG/K0JdjJvhvCI1ceg69/3wnKXVEkSEqB52tO+SU4\nzTOx\r\n=8bFS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiYFfkT9V7dX/I67Moc8i7InKsv4IPDQsBqnNq7CQHnwIgCv2EEpLX6azpO0HObR9JJZWbD0UfEksTO3RIIWMtkDc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0_1603040065387_0.702316358061257"},"_hasShrinkwrap":false},"6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PU3b8VjheCtEbqfmbw9RAQzm/5rkhdCuayCNv9xCU5dIC8XLT9ya74dkcKCuaCz8F8pk3LPYJMpC7xr6yz9xWg==","shasum":"233add1de2435bf04128dd7fb79eda77a2e8dfe4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0.tgz","fileCount":39,"unpackedSize":214766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHOfCRA9TVsSAnZWagAAjCkQAJwo6oZf7n5PDWcBht5M\nVIEby3bTtvD2AeMmOQ9uBptwY2wwTvO+Fx6i2P4oizQb+G7KlcuCQsBpl03m\ngn6nbh39Zhm7sgSckgny3G6+PAHhTsKPsuKGODUjlwOZCEvM6Bv1tiA5iK34\nYMGxjyFJFteyYecI4AEAkEd5zmnjrU4PU0CSMCbmSHsv1QU3IS4X0mX3IOk0\nF/flUOYQsF++Mx7ZA+bv+29xj+k8lFJcKnNMJNVB/A0mPe4CZkW+la+Js1jZ\nwsrlU6YTsqUTLWoiqyLcWTN9hQmH23JPu6qBqcsoT7GtTTTraSmEj9nZkkQZ\nNnZogoMcMgZMckvVn4e9lppup4WAetXVmSP8qRAinylUiSYbtpnzKpvXCCmt\ntuHBG3r6RGKLpzokj1wjDpQFrTGgke4r5RCiUyDtWvGyoDYotzjftof9lc8x\nkDsnY+0Duwyo/0a/i5poS1qvDSmvw8mtmlRw/Tg9KK4+hUg8mkKa7gVADtVq\nMMhi2E7FY/wa3mkmWo6jlSmjLtuv2IyD2sZSupqZf/w5TVpX6SCMZuVML4St\n9prJ0HPo2vVOxcktgu0OdyIDh2tIQ0JL5KSNh+XnQxP1UokK7Pj5C85EQGk+\nTwvUIGRAzlE3ATvCj/aM7ftFqFg8jrNKrmtHV6iK/GANaVf4G0f7t7rnl21H\ncXGy\r\n=id15\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRIn7+lHS3OdTTCkcZhKQ2G/VRXE98/BvYUD60N8FBvAiEAtTPzXWbSMQQFV3P4Bh7RVjPXyDDdVh67hNMXPxrDuew="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0_1603040159304_0.5631567022757107"},"_hasShrinkwrap":false},"6.1.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.11","gitHead":"f7e27f531d1de90d79e4ab864cdd4a7884df2e62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.11","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FlLIERwRPULZgs8sdMXmGNGauNVaifKWpq61zD2DI9gosaOYmUnTqqVA3eqGtOEy+mhcqOCkXNRIGFad3gmxGQ==","shasum":"a788bd9a99fea2b38d73a19a6a15116956901628","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.11.tgz","fileCount":39,"unpackedSize":214998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHOrCRA9TVsSAnZWagAAQcEQAKELse1AQ7RAANr45foV\n2PbtZ3LUWgD7GlPuBJXF5c/Zl+j3Bo7Ck8SblBT/XcXbJm3cuLfSf1ariUKB\nMrNMnRZR5OgvSb54FBLs7tkXDJ9qYbhluo57RFEq5nbKLeRypOYVs2HjudDV\nmSsSPBCEB3nULjoa96ywwhuHbKUO0rQW/XZUpmwTakHGuA0v1X+q7l1weojI\nvWT9f1GBkQIT9Bz30wvA25Ffbtxfli3XNm6CgAu9tz6XE5ln5mPNXXHl6WbK\n7Uob7UYHL6tHxzAZzfs8u6ifI/qyTAbREzPk899gl4CNylgSTgeWderTbCgY\nake+kq9uQuXcQrQklOB46l2RNEWYB3XyoKk3QIAymdIr6OEKvxCxDpjXww1m\nfyqHoC90UssvjDzFEYfOdqSQua9qlx8xaBpQ9J0+SZjvoHIBdQ1Ov+0Jb0oG\nf7k9K8wDcc/AY9uy/lvfDwWrkgpe99/SEV2L4lJ1eM/EPVpW9WDolaVw5uI3\n+x3BxOIqDHkkUWMPE4zOUHuilV6RD0iSJeU66PoGYtc7hKEX9/T88WAMnYYE\nwWISMOIiToxxirCI2aQBjtCxXBzbBRHA1uNi6RpN8DwrFyNly9sHaqho8IxV\nMzd1ZAnnjAwPF2S/b+nfxIhDgkemeCqSPmC7N3LtRyjXdWEVOBZs2+ZV/VqS\nk6gB\r\n=EU/u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8WFG6F053xGe25EEWmMzZktaQi++pXWSmIL/1qq/buAiA/MSmGsnDUzip5yLVifX+4Fpuw2N2ePnKw6EdJJ5TSWQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.11_1603040171204_0.6097851071653977"},"_hasShrinkwrap":false},"6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f7e27f531d1de90d79e4ab864cdd4a7884df2e62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Co42yF7pdPiQczeJG/sAFlhzj/LkSTgrmELGUhH5K712FI6AARJZB3PO8rndPYBahl79k1NZX9dCR+tkhzkyBQ==","shasum":"01f609334cec0a60951fd18cda743b74bc937f62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHPDCRA9TVsSAnZWagAAF+gP+gJ1GEGHtbBwTdKExsil\nilf6lmzBEQ7Ov/eS2BR2DColoFV7WV8trDkpgx6DmkoOIMtZFIOFFdI9hWET\nm0BhYKJMtxse1f8VxccxzSzYQ9I9Z/7AIJlkOvstmstiN70wXoC2/6Xa5vRA\n6WlNQKrrDRCSOhMiDJPP8Ei27yaowtEA4aTG4qIeibWllH0FxU4LtwJ9IvLB\nW6CTYaP7Tc1zo+s+mQVH3V7B658Dn9LA39bOvZRyecujdLNlrjZOdQpDZHEz\nUtxqLREhMM5BXG2Panfm5IyUyKLJmRlo9md3uExiJL2MKWzQ968dI0UdA+ns\nR49+U40mK1b3wrHDnwioatVgdWjeb9JAgBmoxUnhCVMB7kGZxuiImdYDx3aY\nkkrfo+86P9NXa22afCKsXYtjlWLY6FmylNoY60lRHxm1EIuuefo7V9wjff7U\nW+vpSOJc1R6z5B81AOxkoOenziQxGoYLKLY4VPW3u9+NJrF5KmR0ziE1h+vw\nmTiY+uCF1gPhHdFbGQSsG7dkWFilYdfKe+Rkahl6ymTXp5Wp1qQDzVkWkAVP\nOLmLVGrWMQ3n7EeKHwfaqIw8OTTxmKjZKPXQjMbKyhzWs6uzApPpiwQyottI\n1jxsxmy7p/YHV+Kj95QPDeU6mN4B0Aw62nsjy0Xc4JKYkc8qQKgX//OU8IaS\n+083\r\n=B5oB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwhbJZuI856I3cq3Dbw+ebELXPkE7goJHJhAY3lLthcAiBr50JY5vaJjDL50CPGJfSExcn3aDbcwCiRG4M0gEGGjg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0_1603040194784_0.1884108707258405"},"_hasShrinkwrap":false},"6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0","gitHead":"ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IvB6YiShSCXhqzWKJqD4p/seheuTKiWzdOHHo+beR9/FfRnKDDZXgRWyVmKAhAvH6wJqiLhVbHVBjShRtJOyiQ==","shasum":"7c78b96dbb43c2c4eeb61e5b3c3efe9cef66d6ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHPOCRA9TVsSAnZWagAA3WEP/0TKtMDPnBQxMMda5Hl0\noJWOtSoUJzrm18Loy6sbqCxGrnAzwvlNoJTZ1NQ0PE+sm+b9DMC4YgUZOPDR\n5oh+tcbEmdAX9bdGUTjiYTTcyuhzLXYii7PJ1EqufpKe+CGjKF7IThyQi1sG\nNzbban46kBAwP3wQe0z8L28Zm3aELXGiD/W2Xe7uEoky/pLmf3DutayKLAW+\nHzz8+D4NnDmtYcIF004yEF+m6G02GXZUWlhF3+WU7iB5EjdlVu6oX6dEQz50\nsUAM8o3AluQJ4qozwYxzCmg2375BlvobWSUYc2cf1yhjdhmEK8gdhx4qxNoc\nWHyYEWToD16+wmDfv4VYRANOQPHOzotpuLmOSCJGfdTGcZHo7qGVPGHDKMiL\nqF8FRqIs2cR9K7Cby2qwjZ9iyGoNU3F7MupeKd+fBZJ6pg4kd/MScxLKhbLy\nzJGe/kDOpAN/YB7Vf37HwSHjUlAHujsOGskVWTevyaq41nwIemi8x+UkeTvC\nXGHCH8ynonVXbT/uk2gJrBJ3yTlQVFC7LWysc/qqavr0euoFmLDmYbaJe4yd\n1th7ez9IgzS1gE5jWUClR6kfKIJoji+KDg+ojSKzqmitbWcpPg0ZiwW1Myhj\njNY/LOCAZB+D2ggneWTLSZya8x+yUoARaLXRAn69rjtjR1AO7ZuuM/c8gRkS\n6CST\r\n=ElRz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE6RmxUyhC2bJedSHdnZj04amRHViS5DZW8+zG7IIYcSAiEAoO1iTsuGl8XSljxaOQRRouIa8ai3Z6f7IM0GivKMYQE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0_1603040205615_0.8854239546263407"},"_hasShrinkwrap":false},"6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0","gitHead":"f65d8b92d20f2d32b835e18105530c41a33b5949","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-z+XKOJMz6v+nty8Frw7uduvGRxlFHiqpHoKXKeM8zQl+J9axwtlRsfiFBKjaSkDtzpT/Tx4Ih2VJmnYJCg8K4g==","shasum":"70f7da8b1011d07014b0105b90ba013f2cca6138","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjHQQCRA9TVsSAnZWagAADzMQAJxG1vlR7mZsseLPngL7\nK/76Dcu5Mwhj2qLhJ82/VUGqyb/sFDkfB9dDRc+Yd36LmJcL1FlJLIxv9Y+T\n0ms6Kuo+oMbdoaoXjhg7LG99sijcsWmyqSOrF77mELSYDpHfgGnZmb1Xj1iE\nfuuM41iFOUqHl6fz52mwG92oknTvfYYOe91aKWPR0gkXG8hzs8lrMK1snB9W\nTxAdgP9e3nLeD9U4iKpp7rh074fhiyrbH/1WZiU00DU4MQvHn2J1kJ9ZNNB/\nqozJZhdB+ME3DdEu7tgNvYH3P9IoDOgLo3E6pdSHdKcrBR0VG+B0inAiIlWC\nnCezuEyWRerRoDagd3Gk+D3FcJnfZAvDKAGGVOAdQZCERN1g4g4hpdZLJOiM\nmKLvSiTiupEmVpjBnXAZRWc4BbVtraVp4J7eG7qRy86ovoOyoZQqE+wq9ItL\nA4WibGh67XjzDnFnhPxSAL3ZAPr2Hyd3tzuzhfC3utkPaB3SaLOjYohgI2oB\nkRHSOXQDMD+ZYYE7xbo1tL8iIvtmR6Gk0ZDvzdGQeN/WTanB6tu59gx7ZZ+n\nDm7HxZjL40ivQ8Pxf6TjTJanf3hLTGscnIZFC0vAxIwfJiU/OaTdgW5O3w5n\nUvQF0I2l2wBXedDQYmskALBZyJpmdhknoPs/reB/gZrxvJmX9HhWmF5iJTfp\n4bHH\r\n=tqlo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAl6xE6lnFp0AkxivcnwTA9dN5y5pbX6zXUKOFBOF/6AAiEA2Uw7c0tmUGzTH3EASz6RSUAQCTX6OAqaBebu/+zGFhk="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0_1603040271613_0.4371510840522934"},"_hasShrinkwrap":false},"6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0","gitHead":"4fa1bcc93c15d06889f3cdd8ad899ffc725922eb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-hg9PZeIy+QdsLnF6b2SPhWXbaMiY61VO1biGq7/14Qc9Quq/MUJyXsVCrS6bsHuJ93l4YtgzfLP/kWMY6Hs31w==","shasum":"34971eaaed753964b720825c10873fd5f100e653","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0.tgz","fileCount":39,"unpackedSize":215044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjIVCCRA9TVsSAnZWagAATCYQAJeID71XNbw8XJTjJx9/\nkslzUe27NP3sUaCayn4i2k2cBhARHDhNAexvoZsKdMdt1ccck9aFGZS0bf90\nA9yXovVbMWx2pb550Ukw8akZQkrUYRQGPmeKb7RaXZA87QXJBBJTAKtNjRqJ\njRZFc0iBtVbM+wb+fDVqvRwQa2NI+YyqFXwRftYevHwDvGNBspcWCBEfVhhd\nkK2niX6F7omerclXnIN9e8lgYQ39Avi/DHcd/BIbU/y4OLzvOh8FHiwOKUbN\nCMnYwzkqWt+WjsmB/KIp3aFNJYbhmid0MmxgdVSX6aDHZgQdU0uUAwaA7U7x\nMxgSKxUvtiIYwcVJXvQE29YryU3A0py3GOoQHqlxZkV4TieKLlCH2OxR06o9\ny5WeYJZ3Rft7/a9wlcp8GsHQqQ5kUb8x2ibgPTrwPN+8hLXAF96gPa6c5dQK\nFGeeKWakwjyPouAb5JkSfQUWj5Jqzu38+r9eo6gjolyCH5m/7S0J2R4ck9wu\nhrAdBE+V6qjIZAvXZiBlBRp/EhYNWgB78NwYf8qV936Bve0Mfl9NXJeqZz7V\niv/k6ourdT9lzsZW2Ko759AwbQp/SzTEAw6ftg1i3GVhH9glVNR6vykXAl9T\nVeNlwq6CHfzUX09wE+CQVsy9NhAYkSGD5My5hqVq3Qe+4wWVHY62lgCyONh7\nPilT\r\n=nU/H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmGcILfw8dLyQp/mlX3JBSP+n37ATKU+O5lhQQ/HpZUAIhAI4VoALbSIRVrMKnIDP7dQZ6yY/6nBaQOrjHl7TgbKiK"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0_1603044673582_0.11777168440704933"},"_hasShrinkwrap":false},"6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.29","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0","gitHead":"c19edcc28c81db91dd8777533948ce2b9be078b3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BnOzlpVaLQ8ePQzWqW0s2+3P+NREPIDS5lUUnYBwd/ArbHI9tz5iTPbl7tI4vdJAz9EY8yyzqq4TwPGBFpr4bQ==","shasum":"340717b9027fee72bc48e73e9a58fbfec8737e29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjIo+CRA9TVsSAnZWagAA0H0P/3qBO1Cy3kRipZMneq72\n5E3iHw3g+FMu3ZWoFz7mP7iB3SB5V3QOMr9E1zpLmvQ3zPj8sC/l74Yux/sm\nJuUMl9VAqlTpKiBno7d3llVD7gA1mtMDKxAkJ4JVzUXjtRoDcWXfHeIv5A56\nTliTJac4p29l9/1Kr3ucMhK0Nl/zzfveGgFD9DtJoFAuLvlSWsyJ8LEZpi01\n6BBwN+sK9caJlh2EpuBAf1AQBw/Zo6eX9P49Yae6wDK1PgkU/+3L0jGS1gOD\nOvHkUAEQPFw+i0EjIXUEmR5KmJgT5YvwSdU1sixdj6PN2nr1AYWY9Pegp0q0\noffTyYxeaLxVWfwM1hpyt4D2qYw8SN4M5fheqwjbLDDOKdVcokknA9QiUlht\npMVweiJIQ80T8hdfFCOPI/bEPbyBjwXJ7SFfVqGrmNt5f0aeR7HdygcIwLrL\n56QDZSdccAUHaabTjjOkuakWpvOvmEbmdLLGw0nYwROfoYH3KPfqhHQWrEJ7\nfXKFqgKDGhbT8e1ODlPFbN72BbLpY4AceXw9x75o6jYL6fuCQ9WcKxfgZcxf\nv42UzctPwwAnBAA9VGQKbvecGLgn3ECW3q8b8Hnjuot/seyphbYQFgnd4iZf\niNpvE+Ak7QZyfzayd/+jPDQ7jk8/cYIQajBwjTWXv+GsZ/7ilCM3b+8MGBO/\nmx0m\r\n=ASHO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsxnEo11bMKzALsTFmOsFQMaMi5p9jlLQUaT2fkAce2QIgNaYIkji6YxpUIB3zA9iFbTsQMxYwZf9GbGuJNrMwg8E="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0_1603045950230_0.6903949835826124"},"_hasShrinkwrap":false},"6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0","gitHead":"dfa658ba024c5eb9e463d4ba712a7e74a527b1d5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tl6xI2IP8DKnlP0Y7M5vpgdNLZ+T4fExsV3E+RSKlujidpqZQxWfnReCUOSVum1B+3JdsuOuPKp+ceUSlrUvrg==","shasum":"7690b2ce1e6c024604d5513105acab512bc2e2f6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbMACRA9TVsSAnZWagAAMd0P/06e5DHLO0aC9zWSoxNN\nItHMczNbDCgEuQAI0GQdwOAgMRVayT9TtivdKosZfjKl0HfDz1dew8yOfD7Y\n6WhbAS11PAzap+YQG4x9j6O1gR9wgbNdyDpJYFvf1LhEq7fCAiizR5ENxL+1\nwv58kTh3rsC7gPjGvA5Wtm2sAtN74jk3KhqdnvVAxkUWmyqOGqKPUMYv4ucj\nR4NMSSyJJiz30cvYWcS3IxS31V40GMTySTZVjv2xL+5x0l+0ETjA2+UL/bTy\nrkdBCzPrp9mm1YJCWyrJsi8HT6TGwJeT+uJ1lBU8pU8cof9AceuZhE/wW1nd\nC2uNIF8Gq6C9eGt9A5nqCh7PIw1YVKWqA8oyLabcw2x1tTh2cP3oICkJXben\nOL7GRjt3vXP/V/xsNZpHFny/oRNmn1MxH5g6sYZggCwHkDmGKfzBptJOYod9\nHD96sgUKuhV4zSpPVjb1+O7593/pdnPuYSR1octdNZQjF+19Cp2peTSAmvGK\n8O4K8S5TqJxXe9LezUPLTxPPtGGSxF7dcd1dzWevvsMViVFRKG+nIe/9Nyrb\nkPOocM2KyqGnU4PmCBUectkhzSk7FJY6kOw0jBly/+k4bnWuaA6TirG9L32R\nKgJQ/KTlhjz1rkM57vg8pJKGnZ9OlRt27VKasvOPoDVaHr6EHqDm+SINkTSN\nBXC4\r\n=OzLm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqY8zx1N2DGBXYAMjjgVxmRUfLq5L0hmy5kmkd1dAb6AiBwC2m6Wv+xGpACctOcO3cOJOXNJquy7z4wSqBz8hfWkg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0_1603121920248_0.1266980125817203"},"_hasShrinkwrap":false},"6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NEr7Nkpo6a+2a6Uk+S7jW+4YOZSzgGCUfUpk8fSt48FAt9A1u0EL7A+BGscY7hS4Uhg9fDKVsJGTqarUe1wAkQ==","shasum":"88ce999f79ae1fd0f8c5e9d8449c483f540255ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0.tgz","fileCount":39,"unpackedSize":215041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbNbCRA9TVsSAnZWagAAQAYP/1EBcnw0L6VkgIToI7fD\nzF3APcp81ikEbWTr6R57UZ23P8mqPrqs6sb3V0EGWnL6gK0VuZkAb60ETMlX\niXwzAWUpypC6a6+YxEXR5LP4o2SpvuBIjV0wq/Hr82kg1ACn4OYVVN+L0ETX\nA8bBRHe6TZ0SgwznpE/jjklCGMMNhn8BbdDMBCsYUQgkUk16RvjB43sRif+U\n4J/D7ti++Tf2MQaMHXoOvRssQduyADX/mNxSctZQ0JWr9afFe4WBNf35l9FT\n9THLXreeEmkbJRT2KUVO6nJAblr0cqfbSCB3eY419B6SFKDZUejvCblv93Nh\nBUHQCaMMslO6P6ftVd9y/JI7C3Ws5HSCsyYswHNL0XTj7Rt43p1WahBU8IhV\njia6E20hNF95pASKsFGcFIR6coby8l9kowxmem9BrISwsCr4Txri8xUai6ox\nuMrQfjiJ7bJYaK4Sj/TnKMmKTp0f5j9ZXCr/UtdrQvvZIZTm0b+JK3s7zix+\n6fRMzL3LAAukEamB7EeLGuLcWgNn/UMWkH5oNVgChpnMr1DIACTTRrBO8/2q\nmM7LcDss5pS2C7gw0kGNKpciWQg3BePhCjaK+9MDBpfyN7dE0+rvGJ1AYvrd\nqEVnJW6FrMF6AXcSasp+oyhHMbn5UrL/baqc8rp557SjRdmwuJhQsmVxDv71\n4nza\r\n=S+t3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAiMdxdVarMAHOPZ6cNfqa6FR73mhQqPLe2y0++DzByfAiAbapXgDGVeCTUBPL5pFE+ho7KYb7ZVwmWzWjANhpN6JA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0_1603122010697_0.45304171196798615"},"_hasShrinkwrap":false},"6.1.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.12","gitHead":"501c0d6dfa721f75c4e49d7316926912b56b4407","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.12","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CKQN7hxThj94RLopRvCLoZZSi7znx8CeUwg5D5KdLne95fGf/LhQ9l/2NPfzz1AfTzEzl++4ZGy42rgdY6+3TA==","shasum":"835c477f02db71ed6f6df2b391f98ac25d4cfa18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.12.tgz","fileCount":39,"unpackedSize":215273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbN8CRA9TVsSAnZWagAAhTwP/jAxsToFtVZVsnIzI69+\nue7d4XoROrtupuA2umJNDg1Bny85kjsbSvwAxfCbXKgISmd9N5mqNW7dxSNt\nXYgXe1GU63WPI2pHzod4C6DhGZfOTibvFswH3CWiB0MJx+YlwxLTYcAlWe5j\nqYuphS21yTV2fAgmcgdqLBHmvUGSmVXz/MO/+Q80uKuLFiduvZmPWEErKvCN\nD8uTUaMhgSBDTEFvjNYSBa/RnsEQWRSI1bVvKGRBZt7J+nEo2s8J9bJjB2iP\nFhr95OmEE5HjFf/+0HzsX33rOCeXvxd9mbzuwz5oeuT4f1dVnSRNTY7pqQy1\n+9LBkQ9moeai4a7crnSrJTj9O2+B/70+bgsDMkWtIUj6YVGRvLpb5vN2IzAc\nRnJrJMb6PZKhyrD2kUZ+wdx7Vq8G5f837UpPBn2EH6Vm/TyxpPz0q+tsEQoK\nHdI9NWJPeuWII6IdhPr65Sfl0XcshC93d6UTdgLWoPGU1TA1MmTMlE0489Ut\nYhPkdZM81BtAS5vZWwbl8jLBSWElCR8W+8kdbBLLiiNIauH//SGIdWWZZQBe\nqZ1dNCMX1qWYa5RW2FMhdZNkNnCmET+K8lXAl4QXktAktsoEjDecJVtHNbNI\nI6KievZiofys6wk81wnbg3aGqN4PZEKVSptx/mBm/HL+g5ajPbw533cSddD0\ngR1n\r\n=s7fH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVlX2JS+C+OMMHvXtb59IoJrBBpc0jtPB/zv04WwsK1gIgeLUMP/Ai9loyX3off/fPRLwHsuPlFFk+EsNMLbklh60="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.12_1603122044179_0.10249125564172967"},"_hasShrinkwrap":false},"6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"501c0d6dfa721f75c4e49d7316926912b56b4407","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-HTeIp/sNmJ4p4+jMZRvgShsUblndn1r2n2f2gSSzGIXv8ZupcMCQLuTPuLykt41Hxitk/i2VfbV0tacwZLFpJg==","shasum":"c6a7d03e29d62818baf6f7613c92254777d782f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbOHCRA9TVsSAnZWagAAdPMP/RhHMLll3U53yy10YXkO\ndAzYd2CmHXfQ34kW0/UXyHbSYfWDwdQv5xZkrREdeNeyaXGsyIx2c6bEKP//\nOiGI/aO2HCnkhbX+IasMXnRvuTw+b7TzKqnX5+HKfeCW/0lpLnd0B1oSyByW\nTxoyZg/qGTR2LxNGm5AlxzDfVXEr7+cM1UlVKx36DdaRO2QeOzKufEw/L1D+\n3kr8ZcK/msbEyIJsBcQvEtN95IBnbaApExSssjORCMCX3Nbv7MA9iF7T7EQW\nbCPiTSEJPEEzSNVuL1k43ZhO5qsk2hrKEHsy9CyLboXgjqUi7I2OcJ4Nl0yR\nvqYYGuOG6+hYyKbf6PnvbqNMfa5Ks/6jt7NFrUVK0TvdzUFUMqz/H1RcREqe\nJarRdd7Rqjsot5AwJYvF86dQ4BO1Hp8pybxhmJFc59O7wT0SDblPif2Jv7sG\nfX2AGHOtClYyUrbGoFma+50wx7cnOdNWKF/aJQh22ydmxzcAtMH/Ay122aRd\nKnvWLnGUoqjtag0ihzvAIfgXimJOSNE1bdANtO/5d2FhTTmk7BhwRNNvjCV4\n62SqZwjdRF5gFzLUDWkMVXmobvYCupokW1huw7zEkTFduFQMwNQMVBm33Ogm\nz9RPoihohvffSaTCe8T3K9H2HThivjhsIVVryqI4NgqUUD60IMjpyGR2mO4Z\n/XM5\r\n=HkqB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYssAj+dQqMzXuUsrUr856pfC7TQ8Pi5ZQ5hoQq//RewIgD4fQ226pOhoxfpxIfVs/Vj3+tQruB8TqG1/ukkrgIxI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0_1603122054906_0.22777236675123236"},"_hasShrinkwrap":false},"6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0","gitHead":"fe4e3945d183489cd4ae3f09e02cdbab202076be","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-O/fwNPliUSPwzMP2q++3F5LlnvncCq1r9KblqZqFwCwhsUoRVFxOf8KHUp05wHFkwm8lP1bz7duy9JE1DjyIHA==","shasum":"44346bca1df1ba7de2f1a71a1253f31f93ca9dc3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbOYCRA9TVsSAnZWagAA6VMP/38vXG0HgptWn/GC2l+6\nzf5I/iaTh1yEeBkjkpgpJdJlvFqasVN/t1IPQx1LtdrKW1OWzHbOyzLGNDUY\nfM3adeiqw+LSshib8VBbjWQVHhhmfkyn+gvxdm79fLl/i6EJIszeIUsj/l6F\n+QJokJC+leStt1DEWxEEzM/eJxCXzLpREc1UWHlZv0NzXO64G5Rfgnqi8+Eh\n150WpogUP3HkGDWuO89BZWGjsMOGkAxR16ITujBTjtaxdfD20cXdJpc8Z1v9\nujZJu9IbMKYeAp6vMoI2xnZLQWO/cT/lvHrDtbexb9y3XmtD2mkT6LA9ORWy\n4JS5nOKNHOVDvY9JaWipMgbekD0ckousdLAvdCds0R2ILvjgIISDWh7AyPJb\nqg2nD1HLDALSnV88+OS5VtX0rZuIkuZ7gwdNz1+wSs1yMBPyUBj+lCOuis0g\nFtdaYy/P7ZncqhzU03R3mJGTDY/sBUoWl/ZnaxPbVz755IbjxGdAo1TSrGyl\nzD3EZfb0ZQFc1kQc2rkt2nb9xHMn0BGwJoCj+2mgbhT01KmvT5Yv0w8qZfYc\nsgh1TdQhrH+XQlOG9DnZKDUenEHmSzfKiZ/R1KijmLCFGP3pI+pOs5+z8C+R\nheQF4shP9u/k0pcPqxmUgj4x26+ZgySYmz0VW/TptfBASUTUDO/X/lXQAZLA\no7M4\r\n=b9GR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgOcoLXsl1549I8qw2cw8Rjvzq2WRWzM4dJB2H4KLNJAiEAsyEaitcfg2IR+yJctLHVcu1awWQjUvkADy3rPhmP1f4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0_1603122071742_0.6110051154920069"},"_hasShrinkwrap":false},"6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0","gitHead":"92f51823b1ec472b5eb93f97c150a1646376fcfa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vKPdbg5kGwQjK5heLqUjAKEJVaQrPNNnQhFA+BINd1ItHFJBqrIxLOC0ZKer7X6Mn0Okl7jWY7MSlIjuBoI3zQ==","shasum":"496c3273319a04c3148a19dfad1a1522983b031d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbOzCRA9TVsSAnZWagAAP98QAIK9Nz5ME5cwMhoN6ePq\nxJUYDNBLwY4Q1a00z2GXTsFnthFA1bkcFiSRMePDmHdZ7szq8s43Ugub9UrY\nMSpDguly2rgJSzE2EQ6S5cJPlZi4EGNJazBYrBXcPkNIIG0HusdPpeC2GRBM\naawgPQ0ogtFFFZM5Oh5IGQKYKuYDU2E5Uba/fU4StHEUNassHG1oLqTXakj/\nC7n2ukehjx/F7pxONWxDb1mc54RjRNRoOtd4EztwLdlnLTND+rrYZEExiCPk\nXdXNdYQwVAtYPFiIff7+Jdxh59oSkJ2cPcNSx1k6xmfBZnkWWECamxb8i15z\nC5orE6fNnn37OV/DLXH2oL0wvRUCCHeSzl0wolMrJohdVqaEf3PWLLU93hFd\nk7emp6c5tqdrol0Qw/wOFqByaFQDQexepNo9U+7aWg8RIYg/2Rwj9t1Dm891\nTzFLPxOd7Db784LCtrwRtXquIuNddTE9qMMGeX+ICqytKegcgFqnpw+XhGKr\nSxmFkZz5xz0YD3tt+5Z6Nd3Y5QWMvhRVdFiS4z5xnTf/THbt9bSK42xZEI2W\nj9BP1+AhvhXHUd8e1K+nj9uypGlVZTXhedJJjr77Yxv8+C7JVyB1Ho3OMp9O\nw1nL2ktQxrt6ke10dr8+U6WEuoAejioSSLZlXqW8PHNVDYLKw4mBjTjAROxe\nHTfL\r\n=M2IS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSsQOMACCdcbty/hDSxKadQ1VTS3Ql5WU0olkwtzcBaAiEAli5k/Oth78VvaUv4n7hIPb0qTBJvWXkBpYUYXfIp7HY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0_1603122098771_0.1446154885135298"},"_hasShrinkwrap":false},"6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.29","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0","gitHead":"68474fae9902cbbeffc89d5151e33e8542398e15","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-iVziAzgRG0TA9aVXBPm5JEeuuuRVl4bkg8EFM9l5o2fkzzQZrSU8m42k1ZxYSXg/+58fL10H7V7mD0CINmF4Mg==","shasum":"b22e05fe98c78c7316aca60daa800c7f884f2043","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbPZCRA9TVsSAnZWagAAI44QAIHeC8jFiCWoc0ohYJ3y\n4hT+d+XsBPhJ6zVYPX/esvTMrZt8XFZpYhuopXwAGPEOUEO+MjDnBcqMLbmm\nqGUm5/IBGkBvyimY72SoHF8Lj4FL5DRSk74oxVL1blGVHEKswmff0XudNnRy\nSQsYxUDoyMQQ4/Pljo1KJmgoJBHykmXaGy5rQe0sbBgNCv4RTftgN+jdG+eg\nkF4CbswnwEKhm6cCcGiIMCWZO2+eH2Iq4Lkq/f8OXD1DzvtFrBzLYihwKonP\n4JcNELjTmUS6x1ZZ3YF812ABLYlvTIKU3aABpumGsHe+Th2ckmwOIm+zCeFE\nRGy2nyvJozH2AOUXqhFr8x+Qh/o7X5UL7/iC13msQAGJXu0dSIv+uKW5kqzD\nstG63A7sjPrGY8mWLBesIXIgnYczBUOGMUU0llPwq2cogNfJN+iJtEao2ekV\nLCTcncN+fhoXhQX6c6s6FGyvOfHJu+4/0ll44EA3sDWEtLc8yiYvffQy3ftd\nktiQXgrxjxYqSbcfEjH9R5rU5h0UI+8pW33Dr1jpmqcKD3vg+fPNhUkBRNcl\nn/4KrdB58AdRdUgKhcAvsIQMfAz0C1q50DbbELsXapIsQP5EpVgwgrBt+iRT\nbZJK+pAWd5QT1GcwrYXk8c6YzUHjFc/yq35nFlCPqwArtFbFe2Xry/cdl5tV\nEgCY\r\n=pIy3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAOWMo9Y7JDT27TpCFvPjs3G4bxccbyIu5UT32wQKK//AiEAxd8sh+zwn7h9QqhGN0TJ5I7QPLUD1ZzqfN34z6GbCJQ="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0_1603122136514_0.13736405350269876"},"_hasShrinkwrap":false},"6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0","gitHead":"8ee4bb835752f81a760e1820b20f808bb4d0d08a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PRA+ksmvcQhO/6Fkfu8zy3fVXIgzlnk0ZHuTcrsOVqVyQbXjWP3Q4jQ7oCGVJTC3a0/zCsLw1YVtxJ7r4Of5sA==","shasum":"bb679560dcc475b6dc75ea76af2815b77dce5c85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0.tgz","fileCount":39,"unpackedSize":215319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbPuCRA9TVsSAnZWagAA2BIP/1ZBf3U/IQidR2cntR+Y\nXZdAcbTeysUjf0TCs0EDQ7Dq/HKtfc1A4liGDPMd8ak3/tFexh6WQ3cEDugW\nHCIo3G9LPikX85DwxSzgO9cY/IXvWBo+u3d4buiwl9DZHV1JKGlMWwvFieWY\nqKLVBvi7x1Y7aV6QbzH7JVknYxrhEQKk9jrnV04o+a3gTu0yegGnhFbRjO0N\neSRW2a86eo4JGhrWKGSKHvdpm2yfocGjc/WgpQxnb2oyf3mUWM2qyFCFWsef\ngd2EK2oLo908ONCSnELaQwNNEqWXIFSkVdtHl7YkiEemqr6yJT0b6kadSTew\nI6b15EvMyOhdGvdoyLcBskXQheKg10puogTkQzOZ8pa4EOWJ9lzpemw4EwCB\nUdy+mtPxhYO4Zub2GtDq9h6urZpzBvZ+tos0CDqvcEarpTa6tne7jLw7Dgw3\nzE0XJZ33xbeMMGTE+MmeOyi8d/lJkHgXnzPdW9y3C4ACePqTUuJpRNcXEhD5\n8f5Dd6zZ7YHr45ysqsFwAksPMl7jQIvYdJ6XZECNab7XhbVs/983MasT444O\nUfkk2ffY6+SOpEZHVbqVzsdaqGzgn1Si2h+8XEB3JF4r4yLGT8ah7L786rRf\neoGt5NybgXW1yZdLmwTbZcdTrwIn75hoTb77H2NebwXJ0DVU38rEEjK01AsK\n/mZj\r\n=/uQ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwYFavK5GMWtFlYT7nX8Imo9RJtT9VoPhsvkFFjFbZUAiAfp7vfrNFpkf2LF/sHcZe3G6J/1Qw7Xsd3p7mPtuHuFA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0_1603122157656_0.2521212800971675"},"_hasShrinkwrap":false},"6.1.13-a422c41df86f43c572431abc49fbda481109a912.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-a422c41df86f43c572431abc49fbda481109a912.0","gitHead":"a422c41df86f43c572431abc49fbda481109a912","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-a422c41df86f43c572431abc49fbda481109a912.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vBQR8Ef2jwoH3iDeMn/CuPfPBCRLNtQZj9W+1mBF4hVJ99DcwQj7dcJUNaTeDppZegkzktICArGOBHyd7Y9cQQ==","shasum":"25af4dee9a3272a7dfd6df78ef2625c7b15064f1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-a422c41df86f43c572431abc49fbda481109a912.0.tgz","fileCount":39,"unpackedSize":215319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbReCRA9TVsSAnZWagAAIZYP/jqZkP5hQqK6g9hSoytO\nNTV2fL4++q9BzlGpH+4VatOjxAfBBulyrJmAqvMSXwYKCt9luvtxvOjWzk33\nOkHkjCbbkOqc9FgAmmRMQJlep6k4Ok9zGfZZhIWCVGvjul5xPvb21VeMrhLM\nzL27f0BtDpl/NAiCx5JXz+dOIKOf7dl57O6xQr+1Q+98h88GIRLLpAJmV9JU\nhgDnkrfBcGNpIQfFvB8E0iaYmkmnS3E9TJdY/y2PbEX+7IM6rNv6eNF72GR9\nSCJPJasExZ06z7qB3lopZyQ/tVBpWSZHrH6A+BWGx5f8y/0G/Xciz7grEajo\nmyQ9Fx2+xvkZMVtOP29gzJ6EIq4OkHM3/LCxcXSTBRZ8A3ucPiEuE0jrkbwj\nbwGGLY0sKY+0W4chqc/bqfOx5f3IKX2TpyLGUW6YG3y5DySFMNBGhZxiXw++\nuiBjCcQg6CIJck4OREQbAva+QFN4UgmD3//5SGvAm6pVVPdStwjahCyTbPoN\nSggW9T6iIzg2Bfo2Nv54+Azyx63kBBS1C8NRVG5yFE45rc4SxZ2ZjrVEe7Hb\nsFJYDEt3ruiNFrVYFto1R+YZz7y+4ZCbDxVp2Z6aVNYcyPnvH6OnXOP9MMRf\nHiD6rUKYezCcYWAqZxKJEpM5grt2XIkieRfFk8ylsLPovIV3yrnO6lV14U1b\n6QZb\r\n=8L9c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsOJmPP31+PNhv/gE0mTzPWERpAVYv/ZD5zXRdWW/lLQIgW6g1u3/83GlH4ZI4LUR/xAcUjVrwNPEbKXW4NPrMJ1U="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-a422c41df86f43c572431abc49fbda481109a912.0_1603122269610_0.6416419492357139"},"_hasShrinkwrap":false},"6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0","gitHead":"9af5113c5c30b3ae013eed8929073a1ea24993c0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OueWUSRS82jgHz/GaChdJqerRsZnnl8RHccsyS7LgWTdhzMzANMnluPhxxfES3Q01OakUUXZx9nL8jCqfATYtw==","shasum":"fa2d7752acabe0811e11d077fa8e199dc781010f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/2tCRA9TVsSAnZWagAA3JcP/0lg3BySmOcoDUbP3PDi\n9FnDsaTiu8mdcgCbTBN1CS6D1vjtrzWs2hGQIqeqPKfAXsnfUWSG1Ei5iJvR\ndIytDuaU9jiSeoa4d3rBsKfyanCyWDgGlSGaKpgWGpy1JWaz8WCNPr1+4TlM\nMFxVnaoFOq7k+LU0s4aGc79/1AB7SJ/RAqfkyHa+RVHdX23f+ahHf+OOsZ9d\nRSq1dfMbeJOE13qjNztVzLjF7qZ/4UY9IB6g+2Uoe5jyXVR35yLKxg5tTWL/\nsqYVBrJUm1YWBi3urcOl3WKoZsHFZ4VspA6z1Vsnc8MvSy7kboowigIxhDi6\nQNalWsslhZDTVZSDQiG6pS46/Sz6/2W//9SqWy5ZEk4AUH+eINhi0MqQgQUX\nxmcyTKLTP7JHuAlkrcWnWFFUu/X+umLjwh8uAfLmKC26dXVQLdVTFgqVJSE3\nyHEso6+CAAAb876Vp5tOmUEsmacOJby9OV4ugcFvDRAwrIICzv9WKemJvaZq\nijmD/ogqfnv0OklF7sE5wtLYQmr2UFyUqcbsxhQcFCnbczyOIfSCT7vTWKAZ\nTg0uZfe4cgqouz1MYcZPCJPz+CTSw9EuMMcFRefzSRM+RIH1I5KDjaEsLYzv\nCLstq8W3BSkJbE0QCl/sLBSL3PpfgiOHTTdyzBXasZai9bu+z2DIaHjKvzdm\nUV96\r\n=xDjt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhtn/j17E9Mfb1HGybpH3xYkGW4rV5twpIb0ipQel//wIhAIJllAOFkmwdpv6zeO009lnQ3gXMIQmSQCQewDQMEz1p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0_1603272108769_0.19656292437980816"},"_hasShrinkwrap":false},"6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.1","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0","gitHead":"abb45c3de976d5b4fc7b5be9712bf6d12960d629","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dgATYDL1i/GjoFsyELksIg7vHGx+9g0QC2TmEB2UwtXzbTZg7QVOWgW0wEe7PE3Mcc38cM1uNMm2a7iCo6NKrg==","shasum":"9c7cf23f7b59bedf3774c0c2287f19cb27f98abb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0.tgz","fileCount":39,"unpackedSize":215315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/31CRA9TVsSAnZWagAAGVUP+QAsRgZ4LtL0vwOrugHs\naSwdn3q9NFcWIFu41EdX4+dVRkhSOfEs/9K0L823Ll13U26Ji9+9woQUrjBx\nNLBElvgXV52a4XY8apwCFURpcH5J+60gUJN7Z3HXDj9PqtgdKNjlxZLFo7y7\nvg4TTMuhXixs+2QYszff18o4i0fjZYU6/JXO6q+09MwgCkTV0HQy12vx/gal\njgkBoP7RUvdANGFXJPHJh8k1xqFQ7ecjmW61Rp19bYgjJ/I4IccKS4RRWGkH\n/bG6aHEBte7lHMV1+YzeMo7WdI/GFOtQTyyUHUCkGShE9XU2lRLMkcvnF6GZ\npD0KbiJJUGSwPVnOdfFi3ct7ys0rvPH5i+kKv3RoY3habbNafKPvfsfbLJZ/\n/EyCujyflKp4whpedWyraLlzsUhGk5GstYy+X7WABg1bisfJ/hCtAWv2Eyoh\ndv1YBNrbc4uflafvJGSUjOCguzmS4oScwW8GhHjdQgPoQ88lEqNIWcHNb6oY\nWYwC7LZjA2GVMy8PhQXSwYxmS3FqNPnxAeRXECA4WZqGgNkBNks3941raNEH\nEgYEpjLDKFQIpMejr5mr0zccxDlK1oCCtm1A960KcorQ2bV8c0CRWIJSx2g4\nnqSd2oO+5koQ+H3Uqh4Qqcc+aVII9AYj3LnZsmn2KvkWZeER4z4lktRtebwj\nEHJH\r\n=kRh6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHilhRjTnfSOBZKN44SM8W30m3+XTcX/uYZRIUzLB82/AiEA5V/yKvND7cLjyYcArus0+htURi909g4wURhoij9frHw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0_1603272180655_0.43323632477642793"},"_hasShrinkwrap":false},"6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"26a1ec61bf60695455fde37e16e6473b29a55d46","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Hvi2CbyE2L6gtWC5zHOIKrN8rhe3XDgB6OGygRy0bZcNoTlaDN/G3LLduq8jkoTA0Rqt/Q4CcP0UJcXAoR/PCQ==","shasum":"4e5b48fd856efc0406667cc0daf2d5afe08c4d11","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/4FCRA9TVsSAnZWagAAWQgP/1lC4s2zJILpkGBHSZRp\n2E2seP2kUN6qUM1sVYy9vLDfc0q3VUwfTuLRBtgl/gEosyKTqOefS0FzJ0N9\n3su79SZuy3qMx9bRguBzp8j9ptYxOuDhoV8V94k82w0sAI/E/wqJVAiWhzs4\n1BcmxXtSYCAE5wYEewnCJWOF+ED06F1kG7rLJZQU6NOu6GWBc9mbehjRgDPy\n4qjc87QtmzhVG2n/PRZqmhhJM4KrMp86NM1rm6Zc5BDOfPwvOrOfHxRH5jzj\n6eKZUQ0GdthQnDmhNEEaREPSKa3rawzQbBnM+4TCUcdInqCLwKaLvD6qKiKH\nLCYI16qnqtMXiZBhaN5cbiu45jcayrF60xRAWe+TFep1A/e7Njghu/EUtoUu\nAD4CbQIxbkOPUgqtYb6VUyAtTgtH/jEPzkLwqN7sFJoKhQ/h2LUkv93HTSxQ\nhFekuA/G3zn67MWT/goVoxhNGvQQp5aZph1FCsf3aW8iCdTVX19JUzPTcmPg\niKKsntlIUDfIqi1PGhqSltOCvNE2TCNJF4gWeUl4tZQZpE3Z13DhNO+lNDQ5\neD5M9vp2IosEIpfpZ/mtBkoZlgrdNdwYX89BHpe58FFTkQXWlbAllgRD34gY\nWpITD4P4sfUiajz3sKS1A6WMeyyhZxNKW1QmzQymtqwIo0TBqfYRubxL2kqZ\nNsYp\r\n=wti9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5Y4PeRwhQPc5YMYUBCLW+0HwRbMXcuS+pIUmOaO85eAiAiw+Jj9FE69K5Ugi6zu5jZTwv96jbCmj7yO9nkfhdDlg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0_1603272196642_0.0749938773219474"},"_hasShrinkwrap":false},"6.1.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13","gitHead":"ff6e009719f0ad92876f05e427f6c8176c7af60c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-aFnaVw1M2Yhgb1igl1a+EVykfDX6eWSqifdqh/73zFw6HsH1lsnIxf/YCS2BlfFqqTl4zf3o4o6GMHF7pmVqsg==","shasum":"550bd6b9865a75f756eacd7339bb162a0993fddb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13.tgz","fileCount":39,"unpackedSize":215552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/4kCRA9TVsSAnZWagAARJgP/R0xB1rMDG/MQfK4yejP\nQQAFgfusgkzk0RX0JMjui+22Te+oVQObzq/wstVgxRxVDdvB5AO8dsYslIGB\nW/YJC2A8Yv87qGIxawbFMtTPw1u+dlfBMDG9XdGOZVXAY4j8BQ5m8DaGgDSP\nMk/UuH6ozSU8AwSR+UOPii1bS/tAyurFcvBQx07V7pasGNToiWpvkLYkld9I\nu2qpNNJOtfVxqVFajIsv9Xw/Hy44buD6POnjo1qLBoC4fraHafzIFa5KTYZ3\nLF+qW2imf7+YJrJB3TOkJf0fdbuLa6jU9mrG4jPa6LDK8YmT49Uo3v1jRD2S\nbjonylyNB1tu1DrTpa/ESGNICn2alyzkHB9pl8Q72U6z3F/Wn9nzvo3JQV/R\nLdKqgGWHoond87t6ZmhveIO7bvv5qsV1+E0YXfD9ToWGqDPqdMtMqOgv0x0U\nGzLwkCpJ9k08p6NmpJXB9Mg0BjH4kE7H2t3CzwyTB1FreqjD4vM/LU271n3w\nsxRO468XdChKySUyWDcG3s0D9WdTjXswYAccm2+hitD1ddWqyYq2SwvVBMXN\nFyBEwweFemsYqkXhsFp3vGEqUIvQShXzdsYOYIZMzhkwxTCadSyhPsrCKeZs\nMBHAXNfDnXj3EtNj0KKarqekIVZuQn0ty2/EY1CntmOHx4GaoHh0GJCKpJTa\nZFv7\r\n=b3Nr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTERBohxL+KysMSksWkdQGWcwRXddDZSdhwQQDJKDOVAiBKm203ihcgUhdVgtovlPWuYO00mbB6jEz9NmWqDQvevA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13_1603272228344_0.486649551358485"},"_hasShrinkwrap":false},"6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0","gitHead":"1ddd752fc4a7b584ea3ec31873c19145c3075f62","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YCswH517aLiInmoXidut3vy2Kef+1h+pJv5Qe+kChbrC73ARPuH5G5zKGSlBc4AHBEBgIeiB/jSlyHrBZZIKCw==","shasum":"37d17ef758a87ca488e4973c3d0c7f7dad25cb7a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0.tgz","fileCount":39,"unpackedSize":215316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/4/CRA9TVsSAnZWagAA2x8P/jfsOUhcNLwDC2YjgNHg\nfA8WH9hnG24Y/5uXoUvGhDE8Y9YuoB6EswUnAUFwM/RFhqEoxhrqqg906mu6\nuO3/eUa5t2JbQn86JGuStMfft25rQo6dR0Y9ldVzdap6DoDETdv7BaYn6fzd\n6y451qJrZzCJBdaa6hK6Zysb2Jhpj6i7YP0vjlMyzTuxCa6oyhx7Co7JLrLd\nk2Qb2pHl5x6tH+Q0eb49LbQHtOj8Vz/X0K/Da9KcP+9Trs7QlTosQn/uhDkY\nkqVegNjvh5NkhCGr80onoeabWKeNsqWrKHqRBMylVTbeEh/4V9H0pRSflfiu\nkJhIkdX5zeoLEhzMnUUS9/4kty/Z/U7hy1yi0BumGJSSeYBeT/Q18o9kiTKe\nsl66AdMol/Yhleo3LUhW3uTd9DGc0Yy39zajNOmBibfCYf8bOnJAZojF9sFw\n8/ogiFc/7aBpM1otHmSS+tR4z5W7roHDW4xXQQubkCvAlXvKbeWh1iIYFaiq\nopuIee3q7rxaKqGZQ88hzcJzFxeqShROVXogKqPgdEvGD+Fc3NwcrwLNDkEU\nKOeUJhgr4mR8NVyQFkK1d46GMLO3cnmOMjjTg7h7RLmH6fzM1jVCYuzPwZmz\nbMsLAqYNdq5++1vjgUOoiF9S2ylLz/OhcHReVbIaz0TapeylNxjgw0P2wI9y\nXzE6\r\n=2E7T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXgfy/Q2+5IpETMKGFtr6lbmRDOCNiF8gcc4S6SOio7AiBoQROAlH0BoIMPJYCMcA/J04ZgZepszwYzRs/qsu2hQQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0_1603272254422_0.10554442541476683"},"_hasShrinkwrap":false},"6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ff6e009719f0ad92876f05e427f6c8176c7af60c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-D1mBlBGvC3ac7R9MBORIUqZbhISwvEwMSya5uKOJu+Q6+6fBE5LKfbbmMHxJllysmO+v6dzzC2FJghnrS6Tq3g==","shasum":"dcdd0b87312a601f38bb03787271e9ff5acef7f7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0.tgz","fileCount":39,"unpackedSize":215595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/5ICRA9TVsSAnZWagAAsH4P/2YQ6H/BKfBiuA3cn4i3\npGv8n21B6QE1JCck6XFWxVsHhUtP/wurNlM1sWSedr2ZF0pHndnmWsOXdCA0\n9EYQkAu0UDjxrxMPqoEdxdGZW7yQMyVPZ9IOK2+ZxLrpfSHwQFYQTfWlQwao\nKUsuJcwejlam5nTNszFVo/sh5Ol2q8u0jV5AZKPW4JZS5KpKsmR+Ovl6zgzK\ndaa/0nJPNvg+LryoIeO8LTRBxjAUTIoUokzuqGQaYyINSVz1onRf5/GejUp1\nZACm09JadUAqJwT1jTiZdJLGPZF5KFMNENtvP9vZLzLL4Y9DpuRqirL+8eJU\nEakB5Imu3TpuocCaiqCyZ5aMqk580yk7NtF54gB5IFiMuZQ4xaLn7DSp1i3P\nxPQ1C2j9a1eOtpLuXPLAxqEJ4xfTAQl3nBDaMwzqwMhpfnBp6+VGUIy0JnIs\ng9xwTRhYuBNkeQ4yC7ixItm/cSGYUYuH2EufFWT7+B0JkAMnu5JET8kHA+Wb\nbanZT99t0YBAP6OK5JzvmM8dpCzn3b0MrkFv0Z4pI31d9CyvC/VYs02x/+df\nnbozOcA3iOWx0mBX9PhAtW06+/pttSvclyJfTVh3oUxp8dlBdH3Qe9IObsje\nAEoj+4UrtYwnFzO+2MHt8dkWJs1M35Rcw7cpc7caM/NXlcEw0pDGnihTkAjs\n5WFK\r\n=AG5d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsxDjAzIl9HpZekG1srexjxTMmKsCX/aI2itbJwYNEgwIgUUHwVrlopX+OOvfrddBJsjDUwzz4IoGVJlU9t6yTdCg="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0_1603272263758_0.6637143153429343"},"_hasShrinkwrap":false},"6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.11.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0","gitHead":"817f7e55054ba5e4618481d33a2bfe48811f3613","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0NDonSexrcBCgd5RLQUw4rg4IjOvRYTnS3BdnPrww0lsMRVV5QYp8xodJDhEGRYLOcfO3ki+kHH/6iHwsAAkkg==","shasum":"647af4676561e3daeabdaee676dfa940ae3a231f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0.tgz","fileCount":39,"unpackedSize":215595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/5fCRA9TVsSAnZWagAASicQAJCFlpNmluhttsJjGPBH\nZ4j3o18woDcXU/juTj8SmXPfYdt6fO5Pvkd7fqLGI4yVhM9Fim0rzOkGw23E\nC0rS7h82wiIwU5T/HJmY8amFTRciGmRH/tzS8L3Da8R8X1AfmR45iDjGsAwh\nw/r+Ibt/vkw7J2wopE9cF2PHnVz/6QJ2P0vlPpAg9PtfYVIWY//QbC0Vruzn\nzD3V0OYpQnIo2g9h2UBT5ZnwOTnJ4TmLnkmXm0lGs/9Y7DJJw5bX0ggrwB7O\n3MqzhnmFUc6qZnC8Mdcgj4ioWWu9lt2cgyyD7oQHe3YPcS1ysZORpH9l2D3r\nsY3RhITUX24wNRrE4hHY8/0lMQxdecyX09W0pKIlrWJ37PgrY8+omyr2MjGH\nGLgWpjPi01dZ46ap95GNhC/CLsYWxDNGDbfZPFhqlMMFrPYRhc8f4JrDTnbT\nI/m/gXFDJs/ETWc1tzTEL6UZDTf0TWEaLZqnsX+A294pBMxt6uFDj4CMk5BM\n2eu0dI3I3UGpLh/I8fPXQWc84W6uXfwTd24cyv3oPiGlP4Zcn7AAzaZ2uZfX\nr7Ip4twijjiYQ6NOtr9cRpnO/1K9RhnjY8Fpr7wYJY5NdHdwGr7Xh48gwh6f\nT6L9hjrgtP5yOxTNUhT0weziN5lXvV9VQyo1Javwvf7+UnUXE4AXt1zOUGPC\nTSOi\r\n=flbI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG/jmvsphP1XPcEurBlGYAFxPAqa6weIJPLGwHByEtOAIgfg6lqOcZC03PThmlPpkUSbJLnzu6MunoMLhqWeTv81M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0_1603272286667_0.026367304663881708"},"_hasShrinkwrap":false},"6.1.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.14","gitHead":"e00fe5731b080e2783df3d9babea870db9b47196","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.14","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-moxqsQ+9nJamkaScQg32S0v6fcBv1Dc5q+Yy7KB28zWkFsu4GDZ9ZUFJgjF/aV+vA1o+AWFSEumUucN//qOt0Q==","shasum":"cc8b07f0b063d11290b7bb720158d3f872be6149","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.14.tgz","fileCount":39,"unpackedSize":215836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/5qCRA9TVsSAnZWagAAf1kQAJx6h+6/slRMWclekIHj\nspgRMoaxKoRCm7OUI1V44vqnjgOPsDXZc815LFI1LETFOouL6waR/hZQnz4a\nVizqcNs6TgzzCFMs4ShUoWOQxAPIto8PiF8+rPpBTp2sTs4ZYyiGSfYdedoF\nLRdGTVSUzVh434IeKV9uKSGFZhYglz/K2CD1hrB7rgHWy3Ms4oie1e+6K51q\njsvPFMMGxikV+s3MyrhXJtYyQqwU1Ef9qVPTN5FEectg75LZnq7mWtytCGmg\nTsbzVZYuyKS0RNpukRP+m7O6xknPQ124R7dFZe7GnlXROUKyTUpeaYlFmGgU\no3VERo9t9U/RYMUvJZtWQzow3LP+60I3QrsTTXMvu9+EOXQwkQiNyT+h/Rc4\nBWV6V/nf/D0BFiY+DWlM+bFtfAborDKc5lqdKqOzSSX6ACmhCsoemxsYgY10\nY9iCLrF8Z2bRfoK9BnaBRb7rEl/9s8tdYg2J5dNv/fxPi/6k0jiXU2IX298b\n1QIDjQ1/aIHqHoYWwScF3kUm2SSl6BjWaam1P+vOg4FkqZE3AmpZcjEIr1l3\n3BcvIBezkccuejKNBil5CQ+LPEU0uC0lNO21l63ll0nY5JiFvEcdmq399flf\nShpIcYXz9SpBuTBUwjjltCu1EV84OlEyWAX9BNACzqKlFsNaAT67uOUDWNMN\nGjYF\r\n=FNY0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPLUAQkgpZliuTW7+FYZMqpahJYRZPgxtTS58FtVhfvAiBvG8lqZjXVKt0zTmTik1ZYVGww4ciusIR6VOewRMLhIg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.14_1603272298173_0.5824261284865602"},"_hasShrinkwrap":false},"6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0","gitHead":"4ed264b446c83fcbbc983e228a0e0cc1bb30687b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-EhRHHSXMDNo2YnMNzmGqq7Gjy8K8BhLQv3/sOMWBjLNj9o787t/tzyiRotRrJb6a7ZZjxjE5oefYDIXFATvNxg==","shasum":"726b4a0d8f4399b9f43c34e51616f03add7804c8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0.tgz","fileCount":39,"unpackedSize":215594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/54CRA9TVsSAnZWagAAOJEP/08yiorxM1UFWEL6NdJG\ns32juvFSD549Fu0qK7MQ9y1Oa4CE22aaTknslctmnEDfVp/DSR/l0WPgwUyT\na/LQ/eAS7weV/2jcCviVvLkSm9v6BZf+QmQuCTV2zZDd0AbIa78wZcmvT10E\nVb+ij29cKHzvADz3Zdb5oWTR9mvVTCTCIfDwZ7OkFgSjTCzwhpe4M8B630MF\nO930LHtRMYcKqFuX4tqmphTMxxnEsVZ4a7fqulfbS5TqeB+XGzScm7n1EY8u\nlEKsZ//VPFLi8mbGYGt12wEiSylYYAxWCNX8czPZQfMA8enOnSN/1jATdHne\nnFQIztnCw4WeFj8tX4DdcmvGbFd54OqWg2hAHu/1k9Mmwa6HelK/ffJTv37x\nMp8AM2XgPtbhNo/w/ThAO7eH95B6JEc1y+FV31AhkZ9ImKLUe6RWnN+82ws3\nq0x/TrS26b4q4mdiZxbGBsPRxK4c2AgVOpl0Kb+DMTRDWobFib3TLzjoraKK\nqhfZLDDAdmkdNRKz8yCRRfh3SrxIn1uK0Y9DsEDMTF5VDpVsplA22KJcxeJp\nujBf+xHSnxfPkqbfyxkK28Hh0MPo5p7bcEp6H6M2XqPWf1B3lxhcYtRjQ8AZ\nmEbb0A0OpRfymUa92eP/mUHrBxLwCaPj2D2vlGjKSz/dYBUtvh/JD/OjPIh7\n9vvz\r\n=F/X4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOoWUdsuqYIBveYygWzeppCSxGbgEJ930AHVC3WB+dMAiAdz49x3xydpELhCPjFZidq9pXYFYZpWn5TeVFL6mwTKg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0_1603272312146_0.44111738713356763"},"_hasShrinkwrap":false},"6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e00fe5731b080e2783df3d9babea870db9b47196","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Bx5c+6cUfMMi2PRJlw3d+P0z6+NomALggXhwAn7IA+tkV4KqnU7T2dmQLw7Y0SvZ6CvP2wHsvZfuvcqyFaYQ5Q==","shasum":"fd17688e29370b4658817240c4c6fb9eecea76a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/6HCRA9TVsSAnZWagAAZhoP/jK7OEEEY1ezJWV7aImK\ntRa9bpyxe+wpdWWn/zVGmy3Xu5zIlD7khEOoXY/saOYLM9eFwvOzqBt825qO\nr0sTJGDeDxIkUN9LhKsio7ZNjQ1IaTHT89ItdOA8Abnp8+8kQuimgYBSZtE1\njKHCadhcZaaUYpwTFkPfLrPiX4K9qMobu9FVQbzo3hoFyPM0y36F72eT533m\nQqjDYeAweFA9cnZAaqdbExjm5CHFursQm07zOOavtElbmQi4liobTxwoXgSg\nPWoLeQC25sp/7LLXZvgkajNNKXjwoEzoMR1u5FrQzleBScN94qTl93rYVsdr\nIKdXFa9yEuBHdyaLD9CXdFUr9BP+lNYmDe0N/qlHBYTWg8BnLuDd8y7lUVra\n01Vu0Byp3cy2CJpmok0c0IPi7yXi/1vUkwbTVwNWRTi9+fEaPEX2UdKYoATU\n3Uo5rI9q/X+Ymik2IkY1ROwz6zOKVkhEXdJ8MyIhBeOZmdYB+Nb6LMjTOb7U\n/8OrVRxkg471rrjd4KCBaFosMjtcZ6C/vDzTe1cSMcJshWTkuutOzry+Wir8\nHLjCyIAtE050BJpNWZPHFLtWfeVvS21bho2qio09RYQX9c9L5vJUpxOoSVm/\nQt91Vff2nzxtkqK7OSJ/Ae6B3hAZDERcy4r69eA1oy4Fq9Br9cb/VlTlXGfL\nXxE/\r\n=rCCZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiT6EJOoyj+jqJC85J6QVjxj8/vBxEQBux5bujrd5I1QIhALyroOZH6QxJvt1KbuhZxvN6QhvDTopqB+amJdYQ5f37"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0_1603272326787_0.6538788979203785"},"_hasShrinkwrap":false},"6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d61a871f4b76db05bb1e8b38d329f492a95ba1ea","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UfuGdH5zlxr/xWsFbSn/HXxZ4ynUyvcjwCyBLwSZMcnIcZojj+BBwrcBBrE+AKK2PpuG53iGjPUODyAZyvXKnw==","shasum":"cca1d9bfcbcb203e62a73e362194a892f1d5329f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0.tgz","fileCount":39,"unpackedSize":215594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/6lCRA9TVsSAnZWagAAvlUP/jMt7lLZ6hD49G2PCz6Z\n+3554z0e4yxRPfYPcrSujrY36DmerR6UOemZKrIz3gvvHqsU6dkDDLWAVNvx\nFM4p7OXmSjduIArtlyagY9HJChgYZtl6CLGJudbyooW1D9sjZANmd0uplijB\nMTpEVTVmyphUM/SzifZmY9TS2VHzwXGAGYRB2+JP0CftJAY82hi2AUOsfX4F\njPFoKsyC768B2xxlLF9grA8XuO/S2YTL+a3vFxu64kOf/rDcbAQgD+QF8ryj\nBahXfFehB1QnE6/yKva9ycO0akH5uEyrW5YkjNGVfB3qnpgfNz8ixwFolVus\njSpJ8DZvedKQlgDFtO3dv5PfMyqSvxogRiY5/uAY0YCylpeHRprTWWwzCaw4\nYqwyGAPx9YLn+S4NcWm2Gv/appeoCFtCF78oqNadXAGHFaQcnnzUFLnrdBWz\ndl6KXGOQ7n33WcpI2qxq1t+ik9mlQGG8XZOiA2EBuZQtFX1q32yA6PE8F4BU\nu5YVtyil30xl1yRkMwQ9id6mOp0TwbyAAmH1o8OiZUF0v8QlnRamjR82aybb\nuAYEw6JaHUz5exZ3VL6SJ6VewL+ZVq8HBv0SRsHxjCHCaZF+OnWmldqqtxie\nhx7aHsUejy3WZaGrBNecPSizvy6tiPoZAk7VtgNjq6coC0HwDwC1WLDpkCYi\np4p+\r\n=573O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUZ+h/FvfmYXOve2O0PyELsBQWD1IJn1PPEV7Nw18+uwIhAMpPfEFlj0uTx+1R6yEFGfzSJzOYUvrnN+fV2UD2D/LT"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0_1603272357014_0.08230346573839808"},"_hasShrinkwrap":false},"6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0","gitHead":"71a4b9e81d275fe1d91f9d51c6f59da5ae68adff","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RSY23hlw9KMBdliSORWc3a3JueuocBMDWG+8q1lzS5R9bf7F4/FeSFTBzgUD9J44eA2UUmOtJU9PQP+IFKwwBQ==","shasum":"763ed1cd22441ee263b51896d3782cc9e34520f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfj/67CRA9TVsSAnZWagAA3SMP/RtpFFXow7hao4hfuHCH\nK4cpTPDLwb9q29hX5zTLxm38r72x3mtVtps5HjaUYe5ACuQyHgAk4VzrIyH9\n5czC8G7PTGh+JqWGvN/L02dCuR7dVohwvBVo6tIuqXcPlBW/4+KbcaOLpTKk\nxg3MYHPKVlgbOGIVlRNfkXm/hduSohpPUWmGahnaoWTT9EtD89CGhudKiShF\naYIik5FmiH6gmbMM3UFkAOkciPqjaZOekESXVP/dWTFukZXbfGMgieAU5iyP\ntarEfA+XMhIDu0MxgLFSC0CkC+wUltl+bRqNKvBRCmj6cOjtUiEXOKT7lRg9\nwiJJuNuTTpddqrF2o9PvJ+8gbG+vV3flQLp28ZKzuwQIFLjGRWeYzxcYP+W4\nS8/1rQtwgGP6MOmP7nxIboMIi6xuS5BxUijONLUx/r20i0RI30YnazYhCuP8\nrKHB7Xy8/awkG+BLFx98HlSoy8QTF7ReCcE7u++KJoBQeI5A4g+5cnWzbduk\n4Td6C3TyJ/maqIetBEstqLv6EOQ70Q4wVJ88Xj8D/dM4TzN6yxHCoz78R22q\n9lP3TD1gMNnPJzEKHi/bgGB/y0FBtIm0EE5XzxdCHIBaiosRooC48jvzOJsh\n25d8JTByLbG6lLMQlb94ZMCqcP3SrOkPwYjW3FahqED9fHVU1PrGl0d30P2j\nYDu/\r\n=tP6H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyEWV7ZYy47GInGxoS0r4hp3FycZJGkVwZIrJrSGwRuQIgPqFA7YpmEILnUIvZj3acERX/DqERLsZOuhGl5gCCGH8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0_1603272379196_0.8473189244670474"},"_hasShrinkwrap":false},"6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.29","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0","gitHead":"543170ba4afcc9df511762b4e3b7917b73b6c18c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-c5/IuuWMtwltq9HO/18V261esXKyjbbO/AzGZ+mQsM9b5PM3C7njtFJrrlUw20aEBEaOYjT24McSvbA3rq+8Bg==","shasum":"6c346a9b7b712a9d55e7e3e895c715ae00e6a76a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkGbGCRA9TVsSAnZWagAA9a0QAIvH5oPaMwOLw2LhsGUp\nAUhdx0uwGZqRHShLaLFEY44wB78GUhgXEwoMZzuANp9xva7hkK9uyZsd827w\nZI1lw+Ug6r7F4iVZk0Soc4YC460FszEArXn1uz8eFuhVyVdQ28SQO1npGkOq\nv0Urzn6Zoraj/lIIZmMq7POKipHaDM3hPzNNR6+gn1FrtcNIFtn9LVN4fdFF\nQ0/s98SADF1xiTU4AIPSesFt9gQMFo7dcNFgjzBCV9Uf5RFXr8krmNHLlx1S\nuGjTCRhkBqGcwj+zjL18dJDwa+Iz3CJlZSYFXQCc4PvXdljUr5y+RMYP77py\nl208tS8Wsk/AFQAEN3jzFahhn6BXHu4qwogeIkARoTY7DGmQO+nxPTtkpoLx\nfmA6d2l84boG4lPdIFs3T+HsyRlWYbqIzuizTUfFXFOoHS/BiSjeND8OjgIw\nS7/uKAbM/P/RclWKe0D7vzj7JYJDhLyxqRvPEPoLG1Fb4Q3Xz7iPt8D0yLwr\nLAZ/YjqNJjJrGtI6ACcffRoGtmqciL9ng1NFsoz/NeYjO+s51AvRMkrYBmRf\nJXcyoxLY/uz6urXJICZD8iK3g7zlXhsugy+TI2qK/7HZMpdEM8JXIj3JTqp7\nDFpg8OQvxyowYpEW/L4JJZpKRr7NqPBH8wnpt4IRWNnIUANDubSxFJYrA/PV\nb4ci\r\n=mEge\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/vITLxQAfV+WJlX7jyN5o3i0HsSV0644bTlIkmcECiAIgSrNCMOxkK75NvUY6RHuCiN4RipLe0ejch4NrphJfxhA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0_1603299013615_0.7429556380681137"},"_hasShrinkwrap":false},"6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.14","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0","gitHead":"a6b441a936c9205a2e1b0be75dea56c45b963fff","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Lj4WBxwzGPz45Jxk3zuk7678RZ7QJCFiMomFZ+WXRYGztKyPZp846fLQLN1bQfYwf8YY+3MEJ0tk2IU0kFdGkg==","shasum":"e685ba76adb44d170abff325cf79585d0091b682","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0.tgz","fileCount":39,"unpackedSize":215882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkGw5CRA9TVsSAnZWagAA50QP/joqIXxBoYrbcogWrsfI\nr3Wv1h3vy2QW9Hou4F1qAz57n7SmIsKhLsjdQeEe8nEXIaabl9/iI+jdgoiJ\nEvG4FJRFO62t6ipUIHmioVp7PS5GyTNuDFmkM+DdqgsO86P6hdmfv6LFm7Ac\n+FirRFsHEE7+mBU7qmgLPSa7SwkcD1UpV+1yJA8Q8VO7xb5IAJyqf8VCPgna\nXgp1muUJKPFajooXzWF8xCmughtb3ehlFWKsP/z/B3KmNKFJoML+uiaSJNB4\nzJEplFqmFiG/1zIrQldo0YIjZhdsbv9jRggducv5Uz7sTiCVq17zfMyt7bNH\nLUM88yGiV2Eqksi6RWmfsVOfHhDinfWwfht5N1NvQnUxYappzBW16m4PzmTG\n1FG3/KILnfBDLnlmSjGZKIFVFWunbDewZ65HxeewxVN8AtV/P2Sy5GzCHIqR\nDto1I085nGgt9Csm27xEtSSY6sBbevbgAu+Gy13BB+md5i+sCnnUvrVY7pck\nPoTKRlZBg1s4vGHIkj3ZCxDGPbXsipVib9B3fygZn+QotzBmNT43EKbvG0nZ\nzWCQKaXwMuF1EI8OEkdr85YZ1l6FYEpsKNYwEqV3SNvPHAGw7mZdyjxACJOU\nWMXEeeMTF2mJNmLp6PfohU3xZ8vfcXIATfVDF7CKH7sa+tB0+jLeEvol37Nz\nObIs\r\n=gYNo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCntDgeeCfmFbLVyzPB0Br4ypQCj8qy3Zlpy7+0khZMNwIhAIkqJI9Mb+OA1EIbAgcQXSkGfo+GuOusYFXQo5CZVYPu"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0_1603300408505_0.2224118158134698"},"_hasShrinkwrap":false},"6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0","gitHead":"72225c42b94c49fd2e04449115e6c347176f6987","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NquCoqyuZQQeTtEeJGXbtOxSGEuqvzwDQr8bea55/PtUJAvFCDq9nfwwtMfDKyZT4VQfqINrpwxIlSph7pU2Pw==","shasum":"17ca0fb8d4cf032f7176f9658c62bd5c312fb7bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkGziCRA9TVsSAnZWagAApkkP/RkZLpYp+n+jSEjPkMjF\nCMIGAo/N7u3AtmNr6IAj5mWcjm8T5PA0ysv77jZkfqNGkaubGx7nTGOIv5zr\nLn3zaAvZ0GgACLvBp1W31H+DFs7j0t87zT8e4NpxazyrDuLyThQ5VK1hwWKI\n58pnhvBOM55SPckw1tClGd7jcjNbb++3dQmxVydS/s4Dz9U9Yl8BxUdtMn7l\n5N7xxB4FY0wvTVorPWdZ5yJNKx7ryl5r9fhUyID6vUVaN6M2kRnqz1Wviu6v\npax2WEwbR5SH3t8bPeQh+1T+RZmpAcHiFWfuZgM1SiWjLLvUNysEsnh6MouY\nTplws2MonpKlTe/e2SXe060b8OSIZ9CeQw3xPxqLnlbAZQzRQw8JlFz1vJz3\ngYiEv+djSHMINZ5jsr0Utdk02j+NYugCtFiy4jEH7pB2TKTrIG75f5MtiKBm\nNAbTwjiplHGpSlIcDEEzSxfFxqROqXqvYSsqdtOiUYOYBOBU0T2iAfV56kke\noNOfrbnevdZL58t/8QenUQBgrgz9Oo/OUsivtiWBC5VUHBK+firQAEZpapS2\n94Wq9T0on2dG73x4/V5v3MrQ6MLKtTckxgjg3a1mv5ntuQOimWlifWo8xrHm\nVlSvGOEJcyFD2HgedrwD6unNH3AesO1efc1mJTCt+eNGU58HSQi8AWtPoin7\n2RUo\r\n=uxwk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2vGyhL3i2MA7EXA4VQJqQFRs5+B71u1CuVAEyOrMq4AiAlGhGRDYTS/W1bz5o0A9sUldaKLTvxKn493L8hfNSq0Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0_1603300577963_0.15329700544567681"},"_hasShrinkwrap":false},"6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"edc47b444a66aa7abb97efbdeaec3ca071827c2d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Yn3ueDJoyfvqQ2jRV/V1nB4obYjYVAOW4T+wCRaSTheGhLIBfwHDHodX17JkYmWd6r3d4Et+LBxZGTZpY37rSg==","shasum":"dd9ae346d46bc6d463c8aceaaf6daf9c2b17525d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkG0vCRA9TVsSAnZWagAAEg0P/35tHbH4OJGQMGVEC5zO\nwi34GoBNQU8Mk+I1EG9pCGKwEjJPNKFWfRTECsxp0sHbrFAXRSeOqM5bQ2Ch\ni11E43dxCqBKZ8di9jTBRBgbqiV6Jo8YH9+qzr/vW3dWpOJ+FWY/F3JziuBw\nPbTiELcOlHm36MyqXodB0cvUKZ3cKZZMtRMrM5YlgtHQgAaberDIUP/6xsBv\nWaTE7Wql5v3hgXg0mSHJlsP+3cj/4kg64sw9c0O5A0tDBvjVQYg21gm5mQ/5\nfdXrwz+27ZE3BO+iPl08BWEf6R2NJF0qq8LQ2DxbaWNsgcevXswl6WrEzfvJ\n38ef0fpF38Ih6h5DjLyjN5I1XL+ByMO2IXh9Jy7Aw0wtCjI/zWx1Z2HI9JAD\ngBik9MwvIH1GjxGK2CcvDdpn3e05cBjNmGTSwpgqPtOJl/v4m6nu3lw3GHsd\n/brWrCRHHdxcjmLf/JH3gyuVWb7tHuFyEZ/S3ZOr7DswIJ1DbYxRlSIT2H5b\nbOd9CC6nGBZUbkgbw6NxwAiyt1HYToQNds9QjkKUlWfWN0klbTpxZdmWUar2\nOQClZJXYaRYMTvsZt/CMYtVw8aJ3YieZyiJ549m13l7nepu2kCukmYzsMzjp\n8rLOYdhvUzS3HmPD3HxasTjiG+idXU5gCvMa0dnp0OPNVGDhXQrNLUqmVpz6\n12/W\r\n=y3O7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFqSx0mIFkqOjcdhQdP4Q9bk324zZbudgIm3UcvVDtY6AiEA9MLs+pDRJpzbOwyemSBrVpre5ZlaLlLaMEf7MrTMW9A="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0_1603300655394_0.7559714414819625"},"_hasShrinkwrap":false},"6.1.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15","gitHead":"333b939098d7de50a97f433c0f3bf07979f8eb03","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ojekRZpDpcYrOppNi0YIu1Ezr5N6Ge/4jZ1WIE1uPEBPb3ZC9CoeGQBMW8FKVywo6bidEr9PErnSdvZUfMvSTg==","shasum":"6aff371459267ac4949038113df768263c389ab5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15.tgz","fileCount":39,"unpackedSize":216120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkG1lCRA9TVsSAnZWagAAZzwP/iME4cqIGuZXZZsE3TXj\nBxKgSpCxgMyOBkvC+MeqAydFQDrf3ZuG3cgNZREKt4F50HzcD4YvGIc90Y7T\nA9tvownPSmKcGjk8GZTkv7RHTrKSLNleBx3T2Myfph45yLeDLpJzZw+bFJUT\n4z78og92JC7iKIsrsjwqtJ/Kh90RvCTzO5rV69dYDwrhcGjmGIDcz+r/QaA+\nvtMTGqZ6nJGT+GgQGahQr2y1CxdUTa05F0dbt1uDkFcAuBJHlgD3OYMwqV/v\nm7eCmc95do+nA7icvNM1ZmEkUVzIQdHqtSKjVK6/sp6lWQX3o7y71XNIinaT\ntuTDijr9e3r7jFw/cxfSxdLiEKKZTMUHlbWSzrxkYSwuzJ4VPrmq5SjMx6gm\nZ/wZPDLPWCcmGX6RxjvlyBKrP5wg1d+ZMTONaM8MdDOXhb8C0r1GcxkkVkd9\n3EfKhHKgSANk0ErlZmYzLg28ssb8umsUbyxLWROI3j4q1OEBbl4yNyAU2hRh\nFT4/u8ebtAze7JM/cwNLghtMTuJILILd66sT0dzRGoxqGBBcUJBGsUiURraS\n/IxC2SXWYNoGq7h3Jmz7sVv1AwKW2Xo1m88LUKPC6yHLhU6H495MXIAQUclb\nauwq9MxpMeMkQmxQhGOaF3u/AhlphpqDzHkQrAcGwGpmyFVWmT7B5dFlPm5K\nah9i\r\n=z6K+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIH3QK093ogmsXr0dFMaE7nlITb3OsFc4xEWUftaU7uAIgKK3u2fwnFxrvXHMc4KiO3wyKK/0CchqA6ajJS+dwLjM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15_1603300708799_0.11143029372688851"},"_hasShrinkwrap":false},"6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0","gitHead":"570298205e3191ab40290b87a871e3c7645222a1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-26LhTwsI9ov+BWJbTKO7UJSyyicCeBMOspwWeTeDP4Ir7ec7FZ+SJRG645cZBBXtJoL74jrdUzyK+IzNNSLR2g==","shasum":"c05ae7b4711b59d897b78cc5fc751819ace533c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0.tgz","fileCount":39,"unpackedSize":215879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkG2DCRA9TVsSAnZWagAAZMoP/jef263ZTeuYwKPeV96K\nEvcgNQtzc9zhwkKwxJ2T9aj8g0W6xRvzNliENF/Snm/iAAPWhTp3b/1/bQGR\nDeRMeuCkTE84bd5F0VaM0hKZhFbQY7oBHpnntFEnIf7ZlE6SMPwIsEyDN6gA\n3X/JCFw6G1DeJMSbRC54kO5BOhC/ky9nBSIgqa2KzZkLVE8PlVx3dRmGZkSP\n9IrRJfTv4HVSwa60Im0LSdQCJoYXSWcvRWqAshVjQhsS4uU/yR4WnDOhLtx8\n2VdW7g6OSHTZPh1IEFfPMb677eqifmkx4zCrDdSQ8B1fRjFTNryBGZEUvgml\nIZ0M5nvUAliPyjHdkxp0TjYCP2jcOTj0rU5lnjcddlriwczVYJpmeprBBPZe\nqmXUr8HLBitmwstPAfXldYXpNXWXaJPEITzkJXJHcWDeGAXG4CgSVWwxnrt5\n56CfB3vnVbOqZGYOKed5s7SyXcF30sITMqdkNssF0pANxveXPpiZ0udp+VXK\n/l/r2UCcmyZPaWyisLyDrVHEg+aCkQ40ijY/wji61VHU9kxVKqimc8IeENZ1\n9v5EWPpTh+sQRIsQVa1wBZcEWfoiI6Ue3bys6Qt9RD0BqOH6WjYyHhwzynse\n8pX10DBwzir38jc0haUXY8eEn0KZ20am66qTmkONA/cj7wolOUeHU5UrYxGI\nXlqj\r\n=r2xr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASLR+1NMmw+hDSvfcE3oGXURldILEkMJXymvsJPwMyIAiEAtqfdwFHENxVmMMXpCEilOUJOs1XRrvTG7Is41LmJw7M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0_1603300739342_0.36669778236323425"},"_hasShrinkwrap":false},"6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"333b939098d7de50a97f433c0f3bf07979f8eb03","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rKz+GCGm4KnlxdE2nhz899L5M3NqAAgV4UlzdKq8jv5HHzh5TtMmBZ3GTjrsUik+hplmqpiaxoS5WR7dM/0jzA==","shasum":"eb45e232688c6f8d775b3852ee112c9229038e2c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0.tgz","fileCount":39,"unpackedSize":216163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkG2cCRA9TVsSAnZWagAAPfkQAKDqdHfdfDl9rtEnv0u4\nnyy3Ny01Zw3dwkdMxbObeKcFEbcQc9XpUHET+TUvPwA1OkoqzIsi6Ju8p1Xa\nANVW/slvDZOkiTScd38ij9efZ5IgZNuMuiLVYdt+0Gzj8qCq9g9jZTEaTTlt\n8M4opyEHHtfnO3eWP3VXik5M/g5dWLSXIbJZZ9E6RB1Efv9n8NWLCQLEtRMf\niwOafGAcCxWcojLrTdyh7C2ttk6wuQUE3YHp8+ItPQm382M1bq4uqgvQAQhp\nLBhGMztFdKcTFkQ+JDRqY+sfHGKujM51QFlgk8ftAx3MufwNTXceq1U+M8DY\n2bMFIEw51CSW93XOKv1D/O97Od6cE2mYepMPSpfEdtFZy0J+a9hd1MhmhXGl\ngU+jZ0AT5paEGWmrSssNzvS67OK/koBUcD8wu5meihKD4wKkJEaoyIxcnHXe\nG7OCBE/3ajAtSwAvyuY7YsOj9jGLOWc+SYZp2vKc+nfevWqwbSdUmwJNDoYZ\nSVx2QeKgGGRtLaQBEfVO5t9kcLIgaONACuOhC/tbDxYf8MiEE4+hHkz//wI+\nI2EPzcup6i4QoF6PjY5HB68CD6DYUT+cLhr/ICXeqE1RwAhKcUpACCRXR20y\nHHTGLUliHb+KAfxKq3paJo2WmXIsZiGPNlp1Rgaj3kmgks+mrhN+UX4IYykD\naZ7X\r\n=mf1/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5b75StLr1h+LXVJLl5xMM4O9ELtYqJhykmFiqUl0stAiEAoYtqFJ90J9bRK24QRvnZDBilyAHeeSY8EGfl/IXeZbw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0_1603300763615_0.3819341948223214"},"_hasShrinkwrap":false},"6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0","gitHead":"c604e7d45a24b31ed7f50c2ceeedf2de899bb2be","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-C4PeLvxAROIKie0FKgd5UkPc6T709H8br7vDD3laOtyFRcTO0xbMMAIIRzjocPZuQqFnOcCs6+zpJIVRjJx1DA==","shasum":"8a5f99e45cce0c6b68d91f77901fc6e022493c15","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0.tgz","fileCount":39,"unpackedSize":216163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkG2/CRA9TVsSAnZWagAAEjoP/jANPk9vmKrT+uKb1p9n\nMZw6Qt6XHZBuwJS1ysYOIhtkY7F3LhtrdhT2bAni30TKmYUO7ioNNJ4oYKAA\nr/1K6lTFp7NTsnQ7fdx3h+hDDA02oBxrIjT+jv0Cja94h3DGcHAgunZqy8Op\nOR7N3JqlIgEXCKUgQSXA5zDgwbV7PKu+xIdHdXwWaf5BAGmlOcD0aW9pZocb\n1+b1XyL9OQ+Lj4sTm6E/DNgffTws4EfUv805s+M59Opt8GRT/ww50iiNvohI\nuIOu/hWZcl3J9hk+zXQYzKfXI5OLAsmRHCYSGQrZLsaqwesF0zSfSrfuIAfb\nocXir/9iAkojyjs5LQYppO2fA3p8y0lAQnGOhdhAGzKtIKjOfswz0Pa9J5me\nCRwSRHN6gDevwFAROVQ97HVTG1tgEDfqdMTiy3KLmyEj+6pYVHMv3j5G2wZA\nDhJop5yW5azwAWl/JsQWyOjl6adOwrILg4pQYfU8M8PwOflWqlEg2zC3KCMF\nQCxUdGNSMxOzOFemhinc9QuGevsNrWUGSvDehunYJ89pDjl5Fjm4y4SXInq8\n0FsGfRDj1pic11DXoBKEMOkwlEulWTzJMHreafEfh6Yt/ZbhHh92l8WpIrYz\nMmx7VZUsixiTrMMmCvRkvexDsPfqpI3ZUMZmd+/PdRecVpIeTjLhklWkWc2/\nwRNO\r\n=uGc/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY/DPNbdYn00YblWJhpofrwSB0FoPIlCMf9SSYzqgS6gIhAKF1oKfg5pK1rD3xsZkqYNF42HotP0le46Q5bWsjMV+7"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0_1603300798491_0.4607527546404486"},"_hasShrinkwrap":false},"6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0","gitHead":"dad2953f30d84f832b4e077da3efc00456c934f5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TzhVutcQZDGJ7cksRW80nJ2ds8VDhuakE4l4oU1JHc5MYINLioPLN7UjIgjDwf5CxBxvOXhaxAxLpXcjz9s9qA==","shasum":"a511ae2dfba56e8e40753447dbfc63f1c92b2d8b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0.tgz","fileCount":39,"unpackedSize":216166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkNS6CRA9TVsSAnZWagAAZnAP/2NS2DeHuTOk2LvzcDUu\n+YOc/wtT8vrJXbd77US2+LAdC09bgnsl51x7VxTLqmM2opQw6SqAX2eGWVLa\ntiF8BKlJjyLvq5JIlA6AmS7g243IayNRqx4eKiYCYK1hqmFEuDZv4tua9Ax+\n9c+rk9oyIidXEwJWzPdIPd6P2Z4+0W3MITPHy7kANc+EczhOTLdjCnSAAFj+\nPMDCJQGZDP6cwdb0d8dDgXJe9PYmdRn5ps4zdrhnu1DSbx0ekXzkaBXqZoL/\nXZVM1BeXZgFF9MvCqEPNgA13p8Pcrg1JdQ0EnqluZDDyR1IndadTdzvHAoRQ\nidMY58v9m7L+3/uHmLXEHf1cl3EUJXF4oFrVlneNmS9LV70X86tHhGWBQtum\nCu8+WUC8kuo53WE9sIcRwDUYY4HfP19niSvL4Rqyl2szM6g1U/vBcF9nzVkb\nqRiMUt2+1m7vLnvlRFWj94UmdMbjBEZA60woaZRCXjvzBx9OyryZkXlAJ/0x\nmYHyS94XbwamXTbkOP2dfJFfRKYDTvLtWAWlbnaDoV2GnuKziXFhOFYbLRHV\n+8RAPj27J3vYKZJqOC7vP4OFY7Lo8O4Nd1dGkljTGYntuNKitQbjRwM7PCY4\nQRxztHKMiatL1FSpgTt4LRhDoqvPv+dK6hULUK2BxOUhO32b3vpPYE4cPSil\nLraW\r\n=0HWC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbBLyiTM1RVAakNlCFjF5KSlmzvmXDNJkgl4cw5POV0wIgUWir7wv0PLtquUgXg691BVljP9JOaz8RuLYqpHtPBRw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0_1603327161517_0.2917518966585235"},"_hasShrinkwrap":false},"6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.29","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0","gitHead":"29acd622ea58a3a871969acda28bf63069205f5a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4JFnYFtVD13O+6VduPRGCS9/+NhzzZ10lqznuDTs9KdhHOy3kDNoGcJDbUSWsByn+S8o3QS1n7CcxwquhHeHqA==","shasum":"cf83e4810bdea3019a79e025c1416431b98d19f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0.tgz","fileCount":39,"unpackedSize":216163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkNTPCRA9TVsSAnZWagAAy18P/iH42qG6PyQZPxBSQPs1\nuBxJyEVcec8SbZkvvpOTTwJFDGHOlAcoIc9BnZZXr/sUlORdxioL2RzscbvZ\nCbF+/GCxm4mm6wOFymewYXMjMyk40xn5RfyDwCMDQ4cfFEvCkWKS5ZJJzox9\n38coNAsBQT9G+iz6AsSCYf+P1PGK34nQjUheF4KywJMpje4jihycoYgn228V\n6aUtiJbcBfIxcufLmSmpTYfNuTZzhebzy2klN3tVJHKg0FSe5vMxB4RdIbRv\nmG6nHcFFWfU+bjdpS7KJNS5z820acbIk/CYqv0Z2Zzbl2xSyqDMBZ6mYw/8r\n1IY0UoPCBJajToPsYGrVznPxwZIBSEJr4jDhx+Nekkvh2bDhzfeOyx5FSErx\nP8wX+Nya1QxYVnFpvlcbwCjsNiIUeLMVlAtCITsRdR8gv8tIPjJPNLncqCC5\nNPBeLN44TY4o+3VOlgPTpfkRoiYEgLHwO7UE0+LarcP77FbyeoW9/DGek2ib\neVvWfHrX3tK4hHOCU+6M/M6HeY//V6NRt7rNr8iLM87iNOR39v+qksebfRLj\nUexdg3YnVPlxzZEn/AlFkzmdQv8NI5wIa4MZZFmFCz98/QsQJfDCg1DHn3TN\na10xE/yRZc1tB9l++a1Rg3tqyRJ9PZkRc5laMPjKo8o6MUAyVDl/S+9LyADD\nTETR\r\n=fG+j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpYzVkYr/j6TGiw49FcDpMAronBMP3DQoNMGEcoqcwDAiEA6dCcwlHz2o3B8AIJG1LyLNPlivnAkAs2RWob18+i9Uc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0_1603327182603_0.26923105708427886"},"_hasShrinkwrap":false},"6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0","gitHead":"a780990a0330c7f96634bc420d3b64b345816023","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TiPwz3/oulaqbJDf5yh8xeaGaxqrhVmPv/yrHxGY0hTegZUn/AQgxqCgkN1uW5iABc/FzLHPHXBEGq9Z/4+wlA==","shasum":"6e9cf43b0409f28e36857bfeb15044d01ec07a6d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0.tgz","fileCount":39,"unpackedSize":219090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkU5zCRA9TVsSAnZWagAAKUsP/0y5RELh2jnVYCDGRz4q\naeJJ9u6DjJBCtDzcMc47DivMkOJi8vyBVw67vN0fVTvz8I7o+iPHN/tEmDy/\nJHgjMDxmICWqkIwRnKCXohEDHmuwVous3f03UAMxTQeskFqXGBfnFwDunl8b\nZXAkPN8gG48YNd8pngSXvIYvqvfMNMc/G+0r8OSTiLvtJaBH6Vpc5s33bM0w\nDeS7IouADK6NuR9Cw8BJMppLzfAqjVpgw8Dniocd/tt1FQe+f7TTWrsHUNfd\ntGmDJ28Ue8/ZmRBzr4Q6DLiffpdT4SN3ZhSiRETPJT6498yOVksyG2LGni/S\nUjqRmjlG8hW6ncCRZbIU1+mEWpc1wwWqP4s0DzGNMyzE/Tk1ao8h/wYe2kYI\nMpLtwkrQoNdnoZba1k9tRUdfrxoGwl6UDi670lfRCbthb6lic6eGtnsSital\nELykvTqr9nJD7xuOs+Og06E4ZTvuRMxvVMO9wjf0E9G1Z6UxQjZxGH0j9JHV\noi9+WYr0NYT/JfdcAg5oi3E5TrZUw9iw2Vds3hSymt4/HqkJSaBdflnWWyT8\nxY/aotEwaP/5HOJemd1vgQWTHeeSl6iuPZqzCNYlueLwuUEwHUMtdW+ukO6Y\nwxawoLimJJubDzIgpwRG/WXSObvnEADz6IWE0ULKlwR6CHvMBdr14+OaFhHi\n1RJQ\r\n=9KEx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQbisYaN9/SyJFxzLoMjuA9wH6Z2leP3catxcW44kjJgIhALg5rYWFk1so7R0l4WAh3u/IEI1Rmsl8OujGDG1KqVO0"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0_1603358323067_0.6963951345227339"},"_hasShrinkwrap":false},"6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0","gitHead":"1160cb4b16b49b6bd0649fd877c5227c750cf666","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-DfYSJ3xRXZtobiz4e7ZgEXs40GpB99AyCa8jrggNArG6+uLjZfjOP8mQxPTUYnc6+SvBivcVClgQ6Hm32hmA9g==","shasum":"91af518fc689c69db2d1781fe023a1ed644917b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0.tgz","fileCount":39,"unpackedSize":219146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkU7yCRA9TVsSAnZWagAAPpsQAKNqYMSC6YGeF8ucKk8C\nY8B8m8JrWg6PCwM7t4AVOtS2yVGfEQbiVxMtk4CqEim/nda5GFXS//cAqqHr\n8zAz8lBVzRKHcA4f18vFFtvZjCb/oYjxGlWfDK/eoLsdfYlnROBfzzqMQWgx\nA/29vC9BHUo2zryo42xW/yV36RXKa7OvLgGAfUZs19FI0iJG755xohOlmQNm\nINVrQ5ckXi7X4O7XCRm5YCuZphiLkDxT84XaySC0ygDQV6gSlpl70y6GSKA0\nAmy+0cWjklwNsHgsifg6LUPMet1VkzuaEDnNSOwTdsZjHotICwnfG20JAwqR\n1CQoiiE6bF2L5zNvbXVlZxpQed0gWxy9ULGEJHLoYBkOXqlR+CrZr2gFdizw\ndZPqe8T6Kmj+/eYra/GmhaMnH8NUolZ2adbsh4PZnuoEm0C9hVkj8LZKcimr\nBYE4O+SBddjQf++KVqaHTysu8U/AmNJEv/SDAEPh0sCswPzYvy3/eIPVOamc\nTSWBgPMQGCce5rYv7atRX/8GsBd7cc1MMefftUAqVgf/z3hh7PB02wZStCNp\nCk0frBoK9NW8des0Qho5VzEd/Dnb/BpYFyOUGzeSN2JSb4J1++Qla7dJgaZf\nBJK0zhqsEd/rfy6vD6dlgxCDoYRSktZeVnvnBoIZsUH3D/mgOcu7VMd6wJM+\n11Os\r\n=DBo6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9G0odtRIWAXbhG5tFkU6Fvf8BI3GXALJAg7yHEAgH7AIgY1b+/5YJwvVvZ9bcMFZsCuvnsKUbqc9dtjGtABL3AAI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0_1603358450237_0.3176996498302098"},"_hasShrinkwrap":false},"6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0","gitHead":"043140b7923a95092ab9ef9f69d9f721fe903eb8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FDgyspfcHA41slYnurqvrEDx/IfHRkFKFMnXUcTuOXeXM4X3emDPwO2mQCwbRmMuX00dui9mh769Dbtmm8/QTQ==","shasum":"ef42a74290bdd9c52f25378d41f52752653a1d8a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0.tgz","fileCount":39,"unpackedSize":217355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkVoPCRA9TVsSAnZWagAAOBcP/iuiHw2F2ZwE3TJMgyQV\nUq3qH/7Mi9JtuJu5UzLwYJyWnfjo+fn3REFehn9fMjmKp7Bc19I2Zb4yjFPM\nEZANZqtlLoYVcfPLVi6FqsL0pgI2JZ7e+OhnSB2IMnidgFtIbCxQyKWtEIPL\nuGKv6Gh7ZAj7VGiwvuzmAD16c+626fG54cytd18gMg1ivOOTzsQPqoBOuejL\nRmlQEdf/p4/3sdMH5qhCjGYUXuf/KZYMQpC7evL9docwBv/ihtsWYrPymuv5\nfPEn815of/glEoGKvK7xrd3U+Mrzh3x8jXB+gdjT9lydu1Dqa6fOHWrp6lcs\n2Oiwdh88FeMo1//TXhEN3o2gdjNkqBExJReB2Tl+JCFZP5iwbTwpzDmla1WQ\nACwZiIm7fLej/4C3Hqwz6n0Ks5tVlm8kQsoQfGOw9yddAP288LRyqm4C5WXn\nfANXx1cvltMl25gzQbMNI2uPbobnEiXcHqL5CrsfZ//lIlGlBZPQkdkxLbRL\nBw2J9kiR2lteI72vNAI4R87hJrkRmE5HPlLcoMRpc8jArS+tbRKDLK/FHNC5\nqP80ObiGt2cGRA/re6UGw7WVBleTh7eVkckc+fUERtyOEks1Rdf7HYgH8gCg\ntuzkJYx1coWHhxZ5u7BqlPqHWQ6TiHNOq3OTlSQhwTOMQvkF9tdfx+34cwSc\nuPsq\r\n=k8xG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4XeBChucd0t8GrmJmmH6ENDLHYQELdXW/vvozJQx9gAiEAudFAL1AcWIRX+oGWV9QXuuRod83a7uFMC59DxVngLyo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0_1603361294984_0.439716905767793"},"_hasShrinkwrap":false},"6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0","gitHead":"0a1a97f3b0d36290e905328694555c640724597e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-fMOzIvkJFFMUz8ECafJCnCDZyMERX1mwKJxamGazh7yC5MxwcN1EKq9KJaCWrIAusRv9+MnJsjZ1o+IZDdgxQA==","shasum":"f850b20665971132f0255a05f1c3861ae2a1b2d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0.tgz","fileCount":39,"unpackedSize":219593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXI0CRA9TVsSAnZWagAAf0AP+gIttszsElSwG0Q6l+iA\nUwi2MXIP7ibmmU1K5t6f/Ctu1S9M7mJD/5KcBxHclY19k5w+9JdTG6mxdZrv\nrRD6QqIbCsi9ACjwaY9AxaDnFUnsVmNHKGiTZfH92c5fduk1ozUDPBoDj4/F\n5DuA+uRcp9slHf6bs1nhvWOJlSEhGvjE+sWPOBxEV2J5N1UCq0AHg+sPxe3z\nUm6+6+DNWX1SOxoXMsxMoZxFU9VV+Aq5Ky+CZDCnHhyTF/xmFRJ3Lpb9+9e0\nd6chzSPZ4fq9u61AbttD1KBY6sh156tuTxyoZ8XkTLl7fUNuNUwXZKFL1JPx\nRsVqFkyu7p7oz1NNFQUD/6ytn0I+3WkAHS9EVAVAwaDqOiCicBx3Ur3QuX0+\nQZaMIm45vGnkyw0c9P0JInhrN1NqO61GzVRp9vkBVYszHhla5ccO7/uw1vGN\nmNQ8EPhOShAeCBUSBeL5FC4hNAQgzm1cdi8zcLXBMseVksiMIu3RW+IlDJlk\ncacDUIcm0TSgmjH7DEx78Howc6in6+rCh1r+66MgY3oMpUdreuH1lIqc3kto\nEWXTtbra3pNoTIhWae2G/kdIqih40TdOAzQx0V/embyybT9TuocKxFSWhuIV\nA7LCulRYN18taP4DiAch4/eUmL6tSuAGbwQWNtD/nAzUvfSVd476BnfitFl3\nxqIG\r\n=F3Ji\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs7L51cGjDrHaJylh25kkfyVBFvNmziIquO8nr0q3k/QIhAN40tZriAuG7R8iui6Z5Vg/BlYwAZuFWOXUX1ydd+FrQ"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0_1603367476044_0.36384090012796544"},"_hasShrinkwrap":false},"6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7f06ae37524f990fe0df6864e74fa346597edfcb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1RiGAvZX9OlsV5BQK9sfsxbxGTBLra00o7pgBIIXHjoaAXSKWx248FnViUKyId/oFo9MM6lNoWpYxPCHxzqskA==","shasum":"048af39c693ab6dd6e8820025ccf933d304a6c45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0.tgz","fileCount":39,"unpackedSize":219593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXMXCRA9TVsSAnZWagAAsdgP/1ZHxUwxsZLucxRghFvp\nn1Ni4HSUAqJkXJbfwoNZWuVqT+igZ9lx4UXV3ZqBPwPt7F3he8vXTwJHhhT9\n/XqTDcIv0Iq8Kl/yD0rx2qABsurnPPkd0BeLhkEORJL1ma3msHBEo14FrH0I\ni027E292tdaF4BnoclnZJ2ltWlKL0IXQ1UhSn2lA025aS8i13VPxVZxWFPqg\nCmX/snKaHOv3kkCTkVa40PxV9OMjS38a3dbbAv3qZQ2mACDRz3y6oPPHFERX\nKbxL/Op/BIqGUrF7Y8mtuzb4nF6YoKS1Aq1I4o8H+Tdj+xvIbCL6b9pbZJWG\nnWmgDAQGCeOELl53WRaJdhK9bcO+L+jFc5y0drvjbY5Lqd2rhmw/xubnRXu9\n6kFL+IV0ug1BrAXH2Vn4aURzxyqabJNLR6MGTu1Y3zIkvPUGfxqvLj0Ac3F8\nY00614TW1IdrIQMioJuasvifbgyY4A5rNUFG0CWGJ3hK9zN1ZqemMA2qzzAE\n36cXt6kgJFIFtaXE3aEngCmL/ekoepxY0fvwmtF0GKdkoVcTs7ekdkud7ii1\nQqedlJ6+jWFzn3ve2V+iKSYxoU1rucbY1CQQ2NwJQtxMJmBDLwxwBIM3PWsY\nSuI1s/0PPfvidQa0RPRq2FnQFgwxxESnRWnhPshv564bZwv/cUNOO+G+ArjX\n3E1S\r\n=L6jf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICyNd+GRtFifZ1xO74BjqYW3HaRbEFwR/Mo6ZZ9CdS2jAiAtvjCVYwTkLgUpQoNgWyGXJJniy9KJz8VKC6m50P1f8g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0_1603367703008_0.6697732380683135"},"_hasShrinkwrap":false},"6.2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.0","gitHead":"33eeb772088d819aa5e001b67ce820b5bf11db19","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-uyzti30jhNbIokhuWvAbYUGfpmynPVwV/N1vugD5VL80c2x0xG9gzAnlcRJmky6jNzb9fNE3WKo1b0RSeu8zDw==","shasum":"12e43c1de248959533d4f56ac286df8ddb387312","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.0.tgz","fileCount":39,"unpackedSize":219794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXMqCRA9TVsSAnZWagAA+hgP/i45xwf+cBCoDOf9pFtf\ndlE7iDujbUvP0R7//WWvDKqsWJI2wWIzpB4LHWXEb9D68CNU4G89ne49HBsx\ns7re8PBuN9/1Jx5nQWXH8HgEtx+qy/F6U4CRiwLlkR1Y4oV2XKxvJdpijbru\nS77jQIsHtpKw7i/9g2x5ojcbAb+UkQ4GTG2BExlHzEmkaKrX3CRoc96+B+XM\n1q36pvmUz6enWG2gknRU5QwXtGM3FOmcxIMMhdo+NJGQMEKQ/daxp3Pnwoxd\n4hiyguTGP8jCkKFh/RlxTRt0VcqKqyCgrsbekxmGjtjJjqTVUTft2lI/haq8\nBpMglRRW4qmY3h/JyUqv+3lGFbIwjcvMgRjUEF+h1iWCHC4FqQcgVzUAV3RS\n3pGYCko56DQErAKLrQ8ejjV1d6JZXSmq/Av6k/+zsY6J2WyBp8g4dmhq15yZ\nbJt+HkonX0Qdxy5UlpuqsQ04QZkuFq9MLMVTZk0LYMggCAgXMkCCVEa6FGaO\nEBfPJ28LtVKRU/Upmtpo9/adWxjTolyTRC8MSy1XMfQEhQ3JAezf6OAMk+oK\nmyRWr4tpYmbkmDJBMeiuYUOVclNGNNTSvKBSZ0w4wbxrEuTzkx+HTAW5D/Xz\nsQ21zcMFRelJFf2yko/qJrAIMmEwbaZggFcJi6DDmswPZeKl5U9DKZTIMouf\nZrwi\r\n=2alT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwzOccc3MnoTM7YUrP6Zqi9Pb/dZ9IHIb4rEM/Taz26AiAyn5Dn2lo5m+YK8y0dwKTx4rB99XrHyXVEI5H6e4MaOg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.0_1603367722483_0.13287587773452536"},"_hasShrinkwrap":false},"6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"33eeb772088d819aa5e001b67ce820b5bf11db19","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Hmy1FWHjgw410hct/gGWeKCPNhW+9Z8V6DtbBQfIP2PChiKHSd9sMqxt23NwfjfxWQcGJmZama2/rSoSr2U9fQ==","shasum":"526a7985ae08b034adc15d4dd5c0de1e3747ad4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXNACRA9TVsSAnZWagAAroIP/iLNG2MlxhuB/OAghCZp\noRvWOg1kRSyhZ6HVT6KqTFvKmyOM1UB0VEWJjoRFB/hKC2Od+sMeVD7tcZKM\nN9ptkLTaPraRpY+X9w+hWIMDvMoqqm5y7moPKyIq6pgIZfb6WncUutCF6Qgf\nI5slvc780jE8U0VUhCYxjP3Yf9d+6s1ezVieee55H60ixfOah7K6bYLxuTxo\nVXy7QnwLeDprXNqivS4BahAzn45l9RuPcEhWacDVW7cTCGlipQ+xmAPoxmmi\n4KX8KJzfxmuNjQC5fAa7BrwTe9TR+45o3ZWv7kVShNSE8PH4xg1RbU6lVQLi\nTIY7jZk+Zq3fredKKdDgZ5cHAcup8HRMFigvuX6Ca+WYAvfNNdaBIGkUR6YK\n2lcH5rP8A4U7ke9sLAy3QfNrksmEe1wj81w6L3uhWP0MvE3x4slvkcOqrdyg\nQkin4ZCJY3KPlNwYAali1EgxnW5oKFPozQ0Zv8XnuZUS5L3rciopZIcBujY6\nVautZn3LnyXXLUgjZ/uGP5qiU6sZl6MpLQZKTbqq85k1PkHR9fFcV0XrvpwJ\nStm+q5cwb/h+MmsdqmNChG2aZs6jT1WlSx6oR2zZbm73mkYlKXPZw8/ugqeQ\nR22j6R5co9ZfoAkBV4Eezb2KDHRB1bOGJ2rCaSC5aQQ/IdzikcMLVG2sKunM\nIKIs\r\n=glA0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0Zly6LbAoGmQ6Y5eoQuHN7x75hRgf+1gGAX1/7CGgrgIhAOpYDoJREeN/5gm4A3KgAJqCAPUgx2qvlx2Eu81GB2rP"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0_1603367743900_0.8706820031923503"},"_hasShrinkwrap":false},"6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0","gitHead":"cedf5935001b5c6e0bd2a0189852746bed20cd5f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-XRewp3rbuaupZ49gSR79KUEWdiB8tWoX5JK2MmCQP9lZr8bdboeEAoBSsvUKxxJwxNL6I1wLS7gXR0rNh1kTzw==","shasum":"7230083bd14e5f152f72bb1a02dd1d77e43bb8e8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXOGCRA9TVsSAnZWagAAaW8P/2vJzK70Y814Y+J5yY+6\nJrYS7XUw2xJ+43c2o7+BVlpT3dDjMppdFJvKd/zlZgrGRJNimD0DoDlduzXE\ngVdZatrlgailJVqyONxS+FlvF2oWy03yAJEQMjYBof5QosV7ZlxZZrLvfZ/X\nST7ZwJJanLpc0OB5qxJ6ou7/2R1uqmXlKlWriR+ZBkbZ0G8HAZEm3re8UFe5\nox46SS2XVeXVvAux0H98dANNFdljBCTev+i+Yio446hYqngER8RntSC9Qb5Y\nc92POmBidchk8qaMZgsr4cElhF/4dQlVavoTLLrLj8Nm28+Y6DgLoiXoQib9\n8dQrcF/CcDiEbqRbjhyXvwPvE1x9tFU44PoMKmg6M7nTMDfH19oPoT3AO20o\nIObbxliEZk+LmZrlZ8F8WMuHX5Vyxk5GTcmbjiuuy2v5fsumIsh5OUHRBYKu\nWGqvggc4bX5V0NVs6xgWo066yZkafQXh22tc0CJ8u2z9WaQGbaUlIU/PqOZv\nfl6OOQ1f26FD3FplGm7OYS8J6AuDCnZfdsP9TMGWSJSXs5/G7hbTO+aCWeQ8\nl/0+AfjHzaa/8KN0PohA4Pj7tLhLoz5uQ41zVUSuapW4g2sAcRpVZ2QdGpX8\n5RWUqyHO2VLebBuqpV2BaDsP/wvODifbQSlIhZa8tScReUyxOH0ci8lC45kQ\nex/2\r\n=4v8E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQ5sidd/MK6wfxFU7iWX62VLXKpOhqD7TuWiWaKbFrEAiArq8b0sgUjcsylDB5TdFN6hpJjLIoThZbm9RVthZY7Uw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0_1603367814159_0.031425562346283575"},"_hasShrinkwrap":false},"6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0","gitHead":"ced9ec2b48a811774374c3141219180494c7f042","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9Q9x4vfEfG/g2R5R8TL9kYWG4YoaPG5G6Bn/3wMJ1BdQ6oaVVvgSKNEGWsg9c3hbvyqaKWTMM0M7qTsKtoOpSQ==","shasum":"88affedfa95a7f867e33dc36bc8265a9dec67e9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0.tgz","fileCount":39,"unpackedSize":219840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkdRyCRA9TVsSAnZWagAAZfoP/3QBt/BDLge3EIJ4rB/f\n6l3FkYKowYJLsDkolhIoSyJNM4g53cvfZLAxlV1OfPcz9GoNAzYaRJ3Adx74\nyJC5kt2wMZ10+1AY4iDW3DflzK5ye413FVDTz2DP4/TPNYOGiVkrYOqjYvBZ\nzuIfg/e7jEwrgEuAPP3/g9EVUqiI9xJD6boQv4YVewkTfeaHz1tKLaB83gnv\nGQw1MtlC9iQIIB7L9dEoVPR5MVcUtj7Q1inie7eJu8qqI+bAnkB4ms0oI7aT\nad2lxkmLQ5ol1NwkPRmLUrOPP4LrqreP9v+a9Fkqm26Q+J4WtdY/jp0kNgMQ\nLmFgNtdw92UK/e7wzgBVQTFhAyk4P5mWERQpXC4PBioIAk4gruzPYzU/ZNKM\nRrdtNa4Auz66MSREjzgu67R/XxklBK7bb7VNYcAl7bFnRmE5wcuaTgGCtBMw\nTabcsMv90qkcHpHoPYWuTefhWx1gf8Sj+wcl/7finXV+hpnppkMHIJ/BdCeP\nHMN6SCCDM7aYcZdTx/ay7qhE71BuG4lf0JcvWMoQFEMLpT2eTGtZ3SEQp/Lq\ndFAMWA2Gzw+y1B+jEHHED5CN7tEukYxNUaiATV/nuh0CWJ1GkqR1JDDFlbRo\ne9np6F35oRgdmp0veGgjp16wCTm46iejcjTQ01Wo9c+AkupBsoFAlkYHI1Mb\ne7ue\r\n=e0Eq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4/fY0VeTb5zSRbJKzzHpYycvFYDK6UtgJ5C1Ri5oFOQIhAIY4feKf106/afC2p43wbcXD2ya514fUFdSxlUAwWMHc"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0_1603392626264_0.4817639544777186"},"_hasShrinkwrap":false},"6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.29","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0","gitHead":"10694e6193189d8c8a82242ec642cbd45b5554ff","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BywV5HAKFD47AOPA3tTVG91iz8U03vhECEtX2zMMFiyxsxbi5U1qcxcj3XRFWnDg93wEyXR4lREyoBmtMaOnJw==","shasum":"b56376f223583001c4887381a2d47e2b236f9438","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkdvCCRA9TVsSAnZWagAAkW4P/3VwZ90JELy8+BXSZIKH\nb2TeoZxYCT9N372TF5MEdTY46E9sr2tK/LUs3AmjRmeqMsgjR8+9nsW6Sh+w\nZFlM321I0XIir5mxY+xxw0k4zOFs50PT6EDc6PLwAd56qA/Bqc8ABLHR0Rm9\nwNLLOvtAgacWnVMuYmXGaU7Gwl2LrpCkJxeZF9BHbRLJ/HgDMJt4yvRCLCbo\nygGL5e04K9lqgj44rxmPgcGjJYeYon7IAIDYrXcnZQ4OmJA3j3gaypzN2Cmp\nCdWZDeDPQyf3AxWMnVI+6qFDobje9Y991pkfykMWmUOBkW/2aAlg4duKQlIs\nBC+MLurN4zmNUE2HwsVEpJ3SJp7r5E19MklOmFhZYu55XteRH0RuZ+SFi0z1\nu8mhbFcyNJgx84Qk+yMD8MFzP5tdAOyTcBAuk+cYak+n8rEPmWm65Be9Iuow\nemGQhxS+S6FUuMo1IAT+CbVWMh2o48yqJH632CTMqomgNm3Sq8jWEvHT2+XQ\nfUFjNhybZLXBF28vCsmLDyzL92d7RQM7fy6esWPoovuKSwW5zuHfnMNT1SR7\na+8xIRZ5TANkCAYtjdUhFA5g4NkjuWk35XLbbJvxQv7tgK2ea8F701X26jwN\ndLw+7UlMwcQQA5bjfHUSV0yO/jEDVcWXu8akJGjndpxb7FUnQ3F4LHMiqhyK\nllOy\r\n=2i9Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgzbXJe04BEQn4E7Ffmef7ix0rdQJMT40Uzq12OmrTwAiEA/lcjahRmFDG7f3RBbq3Neu3leTX3lybtegZTY9kQNug="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0_1603394498188_0.3386974358361954"},"_hasShrinkwrap":false},"6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0","gitHead":"2a42ace8516c4d2bbc3b3ea36c5ec180971378fd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ZlUc6GbiGxhGTq0JD/HogCK7xSCqNr6EBmWA9eMRT+9vR35rn7La7DSslUJ4T0LgKUNokZQaUovFekYPTUkwqQ==","shasum":"0e20c872912bab2f0acb55fe090c03fb7858a01c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkj/jCRA9TVsSAnZWagAAeH8P/i1FpEhBJd/Spnise938\nbAgJ1VsAN/r9dgCZheEfc7JyxiM/WAzmdQAZ+yqOcOutqz5t4NaM3cy5pJbm\n8V1wDdpUgt8dmk5d1LZdRkMr580Ofn2K0GOzNM3gh8tFQClJrXEPF3A0nMsS\nPUOS/yC3BsGr6ljVBG9/k1GLpI3P3ZeTipLEzqM+jhlTNx091uy+BtGriH4g\n1uj17vMyDu3VBmwfSLAxqwn8F6BmflakgzOnTHkZ7XrDufBPbYsrDtXblyVV\nWFjsxvQ213AanA1hI/LYGtyPiifj537b4gocMMcmWMlcO5ZoGm+IU7aochF6\nisscBZftZ+MekBN9+IiZsQD9J/PdlWhk1Oig9Dgs8zHB1SD+167tjUjY6kg+\np+9d3pc4QO9T9okBi2vR3fk+HmhDh5JSZQUepbmiy4FbTvvp+N+9FWKMucyY\n/5ay1MriZ5wAlxPwEfvNM99MI09VNBc+xya9jLil6wE8CXJE8S6KYLIA73IQ\n2Hv9vVLTI2RLMntBB49m1bD97HyZ0Qiex1XvABLO/pQfA39yWFlo5d7iMCvV\n//915v2T9WMrkY7Ri4vKYUJ3x0YWWmQnBFCesN0cDFjld+W/px4StytOpFN2\n9DLuROQNVJmq1qTXcHMuqS7jMLwbvZj8LK1+hkpwDFP8cPSprqqb0EuL12E6\nGjWY\r\n=ItP2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQHOC1YRLv+I2J8UcUAmbKUt1ZR+Hc1YaWvGotkZfnQAiEAwSvvmYB9vMTr3MKKHKEdgwz0ODR+QpRDLyR+bSTlMN8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0_1603420130313_0.08958683641860588"},"_hasShrinkwrap":false},"6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.5.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0","gitHead":"a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Yv+VKKNS0KYxadswaZ208XtLB5O3n9NR+GXggWXKLD7edeJbyezTqXprxGusVSAH2vyNHXU5IOhXn+aeanPL/w==","shasum":"9682cddd1603af1beec45d94e5aa9f008240c772","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkAACRA9TVsSAnZWagAAfPIP+wRhPNJ3ijw4Z/TwpKkv\nXmBVaEmD2P5BBHVbHtoSQ5sJ+U/QedJxDMgN0kriZncyi1a+p2NE808du4mN\nG4v7b4HPBgWl56D1L0N0yPDjVeiseJEaZUQzGbM3fOrjXamBMDamWZFjmMVL\n9vi2w0+l3jCLPSERTnlmvpHrDliMad1c97DGrzQ99ui/PUdqw1xc1I4etD5w\nHXiSlzq7SjSDdBC2TnLPxZXDgWTwgE3Rl6GizomqCUziGk+O88yEN/oKtOUb\nw3xZLo75y16UHJhbTu5hMqDqQb0/2YLA5Qn3Cw7vC61zpkwUJx8ksHO8v/lj\nKTZayyAdwNsA6HI82FQj6Th4vxTQ4AZ5+gv62dUw0GdGoUA7shqkXSDDrRHG\nzU8mrict+ZSD3hPvXZ0PcgDyJriPac4TaGJibWsd0TR0cs5YSMKhQw3nlz3a\n1un4oMaDsgd6QVXoLzkPLGtREhzzM1mNyUl6+pLpD32puuYOhsAfsjX5Z7RG\nnq27U6rU+bZM0QSECzvQGhWSqk+UU4QhprZBO7pGS4fincSXk380K8aEZdhK\n+Npr4GzSSpv9W5yDjuc6I03COjZpkU3qBWrg+xCeydf9N5hnx/cRWUtysZpR\nfSquZ5ivqzrwC7IwhifA7Pdd53ScW9LOktgwg7vnld2EbiKjqLMizfbFYZat\nTKad\r\n=8fyS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7KYbBSKIcbdr5xdofAus7G4aQ+2HpzaOUfO1O3ImfmAIgN39HTpDZnT5tiV+q3e5oqc05O/gQN9i4NkqRkYruj+s="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0_1603420160016_0.8463626279624399"},"_hasShrinkwrap":false},"6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.0","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"66586f4a8e60e39b13525a50835a8317b857530f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gxH8+bDsoWmWF2fmnFaTeNsiuNfay900H6BJWoZRJtA61oUO6J6/PyFn9zgTydQMlw83WQn0outJJXBxBW8GKQ==","shasum":"8bafcd9aed83c136178e6113ff3f976323447cdd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkAvCRA9TVsSAnZWagAAYmkP/A4rMsFUEOqFo2YXRyKs\n2C02krOJXUKMtuloP/X3fPqzEu8d+W0aNXVbMBKZUPMx1a9pg/IyNC28/jdo\nk84Q1lV/lGp3JtpqTC+p4sG14kphZpaKAUHnNK5OgYjSODbjIPZ2uTNU9R27\nu8vJs8A3CaKXGLgmg6qu8NK9CqxBYnw7D858CXCcxsuLoQSkLlIGqJJfgBNg\ntK8Q1x1+1oa7OV+4fOA0qXG8EBgx5tmP8P2UDID2DsYrCmJjVpXwn4ugjGLr\nMX43Mz2QR02iIySYB+I+4m+7r3RjbCht80P5lIwt3Nqgh7EWofyvRGOZ5Os4\nOTmkEuhlF4HXLzJs0CukPx04666w7YpMofsSDmTFOGJBSnU1nLtWFIQTfIPk\ns8ZD80PemGGgdCJtOivuX7D+4JDYV1i4i3RuIRipIKV3rQ1g8yWsn9Bq4WPE\nP/FCmcOXP4gECdO9kgitebQ7nkWLak++Z/nEQzHtsWJv6FJUg7NzBC44ssAD\ncaFPyWrFG9by5bYCXpt1vTt5SS1juLgtSJEmdVkT6NLa8jBHnzcwgiebEpHW\nMb6mikEBBiezgdToEev+LNUvQdhAAYWBbL49npmqIa7xe0RBPGFpVJIrBmDH\nJbXOPmDzeMNhi+A+OUFSBb+EY9/xL2OIUtHqCNpblDOkW1CDylqWyv324WCp\nGs4l\r\n=eMdG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOrrlc4NibSfGg+h9k4TB6WrPr4sYXkPzZrelOd8iL6wIgBoQ1cTN6X1MixK7bHpSPUP9vj/s3dpkiDF0DgP8RMOo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0_1603420207220_0.6672590505721216"},"_hasShrinkwrap":false},"6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c90616ab46be91c89e975fdef30f63c36b3bd4e6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-GPaX9MjqcUiOqYQuI31/w+F9H4yf70p/RJhxvabPs4MqFbbbp+8Yznju/XmgG3uft25d6VTPtu0kauaiH/Thew==","shasum":"fd781487cf59b0c691664a987fbf44bc15a271e4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkBTCRA9TVsSAnZWagAAoboP/R+AdF6CMJTLe+1LSMsv\nIbLMupjXz49c5Jr+ISNOE4CAO1Ie+g4Vu3eqiJp5c1+abuQx/hApRuBZ7FVZ\nbGZRbXybYN6EAYwgxxruRnLJDKNv0K9Ml7nA8FNTzfyI8DIuXlHUGDhmIYBX\nYS47PPwshJrg75b7phGVS17S/rz59z99tNAx0Lc3oF6EfrYEByc423fhmW7c\nVx+0F/mDWjS9vOBZbbOSH0JGQKQnZDteMvrZGoLNHmHrAP3aDKFa4CyPyc6S\nKzoSQtHhWg1SyRuOmLuX0UDVyPoecctxlw2Jz5+yK8HfWjZhtiwUy5nm2/9x\nN6V35CCDNIPOYkgTu0jL020Wpd909IMuFjO/uZQU4rnX8GNBlmnOnn7X0VSH\n6WfrGNDUM2+aYYtwmkrm58HKEzVI3ucGd0A4iBCcrFYpwBvk3qF62R7L++pY\n/vBD9Nu3yPezN0BYOqJc3PLRzHypowKslmZ2xtJexkB2q5si8/S2aDRKRPrQ\nGSEQge0S0iql6VpMMhTkZ/LAYBO6IkDlGAqK4jO4BtTjWBPPoxOibhyq0FzX\nh+0TLojqsUe5TYntKrym3cxSOLq7DWO70GmaAnQYTfjSSCjJt1vH9KRKtoxk\n9x4eIN+yv90JQnHsWR3CkWiV6cqabWpYik/ypkil5aA6InpaLqmbRN1WdoVf\nJqfX\r\n=DuH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeA/pL3b3oh9C7C55pMvgWio/Nxot/5omhXx3j4/r8gwIgGZMRPsCxR4q430ZY6tID3LbmfuSEaXaKLMHe4VbI8mE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0_1603420243391_0.4943934944200814"},"_hasShrinkwrap":false},"6.2.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1","gitHead":"c714eff56eec8cbdebaa2065aa1c76f7bdc1d419","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-dEgwcB8kjTEvJbdIyMDkRCNfUEKLU3tJuerud1x3h2ARsbaFdDumxiKy7kU+OEbFUdLw7X+NWlldwzHCpvAlbA==","shasum":"ce0d53bdddc8543f31c7262756f50841d656dbc1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1.tgz","fileCount":39,"unpackedSize":220239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkBjCRA9TVsSAnZWagAAPnMQAIMgpSoQpt/bjDAr2LRw\natzIgJc4PbzknvKe6ytJusGzYtjyalmVcG8Zd+nUU6UQENPIf6Js2mqev/b0\nP+Pb27shJLnL2ZtKKu1IbLUtmAU9Tr62Ws/+08nPSrLj/AuiEwPr5lZ8hdN8\n611K5beFb2UsIqQSeMQDoTdfv/Sk5D4StGT1o1UASk49TuQJ616Dt2nNtOpM\nvE0nEcEzViUTsaNj8tUp2tCCYILnmwZZH7TsgJLSTy5+7ImwsePAsHUjTQAQ\n15+m6IW87qwgjv0pkG1c2+uxP4qEkMOuc0DWNVvXjyNFhYaY4pD5XqZc2bge\nyxka8ZvqDfPqK6W28fZn1Qz3jXM78hYKC7wBtQHu5O7Bh5KMz5lS8zzp1SSs\njQO29vox5ORdWvpcPnTdt14BIwEcN9c2649aVjP4dHN18LKEgWKXQknLihwg\nKlRBFU5jZptmdi81z6CRIL11ooNGNY5tTQGAQlcI0poxOSlspsXeTtKH3QsY\n2XgTJrUi/PxjSjujaTUOkDonbJjXkRbuk+sSJmKsmvKkBrlqmLaq+yoynXqW\nghsTbrB/6PWHsK3FqlReGuuFQTI4IrA0PdyYAVN6/b7A2DHWVnAKavAUoAcO\nbBJmcXCta8dnq5nyOW1UVQnrZ4qIz9k3wJnRZSJbkKNuNV1i6OwRg3n5tRyb\nGW4v\r\n=ZWNS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOq7d3uzP0sSh0nS68cSQwwrd/GpJq7RMNpyxUsVx0SAiEA3J9rgHUGpZokHxa0fJln9W3WNdYJqQGqPEA2rWtRFpw="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1_1603420258669_0.918328792992096"},"_hasShrinkwrap":false},"6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0","gitHead":"401af40310da0b5f35d506c9f84e8310bc51b991","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ob7adGigafOuiBAJf7CNWOZt8T26RU7wB39HuidudBLK1wm0HDiDQ54hlX8HFeDF4NIAhRBwgQat9ustfvUgpA==","shasum":"92e410d9fbd05cbfd6ff1c1952f45ef953cd9a7c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0.tgz","fileCount":39,"unpackedSize":219837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkB7CRA9TVsSAnZWagAAcfIP/2MUqYJ+TNyBP4VrnrpX\n0TWxV6i5SsmBupc6zNdbJtJQu5wxQfyTnFhT0fqyjjSbYL59L5N4SZLL86gq\nbD9KDL8Jah4RlnJ/hIXS/0WsVHZXREX0N1Cl43AJXA76QQh+WWZXzFQgKchJ\n6c2ox0Gb7miA6Zy4Xtd7cCo9SEuUj3ghZfAXtSmrkDL2ormMOvTAqs/t0upZ\nJgPPTxtgQCN18ZplZQf2ODRiU1JipCcNQhJKCJZHy1uMnZgLqHYiXKNT5Hp5\nTbUEs7kI509DfdvtTpARaYnhAYRp19yS9t+FvHlz7MjBO6ivZ4TKn2xvzfkD\n9I/+lP7Pggd6zbQsPkvETVNOSOGPUU4pl83aMxAB00fQjosnr73GIMBLkHDC\n7NExCzhzGpIK82YxwShke/cdN83HdQ61xTO+mf8tCsOOly2MVi4EzhnoziEJ\nxlfFyNUUG2KDUeWsRvYTKHTrLd9gp+KCAAwp/by0ykW9Ik6qA8e7hKtjDEzy\nifaFm74lVvcwvvigEdL37jHm+ElJCG4vz9Oy6ijqoRBwHqXyzwOtjJQvvyAV\nssN76RWS/ZleosdoAQk6ZFXUtB36NjLcDhRqlkMzzm8RFXpTD+cbEIm4cnyV\nTwQno6Oahu5DwGaHfWVlz9oowVPEnLpc8ICMn7bRnPYzvutZc0Eg4p8anni0\na8fY\r\n=4ATY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZDZ5tYQKhP+H8tjlz4gLAuhDLMsl3P6jV/kNI80SbxAiEA7hicFxjcaQwc9iT9vrszz70Twt/x+lNdUKcwQ4f0Op0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0_1603420282552_0.14557164657522148"},"_hasShrinkwrap":false},"6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c714eff56eec8cbdebaa2065aa1c76f7bdc1d419","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z5bL3HQe5xWWBrS6Y64/Pa/Tmm+7Dzh5BpTzIhx8XPEdobnYRiB4tQF1KHkx+l7D9a3dcqkuloqrP65zZ0uYYQ==","shasum":"2fefac8c5b9aef5b85009b79754897c5a5557e26","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkCSCRA9TVsSAnZWagAAVT4QAIkRj5L0HpYRbBI4APX8\nqFRI0zgqJc29uH0tRT4jnSBzgkR96IAfjuckgakZa7zS4uTypYVw3y69n3jM\nNyNcZSmn7k850He052NsKrh3XH0sBiDxA2oxp/J2KQ+Hk8jReVdPLJV5YESy\nMjTfAYf1tL7F2mbDLUyHFNxRkH8miMud2Ld2tKYlcdBHg/42jzZEK1tbcGxB\njoHb2EOBnP5LIJEXPiDC+DAa4g6gBdt+eX0HRCq5ezzMneAq9mcoUSLAGO6f\nqgT7jqZJp35XAbUxrV9nnMtqlEnTPPTU71Src3dYn1cZGC/lnzwtS5cuqZ6l\nMM/HWsj9UdIrbqDrBmswHmwvduxFDukOoPxA+kTX8wMvmnEEpcXNBEzGyGJ0\nIVbumJ165Mm+iM+5llfMWHOOkEjW2qyX91w7jqOjSqV3r/+L1EYWlC6EuJrk\nefunzzyQa8L7J0CA9TWpvZxwn4PSzop7uvRLrK22EQUNGAIU4KaxFckoc9pn\nb5Kg9zXSZt/VhGVJttlM//1tRL0c24feLBxJvro8px8C9SECj2Krx4GgoL5l\nHagUve2JzcKn467JHU+dvDfdY8U6TV8jYa1xmEXCkPWK9qoLCSIwlLFtTXqS\nio7CuvQ9rj3HUGxBMeSi5m1lu8rKSJr4Ml/IvGe0HMmeoGTB/O8yBU7OCQUj\nJ6gA\r\n=zzBW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4bTTaSRHi5LowjfqjBcJAsWqwsDWkeePAm1g34euKdAiEA9wxGsxOjRIi/UGnpcQmMzQTLandPirRfjFh863ocC+Y="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0_1603420305771_0.7702725620444673"},"_hasShrinkwrap":false},"6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0","gitHead":"ce42854cad6db296c8ce832ab85e041c36652ada","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-y078CjDLXk6w3yGn3pv+kO+g1pEcbQFxL0mww8DE0tf7K4fWcDe/7LrXx/QntxlryjnUdmTWpf8kFnxQjghlcA==","shasum":"d42ef7fa484aaebd057353b34a89c03e1e9156c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkkC/CRA9TVsSAnZWagAA7HAP/3FMrz+BmmChao9ZGMf+\np6+atvLoNrNKBvwJMQ8T1om7c5Dp4gpoSRG8YN50a7b0hJMAkHXr53m0C1Tz\nQNyDRHohPLTP+E4n4K+vNPCZc+AZxCRmvnCkWw6DuQ6pkxetpjteoTz0txnt\n8dnI56b8qPnp0+NwyPyyg6cdqaJulEqibu8FUY6L6jxERFoYyYE9QJC1Nx2v\nWjnnMAtfYi4IJhyEfsesKLA2K5k9xxA+pPJosltnoU5+eOd22nCy0vEjA0VI\nh0FIZmzafcSWWo8N7vAgJxBriDRRXtm74e1dC/aCGNFW1E6m2E8/dt32uyt4\nWl+Kj8tYx5m9C+Li3y8NecWhG4mlIaMHeg1syUlQicSsZMjeBqY3Hh8a2TQ9\nLbFZzMo+qTaRVXdoVhrzLnko7mCkb2HW3s3hh/dIAm3vo821hxEmf9qyQKQq\nakmALfZYYwhUzAPJP35iLGyalnhGiNsyIDDKH6/ju2HRPCLRWvsq1vkNT4sV\noZP7bs+AkcoXChWMH8Yg8Cfw7SCzmbjCLDahDQUv929dwum5hrGR6Ei6LHfC\n1vS4ZOEEBbeLF2L3BFLkIfhZbJc1F1QYueGdC9zQpeh3Nu5wXSw3yZ91Hf39\nLWD0wwYpTJoSv4gNOEt9WmCqh5JFhdNyqq8QIcoUXr1PxisRluudqmZnWo6i\nZzrk\r\n=oZH/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSOd/VU85cKT+93rJj/8eWcoHA0dG5G+j7rakRUZH6kAIhAMk1G8UJBZWG0Co9JdV5PIgFoPQhTRDQ0IlL3xVjm6Bi"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0_1603420350552_0.57848181838894"},"_hasShrinkwrap":false},"6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0","gitHead":"9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bXuQwaItIzhZf+F5yOke2URlRc6f6y1ms/YEncWltVOuD9LPt9YD2AP75J4LOcG9gpNTWvPm4PYfSZWpK61x+Q==","shasum":"5f98fadc7cb375a59916dae0dba1e75a5fde938e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0.tgz","fileCount":39,"unpackedSize":220285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkr34CRA9TVsSAnZWagAAnwgP/232W+pUSW6EgHqHMKaf\n6e5iXl54WcjVonZr062qHD1C+jC6hB9jVtFuZhwpMjCihbKK/QkPRyzWMzOw\nd1yKVwmXLk1AMWo4bDwAa1c2xKfLT7cERs9mInVetjdNEZOweQqPpazk/hju\nPCZjJeioo7lFeePf9lRQD0nuJH/O4BJzr9ylldxSJrqRV8T7q4kBe+OePAut\no5Wg1LtrDO4kqw0+rBH1jehtXYBSc7vNkkfaT/k1AvDArYcH436WOYJAv/yY\ncmzKEnHBX5PHwDFAo5oz3VqyZfQbakfWQ1GRZwdgspYYpx+yL52aPYJdeR/t\naJGC0ZpXkTJQLHY0pjwK92HS355+9SuCtUiXbo8HFTa79ctKpW28yfr3puFI\nQVk/DD+9sr4cAZjlUmeT2r7ujpGtAYbIIgDkq3qQjYZ2qaG3mHp1n7PwXHys\nWM7DQT7R5n/hptHTc2qXNgRmOWhqcoHazJUlLfYbQIqvXbp6gZ82vWPA44JM\n+bZlKwpS7LOBygEcNZLggpslK7uSjoCkAdWAdMBF7t9OqYc6Jucu9Nc1cZz0\nKQTzRsZUblQ3A0+3EpI86I/9yPG7gZRBrPKn6xpsIuDXFCqNseOyabQcADKV\ntkM3Cy1MNHg1ms2R8zihuXcqKJTZcecD9SvUv1mSQEhOqpJFvR+7FPsp4vJw\nvJOA\r\n=mCoS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPT/wF/FlpMlT/dRsjtWiw5o2GzZcdAVtdsjBDbBiz1QIhAOjHx7wL2VtBWr+Xxx/aoHspKdtKeMDvR+44Tr2HwzbD"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0_1603452407584_0.19612047675110622"},"_hasShrinkwrap":false},"6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0","gitHead":"95ff803a311380b98f78733a116ee208f0ee4cd2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-jt+7yoknXtkoNjc1/B3u8uVtlR7VjbNtIEiMY80S2wrFxnThzoIyp+IODpODmBEF6weJi8QMqxwfwvE7fmMXmw==","shasum":"d9aa7ccef72e0218d856e119b972c78ea2613b8f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfksT0CRA9TVsSAnZWagAACwIP/j1XM7RBMAA3IBV4sxpB\nQunoTuRcghf47LSM9biFtw3pm12hBeLctRmgSqAvMX7Jot5pxySwps+/9QLy\nFlOA8xMxry2D2YEHdWoSDpclWRwim9c0Thpgn1NAnfiUzR2dM68HDInoelaX\n1YDNyl9tNIEKy8+ujtmCug6qZC9L255lX4w0Yj4Njmzgg0/NG4asTEOVTmCy\nswtAo1q6cpXB77IY5/KBY26C7/ZEB0PY8uLPBoES9kn50mrlWFgQv0xONL3D\ndERa55GmcV4mz4OV3SSS02g+lWX4k9/Nf3JXvTk8r21EW9f37synXdp38hvI\n4yc0wQt0gW9wMi7LsO+qe0mIgiqDdHZEqQsDAkXwgN9Ml2zUIlkl0lhkPSvL\njhFI32FQbuJAd3zZnK5pYeVTaTs77TzwiuqpFGevVCdQbAEOFf7WNc/UXFe4\nmy5CoGcmapO9tVzIGEcTQb1+cIX0hCD9H95pkyO4thbKsnmiMoSfFv9zjV3t\n2Y9dfuESoNaMDydANy8rPw2Qx+ENZ8pa57Ee1KrdJttdTG5k/abklCCCHM63\n4TxfilIDk2uBb9i0dO4cW3/KmkM6luM16qzFs/wNu/lO34XZOujLb6R45E3W\n1qTEDrd8WVgqL6kvX+aC+VIEKdlxvCeUzrOOW4A0GvunV0qACRMNhMZAFipk\n9xLD\r\n=it4F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsiXf7i8emN/MzlgolYRjwlaokLjOqtZuLAi1tQ8Ml6AIhAKBWjP7yLnVsh3DsFyIPND/BSOzTBDQWNuDlxwUKs79p"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0_1603454188849_0.7358011452194015"},"_hasShrinkwrap":false},"6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0","gitHead":"e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1SJNMN1gG2MVdPfmua+1z4CEHvu0pZm+OLFRm6YOKkbNYg3WWnROl6RVi3AK8WvXO94afR6bznY++imTbUxkeA==","shasum":"c8d25442b54ee6ce8d51284b5a58cf907ded10e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0.tgz","fileCount":39,"unpackedSize":220822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkwh6CRA9TVsSAnZWagAAgx4P/jTm5j/leOopmNdhPb5D\nFJN69heabpt1bVd7KUgiZJf4LK0qjxKfiX720lCQZH8bRKPP2xR6BtRKsFwJ\nKK093j5xdw2gHB6EcPUaC3JD2eLSBKUoCHuZF7S23hMNIY6cF5qb9QKHtP+W\nwo3MrjTUcYN2/Ui4J44QsZWpWMeI9hxRSdZfUCAKuI8rao8+DTKGCi5cPlY9\ncXkDhJHRhUSqAIzUahwBlbIDGkgMC7jmA42wq8fz9LVUivTWY//8AQ0TxO7X\nDmg+SBuLyv+iOPVb+ucQkKlnwI+WeflwxMMpRYN+0H7vivpmXlJh3axjHN/q\nN/+9BZkViTtXbAfA0KeBT6usbVlPA3VVstnkFnB5DyJeNXFjthBV4QTuRJs4\neSA8yzDJJsZbHG2xNHsdjgO7MMmbAk+JgiSTduk/0myB0yHYr7gH/lzyT7lG\n6GpY/U14CiuULJviSrFwFCaG1WOWwcVo6Ff8ic9cNouAwPnfwDoFG2hb3vja\nrslTpWM/NzP3PcUTLd2uP1m3/66ghjugLqV7eL7PFPSQIpSXIJj4DByFUKM3\n80lkDxSaFpovre7iENLIg/pKC/gdUFfWHYZVpXzQEd7SlUgjlKFzeHiWVfv+\nhUNMTyXjMSbXks1bEDRfXEaweLzTD+XkJHPTiYw9h8zbJ/ZkNbmQIVWHKhW4\nNa0f\r\n=+RHs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZ3jlL/9z4ciCiFtktICnCaYr3ugoaCXk3m830RA1beAiBWL0xZOo0TC9RY58wAonMuUYVcRseMqjdqqHintIQz9w=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0_1603471481721_0.5844301968667824"},"_hasShrinkwrap":false},"6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0","gitHead":"2ac4145bf0906ea0a248d84a9132944ffdc09004","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2pz0TgFkGpHbdWc/Pu4KAiWgjJXDB3q4iwZ122xIehp6Uy6hIn3t2KualX7A8CB22Vx0K7EcPJGrF80OWge1wQ==","shasum":"af22a5ed676a8cf4d45ab0cf25204c30fca09274","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk1xWCRA9TVsSAnZWagAAPyoP/0hkgd0hBcGI0yx7kHwf\nf6pf3RBF4N8jQZOJcuS7k0q8xzwq2MpA0SoH92gUPImP3N9/IEEkhAjE9yoo\niO50NceS64D/yqZV6WCmeQ3ROY6B9zSTsdh9+OZbhs3CANwhPPajmHFRjeox\nXP58T7AvCaignfx/jBM7y1jSiKlQXxIsJLT5ZGBo1YUG23ykk447XBrJE1My\nB+wxbNNCfX/Rwmv41O9kTHa+zV2UFEf4dgHuiid434V/BLtjtM9s9SZaklE8\n6QjOk2QWxDaP5EMInGUYqYCc6Rd2fsFJ6srRmINJHSJUGrswGAhzsgmVfeBt\nY49qrRMFtISxk+PD6XV0jIBDArHUR4KnLUPpfO4Dzzl49GiacY08LMMpBRtW\n0m6s5f+K+OfARgodpZmx8y7KBPqWKnH8mnRyWtrZw0exCWAzmAxgmDY2Iq6Y\nZOkhsniQn9GUadgYauZ/luBjH0Cy/n4fB3+HVgbkjRd0N+wsHMR6QTAUpvca\n0lKAkJXtp78NMmYkFal6/oPa/nxesHab0Qj2eMZoDQboHAT6O3mJFpVLqxK+\nVOWgY26zJPOYrASrWlp4nReS5OHxK1h6sxO72Vbf6zoOeGHqVodq6Qajz621\nMD0YxGRy70Y+qzDhrBGgSw9vzHj6Nu/S/J0rKsfupFzA864PDC2KLeL5Huf3\nhtD2\r\n=TeEe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzbyN0qqVLPtqlRXKQuu+lKzINaJ6ziPU47Mbqm1Y1iAiBDVGMH4c/xnclpHuY+VrCyjI1rOgs7Ey4cZPWuquY8LQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0_1603492950038_0.9349521157958443"},"_hasShrinkwrap":false},"6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.0","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0","gitHead":"a72c5a42f1ed3dd416c84fa53920bfcac512d455","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Cf2U1b5X169D8eSQvElHPtopitemjP0h2SotStj0IPyAogzUJJR0qkEShVJSWgJDiLhspZsKpFIFHutDJb1LFw==","shasum":"283658642b0c5660645e68134662bbf534f21cea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk1yQCRA9TVsSAnZWagAAoRIP/A81jKfu8Mnaxv8vBRCz\nnafur+KbQebda5eXdSSHsZywmvfGVUYgEtQy5rvmeOEq8++0VooPmQRUxyC5\njxsTUCuYfCGwhbcy8oEyx7SaM/A9veuelObYWi/D/s3zmiqpC0zGzhT8eJKW\nqUvVv/GBD5uLZ8ErIqcklNha6C60uwKrYBj6wmCHhntHdZX+rUlqJT9FkQqV\niA0EqY13YlW8K0bJGyZGLIyiY61llnkEcPYI06zWqbNAmyev7VobmsUYBZ6v\nvKcbLiX1nDaKx7y/YAF816p4c1WBNXKxECVS5NOgSYtSQ+6TXznCXHY4RsMV\nM1c0aYEv1lF+A8nHu86jy5PRjm2HKCHHmKt2f8shczmpeBn9+GNy/SE7u0bt\nvTXgQDaMi1gFfM4o2lqYepZGyI5Hl/CCoqRlS+i1YouVBiQ6bwnG16J0yTTl\nnPXwokFgnMlKH522s2NClbLL3ILYy7T/ohMHSP/f34cpBX6WtNVdwkwdS22A\nZHSGFsS5z+zovCay0iimWd4LQtB5OiRDrNMG5KJmUTZhW+eZSF64AdxMUqOM\nTH7MNRgzNyDPPRwSArq5lzZh3hwSdu+3Xh/g7WB+16F+IQDqf/dzEp/YnHMf\na1TxBLIMWseKdFCkJBDj+gMhKOWhZxjjLvRqM4Lwxo6oEe7ILCqnntw3Ms8p\nL2e3\r\n=NRbk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxekdTs3AMaK0W+0VcNzmRQ/fD7lsvzn32yCY3BQUkLAIhAKn5SeCkCLk8tVXU8Ka4RKIHVKilN2kPryrENIMgQq1J"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0_1603493007903_0.635098754057984"},"_hasShrinkwrap":false},"6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.1","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6fccb7434a4c900842c2d473e7595aba262dc164","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-t8gzrEaUl5ewgGg7oT7RXMUvowohmlgZXQdYVkmm9Dwu9hbw+Wc/QdXSO5I/+Sdhh69EQs84cywPZxndJ+sIFw==","shasum":"d22b9a9553a01c6d623df311ed5221a4016a84d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk1ykCRA9TVsSAnZWagAAr1sQAIfUezmDpG3p1aHVwfHj\ntv2+iV1ySDLq9bCAtFJ+R1WWSSPeiWjw4x9d2g7ELJR+Kj2zlY98aR5fEuzh\nekhnejFI4cRj3CCr+YUGnNPZKggggevJ2bb8SzqMRhESxyjUFGEScUeSn1Pq\nae/gIl2TqBzhCsD4d3l95VYvM2ibo6fSQJ9NdkCl/7ohA7XbRBB5vYC+JY56\nTkcAp4mII7K9dVreCYOVNyCnjJsWSvdra80u2XWRWm5Sybn2Jx5KY43eXbCl\nr5V3ujJewH6TphNQ6/DI1tKEF2VJS+Ey7p8VF/jpPbCk6cd6LXJTN+L3o8Q2\n64MHJNpkh5cq2nGBSt/JWQ6f7ZryDqpCgUykEelVhXhUAXQRIJV9S2TeBSGI\n0D1PJR2IjJE+xSxyRiozOYTnvw14VIekyfozJh5YGTv4i+ptqGiHQlzCOUOX\nllh23rJC4Njfh0iUKwzPE3dhweAKwVx4GIoZy4Tyc8aDGlSy37Unzdo9e8Zg\nAumN/NGzqmh1yPOVZFLmJZD8cX+c/CSxpEJpP9byeQW6xuFbUpGML7JaVVTX\nzoIDseu/voSfjPZZD4oQtLRqoEkbgSoRKnRFDy1G4XnQQ2jpReSF7JrmFdGj\n1vp4ZqjDjoD8E939mdJBfsguE/7SGUAdUMp1NymvPQPeDuDxYPaoe0PSq5Vj\nlhxx\r\n=1290\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiOuLxt0kZ1oP3pOBn21N7EPMBdd8qD87CVmJMazRJ7AIgCzGZ/4hW0uY4YqnkdUxdCo1LjDo3wT9PJVxvjRD1IP8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0_1603493027418_0.26870803880923555"},"_hasShrinkwrap":false},"6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9d4f1302cbb38159900c40d6bb9f5e2a8c16f218","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2QvEXRXfjXzvr7MtTVLPaTO4e2bgnEsHLnhoAbKvd9DJu5S9+QKX2dbOUL6G0YEfIjCibkTZQF4DlQW4kxhnJA==","shasum":"2c68d7a4ddf20864446fe538b565241bf06a722b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk1zWCRA9TVsSAnZWagAA/icP/3tVt9LY8T50Pm62icnI\nkf7nM69cjewACQ5ZtvjD8lS9dw3+f56bDh6fe8/87SLy1/SXxABI4qVPMQqh\nR/vxGBhB7Y/VDfAhWzPQmfYv3ntIf5Slvdl+FvS8DgiDGIzGG0VYZ9SzHWrs\ng8ZH7/dzUeoAhJ77m+4bchAisXYBWA7N1jU3liy/4oyYOfOP1GYwEgoLhNrO\nU3DClN6wvW4fKFc4VCjphjXY/efnaTamRhbPCmiFNyCmlcfMMdm7jzq7sCPA\nlMqzmKe1nDJR/CUNg4dDMRY4yD+SojC0Sve2aU1CxtwswF2E4bbvYBNpmORs\n+a26QnKUIIYjXEzc24d0d0GAmS+q2R1TxZCAvLCiHRB6ldYHXsV4XSElJdv4\nsd5Gtk/MqTbyVrYKU5CVu+hvK4iwzOHA3o70a0yqqjN7NlCUTPif7HBOwdWA\n6aLfrriidAO6bXE5Mst+6WzmVQchUuI9hI+sJZkKwxUnKfAe/qXQLHPMQ426\nTEXuOIYHSL/CBthLqlMJlqqFD+pzXgDHJW2QUdPohADxNwEWSMjLrCmV6eBa\ncZovhuRCRtdFTHSjsFJFC/43zt0Gh0gt8gNBHxyERCjYMHuPh92WiS7K+jRl\nd8Eo1dHiQzHEW1x8bmC1IAhA5sEWVm/YXe71+EfHB6Q8o/S8ekU/jDKQhrqe\nAFsM\r\n=V+HH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxufRqTzA121eYiDIczhn3BL79pMzMUr4dNcktkHeTAAiB+HlaknTTmjWa+/gM6tG/67W9oNafmNS8ApkYxxtY77A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0_1603493077627_0.906807892568918"},"_hasShrinkwrap":false},"6.2.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2","gitHead":"8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-hAX53IJqcoKlNTZS+OmrFYeq+CjnghqrfrZTPoajve9w3Lxqwm/fcZi9k8BTTeXD52ualNqpxUmrPGoPIYZqiQ==","shasum":"3ca3163dcb447d428f4c5e98c928ac6177175f8a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2.tgz","fileCount":39,"unpackedSize":220674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk1zrCRA9TVsSAnZWagAAJLMP/1mf+fGjgMB995c0AH9F\nBvxM5NblE4nAGS1CUcKPMLB0rH/oSKNck0NKvIxizZQ8d3WTMXjqNhVR4Iyh\nolCWVBbArwa5eR0X5pIs5R4JJDKYILwHisB+ru1bnURfUBX94ppaiCNcezQU\nXZAnF6VrCHkr30HDq/EDsvyzpFJbeD6t7wre9Hwa0EsZtK+fZTp0r5gTeOdO\nR092v8fBwK9E+y5o/AIHIdUQ0FaPBRLIM4Lo9wjsXdgw51r3qmOf9uiCMHne\nTMkf80LJakKC9kAXuqh92G+UoXo06Tg/fHufns8waBY4R/zP1xxvfCtES9vO\nF2i8xyixEn+Od8xvV8m/W/J+6mh3ts977nB+MXsXZU4toqi2Kyxfy5vXHmi5\nYglMSKdAjrY7jcdjIKyVKT9uHK0/fDJJB5rH9TuFjIG0VaoTuBjr3SEECFaF\nZBDl995euTWPDYjJ482ozy7uK3KlL/J3jj8RhwUd4DId4qEpbxkUtnh0iFWS\nKP/Y0a5abT/j9QL1MQOe0NHZ3p3TQ9SZTOUE8WOMv8eUTrWPKtuZ1rjykrFP\nPhb0aIWml2bwIUDF1mzFzcqC+iqAzyz4yuVhGqBH+S54IetJRkOJsftXV0KC\n/fhgaPQV5zh5l/eohoZBbvwoVHmArErDG0jInEDr65yHEc98iV0JPB5uebKI\nHVJd\r\n=ucy+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFb1ZbUJ/0KEkDm4wMc5wWkdEzvVxeRj1JoLKk8G5SwAIhANLFDthqHnp9l9BMNWvpW2ZCuMoukVxFZk48z3VVdNff"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2_1603493099178_0.05841114131640368"},"_hasShrinkwrap":false},"6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0","gitHead":"cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sFKxlitFlyZ+T+TG4pkAI6v3YIRTXGaEtyMF39X2mXhu4g14SB/SvXxJVbc80jjQiESsWugvIpFkAiwa53O07w==","shasum":"bdbcccb3dceb4270e1e4848ba652acadc93f651d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0.tgz","fileCount":39,"unpackedSize":220282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk10ACRA9TVsSAnZWagAAtFAP/j8TcQfTvLnzRIEmkWhV\nVXfl9nEMNhwRUwGLza4M/iKNI/pOOmumWweB6+MdyuxO8oHx5Ay/ElD/w4e5\nbfQ5y+9j6oMv64n51FKcOOSitpD9TLFkbOhOFSR+luijh4qPmlfqwnrjf9fI\n4gjeH4kNKdwmlKN/NWBsu/yAZlrWrLwlJH322tm6g/exzGdbGFXJLR1a/KOi\nuHFGki4Z4Sr6yLD1pvTr3wm4uU5c1DsBTebJh/1qynH2jC36QJpp3gT0flez\nsj8OVKfw2bXCRj1pqiIXrcriJ20o3xrdHDu8oUX9nguTSCrUfcw678z73/M2\noJux9eYjmKGkKoiqYe8gdExI1fhe2f0+f9OxhmbrPh30q2/3CdYCBH6Tb5Ye\nCq9KN6fASfXdBNygFIgY8qHxcq9XkyncOgKNAUp3eYtpkBVw1w7MpDTjE7vg\n2PXwWm5J8CgIjTqNRpVlpweqX9Bv8nqQ1o0skqZzAwLJ+8QeDL1s5971ZLsA\nSLVrdoRu57bMyTp4vAduNIuTbxgHPR6mFa7mA69e09PPkyjuUcHLceIcrwcc\nbIOP4g9uxWtwISKR86bUb0HMrGBUVl6lfjUIhWbYimpYEbVgMVo2/PcaEJfV\nLoX66UJGID1xmsKDnaXrVjPcMuTN28zwuP4N3awG7oHKXY6ehk4S7WfTjVM6\n93Xa\r\n=9IrZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBMhxVeR8aOEh1hhKcxLyRKVxM7zZ+UK1f3jdtmP9eEAiBUYYe65ZwbLNpeN6BUsFHmTuDZhXNqVu61l3/mtACp+A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0_1603493119691_0.7065081119301231"},"_hasShrinkwrap":false},"6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-H2xiVjPNKRqev89tniOGl7CpRR70k0sMSGubOc3wAbB5zyR0YFASrfFjnkM+hSgUAAwuOuXSImkAh7YP56JjKQ==","shasum":"16d569bb599fd57fa1fea42ed7821a3ff1f8a5ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk10JCRA9TVsSAnZWagAAHmMP/jBBY4aYpdxY2TLLpRpv\nkdh3Tkhvpq9oZSYDaQtW8mxqENl8lnYtM45T7pzDVqFgv9a4Lb2/Tsu/hbuH\nFOzXngl3E5plJgpLAJeSjkRS/YsB+La59D1P3i8m3mb7+1W4AjOwkTrOflXm\nKB9wVxIfmvmvxNBa3P0p/bxHrzaTJ2wgpRF4myJbqLcwL/fXFCAUOLhIESuI\nQYynneMxTO2pyxExJycgZrgUnaqt+TksVkliAJTsoxj4HVDiMS1ryrXST5BI\nu98clu1A2SOcgYA32dXcRt8jd4RaUjVJQ9k1GWQVPHu4ROXnLWACRkHGOr8e\nY4yZ4OEf4CHSRyeeenEpStuOz1C1kC3wtZ5Duij7QjddvHY62qr4XTWLKBNE\nrZvQbb+GM9uYYZff9m9Cl1NegFu8b6fris7pVj7/GjEhUoTgrUUbGPcJ08Wz\nTapAUOd3RRUMeuoM4F+C5Mm50I0gA3qJFQOMK27ZebPUYJN6kuT5D+pqvSIB\nCgPhQWljYDUTcyillVGjEQJ+AnP6e9kJ2pY5IZaw/miKFRWOzVL+JYvyI4i7\ncIlmF/2BFl95T9eFFixthkKLIKGtE8y6gi/w7UQNIZHOcFcsIawmU+KXZ5BY\nPBK2VJDsQurdM9OOO30x8aEH5h7Fasgd7LvavaXe7gN/lPZ5ea2kxmN/99rm\np0kF\r\n=vCkt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6LrVEzGG4bvHfz88F/24gSYP8sb6dNgXh4X+4MgagYAiEAqPs3nt+LN1fMbf873X0JNa7UFJ8ZlGqTQtDvVoCvZtc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0_1603493129226_0.03212555594339794"},"_hasShrinkwrap":false},"6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0","gitHead":"c6637dfa94af293ceb000e1b0d655da2a0ec8ea8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KJqctxMKG5XtpK7A9KNNzD23/jKNYspAhFwwH6F/NvIiODX1pfxZm0qfO5r3pPCKVZ8UEqnACcSWxFI59G7oFw==","shasum":"17c11b0fba98de862734023eacf3fe0b086bfe6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk10aCRA9TVsSAnZWagAAJuIP/jzy+AOr+8gfjbDmDD2N\nDPdWaxiPdqCyup5F5zNAQIW0x8v5CsAHO9E0eCxc8Dc0yZ7uMrC4f2vg3cKn\nXMcEGt+Vk6zDlPaVOWtGfyMxSqPSEBwopjq7dw697pwGLHXFtxWjsRqqEzXR\n1v08MtVTAoZmKhHFYop1W6z7jUBDrjpN8eBp+yfiX5hHtgTA+RQ0n8hNMy/t\nP2Y4SUgJ8RTKC1sx0IgZEbnFpcFjx4a+RYKEimOr8fbStPoJXv7FIt/w/nHm\nTr5BuDRm20i1t/tflh8O3c/VYQeWbTUc3NVuZi/ttvlQjD3j/K2qsqOCvHl8\nmE6x7UiYNl8z+fwRwkmaWuvAZZDwyelTKKJ2JBY6ZAdTtsnSQrYscRN3Afdl\npDy0BcvdGOiU3uFSfcA4lCv0tYCIFyEUduuNDaN6KYFhggeiAZtUgj45WMQh\n+8ovlXbz3aZbAs0MBRiHkas6oxyqs6LWsGo8kpm+srnyXEJSI8k4NzFctghH\ncMvsLCl0YC85+LMLVFBq556NSFVnY3Eyv0Ci3n/mBxY492KMZiwID7JJxiFd\nkqFRxy4jZW6slY8e1gjuA6jfUFCzVHkPzgJr06iakUn2IIga+Q1YClvw1C//\nQ7Bi0KPRb78JkFojTC2uHw1OkPJsQLqZM28zQyBJ8+CYOe3awKr4G86CS/D/\n6AoX\r\n=YSng\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+Wm1vZIxWi21b2nMsvduIVyKSAeMMadkO7PVSUlu/EAIhAPo5831/tlmKnT9Qazu3n1sdF8kuDOVLfaYBX4njlg/2"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0_1603493146314_0.5565333815029851"},"_hasShrinkwrap":false},"6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0","gitHead":"fc5ffe19e72abf86ad598b263afbce7f48659a21","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-moNHlkvo5D3zECtmjytc9DJIj01hiOaHVhGPwCNY33hTBKXFeF1Zotd6IYqdUt4kSSdHKMDT/LU+Ru0Z27YavQ==","shasum":"235a5134e97ad906c1e13e46a68c6fde0f523250","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk100CRA9TVsSAnZWagAAxmoQAImctQLNgTbE6OoFV1TT\nTdAYVImQdo+XZ/y3k5SEzvZtTy4XDDK6pdS2XUZaW796OvP4Rkzf2tb1ufmU\nvjigVPdyI5r0jCbQDa60CTm7PtiV/kVLsml4ZkOXKPxaf4Fm82CEZ2mr7UXd\nIoWXtRmUNMKsQZexVq/9qHpchH7oGxGqsrfhkXonenIcTWZKQ7tA+lhmKGNq\ndzQnbRPG8GLRTocR63KMKl7+loNb41VRVZjA2kuy1mKcRzE5v6QP/51HMVqE\n4JnkRq/Ne68dbiK9gr6I2aZehFnRbU+CuMqw5NB6KerKEWn6lVkUME6gueRE\njEQA5wSz4pFmR3W43TrrUkXufUf7EksroUX4hNGi7bNuXB7sF5mIwVH38jL0\n+EwVfW4SHSvn5A40Pa/rcMtAX4UHpxc4YJDfKJWUfHNeDRdspyOp4CBhnlO0\nv4/KAbR0KoHT2pc62VJPPiTVJT/4tPzCoB79VDJQx59D0qVpPwkOGep0u9Fu\nAght79FRZq/snjcQUoU7BPG6WhrSPQn4QBr1c8nc0IAGwhNpF5P1kci+xPOO\njInE9wI28Ka9uhn+hLjxKDVpD9GaknfKykU7S14cmfbTcfrJGEO/zT9QghOI\nE3mgneCO+YRA4TGTWmONXZJSNgibOyhGAYnp3DCQoRrRm9KBewgoVXSumLjL\ncO3t\r\n=AuCd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBkRQxj1FICIVNXcKwkB4yUMWkr2PL+YNTNIMtwlz4dtAiEAid5JGmcB/fH3pTC7FyA9JMberOqJ8okhKTjac2YpdD8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0_1603493172084_0.3867247678909762"},"_hasShrinkwrap":false},"6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0","gitHead":"4e85e6bab8ab80167be16e62fcf2d6c15c4af51f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FLqWZvbLQ+wn3vqTYOjOmXlU92ecB1O77syL61xgiZEYCGoo4LyUu+mjQlvSRJYefUjIemdm4KD/UEzh+vbE0Q==","shasum":"bd843d9b7c5d14dfed9cf75a7cad1efb87f5e3bc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflGv0CRA9TVsSAnZWagAAekIQAJMepZ7Xf0WBa7Y5Mv1N\nXNnlS8tgs/L/1mUeqbYlt07114z0xE74sO2hOxwcc7oG3DMkXiGYox29h9v7\n3O7SxE0FcoD+tjKcOky+hk2CPdo/dtMbOyREUuSgaq0WgA96I6uKtiWrDXf9\nnakzI4KHL7U43ZJh+si8LMN+vuF83dBygcMC0gypmgR7fyOAAl7WSKrkAu0R\n5gsdoWDf8SrLnSDWYKI57pjGSnCJYyUWtsRq9jMTxFK/WTK9qsMDF8YYhLT1\nxDFEtKD3ClkrPcHzV71TpGgbd9hYk11BogYzgzNLoX99qHFH1CLYJz5BdhXM\n8rjCrBNqio3teDgxcoEYYbwxyiy5wDEfbRRPGYw94Zcgbx1eqjX9QK/NKcJE\nfQUO1tqkXaGSy4oaG/QThNgi3lxFkVrY+yV4NKtcaBEqxAXuygl1A2Rta9J6\npIfHEZfKyjBETppCClFY0P+DXBCXLL4TFeMgpHiYWYxF760/Oh22O5Vq9xFB\n3UURS5RLUnf2V41AaqAI5z17oBXRX8l+Fdx6S601gwUJahmj3MNkyAjez9vl\nhaMaX93+tt4M4ddf5wNCKjAt9qEzILa48y5ksM4UVZl8TdPR1Hy42YXGjKcp\n3IHrcD4br9TCI5vYE+7HlqIjb5XD2UKEbTxQEVX6X/1vPBS6hGbETCkJflhm\nDa67\r\n=iJRA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaFsgd7Vp1EAcTsk2tEexrXt3rs6LtDtDMDTRFXv/PjgIgFmzsspKxugemtUyNTjQKtVquCkekgHkMNHPslqgZ8Xc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0_1603562483873_0.7034664129257489"},"_hasShrinkwrap":false},"6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.2","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0","gitHead":"fa363fbce301c06fadb968576e758a469775cf7c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+iLM+AirSgfHlTVlck1smOWZPHRuhKWG4r/glB+1i8ayNddQ+JcdmW5p9T3MPpCsjprx3F5y3RuEpHC8l8es5g==","shasum":"457f7d28360ee267a5e61676ba08a53867ba77c7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0.tgz","fileCount":39,"unpackedSize":220720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflHb5CRA9TVsSAnZWagAAtJQP/jWv/UBu3Rdins1G9ARn\nfACuE6gL4BdT0iXKtVOA0eloK8NgvNOzS5ePmyoO7wDQ6bNiP+tmWWBhcmYn\nvQaPhJm48ira9/qTxZUlTigG+2c8EYeZtxBsOAyKPpc3jTSy+Ob1TcG+F+C8\nQr+rphH5YAJgYhWsP1hX9NOmR+vYXC10x0L2WQSZb99kTUg7UNiNIBuOYxc+\nvBTn0wAhrYCU1kqo3HTs9zF3hLmrG17y/R4218q1vnh4rNIA+qzaCrgmxLrB\nhqC1iXL/hCj2/+TQ0w4yLtV8ED3pnx/lwt8jyRUhvehze/Y9lvMEP8infp2t\nYnxmYv0SxHVoDAQm6Ar3PkA9p6XA2zrv1F4xKYlmD0DJe4ylU8DUfDH0jfWe\nRy05cpTt7xWw1PKv0GwsuEmNLt0jvobE6zBoNVaBVkXPzJaP6GnTVGacl4Oh\nEbPRD4B6bZD5MR4gdJ/7nP+0JKyfU927fVcip156x2LGOztfpqPcb3W1IvO3\nyXEvjjzkcgkYuDw0O02R0dujB4TnDDGn79oJGZb0F8+L214EUWUQRuJh4yf3\nDBL9Sb1L4G+s/YKkLi2cEbp6vVIKRZnwz9TdRgUBWj6uXJWFx3OE/yqVXQaa\nrJi4ctq81B6+j1bLxzhpu+t9PdUKEUic6pVmnxu1BMLtBJ0m1Ka7j5NGHFJU\nykhx\r\n=hdG8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU8N38SxePtwnEPzJ6kwe4ExC8sna51gSJ6eOprmmnYQIgOl4Lq+W9wPaVStjUv1WnM1Y9Bc0OC8+ei+R+bLNGyNI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0_1603565305032_0.810880054776457"},"_hasShrinkwrap":false},"6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0","gitHead":"ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-sXnwqkFFUCUIhKgCMuFutoYYs9Y7w7DBXW2PYuiiUZeMYJdUMgJHhgfiswwEGy1tDLiVVxKMw5tJD555uQJNqQ==","shasum":"45c304a74e8682ee17c8ca21b88b959d85456c10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllLrCRA9TVsSAnZWagAArcEP+wUmy3X14b3Doa6DiX84\nYjtxqYL6eHHaqoklY+sPdbjJV0lVkBBP/7VH3NPSWYkhjYXg5H+MvF9qL5ZG\n38ZA+ZALPD6FyRuGuFta9YdFfmhe/Znolp6bNMGIkryGbRhaeCJGTtirtaLg\np9pZu6ukYV5GpE/wGo5FB/ctWhN6GQ5lktYDiF6TEQ64/Q85B9zF/P9roJyk\n0doljinndu/24DR/7ZYeYEtIkiZPAnxFKzfWidXAs1sZ8WofiXUpBGg9f7ez\nSfj20QraJ5kJ/jzMBRnImEroZiKD/L0TtE6Siw2VC2x1mWN6DPvGW+0/7B5S\nkdMc7b+9vJ1Umfa/bH93LHWoDFLKqm5bw9csZ2k3oT6oqECwDUZs3/uN0Q+s\neexzLwK+HYFJdY6jD4wLhkOgFKoBCugAZ1tcJ/bDHGv6eUNvqqaJTKJiZv9q\nal/bSP3lImOi7TZPCQtXG0vz7sgUWMI5iRWrILGQMrCwfQf+eVzWv+KRk+W8\n5f8zY58hJAT8EOeooSFBGAuEr5S7W40ujzu5DU3hqpN0GXlh0epwdDYfrKHi\nNDfTOU5WP0vQCGm6vheaOfSByIooq8SG2EDcPH26aCqqTyKklsW7C9WD5zsA\nnlRuBpUU2MEHUS9nfaQjRCaWiJuAkjuWS5CLXoes6VDXbPIIQ/lzBRgN+bgz\nx6dT\r\n=YI00\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5by1ThRSbvyijjowKN+HnsppJrDcpr7UKJNymy/g/ugIhAPIAubIO2fYr9S3eJMvRXKtOvi7e/3GwAOulHHzjTv7w"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0_1603687146533_0.8446642153320574"},"_hasShrinkwrap":false},"6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f1244fa21eb781ce047277fb42bbc2370ee6aef4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eaR06OGtMxQHrw4lPrmpZZSXOndKlYt2q2LxAU2qiTKT54h3GWIp4JW6VDFccbJt9GB8OOwL94dRFaLtXaiFZw==","shasum":"c7290358c8673a85aa85d280ce448967883597fb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0.tgz","fileCount":39,"unpackedSize":220717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllMsCRA9TVsSAnZWagAAdwwP/1isoApDG1eS+CrWgZpQ\nktClukXTLRrZIxgaJwQYCriqO9umyQ2pXHp7PiJLo2JjJCZSHgGk6WBgkhBO\nLzXwg2szgzUPQFHm5aI3zRibXgGIONjnlU0Ve74z0qdugo42vI8QQyFdQnIP\nPMVljALXB9InO1rTo2GqM+Gnk8brKmiiAAH6xGzcj62UL/0S6B0K9rvGsN/D\nhxYAMiGOmCYkmZzBEjGs06QY9hOaYPbalom6SjQVJewChZ7ZhujJM0vN5C7K\nWV0gSd3cqaq//MKCrx2Eeiir1Jj+JnicV4vnDRXh4yhdCayBwEXM7vDYD0dZ\n1mbwqY7vSBk+J6ej/q6HbMA5HFPUePoD/acIj+mY5p3OIWvI658Xd5KhinFD\nYeEVOGZjVSNFB25Rvd/Cf/s6iNhn9PsNw6c20u1J74Sc7vT47WPdZnHW7eoT\n8XGbGjdkA/hY4oH71cH2+INkMU54SL6+pcsq/JhcwnYzd7K1dEqOWXTMGqTc\nhzj3cuqP5Stt15QaUM/2yivXqQqhpKfwD8LbAXsmNN9DqGhcMUQ6JoiloRwW\nsrDKeuC8nnDcNRFQQjONaSxmWeVRxgmwm8I4xzFu7MlGKu37is+y7qh3Rq8H\nAiQ4rmyCgsvKrf1ult7xKzzdkPhFi5huLykj+hJKNTgkaIemC39NGvAOj/LL\nxMh5\r\n=7OwU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbs7bv37r47UfDZDP37uj0sPHtFzyCAlUYQVGv87CkWAIhAPq91yA9pGzkbBJDv6NUThtTM8bF9U+Ma8/irWWbMV5O"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0_1603687212111_0.6426734750770184"},"_hasShrinkwrap":false},"6.2.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.3","gitHead":"1fb7613757e238e7b37105911a2c0548370b8a2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.3","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-crNb8aDCziQMX8izde6PXpeL9x4k4pLyX7NzHVy9ltr5qJgNS74f6LlmmuadGqWHMC7mkavUstWYBWz4+6+VnA==","shasum":"b15f0e5395e85930c6e7bdf60256cf6ea0ab6343","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.3.tgz","fileCount":39,"unpackedSize":220955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllM/CRA9TVsSAnZWagAA6aYP/iqFtu/rw8KRhmqbBA7S\nqp013/kfnmyZQJuB0DFOKag09278wLl1Pt8h7hctnnJ4kvFGbMl3+Lxx1L9y\n0yQ79sZ446DF+xgUa/9TxHX8YPVNVkqix4cURrQC6XiOO37dtwoDPS/ulS66\nQhmlZ48m0nISw91BfUkLPWA1yZfzKwCY54Z85fLG+Wcrkq4bRBqL9juRfDbO\nzt+939pxASso+QtMAdFSq9gJibL6vgH9xaxxtp8eYiGkmAIAZEOtgYWFtfwi\nsaO6OGkPNn/UiE/g6QPRJA81TSpsbWj0V+NTTaEpWqXUkEZHluxDRH3LUZYb\na6P2pwH35fIaqpsFswiEynnJMVt297y6pDKHtDsbtJ2FiqIXk9V40MI6Eus7\nlrHeaHtjAm0VWVgJwGL4DZ21byGcwcqHN+bl0BSO2RPRhliVkNlUi/MRmqti\nDmDpolq9fLoRhfF7nzocaQ03Qe1YNQq+7r4CGxItdmoaxD7LBusEyRrru/cP\nsAci8j2oA7hiNLurXxe59/KGfDLqEroV7Esv6RI9BBd4PXrMjEmAP63mc36J\nmz3x16CyW2t4AdNbhOoFPUG8Hy1w9bagEF/ztKq6f/kZQilOF6TfCy1wo7cK\n4HaiW6j/vsw6N8zZq1p6Nr9xFk4gsr4slEeXjyHaBzZaDZn4HZhGuPjBTjxp\n8sNF\r\n=hE5S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+diZKefnFkXffoqUUv0eZz9ncbmMd0+ahPbYzkC5QPAiB2UBZmDTuOfzmV/o+exrNHpSl6Np14FnV8IUkZqVA0zg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.3_1603687231199_0.17124328496548724"},"_hasShrinkwrap":false},"6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1fb7613757e238e7b37105911a2c0548370b8a2b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-uLqsWD4LowgptO3HFUEctMblIje5opeBWZZn2n1zNX4AuOyBcp0IsL8ub8v33Ve8Dzz4nxQK3aX6CYUqTXXuBg==","shasum":"0028d8f806d56d5514d1093b3de94140fbf38aa4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllNkCRA9TVsSAnZWagAAKvkP/1SKHGd8eqql49glhCRW\n8ylXzPhWUG/c/+fpaheIJsXwdKEOO23QGSqCtBdtFVDUVlwvfv9DZRFViUuF\nG2YNuWyNL1bmNiKu9y9si6sGsehlx3lc0CRtp9Lv/rRXViy8VkIdRJBj2hYa\nll05sKSpMCChqBXjzduBf3vs23Q9be/esbMPmEw2rg6D/r+QzZtuIh/8q0It\n40vErlEjVnVxpWNk3iqiN1vq5hqCMuOtUPBO4C4fpkhiuBzias0bBvcwboFc\nOYJEYS2pvyo+nbjt+MQkSp8JviuDR6VwplnM7ltA6CujzNvUVlSXhzGWouNg\nro9HE3OFXubBEeDevYCi1UbeIuHmvzoCt1CWuzbmUHnE4N78ThtLKjUSSm4T\n7Kv5QN5kaqhHRcZK0cwfYNkGbPsViKqCCUaxxMdLLHzSmoGraHhIkXn8dIOx\nD0xjTediq1tvU2LZN3UzFieGbvJ9ArRuxkgt4O2KS7Ya3G+/jks7ARxlRoGt\niR9hcD3+M+lQF7ZCBQg6zzK74EI11bWF7a8K/dC/eTdepC5GAy7MeUVRLt7j\n3ljwV4M23RG4taCHtvGQV6f7By/1ypvrKQc8ETTT2PSps2F0H1coMGi50RYP\n7U8e02yd6KbsZXS/KNIZZqlh4B7y1Ekr3z4eTiigMf6siEPc6zoi2KoUW1kp\nwwcq\r\n=PY53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHI1IuRZUmtdtIXYNp5veZ57b8fjo9+qxWa9t4cYIffNAiAkdI2VnHGxi9ArMLzhEsG+btTxtLQp80tsdDKk5Kun3g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0_1603687268314_0.5415174127898705"},"_hasShrinkwrap":false},"6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0","gitHead":"64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-0k2HeadiOrYSv7Dcv3fXAf+pS1mA1qVvRL6JqnVQPMBGIquFN8vmcNZMSSZ3BpZaXZzv1JyoYmKd0tD2a8xl6A==","shasum":"c906823698b615532f6339ca8246a52e054f8794","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllOBCRA9TVsSAnZWagAAilQP+QHd+gvBP9TqU3OFt2RP\nchnN54/M47NontBr14GSNowgfdyQeeJ/zjOIezmks1WxbPDNBQZcVCpVx3mK\nSKAN+f+lyiMu9fsMzzcfwD2zl80rn7kdM8WJXAN619EYmivX0ctm+sBsOAmA\nx+4KBoxE2xiLKVGOUEpKEUY5gjUjguwDBTFFPeXoG1BDFBEFO81C2qI/LTOn\n06ei6gFdLso6KWD0vHyJeDqTFsBZpglpHE5Ifxn9XxMeeBJjpDZlDgd0N5aV\n2PCNx+2MqkNsraeUAJnUSfK0i2QDZGQmdPhlWeUXjFzSBMJ6NnZSQ5BOxyIi\nE8DbESrkkad3B5nHmDoUUiv5QMJpg+E33Un7N0rfsdcZ9byWw8yvgEU5z42z\nxy2d0F4br02MDaXLSx2RWhCYi+9h9hu7nEOB1uxXJBOD03o/6TsJA33jigNp\nZ1KQ/kFui8zvdyKHfEgz/roWJMQ68BQtflXQwY+TvtQR0iX7Uqy/g0xsucbv\nSS9yyLOruukar2rWLT/ey6347Mxy6o2MPVQmrunQphJ7V2MZ2FfxoUQBZ5iR\nNoD5CVnIIUVWl7dTTk8DqqWN1FKpd36IrRNMMvsKLvXmfKkBOr6OobC/Rpi3\njs2qefVrGLP9+OlmNPrF2XUgqLGQCxHyYjOe96vhYcEALBacU3B30CfWzKig\nbs+M\r\n=e8H0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcxvkljzcOzKnO7UGad/yWSK8keCQtyYrOMekRepgoZAiEAnqtA3IABJxqAY3oGLgWX91YBeerP3abduY7j7gjNQRc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0_1603687295324_0.384716783261986"},"_hasShrinkwrap":false},"6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0","gitHead":"69de05136f039e331cacd185f5807f60b29ef1ff","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-X9ioLOWOTE1t4fMZyGYAbc0++fzE8Y1wUmYs48U9as2k5wPsVb8LvTmT5vsr6r6XuayqB8r40A4PGXjnNg5UkQ==","shasum":"598a8ef897c98dc7b0763742884588b43dd1b181","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllOSCRA9TVsSAnZWagAAHbAQAIUV/MFxWRws0u8sa7Wt\nNaCjGQQBXGK2rb1Yj/1OuHP3kVJFPSBEdrHvXMrmRlBJmpXKr5c048mrnGP4\nTO/hnwL9QE+RCtn4QbJ8VQ6vrA4ujF+a++bhEV09WeQFA0LCEcBQFbZ2Mnct\nHh+MkSqxgnESgHr+sqE+ncKFeU70BIttFEb3dEeKEA+CfYFrG8g9Pb6ATFKB\n7OORQi2i0vK3Ky+Mpe8jLJKJOsCiThqBfLTkKNuMLsdSlbcw3cjCCiB7tiWM\ngYYpRa1pLOdHazZMECHr3eEv/GeIDhL494rlH0Cpb4s48XYvyMLOXe9j3X4i\nHB6BtRqVhmLN7e8YMpYvYW4YFK0VMzc/bd7E1eE0zSdBctDfX15QwAs1C5Kp\nRdcom6zdiD1xH94g7U6i9ASmqW2BR1pJbQu+NFW2HzEkDudwKQJNKQgj8j6j\nI5kKgJ4T/NnDmQf8nhVrXDrXGzrTDJiu/S9jxk1cmxQaR2h6MlqDGNqb/wHH\nuEd+S7NopXpE84tTPkBmka+wzdXN4tvUOoPZOL1qrpXmnITbQLhCw297CWfV\nLmE9v0Uhz2ea7ts98pQc7oU3zVW8d3bS1vNwyvIUj5TG+sKKj6Xc1Z85BKC/\nZd8NhhjnHr/bKorKSJE5xCaNnXZa+5+kNZg26oNZLWm4t9OUhTvLN7N/MhHj\nOG/k\r\n=yYjG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEsoePuPG4TJb3QTWTZdiU/EYBMe7u1BW+eZQklxjbSQIhAN2/QRFzdwlUV+uZuGrI6DdDVg/pNjy/Z1I/hZGkgWzv"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0_1603687314017_0.8065577081268069"},"_hasShrinkwrap":false},"6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0","gitHead":"feee3cca6607d12cfde2bb9401a2ccc57d41cbf1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AMsmSxiWMnJoCK6KSUl8IdnAm9Ywj8QXqQ/RyWkcfRxqwWY378Td3omMxYMUwUOfWRzlIyaX/Q5/cW2i+5TuWw==","shasum":"4f8719d54ce265a3b7bcb2eaaf8edfcee9ac01eb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0.tgz","fileCount":39,"unpackedSize":221001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllOiCRA9TVsSAnZWagAAwSwP/2LHJkDrB7wwTQoE/Rf0\nBg2j1VZ7FXwHkPjpedWTa9M1meT+kGm3W3imijn6g9xAYk/F5bIdWuvHJn7P\nzTCZlL8Yqe+3Jl+tMtN1Ac2CeMZe26lf1q0qxSsaPsyo6CAa4QYeBfnaftde\n+ZO4Kygj0thatwSnV27yFrJpm3RxHDMQWiHjWj1f1f5jhsWzCvrk4ZRaMhyA\nHXgDQHmRCziO02LD21F98CXea1LHfVySyNC4W0GkLWzRI3AFBaQyTUQFvbuh\nFuefabNpQBZ7lhRkdf9+yHIcZgfHx/sYSNhdSiM1o5txHNRnKwy5sEWpcwBD\nXD0D8sXVsXxe4LSeyAUKzWlaNWReDBgcc3J/mnDBF7LZ3FUYa2683nCNekJd\nuaG+BmC76JNkeIg295isfKbrCK9aXC3g3133m/5pkgS81OOU83P8pyLNhssy\ntzNREGmBjG1I3RYQssaggZxQKhrpiIAh77tOUf2SdbnKmKlZ5w+yjlWddQPJ\n+R38GihUAzApuvamsZTl8yYHDBhRAYrgnQE9qceiQ+8JawFbW6KGUpiro824\nuW5zGjIi+xWRP2InjdMyQqXdGG7d7dq04WWMFCYxRzZKq5sRMwC7z4u0bhVr\n0XdZBVcaFDiIPPuVag8JGG4QgUYcmjNrhc6eKL9YZ+uLE61Dvd5eCgd+piIY\nvwCe\r\n=3zqX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjRnCWGm93LC3H89CGbdHGApOYztrdMc9XBOpufuanVAiA5Lpu/hdqtW+WEm//m6mXZJUCRuVDv4PAARlxBUxruHQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0_1603687329855_0.17932243698860262"},"_hasShrinkwrap":false},"6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.4.2","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0","gitHead":"9366d7f6c9b66d002ee866b1014b8f8916cf15c8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tNJtyiW5LDyez5F5aEaGkPi0RDIshpHP9sI77e+JZIqfsbHCoUXRgmYhWwu46PzubAvdV+gpvqPI7xpJ4aLMlg==","shasum":"163f5014036ba361317b002eb3f7c19977382805","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfllOyCRA9TVsSAnZWagAAiBYP/jigY1mNt3wl3t5mOgB1\n8wHZqQDbVLnfbnNG+s7E5Qkg3V8TUAbAHkaC47R9LnHP7NR/2RV0bJOYAZoB\nKjgXCtHV2EKM/Sl7B9t6jPTQRUN9Wm99Uip2qBZjDs+tfvGWbAg9TBKrE5IW\nksFskZt40rQlV9iuJXrmGU87gFmOZGEsNLWttscQqH/zx6+VNFRlnxBKsEpY\nVZeS4OIPpIlGRZXyt/dxFgiFgvA+TOsIplFUm3vHc+yPykzfn/UEA2etMcbR\nGqunkG7s3ZwDcpzozoVGhU70Aa1+1Mc3er2Hu7I5RaHalQvKl8NF1a7mXZOa\nsLPiP7OpFeDoqjwuXettsqExiOQrJ/0eQ9oYHIZSJ9xhV8dBuES24bFuBEf8\nYO8xgMpjMUyguw5V0CofFJi0murSigAVPccznaMUUT4qXr8W3CFrMKrqAbC+\nzGvbJN0YZuBPSLjr/ramIwvuJlycuV3KTHYgaSi84tw5ucYpjB3yQss3SJX8\nepGQ8OJ7rxI9927bvdTpaMjglskTqxz0TYJP5f2MLR7xeaReIexFQmcb/oZ4\nV96xpl1s2AqP9I3ctkoqRJ3idhZ+/nJjwCnHFlU5KHk66xAaSPg+UYI+3A+l\nJ0LpRMQ8OMyx2P0QSq4S2I6nsPtdUntiUh5L6JnBlNhcYV+K8P794XEJhGPa\n1L9Q\r\n=//Sb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCupk+CTkocLacyk0NhUF41ZaQGJSBndXNXdIdp8Nt14wIgGXJ6GoIfmfpbhdzpIeTYuM+GyCn4n37pLPUf+jCjvy0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0_1603687346481_0.7324644918374255"},"_hasShrinkwrap":false},"6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0","gitHead":"970a05be45647dd9c604198e888bafb225bbb16c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BsTfgjN+mIcoF5wTXxFKd3jGupNa+bTrgqwj0qQThj8QjZYbZV6CjO2D/ZcWBG+whmQfXJ5mqCowIWXlUQyVLg==","shasum":"c2071c72a1458c8d9583892fc7a3458df79033ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfly93CRA9TVsSAnZWagAAA2wP/2Vo2t2FtRlkOFUeUnNH\nim7YSoMBGsE7uGzUmXARoXFSXxGXWqxGkFKJQDGo2JYaZLtR/fUu+SCRaFpN\nwyiMJmQOwnq0ihtBsxPZvW9aD3ObwWy+0OxyL9qc0+DKJwujePDN8g4oQZAz\n2caVMdSgVwdqTOR2D2fSKtBDnDUX/So6z3eFVneOc1haVgTwyNwO66l2nll3\nen+5874ms+F9M2iyvg21Js/dHZS29Wuqj4baz8sjpvcglU0TtZqYRWHqlJ/6\nMBv9ck9ZG2DF3qXjI9swCx+dNXdMG7HOYWixHYT655geUAArW18ZI9TZj66R\nH2/kOaqEVfn+LtCCkieD0and8jCRhjFU8D6PGgyjq3yM4mtPJszeMvN/7ePA\nIg48Xd1ejIQ53M2FvsPnD2ENWRAzodinZhcTTIzCD3vKcY6zGVF3swd+Jdh1\n5s4MmhXZn3Fct0xAiYthkRs5icj/HXTib+TnFeziQpY/i6fNJMJ04E1ZLuTg\npQpsIMxK0CUMoApm25yo5Q9vHcP528FZceqs2Y+Aj9GBbzZjsCK3XmoZkpSx\nQf9YUvYMb9wJqee7f2I4V5xfWBuzdtxtbge88Zdg8yfY2uF+YHzIGwPrS3xl\noy6KJkElYKAukIWHo6usB3ua5DwMK4lEmXbHDnTlXDhxVfInoEhWdIp2EhKN\nCsDd\r\n=I+6r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNEaewkkRMesBArughrPsJ2uXwBMnRhhI0lF1gI8qjqwIhAJNugSsZAGyEnsg2gGKghBFf9o6xDxWohAZB5kmgC9N3"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0_1603743606850_0.8133738812625491"},"_hasShrinkwrap":false},"6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f654455252df0919c114b129a12e1adf72ce063e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kXcPuE5EIyY3Qi9+4ZYF7ioG/49Si4MVUhYA2WEedpEeXgjTMjQBqSLg8+AlodLbxlFS48yAydJM0JJkyoTbUw==","shasum":"d3f30960e15527e892027d5d3e9c62fabc19b9b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0.tgz","fileCount":39,"unpackedSize":220998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfly/OCRA9TVsSAnZWagAAZFIP/jJcViG2/YRitUrC3Prw\nJeuEPmChkmzZUvpNOdUIIU6MTXqBMx9/FNb/LcZH/E8dAunP2Jc8PS8N4WGf\n58FXefE0b/eoXI3SFDHKWsurVojVUhJtta1PZYQ4mimZLaJAuki61iEsjBV4\nqMnRlNKgF4/AQqYqPu/8UWqv0pucZdZ5+A5ClG7cmDZu+04c+8R+nzFq0zIE\nbhXIsH6I5DbTzF9QcZQgidD+R+ojf/g9HebJcJphInSz4KgBims29GxNcvP7\nKvMybf7m0TERESRhkVDkqWKASlt1XyFmF91cSsnlu38PRu6vxdvfe6yhbgpP\nM3vpHN7WQy719oNiwrcXxOXEkIPKZxC/nP9hUgQs0IDLivKlqlKCdzyTQPYL\nNe+T2Dti6Pg4Eyb//fJtN1LY9252duDDVCIDf9YM7DbS1Detly4xpxMTYEEx\n36MdN79oxZ5X/MPpIcd3ldfum4CNdh0YInlew5OzTxS0FW9Wl39Vk56oEz/l\nBvVUGLx9FBIEQ4Q5ZW/jmoNfsEmjR8hkt1hGCSNoYRqLO74ZFPazPfxNnttC\n1cl7w22kQAJ/ZSd8k/cM56/cehd7E7Ci5PPBCQZ8b6MndhgNJPV4WO6NthoI\nlZ8CT+DyaA8ylyO4dlEu4Wuozkfxzy/1oL1FxXU5/X+Yzq0ZvrHrCjMzCkBB\nmbEl\r\n=laSr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1Rve5ThNQAqu9g/HJJNhQI/beMSrTZyWcbpv5qb33JAiAEzH8IZVIc13e3uPm2bdxRAcz8IdfMMl4cTVdtzmqOhA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0_1603743693681_0.7997113957118609"},"_hasShrinkwrap":false},"6.2.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.4","gitHead":"e2ee08b2ebf41427095a48e9e9b35d93242eda2f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.4","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ckj1v+910KEHr4pPKaQOIFh0Ilh6fRAjs2lGy19veRS/ka9oVD6jdcm+sd+/MYyNajUt6GVkonkw/MDCrNM/sw==","shasum":"ca6b53704ef773da8a5a444ff16a4c482d52f44c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.4.tgz","fileCount":39,"unpackedSize":221234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfly/tCRA9TVsSAnZWagAATFEP+wfu0ihHDVlXDCQz2eOS\nquTQOJRAakKb4z+iYs31cnAeyBlHcoJXgRXYUBpp7+WpMVLm4cwbebTyLFOJ\nmvoGSqhQfGvJVo+uCR4eZjzZMqTHiI3yqKwNoMcrFznLtwA76zsVMzzns27z\nVjuDRZ4Ud3jK5rdMenjy4EkVtDYds92By081sxsTV+zRa5gwhXQm+qS4XAYn\n0GkREyMoAdqGwPwpVKiKbS0+7cCUmIJ7H3xw3nBMcxRgGpyCx/ad+XZa9M5B\nCfU2NxBGIf5YhpCou4FzdVYCN0CThs9vjZJILx48tBR86EG295ehklBA7sUJ\n+g+S4Oh2IfKrvixjTZDXVwt64RrhjrD7z5SUEywDQoF5qDe6wyZo7y6eH1Wu\nJ7SUtOWILtCkaKdSAQUqHXsOJoljJli6qbglEBZFsEkoi+uZKuEW7ZbCQ82m\nN6O/0tWqhpqMupD5NdBTZVTy0Po/oQMnFh0/6FOtN0+rEcDWojkx16UOox6/\nqdBAIU2PoO24m4SOs6gaCoKedYAVvWKzykzOCCsEaImVWHxiupD4gK25qwqB\n4sSPWd+7yY/ocAgwwdtd1JfbFXsTN58BWZ0OGvASWqQ0pu6LToNb/dmfYZCl\n+HHyCTmTCH3MW3+KvZaKxM0E7ZFDx5Z3yTKu+46X4AFSsMZabwjLAR8cadBV\nyllG\r\n=V/H0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHc18yAaft7AnBC2c7Gy81DsrELhZve9rrjiCWSAnexnAiBFadFz31WOIQtqzSyTeDGtu1so7/oXsgV5qCpWwjJ0hg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.4_1603743724391_0.10645234533233383"},"_hasShrinkwrap":false},"6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e2ee08b2ebf41427095a48e9e9b35d93242eda2f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-nTXA8ExI9KsveKtGOidOBkKPyu/TEAKKbo3rfwRRKQmKfos1QkLEAmFqk6XxHIt99p288lzDEpU9cl2TvLP8fA==","shasum":"b15c31c6b2429d3a99773475a6f490e54dfb5e21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0.tgz","fileCount":39,"unpackedSize":221277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflzAGCRA9TVsSAnZWagAArRcP+wSH1loDpZLtaOouU13i\nl6bfzSIHK3xXctXr26oJbgAV7ma6D80IPnZgpX/2G6kxB6+LWqOx62WWcwlI\nI0RRV95W2Go+9ARCdwksSV0oAA2828yplPDZg7QaIOZXOo7XGrSWkCI+lyeb\nEgw3xu9cjRJ0z8uu3Qdu24MIeMKV8VBPuDPlpDFJs4DywjOPJTS2elb1k8Jy\nz3Xf8FGEKLc8vjC8cfk251G2WafaPMksCto5znwxSzkR/Ah/KP8ax/gtnfKj\n8xLv5i+4MKE4EO7PDG8f2H5peDqnscJqpTA1EIhkxLwqKcKrV2btAVNaswQA\n3GBZkS7cu3ze97pOhXAct9dZ0YqOK5pTlPiC6Tptm7vqpNNJ8THn98y9dqL+\n/wfWmaNd9aJ57cprJdJ7tIEXWZ7hIOUX2AwxznQMBRNyqv3bC6VsXaI1BPIT\ntdnjQQKPrU/R3nFVu2Dx82TiN3yU4EeV07+dKpyktiKzTYkA2643KAsC9I+2\nXtP3dqqWhPFll3KKaLN8lFooi+k7E/HprBSrp7F6KDAnA7cpLnJUS9qDNrqe\nTLKNqSioG0nPDOqqrYQSVZG/3wQ/aRAoTj3VHsAorAtJefcNBzrq+RRoSMvp\nO1NgFhYQ646jeQAY+d2fiLQinCwsqF/r3DMfYiJ1ZFZwELc3DTQj+aZLGT4r\nT9jj\r\n=d+AA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEvHnY0ajkp29TSFY716PV8lsrVUHPEjGYP4ewgdWfiTAiBC9XwvVZob7aSV6H34x22qFXD3T/YPEVFYrefE7GsfCg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0_1603743749990_0.4727347063545051"},"_hasShrinkwrap":false},"6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0","gitHead":"e7d84acdcc6d73c5787bcd54802e8437b3c00686","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NI5PllcJOF9zktc8N0Xlil5iiAA3Sj3VP6ZA19dhIXZq7UNNlkobUuZNtmSSlaevolCv46IMOrfVt5dYUtCdhw==","shasum":"dad2a255fa08b2d8efdd3843f1224b312620630f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0.tgz","fileCount":39,"unpackedSize":221280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflzBXCRA9TVsSAnZWagAARa0P/1W+ix7SGefl2fqakHNq\n+TqEs3K/iHeoB6KYmvNN3CDXnM+/xV9CuQOra5yw/MJWnHV5PAKXGUp2tT8P\nn1uYrTibHm6NWHEhBBtBH4e4nAVGQzOHlqz7K7Y2KKXk1cu532gD3C229pMh\n9GoMkRpeiIQAvZJYafjjqdXyvgmO+fAz2jMoQQaDPf4gqxDoyTeOzhUWzyRw\nKXDlNvpTltWXHkOF+/ZDvOaPNN0hF0Im7yVebUuzDepqDodq6udRGpNV7Umo\nnecDOJa6U/RYMq37y6tCERmtRDbgG6wUihp+MAZa+AcfuE+q/KGgcvrCKfXF\njRIpGkGyvMj/kw0dy4oX7fQVV+zRWWjR9Y3vOAhmlekvGsKEanO4+CjowlZ5\nqNnJwADbC0J2RXJM0UVe46HtxabWgPCPzm75EW2FoKFEGMA25Y+jpnb2TAsi\nm7vi5rLHSUNweOKZ20QXfPm9/K0qX5BP3eClZinpopGpFly6CnRjkcg0KGle\n6B9HOmm9XPF03kv8a8i6fhK0SQoR8EC+0iiZ8XzJiT/1U8pW8ep5SmTGT4VU\nCTsZdNRGzoYKe6cjKc/5zzY+DPqJJoHQaojfC9bH/vDFn5UGl/nBujPEDeHk\nXJwLJ/J3vtKZaoHPafN0OSpfSbdJi1XwoOVVnZYOY1CZ3WsxWXk5JHkjU+hP\nB4sx\r\n=WU9E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHbQWRjCgu2xHo3yrgK1lE03XWRI8IhK+wNCfw1WuH/AiEAox5rFVEddj/1oxJcMgBydYgPKmZrcLXRNg91QNQ/bxA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0_1603743830641_0.5060570583880779"},"_hasShrinkwrap":false},"6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0","gitHead":"ec056d230b44b87a5ccc4eb4bda395b260f76294","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-etZX744DS8dCwZ/cvd4golBP33y7LxBy3R7yiq+FLglNSYnxNoEaaPBNklZZjmACgxRjmTJpjUnv67P3fdq8fw==","shasum":"90e8b4c0d1bd010365329092d8216ef25bd402a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0.tgz","fileCount":39,"unpackedSize":221277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflzBwCRA9TVsSAnZWagAAJ0UP/3rks0eU1mQWjQ8mOYYR\nXXhFURzy3TDOCySgkYxJc+8TEyOe/fLjHGHFThIRSupMuUT08c3zbMrmTSEo\nEz3simWiwrVBzOLFRbpO8tPk26opSUFCXLYwW7rFJ9xiK+6EzQs1VyM4z9QO\nUkgbCUbhzVr6mosTu1OsEWalQrJmmOESCCshmXWUeBqg/cEER2yUBNfkLV8J\n14sxfYPWL+VweP1CnZtBUdmYzhktxPn8BwDuglIwNfjURosEL0/AXiqXgQhj\n+Aor1FVawaOKqkHyDeNiP5/Fj1oavoX/xX661pCLmxHH1APGDXlyoXQLAnph\nBvgvGizgwJvO51/lFCEWH0kO2kStVmTedoRdTiwprTP6Wc+zxBEVIIgmRhqX\nDRdx+Bul9FqfgHsJQ4P3hhgN986e6u6dzMtTz09F3xmp1duP//60o5pLrEFG\nUMcXBssrgEPNVV/jfuyBnq/lPVGcZzOJBjoPH5GUKNIS7RIuzjRv3l0g/Ltm\nuAyaW7/tw37UAGYstkZDrY3I20n6iBls/+xthCAEGPHvGiY1wk4xN8EWlRC5\nRj2pMSeiVOyzj7PrDNglD+nbXqEvpxnBe4/0EUmDC+8yD7Ep3gQWBHCYwigE\n+J7K09f3ofZG0TQeSt608dis+0PkUBNOhDPIsor6KPmLCUGDAsCtvtmWhAw0\ntxvW\r\n=rfGH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcBrYVjQuzyD/GKyvVqQ9wVw8VZS7nbvTZquhfHGFALQIgCewcEzQEYusOkYK1puyt9Iy8oZLKUcwaO02V/Xyehew="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0_1603743855688_0.4413074696233559"},"_hasShrinkwrap":false},"6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0","gitHead":"57397002774aaf1afc58944ece2bccb9f52132de","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xuKt5nZBHNMIumgkpq7wu8gW6eJ28yVn242WyAxgLWTwHSILOp6O+cBwY3/1xV+a4Dw0lewwmpBkdV06XgKVBw==","shasum":"b3d094a01da30eeb87f274f5aa5a0ae4b6094545","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0.tgz","fileCount":39,"unpackedSize":221277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflzD9CRA9TVsSAnZWagAAcykQAJLPUhTjEOjEKCA1HgIP\ngEJEbfzn0KkPhMjf3JW4CuolVZdtXItyfuLPrIel7HZwKKLD/mllpNCq4bUi\n5dehh15e5aoqfeLjgQx5a6HIulhj3SJyQC4q8IWds3QaLK8yPscRTs8I64l6\nDPSiP+htT2U8IEk04lzrOP4o4cPPPM3QDkuhrYVMJM6wq61x5spg/UlYW12W\neqQZz+UEA6RSx3NIRcRPmAbeVYLFrBbt+Vm6sFkeREwJa/Dth/QiuvmjnrJc\n8VzCb0BDRbPamKCA+IjuAo9prhovE1Guqbn6jcha0jt8z2usgtjfM/fhcsXL\nvP3mRFFqKG+vvkjjspbbA8IdFzDE2I48Ma+ayLqD1gEVb2Kom5pbo5+VQz8Y\nD7Bmx3bBILyUsxwyA0U7u3WgkUAk3P5BlEe+gGEvh7phCia7Bb7wjG/ZR64L\nOaDnzF99EqNrTPV8yz6OiNctDKHjNJs9ixOO904CdiuKAVuDGDOg9oQHJ4oD\nwIZOZea0u+qtEq2SyBuSfy+IysJWFafKV0Z0ZRZfogYspTLHRnqvAQW2b6sZ\nL3itQXVf1Kxiz2qQtAT4aHEFStF+c+UTDyNtyOCh0nzgKsnxnqjECZEtgN+6\nsvht61UzzfT1cMzw0MwD9cdethKINH16G2A7OmEvaxllCf0TS0Z9chhXahhf\n2DDn\r\n=nUGz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhBKsgAr0Vw0C8kxBLMv14LebUZP+QUdPrR/JW8b+llAiBqceM0NeQxj8dleKfWAOeMEAZnxbs5vJyIPIEwyAP74g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0_1603743996505_0.041280063998691885"},"_hasShrinkwrap":false},"6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.2","ts-node":"^9.0.0","typescript":"^4.0.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0","gitHead":"e1c576a6163dbec49cde56626485c56714aaec07","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xUBUGBYJC26Axs6TcWL3a+djCYDZxiru7JmMCMI/OwMbgfWG230ARJKSvIltlOsbFCMacmzv6XFJuu7ddNgfxw==","shasum":"351f8a163c7da54bf5d39faf81ed27bd38bb1760","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0.tgz","fileCount":39,"unpackedSize":221280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl6R8CRA9TVsSAnZWagAAadkP/1jANelKWI9fVRSuWos6\nGcgw5Q6i7gTnjq8bNWRUb8N3OdI41Za94hEhP7wANH92j6Q/lTgDQaZUQ1Dj\nQ0sIg2gASFCtK2KfGW8/R980QRn/KyyzgCDu2vqLdgm1h76E3LK6pSeqHAwS\njNxRnkp/h/xmq5r06hISgfMXOExMM/AE6vPlAsnrxvzR7miqBDNmExw/LZRP\ntT71d++lXiJnCX/DmE0Oh7TXr/ZYB0WKk1ttFd6dUQ7u7Gksn8WieM6/KGbr\nKNOhR/Rji6D0IrV9g3/w41Cp8i0psBMt2r3rn9H9c8bsX28y/ZUROOX55QCP\nY/OCJppFvcPRO9fAEN2ElSQKMy1WMYdKS4eZRe04oSeR8AVFqc+jhlS4orDc\n6tuQtCXX6BpnWrSfiv/DuWZ3+sQfuhQAM3Zy842UE0vfby5CZVoB16iL1S6b\nQ9+YPX039U7xOefq84vZJPeVIdp2OOxV2obJHgk8D773DmQrDEYLT3UAmtC6\nVtXcv9x55XoSSEc1OygEbzsMiTAZRhPi76W6Gh0F4EqxVDEUPnYHZ3G+7BtN\nzu3u7jPfS2WGYZRMnH0ow88st1JGAbilgb+7nqY78cCZcf2yZLdRq8UMpBn+\nxq/ALpXX5Fhp/tVe0G0CemUrMTsWj80ahQIsIH4WLStjKIgtRr/lZiSqkhAA\na5W6\r\n=+KB5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQda5sB37dOOP/l4gWvrcaDAM0GyxDTsRsd1Cp/zduqAiEAnYC/Dg9PS4429SjlQFpjlyjMSqz/B3tMSO5B0GKomeY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0_1603773563421_0.9419339859100115"},"_hasShrinkwrap":false},"6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0","gitHead":"79d77a2373b00411937cf7fe4e4e06d7a7307f33","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CH1Z13uTXaIYDgdfngQJOKOPaLigovaFjE1CJsDY96S/NAZ/eHwiFoNYb/AE9SbJ4YJH2j/iDk05AqrJ7lyWaQ==","shasum":"d007f09d734c810829cd4c73bc4d3e1a82a65f0f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0.tgz","fileCount":39,"unpackedSize":221277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHc+CRA9TVsSAnZWagAAgbkP/RCWO5UexZ0SoJCgESNZ\nEGDEPUWBkbJvG1+PWIrmZZ+rxKb3EsPKMmtcZni9P9hJvqZWJ78oFxJgy389\nldMVCB/i5ApvSN+er/nfF+a82it4H6cumT9neDMhceC/32W1Q6qd98pPGumK\noOl/GIlhZ+/SdkZOBmYjjj18+fObDpQUwrNhYne8mNVyv8q/WnhBfE06q5Gn\nQasQqkB1BYbuoLWpdiEYK6KEbQEyX5LjQpZmWE74a83fltzAJjzINuWho9Gq\nn9HRCfIfxpj9PRN16ckmwOi0Z8Rp9gxiYI0R0K08EpzGYiN+Hj7u9lQ4ksjq\n3h2PfUbce4S5w2zt9R4QiFwY4Kt7hdHr7vKdj9wTHjfUp689S2c8GXvO/uFq\npdZpgKjtAnQ2PjPmtRn2w7m/d409OmHtYuu2kLDe0YOE/Viv1Aw2ajWEhKSB\ntJtSYy2AXx/x9TtWSLwHfCWmlaDlU5mw0mLFbcR+TjLqCLMWows7P2SQhiAj\nD7Mv+cWZ9dmRxXrlEc7Qk/a77uydWOcipH0yI1n57WeqV1E+fyNKkI1QMt0R\n8cOESqKP6bePP+p3m1B+kmp5p1tTMSB90rVOgk8DroqVtkm+yr4ftDXg2ZsP\nSNx2W31KlOTZfU+LDyOocbXeLMzWAi1x4SmJwwXWyZGPiHsB75LaWlNoK+IZ\nW4W3\r\n=OooJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlCLsABxyt5ejb2U3gmiVIAIc5t+MDng45cYp5HDfkFAiAdioBb7khGxS/f4oN+V5uzUebAomWtbdPDN9zk9R7pug=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0_1603827517457_0.5861534675288631"},"_hasShrinkwrap":false},"6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2bce2e23f1d7e22a6fb419d468c2aef20ac234b8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-drs6fXux75QvH2/DGg9IakofB8duSw4LlysLA7z5fwG9/icSSMGlGUXjxbF6c8UyBxxAGLZQ54lsGHyDsBauwQ==","shasum":"efa314c650e0dfbd30b884fd821877fc5e73b11c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0.tgz","fileCount":39,"unpackedSize":221277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHeVCRA9TVsSAnZWagAAticP/jprljPb0Masl7QqnROz\n4TiGIdOuedNLovPwwRlzxWDfImAdjFsBiiXCs8NJkhcNpGsNPz6YsyA2cDA8\nyBBYVerXoAPJz7qHGADvyvbcc8jzSINCjz1QE5/ZV0aMcpDxYonAVIzrN3Qz\n3rIipk5E30RiRgFtdWEEkXG4eoyNf3U7pESQKCqgT2kpyfwJRduV7MNh01Md\nOxrDZI/t8PMe1/Hn37MLtIXxaEipDGhXAOq9CzPjyt1g5uB2ydeuQi13spYC\npDXSFCfN2CFrQWQecd866EmnKpmEs+mQ7WMw8Ou+7ruUUUElmsqmWePjjyvU\n5JNtUmYgMSMeopfmijIUDXETolUv0NENDn72falqE5uXGRNopzfU6C1Y1bzg\noSTUq36dNlxsNnlLKIadK9+1P+HHKphpSJGQb+9qtVGG47g6MEj8lYkHnJ46\nC6XlkCae/EgckgRnZmMt6FASh3+qDQU54siGUOzI/1nSnfyxdccngX+RBQ6z\nrgdbB2vZdb/V4nv5dZCf55uxyPu+OFWyyPFSURO73Aq/FepCAwldvE6S+lZT\nh+G75d+tya22fcrQPeatvcDmqv5BHucdI9xmpB7rlrnP5bjaLcoWaTTIuKEF\nvYtymiHnnIMXDHwij+cBi3HCfnh0mwh+mmVA8oaBoRpYw5KAk0mynheJeUIH\niQtP\r\n=LsMe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9GL9qxJha6CgsONGBiLbR85KNOgJwaI0+aaGEPwACDQIgW8xchyW5Tjq9jJoGLn7GAeHZblXqM8scmiEq2Z/tHb4="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0_1603827604584_0.6940159076710832"},"_hasShrinkwrap":false},"6.2.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.5","gitHead":"e2157588d59827ff78832e1ed3a784b92159dc09","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.5","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3Hu08GahDtdKxjc+pTr6GmwxfsTFBW6huKbSDbIgXxiklK7IsBxeiR9//bWz47phy0UA4KQOdSmegC6qsW3Fmg==","shasum":"bab84f2cca6e0b52af70c4421dffe87aa209ae01","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.5.tgz","fileCount":39,"unpackedSize":221509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHesCRA9TVsSAnZWagAAomkP/iQVY5lunaEBy4NLLMIh\nWPChPw1dxp/bJlbVTxoVbMXFaAGiANHMo6tIcUswoXDmTKP16ox5sw1EKp94\n4W1vDF/lBOpa6aj0AbQFKpfBp5/uUzufBavjCiMyTFwBRsOrhaVo2oQEOcAT\nklMyio5WBml57w+cO8Ii/rshPE8j3wVg0lt6TQz6ciERq9PSocPbg6MXut6i\nH440g5jYrDwdnzb1Pi4aKfvKbjSgyXvkp4FIEenJs7264jofyuh2uT21BzVU\n6qRdfegEYNGBGUo+9ocezSpXAh2n82P0i7muj7i3w2LhFzlzVDa0DMzDEM29\nWtMhQVoaPKJgGiwizijgjp5edH3qXSfoSqs+z02GlDljKTkIG4ZNbyGwrh83\nZphYTDuIabuBxDsbaIYWsk7gM4AO463Iu3L1weIpzY2zQTDDSgHm/RVILZnk\n2ziCaU+sJV0jB/0j24QcdYzssFjDUeBrx07Hk2PAHxkGR+2IXoprtqqVl8k0\nxvgw8xrTDH+8ES9KncEpVUazvcBx7r0nmXUrLCClPcYJ3vqdYkYZL1K0kuNi\n+ELRd5qA0CUq9LP1cC5bO4amR+9D73zxNwj0y8AHxwcnucxJmt3F1z2MpbOG\nQYQYuJZhrG9ZYCs4iNsicox8XCljwOAC79cnXA//6lQZBQskSqM9ooYthYx8\nXXhJ\r\n=iH4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0LTsIUarpPx7Tj8UFFfetv0IxoBVi+odDPjXbJ+C/4AiA+SrFmu+ouyVlrHAEt10MwukkC4EMmQn16aQPbO47Ngw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.5_1603827627601_0.4554989203603126"},"_hasShrinkwrap":false},"6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e2157588d59827ff78832e1ed3a784b92159dc09","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OrwF5f3yEoKezHOMtSbvIGkUYZlywvi6VexREuWMTCCvJxCEJio6EdnWk5ZUINw4RQ8bhupBt9WqEX+Tb3WEJA==","shasum":"9eb1cf858ac568331f7496cc42dd0b5c3264f672","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHfOCRA9TVsSAnZWagAA9xIP/1Vj7wTcU0sY597D7n5z\nSvEnD4JACTbYaayH6i6xBQYK0LF4xApLlpQkqlEotTTJtqnzTu5Tjcc7w+rQ\nCKi3gpdmOaxIIW3aByohdk5EXfiFciMFyDfPnXjQQQlkPqVeTQWkl9l5nDxo\nv4z5TpjmlFm+jrIqqkpc7s1/mC5i6glMk+35MWRkBvmTdyYgk29UWL+FuCnB\ntMNdhXA73WhR8A49njqMdKr4TWVXf0sldGsWfYiU3MTzyrMyHCvogLLdy+a2\n02JhsLQV3SmGTVN94tjg5O2gmePbN2DtN0IlGVEx/mWSW941czQHdY8mF+Lc\ns9mJ1sSNVA7/MqIu1aFTs+luYwhdWzxXlU6vZppw2lN7joeZ0ERWkz4xIc7Z\nPSZ3UXCjOEACOM6mRUET4J/oMY5i+iZ4IolfYC7e8o8ZF2dkq42Mva6NNlEX\nnGTo3CjNA5+Bn3bKw8xsmVqilUz5XzmwEX/4yFF8oVTCIqdVBCtDLqDcJ+lY\nOj6pG3kCRm08bKIIAlYknQ05eFnMthf2uLmggvoSSfhqdNLzjBGbsFZhEkGu\n0LXjP5Q+P2uYWVBpSEgu04QyDASdNdVhC9oX4GAYfwPjqvIp/Np3MarAMBWU\nTuERhI1lkSt+NB2fFnyp3BdhnqncrhnQRqRpTQCjN4rvLfmQkNfEC3KeBieU\nzIow\r\n=ZroG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdIqwgNlIqKeMy1eZAEGxUU/tUSl1pp1T+lI9d/4y2VAIgIjMjk4mW44v5cLsPsHtSBfmg7g4xOjIliSpQXgxTpxE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0_1603827661670_0.6583085669084165"},"_hasShrinkwrap":false},"6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0","gitHead":"cc5831f644fb930bbe5421905426e5280e03548e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8MEl5/0Bfm2jHCc5UzWMf+DGsEDlUUJXs/fL6zWrHTKb7CBmyvY4aC7BYnMsP8YVzY5pT2jE3Inbyc46SHaKWw==","shasum":"e50e64fc2aaea25cf99d75b06cc4952576af748e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHfZCRA9TVsSAnZWagAAvZcP/3qpBMUFvZtubb85TpcY\nNgLa3PSbHnqt0jjNlqFt8iW8i3xTyNasrm8bHjeRwzINckYnMvsC2ZtqFIMi\nADMRl+IeniafwqKw8Rk58JBRXJchDcv4NwHhplf2htfUYV0ygT8aYgInWyGC\nuzeTg7IO8ifBz9dlHH4wS9RZsinNQYIP/qlYvHWyd+M5+wbMr2cAXiOvKFU5\nIxpVKgmLOrpo37Xl5Bo5zYYScsKu5OigmWyQVYaQqGfm0gM9B34A4aMn5KJg\nhwBTK5arsUit/0kam/mUAB0HUJPoWLdPPEAWaSSEYYSMmsWgew8s3I0jCDMp\nHF/y8o+xt7BbEz2IyxqeUrLaNbZOdm3fImPZWYPDGjWk/iphwt7VsMzC0R7C\now5fGsIaPW27JXJ4ITQd/O8XMemwLxLkBw7Xuf0Syd/drcITUWhDVmXPlZDp\nkl9pGHZV5ITetaDNHS7k4mcbpe/69fTHtRtWVTMfNCrtclvz6Y48f6hXUruF\nMjkIG4kLDa8eiTF9c8X/TuUoZqkwroPBPVysec+U9eAqKx8M1jQlF6RqMs7g\nrDUjfmHI+QmTjQfusWd0/eYdL7eaTR+JD4j28OFkjVMRHd+4w7osZ9sZMG3/\nk0RC2nLdLYnxGwaA+YzCnNsOeTDS5SPI+BJBJOa2yIQ/AoUDlkdiTjR0JmEA\nK+MQ\r\n=gKBI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeZWaA4vXgN/uPp64UEsygmDtaWMI4zKU9vbsjxMyn2gIhAODiNlTYOwQK29n+RAIKb1JKwVvT9BUkbtoE4yuiKytV"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0_1603827672521_0.8629176995544683"},"_hasShrinkwrap":false},"6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0","gitHead":"6a12ff15059e596f657d2ef3a6da4a1bde842341","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-THL6Xf3iLH3h3uaGtTifXcCqJUAMBcjartbhwHkX6e1uQAcitoGVTwPBckNm8W3TKDbEC5fwBzzNoTkC6e+5iw==","shasum":"efa623a9f5e83cb9f2b93a583f1bba34a05e2835","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHgACRA9TVsSAnZWagAADu8P/jY2RdDeT5krYjBxfiEg\nNray4HQgTAwtJvUU5LSHWgt2pkxBku+M8rqmHVJR0x2zsdRJAAE1j7a2fgPf\n+Iskb3A8T9i34/SqHkwhGvwq8ylwXDgd3HUndMcgNdmQ/VRtcEOpdRYSTlo2\nskIpPKDC22Gw4Z7OqmiUFFqi/P8LuuEEk6+dy8qt6IrlA/TFL4EPW21EIJpr\nRu2A6i/5XRbF3hHGYQzf7Gh5Gkb2BcIh978JyaYfapInAE6fq0m4SlkavSM7\nhZXk18a0dGXlQmB3YkrfMpIts/MddKlDEaxouWoow1ycBUiBGsbil/5znBQO\njLKolU2naXn/eIJk5Um/kZebLqe9SMjLBOGTly5gv3BJ76x03BIyxWyhQfm7\nb5/kEgsqf7zQUh+eTHnOlgYxphbQDZ4x0WTiwsdZDQGCBtQb8Q52Zmzg72AU\n2M+fJ4sGDdqA5Y2mKjim4t6F3+wV9bX3NRWH9McLHuQEV6wQLdwl8CY0fpu+\nDaFhpN/5tIHdUSy0yTsS6A4PeYVyozTDaY4G1WhjcHSTjYpsXSoHFILvBrmT\ndHTCk9Vi3eGeC2wm1RNmH6mfaVnupTVXQjOSlbgtIA1e4n/HIw7/ApnFn4iv\nuG5gwQbXW7DPxUDj06LdhQ7DGK6QTPlu7JJocXD8Ua4tM8PUQdUAdsUGtNHC\n1keV\r\n=P7kH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7GLBRyizV22wuOAFJMyb63plBz1Y5hSDA9UBTm2jAkAiB3KjxhI7VI4ozNfKI2o6ajYKXTm/wQRHsZP1zxBGVimg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0_1603827711577_0.7927573390178573"},"_hasShrinkwrap":false},"6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0","gitHead":"e97f606b8645bb09bec6e0099aca2f5751ba69a5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-JYIW57MsNzqkjm7sBd7YRpiQh0tCaxftn76LChYVYIA8sQne1Uuvkiw5xTumm7GKE4yjibhIhWMgogdi5tuB/w==","shasum":"0575dbad838926af8041d6561948f083c60621cb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHgZCRA9TVsSAnZWagAAaPIP/incxv1GFHDbaKfGkNIh\n+sxPhkI2eaT9Rt2qNr9xw+xF4UUrVjCyDsJHp+n3wnbkXOoj7q/MZFChrGEN\nnwiVNpRl/5dgJQgU6JFVvwNrDxu4NVLK6EoXRhp8sh6FbWff4/QXq8iE4+2u\n9UjFNVv4NcMHCsiqSnNC+jtQt0Fyjb0X1CTdUas8uQBh329FdVu8kEKBtpLr\ngvTNReipQLC72I0BVOwm4aGYKRJhi+oiWYUC0QOjJaEv25yzHH/lNOkSF740\n5NlhfhRNyDSYVaLb/ffumxnyZE6ENewqa3Lk3q0oysok6R7TvMVroHrV+0Ms\no/ALjffj+pG6Ck7pWZKM82BOW5WVTPUoKQcBy+Wsw0QOSztkTDT9AEv3Z8Sp\nAmUtsTfIjVlZu3uKIGgJwDeXaotHTdJADnQ/AipTMkHQu0CzZFBEXIFSwktH\n3pfBZPryPEvRh0H9emglfSD6dMZFtSuOUJ5SttT+TpMS33UcE3bhHhnmOZQv\nhYYrol6eGV3jtvONUQBfGXgF4iFzSs9isS3Vz1l4meu8SyvM4iVCAYwC6ORf\nJ/yM3vw+fKL5T9i8ixoAxLj0TYJGURJPHoMM/ogVe61CNjqF7KBjojgpx4lh\nvd7WWB3TKLqhrD0j+wVKO9C+18WZA34eZ1aL5MPcYuF/cECM+n/M/dn8HPTb\nuICk\r\n=kRYo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDj3ZTdg7cT08FWf40gwCunE2raQ/zOlblSxD7/jAJREwIhAI2z1OgLEvcODff6E4f5nwAocVIn1RDDEIDfSGUlciEU"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0_1603827736355_0.4971886486736954"},"_hasShrinkwrap":false},"6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.3","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0","gitHead":"12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-YkU5HIjvoIXPeropUqf0gCdkR0yNyAkpH6HvSvgSHrHHkrvYT4sWNzGW/9JH7dSO7Vunm1yCVnh0fRjkwKRZlA==","shasum":"77cbfeb70e757dcfab1816363cc45e649186a0b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0.tgz","fileCount":39,"unpackedSize":221555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmHg0CRA9TVsSAnZWagAAytIQAIOFquvsbCM4m6T6Aihx\nCWqCx8pJsUcDhlMmkXdzkQUB9sxYz8RmZNkYQ/CpwLZEFOMcH+8g2q7142Kp\nPagbKEkMv8m4YKmzteFOU0h7ol9qtytHQH1xdBXDaR5sXfRNdInqWkTH7njg\nTwCkMJTNCA1rnaP4zyLfK8A+L0layoKhv19yVakvLYNJxSD8P24iUuNVmUdm\ngTqve1gnTmZs1z0Agjm8PD0f0tL2SYrFj/lkHwa5IKcUIAmkA/ipLicGwDYY\nz54lpnciG4aVCR1oJS3gpB74pXMF70nTxWE0OB+fDYfOnVk+hIqLdg1Umwfz\nuMLukztAiA/K1y+u8+bIkL8MfekWlfE4QeIhFh8+rAvroXalsvJP5yNTkIBl\nR8A4iwKLQ8J5p382FVznQ8SM3c+cDRPW04VZJbKufoJT0qOH8jJcYEMxF32n\ngAylnmoZnJjDN97Y2Rra8IaehrPziH/yCiI9koOXZg53vsj0KVzyzouViv96\ncSLhjDqJXpIWh3FBhGFUESnaNHSjxtJSnKZ1JsTz1jNk6hEjCXmcA0MOlPns\n2NpNjWMyN4kAWR8mu8dl1Cw1eLqgsjTu3ke4m7SugOleAnB4q2tKoeNtw+ex\ntJSujD6Km2bIi+05f2Q86uCUon+I/aR0+M1rm6hFS0Fu1V8ykRu+wTTItf4K\n1izn\r\n=hmQ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGnxsCxcenCAhA+fA92mbdcmJpwrvtR69NKPtpyVDTPNAiBMFG8ERQR5XoiXIbNz4NSjTcKoIggUMgajc3KkxXqxrQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0_1603827763873_0.20483434667017208"},"_hasShrinkwrap":false},"6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0","gitHead":"279b77026d401b72cd0758b1da1691eb0016c2ad","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-W1P+4qrIVIts6SF0bIFSCIfyBFgcgCNrgyYp6OCOyYdMyYQE1rX4EjAufnLuSubMNiHCst5K8PzTxzKe0hp63Q==","shasum":"8f9e2ecc2f682b6084b6c8409d33386b30c17873","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJTQCRA9TVsSAnZWagAAgQ8P+wWfV5mpz2eDMg9LXz+p\nn3IdOg7ybDPwehVKAbZat6RlGlnTgDhEXVzQmOpBtU3oFFonyEenRXkv34d2\n+9RnGC2F5J0wFhLpXf/FT39DQmsli0FgwUqv3nVTxFV8tfg5YC9a5SEHCAU8\nwxr+454vTFPIxbL/V9azFreUGKE2iLk8SzSzkJvNSlqZ6sgOkcfMItU5N66P\nQPPeSWAggHIXlqojyU3q08cm2Guls6vnUzWBESGqpd1iyvaMYE6QTw0oMxCS\nev6gJqGEAVj08rDJD17hB45TqH98flObttN3h+nmZ2EN6p7xUv19NKR/vFW1\nh6tIfbAIleC8aCl0mPRTLUq1d8L3Xsvu2s7q893+cdE6hr9Ob4l0wFjdeOyD\npR6gum7SfLJGwjPygP8eLefrnSpGosH+sRqd3X0mMU4G0DazkPVsGmGIHMlm\ngbwOD4y0hY0S22nNc2QwYfjqVn2S1K3LPpY6TxBUwACvvmhAefJGCT/UBCtH\nQy5e/MAtALe0cRCcw2x/0mf/dJ8clQlut/dWRYVseLnIGMdi+XP3PnAOJ9/D\np7+zZl2QRk9ZGS2FJlVSbefJGPMvR1/c0H6TBnchkwubTlJdYaZYzhg5lqVR\nLqF/GBdb9KRY5XDS8HRo70DsdK49QVwNKVhrlGu1/Zwgs5+lrorGVLh+dcTq\nhYPx\r\n=CWNM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8uDBkHckgrVvcdBfRdBPYLSqb2zQUxuz3kBG4zindIAiEAk6/YZs8bapN/K2Sp9pX0drCH1ZKYL+sQdehBw17WBec="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0_1603835087738_0.3966883766999607"},"_hasShrinkwrap":false},"6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IzOTc7P7h7IDbdSolzYlCQEf2LTYrD2mRE9YLfdTNmF2P6haTb5cunkno7e97ZrvYSQ9/+7dMduhkym6pjrH4A==","shasum":"a155ee098509d18ac7cf1c1315fda1df51b962a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0.tgz","fileCount":39,"unpackedSize":221552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJUpCRA9TVsSAnZWagAAD44P/2+9Ed/TVuoVuAzgvg9V\nOHjEJdDj22rOHQsEa6CTgm9p4wIcIwgiFGnpnwXTU/nymY669/8Oyq/rwzQw\n7FdqwL2ldKBT/VAoXiwHgYmdK+uRlTabyy8puER7fZ6ug/UMY8diCauVgLRG\nGtn2BQDhsx3uihgIjhNseCL9xbfOVkX5gVs+dXKSW0VDlImU/938Ln7eNMH1\nfShwO3/iOJWG7uNc9mg1FdM7QU16uD53uidJFnmxIvRoHwC+Bun78+j2koK4\n0HTQOYe38/42P4a3CE0nMDvw9udXolxPupzYsoWOY3ai2suIyTMJmAVCbzvm\nPJH+T6l2Uh/xJ4yf5VuGziVVXEXuzgoUoK6K6co5b8YwHxIQDXR4zTyqUVGd\nmS14rB28HgdokPnPv1uSnYSeUtf79AA6lAKuGGdp6n4tzIhDDrSdB/HRKjJC\njFa+c4ZL36uLseJ7AkoLflUl7oIGNy1HiiyeReAgmDgYfg5+gRok2uHPz35W\nZyVs/l5WEDCKOm/OcgIXaqKWibZ/aZXfoQG065BNp7/Ctos0owgd+67CxuCG\n5+gsSUCuN+36riSzItE5kpq1G0EC2PtqMk691mWybTXCzoDLLHV1UI9ae05v\nao/oeZE4fdRiVulOD8/QSmZ+LzGaa4IfYo4FxIwyXpasoe4ZB8mdknDzoi19\nmYBo\r\n=r2bM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF3VuGhHK8kS5///4GzufVTXdOgmIdf5D2PQQW7WC7AwIgFdD2qnJ2kjFoyPwQRmtlLdE/u/1wdiB9f5T7jkkgsl8="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0_1603835176580_0.016264674398996704"},"_hasShrinkwrap":false},"6.2.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.6","gitHead":"0e176167e6cef0e74af3898d373bc864a893bb2f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.6","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-QdRiCnY+l15mAy+lwSJJMrh/1aDvO5rkEgQpoEwyKVFzJ/fCKcWXE86LX0gcbf2Xp6QKu1I44AyH0sOfxLN3qg==","shasum":"86d0b287189d853829174e18645aae09cdabec52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.6.tgz","fileCount":39,"unpackedSize":221790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJU+CRA9TVsSAnZWagAANHUP/jSJXFzYs59kPEQH82DL\nlXrUWKWj+6x6FTM0D6zhSX7Q/DtlGt+oC0d6B5tuxhb5iFtG6DGiaikf/BeW\nsQOuYNEcM1mOXHfsyqlXXWKLopm2zo8ZwLNRHpRm7mbCuSLKN1xVugGichZ+\nL+eDZ78iQJy8EIiiuew1w0TUilmnutg6Wo5X5CJu4h/rftZdR4TXp8YR+Bfc\n6Bry/aXlCxgb1gAuPJkQ01BnBulJ8mzLnzUI2IbWeyd/J0yFJV/HC1lb5INc\nQcGWAVkYJw2FwJ92pjYlf59vgq3XIR2qh9kRnLyCiYJXPNd0cA0bqJ0cHNNk\nyeQor8QtHxs/QYUPQMYU3MQz8RmC0noEPVMgMZj2E+tMwn021VHOdeWEdsee\n+iklRNg7zdF2FIIUNWY5/2XqhW+voS745Kun11awVkflavi+nTg234vqa4Wo\nNll1rguv5bIx1L80H5yRevXsp55zRBhP5ITAcvJxYWDntZLSz9/QackWqOxV\nNSBfTqdULXHLeYcxORCJL0Ei0i1LiUZ3Sy1bGLCcHy51/FnjmGIS9cHVeM2e\nzZRCz0AyGvLLYlY0Mv3zFrjKB34UehEQ1vie3lfeAfXBan8rpKlT31r6aYZx\ndvKM/F5vNrDx9np/Ou99NLVbq8rixTc0IR9FGVg4GpPAD20zizZ4H6buj+Vw\n5HEq\r\n=jnky\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr8icox/3Y+31H0odt8HMrnQXMkLfF7HIubgyO9dG09QIgeOraJaKo/eGKe+zKkCoe6LJEs5hJYqHjXAPs6h7wVgM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.6_1603835197682_0.6495064070865308"},"_hasShrinkwrap":false},"6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0e176167e6cef0e74af3898d373bc864a893bb2f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ukzx0cUatRnKHq07BATc6EPVbsJE2/SZKmLiPNqa1hBBAZxGGPFVpqIP3eLpYGKQ99HoOznTcRJE53mTq1dvGw==","shasum":"4f48c661c5f1a9dad48bb3d7674f0bca2c73ce6f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJVYCRA9TVsSAnZWagAAQY4P/2nKsjVI5rwgBWzj6i+x\nrrECZYZOpA8afUjyGiMl/RnEObGrKTjTyiigb3O0WdjXJl2TjK9TV5uxCfYQ\ntFtXPrCwOCGKQRaeT10NZIbNcCzyxjQRl/wOUgb2D13JPafPTQWgLn0nWb21\naqZZywcT1CA7oTPgkK3O9DUVbjJFCtu1UR1S4CR9zqlxu5OVuCeuK4wBTGte\nliJDhkeLUQEpMdI1LhT1v5gmcgnCD++L8OJcmCCr3tC3fACmSQGzhFyZvn4Q\nUa0SAamIy3iYajV4UPajkvNhdEDU1zV8m7td+8k0cnpaVphNVvZQzmeI169m\nInvuYKXj+bhPIY67HIiYi9WPU5y0nYDAyoNMuKhDBpgNvUyyDPC1VPw8Wkz6\nN9O3vRRaziemta9s6u1lLtmYXdZOOL+8nz0C0pu0m1WPYHf5rMEgnBExOZ1t\nLzTxHe9ie/NNsCQWyCTg6pEwFRcEixvsO12s9//kXSTM+OBSdPcOCne1eOCU\nverL7M4sJJPsKAKcc/IUOlq/DciSXWbP25KJUJEu78IU6sspJ8/4ceTP1CPr\nXFJErsbl7dbnZ9tUrY6ypDvIO7IG2/Q6wdOV3M3uAXpWAsE26SOicyEOLigr\nAYriK0+yR/0z6clBiH709i7Hn33qjmN0SNVo5JgmXECSmMNuO4fpaVP/kwgD\nG44g\r\n=sGf+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHY3li++YkBn5ISFN/CjR4gZJ6/icDVOsIfxOURaxPxMAiEAnhU1z0X0Ex7UX4iL+bf8m6Qg5s4cAQe+RGVipyDEhOc="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0_1603835223675_0.169179925242114"},"_hasShrinkwrap":false},"6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0","gitHead":"6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-VvCXQRvIW+lnM8Z0Ui0tOSx70utlRWS1xHfZfJIKnXL8+1oyj0spQ+X82kvHzlN7uqqG+JeXozS9c5Rw0o2Xlw==","shasum":"b4b9a8aa036e4263d4387c49393c1cfc9d32dcb1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJV5CRA9TVsSAnZWagAArC0P/i1X9xvAMRQ72SD0cOQ4\niLjbigE3ueOvi38VGIDT9UZBiQrN+daWggmau/k16klENRZvIMHk3L/8gk/Y\nfC+xpPAzqXYsAI/kVpravpsZo8hVYksNynU/zPuDBa/1xfqsNX6tvsP/YOGU\nxzujBD9um6BVO3cn8QfI5vmQMeV8xa12VGtaXJUX4fetCLhYP6nDJVg9b3gM\nBCUtYwPigfkhmZcrC7zKN41Kbc/5kHsLagbIkcXval4w0p2pdai7hP1K3ikp\nQlCaPj4+ts0Dat2ykDBBy0W/oAQMEQcdiz0prjpAm43Z4BVu/IuAerBviHaX\ntN6DjywGVXJ7LMDFX2HQc3OOhUYsJhOG+l2WKZvehZPkgmtYQCLqWV05rYYh\nLST7eD1wKTq/OXOnt3VdcsBGGF3h8mRp2C6qVIQ9C1D9mM1RBT/ry8S7q3v9\nXmVljtk/GcX4K6qHz4VHFDAycMEM6SQFDxSj+rV8r7eH8p3GZVm7L+sKEspS\nC7LxQ24OrjQwQ4yJ6K9lo+ASuHJUwsFI/eKgHDYmWQqI/dFxVfn36NxgpIBQ\nWb77Mdu64bzRxyZJyqd+mElIudCsgT0vDa8vhAPmlQM2SjksRYhRXTwCJ7EZ\nqyY8/3y5s43+bXqIcX0geqHRny8mh/2Jp3N6JlfPDf7pDFhvZ3r0SPHSImXE\ntVSp\r\n=NZZm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMQLpfafNsaiWv98ZtM7Octk5I4aOFvRU6EUcT9vVI/AiEAvK2rOtwa5kkBl+QBpSmS6N1L/0JLcXMiGjooJImg8+o="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0_1603835256630_0.8788882286412225"},"_hasShrinkwrap":false},"6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.30","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0","gitHead":"6825f0b08c84f436c858d80b53897fff2d6009b0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kpGywYuRHNZcSuAxuccuwrtAyNsMOiGwpHLW640vHe6Zu5trn/1U+eNyqo/8011/S4tudBLRLnicYZSNShv4Cg==","shasum":"0aa93e37626fa923006b09c9f0231f60885fa1ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJWfCRA9TVsSAnZWagAAg14P/jWguEQCWzb8ONfZTZSG\n5MdunXej7p1dtc6yxZxLEqxOWvh7mduCFpWmkr7ACa7wVpg/BiJ3M4+i2Zpv\n083/G2HZW1GNkoyXVENFTs6Xq4gdFQUHNPw5LH62DZWClDdGsw/lSUAmBbeR\nIA4NJXPIeT+3irkiFi+nWG9+93Eqny2iIs+EyHncnB+2u+Szc8kwcWyTtLPG\nkeaOqOrByQj3sjL8pRJScxQPOPBt0LVfRpcTJmwgkH9w4jiJFbjmkx1trrnO\nHsBR78HHAlr4oJ1MQanxOVOws4W7xlAh0rLWSq/hvrdOoVTAdlJfOvmeIvdk\nGWxhxfmNjMyDL1IaE/ymJ+X92voCQBpLl1/+Y0LfCvyHSIeYMfzzZ2vdaVK8\nyQXOFUk1Rg9NmZc+V4k0blm8i8o1XRTj5wmVne0xsW27V0/AY+V2COhNGzlb\n3Q0TgumUcZd+/6DnmlhqkpYyNFAaOzgvv3+V2c6QXYgybVhFK0zzAKDklqHc\npIL81vG2EGtHhXLcqs+XtdhBJCG5Nvdo5n6TNc/ix5A0fjPxsB+Ft57NtiqC\n5TF6k8r/uXcKD0ozx4fQVZ5/MLo1LG2rNMs/vQ+cMvp6Mzs2Yg5PQ9zCXMyt\njyz+TP5ZkuYH19mukjjOkrT/4uRuz/UfP8vC9H+D3JPCqSVrwzSYUfFKTfMx\nud/c\r\n=oI0g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbfPA5DnvOo+qTvfKsr71wu3MmzuUiEFGzHJiq3iOM6AiEAmOzGY4PCHx3xiOtXD9TENF49WmLol/V4VS/2nQMP69w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0_1603835294364_0.621407695468499"},"_hasShrinkwrap":false},"6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0","gitHead":"d897693427f7d02238dc4a7e6c6c390670b523e6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qzVRU+YgrJeK7ge3ykHRHa0jmdW/nhDIs6TtDzgvv5C2StDaAxBFVTGtYAThO25UD04HEYq10KhI9DN4IwxVhg==","shasum":"c9a5e7ab23ce46c512447b5e28087b4be2edb129","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0.tgz","fileCount":39,"unpackedSize":221836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJW9CRA9TVsSAnZWagAA1I8P/2EVWzNCBWKSRyPMj4Ls\nyqvanD+n+pnvO6V++a8W8d7LRRqc75WtHOHBDFlHBa3Vxw0pFsxpwcWreuxD\nKGez5QsoC849dOqLCWFTduzQPWUO8FPY73RSPg4N6VtDoen6r0Q23NJTZro/\nTc5rDl88yn7AeAsgXiFuEKHgQTnSxL6d8k2J0A/KjxQc2niGhbWsk7EShEWr\n1sYNeNrcbdBQKyvDFmSiv8h76QS9mJrpWK19B8mbyMB8DXKrim5hwKPvzcES\n1pILwluKUCJFQ1eWhnWi8rn0XVaEoLG4d0BWHKHShgiyseuSy7pk3CGLu8qN\nLgq1U//OcRjCKiuFxh/4W9IG+u4dG4pV66SfWKH9HocnK9yUxJJNmQJGg2mD\nevObwMkMkVCZiaBe3HtLdfBJCSf8RSPa/jEx52PpzVUL6oNRGOw44LVL7SQr\n4PGRQ9MSemzyim6D02q+ABGpflsUhYnnWSRQYFgu89aRC9TCpU1PsUIIiHcx\nWaWbmlflId/P27h+2R8lJVOpzL2eAzYS6QkLrn0hsScxOQe6v7WkAwyKjFKp\nKXeIMRAM8B3A29jIvjV5lCHBCVbRvwZKJw8S7ztjwhVL+yEkBrGSVFR0h5hE\ncdgRCnQt1F+yv5SUkfWdD731Mkj/rrg7tNQw6D/3QTSGNJ2e6XJjdAJu/fLk\n4FG1\r\n=16PS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLf5iryUlVcTnQhxuXHHlKDcs4tilstL9Aauf7iLTm2AiEAqgVIkWFBkepbTqwo6g0Plm1zO2MrXM0fNT+AuKvgaaE="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0_1603835325416_0.19416704575418509"},"_hasShrinkwrap":false},"6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0","gitHead":"99c18ef6cefb2b77d0d39074ceb8c749935f7f13","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-t+wGYvDrhJW2P0l+xi/t1+aAefwjzge0gSEgyAesMVXaw1+6pGeozRk9oivHNIaVSE3KRugvOAsGt6heStPO3w==","shasum":"6b4a2968ce5186b224ae0e18cd6eee14ab4de022","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJXhCRA9TVsSAnZWagAAitEQAJ/MqybwBE7sffXBS+Kn\n/bue958d1m0fve9I8dYm22+o8PK99o2uujn8nLSJSmGAdhPlk4nIQK4ucnuF\n1hBm6r9GPdAuA7n5lvKjCUfkq0XQUGKKItd+wYD+T0xPJIddd4vqaP8OraUv\nSu0WRipOaF2r7bdSDntRMYl6PXsZ4MKeEFW04ymUaRFUR0F3mI/7FrvSS1Sm\n60SVjPRUY0CpGfO26RbqiC2o7zepCvFk0Ol0AepSnWL+9Ujnup9HlczUksrl\n3zeDQHKOLic5A+rcnPkwsN5l63F/MoPxidAdBfQEwq8nwlfDDkcEXAnPW+4F\n+v23avavU7QA8lapLY+McXPxSuq14FjhP9ctSv3SBOgYb8kESqAPYO5SHh0C\natn31bOiNzhzBb+zwHUZ/drnzehCCoGB+UgEwuohjh1rXkwCihdf7lzByjt0\ngws+VetaEEtfczpHyppKJR56ecB11tbGzUIGNJFbK5cQ9WHTJ1dQR64SyxiS\niKixhEh1zzWHKKcxHjbBkiL2XJvwLG/svYIxdTh0vRBTmydoI5tBt3rrVLHU\nh0BBdHCGEOGn+TRPX2Fc2tfUbwBW3nV0eUYyiNcD/k+W73PW2W1N/+7J5Xt1\nlLpW6IquJoYEPgiRFCHiQmvBalM6EqMbkEmrbLnuYKBif6irT7XX14nAkvis\nUwZB\r\n=TEC7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1dy9mBXRk7Lob1jzdSr+6MJnBYBHog3/wAVCJ+oVEWAiAq+sWLGh3t+bwAOkbqG37pektzcFOO7oQslMvDAuvD4A=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0_1603835361211_0.24832892711854115"},"_hasShrinkwrap":false},"6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.16","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0","gitHead":"23506457d8c3b10bcc5d47beddc6491d9e9a24fd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-RyWG7QBYsUf7LQ1Fgs1Fxhlxl8ptHoOojxAQbE96DqmWK0pP/fARZIR3s00VArAGE4J5rd8tjtNIfSpn9B/Afg==","shasum":"d4cdd1f17a8292eaf405f40558a7ab1d59325114","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmRJyCRA9TVsSAnZWagAA2CUP/2fE3R+whzs/2t3P9gWC\n4sMuYOycPPZ6W8cx4KYfXGHavkOBuoBXde1TMiR9uTL+kqbBxqUQRKxNGlXZ\n0EvuC4bvjCs0LTu+kYR0AJxMPaYPSQWJYaqqdzXCsItbha0W/ehRuwBYP9cN\niAC/345f6gDQTdjiurJShXgdgPaj+zlBrjh8xApI2/ZMPGxWmMd19V+uL1JK\nuPgn9bqooiCT5lTaOtskvuSHkE6pDICYmtl1un6v4JoZR9l+5QEtar3D8Nvh\ngP6h0GZ0H+KuMHcdEpbvLCbK+1bAIN/MmNyF0sNFmu/0tZo8B2w2T8sMo3YD\nYGP4NN3em0cdk0UhfcgYaZU9ZiIMSPUDS/teNc/+GNiW+mMQCvRpC2dTJWLR\nE3EdHPOal5fg48bZZPvfpENs8DCro4R15BtGs9Ko86vzX5c/f6eq5eTIj5ie\ns8BvCsIrCDX0OQ/oQb6LGarUZ3pxQHv4+X9yNQ2iKG18fuFIaSI/eknQU4GQ\n/OCoigQ19ekwVNq9w1C9BfI/OgvoRHFEoV4d6BJ+H1WeDG74vuWECyHgSYMg\nz6WQQlNuz+ocOUldPsSO2ZYjF3dyh57HwWD+z91i/m6VYGeHOLOvfYaqQ9B3\nrL/SbMXB3BMyOqW+LaYmTzlOpl6EKtDduZg6YZoc+uOJ/C6UveT+40cdHKmT\np6gd\r\n=xWNX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7ExjS6odAfTwBHWFvqMOfdI1WsSSF268DKoaW1V/3oAiEAyOB/ePn0Fdlgdsm0HwRBimO9qfb2AAtd9xQwz88Jab0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0_1603867250191_0.6805336704446106"},"_hasShrinkwrap":false},"6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0","gitHead":"f644a1f6d20fca4ae607160425c5e33016e2f680","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ppujtp2zaSTk1qk3F+R3J6KbyEsMKNsQ2uJAsjWLCqvmGH1nXFWeJv2c8HdXoleGkQn7HvDrhffmxYk4PBqE5g==","shasum":"757a632023e0d58858c04309051fcb9bc0cb42f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmydPCRA9TVsSAnZWagAAaRIP/R+09Ys8v7/kQG/qE2Fu\nm5Wg36zcT6T9LEgrB5riHA56RFF/vdNr94UD1xHFcR0/DV46PLlxO7RNo8nh\nXW+BUphN+wMWtl2sBvwYJsNnsfC1XdOhLWTNUlxzFCOAXPqotKvtRQrYsFgE\nSFKzMHwkQVVIE9ngF6EGgG0WspIGl/t9ukna9ypk/8yxkpL1WmxJMzuaF5OA\nioszqs9KnNquzXGWBJSOcXYa16Zw4qNCaQxLJ3EGM9pdgv9sTJ8k62JKDmi9\nIS+OmRT9/9FOalVPmPUu78INdLBV1HK3WKzLxY8GuMxMZBPdVVNoyiLB0IX5\nSCfkRWzzsAjsZPM27SwkOydGWkDCHkcRGmWjLFYr1Gcd3Alwm7Pfwx79nhdB\nWKKnE29Kou/flp+nUgaqgKEHNgd1sOtQH21QlnqTwCzZ3z/cia5+U46Jh7Jh\nP64YRvzjk0itdd6kaTf3ttXa0AqACbnNchQbwnugFtKs1JQqou9lRDRj9oZt\nJWFTlnde2bhJjkkNduhZOf2qPEUOGTELxqr4uPxEgkIbpaeppc2cT6dDSiOw\nWGf3wmpZC1Bss6rsIh9MkvvAAp+lDPtx44pbHK/uo2uAw1B4SQJkQ5C13B62\nVvEk/eN/ys304c1abTgI5omucK2tekaExM1ElkA7z7i7vWLRi2IKE6ARZf7g\nRdc6\r\n=RSr3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWb0H735jdtA6wW/YZcUSF91YOmrkZ/DzPkNlveyy5EAiB0fNnouTxSZx3SxfI7hvfo6K92iJvZNQWAGt//BmWLbg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0_1604003662370_0.522273784146899"},"_hasShrinkwrap":false},"6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.5","@types/ramda":"^0.27.31","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0","gitHead":"4f442a6ff27692d1755a074656491b8a75bfd2dc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eEsQwkw558etEHFugtzBXIcCrys4Gityc1gTAtKT6t52tODsb6dFqXmoIh1iOgPA9I8N9PgxOCaWqflH7YrQjg==","shasum":"2c30bec3db1ba375e16fb17dd6b137cc0827bb8d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmydwCRA9TVsSAnZWagAANuMP/0HFDwfMJPVlTnTEn1Nw\n+4cZRFHwzoC+tG1NbHW07gRdPQb2DZAfnev13hGygJu74D88DY/4xL3kxZFD\nd1njKWFTpt25RXOZtpsneir6TtFJDXKE1+5TdO2IpqaFV01NtguoeyhtAf0i\nr/IsQYOQqBCsAUsRvbE0BlM3A33KkedIbpM8iRcE6SdmTaLDIzXHUAjS80IP\nD2wDmNDXxSlNet+4uz40886lZqnTP1VBu/TW8NpDSPpu8fAkHJCeGVUB3QNf\nqIM3N/Az+lbP1H0v1GMzU0DvawZ+EhcUlcQKMOqLNXv9mWV9LX5/oRPGRObw\n0t61I2/ZJhGZn0dBIzly5Sy6fUeI4tQLYD9yucVZu3r6sWs5ajRuWaDmmCGO\nl5oAC4bMv0aT9aebZ7IOEbuFRWIhNUO/M/jYTAl+Bnj/g9eBKSFu75QUgmBy\nLd/EAcGe429SZc9eF+XNUxJN9aKcMbaw622MPZ/5uU2sXak68f75ZaW730jb\nwEBP7c9BF1ja6iMOaPyZUgfg56z24Q3b6sENz7PKyHgSyiMpET27P04oo7yF\n+USLBTrdgvEpIf+BJeyn0cop+FWeRXRwUR9rY3zdPJ8F2ER30BKKNWZG8li4\nnQ573MNfX6CQHigbR31qb+o9YH9R9izE6++5EIXJJv+kbmR5CbhI1YNUf8RW\nSlub\r\n=KNR7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG13OsUe3p7tg+H6Jo5Oxad+peZD2TaszBFJv/R33FD6AiAnLZkNe4Nm31MmBiTgiX79toZ7Ywlub8vo6c8iM47nPQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0_1604003695717_0.5604088279574213"},"_hasShrinkwrap":false},"6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"18ce2b91f8af0c93193eabcd7ffe491860e73ff6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4lW6HSwgxMX5OZ5UMTbQCpAawz8rjCkDqV/Igl0R9cr4GDJgAto6nhVoJFUEqQqVaEyDbkuVpCRodenARd6Otw==","shasum":"8db37299fb3e44371cd3b3cb83bc1762b7995ae8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0.tgz","fileCount":39,"unpackedSize":221833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyeWCRA9TVsSAnZWagAAXE4QAIoKstPK8hQ1ZM9hcVOV\nwPsYrqaetUJ7zvraROE5qXXxXloGAE80tO5x8m8idbyt9X8oPLPug0bQm0Sd\n2TwTT+Z98u3Zc8gnrHIxz+1irxYu7iIq47PUiErY1JTgPvcfwaDT0VZA7faQ\nIYVomhNwFUORPI17WpRmEGX+9vdzJLUm3UEVZUCvM/qnp3/tmFMze+qnGEWs\nWiK0FT3rx9/43U5groLuXa5911UNyELLpNLIwdPQ/+lwzNT3kaKwAD55iE3b\nGGH7+hJQ3eGEXYUCVP2ma5/spf94je8SEWnPBkx3/DFHtjHZbA9QNNEfytJZ\nKo58taedUQWPEmKyaJHnS/a8u0iFaXRbdMZPD21f6mMp8izgMaBR0857XVU7\nIVh8Oe/0ry8sS49oGq1alNdkr4fEHfFpVlR01Ymbs0HzUsTeElp5omVicp77\nnia5gHnHwbdLZQTp0qqH1d14VXPzQ9+X2zdM1itJjeGia4wwRR4/m9Bhvzde\nLM63QJCulQhYySUvPi1AyyejSX5Fr/42+LO4IRF+ksNIAsxK89OwP+mHBIRo\nLuy+g62LGSe+qM3x2L6vrDt44zAN0uc4NK/I9UbYn6w/5mIjFH2l662zK52q\nOHiF/CUZ7ll2S7Ea+EJlUCr1BochRLv4ag0liH3yIayI4z/i98BzNjJBbtYX\nGAG1\r\n=9yes\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfj+7QL2vclH8THSXpFd+pohROLzT3fQ9VGfHdZAgz5gIgFGAnLFMs6qdRf5VDMvgGiBFVdPozXVqs4wM4dwGSjk0="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0_1604003734147_0.1570750662699485"},"_hasShrinkwrap":false},"6.2.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.7","gitHead":"211144a5225148c6f8f49d84ea93ee5710f8b268","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.7","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gO80oeZJMak0WXClBFssIhPruUEUNXKqsBXp7200gg65wysIN52qPeIqyx/Bd25+bswsE+lwegvdyFBbpfS44Q==","shasum":"eafd1ca440c5d70fe274bfa4e1f997e2c8164d69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.7.tgz","fileCount":39,"unpackedSize":222071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyeyCRA9TVsSAnZWagAAqjAP/0jqBjlyQPu3E4gIndpB\n71sUJOEXOuSyJ2ro4mmZ7y4bstd4XXikEQAKiEnGfNxnbDFfnZrS1w/rdAhY\nGtjfDVDNREavwcEEU7cCtPJNQToiDYbaCBb2rD95bg6prDNgwJv/soDIW6oR\nkMSBe+ZZp3a4Mk3Cu8IiAKZoz2Av5WO1xzVspe7wPrgFX0hWabXL4MDwn/5g\nTmhjodlwCZZiSYUK7l46EI3F0mPR7oK0rsyoizIflIIEO4rkK4rFwXWK+eh9\nTBjUz393bqEfiqSS5oE2jaqRBLRacEDtKyiV4hp/+r1bObQdzCklQDrCZ9VT\nwz1vUihsezr/5wkBk5ARAv8R6E+Pl+BbMevShRSTHcSoaEQqnDcfkx645eiM\nIYc8PT9m0WV9tQvLZd20TeS2cxT75Sd59zPCGjNxbVupjQ03xpVdqfpaT2rD\n1fPt+gLxBw0F2isjJuIgKqf0N2TC3GMX1zXWHAnV0ZIam8FFtUhjZNfx8+3n\n77sqTt6cfGkMwnpFw/gWJgL6Cy/6i/bQgJHmovpLJT2sq2CCBdBCbg5FWNHS\nbm7VPqMsbGZD4aqHiDRu63LsTRaAtOr0bzLv/AF0mnnjBzMFC1NiwEPqeP0y\n69J8pIhtwii17rKUuja2yl+2vOLtWGl84hshakcp1uapwZZn8UAI6W6qtmmL\nQ9Tl\r\n=6pQv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcU0YCzUc4ShzzXNMOvz3OY85tKL8CBKSN+DrlpkYd5QIhAKp2A9USbbZLG7JRIIJ/d2BTjx+9JlU3psPghWZns0Sp"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.7_1604003761962_0.8943918872099537"},"_hasShrinkwrap":false},"6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"211144a5225148c6f8f49d84ea93ee5710f8b268","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7ekbNZmuunuxaJwK206UzFyQojB86LX0EO0C+tkLvxPf0yIaRjv5ftQrcNSQBicdYdFqX1zd93fyokDt0FyLfQ==","shasum":"068852c8cb2fe4c02a7ae13cece07f388b3c8614","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0.tgz","fileCount":39,"unpackedSize":222114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyfMCRA9TVsSAnZWagAAHxQP/2/mfV/C8gbONTsfoa34\nKQqQJfi3QykVvrzZYfLA1iII7kIHF+TsbI46qeU+O+GWJznlC+PvghTKhZ9i\nCLeixAIOf/bX8zW5gELbXY/wNPrXqwjMl21dmzHDIMPzzgPvzlJ6US9nFcV0\nNgPzTdSoxtgHFyRj4KzSsXkUFlPBlLPNepLUt1L1JNE96gO5+WbysWUYLiMW\nTr3dG+M3TfRcW5KSIIffJi0QKDtlTwuoJ0+jYTGMcjKG7BOmj9MMEHsuLX7N\nM3pxn1j7gFWgk6nGmL60JUABwVpOsTIrT1YWSaPE1qPK3rsvdZnjSxLYZ5ce\nhiE0PncocW9TYqorNE7x5jyRkusjuqmAGG6DHo26YztoT83XZK0r8nZs1t4/\nfMpGpk32Hc6CHzSYTk3GJNAWnXUjiye9vSHVdkHb93F4/RSlppTsogkGrqfa\nEX0T2x+AHZ8uMSve9S1Cu3eEsI/G46P6g2MZcsSGPl+T0LBR0y2xfCI/SvdW\nHW7bX0FRCiL/Z1f8RdOo5KDwPOnlkqdi62jNZG9k87wJqlZ/kBUZOj9ULRRZ\nSaNLkqG2agyL/MqqFmWrVVncI21slInqBRREFrFR0d0+EZ/q9T0O13d5yEvY\nXsThNNeZSAbf5W5RgqY4EZ4xOrYz3ODCaNW+Ig9eCGH/Tv/ljeNXCsgeTlCt\n/3sf\r\n=/8Br\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICq42QgpBkKwa6X7Ae1dN6s/NebJiPHH3novxUmiDfHgAiEA0fGRHcsszybwlTtzJ/9MotRmfAeLSOkL4ziToUgaG3I="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0_1604003788212_0.13741325804184523"},"_hasShrinkwrap":false},"6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0","gitHead":"29905a81a12542cea4a0927bc6b5c61984a5faa3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PyYUZyMC6LlCiSKN/9ZX1rwhIdIifSXUiXPr36PxSaoTIYiCfE6TF9ApOX4iUg50GgiCnRMsn7pP2QcmSkuDcg==","shasum":"cd7ea3a37d9120c976e4a575cacc9e47f0d0a1a9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0.tgz","fileCount":39,"unpackedSize":222114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyfrCRA9TVsSAnZWagAAtgsP+wdbR/u69TyRDERP4gXG\n6ozQS9hz2XX0qjEGXIZz3Qs0+obmktrRdeYMSye5M302+BrU2JZlK2/FWbV7\n5HsbEKJ2/ma9E6NhMRQ91bpMD6IOtdQNaT5RnMeXwEdp/+QhlJ5JvBeQap/e\nAYBSU08rN/JLA1DsGi93eDEFojF0mdh4R0KLEJ5vOxBmon9ukCPUK3hONIzB\n+BLSi+HFGYIEcCqzTODebYKJ0WtwC5Yhz5mWmqFy93IBIGLEtJ7g5/Z6OgcX\njffria8IKNVzOp63hUs9NjpfcPP/wqjPq02NzyTBtO2oRYpLTiNGIgS5O+xw\nwlk5blHkN2IdmsrgxOs0EcM0424CgllN7Jr4bXgD1UFBJnnTR2fHWKVvnv5i\nXi3rhMyJZb7V9Wnjs2jaiBrWSPpQS9+y4Czy9FigmT1faXSCy4s1WB+kxe+j\nUw+Q+oG0nCor3F+AD+D2rJLC2ZzZCdBYHy8zBZEZuTgfFs34WXC6UfwHSxOM\nPUmReXNan/1CkrZxVq2sK1Lxx9XiEEZal8MTgH5mtPhDbuRLAzob7lVzFjMr\nqa0SDp1Xft4NuJihwjZ7oXcLgzn3f4CKfp/DYKkmK+tTDFA7X4bp4cQDF+PL\nWkpDMt3NmDr04Y9ZoRaQ2jhl5dbUS9PV8UBNIDEA2a+EeGme528WmXmerfbT\ns1nx\r\n=7uyS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMz3SKSbhqTCi2mPRBNQP3ZIj17gorI1c8DxGVNUS+RAiBfgsb0I6x28PmFHFLnuYjJPSo5DDpXsnFgfn7kzhc8zw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0_1604003819133_0.506353135452962"},"_hasShrinkwrap":false},"6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0","gitHead":"ade5f3070c473d4ce3be2705dce761db62829da7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NaVhrnHxY7C8TBq8qfVA5xexBDCeWu7hlrb5B4F0TKPgyQ0C08+gKilRhbhoZ5jCDpRYNKxgp1cmkeiRU7+wig==","shasum":"8ee53c1f10c12f28f9153e9cac2b6ae86c302ab2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0.tgz","fileCount":39,"unpackedSize":222114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmygTCRA9TVsSAnZWagAAEqYP/iAUlsXv7f5j/HHy16pT\nx/4pUGtBASD0XfE81N0XpxoHMEDVRgoTzaYUvHe8vKQOuTGbzvNOIQxNzyxY\nc7ZzxuBxEZHOrqUYCGyeCiK7MTkrTtGOh7wblmPlRGFEuUfXTPZVjI0Xy8hq\nPHkhvxUEFIv5z5rwzLLbHk6gib54ebcYzcLnaBPeQYP+VM1gdhwnoW7Zp8rf\nNLyv18u1SpPw2R7KKl8eXNnoQYoPktMVQ63KaP1tdnNq6T2IJPkBxYqLl9J6\nNvDslc15iN11Npy8bGLSnlASfv40ZUGXebyZOwzuRZQaL0/9zpCPG6EoY2O9\nn9EQ6IWU2hXe/DCRPI+/opgVop+QKQz2tzLVYAo627jvpWXJQtApEbM7ieEf\nykMJV+V77BghvPmwwp5ro/OIGuXJxevP/46N1NKZ2/mBJyIDHkck7E28J1Sj\nFJyRzlTIcB/WvrRfLWe1FPaL4YNZFf200Ar4XE+sLL92CzqntF0oJFw65v41\npBrV2knaUSoI+ub/M3SAjIU28DxZeP59xXb6WQlqYYUnsdz9mZXEPdTIlYB3\nD0o27y9F/8pi9dDVdpfAIS88clERb/G3MIa5bttbjEqp+rkHDHOorXx584kz\nJZcKZR+gp4K2BcC0pi4j4Q/2K0v0uSjUa8kH+OUkZeTfbRr9bf5vyudcSC0i\nIsQI\r\n=Xv05\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXBWS8Bui4r3DsY/9PsmTJvN8zrbxL9J8MN13X0GKafgIhANS50rxum7NOiqd+ZQn6bWt7qwSlxqqGMkFJ0DmYcJRd"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0_1604003858824_0.7635776181863883"},"_hasShrinkwrap":false},"6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0","gitHead":"80ea3af51e5d0a08555f5cf6e0f049ba997fbb13","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lv9igFW3fM5hNuLrzGxo5fOl7raXPusU0EtQ88X6Er2d1uicbsvzIUyNyPkAiGOhln3ZP9WfvLlGw/t1jZJnkg==","shasum":"a9421cf12e15b9899d81d64c50b5dea0b58ce8a2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0.tgz","fileCount":39,"unpackedSize":223967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm/+qCRA9TVsSAnZWagAA31IP/RCwzHPeeU2fk7B7ip3K\neaw1AzJtvy76HYRuGqCMEX6GJ75pcueiqR2AtpS0kF8KIVjbOEoUIJmeQJfH\ncgj4fxBX8t0MMfTTNRki7oXA8ZIznqaRFFJIbMtQxmYPi06AaNSOF7GU3lOJ\n5j5tW+QNsIobNECFTav02SFHUTuBO28NwEfZKRHOSK0G7I9WrXSTei/qQrtL\nOa2lNUhRFGtbcPYgsDGY8HsmUF3GdEhIl2xHpdbGcd3UbSUhxQmkupa6DNMc\neXICGBLpoy123UenHPV7amFSvPPEOaOTIMSY6AAk6coTt1cC7yc7jl3BHGHJ\nWEUwXNTGUDm0xHh0+lDkSH9P1MAZie0fUWEp90vxPCkLufBAyq45jVldNSU8\nsXQmol04O015BKW0CggVr504qLc4YIRNnwRqy+XnfaRiVlzVoLeUSW7IT4Xh\nivDAOaiCklhugtej5qEBCoXGosUj1tY1Pa4peFQG2hVx4pGwWirshguL/3GH\nQ+GvR73AZcbacLB9L2GnV2x7F13QYk8cKS2Z3Rz9VMcB6hsJYsLJxLOt2w9E\nK+H1+o1wG2/UizBXAjHrDqCenSW4kHS5uYh0po5InpPkE6RTqbwCakPOKy0m\nIajimsY4ql7/4TJHt1CMsWIoxQDe1oofN+ivezldtRER+sMplQou2LMi9GYq\nmNwN\r\n=sE8L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFIi1FVRMaVUOZY4IhZHrVHeR5V/CSqPe3lTNUkWXznAiEA8aDPblI6+eS1DD1oAA4qBQ0HQNuAw+4PwgBV4GKQJFs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0_1604059050252_0.9901089715168951"},"_hasShrinkwrap":false},"6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"12a601f2bcdbd90114cecfb4c60ed03427f03d29","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lEQ1TZcRSJOMkETiQfcu7sy4TYJb5t/8mgVkzyeofw9ux1Aho3KmzvlFD93GmavEB5g7C7/XfQskjBf1SxCQOw==","shasum":"9da5b6eba5b7550703b81c4cecb20dd32cb0553a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0.tgz","fileCount":39,"unpackedSize":223967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnADbCRA9TVsSAnZWagAABesP+wczr0tyZcHamkU5ZSSe\nPUH8p6RTzp2lfKG+XqhsS2dPmUHT93EJk5lm81j3KiFl1Kv5iAuPSi1w4Fzh\nao+ldNEcukzyJOBorsJiHKKwJPbknGOVcwf9rtGnqNAvsUAmBA6oFdRT5mY3\nE0j98syFAIdF5M++QJ/bsVU2GGeyLPH4cRARoxBkwPoHo0AbkaXLjl4GUI9X\nlIrqkeyjENpg85gCaSwfF5vq1v4OnDq9F/BfEoBT+1qZfivvRdmy1qOlRR5C\nIGD9Z7LknTZT/ibOb9jNzsrzgt3ztUUxrv0+97Fe0i0CV1sD/dcwipK2Is42\nx2QAax43mWg1+OFx0Y7qQXCOg2VjT6Fnf9cbnN43mZ7DIvPI2wCVa4AvykLj\n0I9EtJBy4SHAafIubdyF/ulo1LHu0JsNyoPdiipApDx+pGgzQaSyRXfvemlK\nB7A4UUYB9ai3+iqYhaCMLs6uE+nWzztcRwgw2RhDbpP0NYJOwigzNONBKe2s\nGN6xUEtMBs84HS5ovE7M9tNaSeyVnuoeCQkTTeGzdkN+IYrhyael4RFUioMt\nHZontSGAeAJvnavav7kMk1WFPZQf3rWnyV9tpv5n4v8/bnQBk0H2wA7z2I8M\n6zbkpi5RR17pB7WjJajAkj0UhesFeJsopLdUxo1syawdgG5KYT6e1HN/Rr3n\nHIQy\r\n=AQhw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIZoLs92PV4PT2S1QAfNjEZCbWudtzjWM3yMqb6H11NAIhAO2j89HSua3ZVMwCUdWSrm2JZ7+VfXswX9hB7F/9afra"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0_1604059354693_0.8336936668888182"},"_hasShrinkwrap":false},"6.3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.0","gitHead":"9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-MIr7S4nrIAtzz96heOPJuHeGD0jesokMXagMcm2Tk48088Hx+fmou4MydE5LiymsSG3WG8s84r2SR7N6g28kiw==","shasum":"677dc014d58dbc212dc49be53c28cd6db6bc8c9b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.0.tgz","fileCount":39,"unpackedSize":224180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnADmCRA9TVsSAnZWagAAUgoP/jr1iG8hLxR2KKwEuJmA\nzXEEV80fnpRFPFkroRuTzlLAOpF26ta66O+9/o4+miJfj8mZ9CtI58250c1b\nb3ddqeLXFwH/835WWg/mEYEkhOvwDRvt6hMoAlj/Y5n6xCKfSGms+CD1/YzN\nbQm7PkA3qlpyYc0gSp3+Hd1DuugpnVFRjH7EGkVqLYyqu0ij5eRTjFDh0bOK\nw8/qmhFbFL2GBBfZ1K8CfXfjxWKWv26gG7Akh/eb63SKtaIMJOkQioNpaRBD\npRNEogefVmFyJl2hAqbZ3W1WdweV0DKEKZ1KRPQPcTNE9MYAI1Yo4y6KnO3T\n19lIXevrFe15WoD904SVaEpHqha0KGCiM5og8+M0CTggKFVVMTHWmip6r2Wr\nLo1dHvVgXHMmSsmWcR1MX64xfcZ8Dra0okzlVmizg0qNOYNj4FVsV3SAjDCQ\nL/G3MyF7nxv6XHM9X9JAA/tBkpMwDFzIvZhTOovmm/oTUuHuXpdXnmWm5uDj\nPZmYA/I21DzVk/UYYSUcDYXajoXhQHPuysvR5P2Z7eB0oRR1m7nEYGajMgKF\nqe6OGZr0wCVR/OQbiY9Xs42Lp+8oeQLzx1j0HI8ABvWRxTtuDQkiOX9Cn2uL\nnq44D79fl6cFwCKn+31QD4b+NBvss91fQY1NJrySINIgC2v4OB/Vz1BbgxSI\ny2rn\r\n=NPGx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQMM/Zv3XigKXAUL87Gwmc5hXk7e5+lW8u2uFX7YhLjQIgEEJSOkUG4COh9T86OZOmxvRsD97GFrnBLpo2zUUTt8M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.0_1604059366381_0.7408900318878358"},"_hasShrinkwrap":false},"6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lAvJlDnYw8lbYGELuGVhoayuDvbyLp2zXStALxszZpCdKfARRCcRD1ILbpjsiPoHtwByYnwuZhkWhmtWvVsb9Q==","shasum":"b4d3309f95bc50ecc7a4e12f8646bf5a65a945d9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnAEHCRA9TVsSAnZWagAAq+gP/iOFyxCe9iILzH9emTFl\nB/uRxPkujwFGT9fTdBtgWloMa0pLlk4ICacOTpYGr6rw3OhukWHvILFUIFn/\nh+Nb9oCyRgJhCPV3nQXAVZ92J467YZ2VonaIPXUjSV0thFapXU6Rhw74Uoh+\nJFh0ov9ifoV7TlLyLSI6lk/X9xf1I7/h6nh5ghveNJrFf7mxU/G8sIS/WRii\nv+9dMO8UPc2eHF+wQXp4QpiCeTBEcplFXP800e7pTzpraEAt7lIRfaZGEaNJ\nqnxBnDirCCe7iOeC932GVXz7lUE1w4yXPBHfQz35ubbByPVIOYVNWPHruJaH\nAw0Wj1nwhpp7MJFzZxp95+Ik3aWJJ9qVbMrkhwHN+BMBzTXrWdd7Xxgeo5tw\n1RuoBynx6gB+I4F23dzoRHwUvg+1LumUldxc9FXqHrikGfoq55sRoApvICAX\nqq7UN/JRQFs1MCsjmkeK9nh98OZmbcQgxtoVwt7gyDeZ2x0arfLaOce330+0\ndaeT/WGa3KFDH1obutcR8JTK8x2VXlH/D8JaDFZMCYRrWD6cjWrvZMtZyPLf\nFKb2L0XGIkxTaDfb81pJqny1LiWEq/Yhbn1uQ1RwIfiZKux+laPmeCXPYyqA\n8ABzphNefVK3B8WhGUn4DdDQuQkRXKnAnXFIl5/wftVa+5h1aReOVeFq4BP2\nHC1f\r\n=Mj6k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFRZIbvTQPiTDZRegIYuz43Ih5HJszjMcFdogMxWwNl0AiEAjgR1tbwtwgxPrqGaLpo/oYtt1fP0w5Fi6emXaWfi3sI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0_1604059399296_0.812750518781107"},"_hasShrinkwrap":false},"6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0","gitHead":"1a2e5c0003c1668c9623332a33a5bd7e8f71c717","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-WZH7XTLHY2jouw47Jex6Ye+PyqaZl41Hx13uKZnPatuoWIO/sgjw2QEvlciS//4OVCyYlwgvjMJcI5crr7cUiw==","shasum":"fe04985336adce7167df13946a016d90ef072ee6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnAEvCRA9TVsSAnZWagAAUxMP/2cfOZaIHEj16I+cMXMO\nWhNYZDyhqF3lSbPzletxvZeYqtju0pGGGuB/+t6iohtEK/zlOIqIrpZeXqOA\nRP4bS9EI+21Dp/fp2/5kYPEwPpK5TGFeoc+BOvXjgq+rPW8PO7okCTryH+Os\nuezq5bgnsKewZ013KRXTMneloTx8aPDBiyx03xRXwxP8Jnx7ZoRRalyU5cy1\nzZPBGkPIX/w4SkaeSlgaRQL+oLWrMVDmUy3cpwQ969my5HkMGKqR5Sfr+Nrq\nbsCqMn0IgNjSZSbOUPt1mpdkoTfCnmH0wJZ50sXKDkuKrewzjhrE3Xc+6laX\nSZgWB0fF8qw3aWf1D51X8fk89oi9/0FrVIw+lua/BHuvw7szYQDY/XSFUSZ+\n95gfBhpjXEEPlyfyLyq8sj0b+fHgcRcFQJWH2qtFEmkbX7VEgE5UqYbxQQQC\nNlJ5WPRxta4VEewSVkRIF+08noE0Msl5AfOINVK9Ftw0ZxdCnrpwZ6dXksEp\njT2GzSbKlf2JmM9Vr9MqAZnGUoN4ET0dEhIa3OQHXV4CU1F1U8Avsj9ZpeRJ\nBYYe/VjgsNZuQfG5qoyHlwKUz2WdfYPLppPDCHxXhVwNR3m8bHxFRxvChaCp\nrU5Rio9jtrYDFv7TuyGMZHd/C4uX6LkJkWfMAwkLGCDNRzcj1JxKtVTv+0vX\nHPzR\r\n=Wcwr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF68Q03ru0h4lKvaI8+MXIW4izFrnzOlhHkNdhNrswyEAiEAjIlV1DbtnJAJG/zjfX4mu7VQgbkHExzLIjWwA7vcxbo="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0_1604059438740_0.08548769560822134"},"_hasShrinkwrap":false},"6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0","gitHead":"3bdffc3ab2370dde28342311a48849687323d66d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-LNqCmRLe9mG3ng1cOkQrXoyNjHr0wL41wru/HnrnF0h4yvV9nZO8zdZPjW1PoPjS2W4AeWJTWUaV3AmHR66xpQ==","shasum":"a17629c0a682f7d67d3ce7d071d94d3c54bc0656","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnAFgCRA9TVsSAnZWagAArA4P/25dalbu/iajJLN/HPaJ\nM9vb56pKOQCDibxYE4Rerq+mXPmFwdqH4Ql8INwq2y1Kzqx03k+rf/GCMuyw\ne/oH80CqXUam7i+zSkglHoCG+9pkf2yT/vztN4u8/R5EWD0GJrFNjMSSJbbS\n4Io8UBxzmHJRTespMbXyo5A8riX80lqBZKf9k58N3kFpweZGSRUAyWKMA2cU\nJNR0zc/c/1TV7OdiIyCO4dVzRvLhXvkJLwnZzSYss2ORFSrBCVmgQfDAfA55\nZ46ZhUf7Ox550Ch8ZdiZsTV8bp5vQ31JecBnVjcMtsNO7n2Q17TxiksO8ZH6\nY4tn7Sn7wlukeofdt2DPygQ0pyMvHEvvPtJxwon/PN4C+sJwGKyHSfWm6FU0\nu+2xSIC/90QvUl4q6Hc04SzuC/kd4gUkr1NpshuJ1U4e/xXW9wWDENKiyFkE\nIJBy0oIcBEa98IgHOq2+cnEzNWkqU9E9bVoQezAwICnv7nYwNvAQFFIumSs6\nwxIOjKxgfUYFTEUDvakRun8bdsvOSoKe+UYZvKRZFquQJzbzyA4JN5pVmfDp\n1ZYNHM9ltm6BjhlCWf0zEw5k2IIYUrba0gB0A+rTHgEgLPkmls8mjELwl8eI\ntmRyzfZZVWdDHBOPWihiEXmw1ZuO+Dy8EiekGcyWVN9QWUl647DSz8YDqsuj\nuu/P\r\n=v6n2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZrKPbDCoe+BmUzUg+U4nmofOOjaE7g+G3ZiMyl49ELAIgOELXIzPobUSLp95nvFYSAAGyzSl429rC8QVkur5q0zs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0_1604059487443_0.5540153435273598"},"_hasShrinkwrap":false},"6.3.1-3600983c48882bec439993733debda87d1404989.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.31","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-3600983c48882bec439993733debda87d1404989.0","gitHead":"3600983c48882bec439993733debda87d1404989","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-3600983c48882bec439993733debda87d1404989.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-8RM2FtG1QBFh3aN+mh48zgOEQOsA4kJPVnkYH4Oz5zHJU62sjolUcODBTEGgudo32DzMtoX/gEDmfX3BF10CmA==","shasum":"b9a22bc3ce666e22db789ad3976b0ec251cb723c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-3600983c48882bec439993733debda87d1404989.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnAH9CRA9TVsSAnZWagAAPdMP/jyySOzgN0wlwKgWwtAS\nZE5PqHeerRmmYk2wqQBiEe2gXUxLLDPZDeXYVi/VXk3UUF71puq1lESP1YrY\nRUlUgVf3n1vb8628Po26ASe5xVfPnewYVK21nv2ED/ogu1nRESABkEGeiUli\nr/qZQ2HmYYsONEQ1OCb5jtQqkxIRqltyV3b6kOmzqVAzpbLEqOk/dTjnJ0m9\nMSE5M5J0RwDRCMz/Jycq7llWqyg8hzTp0R4J6jv7X0KmTCn/GoTDJQTycOdM\ntYm25ntq8I/j6pRbsParChNm7DfoM1HIoxldSBSM5ylf9Au2S354ws19+cdR\n1k31xtFDSiWo2SoFS9SknwDpWKNl8gfoVB2+ZLGLrFSDOVfWsFjpKSBUgN2A\nEBmJfmBW1JrS+k4w+7X85SNxZu3DbjeVJaZAN3NuhkqCAevlJt+pqwJgzjko\n28WpBMjK6FEWNQ3N7r6C6qQ/2/YF/ANpyEgtPSBSz2LmE8fUAZRlbJBHglJh\nu6a5H0p7HtwQt47zd1lq2xwNNc5XWUPOTWdRfa5gCcFDbB1fX4OQYfB3k6/D\nmBpbe8elLDvl9QKCExoMFE5P3+3oUj68o7uEAn5RVwJPrdPnpJiK6KKavB4+\nTnJPSsqF/5P6hWVcHtzCY5nieJZWrXrjM/zGHB8jJK+yEoDrh5yJ2rKN64Wi\ngdgC\r\n=XxNj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEr+t8vOGsVipsPMgOHoeXgOA0S1J7YUuD6mrkLvqwK4AiA248aUyyJqXiNPutPv+pEr+8XM9w4eqSLROQ7X6RfJkA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-3600983c48882bec439993733debda87d1404989.0_1604059644651_0.950393360191029"},"_hasShrinkwrap":false},"6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0","gitHead":"6c6c9e85003d3dc6989bb3883c749b4831f9527d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-wtx5d4k4XnLROwTGFfXLa8JKqbQzFoD6Nj9r2Yvyu1ZctyXNJjBClwwFfaGnHc5ku5wSXdLpKPsA4jF0jZ4liQ==","shasum":"bec29725f6f89d8b55bb56d2d4b466b3ed242ab2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0.tgz","fileCount":39,"unpackedSize":224226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnAIbCRA9TVsSAnZWagAAPxQP/RfkljRJdSxofTElg92d\nk4SDC985tgzcLbzqXb5rzx782Fx7z6NpRdKk/dS1zF88mTRFjTDD4oaBzavv\n5f2BV+5Efh1YvkDT1DQcIKTQ49+LUp2UryjkPbXp0Hw+RidSp6aMrXH9QPJf\nNiu+85RWCSEnw66Bu3DdJtjL6GDQipV99+rLI5dfWmAObWg6zEfS7JvAC1W3\n8wSv0eJA87PREej7Dg2Sa5qSg0ZmhZ/woBLmthODmLzuVsqIAddoyGHiv6Vg\nbL6oPPuLJjKfuLD258vuQAPNp32FDguhzRJkkgdKILYVsW23LXs1BJa6FZ68\n3kMDnTI8Y3isXj3lNMHjO3KXrj7kh9UG7Hze0HFBC/X+qjErad4Bhnhw/j8B\nDyDR8pD8QILxhEvHDn8iv77o0YDNA/iga3ueWXS22axJEnh//UiOFzSyLzaB\nXDmo/LxXFkidwnaNPW3qx/imAhUNq3cDE5bqg42wmaS7Q9hh5ns2oL7EPzUn\nmtpUIyEaKYkkgCXfrgny12qPmENLvs+T3KmHdBtVA25KecA/kXmhaWv6f9fe\nS26vO8rymWDEK3K98DziwIC0GF3Bsa2zvw8f3DNDyKmdGPbuh+LH3diuf08r\ne7vQk5NgOF8TEVo8g5nluQKTR1YkWzqk74RHc6KzqXexjRG9Z3aZQaVNLtjC\n+eOn\r\n=4QbN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0c1o5kbEPEg1YbwiZFPFwiffurvQtT48nNh7jBWTdFgIgL3mdv+kY55Gsohc7j5cBnyybDxjw3I22RbqXFaqvVUY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0_1604059675124_0.3124151894699607"},"_hasShrinkwrap":false},"6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.0","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0","gitHead":"7feeaced78dee50f86a0ac0729ad0e37cb1cdd17","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-OcKxnlIc2YM4A2sDGTrJxC+4NZtT9mxP4W4Wiwm7siO+5KobsGyf2JE1bu+ZMy5an8IQGOvWtxBezIswHfCkyg==","shasum":"f7dd22fed962261683bc8e0928e62ac463ed403a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnKBNCRA9TVsSAnZWagAAtK0QAIfYXsw+vLwxphqh8HWd\nJp2bimUPV5eeUZ/7quyVtFfZMmg42+Yp3kmmqa01wApnaKyNXhw8jKt2J/oI\n87ieBv1V3xKagrIoVdV2Y9/VgiCA4vZZkCbrjYv+eRWwsYDIfSFac1my18AG\ntIIUmTbsvNAFM4+d5C8YXZNk8BkRsn42QKriHwKMGMcjJlZtsxP884aSI0uP\n98FRf6s2huiBCeiUSi+5QEzu5TxsM2RpXNxx3L8dk6amw7cwsU83JgdBUymJ\nYi4RyEcAyUImax53cNDNNlCFbhHXP3NXNUovwGUVBgUjjTsNSTcKjGsPlt9y\ngzjQxFgQ8DxG3Z1Vew+1z8gJmMxSwkqjLLbTkSIakoSL44Fls920cVM1AUyA\nSbOP7i2jNsd0ykBRBpMPMW9SihVnWk3By+YRZV4WgHeAu7Bzr8dYRKxviWbl\nc5/Y2o5Zng3Xr2ExYQc0n9f1ZUdxpvKX1blM0NPUvBjs3VWODw5cisXz3adC\nWmwpgGRMwxwsV0Aq3iTg8l8STUplhXVmnwp6AfKF981+qpKJs/7OjetSo1XZ\nTXZ5rMNEcugpxoYoUV8/rrGmGO2roGFGdJH3fSotn/EiFYWNhakteRK8682X\nGZOHPMwjywUaqFbO/XwwX3gcclezPXsw2sj1aKJYwoxPgZXF+naWn50afE5U\nfeY9\r\n=GiFS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBs4gDjfuuMNR5W9JZyRSWUer9XVwrNci7rGvdArwOSpAiAWu7DZDkRT3tScPgTo+HQ3O36+Gurka8o07JA6Ja55sQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0_1604100173019_0.6176638704066539"},"_hasShrinkwrap":false},"6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0","gitHead":"05f100a10b641a9cc63876e04ffbf030338b1950","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-MRD0jZ/AgCAKfQkSvMVyMc83k1ZUlZZtDouNkbCFJYIw3cXtKPnCRjdt0VXA0mTuOWaw8l1mnz9jZe3z2KzuEg==","shasum":"665c98b07cbf2c0d2f6360ef9e68bd8a3ad4b0ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWlJCRA9TVsSAnZWagAAKPkP/RtM1uLqactKrlRKEDx+\ncMcGvnjbfAxKhy+tPMOQPjmUG/sRQO3rAe41yCGO2P5ww+r6vpHqaeOHHQd5\nv5Q+0ez0LhS+dDABT34ek2uJrRFqGoGlI3ubvIlev3m2VuUozeQDfw5CRHD9\nFYg/BRUIAn03HQyjRFJaMTfiBpv+pbVEpRIgsTF5qGPCX+AZfMZpe0/SdQeO\nsucQ2nEKc1pop9okHSZfXv2/r15TVoAxGbjpyDV7sI2E5KhSA8ca6DYGQKCM\nNfjgJfHNWcs3OFFTBZfNHMwP3WanDF3KZR0muyzr4xVpIG78PwiwAJFt6i4q\nB8y5rnJIENSo+Mj9o8GAUrybm6z+3Ltnw2nCyeXABlPINxgIa8DTvmV08QxC\ntX+hZqty1a1VarQnMto2QmbKKAeLuri78mD3Oa/rjSI4sQeDviCAUITnhbMg\n8loh0/uq84lGYQw333rrtHPxiugY2SzYLPLTyqhiQYkkxofjD5Jwz4A3X4tt\nDDJBphypC7+qAF7H5m28FGOXcKgHSXVKdACZoiHLAWjUYiocdXHxGlhRzshf\n3Z13ST0peW7zH2iOxXVSKV36ZQagznujCyv5Cmt6o0sBotgEQwdWdZlKTe7J\njeAejvUuBrq8Hb4DVJztAS/5e3IKsFJ1ER+UHvrHM6s+ZHGqZ5jCXXchd96T\nepva\r\n=YIPi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwvjxP4dLWD1tHtdEg93kg1BozMu1wfEqMes8jTP6qdAiABZh+so9eNPi12SCyrO9z/Orz1PiO3Bin/oqgp6k67Mw=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0_1604151624866_0.9622833663127772"},"_hasShrinkwrap":false},"6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0357ca932a9424f2df96d3f93dfc14bfbe7d7baa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CRhfA+5A3Tl24V2qoqcrtGPs3wH3k8wx2z0jnU9pCgn3yiUJfbinko3sOoo7xckJVvFWUgp62lN2ZX+12CsFUw==","shasum":"27e5f0fe7450e99f80f1f6bb1b301b78c9e0a6a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0.tgz","fileCount":39,"unpackedSize":224223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWmSCRA9TVsSAnZWagAAhxQQAJMbIt0GOXyosnmbGAhr\nIIeFwz2Zg0miH8RMfwRuQQIY83w6iwQp1V7nrOJn810AIGQF0cy71Za65FKq\nzZPgNKlxand+e6E5xkfGJliNxHZmsWXGQZUp2ifR05MX3oGqweJLpK9QPb9x\nWmnsvpjjQwFvMc+XbQD/cLnj2rjHB50MQd39+zlFnEPfB/XmOe2aC2a5aYs7\nZe/q3xhNpEC85fkY/iZ+EdwXmGTAgyW2V1mSOiMb1qswjF6nDTWxAcYMZmrB\nBu20rImwKlx7KQZy8fQqoc1AMoYz+s5ZJ0STKLe949p8lL3ORbEfzjPC94yJ\n4USENm1lqRD2G+dXfBCKOrrrAc2yJj0A7/P6p2CdLXHkPTkex0ez3QU7bfYU\nuXJOH++TY0cA0KzgF+LfCQptU0TB2+14XVhT+WdBSGXJqWAbiY2FzhwAmVqN\nTK8lwGnj2ORVI21Q82SfdmeoeuOsDvUwgahhZKZIEyYTWVqHWWaTrvn4Fq0F\nuh669IQFlD9TkXWplw8HdH4Ib8NVisSXJAwc2mOw3YeUjNH1YM6uqhgkLb1r\nFbA2yIcQuuFv/7QUC+F2R2AhlSa6jMyw2SRZQkZUDMmGUxnPGzpmC8xYUqSn\naGoTVFCOnOS6H6ioy2NoDxEv+zMMbvhI+xMcIgLDOVcF9LESBJIBQAPKcwFA\nB4r/\r\n=r9/b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDufdF0eNdpqE8m/JRei7Jlaub4mRRHJHVOlBp7C1080AiAqZzXAw9DhBJk8Y/V/ygbzcU1tYTbxtpU0/L6TQUyLsg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0_1604151697980_0.26752862539746736"},"_hasShrinkwrap":false},"6.3.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.1","gitHead":"500cb346ad27706256e0f926c130fc2d51ec25f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.1","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xmM2714Ny0zb8dTkSr4+HZlvRY8Y0pk1AejQw1a4wJ2BI43lyEW9hzQq3d8amMv/Ar5r025aHJ21AabuaaUfGQ==","shasum":"6368c74fb5f56d7696e400d09a0c766e28be5c47","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.1.tgz","fileCount":39,"unpackedSize":224459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWm0CRA9TVsSAnZWagAAfw4P/i13YF8NFsi5IhLvBzge\nW5r1/EO1G9wSqWglp/xnfjJzLnINbUXw1aLI1kg20mIncUM9yrrAJep5PDPf\nBvQyOeuf1tPfJFq51XJIOeeS/qY2Ezb6Vsn3uq4751Fdg//mimwFFm+LTHGr\nSQWQ/KzdUGs65KnEO5h2WYInLcQSECpIXEKft5LkQS3Vtg5jI+DY5/vw2eeQ\nrWj02XwCSqZHMGBOResyACLn7G6fDapaBXNrMNREwwh8zSVkgU7QadyCG29O\nI8Z5SzlBLHz8ThPuBLKWVtTal2phZtYS9rySZZclOwT3kHSDgGqqxF3UfnfC\n4pMf1TBuUVuqObD76XcmqcPIHj9PUL5S/hDKmLJGpFdFUMVt/+HMdLLzqQGK\nWn/jiZQwY/UfjuHeX8Ya7H0ZbNiDaXc+Df8h0ZTBW/z4tRSH7fwPhwFX8Ria\nihLpcNh6jZxR2BwNhK9JMZ5DKUu8tMrAwl6jEYXWRGubs+c/AkYisj8b6cr4\nty0qbs2SQ5oOCBEyWyohkPVpc0LLgaO8B70TJo3uqu/8dIbZCnxelf2Mpj2U\n5eOB8duMJLfh4ulzJpVE7azbO935IRtOHvKu30THfdouuNPB9QyZXDmNoLXl\njz+F9Q2OhZSxhcQQ9hjV9YcVSHj/jNHoAa5TVfwteqy8f7zgNefeW9/JY7R5\nRUQK\r\n=dfvA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiqXa+TJIo4oIOaFCtv/pBw7QPVIlzyH0IRWAc4Yk8GAIhANT73yYcIAg6hHNpptJpin36n0dt+bIsN2uH5VvjER+6"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.1_1604151731942_0.39582564540035237"},"_hasShrinkwrap":false},"6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"500cb346ad27706256e0f926c130fc2d51ec25f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bMK263HXmHbgfwfMAwrEAJpGVhNYPAncyXqePjNNeTE3Yk6N3UBfAzl0peYgaj8qhT2FxkMw7RL8Xxmp6REPCg==","shasum":"cbf5a9eb2de9d1d526140a10f888644152d80e14","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWnLCRA9TVsSAnZWagAAh54P/3ux03lFqccDRjeZ7X/b\nLT80+3J/9xpBzcvrVFDP/0HaD9Pm+JjEc7B8oHLklU0BDmI4FStTkHuT607x\nH2uWcxEcwBjfTSYal8EKgmcbAzTCNzSLVumx0W6rH4kXiNUb+tI/YBEFVDID\nlv+G9lrRGJdOVGHpYuu+Nk8MQfoJ5NObhoIMWO2R504/u5G12+C30GjbxtJd\nbV2KcMp9R3CQWTy+6oomnvrdXYCn6lsyjQib85uR9htOHw4l+ARDh0/Twn4T\n3IehhE51nlP6L1GAxZCaelZSlGd2evv2Bi9hcJmi9o17P/N5lzO2WeDBLU1b\nxHRzgWEm3oKf+1A+FYcIQpf00BlnBeCKHH1lQNboiZfV5OFYPUk7TONelYdb\nIgcgaIlzM1bkvnFGPCfFLf2Vc5aRGN8fYNjLsqG7b69LkIV1JfbyI0CGl9si\nyO+pcdVFR3Iaui9uyDV3ZQYMiYVP6aGJksSYM/wThEPZp0ZEUqOjyrrsBMYx\n2P4K24G3OctyGWv1thW17T1o8b6GZDO20en8f90G/EBrIIwh7f+49CqtsR/o\nSOth1lVTiZL1mMRp3zE130knN3+EsWjw0L725ux9AqQ8kZc1/2B+fZFrBJpN\nCwPMtew9st+aHEBbFvR7HY0CnrG4hpjN/NBSAU57rlzU3a5BwjR6gY9hauEI\ndAyb\r\n=uCJ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeg49+iEjPP4pKAH9wWLuPU3/y2SukXv4D28ltoY3eHAIhAJ/rrWuGmdKYv60Z+xpwDAsfMvEHGJcEaymWIedHoAE9"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0_1604151754897_0.7444146986374351"},"_hasShrinkwrap":false},"6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0","gitHead":"1c814425eff52f25bf7dd15b5e2bc01da1eb8129","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5N2pkwOG5DBJfol960Jh6wCDk2WvuzmoIl1RU+VtgZBb/VFfEGRrDEQJS+bnslPcz4kr4rLgwACpiPwU+dR9gQ==","shasum":"18b11670c5a0c1a7ca6c678cf7fd7079a0ce5278","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWngCRA9TVsSAnZWagAAi2MP/Ak00G45bS+KHRizyr3g\ngaW9hZB9Q/UOhNnc1L+ET3GqWsddR8cmKgFiS+UXkZdp2fbAN1p6fwCws4ia\nkpLo7tqv2/3O6PJNN/uHvL8PE7WsmzggIf/j8QCatIySDlv+3V0EIjlcpA3y\nDZautHT/dwIkvQUQ+gl1BDI/jfPN/HL/gWtvy815oygo9RrkfhJmqziGZ862\n0fx0GwSzMQxMWZPhYWz1UyJN7tvy90yjtGqBH0z5K+/9kcs+SqT9rq1NRwav\njxW6H+AxsM4613QzBvptRAqE64I5AHEVA/ney6byFLMdJtV8MMBC+IakNwC1\nP9rNmQjmU6ZP6hG1eP+xMlyF9aNNDwNnGTnu5ReWQe/icjWedLIIdAX79XOm\nIt8Bu4cGZvFytqXaCihuLj69uBcRqWv0W15c9wBx0TSUyO9hmuC8IaUnvPig\nk+gd8rfvM57v0GI3XnNoZDaxDod8o0SdEsSrvb1oF5Iqzzyhl8nDNWPNWRPD\niwr26+o7GeQ/n6oMGr/asRCFt30M6C3qpzTCL3QvhP5IBKMBbNed+BTCwsfD\nYVEPSTBDg76c4hjvLOEjdCc8Sqjd4VBkI2uIjr5ZfuxpiR2E57mvLw52wmMW\nPhuSTCp4o15d+bRy3rLN48haOa2p37CWvMwcz7V7DKAZ0xmO1GZx10JzkhPd\njNmT\r\n=1v7h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5F0sEaGjq8QkKBN4OY49ed+cUe4gjfqNlNaFG4taEYAIgJZ5FV2FUkIBUChnPjgBLnT6dse5fnnlKMiiKoLS92oI="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0_1604151776010_0.7413043683087479"},"_hasShrinkwrap":false},"6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0","gitHead":"8baca90bca67be5d159ac300fd87e93c31ab03bc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NHqdgkKExNzmvfrng/k53SNmUPTFWfqtqQxfxMoqACpwicgOSUD2B+aJat0vSwHiA4oOOYUvcJvaOlUg0AgUoA==","shasum":"3d572bf39d06f0f7bd84eff0aadad4f9b98cf852","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWoMCRA9TVsSAnZWagAAukEQAIMBKB5kQ/+kpFxSYqKD\nl/GlspMk71IO/KQKtOtgrHiwC1xVhHOCIu/E9wsgGY72RRSBsnsrwCuOwcff\nxOtCt94hmFb9m/Pw1J4e4Bwfaun8LTx08ws64FBwhjf6zdJHxquC31R6SdQe\nHjlGHuxTaNvJSPZHmB3BTDm1uC6q7g/AvudZaHg+XkQVoZsW6RnRWYJXHBcp\ngUpV15fRRt0H0Hcqu8TYJBa7URQG09NPl2eN9YNwDfPal9cTbNDYo1cw6GPj\n3iAFOaCA4mSxuIVQ4Qr4JfXV6WKxMWT2E/VgdDDV8/CzNSO1cmsme4rPbir0\nzsSFmBMBaQm2/bUIW7iqGEEoOQtJ5WURXl1q9/hJoWukja7RRtwnA3OxbQsE\ndnw5/ybcf0YfuHBzQ9t/umfbZ0hxUS8OtGggiR2/ILHRH3qObmRkIbyROhf1\nOLwTgnOcYIAjii4x2BWFgrk5+qlfczjJBQn7AHiY8EDna42snfUP97Wz3eoz\n2OnO0t57TK/eltQcEVAaKfp6m54CiWnKXqrkotJP+5tTRcXGMzSGsOM5CCOv\npn49OK2Z2ggellKdKN+TmhRQRzG7XAjrOOI6ELXACkLfKhEcalSmK9Sl5Esz\noD4yLkKbZryKiDMe8CNnN4k14/gwru04dY9j7jfarQPVi2TvsaH6j6Rfj6G6\nIMSd\r\n=pDtw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPQOyeKnZ+oxlZ4ua6BNFviWIiqW0zJmENOYJuVV5qJQIgPCrCEBM/Vsg2P7KYTWulMqXdj2FnC+WM23HLICR/9uA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0_1604151820350_0.7507597809011379"},"_hasShrinkwrap":false},"6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0","gitHead":"a54bc9d204adf5b2a574f1b07d631d9d551712b7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-of03Yzc27kCUBmxm/7XtMu3/wY2nYKJcuX5gjHy6tqNU0uFiTZ8+ObB6fjXbYuIXikSjZHUJ+XACwpx1XDI9fw==","shasum":"3d8aa869ca4837cb60fdaa06d336559028086e10","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0.tgz","fileCount":39,"unpackedSize":224505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWokCRA9TVsSAnZWagAAdqYP/jdYxGGz9UoqEbCIJYiv\no82nwCbnY6NRowJB1NCoaoao2dgJENZX4qCcgjjqaZsURC9vHdUJCA5RwYbj\noF6ZKtDmdPb0u9O8mErVJvRnCT9KCkidwKm6uv5iA3z1L3jQa1kMDAi2/r1e\n4j+z98KqHkSLvUrBz9Qhzgou2Ih5yfZ66hxU+4N2xVBRpr9jkVNWKMXmfu/Y\nXUgXlnGAX9Hj9/17quP2zoqflSy5+vZecofh+IqCtHkDKnxw6SnSDYeCra68\nezu7lTgMCQ7ebJ71JHpq7wyKHG4wFNl810N9OzVaFd98hWi6fiosvVYBVkFt\nfqpgGPLuWUtWcE3Pt8OdeMeQPcAVelKa+kUQb7Dkepqfsoyk4P0itA/a7GYv\nlH0cnoS7UPfQofKLax3QtEYGAymHzNRq/Mr7vaQIqmnX5O+ZRCrH5iz0oWBq\n6bV6KNEEwy9J+cDfXS4PmFqLtw0aIUKmuEnlVqtQ14dqr3FKt4Gv1TiAtRCW\nsN44QRqVLPfPhFssvm6rnvvghbX69MCUXYd06pAghJ23nmkn06KmSqw3ykTE\nnLNRNX2CzejXUlohzOOxU+j/feq6v7e/9JPK+iRewjnN4qBgSKCtm2xcD5JM\ngc8cZ+dZIRizAQMLjO2sy4X0ogBgowAGmae2mEGIGpuf0nw1248ccGvUzIt9\nP3/Z\r\n=4XK0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrzge99sdvUwTK+iTQCJa8u5YNYyKH4UTYnax3bpv0UAiBJhlsrchP+SwnyYX365w/17DQ2n1Sl+L5O1SUVaLZhtg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0_1604151844352_0.3115237767755923"},"_hasShrinkwrap":false},"6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.2","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0","gitHead":"1ed5317efac1d3136bbb6180267f5a4f9cf0a823","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5//4I8e00WVCVZywfa2rfXwfzUY06AHCN6stdoSzm9DAT/E5rQ9nxAQuWBftUN5pG0ui75JNam5GgODyBBI3Mw==","shasum":"3df59c436432947333d13e7f4b3a5814b309fc86","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWprCRA9TVsSAnZWagAAO+gP/1UbFEfnzqJQOqgwINo4\nkP5lspZotv2Z1YLWFgitrHrpESoZlIPYxfrx32MK583mEdWGJv60QWKe+NOe\nk86JqbcfZ7NswxUZEAYKSjJBSJz4WJPuJsZ4YzHFloLNCxOnGsSdYWHqWPgs\neWXxdX2AG2vG+zNZzLRGZp7c1ghquodLJV1mwN2RTlSoha3XvF7YpbSJEejr\nGW4zZITEraj/LTjKTqin1lmm7i/Cagiv6Q7SC3HIQJ6tyX9jW9sw/S9Kusof\nBamO99kRmQv4oJo1OR8ydHG1efzS1JtOffZUOfdIx6Ct0YgP+LdTO/OtgL+I\nErG0smrZ4bckXgykNQEEcOiDoOMf4W7mYQLSWAB7rczuQXlWlDu01G90Brbm\n/vnAoVjfbGoJ+zPFvNSDgjj0EEK8rOlWxnFdiJw6r6nJKCxxouS84OKfNPru\njVh04Mto59G4XprFkshSsqtcgyzX1BppgaPtzYZfn8D7kjE5XinFaDjsY+EA\n8iBYJM7IGtKIJaPnDXH7lE7z7qjweM+hzGOeDCSNxegOwCh7eP2bXVTdm6Fj\nTxXLIzKEFU0t8v3E82zk/OvK2YRuQkAo7nnQZKbe8A8tgDJri8YUbdJV36xc\nJj7FX+8Zwb8mbIkW6PFIf+JeOIo0a7B8oZrR3uUS695a1q6XRl6XI5l9Ip0n\nC/Yy\r\n=VITs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/VcLB2ppMavdIH/BuVs4DjXDg18TUdEdrd0S7/pzT5AiBlIbvYFSx+pYSK5eKLPTG4LtN5H6mbJxoJcD7VcjyN3Q=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0_1604151914772_0.30887954463867273"},"_hasShrinkwrap":false},"6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0","gitHead":"04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NwcGFK1TKuFCu9WUS1cQgB7BmTYhWOA1wUBZjoS23v9H0ivrSG1JOlGQTVIv891IESx+JiY6n5I00eYhDH3GaQ==","shasum":"de1a91c261b06f280bbf6ffe5bcc7a05d9c84422","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoC4CRA9TVsSAnZWagAAc90P/3fjAS1A4AyTGWJHd5Wn\n7C8QMz4KzjDmOJ0dVcN9V3kSadmT31RX70dYaqtFcqua9Dg3IeS4YTr6VkuC\nNewewgdk4oEogekApKxL+ZwO9kobM0DETG9GhCx/WZdBDg9+ovgGc7n92/US\nmjAJyqG9VpsFvw0e4sveJ/vsuWvAeGdAMMY1YDS0auuIMItd9KnoFVJcrylr\nZupvuwCC3PPE2jQmTJ5ko+auAh99aF8XL3o6IdbvxJrpxKzIkexict1ySJuH\nPjjh0zEu5pog6JJMXv+fy0u0oIcwnf20+3b2q78WxUWr6LsXROrm41mrcz9s\nkmipxh7CpNaBg1zKt4W8UdvgHXQneqtMmQsw410d0V35q6KArkXjvuJrv2Gm\n9mx4T9JlW5W4sKq8wr1sCRZJwzbi2juA+qJfRuKO6ZsefOiJiCCkFWFl1Gz8\ndB/kU8oc3IgjqhzAfytohtZqeuucH4u1hfoLxXSSL/gzoMpIt9Bhjm8RmXvG\n2aBLv6YE6F393k9N1KnDpKTpYo8IFq1qNZnFCwUL8qHTKh4I4CJfXHSjTbLg\nobBAB/8e9skfSrOzk2QCavm6hITTmbRiHllwoyoxM7VOqZNGbqo+dU9pYf/j\n5AbQPw85ToEft/eJ0AcerdVVgPKQvFYqb3euq7o4yUtyo4WhnOC81BAA/EFt\nV+bn\r\n=sp/O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBiDm52zjmRdDbgRVMoqTPwm8tczgxQEyyNXwfKnV2CAiAdQrfccFwH9Jr1oqwR+H5UlReKXkzOicgO7l+I192lHg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0_1604223160318_0.9590437167884993"},"_hasShrinkwrap":false},"6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Ew0/XIFZxIjQLNqrOuJ+gVUVs/s8jbtHEPjWWqNepMOMEF6sNCkDPxwuHQLDETk8zZhEOda0RISije3zYOXkow==","shasum":"e556d1f0254e05606de1965db46702e8daa564c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0.tgz","fileCount":39,"unpackedSize":224502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoEfCRA9TVsSAnZWagAA46AP/AlX6lutx8fr/Ys8E5tx\nIcXpnoSfFV8g6y7G46JDNk6jnQWOVLF6LuiGEqHvCvq01JLPQ870YX7UAfLV\niT7CPdSQKlowZ5JhyILUGUuQTfHgpU/ueR4UnD9PIt/pVWy55Gh2EKBr5Ckd\nOk51L+nF2rtRoVVkln7xI7V/Qml5Vd3zp/1REsltlsINZQUsfsNBhZMHfyU0\niYFJ5AdYiXVy1rEIDrPofgAMjSfuHMjSpwsRzdvaZBwdzeVlFPlcJR6lv9PY\ngYbVzwhztQP4WcpFwePSQ8euLNrV+OV9uNX/prgW8FTXX9EbLqHiLjmE3dvD\ntme53ugzwRpsxV7c1WPAWacO4VBYnB9z7VohWkPHMELvXq55gaSsA3h+lX6s\n7koHC64nNne4WtLQ6W15E5O0fxjdc49ccr2FI8tM0a1OuqEoSQwNxekbYQIl\nzX+CdsHsmXowzDavJ68O9J9BnbmhEpRW3Zck5KcDwfhA1dqrTZ/ba7qyb+8G\nkzMgXu5nme09qjG9dT3W0H5d4rtTnWlW5/aGyNeLN8+gm3WDotPjj89AMAfe\n8vzEeywbkROkNyuOZ+ejXi8Em72E2Jko0MWKm+nj0Y8lEKgJjmKmvAlIwx7L\nDygDAmZjbu+5UGAKTNi+f721ieNZVOgHhqk3weq/KW5ihmtBjYyHSit+AGLU\niYP0\r\n=gsU3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8AyW8q+2MJM1a80HPxTPIhsZTp9gymvFDQQGpn+m26AiA0Ogknde3UMXqmwJJwnbk255Uaxj3IguVOGJN0FxlVfg=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0_1604223263209_0.16689465798805347"},"_hasShrinkwrap":false},"6.3.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.2","gitHead":"cf1bdce7615676f31f8b4cf351d88b704daf8966","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.2","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Q0FLm9cPU/iE/WTxVxRUbO/vk3l2hfV7Jx6j+ofduV4g1mOGOLvFK7rsyyOsGWEPMFdUQI3V9KXWvxCf+uPjHw==","shasum":"da03161d606da1845be483d87bf6f97e7309bf81","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.2.tgz","fileCount":39,"unpackedSize":224731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoE4CRA9TVsSAnZWagAAOAMP/RzlD76dIXVW8GKJtC1t\nJkVNawC+/+6XKNhQROW6MNGOxY12PUrawEl0CgS1mpmNCS6QaKMAL8/+5U5j\nsPrdpka3FlIMvMErGrvB14PeRaXH3mVmySXAmq+YTYfeKd7y/WSn5wLVlqOH\nm2IbjAcUGTfxmK+Ts5eiZJ5EbwM7rfMCh5jOSoW+vN4l3IEzUAZAjp7DnD+Q\nrMf8eEi9JpXSmWqvJKtW4AyGl65XuS/dnOsq9ks2t2i3xUMDN9Tmq5qttbZM\nxtfdkOTayDg4I/TyZ3gwAA7dFZ0Ozn7XIlASTfEyWcezUmVo8iB71zoRmci6\nHDXhrbLwwuDN7qj9jTqKyrnWjnabwuX39ob5iag18qKp5jQ0PtRzkxDzBRdI\nkhQWjuEl6gMjNUxsUtwKQGB5IWfxCaBas+SQkpt7gOmeW/mk1tmIADdQ8KlE\n7Vc26rOrGVUxzeVFe7KNmZEWUDB6zR/zH7gF1RUROdQRMYDNFJFADeSi4B+A\nztWU4K57VrwrGm0Ik2I1PFNFlYS6zCM44qITaxSWzAMtiZZDTR4IwdF0kh0s\nw+SlscPSf55ex3PK4plcn6CyZB8y6lHPRsedXzdxGNbcj0ePQ7eO6jrkSmPP\nK3KYBQR4ahqpr+N2WWbDBHpw5b7gaR/gVZ/+Fgrt7CWLkBetPiXFmHVVFkpM\nHdKF\r\n=9KMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwesTv/77KbBqwOzjoBHk1sTYrKh7XvavoIj1nUQbIGAiEA6HhZr0wQfwQKXTe5GfVgcUwiCYrZ7etifXOgDjLtjGA="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.2_1604223288136_0.42310366044755066"},"_hasShrinkwrap":false},"6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cf1bdce7615676f31f8b4cf351d88b704daf8966","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gmCei6u4aGSnLRXyrcl1E9aO6VIktbQfmKLMeAFCvUl22cecqF2f+n2bF/+eJ1QnRa13knDyyxToxHoSMzfzFA==","shasum":"8d2c1160e9dfcaa3ea74ea1eb605149de66288ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoGACRA9TVsSAnZWagAAotIP/1cUkJXpy1TGdoGOq6fL\nZqh7SMD/oc7a9LbyOzJtfal3Za2Ez5XYxUHlF3ZO6Ng+jPUWmyyMuMSVG3xP\nNsyySi3cYG4xq27zZd5RASm2vXvv8SYAdREjhMdd9opCO9s7RoaBoYHGRF4i\nq1X0zI1sSAows3hUIR0JzXhD/Fzc8f6G75LMM4S8Ph0oaf0nZeIHHWKO8Foi\nZWevPnDEclcPCgpojqezsMmeEoBfym5Opp9CYNnPg1P6bX+tkmr7uV1+d7sR\nqD3ZFjetf4olVIGh8LQC6Rc70TbhrbLgavcGzG/zJsFn6CsKEp+D6BbRQq+t\nLTJNmXnrw/WKThCFNU0gfZqb+A9r0A2e9K0UNNR74haXhbfZWVdslClz2brS\n1qpczlMaH4VYtfrxsW8DLP7hYVQoJdNcTOxe18yZuaSEDbdIFoyyo/EsK2y3\nnbSNi1SqCO9vYyIjPWQALyY8pVFLwHH0HKypcMx1XK2OgTChdnsnXBAmMnyv\nf2gxOuczWy4lovPiV7MfB7qegxLrk5DSnIWlWrJDd8f/B54IjbRnE3K6pmm+\nwo1BSg5hjsLF1FYPXM9c+o/iXYsjW/nk9jlvN1KJ0C46chuOL/X0fSGJWK73\n38w4IgSnuI147REnlbRpIHxTo63sSIwmeZujcAbckcCMhNxlcOgsW4+oWiYv\nzotg\r\n=kr+6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE8nNDwZJi9JyCqvmWeytJqT861qRiqOqWxs+7IEsq9wIhAIlm0h5Gb8Eh8/ktKIBQpOcqmpd/qqsNaOtTLiFOGtWC"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0_1604223360347_0.2845491396513331"},"_hasShrinkwrap":false},"6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0","gitHead":"e8b59efa4e323f031c244655532f806df1f62a08","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4ae620u9iCaLGVBcVWoPOBK5t28QFbED/2obZi03BV56jf0dXgFdz5aPvXf9AMQsKbc9SNLFO8ZUAKSyuTx7LQ==","shasum":"3d40edb31d291838a35b15fb81b2e725d40ab85e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoHqCRA9TVsSAnZWagAArEAQAJBX+iTpuRA+mFtnYlaa\nSVHoafUYtxwpodPryMyv6VO+3fcJ4ducw4yK/IDxxXRgzEQTNLLhBpfhyl5R\nS7TEOARRACkSCzrRGYaEhidYQFZwk91ABHoZds8gPnpY+Ke6937YbnuVO0oI\nYO0UClNkLVfc94C9dT4uzfQoC1J5KOSFmRMOoWrraDDWx53MU1QVoszLlAcH\nnAImxvbA1WInP4T+Hdbfir0cMMi5nDP827l4vRWnK1FgUI4xWv1SwDMX4hfL\nNKWkBHvm6v2ilyn8lWgGvPkOko440PynuprtUf8LNaQo43pSsoHnavw3sE7S\n0PBhbogXcaAAjtuPtBuh+QyqPD5qg8fkbN652f0I8Zk2JaDTT1kkpNL1c3k7\ncjgHEazr4PbB1MMxt5ZKfIVkwi4fmWV6Y1y5GRjShibZm3nhewP0oA8yO6Uf\n+Vg0zaCSnnAYctfh4ipqQj0YpEVUdZYjmtHrh06Ok4CCmaQn9pX402bE5EKy\nqE91DUwvbZVsuwaVEBYwAHgLwssnbNFxVtU1lLzm0HM/nkj3hbkHLyqdHqKo\nd+T1RbWEuNPiibsY3jwdkI0vQ49asGGHhv4mBY2jDm0sBQd/I8RrS6YQD/fw\n7DUVJQGXkw/1wgS6h+5oBJOqmjm/E+UyWeQBp8O7odKkXIHOQj/kRKlYsMJn\nuNhB\r\n=v9Cv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDy/1l58r4fYhWq3/xcwfsaCEj8xsewmyyThifXCVhyAiEA2Yujthnm68U0ivGpsXhXQs1pG0sndvfGJ6k80NVwi+M="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0_1604223466031_0.795887491563452"},"_hasShrinkwrap":false},"6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0","gitHead":"b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-DypmBCRrwpgTqqS0JCPAZeq8nBl5iLtEeR+a4vL5dqnXtVOXOMlRrJRqfZ1qn/0nVGclGt9StZ4e7QP2EqFXPQ==","shasum":"535cedd0e0541e9f02b45fc34aecb53cb76f9556","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoJJCRA9TVsSAnZWagAACpUP/A5XzBx25glwSYGRftB+\niCHOdjvmfxyi6W4Tn2RzQoHU0xCy1CGcHCweBCakTI5TOgw8MscJk8gwqPcA\nXGVRzGiuAdOzl56OXKocN4RYdmQs625apOzuwgVZ6OV1XMhVEKTo7DYz9UFU\n6qdDXuiwCufDf08LVcj92E4lkMI7U2FPcBNDzlebDuGg/m3lZwW3UD4pV+7a\nF0txp3LGjkv/ue9fbsunpMDPdfeeoSF/86t9KpSr24RdUT6V5mQm7/xZc0OW\ngZqXuIXTz1jP6EJiF+nauv5TVPuPBNeotX5oZOs7YTA3lyTC3HhRnjPYXvN5\nX6lJ0mHfbzNIRuGiCXSeLHPYrMSJ/9PBcU7fWGQRUNPWkazUw7TQi7HEjWJm\ngEVgWv915LfwgaI4NmscOAOZ3Laoqb1qtKz5FdO43cyi2mZebmki6UQLzJ75\n+4W2p7+YyNP2VQzEuvPWs7LTi/5b4RLHO7hr4j/Tp6IhxtBUSJcmdTl/K3KJ\nlczvB3pbn4gl9Ui2YT9Po2YXzad5pmgfPUxUGD1HN+ma5mvMbKmFiNbJanqm\nvVaug3Eno2fhooSBAdZTDNCPOfme/BQa9Wz0gIdZM4XjaYsFXJ0rRByGmuEp\n/W068MC9oBznQxLrEy3SNN7ZC03s4R66wmSrmt0NNgwpk3PP7xsQwD9C5Jb3\nahId\r\n=3nk3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKphnTOsNnTBLVt734cpibRXACB3yz+sNBy2m+waJLoAiEAoSv5OtP8IbMsrTlRvukxZcO7zOH3CMK+f3j/mzUI9EM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0_1604223560876_0.47878423804346126"},"_hasShrinkwrap":false},"6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0","gitHead":"b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-CBpgo2UJsCbqudp0tKVI8oGwUtjUxF8m+sqTvS6TEPz1faOMGh8ROFBovN1AKoCop/g6Ip/sjqJNTisR9fCeSA==","shasum":"9297377b44a77488743b263ad0be87c1329f8aa6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoKPCRA9TVsSAnZWagAA3WAQAJqoJvmWGwerJo+75sf3\n+nddHRLchHntJQ50DRAq/sDdO3KcTE0qTG1kKgcM7guPKLQydKIN48CUIQFb\ncSeuMGypRKlXOPQnFSAKCm2wmOZLO0Fs4ozZlPSK/4B02YpsA/Nvx8aMr6C8\nISKOEHBd9RMXUBuC+kmdkuo1ZmyjDtjUapMrNnvxUFu3hQgDB83UryfLxqNz\nCtQ63gg0a7Q5LLg6STfKHAnl4t/sdwFNSQhgIZ691Yo0U6+J5Rk/lXYqSlCK\nL0BJytGBDE3za6jdmuGB+98BlgFWZqecbeqgqduTd/aArKBE1XYV1kVRUeL6\ncyv88EDqGbAbh+DI/HZwZclUP/ot4gv+qK5rXJfr1VEyX/sXEq8B3HkyEEXF\nNIv+dOrb73lWkFwH493oqYOgv8g4V4Du1TMLwsNlgvp9ZxLDbErM1C36fOd+\nc8bgzIYvOEuyrIqOhBCeNnoptYDkQPX4OGsBCM+LqkR+Ly8ux6sbN8k07a4u\n40nP13jD017MVTvvTEpvMqPF2hhDwj9F21Bl37aFQVHd7JxEszUrcZyAJarX\n7ZJAmrt55uy8+VVllkNbehlNwi217H1g16zikZGV4pnmbQlZVSbcg5gzcw34\n7bhzHeREnvefsOaTIv4lvRCi9kYhs3vv2F+VNYbE4DhaiehT49l+EgTrpblE\neXev\r\n=Jqii\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGMDcNdD0yfs7aklaE02GfKoA35XIpxkqh6laSooNMNJAiEAxRDUafa6hK5Ai25qt6DluhZJSx+TvGgAWs09euTGMvY="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0_1604223631220_0.3524256898752156"},"_hasShrinkwrap":false},"6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.1","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0","gitHead":"fb64f392090095fddc29054c64fb10ab40714140","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3tuCAhxC8yzdVOpI75iTACRbslSEfbiLQCytqk+upmIie05TG26SNx5+RAkqRYqeqkbe6+nKh3hhRp4O+CTkDg==","shasum":"5f7c56e5f4267b486828fe4a4fbed3811dc17e7b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0.tgz","fileCount":39,"unpackedSize":224777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnoLBCRA9TVsSAnZWagAAiykP+wW/k2ihxVWI9LK2Lhu1\n4CTYXMt7Pcbz1VviYOKDzLD4HXTBwBKqlKTr6e/+VjlI3IGVr2k0/dLjnYbp\nXgxd+aJeOEfCrmyA9RtW6QWP5Yh4J1klynC462HvNDTQZzrMLkmHzB6jGUsr\nlmZ25ICL5A24jAKPg3nQqGlzzzgp+6AZv/PffmFCFP9BwGYv4WR7hNxp6zq4\nKKEU0ZcJCXakJilDtIRYlG0cGgwSXRhyw4nsyok/+PRVRNNd3tak0IdLndsa\nNAF0q4S4nnkjNac15oPey4lHtPkHJyxMGJk7o0q/YPTC9rPFiEXVOLet+92r\nvTi0R6AMd+dLLRV2hmE41euhYroDw49cx5W9lTNR051BDzCb5uq/Nj0hvDIw\nLIzc/C7O5zb0yf2P6zLAC2Nq/JGo7+Oui5+LQbwq20lhF3tuBm7w5fkLq8BN\n6GBlC6vfICUq3w26zRI7TiJYfoCRGZaC+ue/X7Rprb3WOqcVWFmFrmUXFca1\nHs73WOjSsjvYM/nl0G0cTEUIeq0smSVZBLiBbsFtXWGQD2cZT/sDNl04Jao1\nB9rL+xTJKPBUcnt0K/KBBVcXQ2Ttx4Jp9JzUezcEdJhCQiZWyFkDy/gtdul5\n5i0PiygyO9El+XUjQS1yKNBno8qM177h02kZcykQjgwYyS3xv/gneZtB0Cl5\nTeOQ\r\n=l06s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE+98jfXw6K8utIFUFzIbmPB3AWi/oJqNARnHGvBWgZCAiEAqXxgVvZ9snrMREf7RIGVLOzEK+by47YlKyHE+S/obUs="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0_1604223680420_0.8164208115927862"},"_hasShrinkwrap":false},"6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0","gitHead":"08bed17cc9791fb34515fc1c6c82690f842d1606","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-JqDTCY2q2TRB+YVnk8Du7F7BIJsOkj+kbRMO1vpzaBzFuHiebOQmdWRFn4cFbO7mCf+k79PIySaoBeVBfEp8Vw==","shasum":"afca272643ad805391da88c07412e3d1cb8b7ace","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAUNCRA9TVsSAnZWagAAoU0P/Re0OruMEvb9dSFpF01r\nS3LrqbAA15WVSrWvBGNQDhfTDeK+3rEzIYgjFTaZkbC46PWZO9f8oaU4ueEz\nVos+ZpQ0V/W07vO7W4eSygQuW38hIExUXW1WjVX27FDDBCL3+G3v/uK2q8F9\nr1N1jPu0pM6bNOIlk5uqa/ZkCjlRqKk0tZg5yIvbBSVIkNt/nAOYUswXbjFj\nYOtiffNbc3TSdwyVxh+oP6lFw08kvTRtdAD9RIMYhCmo+55Mxsnd7SUrhtXH\nHlTr77qrlX2xk6FG3eJQgVHCZ9CIwnYsxB27JZuRqZ6Go2WJ7O10DAssNYOq\nm29XLwqoyFfTLlUdIKqa8pcehHPTixyCLUJTGmHxKFww7IOcHG9Q2GpKvmvW\nIUoRe4NKTEXoPENSs1a8sAj20Kq1O+rEr8RKUxwQaBbCSMhiFFgI20UY+3Tb\nVb4XJvs0AVQfhDjU7PVp+HrxEhNSVR+mt4r6JIFN8XCsokquCrtyuORwCAf5\nHqb9vveqJb7qY1qWAW/n85JmIJkOGFfRTThfICNbdixQTaB4NPVaAPKBghtp\nWNMwEJRSoYhGcbX/02diLPvqASniOg50LbRpGuMe27/xNbDswQrpND786qGM\nzOmLGc4EAEHtDTA+Jo1h75mFYdqDEMJgSGDaeoHhATLxt3ve92bnsbPsRtwM\nFbJs\r\n=7PWa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9brcNo4D8XTZNdXRBcsoHyRLQPQwL8SfZ8FvrZcVM4gIhALChrRjZxQoC4H9Nr0h6Z/Cdo2qFnegRkyzHOWK6XOG1"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0_1604322572593_0.7477625363395666"},"_hasShrinkwrap":false},"6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3615e67a505bc6e3cfacc55cf5e85108f521bec5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-HnAjQdpcf5OVgvRf66NK9SXzywmaFpO2JQk9v+H5DlvDNinWjx0j9FuwqLjRgUd+eTl4NmqS6nQY01FqOOqydA==","shasum":"d75b975e1b3b4efae612e716fb12d8f60e19c87e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0.tgz","fileCount":39,"unpackedSize":224774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAVnCRA9TVsSAnZWagAA65wP/3fNuvJ9/LiGzWsxh7Tz\n1RaHSHYzUwgLIkakYscW5gluYgMO0fgRTNXiD2uOLIVwifmhBfQHq6ZUS5Ac\nSESu32kvUCzs/JUMRxtgXIVbasbMSEoD8mnlijCKV/BOoysXNjgIQjoQHiJW\npheoKsXL9GUcMVCcG+zuOoUtpqZ02tdPgWhCBtslVxEp9Iyjfg7jL/jTWDVD\nqcGVCD9ELGb6l14geDgyNL/l6OEj5/3rVw4oJWvXHtBm+BjTc6MABQuHpB/b\ntkG0RNVcEp6QwZSoXUG+xk1iowWTB0fGLbsBgXGph6gbtxXrlTvvteAdwVcg\nqtu7RnbF+Uyy8IgPQA7rbncZLFBwKBkWTDM78rdmlRjm1JwiZKO8vJKhnBn5\n7MGaSeMpt+qPkB67KpuQNg2WOnKp8lPh4vx8iYYTPV4BALljYfUZ/+IBVvRI\nTn9GOENF1xTNW/vRd07vooqMK+Zn2Riq900LnJf0HG9rCnXytUM5zpm3pkKJ\nsX1VLALx6DQIGASrkOqXBiIVeEbVdH9Qk503kk81ruM6p/iLpunvw1tYhGPP\nyb5kb8mIYGZuSoH/S9K9h1kSB4HZNrnicJbc3nPSouDYQVuVBJ4S6KZCimco\n93JnXB9DAIebef6WJTZ28iyg2FKu7RRz94WCcv/doXlJ2ojLxeQtexkLNa4I\nVFIL\r\n=0+3z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4Z9zaKY+YAvR5cw7EQQKEUmn6VFdBhKjkc746vk8w9AiBeQbG7mz62vaYsrJsAty1QXbawTkgTgmwkAFFqtxaO0g=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0_1604322662546_0.5186392957590553"},"_hasShrinkwrap":false},"6.3.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.3","gitHead":"1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.3","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-IAVYqG+bp+B4k9Njtfpmpf9/fFmu/hTljW6cruZu1cY0sPUYKYJzKiDsdJ05/bHVgbtN/L9vBAJLJAw9rgw/mw==","shasum":"8fd2b4e87a959b513f165d0caabe32ea4192993d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.3.tgz","fileCount":39,"unpackedSize":225003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAV3CRA9TVsSAnZWagAAlxQP/RQ+qrzhPRyPQvoPPnCJ\nhxqCpWI2wB/b0JAFQdcNarMtWqX2CztIwWqZNfKFTQjEmCaFBGt1tP/6SNre\nWhnDNOmMfv54vHWcbRuJjMOEfyy5wrrTWgS4QJAsA6CWMbQUqRnjbcFH06cA\nuo+OMEjNnMh52DRsjzyrOxqedzjCV+9nOP2vQUR1J1MN1U2eBCsTMRKEV2dQ\n5K4mFzRZxrnKFLlkWYx6G3oaQy1Dh2vd3b1FGGNFuh50k5/VRDkWY/pO8+om\noi0h/SwWthoxnv0+l78aM/HNpreF0lQm09uuJ0UCfbGAmvFTHF6sty8ySFNg\nm0MjnQKfp3v/iEjQyR39jcLNMVcvHcLqYW1OHwpgqgiMT6e7Z9DfcbJtbDL1\nf/u1vRqWC2vCSlTBbgWbyNOFiwgeJYIDjINfjjOSpBlswH46cvK9a+kSsVWT\njirFV379INIKX5tNJJO4oOSpq6klLl9/RLAVoEBtY98edWB0lY+1jxjQn9W4\na+vVqFLPHCmzdzvhH7qxyxA7bb6VZ9JXkRYsZSu8UV8bEIzJcWyFyxhPOpFW\ngGrbBMRTkfWUmLUYuc5qTQKJ9euPplRs/GRhrYB9PALCjYE0BCmr4axMoIvj\n4YrDxZ3OcQgcdlRrAm18epnPL+eZrAVZPKq8anOYqISop/p2b2GHXBuiXc6z\nPrv1\r\n=4HAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHOpKYZ64OX32j8bfulsDF8fqU8ez8NENHXhWNa2lxs0AiATPSV08VYu+lWzMUcChFT/6kYjEQCV4WIm/n0JwmruLA=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.3_1604322679140_0.31421469286025205"},"_hasShrinkwrap":false},"6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1z3KnNV4dOPuz+Qo29OVQh78T5AWm93TadcF5AArdPbPO+Nl7JhMThPChECMddTTe6UNUyVI4Xgd1xrRm78wnQ==","shasum":"d50c99a03d0a5f23da8a25760e14a5407f4a5b75","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAWiCRA9TVsSAnZWagAAiMwP/22M+jFfNJ7paeyiouqH\nW7WMkip81zSEaGT0pVHgmYU1JjcRooj95ZXPYw68VtdFImLeMBCqTpMrtJ1O\nvTj77gmgiAQ9Fg96Te5prSkVhyFWiLheskvrQYQ9hwl6JOvgpr074laciCdo\nzqid6gKkJo9MLCHiHWmPW4caw8ZTsWj5GcQ7l+npDxalnNjqKiKmLGmAOg5Y\nPz6FCvW97wzUBZbOSY+Qk+yshefgCZb6MrkbmOoJYuO0zUbh055+DHsO0KY6\nCQlKz5/5KYWV9Z3w/OnQ1mBzdC9vt0aoPCbDo6W3yG0iY5piTnheHLzpgjB9\nN1xJi6GePi0f6R7heWzKPq6sE+4BLhA/o0qfnF9odPFSHZ3k9VsimDEGdBHL\nJo2bsPP9RuhEfmiAjg/bEBYJCulXx+UU0iS2gJ0sFwIz+5bJv3B7vTLsbP2S\nYUjlZXn8vBb+vcxqVozir+Z8keNwmr5+HwmCE/s8ObUox8goPzWrKhnAz/hg\np+pLzcj16URDC9/BS7zjjoNY8zmodFth6/xJCAa7AQmf0bna4P2rVHa7bo2Q\naW1NuNfmn2FxW4s4AAto6LV87hcBoisUn0WXahPG3HBMyxlpbmOWri67yttm\nBIe7Fx9HxR2tirjUoGne9Y6erYLPb7TZBQpmDTzOuEUzuKLDrVf8ktbYWulD\nnfBw\r\n=+Qor\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqOWkiN7G6ZqWyPNCUmobMMVmAZx/KwTEiZqCNdzS3RQIhAMN31ie6StgGtsAqV+HVu1zTbePm7GAJzoGISRErD2BN"}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0_1604322722138_0.4652247566253396"},"_hasShrinkwrap":false},"6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0","gitHead":"9234fe24f099772b2da4eec3ee304f7e9144c04c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-M6aKP53nXn69Ku9Xol5om7u/Ny1OFI7KurS5GKL4NefEdvnU79133n6/lzPDJ4DWtyqBoxWksEq0vaZpUf20iQ==","shasum":"4339eb33356df2caf2faf3cc58a6b88a5100c153","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAXJCRA9TVsSAnZWagAAt3wP/1q9n4rHmBFTEuIwq71p\n2MQ2Us8XnAJBMOLaq54sMuM2nA4j7KsTuUy6Vq39Y5RFx74E4jZFZx6o67im\n2m/OXuKB8Qsg6FJ6PhtLu67HKZSSMs53ygjQerilz5GB2n3pWWJwauLSXCg3\nBh2qU8UzLDRNAPT6kH8KlavdMpGXb3BMMcm1PtUMU0pSaWS3/4NBkHzKzaCy\nj1R1L2BSgf+PHngFI++gQBzH5bY8oX5rs7vBEVMH76OD36v0xRf5ULC5bHvr\nLept0oRMYmFwErT8VWM3KtXb4IodgMudGnWuvzDmKz+oISSU0/GtWGGe8LoH\nGmjaAx//sHkybWxlYnAm4PWApMpLs2YQIoiENMSom3Q1t/xcK6l6B8OCNAQ5\new5KGDGPMVAt38lDKtsRN6ltbbn+Kedp6Mow2PK9kSn6J6G1QkO9XA9v4jkI\nF4g8TP+8xXngw5QSrJ3u48aoUtpdS9gfn95h9FxjiLxA+1hcluYnS2k+qXAg\nNR/Vxq6M8sEszoimocb7sV0l1KEFR7r/uCeiqflvMF0S4s9L4KKXmSXE/Z2Z\nvaL3NUq5uNR/roAxBWXVsIBnHMjsuZCYlUn5Mnbx3iqOXXa/ko9g4XvfGsgC\nvbUj4fSgsKxNbt+itCr/4Z/orU8F8hsF11/7Z3CH+3dSwJqcus/mA4gmjg6W\n0jML\r\n=Xsr2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrzuxPmuPPzSOBCLofQ0QNgNhaJPMbKQyzk7S2msPXPQIgfmMTf27KxYCuCHuGyqZjAGSjCmNlb2mColtnkbEdLBM="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0_1604322760562_0.7491820313190276"},"_hasShrinkwrap":false},"6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0","gitHead":"ec119ce8916ef9349e6f0870ee01c2dd25d9b7af","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Pb3EwgpQi7iYdI2FboF17531A6TjCd4FT4lp/VCk97eELMWo8I6m0YU4FURBOdYuvXy6IaoxSNmPQdqlH0rFGA==","shasum":"f2d082cfab067a6c5b22dfa41bd070258d03c108","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAXxCRA9TVsSAnZWagAAQ1MP/17Evt3Zt0KJQyZl6Zv8\nwEmeqWHoukbzChfhue2RKAUy034rIUpGDgBfjPOgFPBxG7rs9wJgYDvetyXB\nepMllrbDIhNPEY+D9ZVCxGOPsqtIr1/7SkMfzCj0jq4VpX+yMQRBDPk9sZBP\nMZw78l/BvJSeX9Tx81BMA4YTlc+OBynIeeDWbMUNoovuAj4in3XsiZhMJm44\nrs8aKvsrJowcaMohb72KaONxYA+GUdDYvjrK9X6lS26QxXMEVCx6tZHi3CpK\nvPLQ2IHTHZrK3nGfd798jaB8eWzjPhCwXP12WZhfwGr6428ZghDIY38Q5lQ7\n2v+Sv5atidLaR3KYnV+PlSIQb0EawqkqKmw0zNmOD9iZLOX39cdguKlHNniZ\nERydYaw7GpVfPqaKnbDtU64BRAPk6Ao+kkF5Ds9g7AR5tfjBNzwk5HtHZjGo\nh88/pVa1aV7LlP8vW9QJUphpFL0Dfh5jabq6E7Ke6ODjDPvsOBEg42hgj2pX\n3hh55s9O7f9uAuye/YlO6CBpNwUAPpZjqtjAljMVchzKZAO9r5TyCrHKxROD\ntY2ME4EvUjiaXBY2TgrrCQO90BaUVLfHJNKO8hMYj6a5RebexxlrVkBJeCcR\nVl63mqfw4kO7oYwU1bkRlj4XyXct3pLJRUxy7c7d8X0h6YrRyuEZvvrd1/26\n2eHH\r\n=910e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICxK3bwDgnSa5a9OXfLOuWpHRei0PL1jXmnNbpZjmnuaAiBygxDbrhEIL7PDLgzsnAAK3mB/79X+w8QYFhxKUE3FzQ=="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0_1604322800945_0.9447455187474694"},"_hasShrinkwrap":false},"6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0","gitHead":"51cf808664023dc74d9a4a6fe0aa02332969bde7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-vjh9FIG48R/nwJa4rtOuosKvo/iIFqu5XxSyTcRO096TYYiGozzegbSAmPlKRR0faYs97iB0/RfbEK0niZa4bA==","shasum":"39237ba5a8126ba45c5496b056959fcf5977d39b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0.tgz","fileCount":39,"unpackedSize":225049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAYUCRA9TVsSAnZWagAAErQP/A5Ol7uKrVAv+1ZHWwip\nFOTNyLycGvVxp6eGIm+wxnI7gSwHjknF2/GN0FVMId9v/5neGC2bljAVrY1U\nZf/lG/OINJ2oFazdvS4LsvgNxZoThrMfxi/XwCBs3RNGOYjRvtKWsjC6HUPw\nHcB7uAXePxJIpyjwbYz26rxa4XgaKtfJFP8TM69R5txeX3OzIYRedsdLVYWk\n+UbVobcJDIT5wLeJDQ7ezyLxKCeMxHkh3IMu1WlasJn9Nh4kiHELyqUyWNyj\nfsHSoqrJHfuMe4GnEf7JmujB5SW/kzERp7oVdcdHLeWPm/8jQO8p1l5B91xH\nyK01PCZhaX0CvH9QKzjAUKCaCF2zLRlIqBTcwrDlikMrHkAKgDvOcbMe59c4\njs+ySu0YlYTs3UuVAV//P8spZ87mtKtw1OsZJh776sf8j6+V0dNMkUYVADjh\nloi2MVg21q7agkIxHLq5HIsPzbSscrNwVMOXXATlR+ltE/O6vsOaLUv0XSwQ\n8HQ9FTSQ2gGFlYjruoXMbcwzWmVoeVpFo4d9wYa6Y9fcHzQ3JlNs27nwpm3U\nba6hC4eLio2gdahvUT6chQWTpnEWkQuJc6wYVFXUBDuHFiURXn+uQ3M8vPPu\nyPnDvBrqd6fLVrohvsas+l5jcG72g78DdwxynSWMMB/VKAxGO+kb1Pn5Z5OW\nmrx2\r\n=QGA6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEw8uKTm+8gVyKfGPccAbu60WnFyWKuH61WfO+GHVYvtAiEAysYaIN7Ki634fiK1O12ong2sTA+j9m9aemup95Mu48w="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0_1604322836075_0.36614611582153933"},"_hasShrinkwrap":false},"6.3.4-51c776d225ed29299fee23880700508f6af65b14.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.2","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-51c776d225ed29299fee23880700508f6af65b14.0","gitHead":"51c776d225ed29299fee23880700508f6af65b14","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-51c776d225ed29299fee23880700508f6af65b14.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-g4e+hvOqe6i3g/OR6W6Bnj1mGOtcSBKl/6Fp+kt5RZvOXArj9dzVAERIgb+Ys771PLJGbOr8lvPgeBSTPjIe3g==","shasum":"6e5cda7881db67098d6556310d415b3e9b7065bd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-51c776d225ed29299fee23880700508f6af65b14.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoAY1CRA9TVsSAnZWagAA2lUP/1MNOM6QlcBYEJNJnjej\nG5XqKUZSDvfazT5ULB4I5Ep8ocz4Fcv2ycMibUJoPQt5wVcrOdFNLAiUbylG\n8bv6HfKHSqJgndAzWldJti3KLR962/wOtk7Mb+KnaBq3Wrhqrd7eWwBNP83M\nu3j9A855b8X4K5xENRf8KEtZa9axMSLI2ZDpWWkGD8nNTQdVe15XvSaFIoll\nLcvW4SAazRJvQxyQ8M0vdNOVgSvv/+Wm9MMPUe//U1yPkS0qrjxC2U7iS3qL\nANaq0L/l9+FfmpqQbpCwVWrNIpMixzHj/GS00jfJUNQFMafKrZR9IQxyZ9cD\nWWciCz/8mOrNg4bILyN8BtZGtq5DutvDGjVDTerUA9ygmiTrrGfvPCiM9cEF\nI+40L3PZbhgSne244Uo0vpxXDvHJwgK6rT8Up5sRVvyEx2TwcUAPcE3MPKd8\n888irmtqNA27e+gASov8R9aCOxLVIbKsLXg3nGdX6pJNnQT243gC54+BNVOl\n8p0tNI397m1t4D81pLkX4OaZ+A79YbYPnNPBoQSQsAoAkVhUNqhM254W8/vW\ny/BI8MMmnYrglRiASpn2572ErbMk15FOKiFa2RZlBm2AXDiNdkMVz166MlAu\nmH6wFU1O3FNCUD+0jj1r8RgbsEiqaCR6WHoL/lv/yG9jLcPJFOIKKhgAvKdt\nt9vc\r\n=0c1l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdLBmsNRjNdKhGBfW5XBR3CwwjH4fJm9icxxV8Nb9x0AIgUCDDLGOz7WOPZHvGfF4Z49dVIDW+4ZjctSNhT+dTH8k="}]},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-51c776d225ed29299fee23880700508f6af65b14.0_1604322868536_0.5964055499899639"},"_hasShrinkwrap":false},"6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0","gitHead":"34d4f48d0d64591534b2f1257618a8bda077d938","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kou86qXTvGoZ5nc+8epO1fgt6meoKRcsyv51zuDSsChMQlcocSj5VOAf9ycNulGJ4xsBKkU7iUSwHcfkKlqOPw==","shasum":"87d0e8eba4dcc3c8b9c6bf39305420c72c617908","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolacCRA9TVsSAnZWagAAxfwQAKLSo7CSbVqBxY2Qo2GO\nFhTx1TZJGwQCBdUriWupQJaiKHZEuUwXtSh/ZNo32K1At10wFIttm0IuydjI\nPkxoZHeRWzYsfJPQ+HScrViOkgEN7YreqMr5led0kkM4JKACT16Bm99yJrY3\nitFvPA6TmmDGzcJ/c7O+vhcLKgBlZl4A+kIwJs9m8gzrqj7RMBE9zkJoytnY\n11srTyaaUXv+8aTCpypzkJfDHMfJX7F9ZbGhT5qVjNmiyyUu6WoVIQ01KQ43\necsorhza2lZZnwthYZPK4vHwSwdI9wq4urvhMKSo0B2MUR/HEYbnpvZt5608\ncOqE7bV2zCAhKCW2FfK0uZTFGWU/dPw8KMybEbVy05GMw2ESLxdx+z/RlfR6\nUc0NTAldRlguMAwc3tWKfh+R1bobvjU2HDFfBHy7ho77IRV9prMl0L7NOf8A\nhaAXzYGW469AGArL4I2iwX9c3Vq6eqiG5MKxfBSi3En4RLcpsmli5m9JqviS\nSIx5DuM2W5JympdRPDiaJGOYp1roV+3+JOpMvBOMceIycdY6bldM9sDSism0\nxarBs2BwSUc6k4tHnqrMPhEoOkMk5HRN5uN2yM6YThlU6YPY78Uf3oy867xl\npSRz3r+43OBUTupNxPT7O9oTXR6BvQSUmyb62KLoRwZ/M6dC5+DOeHMVSKP9\nLVaA\r\n=xvVC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8zE+AIWiYHgQFfpT7Vf8kHSFcGL3Ipfv8LyG7X5unrAiAsGHjCqrjck0sAf0BjIkdEn7RmFoMsvdsRrfdRS3L5gA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0_1604474523264_0.017965849788432076"},"_hasShrinkwrap":false},"6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-cO4OQLbMKbK26iV7FREst2jDh7YWvxPyyNY09cgbN0+rcKk9/xuXWp0CUDjRBTSe310AGCoE7ZQeXN35yuS8hw==","shasum":"1289bee4d470689a5e043087b3e98bd6f1e0f9df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0.tgz","fileCount":39,"unpackedSize":225046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolatCRA9TVsSAnZWagAACskP/ihiDjevqQKJzCTFjzgi\n0ynSPMNgoppgu0H/Z6yPqdka+Gh1WMQePgRGlrmxTNRTpi/kCpKemyKzRmdF\n4Gycsh/rEHO4GLjzHXcgot6db9PU0xDKgjOqlPJmfEL5ltl+h1RqUfKe1pNS\nxtiFOFhoWi+7dh5FNrUdXtDYSCcJ89VxDl5RIrqrwo1b2ZtXrzb/GdWVupuB\nW+gbraX1BIY2rnYqQwDdZhBmPgz7nIdroumxE4AdeEQeCZ5Y2wYfcSKN/PXe\nTM9OkJxjhbMhxxsvFa1yEHm4cG3coDKvmRXPaDRQzhE3dgiJL6X7xi1GjYpF\nMeHqcsG0kd5YPSvuYxF/ptrcE+89PBP2msJOd9l78J4RHYW61wMN6a4iseWN\npqgDzK67umhAN8e5Yj3In1m7OmLME7Bc1/NpOYSXj3V6lNIinmsLMPSbCFXo\nuFbIsEnR+/rRyrCnxBgYe0HH+b1BxxHFHHsXgREwKtXOuvjh713HEB4em9CJ\n7OX6ktQ0N7KjH86rm3HZt3IBMikcr6eJhJRgkiQjjQC1SY/HRQcXis1BZf+K\nB9Wbj3UN3qnXLOIPTnMfWn6Xn7U+RL1UFguuDcZwcjmQnS3rBQGrfBidXeyb\n9Z5ABv/ny3yuOrMQgB6KQI/gXGm07QX7X3xSsvMrLV4bSROegYaxGl+EkfiJ\nmVHc\r\n=n7ZZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqB4aQJpBDqoXt/3aKt1Pcc8eRPThe1BYxEQu+En3+zAIhAIcPvSdv/iuL/obff92XLevm5UjxjKCzTRNQOKTfHrOp"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0_1604474540925_0.4922339583664743"},"_hasShrinkwrap":false},"6.3.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.4","gitHead":"a9f58eda568255a4319c63c42da32ffa2f4378fb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.4","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3gWzE/AVHv76Dh30PngQiDBsjIS5KvIBqKoEaspv+/XMFknRUtHLxwnOaDFVklGrakDRn0KLfPZapO2GNr21JQ==","shasum":"597aea4062ee6dcc25d8d874a2e676aace69e24a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.4.tgz","fileCount":39,"unpackedSize":225275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfola9CRA9TVsSAnZWagAAGesP/31MK/OyoSF/N2qJtxVM\nx0YBhL/AA1FP2NUEU1bHzYDhqZCEry2NZZpoFFJ9qy96q7Hx5gtLm5f0KaqG\nLsB7F+Tjdb0lpxBOBSimeSgPXrpcQ4x3u+hTFNY9MxQGhypTzjdcIqwd2dHv\nbJPK/vwI4cNhsvo/m0APR8hoIZu/1vih8lT5Vs/JShWJlyh5g0jWjJniZPwS\n6d89a9BgXlDyzrTspbdRxsOh8xNE/6eUNng9OcTpw0Ghw8KPfwdK4JALHGOl\nvD6fZg/P8FcP/68gIlRcxiYdNlkRpwhW8wYgF8GTZAPLYrRxr9qOiQ6pecnK\nIWpeG5yIf5gChKHfK2AVCj94iRNbswzaSF+hG98IVzoPjEyy2Ooo21QG5GPD\nGSrsswrP2hibg9pSJ2Y2p9r+iG+mZKLnMuT5zu0AmQGIfSQLPvaVCJOzl1DY\n4S8jaW2dlqDoa2/F0izF17MHNK9D3GpwhVGMoKbQuO7DcgXgNEOXJlydYcKY\nDfY3e6ir9//IFx6HFSqPrfkcUkj/UOhALRXotW3eDU83aAI4hhlO5zhXruEE\nbeJ2m7zcnh60AgrrZC7He7eDQ5eeGi4/og+xMJZViQYp33+FItTOO+13i9XW\nxPj3FZBBwCoJvKB/vd/neSNY4SII0KW1B2t66g78CbuCCw9xHwghhYATeAkg\nlM/i\r\n=OWNT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfrBhBQITSLUfNRMiy6boIRXZGeiiKCy55iUns+VTtTQIgHmBpxOzhvmz3n2AaM2+YP2RfQNWpu1PsmUue81oqhEI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.4_1604474556568_0.2398301339206086"},"_hasShrinkwrap":false},"6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a9f58eda568255a4319c63c42da32ffa2f4378fb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-fk8AlBBPCCNGTQ2AHcvpzxeRlWgWgtM7pEmGLIiUc9d2Da7EkTUN+WTxKapAVkdi+riLwboxyqy3I0N4n5tMjQ==","shasum":"17886030d428fe7a44310bc74d2594a8a0842b5e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolcfCRA9TVsSAnZWagAAWwoQAJ4BvjchQQZHy24yv0nq\nuCybTiOkfZyKqTZZ+l/x9kYpX7gGZZ56fdQS8f+JoggyAlAlC3aSz5DCTaEF\ndxU6cQ5YIwoI/7OV4St0j9ZJHTC6kBeDoLE5fuZ6jW5Wm9+XTGFSvFnZ5N7Y\n+HvbSHt7bNgMTlgHIr+hjf5G79QXGPq0AVkJK+qZiYbtgbEKmwvTGfUMTfiL\nK1SijNk4B14oGO8un6IKH4z242iAHpm/7uv78Jq/KambbJhZQMMwg+2YXlfn\n00ILa2DVVPSMzPg5E6sDfJ9zAu2bSqEO9aKJkgDtVdUywOKDXb/aNa0tyDas\n+Qkefl9PdSTJeePzcWSrXj+3BjzK7Yu1hp6PLKB7FWjtyaZcCGvAUOafji8j\nFV2JklENi5QB6+PesEeNKzXaJZKNncUfF/q0Tus+Kbo7OItkifc2OITSAskr\nH9tZslCvZUeVDUHfEeR2QL7sWkrYplwpZwQ7tawk/P+jvbCAP52ePq6Y62A/\nwfW7r9Yori5ChLVh04cHDj8NxZNNi3PX3I6Um9pkJuLiE6daAT6thJfbkzB7\ndRZBDy183IUz4mqrgcTpguJP6/r7pWUcEt/dhG/sozcQWkcNMRTArusJh+oQ\nvm2ivYH8VkHGCBA38z0/P83vMRW2dKSRDzgdC8eDLnfnicR7LfDzLT7gc3zR\nh/ML\r\n=rzPP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaHExnbj4tWAFR2GtVXZ8izWnO2Irp5VZ0yJSJ/rDfqAIgQvQTZ0c3vf/RU/pduEHu8kbmvyYO/OZCKy7FkFzEU4Q="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0_1604474654614_0.7975183091179869"},"_hasShrinkwrap":false},"6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0","gitHead":"3e056ecbf6c975237fbacd11f95cfa1e74cbeb56","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-00vkwkIJDA1ViqPuoUyTt2Aj6mfOHfYSaDUoAiGE6L0cpqLm7gvZZXxYmL4/4049PM4vCcURkbaQIZGa+PPdLQ==","shasum":"d52d327c6bc5fc43fe5b12db4071ab737a12d589","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolcuCRA9TVsSAnZWagAAeZsP/2+vm1CzNFRIR0P357/n\nbgbauniyWbP5P7bw7Xpb3832r38ijS5O6N3Ed3wkEUZBkfcRPn61wxH7jvtA\nNWSj93hxqWNzqIIygMHb60BiGJ5f810gEyxvJ1u+XifiVPwpeKd/iOyzrag8\nUmCbRXBXVHQaFkynGeTh16IvdWmBa6ThJxMIGZ+qDcv4dX6pSRrR1iQle4Od\n55CpIVjoGgpE78cBEoXGJEDU7V+1PJL/h6krDctWCRCkCugdrslua+rqNKEV\nimLQiqW8epyeIUFBXtqhn7hN7NYNRtyOyPBhEaG4tF3J8KNH5SemZg/5fiLK\niYQmmJMaXKl3hm0/qg4UzZLLIHDsgeQm6v9xOx7oezYvsrqOiQR5+Rf5yOfD\n8OYpTpIGy3G8YZkDos7fypcsYw/e0O6+xh/gWxDM2Zqw//NX2SLfwmvlGMTC\nJY25RgQcFE/UbdRiCGqNceh4+si69izPfCybKkAA01yhFe8YEKHOh6adscvQ\nGBLl6BQnvqES30xfbwIlhncwC4+bazmc8Sxa5Lf9QqK/fLdIjMCH1HPCtcX2\ngQVwth2hlUNgadSatAWB2EcO91J1wH7dbdVvTmQ0eaev+Fbrv0A6j3tjc6bp\n9FJmBE1iNQu4BcDDPEyDsuYbRPINluVsSOavIilKBwB0wLl4XKJsG5fEdGys\nSRVv\r\n=tGBJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd/2Ory6kLacCYL4KHfw8mJWin3mEC6RSN23EVMtS9+AIhAM+rCDFk+OPVd3yJL2+RKF+CkbuEf9DmYeSj6Dcbz/Mx"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0_1604474670199_0.1957263794288051"},"_hasShrinkwrap":false},"6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0","gitHead":"f115bc699f01b0cb22bde831b75d2a37aa2b1e64","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bY9/o1lFUzqXEDQItHk6wF9x6TS+0KWcfRWggHzQMoBVsY4Mfk5moqIt+xScfyP9seo10gb95zr7hmQ4dPWMaw==","shasum":"9a9a4d7fac4ee9c5fccc69fe60b7431fb77599cc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoldGCRA9TVsSAnZWagAAp1kQAI9UW/GheDqshhQXAmae\nn3x408fP/QoWQ4Cw8ZVUlh/B8RU0aXqtuRXoaNi1qLWKSBFRj9VV/Ckfl5Bx\nA9cCIA5U+bNH/loaWdCfDJgjd++AuM+JE3OLtlSyiLgC2q/Q+frFhxpuEPtU\n1Bx3sFur4luSuuZHfT6UIzXDqtNgHkNXNITtwcwlOtAyDPRT6K2nkSwhsTKb\nszNHEYjsONLk4+/cvh88usSHrR3Q0C47zQEDXjCd+RFdhs5qQ8LbFVsozGCG\n/DDqqI14dSd+0CvYmwgsE/SsTkkkm8FPknNpn/3TjIWHN/ZxYr+Aum0Vjj4y\nwHofWAJMf+bVTZnVjXoP9IKOutliq7H5/4IHX7KFWH+9pRccOgeK12XlxILC\nwihrXClajWcT2e3g5v3utB9hOoDmVhvpV1XPJHAzHQd1GcOqTbP4RbEvNEdJ\nqc/yPQs6b2GbCfoNIQ+z6ctPP8JgwJdctHrITfhDhUh60SYrbWpJQy5GwqoF\nDh3ZaYHGvVl3H7Hs8V6yOH755opwG2AXdn8Vohp9kazpS3hUbP2KTK6vHOcG\nRi08oHPLHUZkCcorHNbFnhEGWeLJqs++tCe4QpyejrlHn6cQsM/RmRSxxwPY\nvxY8QgimGvJ9kpa/k1Y6VSJbjnQdo3bP08wzkDqfxLgoxBejGYi16oQteSzN\n1481\r\n=UcYC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR377MEqsrsqaoFeZ0xa0kXI6thWxgx6nME4yGTPTn8wIhAKLXcCJ8jW5BNIp8Bon0qqH4WcwuI6iFyCZABTeHZCZL"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0_1604474694110_0.28478943065139517"},"_hasShrinkwrap":false},"6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0","gitHead":"cd429b29a38a391a19d4388afb96ba3176f44714","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-PVNk2nyWs7RW19on+CnD+GdVkfLZAIkOjF95LrObVbE6FRSpt2IXGFvuDLH5X4QCkBY66b9l1faA+cyzUVcYZg==","shasum":"6dd262af878461d3e90899904b18f3ea96a085b7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfold+CRA9TVsSAnZWagAA/8QQAJYrT8KcPxk6iyUcF+69\nb1dWS2bEmH5wf8dCymr8CKGOWWwwrRG1gT3lEgpO06RFZJFZOQPomeqo+rED\nbTvqCfRJ0h0eeAgsprBzqtNRQ3WIMIpOlSgF9rMCvI59O5EE23LEYR1DK93/\nQETerSk+LLpkA4OA1IE3BLkp4jKdioQKIb1dQF2d/2xwR0pKcs1gR+gahgjc\nw7aIkkUMlOzOrJbOWyNRWVVox+fBSVosYduhvzGsR9R/uVZd+3CyZqWt9U7q\n9Nh3zgTDIjVSgO7+lBBnZ9/8lKrWDeJA+3w9u7TZ1V06/IJ36f6bkfKxqU9d\nRc73E6sCUBiSXqp5qSOa+5O3aNpQpo5rVcX690qv0ia4IN1Xa+/GOJUjZ8iD\nPhSfiiG4mZEr0S89druhYMiU7ZkSR+3HeIrlk26m2mhVRdd+Frc2tcPAZNZF\nVfic1CiL3F+QKIzTK+zW2v8+Jyly8USuLwP51pZlQdVbPLsHtcuXb1jIeQd0\n+cAzsu/Z+IWDfBEd6gOaClSNyOCT/auXdhi8ncJupaB/aJO4DnHbWSQCt5O4\nS+GbEiaohn57O0FBsym3HJHZMd7j+b+vAt5qkIMxETeYu1mOhjidXuH6jYoU\nhXQDzFPeMupivfKzMJsUf6AxUkYxzL3RP0NuEqNUZwEG/X2cP3x/79xw63BR\nsCHI\r\n=2UeK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuHrek6DvjqyeaA5uSbAaTpkfMnJeYaQhwBKqM0KDycAiBL2Mn9fbGkiZxEsslP42LjxQlYbxQKlD4urNnLaaH5ig=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0_1604474749645_0.2526349398678631"},"_hasShrinkwrap":false},"6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0","gitHead":"ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yz4brUuSaDqs/ecCxVy7Umf416XCmy6nQv9czK589chf6yAxI9LIh/k48vsFu4DW35W8PMVQeRo3qlZK3lvxaw==","shasum":"f611e601a93769a19f83322a2f75aad2f6f7a0b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0.tgz","fileCount":39,"unpackedSize":225321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoleTCRA9TVsSAnZWagAAdGEQAIHv13PDfHWRvoBTPaNl\np7cs78KgAwtctzkaQBBHBsNMHfv3qnvgScdAYuHcId6LyejYa1Vh8tZ0D7zi\nodn9e5FrQclEOmplgirIuVcZCFntpatxlKClCsSuJTY/HQE2juzeA6cPFtsT\nlCtotEY/nrIuceU5xcvnIMQejxaDBqK3pt+5eNV+ephjwGjxxNQ6BVthtG/g\nqWzw/jWpmA70WLLoGkxvubC+8A34buxZEvuCZdPLp33wr3DxfUVlY3g1YEgJ\nAGhk46Jkou05yiG8wWwzviGvlme66rQzDEcn0/Bo5YKkh5duBoijohnpbufD\nU90QdNQ5IeKzEvnL5eHVeL+S9K1D2QEPldN582mZAmoRvL9c8+FiNbYJzNg/\nRhDcYj4Jm4WP/ArtlKqXMgr1lRPAmTW5VfJDusK+uu91676tDWE2lqBjGz/0\nwjy49ASdDhvfevw5FQC78vjfy8akVd5IflX8cUEOyNpDG63dj5UCWlGxw/hn\nQMwJNbGHWaWukICjLIcVvhYsX7K40j/iJpbwHMVOSq+8dzdnYaRA5SyRWYIe\nyW0L86jZPJ6gjH6w+a7qqicF8s0TJvvfPDl0SXs7eyWmjWhsbPK4FlDIRkOO\nM70QTUSieSEV1HJ2Y5VqrGHOtrM+BRscXYX3yt28z08L/jkgc2qJ9dSwyJ0X\niUbA\r\n=WoBY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0Afzxr5jz+8gvkxEnx2Q92g5HdEzoyGvPhd1tBEq85AIhAMict0BN3bqRAhYBtvayDHWsOpRGj2fY3ef6822ZAach"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0_1604474770842_0.8520786727898222"},"_hasShrinkwrap":false},"6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0","gitHead":"4ee427763c137df916dd2d04675f23a27ac7af48","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CZVEv52OATBOzcry3dqQMawk7CX+ZMS3mYSii3AjaqqEwBvgV4L2yIl1vf2vgZSeeKIBhcOQeI8GnKyXWc1PWQ==","shasum":"7cdaa2fbe91a6730f27c8c3c5a9991c5b526fe66","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpuhzCRA9TVsSAnZWagAAi2MQAIeY8FC9l+5F6NEIihgn\nza/4yK22Ft/Qi29SZKD5VT3CQ895b1VjQfHyCMPpeEG7MCl6ofC4UNup2Iu8\nz6Jdl33WE66DuLxhTQDiVhjUwma3ZseGSu93qjRZNkEZ9JjBpWpfWRS1Elex\nPrdAKT9b9TQYVlJ7lpmS5tA14q1zEZAXKWWndSCStbSA97eaDbVGCkDZo8fT\nrW+jwXRNmdCrGMC9J/iX6hNbVNWUuZt7Vbcotju5k89ZplBzRixFUODruxFF\n6pPhks6MfDUurzbBGal4YH5bRq5NdFYWufoR8JJwsS39c4R5aDgvYHpuMk+v\ncb2LMrnVSf2EfvNXgmuPhmjZAbq6DuEhTYiucs19neJDMJwxJ3+EbVchv4pt\nfE9mwTStKOfYHCFNxknXhUxwXnJZkbx901/uhlHvESjxX+fHMXmtO3KLRPLV\n5aNuRij5rCU51ySv1M9gdaQ1Ymktk8RodqFqCL5G3/O9gkJe1YSy2NP5AW3R\n8TSJWfxavxZmY/XebYKn36uCyNar1udnXMGC100MWkbyg1B4xvswVz0vInX/\nYBaJQ08zH8bYj6nChh+jfMkcKNG1ATgNhj8L4ZNbioAxXHNxba4E2AgDCHv1\nTTypZ3J2JhDPjmGbqtPbp1es1/jV1yRZhqmIbpkksgc61VrgrnfDJJXCDf7s\nbZM3\r\n=z1a5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWj64M5teDaa0GM0hZSaYIDNwbiYIiLYJ7KwqZ3POBHwIhAOOq855P9+jzIpnC1HOPUUlbXNKwd7OOMQJGyxAwMY/z"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0_1604774002827_0.1381765951662035"},"_hasShrinkwrap":false},"6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"04c978cebb00b2e0e8bf96d0039bf5b550352378","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-x9j79fO1ojN17qSLDVDXLkszsPciqHvqUWUiMVM4piLQDHyPCw08qfLS6NCHC77bo/6LDIRucT1WLeayYGbApA==","shasum":"f2b4c6c47c4c471b8a470eeb7e1cbbb3e71aaf39","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0.tgz","fileCount":39,"unpackedSize":225318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpujVCRA9TVsSAnZWagAADAUP/3WpcGmCDjYR+TY40B2Y\nzvmXqX5S5VKYPAgCqmCslYiP99/fv2EXnmWDDxJrHAwVgOG8Rdk8IaanAlqz\nX62YtrXiw4REX1qeMk2MlTPKkz19XXFhBRh5QBHFZvEXIsNLxYyXfcfqlArc\nQ5PulNt2JzM89YoRlBPMlePq37TrO4bGmQt1tKbgEVb6LxmnH9qXF3iGO3pV\nXLi9MtQf4ThLH+2QE/pFBPQGuCwPoY9cy7/jNDzl8wuUFOGI9Ag/HbI2Spuy\nJDgl0geHXJaAytRjn7bDcINN2aVqUHYwOCMVn6mKPg5yphok7zvC5EFPH5we\nf8OWuw71S8Hns9h6GOjJpy3EpV3HlAec+tsN89yG1vUA8aU5udgm1z0QrzRY\n0wCIxhJWeLCYovfrhXEvjxV9/ZOrhxWnX1qx0eKTcV2Waaktjr0VbjjQ7VaW\nXn0F0RaD6TaTNNtcI6TLYfhr0HYVM+Eblb3ooqQfYQG1BSIrv65Vd9fnG6PY\nsS7feLEIuPsnwmv+m3pKyQ94KrDx+rKdYurG6swXb8VPQjeXPjH5b+l2w3eZ\n1fYxORO7Hmz7Nzk5gaTk/Nyoh5KjMqiyVO1G5770miFEHsk9BLevu6B+9hfu\nyHarD2ZHZZQ1MUHerhLGQCzj8Ku5btcsxKN+lZQFNSrOZebqRzR+ns/KunOL\n/F8J\r\n=ca5g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIKFYl775lI+AmdHakA8f0LKmv8WCiHNDCyT+ZtU3wMgIhAMbqcsYOHiRIcHdNm7Z2TyaNlCYbFrToylRbos0auA4P"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0_1604774100604_0.09071860290779443"},"_hasShrinkwrap":false},"6.3.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.5","gitHead":"241e61f9345185371ddb24c885c1110df98ba2c9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.5","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-argkLNXAoSnVewWA4ZJaSWwEjCuhsUvT8Tn87omZSr3TnVQd6f8U9T3PyhS0jNLlJ7mnmaz3AxlbT08zcmRbMw==","shasum":"4c722bd255fbba596124fdc84ed7073f2d91e525","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.5.tgz","fileCount":39,"unpackedSize":225551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpujrCRA9TVsSAnZWagAAVeQQAITjyKqNgeoOIFuaWTSJ\ni5B5qw2qjlpyYhSloUfzrgyEiCfAS2ataznwP5apeh0pLl+SY7wyPFJiXu3c\nx26E9aE5yfVi7RyAf2XSlF+VaiIoSP2eFdkiC0i7WWh03MpfJG+rBHH+s2IO\nknK0ZDoc2gWUjqhavyaeHBroOouMmWmsdRO6u+XCitB+E6/PCco6RMgLyv8q\neLjQcIrMjJuEe5L5xmGeuZI6xBBZG/FI6EuWLDn1Jg+/3e7Jf2SaiH/lpaXS\nnBro7KnHjnfS9oHvuV3brH9Ur/5I3uuOiKpkLjWzBe1OdootuqKXJKbU+8oT\nwJkmpDB2xdjgZYkpDaPJKf04+dwkqebPPXVtRgDsts4IaVp1zWeLvbkLq/gA\nSBdIaqc2t3bayBbwJ0ZR8ya+WfZ+V/XIjtfeOYiu3xW0bqpy+ic9oiP65Zdi\njFwwmiqPEfWii33Pe0UvMrXWtf800LCDlHUzSWCwg4Mvx2Ha1C7ucihJkDYn\nODe8aSuxGgb75cRzEjFlHoZRtKDWJfiRF3TgcWJiRTG5rps+puDJmUHJOAk4\nEttgyEoVt2wFJSGaX47IgllpbN/FJH1GGkw3Q2hY2J8EmT2UeGgmxIBZt4nx\nKmbD0Bru10LqzZ/aEANWj2utLMltPfadOSSr+/1ylBGZDgAl6txNREBiG5go\nGQ85\r\n=BSpK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxggxpVurLS3cp7ZXigSX0OzN4Y3nQ3dGp+2Bl421nNAiA3dl3cgdQsNJDb7Ucm+5gpo3kb3mP03GuxmF7jUs1X/w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.5_1604774122877_0.1562527882399074"},"_hasShrinkwrap":false},"6.3.6-c87297a68f27633a892229c64837d121d914d105.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-c87297a68f27633a892229c64837d121d914d105.0","gitHead":"c87297a68f27633a892229c64837d121d914d105","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-c87297a68f27633a892229c64837d121d914d105.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-v6g4KF0kMYfBiNtO7O1xiy2XEKsrtORVFlKlthz74C8TUqyZhbDkoRMcGRXF80qSwA6PMPJSR4zi7zCgyjYrLQ==","shasum":"c0537876bef43687711173a428f1f2d267dd3a83","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-c87297a68f27633a892229c64837d121d914d105.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpukGCRA9TVsSAnZWagAAxmEP/36x9vhFjRqoZMZCmIYq\nmsUkuk+8ni5b+LwO2oStZI+tNGtLTjz6WOBTMGKK4AKWF7KW3WyA7HluHbx4\nFqVta6hk8ZgfOvKz6MGtmaqw5PkFp548DFulfLW1hEbOabo6H/NxDPv9hi5l\nr72YiSWVfXLFZ9dcfiG4JuMolAafV5UulbfCzony2GILIjAIBGITsKdJBvq1\nXZg4qwNwzjLvWWgAKsAniGcqhwdFasPcmbp+grdOTXFRx/ynxw323NJfiT2Q\nYAuACKbK1zwuDca0OVhqq+SYsK5o3gpLkiPbB2Yt2o0gQqH3zN8WLZ1O2M5q\nW9nGiNDhbE7yqo+spLrJk1d9EglkVd9EaO79UvsLW9hSV/BZ8TVURpON92uH\nR26O6oEb9MxNElK9hn575A5CQVQHBQCbjoGVfhwKFA4PGNPdxE0lBnBHR+WL\nyeWWIkhT70ajM46ochxpbMBNOgrdob8++gh97UXseTEkaaoNWkqj9ICB8mLU\nOA62v0gQGRQDwPYNV8Z5RqdU/efaBlh3cPJ889m5A+6vUCDEoqz8WdfEjSXV\n7zUzsdOIQ5upM3KJwNZjCFX+XioBmSl66hZG/X+mHHOUMP7DNOb8AUd6xMbR\nPySTBTwGfPGmDl99RI2yEz5oZSYzbiBoUVzXNB1qgbByQQdlrISsGGgZHwrp\neN3o\r\n=gR1S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhD6LrqX37vgSxAm+47YLvombSyBYnh5d1no9sw06MSAiAFBupsmp0ByynteazJZDcww+Qp44gL9tP5xUVnau2Cug=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-c87297a68f27633a892229c64837d121d914d105.0_1604774149392_0.9842014947573907"},"_hasShrinkwrap":false},"6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"241e61f9345185371ddb24c885c1110df98ba2c9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7efpQcm5jWMfbmpCi3MiJcOIeJmfPfNhw+59e4bE0qRiHlXLq0asKpt8VZIloHPJi70eVP0N9endfdbdMRO+dg==","shasum":"8266f6d0e4f116789eba8f769109038ad38a4b9a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpukeCRA9TVsSAnZWagAAZEEP/jEhFzgwam2qMAsuNmiK\nc0b6qg38EXYd3PcubJ0xryELE4SZh6mF7YbZBBixXx+7buBDiJ9PqR7GsPfN\nwm3ORhBb+Mxz/kMFHEUzX0zgw5ntTWrkzgOos8L/DTHNN1RKihFsYWaKGdaF\nnPpxHjuhk1JNCdiaa/ZO4yVgw8Q36akbVrT8uM4UESFGdysoVbRLqBdL3I+l\nLVy7su7d7NVafADU/AIIDUYdDMquW3rWNuTud9VH/b+uuA2iHc9Nw2/yPX/1\nrnRqQ6pl5WGn+IwkFsVWBqq6mfaxhr0nugXLu5XNoARdYdBZdvNzozqO9NN0\n805jZb4Dm1Eo6Rl+2QF3L9mqabBRTNoelT5HsAWoNpTDx2CdumbFTp4p10GR\naaZ+l9Hzkb0KCjCKRv6J4dxH5d984FRduSXQ6SfAQFnOA9g2ujgPuaLTG6Qn\nOvKS+QOQYpIj9rrljQcC5cpSbtJMd2QdyOQ+aM/PI0myx33+5DPlIGGKtUjy\nop2SYc4fCbtYuwwjge3U2i48pD+0oSm0nCPQBckKDsaLnm3GAEDMPWfvRoC1\nRILpAxB+RH4aPwHxHh0GBsEKYjrPdHG7uxVugdBhvMOxme/7lUA5sJyHsL5J\ncG9VQBbZH1F29zhJqQp9HP5PDKpqBXk7ngQPVTgLhHevD9jRnk3TfdQ7ZvmS\nFtAm\r\n=CkrJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0idcs3I1tSVlRtu5ZEOHmqH09Pk3WhKxxoDCIEyWziwIhANRGqOm1etv5axdxNYj2gW+fZ8WVQSCQhR/NgHFfdk3N"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0_1604774173847_0.18449435916436774"},"_hasShrinkwrap":false},"6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0","gitHead":"8cde942c72fa0b43b529ea6bbe91387149bf1a4f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-u3yrokeO+eXmhbl7ViCjEDddwjUDY74g5MJ5w52EhiJprDWzn6hEzr96KD6tcfZvjIa6+1hi6QPxUJj7uzVXMA==","shasum":"5a8c593d7fe6a32ab557aae48b1c7996f7bc916e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpukzCRA9TVsSAnZWagAAckEP/il7t1tBxOzT2X1LZ8zt\nKXl4YL+tG5IKvIYhda7FqYKo7ZIRWtRmrhi46DN3Qy8b0XMgWh8aBJfe3YzE\nr2AyKMI1PKXogm3Y0ODqAdzlMmeAOYCdp2y93eGmFLrWKyt8XsKzqEUe0pdo\n5JpiPYeIBqhJ6DaCIU+SKVyaKP/wS7ap+m2zmk7Ac8I2g4Ua+/0L8qWZ3zF0\nZPRLYZJiG3Lcev3+Ni0+rQiSsI+wWUQZAAyalL5PM8wfbS3tfaq73Jy0Xhi+\nxUoFOzl3e1ttQ6Ucm78wMdzXIih+xVFJWg0yg7+hgbu+vQJBLOvBniaTzFJB\nzr96JXR8ZooPW8ZbmnC4K4ZaR7gZZPNZINxuO/qAtw93NI6XkeLxpaznnHVb\n8700/3ZzdMBMBWcGY+BJ+h6cr1UOmpt0c3nw08K8d/w62VYledWXruwawJ5E\n1ZEMHERRCP62YvZ9/oY5xo78JzMzs4GtGSsrKGp1PCCdgk549M+lmY83ImTg\nF8v4JVq8sbmDfQDpV/0CC9nOtaXcdRf/eC6MRot5UB+nDTHmL/K7SOgfJslw\nRDJmhlGJXl1ccU9W+j30cMGPEuLUzXagdQByY/s+4ionr9auenpb09rBCeyw\nGCBOAfggOVzANzOL5HSsiHuquMayN4mscEtVisxF5/aupfnmVsV8YJLWmXds\nAz4r\r\n=OwUv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF95Q2TNYwnPf8dDJuTKwNsDtn+NjAM0+HQB9ebIukVlAiEA/Ayh0g3JnB26Y2H20omdUxba+OO55GVha0BL2ilhPm8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0_1604774194479_0.22053814364961544"},"_hasShrinkwrap":false},"6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0","gitHead":"fe64c858b901719feebbed1c90f12286fd86f731","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ud7riR4YfM3XLaVmRb1YGVwfnP7IRimDn36n4oXOykwali3Zpna5Vt12oZB1Sdb1BFdFqafIPkQSxmRi/81KXQ==","shasum":"eb51a4d3f126b48559e67478afe927d8f5c55815","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0.tgz","fileCount":39,"unpackedSize":225597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpulKCRA9TVsSAnZWagAAJ0wP/2s1CYiSmzD+yBNp4epT\nQQd+NZthRQB/4ztI+k22v9Ek97Oh7MieK3zucyEpHKmgrvFrzEg7xLWFFSLg\nmAyRIClPtPVxNFwNa4v8PlsrF8+9fySKgIZ6s3reorfkOPqFPF1qMiInbRsb\n+kVUxScrhBSxq3VQeK8fEsytyQPMsG/4GdJKhRTGol+CA8ZLnsdh9Lxltki0\nK75Phpi4l9NUkixLgP5FUgwuOccE2mONXQy6AxKPi7A24Ld2aOcWqx39thzN\nAOEJkD+Xt5qTXzGrRffvR8m3nrLJGRquUSG/x5W3qFHQXuHZJL2HaekzERn7\nP14fk9kLYsTNm2rVszeFwjnZs4JWyO7h7F+KZC3rBT2ul9VqA+p0sh5+nts4\nevELr1UPushqQwn9UNwSbgyStJE9xtRXdjS8SZD+lWczo4tM1NT3XyvkkltP\nIKKJfmCwgQn6xZK9HuKk2YFOXnE/hsHRt4x09EdHNsDQzcyBZtWSH6qtD5Q7\np2fiXKvMD3/2PJzLgkOuybqAMiXBcnmMlNQACzEKUD6LgSucqHRyYMAQ7TCF\n4HIwONwfQQaF7uX+rojn4Mst+vH7SMy0fxuospeslzBJKToXK9Iseecf6rIc\n0OfrTchOgILKI1DT0MY1M4lA7end7UtubEBwtWqOFxN24Lxg1cmdGsCtq8lJ\n0Z+c\r\n=WyaH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGhoR+ymS+XSSDi5XdJ1MahPNSj/zjBdHxqc0zFYKY1OAiEAmT2UHwWD1Zg9OaPrGmFO0neFgn3j0b+s1d3CtZEGeKM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0_1604774217956_0.936416764243732"},"_hasShrinkwrap":false},"6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0","gitHead":"72a149e190d22a8777eaab4535a66f23231c0aee","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-A0q6xbnhNjHzfysuMtWEsikBewYcDBj6sucU6Qt1heD+WAPxiGdMQlPNSDVCGuNcB+Zrfe+j/B6T6GczmF6d4g==","shasum":"bcc92c70d791e1a46e36a254f7ae519ed22abfcd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpuldCRA9TVsSAnZWagAAYToP/RDX3hDy+QRuKZWhH88p\nxal+A67lQT8MLVxDpeesHifRx9A4otcmzE2CC8lzKhhFpS7fZwVF1WmIl27g\nv4J9AC/OMarx3+iyss9fBSAcjkdygauKCLND8xKEW7ePRbO5Bc3m8LCwzPXo\nkgHDwpl1Pqsgh2aOEn48LqJIaE36eAxu3cOkh4VKPKBA1U6F5PU03WrVrIXR\nfkcp58B9j6NSykCMRxyFW15zMY3V4KjvHDrtVtozBSlzwi/ExrQIzEPwdTrs\nSLKOFI/1vza+Udt3bTXHHKA9ylJ6YcTVkby/8RLgOjCdL7918ppcd8mDEZ4G\nhPFgkNpv1SUIIXl3BPwYIWJQVylLE0UXiaXX5KwY5Ut/U4Grki/835HOnkct\nmniGOWaQ58R6hcawAP4bVJ+mB1H04jxvCkFpa4QVbWCVZMUbncqFg3OVbE26\nySbEc9KBxgCgTbtUhXC7NCPEduMM0mKSKwdICvfL/8kXvqGO+11pYJN4Mhk6\n2nDp3mCfM+XiT9oqOjq60q7SRggS+JGzXeQidkWTCcvo5fGRpSoDqc7PL64W\nCQpl+qS/lh5vLiNsVPgYO2OfwB0DacnwICUKFEpraeWfDTz4ixUvzgprvSPO\nZ+7ymoPNvt7h0jP8m3bb4mxK4y2nWj7FDVR/+3jBEHfrCUxp2rwkPuc41eN2\nuo5H\r\n=aEpN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFRLeiH747xGRcgKnDITF5bKO2Cem+hCZxEjshxb6mDAiBOq6Y5lvaG2ksJDwE1BOal454I5myLRwmfvOVi4/l6vw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0_1604774237274_0.029306948494506102"},"_hasShrinkwrap":false},"6.3.6-31b9f3f350f265804950621594054756ab5dae74.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-31b9f3f350f265804950621594054756ab5dae74.0","gitHead":"31b9f3f350f265804950621594054756ab5dae74","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-31b9f3f350f265804950621594054756ab5dae74.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-o4Y1pKksyuIGiGdA0nAXOUejSBoZn5PF5YH7pg1wqWDLALj4yYcWqgAVJSUmNAxjxSmXWJM3+eUnEs3ydy+EhA==","shasum":"fc79c62f58e97eec1ab93b10a503213298c7341f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-31b9f3f350f265804950621594054756ab5dae74.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqA/ACRA9TVsSAnZWagAAprQP/Rp+IlD86HczhMk4TV/4\nr9V4FWDxsGmk7bpOB/uZxCA+LNenarOxMOx/32v574vPs9tt8e1qnQmy0UK5\nvhK0w6PQAa75MvYXGVpkGMuEEi0hq3CUEOQ50/emHZlHfe8CPD2N5LG/oEoE\nAyccgM1ZaQ7euCTnlNqDL7ppnFDHDIhdCSyl3u1Q6AEhINLZF0ks9MPVhz6o\nLmx2NUg96NewAnZbo9GIRFx8qC3C+sIAy6eBS+G3YLwqZ40fd/xqt1yvJE4+\nfTQc0W/V2WzRotLuMsYvahOA/TWzaL+Bw5X1Vtxsq5d04ZfZSvlUeH3J50/F\nuK10dPa7YPKcQ/jFPVhv3B2bys4c1QlFY2SbUqlT6yPl9wg4yc6i4HO6fyNF\n8CJzzBJ0/lTMBGcaPH4vc5k/MOiLRUCY02zKl4YQdl/aAlZ53jJju6Zw2z1G\ns8c2oHcJ/22eouHxhhUyw8TKe3XD2nq+x9wp5oERSvFjzirjesUCshdIP05e\nSWKulrYcWUM7zn3X52UzJM6rr109rTWXmouCU/Yc7rvnFw0Eib4VeFu/GvGr\nlnRIpnK/AGD9ZnmqldQV6k8N7BaZpomkgcxAGEh0ntB0mtBLUB4Kod1vqPD+\nE10PNww+1/CotHGWwX93zV7kH17tx68gLmCZ734x6k0xnzaq5uzUhlOZQPAw\nVPmu\r\n=jgV6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClhjOdZpz+u2vN4pYDCP1wMrf9WDAZ21Ix+0/As3D05AIgEu9ffokSuToT0p2i43pKqN2q1WE6E37RR09im+9oUW8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-31b9f3f350f265804950621594054756ab5dae74.0_1604849599555_0.48516058776280047"},"_hasShrinkwrap":false},"6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"146fddaaa8aa168f522e2c2647e4201827a1a0da","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ufBKOsZOjOjWuvnZPw5un3YS9L+wM5FII/5f8XNY+JeFbvkvfU8LSSwNji/60LJ4I138HhDcEUVODFhbZFC6zg==","shasum":"1115c47215e369bb4802242c585c47c0b66ab94a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0.tgz","fileCount":39,"unpackedSize":225594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBAcCRA9TVsSAnZWagAAEAUP/RJwvBHKkoPSATWD8qB9\n6/zt42oKb/0dLIwiNzKS5w23+yl1d9NkRSKP8gu4m3AhOrqH6UZi5/aMhMym\nXAsBZiurZRzKZeQBEL5kFk3CP7PU2YkSeH2pzMMuWCckuFhNtn+xBudAxo4D\n7PbOvpAuiHq25CJZr/t4rc96sVn1nFfgD1vcSfj1d8IPIMXu7tCMbInHHKs5\n0u4rfc4MgN8+53WCsgs2WAdKIORqiLaSBYLt09dUMb/+zGJJjy7RDfjwavpd\nD/bXfYtGYOSxy5aB7wWdkNdZ0ZruGEsgz8eC/h09vkVsXCwhZ0F3B88g4/52\nU5d789ur4ec3rlrZdw5G3eVMBstT5ZYFvYs1U/3X9XbYZNnmHWiH1Yf5EL7r\nGPrd9qidaQFIIsMzWRyS/6xBWRxjEAklAVU7XJRiRRzRoACFP+tmMoA8Kakv\na1GGOUNpbxAdb4sbhidEDOicmThLssmizzB8+ym0rFHoPmahb31xx0+wVyJ7\n8vtIOsrUOcoGE/yWo5Us8Mlj+nCmy4tphg8f6c1fmlxXCsJ8WQyOLMOjj2Te\nvvLHD5F84BJwpX4rOhk3K/8lWqN9N0BWrMBCcOtZwe8m0YTlHwLEwxA3WwGJ\nv0WvIoC92NbXVtq9qCkTvmTfBbb166CTYDJQVUeQ3kITDUZHNv9YdfykQGQd\nn8pA\r\n=iPiE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC59hT4udgA00/AC5Q6sjhMnn5PMz79Q2Gm1leKELP66wIgJOqy5bvDxdRQ7Ik3dIsK0gXb9cmcb92SUdzFL0fXBXw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0_1604849691771_0.06412420299945065"},"_hasShrinkwrap":false},"6.3.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.6","gitHead":"cd0335ed48eda2f6078b231432e5858a2596c27f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.6","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-I01XlcrVADlzErZGbPjaOe6qLWbEV1uzhyafPmS0BFwMR7xElgdOyyJTNi0hO3uwPXXeSbEtQ0qhITKjJhQWbA==","shasum":"d0fe134062c8a4a824f21b42be7acfba69260268","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.6.tgz","fileCount":39,"unpackedSize":225826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBAxCRA9TVsSAnZWagAAoOkP/05FhabOeezO2zO0uRvL\nVGYZK1tiOzyZYR9Wck1XEpQT++z7Cp0AJItv9gyyTijO8zQ3ok2I4y6QDfln\n2tJThIv2Qv5s/SJYFBPtfF/usQtWamwc/lyP02YwVn5Ozu1tW7qZuMbS5B+b\nFcvtxG3z2ynC3Jh6J887v4v51CYu+V15zlWEp+aqLvpQf3T49AwnaBtDCn1v\n/QMvR3ZSv/hfzy5KGnZAhCjPmjNB380PTKTEwTsqyDRQ0VDLZ2qQ7BE0xHCe\nJuufzV4Tlr2H8NeoPS5Hy4bNVMiYzp2m9XlrLMHIjRAgccuHzDt2Nd78U2wu\nBl8j4MgSoJK1JohTW3GwNW80+GFXoX5CT9E7rNAPYYhbxGmwRie/01MyjHaI\n2kRClmrXDvHQNBtJCq2R8d5AAFiafJM5zxgS4p6ZCiWgjbxVuD3urF+2WWpJ\nrrl4Rt7B9hcx2YjoRg6MGXMS2JitwZuLbIZMqYTYDt2cPzyqnT6ZhYKiV6Wa\nk/DP7Q2yckNVOT6NUMPwq5/EVpnAtAEgOX85Pg682K9x03z2gErA40LbUM1z\nWuunp+YmjirfWfQHpmumxUeOTxdjOhvF38uogAt920VPn85HxqFHJximHVNN\n+JRocSCkVReCCmf1/7H6MQLJjQtoW1TwnHu8ulgKqABpVr1nClvOR9izRubi\npcWK\r\n=aPDF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERM8SyabaQBiI+AJdPicUfRBwJs+lZMrYHsCgNYlLp0AiEAm2JLIuUPX1dCN+v1MofMRJth83oj1JkaLLZ8YQRDVcY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.6_1604849712653_0.05909695875095755"},"_hasShrinkwrap":false},"6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cd0335ed48eda2f6078b231432e5858a2596c27f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IezkoozuEuMZ2JlM+jgcy1hLBGV0O3M7B4unGHVIxwioxn2sxcwBCNmSaKMYn26v8k2kXtUcY9NQXKreod3tLg==","shasum":"8be51f99004848eb9169dc2d26f5bb76399397f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBA+CRA9TVsSAnZWagAAb+wP/1ALwk78sQrKeq7x1QgC\nrx3mTB20dYCBvzrFFputXq2pfZ6T8nZXJh22t58HHC3uJLYg/TGiHjJG18G/\nmZSpNEX6H973OBJTXykSvgkFwzAxxksmZnIjsXydctBVs08SxnCBxdvIn8tC\n9CMH+Dq28uEw8KMU85IkChEC7jGpz0198sohNye/Q0pxT+rB8VN6zRvKzFl1\niwZOvz1Os1/oCRtsc9v7chWebpj6JXxhobTLUIdan3HYq/9NGYLPn8H3QKMF\nv3XzKfQon2hpNxXSIRlZIblcsPqzArwXjkNVQzBtOIHHuHtIZ3nWkMRoJwqH\nKLxMUVIS7svZk8WZdRVx8sFDm7Epk6hhpogzyCfDdHXaY7zBN/l6VBAohhBH\nb7usszosrGvQNR47oaYqb6G3t74JNPTKiNx6+zmW4l1BNVfSo+Y9O5agAC6E\nLOVHlDTtncwmV2t5wUB4tVzhIu8oeVLC23xvREJ4/qXLfhbCv1UgzqgoJkgE\nafUF7eSpTddjPgEAnWPgOKiebOYk8rrznJYm0mCVYIRbGnpQxQECD6kkc6Ps\ntxqm8wSit+n3/KC4bUiZGn0AaFV8pgss+kdE4fkyAnzo4N1Dnnc4A1YeNBlv\nxdjadDFomprOs83HXBbj772MwMpdi9DfDsD+pscLMkiiNjzdl2ZpJcGgP7x1\nfY43\r\n=ozDF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSQpHQcxkqC+w+VlsAZanxuy7XzlAXA1H9VbjwTcuJnAIhAJ1kem+w1WI8p8Eu5NntRC2X8yqxjgS7gLVVfZFi4r9y"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0_1604849725708_0.7451071269193674"},"_hasShrinkwrap":false},"6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0","gitHead":"6924600bfdcd003054b6186b1e962e9a576e92e4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rDHo8J0ucuCTzazgOJOyLpqdLoMx8DZZJV9/wEvzsSb/oEXdWYl91DT3qcEYSYVgAT91iGcqHbuebpihGedzqQ==","shasum":"92550ade454eab5c7dcc709ec06ada3c63a5d0ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBBbCRA9TVsSAnZWagAASwcP/3KruoAfsCy+G3efo7s1\n8TKj13RoA3QCt5EcPDI04mVy1OqIHG0uSslfBikvZkt6lKUbizzmNWD980SW\nnJc6qjrL1jXf31scLDOjYcvl4zZ0XRb0F62FHBJL3kPuTPDWkrxi1FEXY9is\niqTeGufWPqobriWUTzvWPETk3nnPX+uf3ACjqsQHboKQzzu4F0gBQONZEfUu\nAm0EGPESX+p35j0rKOpuOeOnu/YhWiXFzvF32rBeXC50go5oq9BrIXSLrEX+\nl7/kLIw9Uh1CdyfFVq/ekoqRNrYnNf0pPkoOAn0Y/TWuAhLZbFTNaOpoawhe\nvdEszClqYzNthVg7xaIHLWzu3C79aGxmxQvzgE3uqW1VENNfdAh6tRDJwx/o\n86zVD71aBbWUDoei2+ftbvPYnfVXcoPjjg6bCj67hGBDlnq06NsJEzoh1e2t\npTlSBHwgeo5lCHKvIXX9bo/1ykb0Gwtt9nhplYHwFSAo/au9B2aWJsVcNl8Y\nkbTWGFFIKCQOC3xzBJJUWodleZ2RJ/kuSX1oBRkt128vvPSc4OCZ43y5m3ir\n8dO27OZ4z8wWEuvOYVp6VDaj3XcDT5d1T12Cgd68vQdWdVgYchV/zPUH6c7g\nhfKEtlDvCxT2wZLaLNHX3+SB0rnzN3zYQN+l2ds/fLrgD7fSV16GOYcdyGxs\nj37w\r\n=XohV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtjLZLfE2VlwcLcJet2yiC+FKISm8TrynPE7sng65RWgIhALhQfKAwo79AWnJJPsrhQGZz0zUGgzmT8zI2KxfHdNJ3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0_1604849755315_0.406357536793561"},"_hasShrinkwrap":false},"6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0","gitHead":"4563f8303a70c8df1b27ec4ee22a98a152ee9631","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-LMjMu7cLXI+g9QXNEw0LeDDhCLJUjGVK/4T9STZI7fqzd/vMjeLWTBcc9lLC7sOXaUZnxtP59b/JcZ35ig7dBA==","shasum":"acf2dd99c8a8d2c2aeb64c9855b03c58fe4991ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBB6CRA9TVsSAnZWagAA2iAP/jN8DdpsMmt4yt3CiG5E\n0B7LnGMceFi8KAx0bg6Gl0FARaMJ341xvF2Z9ksgjGzSNh0xtePM2IenCitz\n4+MIUkQrICIZp/HwcL/WS7WBow0lzLD7GG/gLdjH31jw2bguh+l2v3eU6BpQ\njU14uZZZbcU+QGO0b/86DXIcQasQ+5HTHflZIjJwj9sEcUG10G/x2mwaIhjn\n07TTMX0EUm32YsN134BPU4JZtl/a5/OXsBGBM5Fl84m2wHPDvYiKdFT6pFdA\njTcmkXiqBjxzTn2JL7izMmit7gcRK2WfzmHAdIgtkCiHF8kZz8JFRci3GqFp\n+EZR67qvhxm6GQyb7IdVKlXHrOj2DlsdU4t2wkhQpk432rZpUnt+pEtZjMR5\nx7elZJd5UxX5RoRKSpNTPtXcGSGgJHRyWOXO7t/1n6D4mkzfQLabrCZ7Ej3k\nM+RiFpNh+tumCak0qyc7EekyMYyAYSoM3RnJ3KqZACBbanzOTNRqLlTIABmF\nmviUnMOt0fOZJYJHQEdvNdRP6hZOiaEvzzCJnJJsb+ue1MTjXSXHxMqt5aLL\n9i20r7GCHdSdHDY6j9m3aSrBM7ttZmFLxvSts72cLyHRwS5GV0Y9RaN+zuXh\nHOZ/NeJAKHwThVdAeOsgPJaVmojclx4z1hnkaEwdghInTvG60cJ6YmzuWNTc\nLamb\r\n=csaI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlbR4j7zHtKD/fbBzZpiu5KjA422sHaxJHCwW00gFO0AIhAOK25qMzpTbT4AS2mNe4ff6as60T+YA7DaFRZegLP1E8"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0_1604849786217_0.286146340820397"},"_hasShrinkwrap":false},"6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0","gitHead":"18edb3c451c43201f1aec22242167a65488580dd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Jihk9PItqOJs9VQS3Zk5+eDw1D7sfFIG6bT8npajVVQOYW5V3vQzXhyJPQAmeb0dHEX9cy/UCPSXzcAroIIQ6Q==","shasum":"b69000d57387f524c0bd6f4cb6c099c2af16b5a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBCECRA9TVsSAnZWagAAwmAP/jQsGbct2tvWgFB1I8UU\nSrytViuaB/GKha2jfaGaZFOg0SWppzYO/U239FO/q4Wzk8baXw7Tqxabsmhm\nA72azFpTtrpayzM+k2+HQL5xPSdb4XbN9FuvuvOQJPINdP84HOKlJHeOk1/L\n+yRlTsUkyYyV5JCZFAuAgW3sCOLp2UhVuxxmQbrXxJZ3ypnTqZ4qkukRT5xs\nAqrV7W1P8xsXX9P5LOnvG8b2N/MSt6/PSJYW7WKI1hjgB2nm5fP3m/4+F2Ug\nU+nP+S66/yj9UhQBQGwKs+PsRWLU0bmoDNAg5CZNwWCcu3zd2w/KHjpwpCKh\naCT0kE3J2GCnmSqA7oCVhK0yRpmgpVr5n/MSL94RKQPE/uktKC55j4QfzTok\nV1bwE3axUVskrnYKNPw/+0K1V1UnKAL3rglt/oLEJsN/9Zfy8TPvrWrR7Igb\nF4papzEBhCWJ5GTgnXdo9NLySoePMlN3zRAJ8GqW/upbE99NP78AXQVaQP+f\nZMY0x+kRi3lFk3Q6ZJF1vdzuhV2wWUDg7xqCuhOZ+McwcKoyTrSJaBqg7nGd\nwLz9G9YrkQX5XcVFcozUk2FzrYOeRXaDOH3h9wRbXkWk+dQN20YwfgShqDlY\nhkmS/ll1Nij8oPiWLlhwJ6LcXrCsj5M+qFfqBYsEIwpqCvqYOXHl7YM/NHlK\npT0p\r\n=bf1L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSUIle5t4wvwGDPwjYikVYIDWD94uVvdTGisudwSw8hAiBuOiVoWRPVKK+klQS8edwofTlZwyGT9tOOw189MnrjjA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0_1604849796099_0.16146835286523498"},"_hasShrinkwrap":false},"6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.3","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0","gitHead":"62b09472e230df17eb8c2736be8767bf1580f5e9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eK1qeE8gI5DJHhqePmKROLPhmQRmjupW0Zvu3yz/aau0cGuwMBMqshfvWBz5Fk2mGOwe1CNGKcqXPFOJPkEmfg==","shasum":"2735d28bca11538c0df7a98485d27c54ef528e46","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0.tgz","fileCount":39,"unpackedSize":225872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqBCZCRA9TVsSAnZWagAAkfUP/is9b0BSmWdsSsXVRReN\nKqNReR2EW98sykMg/SgMtXCywvceKSqStbMzeqNIUV8HzUdd+yLBTVmoqNYf\no9M1sk7srlvhvVYmG9BhVXCnrQA8504EXa7IwjygCXj8KokozJrcJmVrrpJH\nXa3DTh2jO+Q2YHjaLgwpZr4lgvGYhC6QpLfFzghrs4SnvhJCEP7WWnC34k3h\noak1PVGtjGjxZS13ILv1XAmmWAAj5htu7y6y7TcFBQY2AoImXK6CS1wDrzkE\n3/t2RCpgRd4nKE8kvXLgi/tPIbXmIIiYl9bdHqAkCzMIHE01KRYjwGUytqd8\na2r2dxW8K5xB/cUHM/reHiMY3C1p86ACXF/888lAOMMx4FuKQvIlmZirEnA5\nOhMRjzLhKfuE5qrx73o1Hj614vW7lFuJ6wpHQcmGew1ym2YfpevbnIgpdUjP\nERcWqwTzCRWXDm6so444nGucAA3uTvJTtuO0iOPCjXbcKkoKErXsH6YFSFP5\nHFjcn5sd9bIlg5ovFCbSWgVpTitduvYI6P/MCRt0uCRkXNj1Jyfin4gnxRBp\nHObMWRG86ZoTQe4+A8wQ62JlmTo6SCzJPZqnPYFRqucJEh++M0twEWLl4F5n\ne3nFmyUgALUwmnFieGNT+uB6sMbRrdAE/4EUBL8hqdYWXV5hEamelfW68UHq\neFQ2\r\n=uM3C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB0vpjOZeDpp02gukLWHlqwr7r0P46lFAd200H8Tg9TbAiAsnnChKRwjC8K3ICvvAeVsT/TiV7cu4EAvlb8JZY2Q6g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0_1604849816926_0.9399817881070833"},"_hasShrinkwrap":false},"6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0","gitHead":"d41465d57729b47ce1719d0669d2a7e73c3662cf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-l9kac0YLvrhbcpfQ8Z37KRIzizVjcAVn/rdFC5huDd5kI9aXwoeIIN94MCkKkr1vOzZPU24QLKBzX6tfZj35yw==","shasum":"cc3cf92e44d804720fc9a4a24a82a3ecfbd71b7e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPJ8CRA9TVsSAnZWagAALkYP/0lTz3X/XZBoFi2vDaII\n8zgbCb0+vQSZr5DLVgDO1Z8jY/T1CkP5nLbQ/YzsY7xRwWh+mazPN+CK94yH\nKJrKjHRXtfM7DLNjubR6m/U+Y8YTxnPz3rwohlbdums5ul4QVmRsMYRYhjIF\nAVuwJU7kho1rR8DUmFi+1OR6dzE41qMl9WFhMr4uaL9aRjM4goW1mz+kGq1e\n9LbcVC241mjh6PhZYZZnaJUfv0mf7v1e1SHjnN//PsarGXklCM3Mcz0Rb8wd\nrVf5dmSkV62ps3UE3Zx16aEQfVy41Pemi1VwsQ1rOzqrVY1toEnPyBRx1OWm\nBHp3iFrBMKG6Jg6T0ZfaiB8c7GEznFMiCC7m/HwM6nNEmvmOv1KhFKo0vkTQ\nryCLA4fVIoh2evz8d2sE8yYgOAjXxxlfGpIx7CE5+zXnv3y2CPZmrxcfaljR\n+TpumU2Elk3iiDnVI5Y/QNAHPMsKhJabvzBWewBriKpaRYj2DlEQCYp0Yatd\nl7BQwr1HNH/UINoWrB9J600zyYa2e9FdhpxICLG+D+O163+BIFrY0z4sYLA3\n/1p/ME2qOjdoocvFP82kjP6C4P47PBTKB8Sxjp5dfq9Ru4JhUYP8xAi37hPy\nf/sr/kTTI3YVKqfzG+qkBGB4A7vqfWYmXDeJB7CGm7fiZaFXn6SMryYbIDqG\nnZjm\r\n=RpZf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSatucLTTz8QVdrm9T2BL/sHtrQy+zFKwSLpiyWqOWAwIhAKxac9gF1EmvcCH724dHt0SDkjQSC8Xx5ex5lW/8/0/a"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0_1604907643670_0.33284162111200977"},"_hasShrinkwrap":false},"6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c620c99fb46c07274de690df71334a63ddce58e9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-290eLqMnlBRNnzNTw+DfpqGZLsxHGn48msWmIAu+cH0iU6HxBR21TiA5sIco/NLQgu+3BVgZgZBeYwu95wjSmA==","shasum":"f36a0ecc06b58fe383fa907414cbda085f46800d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0.tgz","fileCount":39,"unpackedSize":225869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPLECRA9TVsSAnZWagAA+qUP/jK5IbfvzgtmgLLYFxcP\n1Di6c83o9eJk0cIcbTo+eoQ3LhsM+zrauzbLBUFEtg7JH2qxQh5ufgbPTsFd\nXZBFGPzrAC9O8caP/Z0zfRtd1iNUuVN4UOzE+CAd8B059XaSujeeMzGoTDu0\nb44XyFW0WKP7iLfURi0ibEDXL6UFDc4UE8g7bWQ6TDLI2KESso+dl8j6bhFp\nP5tkBYigAxHqSBWLavjHnRdCd1+P/1yxpoFvFGYmD+JyahpLcadSOlIBFy/r\nF8kCjhoResy30oDZf1FfDVdJ1IOLgKDSO520MDLTdwX8cOPJLHjEYDScTNfV\nFu4YoFkUAfTmxS37yPWZA7EhECci6QTIsnpLpYAZ69IS6W9kJpp3Yj2pcex2\nNEQqD45SsrZI+aX4yMTcXBqkPjM84fLOnJaXjVs+d+hJzDiqXpG6uFhnmpwM\n2HiD2ZePLhc3+izegYksypM4zGUbWG/gjHCrOXuGufW5nJnCXjBbwcnMkgCC\nAbpJlGLIGaj0TvM9KCECZGZZ1aaIoHHMYwCLsjpUsp9ABxgSyJkA3pN8NV4X\npMNh4IYJr6dAuhlxcrRctN0KGWryQdfyk+Qg9AJ1/E2MftLdKgHdCuDBQp8e\n/qqG4yLFip/UTxet82DPM2NuqKYvDyWdILWjM88YC9NE8BSNvT0EgUJm1mCh\np98P\r\n=5gLy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDXKkNaVuxFJn5rsrOKf7+KR29DklPw1XNVxFKEjznGAiEAz8zPYCJ10Se3/wO+4bKRrxHD2m1jB1eYSI7IBgS3bT8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0_1604907716281_0.8888593735494414"},"_hasShrinkwrap":false},"6.3.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.7","gitHead":"4ac80094a6cdadb7b39c3d220e51de46aca36797","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.7","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6WsUPBV7VZ5KEwHNp4/tMXYz0MuqLHXyxhLsnt3vloxZV8XBONeNtF74r8BWByLym3eGjhr+Nq9qHME1ILK2ig==","shasum":"db25aee609f9b72b97234770b4ea279dd9b36a45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.7.tgz","fileCount":39,"unpackedSize":226098,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPL/CRA9TVsSAnZWagAANDAP/iSLOYICqVP1fOlM66Ko\n33yTG2sVBygTeTX8ygW/DDthzv2pYRhfKvbS3d56t9CROoU972X/vvrU4a9T\nOMc8fT/DqkVJcXka40mec83qQ9daMSey7cb9KbAlGkvzdSunOrsbBXE9026n\nQ/9u3XRZntLdYNUYDLyuVcBkqo+GpuOqwZ160mXScFalwZBKeHxDksDDqlEB\ntbL/aTayeuLJTIHUGunVyGxcsBhMhhYw6tPM353nHqDgI9VOdPTDmOklWrnQ\niD+8Qtl/lspvH2k7jrv2ANFCK0m1k5mEhRwvHZ7VxYDlVz2RpDr6L1s1cb5i\n/iB4nMQAH2w6iAqhHehFWyNffzWOUFARwbWAzP6mXXiJjExqfN6YpcFMiB38\ni3TYPXagQp37qzzv2m0kh16WWz4hPnp/nGYgAe3F39kX74Nqxy7yK6gIose+\n/tog0ugrcy1xngBtHJBZgKDOykGPCeB89ikwJJDLmBjDQjjQVQJNklQ8jIVG\n8S2TwGSMIfo/4+PaFI/tq7oGbaUCQZuEmHCP4seoLkp8F3BiCn0Ro36tYjaP\n2kXGOSfSFXj5WotgqBz20vpFznlAAL9gGReSMyyabw5E3g3bU6XAa/BXBFbr\nxnxj35vEQc5rUMrPAN6XU8rYyMhtQyXSHIveuK+x7Dppaikr8Ftm8aNH9D36\nkv+e\r\n=U33C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiRX4yAW8Z7ntdBODHU/H/pgVoyqyx29hYXOzMPvSDGAiEAxQsw52XBA36+ErUkYtxesscE1IQ0SHYAe2DRcmXuHe0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.7_1604907774317_0.46154194452233055"},"_hasShrinkwrap":false},"6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ac80094a6cdadb7b39c3d220e51de46aca36797","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8nEeB3/+Tb+mlTKlyElXzXFClduxtkG6+kWdVAyNgDL9W8VWsBAtVPaefmO1YBtv+sFhb39j9+1I1A9vKAFkOA==","shasum":"bdd18c57aa64c8c678e51c6f2c7b9f6de750d497","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPMdCRA9TVsSAnZWagAAIn8P/RpmaAE+o559qEU6aFTq\nf/d0KjLugeUNNHsgeWaWcTZy7Ibw/AcyffYBKgffttw0AKFloNdzsY9zUzQI\nbLQ5Xiyq9V+trFb17EP4PXHrJ3f/uWW+NCJkYZgPKRd6sRMS18kRO8iv0YDI\nu/+wXpI25OoSZR8Qi0miUaTTZddIG9I46KiakqbOZUPXJyMn+L6qA44Wg56J\n9uEoUl+DicUmGTD1vK90f6RrRPKri9k11PoTiwt970WF/XWc78t2oidgBZfF\nnJp0lJ2uI7fTUL9XbSzcVcbfiHm4T5BqlUWowcBlRRgChLJs1gV1t8eXn/Ym\npgylxzt3S6z4BMXAQOAxe3qZelcpNd7YIsYfn5TcPlqf73eOJubeznZAGx71\nHfFvSRzfIHFLjRRyRNjjNQNnQf5d/bf/Bcx7W67tTFQhunTHiXH+way2jedP\nzwH0lkT7gbPTiixAsIKqUtTrs2HRRcr6ihMbeUJtQ/cfaECyHj0Fp6zs9UjU\nN+FmbLV/F+UwC8OIZ2dFBwuQlXimspaOu6UYlV4v4MnxiEnzgARpIyGQAkCN\nzxSdaxogoGr+jCZpJhYp/B3x1tFmz0e1Qm6yZLKA0xxP5qWUGER1IL55ILEF\nGXtQGW/4oZ1M4ff9pR1KO7tWzyAJlnyo+t6ixZLs6lqatKhl/15qRCmUiVHi\n5K5E\r\n=41Oi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtIl+qAl3xd4HrqDpIgiDSPLOKFV0oTr5OLuVmF2WoKAIgDKN3k2ZicyX4YrOMpZ4V2XjJGNxmtshmzEX1ZkwGQas="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0_1604907804842_0.46986048539299463"},"_hasShrinkwrap":false},"6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0","gitHead":"c342209703cb66ca76ab87d32769ffc4515d85e0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6c+7q+JuSHe0ZVJyU9ic8URCcrg90CDtFRJ944HztXy2rYyg3f15EdAl3CWAQi8DbVkIa6Emdf4yia/hiJDZGQ==","shasum":"50418e21701681d8df04d13f392c8cecd923d86c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0.tgz","fileCount":39,"unpackedSize":226144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPNHCRA9TVsSAnZWagAAx38P/0iq4xUlI3OAeTPACeNS\ngE8rbG9SkgejVr8iv+EI2Rf8AcxAluhgfWtx+B8y89OVYolY7W7FEe8l3G7a\nbIpRd/gXabc6t3hcx3N7ifyZ3SfI3iI7DR+QQ0hVUuEF7NHQhFEYJRSAFjJw\nTWfccZAGSCLWTFpv4DYIgsuBT36Qbq/x1UmUt1WR17RTfGhWxWbYE7jHwriA\nufAF3ywQa068b4wWZkx0NCQr+Xeag+8mPV9sbblFeaOJBsOqIKGn3HGGaLgT\nct1n+aqpaYfXf/bFLuBmxI7mroKAb213mmrVJl3A16XRbYKy/lg4kIMD7sE9\nngCIcEuALHfcTdC16pAFxqwqjJTimDcAlDNaBZFf/D0vkVwLjO36+FnERW/S\njU/AlpkdACatZuudkekC7Krs2zJyciVgDy4pk0AIOvuB3yZwdLVgZLZ99A7X\nRVGCwzyDvW1JIOxoBwC/Neo/oKzqCzzLUrf6RudN2L4hYOFriAYGnh28grfW\nMtRCa4wounVg1jVPZnnXMH9QDwUnG56b5o4jIHQOzIOX2wkeoIm4+Xeou0ql\nZh0vr/mF1QPuFdTjZQz+Lfhl5ULlkp9j6+Dd/HsFBusw8o3/+ikpm2bHDFaS\nBCT9V4fyNAmEsAA/Q7x4dgSt6FIRMrY91KFISgpeuTBr1XKETb+p5VLJPp9f\nUeAZ\r\n=9tJt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICm0U1cHk1JBD+1sZOdjA/c77B1x8ddmke7L1J633APCAiAZ0bFlqSXL1BCR/okhg8HOVNl1/DNFLfFpLRs591W49A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0_1604907847068_0.5978633852942996"},"_hasShrinkwrap":false},"6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0","gitHead":"5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5HKJ09+Uwg+u54FzWLVhLkp/8AXU6SUzfgdmJ3kMIAw07gBNffjpTy235S+S/MxvsMfjAxWNbka5rVXSeKfRZQ==","shasum":"30c6d415374e7516b369474c25c62a6853a412cc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPNfCRA9TVsSAnZWagAAYdMP/j6RVpQv+REMSAPhrfIT\n37OEQ9JkobdHxQ8Ji37pkBFogioCy59kALQ324/sGaE9iD76V4TWBPOwfuew\nJr96XA+6sD3rjPUS0FmRhPxTe3pPaFBbiZvkdCFVnwB45uzB4U25vW5QJpfA\naKR70pKIl48PpXBv5kvNN0vbzo0FkeK67idtQibgzxP5A08nRPWPuw+COvzP\n2uSRDt8i4uOL5J22qpdZ87l3T3NsmTDDsxpNBIxRzdoUVyR6pnV8JvYr6oA1\nj8RVcqEEJCPtQqmTDk1xd1+gk5SAeLMipmMalk7nBIOV8B2v1+uIhNXyrNG5\nCEuShe1jLUmVhQeZg6OgwZAVMn8KTFG/QengTenjIvzGoGSxjdT+T09huMls\n4MHjHjQtkULaPNNc5RaVrF3LEQz3S1Uo+JpP32v2I/GFPbHOB8yGa0lLKgmJ\njwMNCQrne0scZipJ9HABH3bjLzESVNyI1uZXdIXx/l+Z/qk3oQGi/L7gIUqV\nF6HiIhSI51KDTXS0gfQpjCpIhr9ykXEItsxnrd6+7iLEJKrWujVZstv4IqKO\neFPU24f0cDFEbYuqrBE3JD6F0s5JXzQkEfo6xoPygTI42Rst/sHjsgD3d3ad\nJwXOYdd/gxl1kKp8J9k7veRPJ7X0L9ZYnfS4M9TX997SW0WBLBJ4pEvh0PD+\nRCED\r\n=M6/L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOdfJagFBTX1ztPEE7VvdN/SHYNu49uWr4EKq8ykIMQAiEApwd28G3/qKWAyrviD2awvJGY09EzF5P8urX0Of8+Cso="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0_1604907870775_0.07677562590349529"},"_hasShrinkwrap":false},"6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.4","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0","gitHead":"46d44f0787559a20384e076437b5fa3e6f99953f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kpEL+7JMses8UVr9frSZq49MDB4ffJD0f8B3fwJVQuENkhBNihyATk6YAlhFpfptQjehsvlC6J3xAEW5el0KPA==","shasum":"8d4615a83c822c064b4fa875d89f0721a3ffa1fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqPWVCRA9TVsSAnZWagAAQH8P/AmuRVejTcQNUP2YU/QO\nr+q7qN+cKKwFeIGqiqAc9FoHHb9Umnj3yGvCnXPb4BMMaxXryjD91kO1Cqhz\nJiPVFwlhRcwcljlN/cAGXJ/EGvuVjSC5aGTsjUWGm9CW1fyAmLgr+qzKrDJW\nIr8vpRmlwUCC17hjK5yKFEIg6brRqQJCf8r0auMhBvuhdD/gg8Ic0nyUnJt4\nXrQsMh8sr+XIt2X5/ajq03qBEOR5NsKe6r6f2bPd7VxA23k8cOMXvrEeiv4x\nTtGN+saelNlI4QJhM+0QN7wTLEIeWU2GyQB6tq7tlWuAq8yXY2puJWdP/LOQ\n/NbMAriYtdG05kLBU5Ke8M5GXCyS05K+1bVfjs9IZAAEPipY82jvZSLqGDbg\nnXUQab/eH5gFX5GbwxGW9MRnYr3ImGe3nUAg2JzBTPvQfVoZxAwNHqCg4vRU\ngDIcGGioTkTz50yaoeDG9223BJcMmkJU/EKwSdT8WQOSbW51CzEAzNl/XVUH\n9mckvvR7MZ24WhWaTr0aGOdnKcqh7JL3YvgTI5dn/19qxoBx2OeswGO05Oud\nPYDJIcP+pHdXS2GRQz8KfXPddOaQ+ZY1kuN9W0V2kqHnCV48du+C+ezLc0Go\nvRICG04A47BxCQiIACICL327d3og0ep2XYgs32BzXg5LRv3uv1Xai9vseoVM\ndh2z\r\n=ek0i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhbjDxlgw5ynyRseZDatGxxl5nfDOd9VqVZUpo+pUNhAiEApnANzIINbjODwQXwX43vaM6CLkHFAOJ0SDZ1RRI2tTo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0_1604908436877_0.5200024578545939"},"_hasShrinkwrap":false},"6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0","gitHead":"97b522d2009eed5741bf0cb4caf18f6df8067624","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sneOQ84i3i0U6iEtfKGWjwi6dd54KGPp4W8yTuAbyaf/rN0tnjaQupzkXmFBsG44oTFwXmiFmm1CuBzUR1GiRw==","shasum":"a4c394996fbc7e7b131743fbb01b45aab03a1543","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqU97CRA9TVsSAnZWagAAZPEP/3p3nbG2UWnDo8kr6dAZ\n92WjlWXTrgMR4w+kgVC6Kn3FVUgk6keC+BtmFtH9A8n4hDQUJK6NtzFrWee/\ncyaOZkB4xaMUnQI+gLG72UWFWMHXQuyR/or/atZFEDCMQAgIxiXx4tzPTrYw\nb4hRZq6cRs/Ge1iaNtS5Mv0pmVQNdkbrrP+w8q+2NgQF63qoMLvJ9N5UYMyQ\nONA7TSUJlFDIWaaZnt+7g47upjjMyJE+tqj85cRcea37PenBfw7F5mLu9PJT\nD+nmdptjzBjpJfc8nmQqghupBgw4gpkIuihoBDJfCGs9oVqqziAXz9tEmDkt\nASiCWyWpSeJV5WJ8ny7Jg+oe1IQQq+uUp5gsCOK3FwIX0J7Es4P47tDlGdbw\n9pbcgWPLY8MTdzH29ctduVc1HmI4sAEZtWkxPZ/2xX1ziMZeT9srXdWxM7NG\nASilB2XG2XBKWESdarhpyhyW65nQIqZRV02fslsViXMubU2ZVtYW3ymVVsV5\ns4BPStO3wIzlb2B5vKQQAQgEQZwG8hqh0jaE7uEzX0MHIdJlA0YCCTX9uDTj\nFxA/C+UNVHMkM7ExAip04i+aP+ogjw5gsJFPYmoSdV60fgGjlFhyi5L5L4fi\npe95U/Nk/XvQEJiAcRp5QPeoTzseIK5l/nzYnKafzjQRzCzjIQmEcOteFjLX\nR42j\r\n=Ka0F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDq4+WUZ7zt5pgKPTF+qDV7i9NyKlkHxBbl21FninqY1AIhAPvnFmMUd5xcO6SPuX9ft2Z8OHkryWTvXImOmz+iyYMi"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0_1604931451277_0.9527021112509773"},"_hasShrinkwrap":false},"6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6554ae0ed7e14caa68d18e24fd75027c03f1f5e9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EJFkV6AaIjhX2qoyloXnjy2hpYn3MZh98YJ3UbTL0s1LsPWzZYw4Y6jOI6H8SDHWNu74UJMPUKNS+gYBa8CaJQ==","shasum":"25d38c837cfe554c01f100675c85a2564955a77b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqU/wCRA9TVsSAnZWagAAkbsP/3RdBSzP7oC0hZHv/jzv\n9aF0Ab2wRWRa2GJ/p8axdr8LGXqZ6TblNeSK0rVPsgMaha2QitIflB2UcZ7k\nX+BH2JIEpXNKBfMkJo+m37APqdgAh1wN50dWWHX7HwA7VIBduh4A98q0gNWT\nT5G84KJi8ucnm9iW29e8+m5w53aWmMVlY2G9zisUGZOff5vBahaVCSHv2/vh\nwVpGOg6TYUxfj4dBg2KYbAdSoacWuDhKfv9NuS/TA3aREm0oFM7xDbeNd5HH\n0OABfOraJnT4zARGC5tus3Q9PZg5KpyfNqFoIDmj/298f+X4YAxu9sB2P1pw\nEFTYXyPG23R+WU4u1Wh+zTEG3zf5ifp46s0YvJIbpWADn3Eptnag4E2a6uQW\nK2z9L5sLU4Js7tikc7eqGlgDC7MREYqJ5v5JblxAvLWxAZqwl6LpdzyhN0+9\n3C3mDpfD70WmiLche+jeLv2Y+If3UdhjoCffQA6CZusry6/pBrCEglIV7QzO\nTvKUVkJNW5myZuyTc1DT3mCeZP7wYPs08LbQJv0Nh9mI8TY0eLpnicaNeBVV\nB1MfC2DqOvlhPFIQasnAX8gi8Qc27zC4pryo8efVQm51jhk76hc3reJaoXjg\nL/v+cc8r67QiyDeGouRVUVrnbIaldniEANoOhBtATZraJKnootUL/NYN57Wp\nxxbS\r\n=G25M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHciYIaUhUrvjVoMrP2QDC2pu/7+YBapCPm548IyisHAiEA6SkcW5knfkU+Wqrt+F+YARDXY9P2wHd76NKXRmTwzQM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0_1604931567801_0.7187978903081518"},"_hasShrinkwrap":false},"6.3.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8","gitHead":"f5538622ff3bc214fc68ffb44bc37639ad19561f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/+X4aXuHlY3ZEQcjQnT5LhwPIMMa2j3tiNs4/bcVzOoQDR2gi3CJbACj8EkQgvMicrvAVPJ9LneqiEgBKFje2w==","shasum":"c1d9f6fb682507b2556bac33ef101d4538c05fd8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8.tgz","fileCount":39,"unpackedSize":226370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVBcCRA9TVsSAnZWagAAPz0P/23RbRePcJaVW7e3fU9Y\neyqYnOAVZwUnmLGZ21p4BXMSLtSpZtInohFIatvD8+S9hWEdBqGCzoGjhuD0\nFvWjvDU/Lz1nWYyp0JUzLNIwmbSPWio5uCiYiuvCxUPYrFe4bhbUDcF30pSd\nBOKsGE3MQD4ZVTMzq2ZJcl70Wwp83ndDXablMCYi417J5d+BHtR60n0zSxJy\nl/XhKnz7tzVL3YcDcKTkrcLjYrIK9J9/UPmvKBRBrnuC4zVzSwWrIGrXHDVR\nG7/XAB2sBqEs1ypuczLyL87TrhiiWOhQLfcLfhIBlR8rodAB6FVILIZNAsTe\nHPiYXT4iO+t++RhyjO+TX/BoQJaS5FjQ4PLXTW0UHhdpkEwFDw5IzHgrrWg3\n4DUrumHrZeZ9BC0zbR2x0iwSnlLmUUy4wehGs6AJCWDaEtm+8lxDk6rT+t0R\nLWi7q3bb9Gov7T0MlLFULqy964Ang+pU2zeFgJ78okqPTHYhZbufyldovsi+\n0kzlriOi4n8xOYKrUbNzRSSFrEL/c0yGfADkSTPS/3HPPqPiV2dqlLFcaPEj\nNlfQn/DePlxA3aqwwmYMuQVMlMZ23MbVqM9Ffdw1n8MghbbVaGjZSm/4TKkc\nIYDA7z1Au7y1vRetOGDN5S7t9+j2jj4HffMCs70DwQTJy9XVxtl3Xo/cvsgT\nGizr\r\n=7PrN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEolQTTaP1W3nhafzx0osU7n2B4k76kx9THyhGBK3WAjAiANcDKrsYmh5tcR1m0pZq33SLSd4/ro1AZvWiTl9buZFQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8_1604931675439_0.6037135234625397"},"_hasShrinkwrap":false},"6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0","gitHead":"9a7657e092665b34a1e580e1e59ebc40a0c88362","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PEfNtPN5qk1SS22p/SN1N0E3jWjMWuAbxEEXIJH4P7ZsRWABaAOM0o2zgXijQshyvPdOzGU8repo728vdgSZ4w==","shasum":"ca523a8836019cde91f417bb8ffa24aa81c6425a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVCLCRA9TVsSAnZWagAA1n4P/3cvA9NFeZkIoDblP09D\nGw0iW40LoxzdQpXVJklGFChPK5q7GE7kYqN+61+zVryC8yZoW7V2Vwbj+D/N\nPWpVyNkgzUdRefZGkNgr3g8RCl2sTryBhEfiCZoedGX4gUwkdlpATUJ8/IHz\nYnERXak88a35V5RQk0QDQPoXB+7Tp+eYK7UbZsw2QknPHiTCl6y5NXckSzLR\nbBZv/Iu0k0xpX0MbE6vWznpvbrvmrzzi8U0LbVH77d9xnq6ZJpQ1VCrq2SB9\nQPbcQMUfuVTjZYcvpqBm/6u0LB5AYTQk8r4VYlDoq8t8oa5ffSn1vvuEQW9n\n+PRWBq8QuNjpVGVV9u6pjIE2FEF8/87A7hGUBvvgk9mdDwW0p2q5ulFLEbCh\nNvJtRWDx82CG+1jVg1uNYE2hP26wTjmxWYSyceep7wrdbi+4xuVyEJC2EXLc\nm4zVvSAwtQ0tfaeBfhpAXHU2CdfUg3bUQ7glcgw406/d+Un6D40BgktAiuJM\nbkb7ShELJkcmAftzDmhb2+HkqMYxc9SQLCWGXrBXIUn+ZTyR9CjeMFxwLf9+\nj0F+tZTrTaKrjCW2Wk4Ieev7g3u6QWPgSBkLPHsdy2eZJ8RBdy9lbaUmm4Ur\nLiSr7jzTY4mbk2aQsLZaam0MS3FCEnvX/qYu4GXXlqeITj2/WithQxOFTdhk\nd+Ro\r\n=46Qp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3BtNprP8eeNEbMWW7JxT9OrhJsXrL1alRTZxgRlTsoAIgB++6hvRZw8e3USZF/EmqukPw8bo3mz0N9uDWagT1Pcs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0_1604931722907_0.3619105952138555"},"_hasShrinkwrap":false},"6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0","gitHead":"ffd8c67f4d5b7df7b7414377716ce19aa441720b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kjSXiL3gpX0pro8fA967ts9LhqoFrssfcIKAgTuyElNFqPeJOmLnfm25gUV6yZfqC58c1VbDpNnK1cVjK0xltQ==","shasum":"6b5b3c0963f9a467e5cdbf30ed73d7ccdb7df79e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0.tgz","fileCount":39,"unpackedSize":226141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVEhCRA9TVsSAnZWagAAousP/i5AakIRT8nSSvM4hkkp\nmp6exEPD5amPTr8iZOAMbDHuiN3CHG2q/wbed49zo3lFxSwDDZkKuROLVExE\n8q0XtX+tjpEqrZRaRTf7WBv9SNi6qRAhrZGwVT71GI5imwZ3M54Xx7PiSYsl\n0XrVpmcgnOaTvmA90XaauI99lKcZCLu1lAv4YT1jNYjEsoduulTq7cVsv4tl\nbwV+87gpOHOXrj1aNgHrBn5sK2bhtXBAjyeLj1GNdaYdxTJ/ekRlE+pMVtPb\nuE3MuGAqAmujXEWGE79q+toc4tLgOJ+9BzgtCkIyIlPVq/jFphd7r4XndF1I\nNe1Ol9t7xc8XWXz9h3UebF7jKnA/CJMKwnKGzwb6j57iYL59p6emliK1fxWw\nhKxY9l06ih5J5L7edBUPcmYzNqZ3l/L897DEREZf2irdWZ+uohJQ6sHQPx7V\nVHEabfcyOcpag+ot9wMJPqnRunCYcAyW0c4+lfX24PcobCAFu+93QOkNV128\nYbWAdE4dKd6PMFr1r5tbaNrlGSEWMwrVWzTDSYCeXRkdTAxr8NJHg3HuPSz9\nboDGRs/8Xqfz67KfkNLeCyRtdNYjajP1rIz7GkS+hBs0E/9gf279ArLxkF/P\nX2E5sKcc68vDcSzRayAydXYgKRCdc9RsxL/YBOQbMuP/fxQu5/KN8ZYzO/y9\npTB/\r\n=OxVS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSYRxXgT1xpP9WY/r7NR4NYbOWQZvyOiqht+0qklcFcwIhAK/NFrn9zIVKKJp/FdbUMrg16R+1pNIoQhFQcmGlnj6I"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0_1604931872389_0.2103820880306977"},"_hasShrinkwrap":false},"6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0","gitHead":"c49c7e38ed2f5007530be2d7d3b04f2733135561","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-WPxwPPK9Z95JoCpEQ3YbFlU0r/MpsUN0pVTmaFkxPnFa2LU99H165r0bQ9r7i2sb3/ktfs648h96K50Z608phg==","shasum":"d048a117754d2d5ff0dec2e244f829efb76bd8ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0.tgz","fileCount":39,"unpackedSize":226144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVGdCRA9TVsSAnZWagAAGLsP/2J9QiwuJtaBb+rUXgql\nPZcWGCNZftKuLMvDV+EtmIXqBsvFE4n7wBHdCrYLY4V3MDtFiAKFWTowxruz\njpJLmqb5OJb/Ld2KtJkpRH9pgqwG7MBdLK0wNOm4rySZzXe2utwhB9ZUyj+g\nHTTG+z2wktAbBZuSBl7hkRWJ3hQqXr4y3Z6yflnMSNTNhA6y8gTSXAY6rCB8\n8wANJlfH107XtoLrECeFn5+I0CX4d0KoaXUeHPE8HctXMDXUDNDoenWx2V1k\n4nbD1sZU/ZN6D1y8I35wsNeTMQzt06vgAe99XN9jFvtpsHh38uqthLMtUSrz\nBmGLaljpsepzYcXu1B1rwooG401Mgfx5umzMZXrZ3WjpRr+bmZryWlU3RPh7\nmBt25eSJOLeqhlmJ+NyDJFivBxTtBdPv3Pw7/EOpsCV9Nm6W2OxXR2m/VTl7\nbr3N3qbVqd4EVP+ekJJ6OSMkvCErGaNWD0BZdACNnk1rITE9jj1Jsc7ZF45X\n07EC6zgVL3eum301UoC21xGJPwxSWzeFwJYbPQdc3eUp6gsl12FYxmJ+OGJc\nOS9NhJDw0GtTEQovvEIxox7jrbP00eBmaMzffYzkn8pBqGSGbH2wMWBCQa2d\ncSfLZkmw8dVmJp6FHi7crONLu4U5PVJW9co5W8RTv3nBsoFxjH3D1UxDwOc3\nNDTY\r\n=aSWg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu64eha0cOIF2DgoHj6EtJbUIJQREM46ByO+rxCLHxogIhALsLo30zuSbXfXJwG8Dy1Wpt+j5i1PtOOX0eNR98L0pZ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0_1604931996510_0.24738292723613564"},"_hasShrinkwrap":false},"6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0","gitHead":"6c1bbea72535e76cafe572ef2584e309121f19a3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dGvphm0sDAGa8lRiPsQ5+gMyR07hj//p04EiTVuUVPP1By7pHM6opoEqtttpTp1Qs27vlWT6qu1Cm3qHh0Rt9w==","shasum":"1df3e9c9c0b19e365b15f1eadd4a99a102292236","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0.tgz","fileCount":39,"unpackedSize":226413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVGtCRA9TVsSAnZWagAA/OIP/Avm6i8yix/XfdBBbP28\n4/QltOgxgVfc4VAoffQ9heDtxlnnaKoBXuZQ4VFXhagARWqtNKU2IP2tBwQF\nkzs1p5e6JKdwiKFnFWIINgWd0ymU+8zoDacbTOhHWmeDAsdMdlDEj+n5t+hh\nDngJIYDfcM/ToglXXDe6ryVIiviRcYYaVK2utaKzeOgn25/ocsDevNc2ESpR\ngfie+t4ENQn3JnBO5PrXJd+fy+bCMJDmmBjbY4xPpNKjH19jILUmoe5oDZAk\nayKayL07e6HddFHPem/W+buUdp0kqlYuBZurNNxVEZ4RUC+Ql5/yGCkGftmL\n8lH/AVOyWEHxs//ywXt0ZO/mPbNSU0GPpk5WsUBj21/zAaWAvxUDycKlYrns\nE8hj7nKyl9+rX/rUvBKYxrFPv0aLFzILt4Up/8lslkr+ZF4MP1Mp0AbL673t\nKP+KA+VvJC7xvxdoTgpkiimTi0lfKtZQFaxcqLXIDhrnN22u4mGoGuZBjHYa\n/JLsxEUj9NYAAKMxD9x855UlH6VQsjmSUuJnSNRzAu2vEw4DAw5rWbSBZmzA\nb4D73idmSrzTx8DtSwn0mBlIpDbpJqT2kEVEEogEbuGk9EdFpwf2V1y1bmCB\njD4Tz9v03mXU+P6ZmBCI9R9r03WX+phuPwedyLd1YohAqnQ3qDg6k9rJX74g\nOv+j\r\n=GdgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPyFaUfZ4MF24208Mx118XmmgAJLqVmRrOpb4VYZLwhgIgR+mxosAx27SG6kXK73kDXvvgQj3SO5ac9tIocmMJ+ak="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0_1604932012852_0.7781208387856695"},"_hasShrinkwrap":false},"6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0","gitHead":"09f4a11f3c44ab3c973e893ef61fc12800393adb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-E6uvd3zW/WlOv0Y9SCziysUvSSFglDF72yB3QsN1GqPtorggd1+2HLb9OGjC7BevuUmkK3q6mpYy6kVrYy932Q==","shasum":"8e9fc189beebba69d77a1b1b8c5aab8c478ec095","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0.tgz","fileCount":39,"unpackedSize":226416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVHFCRA9TVsSAnZWagAAJTAP/A4VTUI3qA656RcVr8hU\nZH/Ax5s82IZpGhslpZTApi5uQ6i/My08h0t43IPhQn9o22P5rXruvHJ8XCnO\nQhydIPIWNBG7a4S6IIKruxlfFuScLfrqrxm9B0TaNhTZLz8hq2DpzWt+7rIA\ntzLyp6Mu1hDqa17KcqKLZUbCBRRWO/bWAib2lGqivzJTE3qnCi+5CoSHUnR+\nPv+4YTQFsr2iDcGhXwHJquQSKIRh63XUoWkP+HNPpNU3ZjpjMPYWGjxyIGqW\nmuUmYy5mNbDrDdykEjmQ/XWxDZ5zK2k/t1wzyw+hLPjmoZ5TgLcZcIr4ajQ+\nOUVc4uluctiFFbrOSCyNaWk1u+ABlCtWwrONBMJCuGjW/mDtcZFVPJ7pCZE8\n36gr+kufgRPeHF67Am1q8j3lUU3T5eHTnmDc8SIpauW2nCSCBlhFvS9O3hhN\njk1zKu4VV8aRh7Vly+Vu5dnTH/w6gSOlG0q/JsKKwONz+A/Gf3bL8TAgf5aU\nUP8ur8J2lHlr0iv1LIvUNdACFfyczsWVo6MoREgAOcashN2/cDhSutkW10VW\n2FUHRzEXyyDysgJKUGwxtE6sE6aHR2VctM2Ee5PghMBnnmg7coLrYOmAU0x2\nr0Jk5eOLf4GplEqaIytYOX4kz4EicmY5LH4qfGTCnBi0hrv6Jm7NGqa6sQLm\nAe5k\r\n=9D9B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHa+vhKUsUVOvqtG/y4pswvbMa2R9lEGKDnlrPe+eCpfAiBYZt9wVpo51eGGQYAGEjQ5Qe8tsZRUDDgkX9tK+UI7pQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0_1604932037485_0.4291884221941"},"_hasShrinkwrap":false},"6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f5538622ff3bc214fc68ffb44bc37639ad19561f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-byiedftWYbhEUdyFgfboW43c9nEwNrA6zNe2FfVLPXjHBWNT1+7sovn7BAm4uB0eAvG/22zSqu/BEGnrF4/tvg==","shasum":"60974f2b1725b6942a44709dcabb908daaeebfdb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0.tgz","fileCount":39,"unpackedSize":226413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVHeCRA9TVsSAnZWagAAH0gP/01chxH8vAVmlShFJqQu\n7VUzQddQGVAX7yYgPD9cgrdS50+Q+MFE4+58NS1IZ8wKbb4B8REJEHCe05jA\nnI1fJeTPJOaHh1jnZ/IcFSBAfR7ssYdLV9ZFvlfKCaXDJoaoVHwsYugLDr5S\nKJLCeqAGQjk5FTJ2oP/bQLcSyuT1VmZtFUpmflHYxtSXJhbFOydYG/esFJXR\nFaOPWugCebIHOqPYjTuIvR80Rp47974GR2t0hduEaVzsvFjCfzlI0rseX7gX\n+JTml7QacejQSb21hNzSVtKN60DhabIGxHsKFZPK/tjgAu79KY6LcZnfVxZ5\nlVPyPrxW05Dr3s0NyDF3EJtGfTY10mTr9B1bELWfui76yv4HgaNZH3BYUfR1\nR6/zXAqMbOJjmAdQqq7+0VONib144j3OVJlfWG2pE05mNGd9BjAnHX0p5zXH\n+MAS7MJDbuiWYSUCrrxACDjc1PHomSUNJaoBUSNV0eieb9CISLK7d25Q49Xq\ntuWgo4zo2Kr1PooxzcoD/nPaZMasqEOCFbNnZqxgEoBuDk8gP52f/xrZR2IB\nksXnMiWU11B0ezF2TEDLGVfqIItRpqiOOLWJ/w8ABbLoJ2spgtI4qy9GVZMS\nqr70z3W6e9Q6IYprcH9yIIgcAU5Dog+wMFuiXsOelwOC+D/08mNGWwnt83R5\ns96/\r\n=sDrP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvWnDMiY5zXX7RmgCLHUGFnclNwHuGIcec1798K5nYggIhAPUvl+63IKvngHggijUl5Rw8rzMtiuKgFd35g81oed6x"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0_1604932061602_0.9365712117447935"},"_hasShrinkwrap":false},"6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0","gitHead":"6b3bf769f6187a2ed5eb6f99134430bd3b056781","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-h6ITKHZtszfNz6MpmQC8g4wd0+GtC/UVYPtTRk0ToFXZsQLHgyfpnxyCNTK4GvJDdiBE1W+gyBdk01rvJlQ2EQ==","shasum":"e269d1196040b59322c2002b2cc45ab02258d9d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0.tgz","fileCount":39,"unpackedSize":226413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqVImCRA9TVsSAnZWagAAiFQP/jteBcdCakgeLMdzBMFr\n3nh/PbQmroSor4WYurH+whaySJVohYC8cFNUihUg9CTh5QcQmqTToxy1COud\n0Fw1ORmn0CwOYijRKLeWXRKNpLWSRyavwWlnsb0MyRjVBEdtIeRKdiYnUd1n\nk1pe8o657WWbUje+Z6LgvkZpyGPnL16iPcwJ5SHeacqReczpC/SxJ8704hEd\nhe3v30SV7TNSiGI4PF0mxt09/BN74DZl0FmS5rMaMCgJpQ4R92JuzRw+WOgJ\nqV+NLDR8TXaRB4vgaRzZ4+0+MTNTDjp3/FPc3tzkGeq0Pyp3e7jR/y0unflZ\nVl2P1cZ8elOwK7LeuQf5jAvJH3slecsH2HvV3Yw7Cu3XmuD2XHxEs/+GOGAQ\nyJEDY5z/H0V6DL4qON+AogBqZLJKfHV7vgdkv8JuGaGberdC3FQylzbaYp4S\njxdlOTmUfZukxSWMCT5EULyKjKbU0e/36ZL8Hes7wfdxnEAWv/gKc/anpt2O\nOC0vBB+MQhnY937MJjhGaEEM8N77Eblx31yyGtMi53E0kiG23xsAUHqKVW+0\nSUdusbOQNbLtdHLxbyMBmCtc0M0lIc2o38ZOBv3sJC7wyGvZBTQoh/92metq\nSUMyfU5yQ5v6y1hQjOx/10L63bNFpiASK1jzUaEIkyrRGRqxU/ZAXbi2t7xW\nYcIV\r\n=D0BG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuWo0SNx0xnLpYSGgTlr+94+XOz44WfE24WQnrlKBkXAiEAuvAPDu1a1KG6ufUsh8jp41bB/idCU59HaD4JAbfttkc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0_1604932134307_0.1768781922778333"},"_hasShrinkwrap":false},"6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0","gitHead":"1f7f554e4f70ec2d5184604c98773a5d372f536b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4rqthRTX08iMWK3tMSy10Irn6nQjFluupDAp6sZWZxKUYRm2FaraQe1qapf1s1sNSGGz4eUCGMAtAZSxRKN+Qw==","shasum":"fba0f4ec014362332f89e1c1877a6a04e38210b9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0.tgz","fileCount":39,"unpackedSize":226413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ4zCRA9TVsSAnZWagAA3LkP/2kZ7KHXcQ3jrHIO6eR0\nIlrLCUUm6EjG46RofyFoEDz0/338jddu8pvEL4R8OleUIqwh9Y2tczNKyk/f\nk9dEg1LC133Qswi22HMgq7lQAC6G/D4569ao3shpplcr4ekX3AMtvjX8IQl6\nTpEojsSVcVC6ZGP3KzEjhshawHIexF4b9wSOdsD/hB45IbkdcEuC9zTPKU1b\nlN2JilPZmAyhp9fHji3NH/PFnFlP9miXRJcLQYUOIrsiItS6uWvvlvRO2pOb\nXwB7s1taF3s7ZSQ5e9ZPVgj7C2eWFzvUCd4omQsBpUMrAUMJDCbLPRl+UAJS\nryCWCm9slYxp2WeH+Hjy8DECck39yeqn2+FldTH1EOfk4QeQ2Cr5MDv+1wR9\n2Cz0U2JmV5uQMg0PBNxQycNwKK/xxIJUZsPMAV5viVg1kTUWMO0meks7j1rs\ng+2T5PN4ZGz/G1j3r6fVoUww3lat6FMIuwY3z3gr4cNkWRo9k0w0i3/QCtEL\nXWjwX2kOMOoQF63gywzxcmtruThVBlQIPJuqmM4b7yZO43E4qbPCsb1guhLx\n399dJS/opdMA/HjssxxRqoFtFNdkJoZve9MwaV3Cl3GrkzlD0YJS4untk5Rm\n6fSXyUxVDSES8bTRtTNsB/wlIYn6HCy4LHTgr0s3DFGrtn07o1w1G2GvI79O\nzuXB\r\n=l6zu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYRn4Blf6jEJlLBzsN0+0JoKPTignbdwSz1SUAgGlcgAIhAJiMBIoX7M6w3LYXpNw8appqVSLzRQwT4aq0mbsOgdXs"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0_1604951603328_0.2494689209498766"},"_hasShrinkwrap":false},"6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1487a0816b911cb6f0383d3aba8afdd38af3e71c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-93U4EF/7PrEH9tB5YBd42Gy1+7hpsH4j+0KmRGJuZm0u+VVFtSRdheNNvGzAJqiZO0qAw50DBx/L8+nOeDX5YA==","shasum":"3b3a4ce747bbfd36ecbc416532a4308a72be605c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0.tgz","fileCount":39,"unpackedSize":226413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ6FCRA9TVsSAnZWagAA6hYQAKJZ0APFYK2/dI7CjUSX\nddeC0wWf7By5/+8E5YtSHyOARQbbf5iS6rDJtE21GxUnkqM0Ub+RWmmP7CRI\nKItU9W3pMOmYHZCmNMRqmgaPQjfoNeHFae8Dnepm32KvK3NVj6Mu/r7ZJ0Jw\n1/63Kf5My354G8L15Eq2O7bHEu/G5NTlpC0jhYA3T6lA54SYfUzbsibI47dv\nb66oAc8XvBGfU/T4KbKPd+jpwKzCRym4Vujkf3fCiEU4HrSV8e2jTDc1uJ2G\nLetw5Dd2EKZ0mlJ9Fb7krYaAxF2ENEDYiu5tU/FbV7LWAt2bwsEYEoPyREax\nksvY+Sxt4p4E52GRZ8wNPa5mJURHbTYq6y5CalgtwlyuZVZRpZrgBo0uTm0B\nttFVBh2wNtwqoUrZ1vTkpC4Ub4kRWud+qsD8reG/jKVbR9Fyad50chZRSLRo\nbkKGzOn7rT83YoqbCqzcRz16m29V9kwmMazT0Fu1McAyRymlt4aPsEEOjbbM\nUQ7EUxIchZCf8wpJop8Uunj2IRwQhus+mzkr8smXH2Lsiba6S9vhXe7wjYew\ndMr/SVmfAcKqZ6HaCAeiAtC4dWSEGvMN12CKh7662lgIDu+76LKuRzqzYu7V\nIITLk5kqemdMJMRYFHiq+2UbNOwHRGVtd7TNqjlLVo+fT4bcF42b4E2tWL1d\nCEeE\r\n=mMLG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiJKsj5kQ75qJ8lmUrgSxeACUXogHerQLRA3ezgQu5lwIgc2mohSLnoDFVV1ES5NOxTG12lARQtpCf8LY/ta9HorE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0_1604951684416_0.6238288057252745"},"_hasShrinkwrap":false},"6.3.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.9","gitHead":"f4e14f150b9f4c9c5858940583968ec4b33b74c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.9","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-BTEenZ4Obxfl2k7LeC2BINNuY5M9gRSvYsfYcfqmboAFVCesydOvxHCnsUhqMUhSWpa/L7iIoLw8wVcKfwjzYg==","shasum":"9503e691e21b74a518bbd07c35dbfeea0f05a484","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.9.tgz","fileCount":39,"unpackedSize":226651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ6mCRA9TVsSAnZWagAAST0QAIx23ZMuPd3DHtAj3Mbv\n+1xCxAKE4N1fILrkGk0CCyTHbxoYdxkSYDldBJKftxHB8jHv9m0B+mr7UJ9A\n4mohovH3OMmw94IxJfe8kXzOP2OZRA1OwvOLZj6eQUmKkersVzj+TjABYjlB\nMvR53pmWF0fdsPRR82Apc/BGNa9cp5VV87FtcxqoFKpsKNjkqHC2mCVpuGCS\nG8Yo5gHI4Zu64nXB58H+6hctD4mQrjviL+npBXmmelmIwPtk2sh6b+8odBbS\nDJK8z1+gQ90pHUPWKuemVncYetePaz/4S6ZDjYWwNRUlxnbfkTn16xoYL4JY\n+N/z+hZjztbJcvsoRmNXstV+9LQpaOkJBF5vMwz0ZH4rrjY/LQ0/d8av8p1c\nDOFHO4nXgAFMifhqaGq8HfgQ01GklOZZB/SXjhWHkmyKcLaGpdLESJJMvHd+\nKysUkzM2Kh2kdU39vbmZEWbAb6qyysMGbYxKoKJ1ldvu9PhB0mdfMI177WY/\nxqa4lrIHbiYLJviSFvkqWYLurnNmUL3CRfRQq7tNftjBYfIjS6lDzoCejnWl\nCEPYy4boyngUk0S8BTiMrkEeSDXyZvnE2G1wbYQBdTxyra9pZQe9uG+JziTU\nuK5Ofxqp/SzJIu9lHaUzby06FGuhkiIc03x466jcGczWmFItqxmfv8zVh+s6\nAZMl\r\n=LImu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDghnWe9HEgKkikFWnipXX24bgxU9U8RV3r6xCIc61mKAIgU8wL5UBeQIA8PoE8SiGamjVuciRu/upzSl8W0SSjHTs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.9_1604951717409_0.05683401212774686"},"_hasShrinkwrap":false},"6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f4e14f150b9f4c9c5858940583968ec4b33b74c6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PTSnX5crv0hXwiZnJE02vKsUWx72CWj86hn9Qtz7WoMh1R32TF7xexujRIra4MWdgf/RWpVNjCwvxqDmt80eIA==","shasum":"3263a078edc523bfafdb7aa5468a49c1e4e0143b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ7ACRA9TVsSAnZWagAA/ggP/A9I2izy/z2bS4Mxpe4d\nYIzqYzEgiELecP7TWYphyxmhb4Ia9UoeLrx1Sz048/EjFlhZ+aoq54vd84Gb\niJMQTE1qREio0KbTl7D+0jN4l/wLwcK7P0oDMvUbg+kMU8AQ9cP5M86HDZ8L\nKcC15N/HLX4esLfP9gGErelOmYH3lbvstqWfQ+l7gMyk5ClPgFl3M5hWIIGs\nYWmpRkaKjgpd6huPjUvc/MhpBV0GbECRtbsukajVY+mlSUHGgdizHGJ4c558\nRk+IimssyTKIJb+RlCKzJ/ZQ+Umod1d2SyXBVWueE2ZJ9OAspnHRpT4eBpZB\nkgttVV0Gmcg7mSoy+tWgOKmt4bnSclQoyHs2wv/+scbIWH2Lj4nz2Z9hT5d7\nmggXk6H9ribcM6JrTEp7Ya09FgmYinR/D7vjmKofojnQtmyIUFXJcY20Rvk7\njDfK4egDMcWnY3sEmkHFxZ6x+vtO8jzVJtPgITHSv+Y8YG3vfYcQhdENRvZx\nC+x1p35T1VdDqDPY783KkQMpL2nDrB6/bqAVVMIGrdSEgIEFiSfwXw4SIpFK\nz1eui+xBUvnBI308ko2yCD5fTnGGWsi8OxogJODRhxvjJsYeoQ+MjYtI66jm\nF5G0I6FDb8xLCpbqFNgddHwjO4+2LSjkFBRwQznICNpQpXyf0AqgXxQCfcDf\nG7bF\r\n=Iumi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClr5gTGriU8C7xE/Y2vos0snGb0l0ZyxyvwxlvfGJouwIgY4cB8tTFufgSyQfjRxulX6Ktv6zAOql2TVMbl/RhFIo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0_1604951743751_0.5004238173320688"},"_hasShrinkwrap":false},"6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0","gitHead":"626bf6e10340620b69dbb4bd829bacb48205ebf3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-t616VGcgSaxHO1cT7UJshDF3Iot2LIw533xCJ21rif3Icmz0LOA7s21Y7zccxjcz602FYcnH7t0HmCgA8cQyog==","shasum":"b81877e0d29dff2e29292b5deff7143281b479bc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ7WCRA9TVsSAnZWagAALywP/ArhW223xailNFUJ3jrP\n2P6DS3BqvMEYYYsFAwn3ExAxIUYyNqX2K991QQEVXjUPfvWZWE+IE7dC+fYu\nmK7VOJXRu4OvhR7fs9PGpFqUo9QFdXcOKqkn1KsGUXy1Bz6HYM3H5T089ko+\nEw/Y5enJsp2MvWRUg4DZgGYyD1nyGTrwU21p3Db0fBSkxx63jrIgxaEoiHFs\nI7/iT74WH42TiebwLWJYEBnQLa0CWmfibSFDTnpdfwihWsHI1XSRzGOQuxou\nozucxq2yZF/nY3yWfi30S6AkmpB9Ad4M7nq1M97lzHdpTfDFYwOmmYLzpt/A\nhIOSDcgYX7UPItHm6bHeeRP+EcCQ1J8HwID73XLw8Qg3jGEMnD6UZDduoj+M\nx2FdSN813nU5dRGp7GGx37G4gQCn2+o3r6n8v8mjZEl3MBgogSg/AZOnKyyD\ndtVpPLQJvOx1OVZE1XBbuXLKhA054tdc56aUuTaHzYnx1SkW0V4wyqAKqiAb\nVonZrowdgSgx0t2vEoy8/DA3YN1tzYKhkwCiUEMZPhRS04vIq/vkvamTEWIO\n3kiGQ17KdXCxVJ274gTHy8wXdIeDDVu72yXnyPqi4Sx7phYsi6b9iCLqPX3c\nZqxS0idB2WhR5DNc5DOoQNUtJx2DmhGFDLBtbb9FQlYUCvA+2LK46QXr2CrX\nsgzZ\r\n=Fbxk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqHpIv6fOVTAhp++wg8ORoDnDvG/9dxXma96vN5U/UPAiEAmJYKfAU9vn9sSoA7BmirW5CvyPkSgUQZarFYxWfGagU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0_1604951765474_0.5660213194764923"},"_hasShrinkwrap":false},"6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0","gitHead":"18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nOVcy//+dzpLhOMi8f5uo5W6ikbTy/v4LZDIXqida/Zl5LCyETkP496Oc1VkUtdWGCpi1Wr7walSNSmaYMBMGA==","shasum":"7ac7fd4999ff594ac8e6ff861c0128a888cfb45a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ73CRA9TVsSAnZWagAA7hQP/As3qRmYa+fnU6yQfiG9\noEJh0ofEJBRvTm8LeT2dWeMQPAqRWm2qBTHZwk4QW4f7wMldEQfxigIUueHZ\nf1YHL1oJnD0vz5kni2QHz5TnhmoF1dsevIS5ueTKOOMbWUS2scXnJtcXL38W\nvkldTFV4k3IhvOOVhjNK4T701nBE2LxUob16Yf/ZtZ6+5fB8ODFGFGbDcDbK\n2f+vTk3EDhOp+FCou4No26TwjIfnCmCThhPBygv8jppVMs69fOZZFsD9/egc\nWuqL23KMImUGE4y8XzS/Rk1Nw9ioueebbvojnDTFCGbD2pi5qaHKP7iP2mpA\nu9OthHYL0KVtdmy5D98j1H/gM7k/tXRx+we7fAq/w6ggBPo/NBlnf1kF5vnj\nOvO6ekGZuK4aFeox6uIP0RZmeYXxlzc4qP9TnhqwOuXPW+tlGw5KC19FMP7b\ngIvwiB9+SN20AuFKdC5ZlHdL4vSHjZZ7kLYm6PYocVbn+NNbC0f9RgE6Fo5X\n4WavUEg5KOgV1lJnzdkjma/FNyPq+OgB4OXk1fDAImi64Gotw+mmjyiRSxaF\nVkkGJ+APYepMMvJ9Lj/OUWe5IDUhZa84wHojVeYU4JTrzJwZdeNcwad708EY\n2uCCKXIFWHrPvWy27BNwwwwcHWUY0nIZr0WDoz+m6KPT1LnL2707meLHYM46\nIu7g\r\n=xW4Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGG7NGpSoMZUJFAjmbIBsd0pcn4stjUEl63HvdCMV55AiEA50gjPU+tO3GeZCvjIlYlqyRpNV4SzSPrGmHuMw/Ms6Q="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0_1604951799075_0.38743193872803805"},"_hasShrinkwrap":false},"6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0","gitHead":"e711aa956151005d0947a5525d094f3ec885d05a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JT8krX4ye/ULw5RgputAoPCNFQ+O63fyNkTsrBVR23AflJP1YODzTM7E2wopL2yE5yDPQRBLJV40Q2dCxY7o2w==","shasum":"78d795a6eb2cc0052dc121e6d31ab6e939c1f464","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0.tgz","fileCount":39,"unpackedSize":226698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ8NCRA9TVsSAnZWagAARaIP/1yX6f45GK9WAvhzNh6r\n1Md3cMOcGiDix96seFBZvltflW2ZapOd8Szqc6ie+t/m/YKlW1FVHKIFuTu/\nI22m3ldk97bqS8KaNxUZs8opEMmZazzqdM+KM06OpVQiEyHfolUITYrkeSWL\nYMOXXxIyXcgOQaNWIROTQodIpQ+Lg4qorenoCAe/8qj6knp0aRTBMb/OjfvT\nIqnIXsDadiEmidSCnWPbfn5HtjN2KM3XQKcPVLiSxICJUNrzwR0+5HGreE1B\n5YwvooNtigHn973L1/DyG/2hzoizsU0njQf2WaT2r2Vj8qbQE0DFwMxMhQas\n593pI4TWArecMjkhxyczC5xdPMw6frfFQfLeWMVe4jU2+9tFwbOWFBmgxQb5\n/rE3N2rP09RyKnanOVc14WjZWSMt4uUfiyWL8QJCN/u9hpjCLYDJ7gra+VTq\nE1tgGde3HOD3Yy+zHbMTuFBxI14hFr4J/Qh3MbGL+WkgutwTQ767zsdxxOSm\nyMC/ZpzP1aAmBvEgu5AJnlpls4NsPgMUjPF0vcvZlCBJyUZHrwsDKMr++E2A\nzzIhDI1GKiSmqSRrmNXEIXLrSUfTbi+3f0EAxgQhV08sSqp7WnZ9Er46bMp5\n79EBKler9F0pLxeZVdp58J9juemwz1Bi6VhRezp4SLk9H2HIHYC4V4Af6iG+\nvvlv\r\n=3KMW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH1MaaezrB5HTW2h+ChAbhuYluVuZW2c3ghpHXYveS9gIhAK73aq93FeUq6VWSapPyctC+tg7ock97gNivn26916a7"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0_1604951820616_0.6923688589053079"},"_hasShrinkwrap":false},"6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0","gitHead":"d1c68826bf3a52d47c24a779054ff7fa31b84828","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Kh8WwwzraypG8369eqPuwtW98OQTnZLW2n2JpdyKPtcKK1n7qe//DFaqxYQ0sQGVGotfrK9bEUooQ1TAvDCHhQ==","shasum":"4fcead67a60c5abd38dab8bba06c659065643b36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ8mCRA9TVsSAnZWagAA7ecP/3wwdYAJAslm2zyxzK65\nY1D1EuecDceRWcfpr0hwvVyDns1SbjnGUmzfakV/3nqI89dMHAL10P1p0hVr\nQCI/oQ4gS+ChOggSwU20NYNuSuoaZpyBaVpaEoSBB498F2qF4LWjOldllqJy\n4GGooj7eh9R4deNU+6qgZE3ZZlr8w5tv/tGXM9fHwUrfC+fISKkAHRjy536t\nOcAMuGfMgUW25pP8bnnRo9jmBTniOTZ9ScEbKZLXiDEoKhe4oMeeFUx6GL9y\nQjk1/zRUdG9JIs+q9zFbth73w+Hs4YHgBf85dmnwIlegS7Sbu35hLzjdV6RR\nzRu8JleyBUSB0RsngNmAE7X03RIpujzdoXv+Rgi3urStZnN/GzuY/rpC1FPC\nJix0NuZy331Ig3/PewpZ9XjeKnJtZ14B1QrTDSS1qJBpsxMe4t/+I0Cl8Yxs\nvhY2SWFduclWMSsTgISrQivVCCtH29K8EnierSsEnOZwaz9UwgSefUaKMba8\n+C3eGg8I+MM4PXVCiSqnkAqQR3bkGsK/J6mmvZANIbx9LNTUrzCDm3YqIS8K\nmzq/WKPUdcTqkTYyJ0qRzBZARPul31KL5bw+NyyGojrMigMe35V12gKVksF5\nv3kPDEBSwIyjeuhyKikaoIYwI4c1yU+dsktXFlJX/OdGRFyVon3N+s8zhUbh\ne9XL\r\n=2k5u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJNRfo/wURCQaaaYM0U6EbuGxhkQad8zIgMJxxkYwfKQIgDrCBDKWuvbnwkgBRzVGX5oN9VgDrUY7VXb61aobZOgM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0_1604951845708_0.14753912515377277"},"_hasShrinkwrap":false},"6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.4","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0","gitHead":"aecea1847bd66ee0333cced71fdc012903f50d24","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9/cNzPH3ZMM4uqPXuj29TPavqQQeWeJaY/fOg1BiWlFH4rtSLhuU7elTLcAL8+eU/jLCLbzqxp73tyXujEb+sA==","shasum":"4080503521dba85c472f6291c41f8531f7dfdc87","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZ+NCRA9TVsSAnZWagAArBMP/1yBB6On8UROn4bSlr8w\nK8Qeb0X4BhoeTE5SNsirRtnMsYYsAG0np00FPJzpRtKEfB++YOWjKB4yHxs5\nsok7XoosKoaXBecqR7sCfSKOn+0tWpcn/Wa1EOdW6FAyrq+eA1jlfympGMvS\n3mF1lKAJrTk0dp62C+A0jZquR6RxE7YJs4kg5CoLJoRQvhpDOB9BqO2bdyqD\nGaoINVz/S9jj39t02GONanAEw3dSt32+DiqWUGXMng0jG/99fkPmi9U23o0U\n3f/3TdoEkzo8beSU1y2ozfUUzFJ7dYtrdNBPlwlt1VV2AqWyKnSrpC8aaHDU\nDJ3gSXDZTUOrhlGWur0EeeyK2liFuuQ/1ne6MyT3WF7TWMdxnPZdf5tpLyyV\nM33wo8phGjPPcpLjrLu2Taz4N4ABjBwkqFVgQ7YjmTPp6NJMHChZ/SXjf7N5\ngdJPVdG2knAYie/XhtnMSG/wsTsQpr7xKrQViRWTiteB3zyFBevm0b41kWVN\nNbHGYJBpKn+46ZqQYH6HMFuy3ygaUSZQNbPrTVMdSKfp/I64kA79lIJ3UsRC\nJ8keNBhFxNBToa29MxdnrxDqQn7/cBT9rq1LS1xjbu/tieVrNxmxgQbTJH3z\niWDergl55ccnQiHjAC30Tt5drtH19Q5OqsygXtnocHgOjK3Izs6wPI4k33rn\nU2Er\r\n=43oN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICeF3M3yZfR+qUtj9trGqd4iXzcy/HAx8hVGlFGtJ5W+AiEAw7DOsc4UtLEXpxGQtyeGIyUON7Jyta5TmkKQu00aFZs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0_1604951948864_0.08689924980892938"},"_hasShrinkwrap":false},"6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0","gitHead":"7cb45d37e434bae1189611b84d93121eb9dc7fbe","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/V8g0PMT+POuaw1Pqs8rg9c8kiFUWFt5Wwil0I2+zfcnVlmaXQKTCsjeyuPOFhzXH6ZUzAaIsO4Xp+WbATsTWQ==","shasum":"0fec640346e8906974faa5d75b87f546573841a7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq115CRA9TVsSAnZWagAAVE0P/05KPVq3LYrCzQmuAupF\nruaB5PxWuxt3kf/ZqgpMZxfvaIRfalFlNq2xkd+gmCM+IsMAw/bCDR0uvra4\n5F1i7njfw7bseKpU821MSN0elJ0lG0gCx1DPgX17Y9k13L4yl5QUqgsI5dNm\njdNPxz4aFg28QMqRPQWBeOEKIrubDoHNN3GCyfzTvNBPeLVSUc1/gn6b+RzE\n8sxXbdiGdD0XUjRuSyF3KB9HhYDosIqnj/RJq41N5tM+a8WMRSn4TlYPhQVy\nrVtFnc7ipydiB57riUOFQLg+i/bPGjhmUlPAkvKlPUv8FKshvmbq5ckIMGxi\npFzKpXUzwjd4fmXaie+yZ6tA8kQXHX554EXYZvarJKsyBhI4nUQ9R/kZhJc6\n6HU2Me+q19bFZMMIM/p8WMPmi4uE5KWE/dR/XxmqSWOvbk63+5uPX2KxIqCJ\nbIGut0O+uqjtE7c7GcA9JLLe6Op4P4a0IYDrqlyxtwZbrlM+HrV1P7PMnM6t\nFdtEJuPZWv+Y8uiwczBkT6hEKfklb20CjHb6yr8dYqGIOi+615U5s+hdDLM9\n3Ytzc/FSWvOOTx9oKpV57qmJB9XjIATyyEt/hoJhpyqqITn1k/HW5RSo1Krb\nAUWQyLVinlhV52xekWR9apLv2ed3w/S3TxxGH6NOVsqVDNRt4i1W/Vk6opZQ\n2iQo\r\n=baFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMi6zAzbKw+7Dx52YDjyRczfLEL0a9QBrgjzIDZJW/+AiEAgSLV9wUAvqnz0bFg34jE1zUiODoiRwlu3pwfghgxB3E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0_1605066105030_0.5249128381951507"},"_hasShrinkwrap":false},"6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"744412ae6407e76df81cb086deaf1fafa6f2c156","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rVTvJzpQjpdKBw4gOcScch5P9T1/d5Qep0WbkXcany+/tWyBY3KNvPxfuCvBMVQ8RJNxcmKe27XywaBDdn2OoA==","shasum":"df84480c8d453281d5527ad3728703ef49ff304a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0.tgz","fileCount":39,"unpackedSize":226695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq13eCRA9TVsSAnZWagAA0PsP+wdbXJNsAevedMZOit+8\n3bS7rRlpcQoDcAWda5K72ua4b53yZfwQDAYv6K2+qv8y19ZOp5GOZIVXRri2\nZBSs9BEbuk9oefepGkvU5hpC9bEVcd7JRHhlQVurNJpjj1nmZQ+eeTtmkrD8\n8iqrJeIrCvhR5JXHh0UqpGpg6IDGbdK5elpo9oK/1ZmVybvC6f67sMo00EGK\nPVVeBveVdYXWqcElq8Ewul7pVocBscIjCkaWw29y4kPaHqE+MUprz07/0uQC\nqILMhVkc/PSCjfy3kHxe49bFSouFDf0311eeJeFCwTRDfZcTdip7tLrw0CY1\nSAvNq/VrKJS50bKlb4tLelRs+t0YhoyG0iKh/+xmgv5c1k0Je7Wg/mF/ylhz\nxvDSa+2n07BtmXfdM45ICayTDYBIghD4NYEKqc1yhA0/xsw3Rc0EOFdyAo9I\ndKwnNErsEQQzfWPI/dWGJFboFEAl7TeT1RtBJKzRN7s7TZ+fG65Yw66z2uNm\n0cNMp7n+RI+YcFEE9LOlghjnZUhA6+B7DdjvEo04Dn7ng+BbdqdyhZIIytrZ\nQDbLcZuVC+r8/I2zeWYCf2RQKDzkIBzGDP+vhB6FPs6DafBLpGNJeRVyPJ/F\nEpkKcbBrTWF8UyKiWwXl/XortTMeyUW0r1nS3CaF+oMnAid4GRF258ryyMEE\nnAzB\r\n=tlYQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/qv+gwunodP1ntTn4NNbz+5e81047LMeAVpfDckWQaAiB6HNA/YL+4GMp21nFS6HcOaRnrnoW5VO6CYWCRZOAgwQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0_1605066206077_0.9637290604713262"},"_hasShrinkwrap":false},"6.3.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.10","gitHead":"74565303991823e6faf44a67712efe95b0a50759","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.10","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3aFNjWx5MX0+T+9trN968f6WGZgsuDPEIjjyoTAKN8qSZ9e2TgQXaTF0pOt62ufdlPOoBdJUTnw7OnrCxglyHQ==","shasum":"eafb720383d9b38709df80bb0927c0b69ce93455","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.10.tgz","fileCount":39,"unpackedSize":226926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq13pCRA9TVsSAnZWagAA7hsP/A6xmGWNF8str4aDRpAf\nsy75Fp40Jv+cbGkfVkiweq67ejjtoNlLg2N5DncrzHzlp75zjNVtDIW2e/vd\ng2THbJGt+8wab+GhZdCQEc+hXYLc10Kg4go3luKLuS54jEta7O+5rmIMAU6V\niZuKVyt36jPgHbvBIPTtoLyROD3jjXqvLkBf9LPV8dZVnY5E6q6f4JKmVRFa\nHR8Bqxc+/9kMcRoKl+IxjMQx+Y8aN+h11cBq7f9aAk0Cp54+U9Nrd+lRs8c+\nC90syyqvC8FtthoQvzma/6p+lccsxTVEjNywxoLj234yU7A/i6mln0Ecah1R\nubt2JiBwGKNO7D+8i+aiKEHb8rE55gXZcvr9aMIM6teZmf8c8nbVeNMGXeTe\nyt1J5HVIHH00teQ4DYdKhVdzWG5J173ziPEP/onKnlHvO7Gjb9u1zRq4Vaqr\nMDLsRcFG/Onp+gLrYMnJI9gE097QX/KASsx9jbguxfFWMZQ1KpVRm3w+B1RK\nwnuoue3u8jq6JqcDKTMySe3f12O6q6E/2t12z5SfmPIyU/iOKH6qn67XHGZO\n1Pwhp6GbvR5w0HKhqAJBS+LNV5x6/A0xN2Q0EQMU46HVD3g8V2RCxukypoLk\nVNGghDLgTqvSARqTZgmobCNSx/HVi1IUInBIC48p8wir8XbnnAl1QVDvt1uE\nIEXH\r\n=P3CP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRjSKGvzHH5tQJZx+xX91Dc6F2P9UmiigpP4LaMul+CAiANfcZpJlDtfibPzFX3lYlnKYfgIfKPdU/EV/MtJPJCFA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.10_1605066217089_0.15026495062912137"},"_hasShrinkwrap":false},"6.3.11-74565303991823e6faf44a67712efe95b0a50759.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-74565303991823e6faf44a67712efe95b0a50759.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"74565303991823e6faf44a67712efe95b0a50759","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-74565303991823e6faf44a67712efe95b0a50759.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZXsSiRoZIRJx6/gYxdV43RnA5vmx/prv8w4q/0jRe7OnQ/7Eb10w6aTj+r5KKRugBE2/CIiP6NlEa4sdpC/ftA==","shasum":"9ee85ff0a9e07bcf7b9b3135c030d74c5e103d1e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-74565303991823e6faf44a67712efe95b0a50759.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq14RCRA9TVsSAnZWagAAMygP/jtNCQ4aKKADgiEnJ8Vi\nqFrKG/pPB8m1oQclGUKxVwMdTdEpL3PcU4UHiFLA67iPXso7WhvsaTTUW5vZ\nTr1UiVb8nrXbhaNYOXahsEGCKtJjeloN03NuVxtyvsydmKMPa622ePbtQAib\nNgfr6WxLclAH2EvgiFfYJABQyKDL2fHleD/TpQYfnHIzFJ7R5KfTGOKytiFR\n2UzpY4BgO1UFLKHVhjX12EZcIExF96kBhFJhOWKvmdQ3Swr/Jr6uYyDvhvfV\ngWLdlwrWmOXKRJqpn3LfiNgpIc1HrpvL0HvaUiaQAj9Y7U76U/Hs6myaX12t\nNuw+1ZzON1thUmfnn3W+LoR2gTaUNs+21BsG4zbuLILbd++JQBKMzdujp+vx\nISW1GQ/y2L+gSINz2V+rGblbNMJJDs0pyVcQEsKrn7XtrU7Iz1BcEduSuFCK\noOidcu0RWy0U/38FBNx7gn0tNfh5FH1FcDAMItQHbrAhSwtMO5Kzsz6oU2Pw\n/jviZ5Ji/LRux4PkGFq7ZDm5sgdl+m3ok22m47eI0MGX2pNAo+hHPqYer4BQ\nypvM4W6ggEoq0PhXARqhDFYsZJJaznPnzlhmnztIt0nPYMcS8SX7c+xIKXOJ\nesLrW8bGsoacBI21dvP1zwVRMijujyFxWMLXcyWeChPi86tlrHhh8D6v2Ltf\nepP5\r\n=yVbU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChh3W6Y/3Q/Ezww/smKRE/EwvSgt9XF8rHwCpb9eSmNQIhANZ/T/g20fjov2oNAHoPGmEnyqyJLgPOTdXPqNOM1BQQ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-74565303991823e6faf44a67712efe95b0a50759.0_1605066256608_0.99317825113699"},"_hasShrinkwrap":false},"6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0","gitHead":"9090654372cb26f9f7456d6a93018b98b5bcae6d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PPxP0GopJj55ZFbBFRDclBM9Am+kbxbKdx9bpwJNdIEJLyJyeaYql74tYgjqPByB4fx7RSfek/4nRrqJMEfWDw==","shasum":"d9314436f53a761bc4e1d3078c0047d9de2b403a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq14rCRA9TVsSAnZWagAAR38QAKC63J82rKwQ78H3eJik\n3UvfjmOzrok31/xG0l5WyVZhwYxJ6+PrKj0dnV/gijbOdYxVAoVhcC/X3JoN\n8CCvLCPE339JzVp3lDqFbFLzwg69ZhgrfXCAmAU5xa+usiux+pVUfAUfK9qy\nqMh5BQKlV4qiJxVww1lN9wp5kxInC6O5gUKkjxbcxmjynTE1v9VOpNn1yki7\nxJZqpX3/swyZd23df4qT9T/JpQEuHhS9a5kCg747dPdh33bltq9YIbwoTspG\nWS5xmGSNrXvpCbCqp6DatbEj5WXyrAgpmvt5yxa8S+pE93Jhxvy751JKTx4h\nnjQyoatUYBZytzTnT1Vz4av5aZLhdOmTbjy11ZUcphaW/cZbomgwebnzfeua\nsBuWhqDP2o95YMn1Ve5R9UlFaIyqyU6Z4hjG28zDF7jN03U8wgh0q9jnZPFG\nFdKZIG90ZClors0hWVUXODJYSb0pyw8bQ3AQ5G75y/kkmzUv47j1jURhLrLD\nm9Gpjn7I0ZpZVHRvidfhV5Vf/0pPfqPvu+u9ka3wLLVNM+3PQ2oyO5TzCDH4\n2Yz6kOMtHkW78GLONkzhEer9yiKbDOI8LDtxjgeM5DkU4qQWQKECc4FM8sFJ\nDjoFugJBUvkCSPxYTPsGrL/8zzdQCnb4ZkuBcWD4IzqZLgGLF6ZGgry5uzoS\nLE8H\r\n=apsc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBWqiTiW23v5SwHM9FMbpLsNOY1cmesscHGt01cNPsYPAiEA+5S3Ve3NJRvmNgY039IoA+hU1Cemv0niqMfBmZjxdK0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0_1605066282519_0.4367456345768814"},"_hasShrinkwrap":false},"6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0","gitHead":"e13afba1531e56f08c5964d8048053a9558b0390","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9OcvD/p3L/zudYPAh6C1WvnQhHLIwRFlldMPHBIU0OUmXZAl9vF0OMiy90bcXuUpY3/3im7r0Z5z1ND0DNB8ZA==","shasum":"15f9644c4d84dfc015ef3d1c4b1e40ea3cbef169","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq15SCRA9TVsSAnZWagAAR2gP/jDXVZOaopsmrP1spNS5\n1PKgW/7i3uQbhAK8vPLhZB/d5uvcMr6ZsXd/Qz0Q0WzmNrChfj3c3QUZZax5\n4sloVa/zyKEwDUnm/3lng/ZD9u5pV5d4V2IjWOuLfrxrkH+rucuOtgBta0dD\nXMPIOmArkalNaszIw0zZeNJoRrvblxCHrsADWlDcp8IXIoVL/7AJx5dgw48s\n2/CeY0KJRlUPatGbyliGclkp4/TTmIFl9xeq937ICcCPZUQCSweJSb68MaDX\nmLKSvLMPQfgIDdJ371CXu+nmB/UgsNMov4t+XSi9H3iK/ERniFgTrWMHiJ+w\nN1vh6/tF1CF0RJFYaq6tfrsE+UBUiqQGXNOnux+FBm+aFew9AqMQ3TLyPY4E\ntTTJSdujw4CL9jjfek6MCHuK7hzigZOeX4UJCBW8mxV0WVOHqPtiSRBr3uoV\nZlDe5vuKSLynrcBcupHlcWW6uI/5dIhNiJkFU2rlyLB8pWchmz+Egn59T65x\nAyFZxpP+bqZrdkDtIN5KkAlkOCL4MdJx6UvAlfPmjnuNva3du2ItdSn5oGv5\nWLFhasA1tUQ5NybM3vWLeGDB1x4aE8A3CILh+oBPLZr692+BnyPQHh3Gu9Eg\nBnUpvj+ZuJBGZjLNszov8KsCPqmzcNbEWRLMsLKaivboBDfXn2SjGKL0yGuw\n4jZ/\r\n=fWPR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzilHlaFomjVu2tFydD/eKEteBH8Fgc56dm7tn90fwOgIgeNZ+vQqxQbY3cQ20wdq0JxATDKlc13XPpopOqbjSxaI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0_1605066321710_0.7449901784220425"},"_hasShrinkwrap":false},"6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0","gitHead":"71e8de978bcef6af2cda43cb783cfb73305ad97c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-c/vnMd8E0YufnIkf1/JPhpaFJY7JbXjTcGTeabJuqVe5HwxM3VCG2ufW4336bl/i06ymcJkHEDCss8X6tU8fTQ==","shasum":"2f6d38dda41194b62bf9490a7338941bf306ea89","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0.tgz","fileCount":39,"unpackedSize":226972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq15qCRA9TVsSAnZWagAA8boQAIEoroIpFfl2YhBsmSsl\nZEh9W1qWT1gTgPwqIZdmTwLxSwB7HMcn1soK8EMDJdZ06Ei/+WhgDOgg3JI7\nn3r4FMtUmnDh5P0sRDVcMUfz0+7T7fOdlV/0/OWRtfb+5JmOQBHyLhbaKDyS\n/pjiCND6s4P5OPHdgH++NvbaXwViQfh9Rsn1qFcuSEPCDp8WZd+g9xK++RBE\n9yCaf7fuzCSVcgf589DXwlkfj3cHTTixyarfC/9R0N1/Lj0CeS9aGEOkAN0R\n1/3nz5+6cS8eVTS4ft6EhIMYvieafRVreS2muMMyHES56Os0VOUv3LYXa2MF\n8P51Jf82Q24XI5+EaF2dtZJ6VHBX2YNe3GXyoIQHCPl5LuNC5jmUOEnRNjhC\nc6z4jK2W0W2Sg/9Y6gJv4H2o3dj/fVGDPL6Bcg1x9J/aBLtYm5Rg+YPefRAv\n+dTsFpQGl4BsKO1A5j1kHkdndbUwlA3bkEYp3jefrvHOKIBgC7kpa/iivGHy\nsiyvcyFx/FJcxMeOlALoejC1dUMWERm2QQdOZJyZpditrn4gd4fj19zLzXp3\n0wlylrmBI+dpU/Qa26E+bbgNYRxO6iXsQfS+J/m54HAz8EvO6QBwAR/w9abI\nv+XJixzixoM8sMvtee7aeIEOBo7waUIb3JiQwNMq5P2kfhVokPmYz/Uwnedh\nuJiW\r\n=SnaY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKjUoMP7x4P8Z4Bjhl+t2QgKhhMhcuc1lPS2hF7L88SAiAQUk9i+eofXKweJqDo2ogaZsfMuYEMhy3bPp7byKvm3Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0_1605066346070_0.8535170755870989"},"_hasShrinkwrap":false},"6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.6.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0","gitHead":"ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NGx7GuVVucMMsO2gAfb2WeRJOhwwJhLwYl5A+b1ji/liRi1wzSu1yMy0P7ujy3MBe5AE0tEo3KvOvKmJ1talKw==","shasum":"af36abd392f82b1e623672e861d44d521148555e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq16zCRA9TVsSAnZWagAAHUYP/jZu07u8K34WIuIOuNE6\n3QF3h5WpjPAZxKicWn5iZHU1NO/XPl9zKQGabvkNYcw222ix83q5ZgaqJMuc\nBarQ90kfGwW0+FJMmUZ53LsRyASLLMZCVej5KLf1KNYwMpubjhGxkaATkQYg\nBxORIR4GKI47j8+UGC7gj9T07VxIxkYRfVs2u33NywQDzCTTDtJe8XxIj/st\nAABm5m+/USarUYB460AxPrzy3ykrvTYKmfsnPYEfFOhLB+fYUosv6xqytkkn\nnqzFZUmrRU/y/ESX3hB+xO04fyOUFH7N3ni9a+8W/sXjyhu0FMgCcGeOdyVe\nMWXCFiGj3th40e6y01rrNjpwvs4mkWLznN8GnHoQo97u50Qp+pJOXTuI/tqg\nknrjyQLHNSMaPSBm1oPTQ2nllvwOla/oCNJ5in0E1oKU00w+Gj+qakTCykOp\nvC3bHTWABwgPVSJl8tlSehMPb6j/cD80uVRkVVU8Rb8/Se2hP6BCHWv5Tgcz\ndF8/6YoOrDaCYS1h8gPumaMCX5cj9cUykJ3yxnl3vprj9iSXDGigtbUUBgLF\n+N9GoIYQFusv41TS5L+T4rvbsGrTtl2Pz7xcmbGX71as5oKVSP7pJokUbkfo\nA6qcfRFKrtUYPMuIjeOb6ljCRRaqhagBUTULvUnZL49jCDTqV+AsGfdTMC+N\nKp0w\r\n=jM5N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+nu1E/cIM8RhH9TqWq7QXhFdHyGP/zmZ4MTgsKpc6kwIhANT3Vdl26ayoCdWcxfgWt3q5QmWWu1k2Us6QgHSTcY5s"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0_1605066418452_0.7468712496360208"},"_hasShrinkwrap":false},"6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0","gitHead":"cca30d61084fb9354aa3e895e869af2cc6836e73","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6jqSBhWthNZP6a77ZPQwmJzEjMsFMvz8zfdDWBh6U/+hnfmA6d9OhH7e/Pxbj5s8WHurWMGJ7xFrJobmRR1Wvw==","shasum":"bdae784dfcea538ffdb6aff308f0364a76a2e0d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZP5CRA9TVsSAnZWagAAuBwP/jTuQZ/RYAC475aYn3tm\nA4sKGuyAAcokmkZkIojnPonje7SLE3w65WF8voAU2G8o0HaXioIQV3GxZmLn\nUTVpXPOFtXKBCc3ZYZG/wuAA/kAJ8yjz5376/uck/jcCEtcNN4AEAm3a56iQ\n/rWpx0cptTJybzYJ4otJ0VVIg3t7OTSMx37tmzqox3iVHA9F6DSeATbsa9BO\nvIgeYvOtDgdy5o2yFPCBawprwD2/P+dMN2PmdsI/nKznfKNmyYoRsHtKYSZK\nTrKkHA1Ep0gow+YVOMgFP69UqDlfkymYUx3EE81qk/dxQWWiVzUH3sp4bq5R\nQd5Rz8cawFha+ynUZUvzS5ZncHlTWC2UhkLmLIotfneKtM53/A54QV54FDkW\nvSJMY7LoFG6aKEx91jXgQnx+GeKsK5l6qkYswpVx3P4zjd9mMaJ+Bdjnf4ob\nMT+4RtGwocmYgiB4w7eak1IgNeo6DJmmtArjcgF4UN0aJy1+jYbGFnQDUGfy\nVAQ2l78NMId1d9VFmrvYXC2upmoekeKp/LmRNFKlTM4XEJAbLP+8VB6dip05\nDRyW43JVm3H6hbQUrTdwPiQpHSzb8l/wccV/G4eLkxGzHjqY8GaUgwEMbE+W\nS8s0WSdfP+kY+SiwjFwTNzIHpKEfzAci8H2ceF0QRLIw6vcPlwVsYNF90FFk\nQ3BM\r\n=sZnP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnaauSXsrLfnqwSV2MehzcmIs+FUdxVMManu1viXy6vAiEAkSzbHsH7oENEBTwhLG1PxtAKy7MJ6bplREvK2mXPMaM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0_1605473272946_0.8745637838299822"},"_hasShrinkwrap":false},"6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5913a02c36e86f38b802744a0b00f4fa27c84cd7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-32qSBiykWHxGr+Hfe5aHPpvq7dbe3Rugxgxmr+cX8cZB2SMt5V4cYu7gGxhjrV/hmnz3UDp6pK7p92Bwmm5Wsw==","shasum":"064e68b7d42b4d1ff05a18d8a7a39009cc48ccc9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0.tgz","fileCount":39,"unpackedSize":226969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZRLCRA9TVsSAnZWagAAhloP/1u51ZdKKYjJ8N/XvCsr\nmrTxPUM4gCYohFh3SZDb/Cho1S6GtZnmcuBADBXq4aKX46w6nfEbcBpnNlJe\nS+DItIaZ2zOrwLXEZRC7gnQSiIf6L6EP2RDEYPeZxCjK9duemZ23qLLhnvNS\nw79gizI5v6WHQ+ll+dwxbR9pRwFqlZ/5i9iHVBnbfFTBXV0WLh9wxwLeFCnJ\nLf3aqjctNPpDGQuJhTlQgWoXCHWQh9Gmnu/weQXcHb+wENQygGvfF61ztWaX\n2jopmERTzRM7FOlmxjU+C52p2nNBwq0V987K4smVexNGkjF4dupMk7A3p8NK\ndoaS3lp1jBHkFhK1CTgsB6v//IGfwjmz+Bnspkcxr/nODiTK4asAtC3EM4iq\n6GKHpmBpDm+zB4zXxmCbpFBA8Tvnl8Pk2/q5ypkmCZQfJoe5olclbMDEr02z\nhvscNJBkXH7v9OOtvFXzkeDKQmfNuaA18GY43yxY3By9+XAPXA6gTSCsxu3a\nHQKTHtIawehWyluXoalE2F9EU8TnXDEotd15CZRNSxpXrg7bj+P1/WcVN+Bk\nVsOAtARJ2txEOEM3fukNqbGqoZthVc01B33KkhiSKT2O13QaNKgT8KGKT9Os\nwPWcXLf8HjD/qJqYdbZ9Nu/mU4mxsGpcD96MONIXoIH5xBwRbvNqB0Ez0wOQ\np+eJ\r\n=zGQU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXxL/kxZO6M5dfDefdMhrOaIFXl+UlIyzxUeYCdmXT7AiEArOl7gyJkK+C2kRaDFDMQz+ncRzEAtCON1nfGUMXqcl8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0_1605473355449_0.9497088315191575"},"_hasShrinkwrap":false},"6.3.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.11","gitHead":"4065c6b5024f48477675b1f6ee92600c7bfa298f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.11","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-bjxZfgOwu1EaEOYcgPGX+6V5bix0z1x0MvwWRELPv0EsrgYlOZfRcGaIEyxOPh+v68qNz4HSGcZuHxUNWJzzNw==","shasum":"03bfb4bc3574a419a806af5dbc02c1b6cf949204","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.11.tgz","fileCount":39,"unpackedSize":227205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZRYCRA9TVsSAnZWagAAeU0P/0feyKaLKLP/JZQ/ztdW\nH5iYbqqu5V6tQN28fGOW2D6yLgEx23ZXM2iHaT1Is5b/FWbfx6jbnyPq3V6j\nFs/z5E2w9fDm+9P2JA50k9kLHeoXgwJq9sUXowALkJymxg5tZjlnz1kzZ41m\ni3ETDH+z758VGEgi8SMS+2zy0nvxbdtv2vajMm0Qyi1LY/7UZnPds9SO2Az3\nUQV5GST8ZBmW0NnD9e0KEwHj/b+Zo0VbikK9VeXqqZ1rvdUC0106rbtHNUU/\nKsjXCgySRHcvTNEwxWO7f/Dvcpk/jqeriuaryjvX8hAc7nVMNpgt1mzfs1H+\nRJb1NwZ1KH3poIM2vlKSoGW6RKd9d7RECKHWC/jJnllI3l7C9hRdSl1q6Ha+\nc+xi4NPl1uW2nvIi2ynHvlWtvxe7RBTHKYLfZyB2qV8V2l6VT0YTVvlda5f4\noHquiYnC+E9jk2ytjzTdoso7fO/m5ogiRVp/79rt5cydyG6tBM9sku+6xFG8\ntKRPgaXB8g+1a57ImNi5meFeA37Mi8Cq193k07Md9lljd9ydbq1amU9nAijr\n9JfEuLYkXpeTdpp2OPRAnng0kmC7x70nmad5731sPU8DRPENMJcKY5/qzssG\nmQbcXelajPqKjcCDI/5ntfDCSwoOqhmfokGNfzcXXdonUFF+6Nj2pUoHl1sv\nsS+N\r\n=c/V7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuHyc1cdvHSbfJ2xzz899PS2n8Ut1hDogZ3xF3YJDrCAiAsJ7M2cWg8YteHhun+T44e0/SqjGs1kAi50C/SM+2srQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.11_1605473367444_0.756511607315328"},"_hasShrinkwrap":false},"6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4065c6b5024f48477675b1f6ee92600c7bfa298f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wj1rteEWp1e85Npua6PhqOMSbjXt9H/DLMIoJ4hUsKcGJi6hAv6leuRS3PoJ81NoG89jkBp9wZZmnv+NiufOWA==","shasum":"d2f1859932684de5ac4d23d587cb35cdd05ee44e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0.tgz","fileCount":39,"unpackedSize":227248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZSHCRA9TVsSAnZWagAASBgP/jGerW8j1LfeZyE366Oy\n4JxfpNiDXkWuVhPuwbTL6I4pBtF9A7mpsSUXp9px3CauSlN/WfjKV4qjMQQ8\nwHrlTCtojTan/HYigSwbjDNFcF2oTe8nEvf9SeD3ezINkqITmN7wzzZTvWM2\nqelPEmIODbpneXHjG4CMkRpKgW9sGlmNgzEtx5iYYxIK/M1lpXjMZq631qj2\n+vBBS5XcCz7+lwP15Pra0cbUwiud4JvVwtbazK+++gAmylQFnUIgA2Ty3BC5\nv5VhzAiIyr8cpdWcC84mPLOEyVqJRmDld/u9CtkqRELw6oogLfiKf/SSZBOA\ncquDGVe68DAEimns85BZlwBijQk/kY/4G6T2SUsoDeYPyYv3z9X8VtjM1VMw\nHM83EIbCeFPkVUSzcCw6+X3jnBsHXhDryelwYnQmcmr3mo8EXo34cCoGy6Ra\nBbqOx0mcHxEu2WMggQdf+2iyjVd+VsAQRQ3k8bKEPapIFjaouxzHic5Iq/cA\nmYsDI9k+Yb/TsVthn27iiIhmWMr5XF4USmQDIohbPufJRTze4t/r/u7IVM3T\nZoeMgJCv/ILe6FtkOFxIlH1DePD9Arwe7Tm4SIEcJKW0tJ6yNhOQYX92UxYb\nRlUZAu9YRy8bMCaxJIOhxLoimuO4wvZn8pz8qmz02tZqcJ9LuCdTvIiEOsW6\nZvwQ\r\n=A9BJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc/BmeU4iUZLZw5KgYDc6a1x+zXglq3aXPkSSVFgxDLwIgPh/WWfFac1QFmorOvTkcHzoFws33k++P0FX4oJkcB+g="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0_1605473414667_0.923949613564437"},"_hasShrinkwrap":false},"6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0","gitHead":"9a05e06f4666c5890643c63867dc936d32a3e187","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-snhYd0Zsln0PZus5LsMXV/ujADld5ZQQsMYwS48MQZuEIlNuMzy2V5Y7T38Elt6bxNSMKFZTrzA9TxJ/kCaQqg==","shasum":"aa91545f02ff3b3597809b874c7e9fae4242aea6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0.tgz","fileCount":39,"unpackedSize":227248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZSmCRA9TVsSAnZWagAAPGQQAIJI6USVosMKXJe4EfjY\njBv4oSPbIi8Q4l0HDrTVrnULDISICU1hHX81b579JSWyeZjrBiJsD+jbph8b\nGpk3naoqXokvihb/afqr9y8HrXlWS8zhDr2K6ol050gl77+E5GCsPNSEvdlc\nUFOGQ+2bM4oblp1ftmFJd7RPvRLAcL8lKOqFUD16o8XiwK7seOZYQNVPwDkC\ngKbfj/5m9i4wGG957813KIcFhhN5LbUC2ka9F6PndTivLK186xBR3O2pCwmI\nxgGSREjKm+2fmROXHi49NM58MeSZp1LFOyfaZcpRgNUIvyq3rxncWoFXTq0m\nausjI4aHKSUsAWAkVvONwke9xc9D3KNu+FHPQkRgFNTVA4MPWSJ+4/lS7MXA\npms77zOLo/p0m9pnm6RlVOtcptzhJ2p/bw5PjslXCnhRc89Zn1ENGXBsJD0S\ndHCUBtM9GO/h2fSlPtFPK+3WZ9/hixkWbOLYoVGsGmYHo5JV4YjqhhwTS2BG\nDmnG4Hq+2sYr5wzuf+i+R2Tmd5esl3wrqdUcJulTIQSt37rLn1ymozQt6KYp\n7jrarh5kpp5/psHR/xuKURccgUZE6FI2FtFSEiM+Kbhm2Vkn0itnEGxVkHPb\nfloFMbNs/reFIsnO5M/jdMGRpE1pJhEAgORcnW3XcAivHAw3XaOmy+3rrlvq\nZd0B\r\n=wKbt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpQfhM4Qehm/bgQgb5UU5sEglf8/tqghVmX8YP4sOrnAIgM2T6nkmrfyyjJ6MqiWKYj8VFv7WZUTVlB29yK9ceAZI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0_1605473445808_0.8318308619840946"},"_hasShrinkwrap":false},"6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0","gitHead":"dcf8d1f5fe83c9a25454ea0ee62519142c9af945","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yg3GBXNYlItgrINg2MyH1MQ8ltb9AwsLXjeLp2E+E0XF/mEeh0zYNJWLxkC+VJBD0j4b83Ij3xwa1uw+Vaak1Q==","shasum":"d2a8762df52473fcb895d7a3fee5cda914c28c55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0.tgz","fileCount":39,"unpackedSize":227251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZS9CRA9TVsSAnZWagAA/n4P/iXaT82+c1gdyRCT4rTp\n0GPNf2vjLK0lo6epee8G1JepFxWcrMpf0RyY1PTMYQCeUlIaSa6s2O+Dy82A\nsCUD0FRAYocQ7XFkl9iJvc+H1+8lzu0VAa460kW6paml6ldaW/8QKp5Usf/n\nkmHDkBQ1BpNZWj2XyjLDNPFBzUM8t0B4r5assrG/qeNoUVpUXWcHkrDHv9AA\n9vlFxDtC2FfxQKhxkvABQLp7uLs144GiBR97YzvnnR1W6t2u5TRSDh/okvlw\n8HpoSwkTI1NiWsw/Lib5lYuout2/BYDjvZwsMF7mzr4+nd+49Dbu+YlJpvr5\nFeD6lRtvkw9QqziDbiAZ0++sTiWXNkzAeT9pjnT7HrPO3eqk/jwNtFGpVDz9\nqHIIDUP94Mnw2o5YfzaCba5gtySb078fCHkzUIuq/yhwr+27aLYpNdkjNw34\n1eUpF/duu/iQzoVxvHy0m3P2/bpMC9LwaY8iEccgwd/JAUa58ldZ0LLNzwnC\neTa5VsI3kgvzSa5zX6EIoSi5tav1RO0XzoMj4pIW7QwgE0ZaPfXjSKN7DbKL\nZyCqSzK64qlZaX+4bn7VWJkCRnPmpWUlojqPFVpBMFqbaHj3K87eYiAPGbvw\n7th2z5Ywk2gGwS4qB2kQt17buvcrSrQbIbmgsmlQzn1XzxbGBD24bSw4Fwdd\nSBSo\r\n=ZKNz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDky0sydDt+6+YjQYMRBiRwsmd1j3Ke0068z+SZx9Jr5QIhAI0UBL4JQz1zlSExJfWFCfJA3oyLLf4yL61Iz+VSuS6k"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0_1605473468848_0.9754307900884251"},"_hasShrinkwrap":false},"6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.1.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0","gitHead":"777bdb889ffcff51662e32fc27a3406b2bea886f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mkhwBcbRUTWF8yt45pQr9hzmdF0w644k59O2XYLwhp8Zsr1V0wU3N6bNInARjiZuhQZY8X8Ce1Srnw7Rs2f30w==","shasum":"c811e03e903cb727441ca8985be299b5546256e3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0.tgz","fileCount":39,"unpackedSize":227248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsZU6CRA9TVsSAnZWagAADPQP/1Ow4PVDSEQXA1Q4rEMf\nZcTWwed8dkpAYkAufcuxgzVtZLPzB0A9NxlGVvamlgL1qfk8RmEy4mY2FLQV\nGE7+sA7bgFnwhOnkEJqN9F/TqW3b1d7h/l+gGu+dLshHyFveoi4Fi7HfXuRB\nmVDz9hKYV+ZceGVkpicY50nz9GwmuI2w7RJXEFlKxVQmE0dnnScaTGHYjq9w\np73fYwVyn7VhCLRiD1jd9r1ZHzLkYxKuhjcXG0j9C+lLVXuFsPi+tMgOi/lb\n8kGBNh3HOQTwWmSIZb2uF6ypr5gvsUChLjUex8XOfIBQYvqIy0oWDB682yio\nuJ1WeVPR1CQLdvbvfZqo89WOc0EyDY4luDtCIrWulEEJk4mwnkrI/5azorGt\nFcuvRohvMTjzLDVBZ661YludhNQjoCRsJKZxoG6BzamHRSIr50lgy7xDSRVZ\nY1uE0wkxr5hwoDMbOX9TB4k9XKC/Jc5KEef6kVA72phdq6aRJ16DJE7HNMpJ\nRF9EhKIwSi0brS2rCzMcHVp7/tdQoBv2mJUXqodVgqK0ywIVZnDLIdmjmokF\nMoFaPZXlOrOO3U/8cYLQgv5OaoAlUW25xClp7346t/fw16T6C8ZcRD9PDz3u\nLeYjYfKpirmaS1yvGMUmysdQKvt8CcU6OCVffXrwOa9qigTgSalJ2n+DGaUE\nwNlS\r\n=kPIc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvVtEjhZM1DvwASmnncrU1uROwSPU0aMpPwZW1C5osCgIgTpWGPslz2jGfeHianZvFEqkp7MJipfSI1jMdD8XBjUA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0_1605473593517_0.6502952641691835"},"_hasShrinkwrap":false},"6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0","gitHead":"6f789660f15a02cc21601b932c2f9d36dc1696f2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JtDwVHEAh3r0VK1xPWu9ewbxmP9qTlJrMH/UcXitiRJbKPESOtndPS/iavB3XsWgV5N312y4XbbSXvPFftrxwg==","shasum":"30162afd719380318a6bd7fdb47dc74475b1b27d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0.tgz","fileCount":39,"unpackedSize":227248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsifjCRA9TVsSAnZWagAAlFsQAIC829rvWBFfNkfWklej\nt5G0uwP+JE/fDRzAdCAds1+BnH3zbT8S4LAotpHxa8WBdczbpakAG59JevHi\niCZXtsA9mDqfUY30UOzPeAwCdAfMBsxNA4lof3GG1ze6fLC+gYXQaebKfgPu\nRG44tvgJV9WVU2KlCStoWjlv02MWO+Dfa1hlSPucnoVV0Xz54MMrtbYgSmXi\nAK2R0rK8OOZmwKoGzbQruHiMAGvlLeGpfAxC3KbNNjE8kEUiu9fB+fFZzm6e\nG324KrGP8IR/9eeLcdtXD1BhVPRH10EGwk8P2awC397aIu1Hzykbd5ygyKMN\nZTebqzqkn/qAhT/f3tvNF9fX20VIenvt51vZ5KwFNoDVV9T6edjW9S1DuHWy\nHjX8dRGW3Ugj0aHbd0RhktN9LLDm+OOvvSRZOEN0iO/x6aVYfsm9qh3raQe0\ngSA5tDqAwl90Ljhgazdc23+Non1xJXYJbivdIZnJO13Yq6jzBnBvSal05jC5\nYxNDqPhnwwcBUCJSSlH/ZldAY3lSQCMFnh7xO4wWVHL9sHlMOUXqX2Gl84jv\nTB2P6pPziVsHsCr8TZXgN0gPPELqnJhTJ3cdUQvs5zvd8r6/7LTJhTQzAxWb\nRAthTLyEJ8a9fdxNAzt3K55qX1Judi0E+0033C48CRp8UMjKewzumQIU1L10\nLIAu\r\n=0cDB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoLaM7tlIDZK6hDHRf3cPlLVASo+CpkGHTi4mhdQNFzAiEAlT/2tnM6TsKfAiMYwEzIr2YP/iTCVDTY50fyICxvwGQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0_1605511138523_0.9726883691566786"},"_hasShrinkwrap":false},"6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ded8fb077da20ac403e45ae22e243e7037c2dfea","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EHcuIu1WZz2pRxdrXjMKGrcN7QUc/kMjNa5tOuNR06ThM8nkV4kFGVYOJAox763MzmCel2SnJgHOm2pdFCHPyA==","shasum":"e89e93dd1727a8a6ee2cc6a9919b361372079044","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0.tgz","fileCount":39,"unpackedSize":227248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsigXCRA9TVsSAnZWagAAXTMQAKFeIsMMDsTsAFxdBV/9\nV1kok5met1PSau8Hhds/JGuqrr9KdalKkIgFv4+i076tFtnuDlUifKtTGxvI\nIEF98w4Ak8YM6PxnyYDK96tUKzbpEKKOWpU/GeNtSBNlSqNtnMDuNmLgHKX9\nLiQGdKnjtibo8zX4ZNoJNGVJBIllrl3s75VlbhExWnwbtWvqTQNb83NPIhyO\nkAFKHTG+aVLyKQlqZJoTjOOABQy5oAmt0OLFQnuEFyA/Pg/5qDklk0FjC1I5\nWL+Ey0RNu+MkhUP5yxntNxtIBHUN0/kgqKrb5tgCPt5sn4CWB3G25KTe/8hs\nE0np8IZIDWqZQ8AVuV30Smp/Q+69l7/nDoNIrkCpfuohT3udm0ZKPyK7tS4V\nvQ69aTNo4KTc0LIYs48VgOvd5xQBaorVqmesWei81EQ2QqG579uwX5wlpAMX\nUYp3Wj3IYCDOqamyVRqpEq3UYZlu6KRDP6yES1qdGN9dd0krjKgFjBo+HqY/\ndBUlMFpwt/Xm4GY8WPRrHHq/mp0Rp7Ia7c5d2slWRZ2ltjLjH0/A+4+/Cdxc\nV62f/+4dEBK+h1DTvV/LKNCcuG6cX/EN6LFWZeHO1gWoY8pyumgAxTcFq+n+\nXmgPBUXYd5/ig4RlOC6h84yzhHayO8lZlsf4jtLxG1HDkfB8ZyCT33JqIyKP\ngNTZ\r\n=2JzZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC53j2npA2YEBXYG7fWVGEp6f+lXIB9dDht8oQYFyf5cgIgUiVXMdkue6j06n4/tvDWuzOLeH4WRuQyd8DrYtEZPqM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0_1605511190856_0.4711573845327617"},"_hasShrinkwrap":false},"6.3.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.12","gitHead":"95227469a5a3bc05738a2b1c98b666a1f5d49b7a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.12","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zE4N3ABvXsaTPvL5JKojDXNr4eTqhbBUB4rJYwzdYFRLcq8FkKs9p6mmT+5vrz5HFXmE5BSVV9c6DoyoGz1OCQ==","shasum":"5a98c835f1806d47484cb3cf9a1c310d19c17fa3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.12.tgz","fileCount":39,"unpackedSize":227480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsig4CRA9TVsSAnZWagAAVLwP/04rKO2/DVvvSEo6JYdh\nv3PrIQwkW3rk+DCF9GS/vx1oD3YKvx/Q58EmHZq6YZTKgw0xHslHZHFu2RYa\nGhoLJUdfHFFUNimwSPqD/QzbXFHSaklB8KCd6SI3umC440+03Z+ZivjIsKwG\nBXIs7KXpxd+Hk9kL4NIabOV8JW7T2Fo5ttK7RwW69dKNZTVKAzdcfZSC4zL7\npn02Iq61vj+UrTetn6jhd0FiRs/aSkW7wbUekJ6xpf+H5P0f7uLz8fKZ6CTS\n1M5UitblyLyKLAMlaffQXxDogTAAu/O8n9C4Qml91cc62dm57vL5Jfthtd/5\nXS5Qx2RvNFA6kqGMOmazEdMebXQWbmLie1vN1/m6FNDYaDmNEiOduimMydM9\noCAGmjRxDeW25revqKB2a3q+bvw6mbPAFLsXEjuo3pklpnXw4rltKHF+BzeL\n5YkwR5wVc5XYRIPb0IXoQyTJ57luBtPknxpOHuim6HZsD1on3ABzulXgZv12\ncKh0VXMkARMl3Gp0H5w4IjOI0KpiY0NtoX8OMuvy9CqrNtN+/d3sswtfCsIl\n4qN6KtzgEIMxC6pojwPzdzKyWyEip8AYRzoRlKcpj4rkAUMIqWSjwW1r98Sr\nKODRY4tapIr7p9pgDbdoFD519AHsNFpuF0loAk+ArY1wfDlsPbiFfvi4tL6J\ntfcu\r\n=uAt9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7/i2F5jrrnBWCFVKGy8XWQaRhCkppNFMcivGynF2GQAiBssC6FcYAud4fJLQAfqXpZxehFxllTmbpg17Ml15NGWQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.12_1605511223984_0.30122383563485955"},"_hasShrinkwrap":false},"6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"95227469a5a3bc05738a2b1c98b666a1f5d49b7a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-WXPLN5snGIed6xQYe+IPAYWJ8YMdNZibkThYB2hbsQNm8pnMFHxzg9xfUws0slSvl0o5U9P7duYsfWEKPaR8Ow==","shasum":"6c1703ab42cf943ff4980092f9aded32922abd48","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0.tgz","fileCount":39,"unpackedSize":227523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsihVCRA9TVsSAnZWagAA+IgP/1zOI6/obck6EdX8X/2z\nv5+nZx1nuNT1YyACW2dHmrtCq8j7Vodu0AiiJ13Je1w8q4d5ZLEfz/DnBtd7\n9sNLs/Ts7VpwWnb7rgjp0PHedgs5HU1TqPVOssQV1i7Z6h1yUdmZGJuMaNQi\n6IP266nxg29X4xkXoGxX12x9NxbUOilEfLHVu+GlL83MMQg+AtapyeplMR22\npqM3yKVt9WSWb3BEUlq7l9U6ObYTA4F0USXw9uchpo4CUFOoA7DrPFcyzilw\nrZoZC80B1ua6caJFMSd1I3JrrBOPLeZ+GycUtOy68Rpm8yRX0Yu4J5GQIMlf\nx9dKZHHnl9QKMh2m1+NkNqQ1RUNCwh+fuTdgTc0KtvWJOmFKOEODjFFrTwZc\nxWi22SNeNZcHOFLEYWDR4obo2OGRJYO0vo5SrdZOUKSag6gGZqQXM0JZOPPU\nHpFzCN7uYunrbgrozw0VxGJfaUG1ZD4CDuutUr+XYZDiUnYx21SEhguookgX\n9vcYDbmjPzQNw8OjknKNNON56qOwafR78OzpIobaJF5J2RnOwWbxE4s8Bmc7\nlphds2hP0sZV34oOm9dXWX5nnIRR2JIQgAhmlr87yTERjJfKrw/GwZ3VTukb\nP9FzqRak+/TEp5ZTsAz8a3ZXQ0MDOqR20xQNRKyO4T7a93e3ZMSqKIcjuR/1\nSteJ\r\n=cV71\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMWwVG8erZFb2cG0iKdeJG4Yn+xfbvrN6XwA5AeHtqOQIgSDvJGGRTqqbyo2LPo/26Vm3penlu3/kSNaOd4QyFZTQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0_1605511252628_0.036113158136362955"},"_hasShrinkwrap":false},"6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0","gitHead":"23de3a40132bc8b91e15a0e3724300a19822693e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fuF/GhLSjuNIyUdbFWYRvyLqYjYE67iaCKsUINFXS/dtzocaAc1P+O2u0/9U8q81A5bcqazCIWPeKbTOdxHGIw==","shasum":"31d8aad36cded8ec9223d525fbe902a7ab7ae74d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0.tgz","fileCount":39,"unpackedSize":227523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsiicCRA9TVsSAnZWagAALEgP/3p2NjaKstnc1m61uSpn\nwhZkFL2BuT/RFNmNM9AHokdxuM+psmBPHGS+pSV/8ff72iiTjnecDMTOYYSX\npYM7e3uRYeGz4ZcN4cW1n47/4NgdWddkA20xr2unMb/eAetiQWBUr8D0JyQ9\nTg7qbufWBkfO44DwgKwj8je3eMGDDveOeYj6AE5jRkNDAYqYF1YZHY84RIsx\nNndEnH/hR1No5Jf+xwwDuhqOj/lAdMKOMvXn+Slg4ZK12lvYy+ZRhvrlSbTm\nNYHDSNBILSScN3b639X6J7T/2uJINFBeay5E8uUJrBWQVC4LS6sHCVLcejyh\nZbeEm5p6VZwWyvcdtpvckTd8GEvoMjZBA8h94vH4x9kEVCcqX35y8b9wyjp9\nOQmlubw1OWcFv3aBwqz0vC1T9SIfyrvzCMsR4ouStlM2cj7ZHAbWXEJo15PU\nj3rxVBlQXIBqvCMEd0+ERRvxIrEHLnAlJgXrN3rn6gbt4qP2XxmzKrjBokyX\nNNh5PfQLb+38Y5ZzCfd78x4grVzgIAcTW0SyXOWD2p+f8Ot1Dbtb+FlJe/WV\nRcnCHqYse6wkbqqvElB6FraEEiNk6SM2/4++0UFY4ld/aXSM4TnQZZVKYEOz\nfhkPubyhtlQeHhpJN40oAR7G2sMuBRhr/tfdixXZaGAf2C9+lKqrLvqQBkXs\nO1bB\r\n=31Yl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDujZiycGbjdle2oUQMWHb40oH9X09K3IOnXABwmB/3rAiB8sajhXoko1Jn7m59fcrx0rwTlHqSR3T+jJQBOHd2jJw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0_1605511324131_0.8167773344121827"},"_hasShrinkwrap":false},"6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.0","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0","gitHead":"892a915f5356b9d89ff831f1b84beeec55b1901d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-to68N/sRuM8LZdA+zPB6LE92ONp+dPuL920YuIdUeJXZFo/NhWM8YkSM2+aBmw+OB3X979Bbvos86z25Dw50dQ==","shasum":"6a98d77b7430b74b4463541755bc736922d95cb3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0.tgz","fileCount":39,"unpackedSize":227523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsjBaCRA9TVsSAnZWagAAM+cP/2Zw0+wHf0NzirUO6yHD\np9GVeOk6esnfQQMsgf1RJqitaDZbI7YK/L73TvZf2NfglDlMzpcY5qG3Jvuu\nolhu09neTz31T+DzSKs59sZolKUUPwfhIczbYfppwNs1q3fE/dAvD78TTnt6\nD5grpJxDl5KZ/jvb5HK1cFVxGwFW47g0SSimqPtHgXa1VBxVpDPEKKK52oh/\nPMOGKR2xNBlVZpOekQuUJokJOPxToTw+Hm3SmAHQvFR7ElEovZEEIKrIr24S\nHq7+bn+scfQju2qEevFfLoYYtaNj6U+QwcMkSm3zfmvhTOV4D2ZYBVnN9QSR\n+d+zcHcjzJ2PVankoWL05BifyP9R7tUkdF92SYbKWkkenuW8g26oQRyiG/kD\nQJqAK4CxKwWOUta1p6g7a6Ps/+2fZkLL53SlCYefxuBPqEBiE314L1l9Hyj1\nN0TLLZUWGfplilgpccQQHcR8lG3J4Q/RBoyS/qr6mDh2fusu7mRYAO7scDuv\nknMTKQi64nk9o4Wgt5975RYgVJq6lCRkOZjYA84dRYa5eDQ4TXu5ZA9FbfFf\nFS93pin1qSInGkU5TT88yl/69v+AgVIRi76Zhc/KyUorKyFdJbcfAFNwTAVY\noODxv5CO1Nw1Lecrop3+TXDWNBW57i2gyliGvi7RCl3An9o8s1RlYzJsk9Vs\nx5HT\r\n=4H55\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8/OO4Fuz3EzWZqWXA8HH5uTX9U724mHAbvWIVQY7rXwIgEtL59cy6M5RkZyHB8e8diMdj+NEZ+l0wws9KSp+nlhM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0_1605513305929_0.4769064345671534"},"_hasShrinkwrap":false},"6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0","gitHead":"8eda3491cea12ada6c61bad371f8eff860a6a066","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ON0PeRya0Z40yG5MtTxZJ+Y9uTwCbHmYoquioYIohuXi2/D3TBs6YC04SL+zjbL8Lhdh8iycfOPBRMxbQ2O1lQ==","shasum":"ebfbad483a738db72f0eb6965c772babe9167524","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0.tgz","fileCount":39,"unpackedSize":227523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFvbCRA9TVsSAnZWagAAS8YQAJ/SQZt0JSors1MooePr\nz7oRYhyGumzABl2ix/bu/lxurL/PbBCJd1bgrujTl7HprwwJW3VsVR2bdQCv\nRALxKqigQdA2tLGCkDT4qvOtRJew5tjrCkKV99YVMn6Y5K9mpWb/7pWeky4Q\nyvAcb8YADhLU3+pxrLaaofwmqF8IRRO/eUfUYneEpTWiQIEiELVnnvE9Eprj\n/FbZgpZNc0omHVwIto6XsL7wyXl0+E3DwMsYI/iBHbk6TpmjvR8StflxK2oY\n6hnq1y9rrJzoR3M+gLaIu/N3VuzoK0E6Hd0xbpu2MBodbg4tA7S8/fG79ZHe\nMoNDvRRgWy3bi/jEugwoaCE/oHiXgN6ypQMA+HuvDl3I8PCw3h5uNYpHZ7NK\nFp5Sbdws5Grh01P/PoPBzQidY1GWDAdS9hKLlksnViir9YHEFGreLK+zVh0i\newSGoJmNdA7JAubovj7rMSCkaBep7DdUkqjLbFTMoxxjxTlFu7KBskikYyJq\nVA87Li7EyRHc/jiB+q1IHLKGYExLW3NgUjAXn4l13VURoL6j0Z4TmauJnPa3\nzzz4Lg1IamLEgcLBQUlRj+xi5TtwbK6czadCE28xoJm+FrC5sInp2o8kvTkm\nsiBjNegXhdzgE6UA8zW0lsVCz1vXBEfRMarBXN6ib7CIldjkwzumGzVtIxgx\nreFI\r\n=K1UK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2QLI5OPhjCaWiKpvDmkrBHMNLG4HGYNxcLz7kELqzVAiB9PJ7nWIvIZKJJEBJHiEk55oO+4gqlUsMLtmyVpTyVww=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0_1605655515065_0.20034324860537178"},"_hasShrinkwrap":false},"6.3.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.13","gitHead":"4765c619b6082d76bcf084c50827182b764900bd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.13","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UO3FKL+4anDpZ796Jhg7at9lPa3FMwHi5Edxr4PKedGuge/lxC1i9khFRGT/Ui6bAp8hEeVrNRJM/XMuycSHeA==","shasum":"dc504d15afaa0887bbb3fd2276fc03c232caa293","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.13.tgz","fileCount":39,"unpackedSize":227755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFxMCRA9TVsSAnZWagAAgH8P/j2ridj6Qrxyk0wV+wcu\nodP6RnH88FJ8GWTSuF8yV4PIMMV7JcMiZvcnLLfXBM3LHVcQAeIapLQJ+I8g\n5dl571QXOxpw/mgd4bThiqIS/NXDU3QX7Yn0JpI14yef2eYD3aEaUWRZxCa9\ni6eHLCI9Ax9nKp3/jHAlEAeROdx7beMuvttpt/l6Zfj+JqFvK9Q38bfpzZtk\nRHjsc5ZE7hPFhxdmM1ftFBNiRxpr9/xcuRKwC1zZQeGHPIHFVipoIvyqhtHb\n2rQuyIX0+2uO/wPWHVWsi90xHhSkeLnS+uOj2RYxXwOS1FaplSCKrKEXgKYm\nLVcP6N/tGWdQ+rQQY+3Xh5x0EK1QK0odf/j1gY/TAgyAu6gsmcNWqFmrYhrY\ntdIvtaqHNxacSBXCJpbS/gHT/lPGha5Md6HFMZq86SWjA3+pXSjBbFhrLNtD\nT8dv9aejCRzyP9LRy8uv1xBAAwLDqaxaUTFSdttqE2ipVYTwgu/yXzpLrA38\n9RaeUCbF0bP+mrgZ6PZRWRRBEjUiN/MmwA6hu1li+uMrw9DuBGMuvG2T0Rsm\nliAyINiqR0q5NUpXQp2aT2fRMFEssu0fxrRFmSVqtt/Ou18eIlMr9Ueas5xA\nNW4feQ5w93Rn5cL4d9f+BFcKI1Ypf5U70FTVF95nRzR4QDWynIEGgs1Vv1nG\nO98D\r\n=2QTi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaM8xQnVIC47Ep0TxMs6oroD5fGTZ7YOqdwsAGZZNrZAiEAm9T5tJSKlkLU16MvdvNF3wz5+9wqZV38xmTJ/CkViF4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.13_1605655628169_0.4538358048104967"},"_hasShrinkwrap":false},"6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4765c619b6082d76bcf084c50827182b764900bd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kDZaFQwRmTNzqFkMu1KAyRACTVj2nIA6lZr0K2zS1ts4pgNIssXFy7GdKq4SYsYPEEkP2mkBqvs00KgOgLQfBA==","shasum":"47cb177313e756e79c28abb34f9b5d59e69977e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFx+CRA9TVsSAnZWagAAhHUQAIhS373nlZJuBlVi7sKE\n4b3f34o+RPg1kFXKk85a9raW5J2Y5/5TP6+IcZ33RW3KeSlxup+GT5VP0qUU\nqMh6JTflUbqfhZViOvZqvys0chIkUMRdTRLu31swNX6fFcbAoBJDdwHR/kCj\nvlLjjttd+Tg72HdcCYlwaAo2cWH/t3MJlUufT0QD9Ts7IPl+/SoKKOz6cRRw\n4HjxWuaSSvTN1IOTtotAr6tiiCn9S6z6726xt0YPJ5jQrki/6/4rj3lni9RA\nBodBeXPe2GTis9db4vI4kB4+N+w13AOJgh5FuoF0y4hZYoHKKVoovqjiCVv0\ncPGMCCQlggFcIK3n2TTFV79g6YqLC4w+VZYWSX04el3RFehIBuhFTwOI5ezm\n35+MliCmsDZYEXUrvetf4FKmEO7TX7FUfVlTZDCI0/dmkLsb8bUd3IcwkUK/\nqGS8gBpe/JAFPIGKA9kYGWYx/KcSmPNodGnb+w6DlrflsP7pkzW7lwxVYNOR\nbvNxccO+w43yurJFSS2Trx7QzssncLLfXQz7KQiVd3xkhqpM2MbNPlhEgJ21\ne7RmGe+sSugfkX3AwZGb8Blai313pqpthg6zauNJlFty2eR46B3bRbpHWpog\nIUHu9ocbpMyhNRPscwKq3LojuI6edre0XMpu3kFyhBlTsYNi/LuzuHp0J2g/\n+T0v\r\n=JsJo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnaGz93FpkP0lKSEt5kRr66wwRds6FiHQRGL1XeC89iAiEA+DNSrLpdJ9ieE1Ji1uz74m7XquCMe3L77ZHMbNFa8lw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0_1605655677581_0.12451619427233251"},"_hasShrinkwrap":false},"6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0","gitHead":"fedbed1b88a0c35d0b7b10a324dea27b6e5c3445","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NmxnDsY6MujLpVmekLDVnAt80Nt0gE4p9/TApvnhdRQUrtQE5aT7LLsdE2vQT593199WMNqNq1pUYVHMebohXg==","shasum":"2f746fda3a73fcaa253532ec7b9fcb2914944b9e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFykCRA9TVsSAnZWagAAK2QP/0z+Ak3yMopAwEs9fSqW\nOy/w/xZALcmfFW0+Y0YB58uKlO35qm84JbBDZSGqCzwJehF3oD8sFjR/YPL6\nr6sxvrd9KkzFG6TTfKmJZh9rB+B559jdFL10nUGFHOBchnOhgQUpoKqPhaOf\ngHzdNnp4YiFEYyEIEVFYaF/dNmeX3S+FLxAvWU7RJL5QRjdJahysEZNeJT4p\nYb5HL6tkFhHE4cfiCN7Unp9G46SNg8B9fDgXYRgm4HzwhhRdj5I7nvT5xIBj\nnANBGN/Pc3F+tbNeZWJtxkp8iJnZCRgAxK87VFWVeJzsWD74h/LoV33gpgwY\nQOgo4KwGex3OziCbf9HCD8rGMeWUlMMt6g+Tq/dLsMxiVeoRRtaNdUQKFWpy\nrf/GB+3adbddNEn/lMTnXOYy4yI79k43gtcLAlPbk7MXL24dgokuFksu/zjr\nCUJ50VVmA3lPbyU9ciLrK+5XYh6byonFfcRuKfAcCDtsRPwENNN3bJtTpWWY\nf01zlgpSDL0CuExo00TsX4HEE8n6tPlwYnilQ8Cbcb/4U1CZntcupIVNZrLm\nNnaQgQq1Z3W5W8p7wpO8YMJPuLVXU1BOt/7v7VBob+Oh5iXtGmHgTsno1NV3\nDJFAa1y7xCfXcGsOl90y/y/U7Y5e4191MM7kIJdN3nfbswyQTH4iVMhm6obi\na4OX\r\n=Oe4H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIPA79a2uOsxT750x6ZZSbM/GD6WdT5HhJCD7r8f+sgAIgYJEurMLBwVxiDmpM00r9xgKSX51aw2XXNs6Qf6uR1v4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0_1605655715655_0.2666767169616482"},"_hasShrinkwrap":false},"6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0","gitHead":"8d1ff3474540ab67af9e71c8ca38ed2d5661da7e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yWK7o9m7RvtLn+o5SMm6bwUV3oYp04Kw9utU2P+1vtHWz4ghc2mb4RkIvkKUhVEkggIzBFXjRUoVcJkhiE9imw==","shasum":"9fd979fe3185d1986b2f8ef8635abf21f0ac700b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftF0RCRA9TVsSAnZWagAAXZQP/0WtrNTa1II4cqm7Sask\nqrDVEu/Blu6sw7aXtz2RKHHP6V7NFKNsHYm/zscnN3ZdBGO5UNyBBRJQz3p6\nMhBxwulmdlkP5S/Ii3Gl7lbS2AmGk/vfDTVsZrUqUEnQxdYAgccWM68P8oOT\n4InjQ3z3MXq4GvZCXWX8VVZOF3Tme8w+3WvYTI+BZq4Az69G4mP/mlMmq36L\nCFDgFOsfjFIdIMNNBlnGJfsrtkVAU1BywEnPUnQfil/9fcUJe46RQh5vTyG9\ni5gGZ9ynQQ9r8t1xHChc5iK/SRt1ylB1AlNB9x6BCdZhHlIxZD5kdDIkry27\n/NTx9nf/fYPqFJoxoe9UT3Gde/wwgCN4vS4EeNxrhdDWlf3hpwNOvqPZ+6tz\nRZeg5mHyvP9PlYcE8NZ0jRrlytKcVcoJlUJBJgmzhZbI4BmzrFRh7LY2MiYg\nOO3qJVPgHW6kUDewknbs18B8YpCLZuTw+fp5e7qjn620jhjiZSmq8+fE/X14\nUwmAsJdEWZOhAk/JFdGAYW2m1VXjlLPZVSXYMDeV/T0aeQu2K7czrtIMteZi\nUxX7+8at1TUb2m/KLBzkHUCwY4XeuWvC88TwJjXpqxDMWEGTqxAjbilGDu6k\ncARUhkV8yIqoBdn0tVsOl5m9CpIBbpEDyjcQFpqYlMdVXuGERAKsZqRbRVkp\nO7+m\r\n=JL0Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGr6s2RQC+oGdwg4APFC1RT+dg50nyib97DSsNB4/3iZAiEAo80KWSWMDUUrfOjrOF7wBEcHjGM0xPhCwhCWRJyWBdI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0_1605655825169_0.2867364118641258"},"_hasShrinkwrap":false},"6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0","gitHead":"f1a0b72b562bfc38c7e06118abfe7cdd414055fe","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VYMZRMf9sctmxFZgjOU78DUYURCad5qklClpjhxzAVIGzxAuEYe3lyh7jYtNdIp1j4Z7atN2McsmnorL4P3HNw==","shasum":"c9ce4eef32a81121f08f78a1baabbdcec1260cbe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0.tgz","fileCount":39,"unpackedSize":227801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftF0kCRA9TVsSAnZWagAAGDUP/RAMaWTXr+OTmqWEM2nM\neV5bslYnX2VMfbY64IRNDrJyGMoYmmw520bLD3VIroQcYtlEqlU1jfyNGcdT\n6KLtRTX9cbDSsl/FPgu301Y27y+uk9W5XUuRPuvd8x+0+Pht5BMAcEPIWxbW\nWwK3GF4GzCoRhpD1uEpU++uoMHe6Eo1w9JhOTbK+VjGTaT6GC3+qz1Qt/COK\n1P7HBJOoVatXQvonb8ymQIJdx+4bsENKn+cAsztdR6sQ9Nzqud0GXcsXHYPx\nJYT/856KknOd57OPpXO8z3QyxR/Bz9NtAfBbhX3t56uhvuHp7BmDCEp5vkMl\nqXAeBLr421cgUoEJIEhQJWyX1uEmvgTvuFkFx8aG4ctH+UgdpXf4/mr46Zpy\nlC8q40F32qOL8jM0FPAmvaLLV0V9Kuq5tJzMzDblJohttF/tNzPTHTbH1gvs\n5baF2bhIGnfXi42px9sUic60TWW5pl0G6tSO27hqX+5h0zPLy8ymIRdZNSSm\nF89iUKCwvOIleZnOTmVO6eaxl1ABtKwtuCQRVEaO7SAyU4jkgO/jtZafV1SL\nH7SJx0SQp0EDLOKE1QkfCfmrDmToMiJkiKYcSr8uhCogJGceFyW6ee54u8v0\nq3MhAQs2uOtBE/5NoBaRKfqcarypely0EE7nPDc/gn9LY7Aqfqw7IU3Tjmzn\nBlyb\r\n=17NN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2uykD810wWnWUuzfHCXm5qWXPU/jIn8lJ4GNtXpOxOAiEAg2G1d5iHWwn8yvjmOmWCQV0zxwDjw4dN+Z+eMm1dvOA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0_1605655844054_0.47890773304033063"},"_hasShrinkwrap":false},"6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0","gitHead":"6508527a71892c98c980a5b32c558cbb455bf8e1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5K892+QZZiPpxI/gpUFMe+SzqQcWM+/YiZH/2hctCjqB0ItNbiFbfpUkC9LGS/UTJc4lpMtnbxfEKOhPOPKVnw==","shasum":"aea65e8832cb6d7a0bfa2d3c164d50e76ec64a47","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftF0yCRA9TVsSAnZWagAAPUUQAIMpNFsTjpRwOpZAaMYq\no2LYE1oNWRtuy0Oci/qz68h7GwtZpPs2sZ1Qm4rZsP3upijzSh2/6Ef6V/jn\nk6R3tQMRrvfcYtU9Rjexc8QvHb6WIC+qhnKK+mocybzmuAvrfb8VoiLVEQUg\nuRfWCmAomAUGd554mLm9NFilhfomMt7Qz7XBdnQ9IcLCHcVcEB17Mf0/a1Ue\nEqalSfT3U0GrPumVfNaclIwyGMM3iWrwrTpDe+e1V09/3gN3yAG8hN8OQHIr\ngTM70CcUuIcnvVpDyQ3tfsQlUAwdhV+FUPM/Yu67mVwCu1m0syshonfLgYly\nduNyXyHzCiDGlQY5OUtqPGfls8RFFQERgcQsIhu0LY/xyewGfKYlOsUoiyT3\nSNvu/Ii92nT/WRIee1BSpqQfMn04SVtglaRj/+hFMseUUWU8L9raCiWGr6kl\nfhc2Ad4J1UB+oLKo4gncMGf1GHZFoltLx08qagXq2HHMiR5anb/HW7vx6XXX\nHjyeepRe5/uUVpbBiRRY7XdgE58ZRzw6D+8Oti/0MnQmEzKUVtoMhKLswzPs\ng+d8rPdCZKkRNb2Pm7JxI4j9zkh6ARbwbuSI8mL9nxFdaMPqh9YGxZdcada3\njDob5PnZnSMFjZfxx8aeFtyphXJxXjIUuFu0gKEsA2t/Go/QNvOkHFKkH88J\ndXV9\r\n=L91G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1s89muN505wsrDrDO0j8MqJYk7ltd5QbLj/M+GnMdzgIhAJmgvOQhsCF+bNEOFOgqwfAwyi113xJbZ/0zh23cw1zl"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0_1605655857736_0.918723197008156"},"_hasShrinkwrap":false},"6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0","gitHead":"f0899962e685e313c39c216b8393ebe6a6937abb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2hfTr/nsHOLs2mV+1IKkZVzIbzz1I8nnLG2y4zESTHCKMEZiYCEyJQ10L/gnir56m51a0UAExZhcsu4PhwZ8BQ==","shasum":"cbc548ba9d1e6ba28be67ea98f121773776eb49d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGJyCRA9TVsSAnZWagAAvRwP/Aj4WEBmjS6/iQsfyazX\nl/6baZjjnUDJZwXvl1OzwGI0GhwS2qf/zRdZXAShsZjnRw5jSm/f2Ev/pVIh\niIkyhkrvo1LyE+tg4U/6hNHWLy8KQCFil3P/QEqRAGUeIn+WGWS3DV2kDv3k\nX60tpH0EA+eTmqQoKptz+tJo2q04rIYIySd8fAz5lLGLdR6Kop6Ku/mu8+24\n6djEKrVaCdWWo0UpIQPJKW5BTc5hyx5fo6z4kToSciACHDQ+Tz0SQHl7Vuce\n0mFgRtTvNUhXaGhOOqhcdSjb1D3ZyO5ScM94jQHsx4qjfQwlktnmc8Gqseio\n8aI9TrEaK1tSBSMbNgUD4j/nmgc1uOBvnelmHZ5QKGsuAELRk9IzN45pMEGE\nRxwEAFsw7vwTtFTWRPxhrVk/suhOdFJ0Dw0dxke2SIDijJS3yO/Kq6+3zoCo\nCHJBuJkngQ0eRwb/stR+UMzIkCX9F7JAY5qn4pmcGeVtxJpswRqU653OHLqs\nNKwXZyAZt8ANny6aFtomC7RG5e/6sg5C2o3lno5wtsYf7m1VR9h+ViFONTbu\nhJ/rlDVNprgK6q7dmKIt9SjaQEU9T5Ap3tw0OVFJQqLGkKoVrsaO+tQWcCUR\nczxkG16bXWWSxEuQTEMr2GslK6PdhyWj09C+tLHzJ3/i6Hj8vbUteklsidAL\nJkvg\r\n=jzBb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4C2ajTJfsOC1u+eg9ioFBkzk2rsims/WNtZsrmLy60QIhAKqzzQnWKYr2p/P4KhQYHX6V9GQkmLrmpTbIxmYozLfL"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0_1605657201658_0.11989169318207371"},"_hasShrinkwrap":false},"6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ad6f7a1e83ad6486c27a049889c741fb3bd4c145","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-hCjq7P+PhxjIoLRaz+HXypLnGD+cpexc3DVBElADi8xZKWIRe4Tre8+aUnaupmE0u0r0bOIgK0X1WQizKgiwtw==","shasum":"060182c7e2934250fba75b35582db2701deb4c78","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0.tgz","fileCount":39,"unpackedSize":227798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGLKCRA9TVsSAnZWagAAtKQP/2jEd5HwkKc+xLJnVpD7\nhl7aJodSgDtMYB059yfHSYFC95IqFL0yEdnjLjAZzDh0CW5bVKA3OYmyqN2r\nC8qb2jGpewB/BAGdlKcTPCr86T2XaLOPwPAnEbh/wx9LC1zmjEsuqc/jMS2G\nBCXTP50Wfdmj1yuneKRXQBdvrkjd6/NWA6AqL4dfGGwaVtFApzGkH5snZ2ZF\noophf60R923RvW9PE5hn/9dsmMQVVJQ/ZtyUUO+VlcGgjLYza5Ojt54HZuaR\neSy1DbQVtTSEH3k6aHaXAiIh1acAtm6xKzm55ZSaRktwGAVtoplSI/phi/2M\npYobH1hCdTkIn4uc7nB5S0kYUp6RMGkJw5zS8ECVl0df6PEeI8QA3Xu0FFa6\nQEf1ANc8jZAmnBd3OwdF0m+iIL+tOsesNj7AD1JYMy8yAcN7cVF1kVPYl5Lu\ntJo9Bz7M/sK68fyfOo7KtTEX3TxSB+6ZTectVyXoW6erfkCsXeII3gzYTGBV\nTINSkCCBjhoBBzEnUNa+QWDp0WbgUDJHmAcHwige6rDB8tt+2HCNjhobjqdf\nrTWA+AN8EGAZf4FP5lhIYh9OXIF7NhoaemSYB/MRTAu33NV1MzYGMs/h2iXD\nc8uw1lGeRykCiXO5mYZRBQvWpXQwT9qWZkkv2lthIk2ji6xFOzRaJnw/OVQ7\nR8ju\r\n=mPyM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKbpzhhlmbZjWaQP2WqrwSCxST0kfBaDItuPSlX15YGAiBIxjj/FE9jo9fSh5bQNxLc22Wmflx22gpFmeXZxW4sHQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0_1605657289283_0.5476135422469908"},"_hasShrinkwrap":false},"6.3.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.14","gitHead":"5b431ba2c69d5a9003749f86732d1809bf42725b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.14","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xIS2P4OuHV9V9Axj8mL7DsLsuO2v5RTesLntOGiTIKhRisKC/3nM/aTZ2iHdVEscpTQoyEw5XbxJq/8lw/EDww==","shasum":"5693c8e84cd9d568641cfc418e2b18a92d8ea7aa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.14.tgz","fileCount":39,"unpackedSize":228039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGLrCRA9TVsSAnZWagAAwW4P/Asst5nmSzsEhZznle6z\n/ZBww5F34/ByeoeQfOtO1DUTbhIM8rZNlHxsOQ8KcAJU2jGwxG++SxxFozfz\noZrEZky3UpAOrFw3CDfRIQWcl6XsxWpWu0NEx9FXaPY1Duh6bGQWUnqJVl7X\nG+K126rxvMPTICd5Pd714cCyobCjYpEhVujmf1Zt6a+YcPeKj2nCQdoCRa6j\ngGhO4bQqCdYEFQiTxDZKvZbJ073O8Eh0z6lK+kFG+jQXpxb5RFJgDzzvWxzf\n7LPlqUjXblVQ5wPtkT6cUWxF1jYsYscM3IUMXKmOhtgveNfVKQwZYn/dy5Li\nzLyHtCslp6R0gucA1Pj0I/FXfIGyBIsA2f+9z0WQ9aUz11ecm2PRtNL2+oPp\nkhbXKDxUVATEwAD0aNbvHZhTWBEddd1pEHEAs0VMHEblEAxQDpT3S8Rn/6IH\nqDsx0DqDSIV9clSUsLHCt9nrXskSFNOxcrezOOvavhthjJAkMUwnHON+2FSM\n+xH97h06Ze2gnfxhAR+TC5Q5od7qcN/PwwW2+ojbMnOWInGZ7miwwRw5RC4T\nBbC2Xhpmgr6bdWzW718YPVr48g+5490DVIDUtQz6aHaiBeiIMT2UcO6vhm4F\nCQ/N/rDCwP1PkTZZjVMY9vJfrYOMYa9HqTJWokitOLuIGlGoX1oJThHOp9eb\nzLR+\r\n=sUU4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwGaOXSWl1Lw5gmHvjCZjzl5ALcxMEfyAP7gMxYPj5dAiADqz7luHlzsSk704UzSpU0mgdMYPXi56uUQmgcj351Wg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.14_1605657322843_0.08184397536372234"},"_hasShrinkwrap":false},"6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5b431ba2c69d5a9003749f86732d1809bf42725b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0KH4B6Sd7gLl33fLgX2QiU1HcQ8VeTJdsM0eOmLT0ygLiynB2DaC/DljEOrsPS0ZdSKDdQla9BmVNa8kbllk/g==","shasum":"48e8d2a39b773129ca7d00dad7618f9fc3d0d23b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0.tgz","fileCount":39,"unpackedSize":228082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGMkCRA9TVsSAnZWagAALTsP/Rf7uLnYFvn3oL++theN\nSxTjAhTz4D/T3Y9TvE0Q6xviF9NgI+BHrQb6RervAWTRuK4KUMDDGpGERUqr\nLKnFb+cDD7g1lkcwe0i516AFiypFKmt1CWnbCKsrEs1eggQZLwwvsMpo1+Aq\nWCHGOJ4xb1jmDC4Qfy4rneawR/2jiMKaJJ6lH9UINTtonGcP4uPQfgjFw47X\nmG5QN7VOYeeIF+K8c4dbIGjMKAIb1Jec/2xZDaDy49MpqEOdi9epr42Zv69z\ngDUNoZ1256sZRNAQup7pmGVc6y5LoZa1WAzKZe+Vt/QAZRyqZ6nIKaqNC41t\n4T5jCNXw/l37bGGJRjqq8BfIwyeLkXsEHOU9lSPcv0LOkPzDezEY78GAqKG/\n377oqUkvSGwt8gvAwr3VewJG6XY6Gt4D+IrDPP9qlSB0v9/sVgJalM/TlPrx\n/a70RVnV9psQn6Ao2vsLMFMvlhDc8W7EbbFPqujNlh7mIm+C1IureatLlFZv\nwwSiWCTftni1Etl1MsNV+/iLpbt3XZjtFSTzbMTFAlg8vdfAKe4dBAVUvenF\nerOVYF3791mu/C1nJefFybG4t/A67bRV299Z1a8rgDPObKkHJdR3kcvVcIJw\nK8kgAugV516DfFINTE0e0kwPnq8N0gdm75rk2JKndSdMkNykLaSEo8EaEaKk\ns1wv\r\n=JJWu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqyDIS5KKj+almwfwPfY0Vu7Fxkxs6jcosJm3UlO2Z0AiAGlMne3mbaUenYDJQWv5aHQDb8Ofw4K77yrn49apPJ7g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0_1605657379377_0.2717797040524206"},"_hasShrinkwrap":false},"6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0","gitHead":"3e28c52cc96eaca9027f66912dd1781fea02c096","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eIiOBM9AfMbsKh9Uhv6Wfi6TRDfCaXdWLlC7KbJg1FkVIlfMmJDrb9Hsj5xNE3yl4lpHdQBOX98FZl2AwQdyAQ==","shasum":"e17b2f166a1cb0f7f89fa1dae0ec9f4731dd434d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0.tgz","fileCount":39,"unpackedSize":228082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGM+CRA9TVsSAnZWagAAQtcP/2yxtTeCR2dpcXS0JMLq\n/epDAHLFijhCXFEt7Kl1EF0XDgifiwFunTES/k/w830aBzV1auP/ujLPXeuD\nO5h1ihF2xq9vPGAL+XVafV8dLgEdr5w8QTj8P4i8ExWWV8Ge7u7b4O20IDRN\nMjicLvOzkdZ0ofl94BBdckmS0FWB3WNgQy82ojXzFWAonzI7mTQ2DshmhtLC\nurewAixRVFPXcDXYIR+F2JyvAMbuDlL/Tg7j9JeUbwS0TO84tSM53gOtAIpk\nIRdUyC4AwhcxuFGL0EhfEyqDR7o5t0bkg8wB3aKQLzlTHi+IPlAD9TOSI8J1\nkMINKBJ7uA42vQCXq4yIfYmm0aB3zo0lLBD+iwi3nK6Q0+zqFCnx1rqDrj8i\nZ0KyDLsNDVMGBLt1x+llWc1ZCH3uE+himoBUCGHms9ItiL79xAPitGbirsey\nm3Az7T7vqDwgv8FQu64ulmKx95zTSPWeRXbiuQInUMqNuCSPYGieGWEdF5xL\nnDztH9jmDJj+x6gHLXNBeK+QlPN3J0Wu/AiUiGERPKmsSoxEYHMe+TnLcjDf\nsizfV3LqCHwGeNz9qfnTBa4V0O3p4kjRRoNUmhV2AWhkdsWgTPLyMJj1HDOq\n1PwGFZWn8BD8lDYNBMZADD3hnYZcBWMWDVMLBzBf7fY0xLAf8jatjShmXGoq\nwwp2\r\n=BOWC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPuF66dKkdOqMqWEVCrhwBu1atvVNJI1kX6LOTnEdw7AiAs4OaXHcVM4Jxw41//oa6Gwf72enEpVYc6SFgmWdLh4w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0_1605657406168_0.5514516134813037"},"_hasShrinkwrap":false},"6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0","gitHead":"58331d50a692ee890d02b6688135acda4cac20f1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YFjsf0ggWA6loA/ROfVsPkzcHwaMakX2SJEb8ShVUJs+BqcBIwinEW1iuFxRQY7qEIFD6Kg/7K6b7EqxQ7PxLg==","shasum":"97dc2e40e6863b0b874e43ddf65d563b48d03118","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0.tgz","fileCount":39,"unpackedSize":228082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGNSCRA9TVsSAnZWagAAR+AP+wWPxguopcWuLd26sg4e\nOJM6L14AzAMxorFjQYSrk0Let8zkMakLGCXPgjZzaofcvfR3zFiqCTHu/v8u\nZHvQCvjIUtXcUx0+b+WSomr5fPN4Wu/qPHdooz/Brtct/lq2OojurB7n/QbM\nZIfnMmQu/3oQjziaANd5KOTi87UJa1ESE7CTiKTijP+hkPbwOkuiwjkS3Sku\np6or+ZUZC8aBNTYdjmpO92u+/j/KYlCjGNXetEuWpm4sNTUpkgqqIBsc665V\ndKNcd4wKpRbDmcBK3Xb6u6qWh7VX5o3el0XRjUB1gBLYkGc4/vfxZ6w9D4n3\nxppYQtYL+8svwy0SQtjxGBbFpbYXNb9GUn68xDGvIPc0SOsrvc9b9r+tYgrp\nWvzJnmSVrjBeUB61fEw2yIHS0Xj6eeEAjSjysRZAflN2rDIiYxvyiOmTqMpt\nGWAuz1s0YeuI5hXuofkXMx9TCVA7zb9f8RljNJ0gFsxe5yJkJUYreXeZJJm9\n7Wp10HD7iJneoz+FdvUPlTUWr2sfqqoqYp2beu3LQHIdbQfL2xLsrqbka5U6\nmX0A/482lM13TrelZ0N0onANMeokUssbp+cvoPm58Kvw/ny8idjB313FPVBk\nJHwmPVxoqpG5yxzHWvvUdIv8k4bvsTt24IxOgsRultz6JlrEq3qIFLJ8Susv\n7EaN\r\n=H7yy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1MMRBCwO1sjlR+i1vta+4RkOzhnD6oYoT94kd8gegPAiB4js9ZraUnD21O3x3MzB2miYp1sAAuwHMQ6fYN1JI0WA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0_1605657425880_0.0716687261985034"},"_hasShrinkwrap":false},"6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.8","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0","gitHead":"6a8c55c2132fd46d68d96d344293c87dee09770a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zdVqQzVuvnMn0fyvnqR3e+SefjYoTa4hPAz4GD79IRY3L4tgV/7NmhzL7N4mfBHr70zNwbq95TMAhMq3XIxvkA==","shasum":"7c4dbe0049f81688da23f4ff5e7b61b304e5591b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0.tgz","fileCount":39,"unpackedSize":228085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftGNhCRA9TVsSAnZWagAAVd0P/AyvpGP5HHDivqXG5pS3\nivHqJxeVh1lJuNIcuHSPB+BZk1ygGrkq63Q1EhTavhqeXEnXEbE2IwcwLlcI\n7fLKv/nWhpqpG9hPMRvZJCPx/i2ilxfebkFWiJBrKepqlNQtfGWBOtoMl9DH\nO4UMKEmVUI+SBhThtumDFRnYwvB/FYp/sg67L/7bekrqciO97Jf+W/xkzTeJ\nXVd/7xlTm0ZRTAXEmPvLV7gaseTXrpCASvjhQ1ftYt0t0WafUaZLzpbQmoZU\nEjlgbZDPgocWSxGn/A5HwRW1l32WzzuQ1aXd4PvsBG2MBhqbi3Ppn39kDgLX\nlkixKCMxePHAlmMQTrZNXVFkBh1h/iyZ4z8WNkVmAthm9SPUA1MslWimFysx\n6Bu0SOyNR2yuStGUe7BhEIYIueII0l7dLcpDSv9vDfv/ezB4FlhPjgIe7QnJ\nlChw3Ywt1APZ/4OqG7TqVi3A0d/p4EE4ZWkxBKpFC3bjJFZNkxpe8pVnfo3u\nQrIPabcTxP3ydgjYzOigdgti07FSy6fZpbU7U9NminCoJTQt5s7zLlCBwSCA\nwVUg5sSCPbyh5xOGLjD76vRAUS1RXXYW88B81/2GAJw7polLmX7vV559u6pc\nnpglOnAQKjEm+6UpjKNuaqw+h1QDyy0M43iXo02bHld/GztI5j1Wj4A9UcH8\nKlum\r\n=fB1N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyWZnsAEM6q4SMLQPamuOtytIf9x9r/EbskDUtHkAxvQIgPQIatQqMlqDN1JuCn2p07k7uMpF2pLI4iD7nKP4O0iA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0_1605657441102_0.1825226317869022"},"_hasShrinkwrap":false},"6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0","gitHead":"21bb96301b0059d8533b6d506d8714304eda5be5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kEpFedBrvcsJsRcju0dRK4PHyZBmvzkWRWVLfRvnb1WP9w3miv0H5kBcUd13r8GD60c8zaJyUhxP3SQuLewxjA==","shasum":"90343e8eb8a5af9ba2386639d7b544073db4c3ad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0.tgz","fileCount":39,"unpackedSize":228082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuXACRA9TVsSAnZWagAASjIP/18oOa+52MO6TmFUdkhE\nuFJH3WfPTsW+BxxYk6zM9OmvhFiQBC+KP7rNntc7bAK8SyaPXlaJaj57Hbaw\n3PgEpszEybIpdy16aHUqCmHRXHwW3d8hDSP+rtqgldqmTxESxfOw35Z7S2Dj\nLF7fUOIo8h5yKt0nrq26dGuHJRsJDWnWkJyiLxZeqVB31SF3n4amppdSKOl8\n+v/7wJmCC2c9dmSsn2nc4KadUqgzFTGOwGlCNiZocJuTge4nZoZ7yqNsdonC\nXCiXpBjQA12ogA5pxj4iG9swwU6WzRhC9XG1BHvbOfmUBVsSr0BE8xCoCoSN\nu8Kw8akaH7syZLhuHWgUcGaGTqudr1Hcc78oZYZUSoj6WUsEj51Nc7JFMiII\nxuGrtOXVAD3kXK+yRUiGJZ0sEkqhn1d/1NzTrliuyv4OOiMzBj+eo8b27k/T\ni/rtE3VIka4IfXGdYLSOiIC9uYuFAF7R/4+FF/8Th+EGDEtwNKefc6ymd4iA\nReEqW+cVnKg4i584+QQPFUQqgRMGxLjY00cgVd1ogSz3pmMXc/RG2N9nKzyA\n9+XlzpV2oMnkccNHKKKsy79t3f+W3Nv0RprWXEbi+KD8bv4quCX4lxrOFAl/\nWaQLZOAC067tsV0odPHm9R7PCBdN+N/ABeQknnwgvZEKzJSA8EXf+rD1JTmh\n0roo\r\n=FexT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnruhfnLOPQFHsdvnTf2ySEk0Sq7K7DD2PVkYm1ao9CAiEAt5FFh1TeWmvRG354PlJssSa5B3INUgmyCQEJTWoXejs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0_1605821888162_0.40801007164594205"},"_hasShrinkwrap":false},"6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"36b3369b6ff39e9b92db8c33e7615e82ed5c797f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sObzw20okwwNlFL3mjJl3PDyFjP9SV6UE/rj5dXlbboECXy6IeDyrzxirD5qowcUZwEVl9c8qWLM5q1ZwoAarg==","shasum":"7befa49365d06ef67e42b58206706eede3f0203d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0.tgz","fileCount":39,"unpackedSize":228082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuYpCRA9TVsSAnZWagAAhdMP/0Fp6TE077rw3xYGWR0u\nK5gdIYLVqAPl3EKBpl0QszjdJCdlr9m/hB0onkCFNTbuOlq57yyPBQk2m56K\nt62c0h4wx1fBD6cAsqyWO37GZhX175RvN/Vraveo7f1S4pTqpoKEL00Eh/68\nCBDf9RrrYSQ4fFhcHfPSIEu1Ednkwg0uyBOIw+yeeEfmTe0MI7XKBGyL83Bl\nn6Fb9+lhpoaz09Nx5e3Ov030sf6NzH2zAAsw/EUlEcjqweN+ebR3rOyxTsyT\nJIZApvHDHkMPMW/yaZ3PMrnA9z+J8Dhvl/MCvsZzbjJmpaOZ1zvJsNHtdN54\n25RX4cZd9xmf+WKDrmutSjcDIn5KAcyIE3pslXhWSmnM24p6zxxEkZvwju7J\nZB/LBRA1i2Os/mwkmC6yQt5ZdMTdQO0bTCbcegbE/GamQXKMte/T/BwvuFFn\nHvvtZlHxPtuBsAQa3/64oMxLAOdHEOMquKFAIJLg6R12fMntJBi5+cf3/Q1Q\nELDQuh78UFNz8dHgqTMNyjN4bDGnWeYt+B6ZTuaizCZ5etqZF5+1+mVGe01K\nQCivfFJdhBTizTIJngPDYDmqZUjbcBaYjygX53SU6j6wczjPNVcqoMQ2R+AJ\nZaJU4yjJjUkYMG15TTPXCgmNVoZiNxfiUGldecI5uLRb+3ompm3ySSqJL+Ol\nSbpJ\r\n=hI1p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXUirjselIwqsKvb9kyo9zRs56mEqrAtjkJLFR49YFwAiBiAkJyJR3Vx49PON098HlLzaf8yaRhi+j01dj9AgkXnA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0_1605821991934_0.4523894047058623"},"_hasShrinkwrap":false},"6.3.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.15","gitHead":"ad97ccc894b83bc3d33552b9b67f53e0c084cc37","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.15","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fOz6HCD12X2kO0sJyuS+sxR6sVvGILbjYAQnZXMOwpNhL07Qe/eJ9UN9ZH1GCTDC7lW2ApVqj8C3s6aVgTIF4g==","shasum":"05e36f3fa5eb05f99e098f3e50cb28868012d93c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.15.tgz","fileCount":39,"unpackedSize":228323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuZCCRA9TVsSAnZWagAA3tgP/j/sm8QaxhNtzg13Xglu\nEYRaHcQgabJGhvNQEgSgKAkGi6erSGpMp73E+8NvcBGRpNxDvDi/zAvL7gyy\nuAwKP2hwywT7yHhGWV4WFk+v81o2NgtIj7k4i+j7jUeS6x0Hh9s9Tinz4uRA\nas061k1DvpalHu5MsnP7495+JEH4IAxxYFIKDStKd1Bvl2VdD+X5rX42gMvn\n9DKRsAzsXiqj9mbU3bAOQ/KhSxzrQePhtPv6RaDDvfU6p86Lcmaa05XcYore\nFxIo1UgSiVPv1t3E/U4kjr3Z323M4MB3y7bYgYuZTvoXzeC/qoZqKyvzIT4F\ng59yDbWlqkhg42H5DD3EzSZFSVLQ9i5WZAp5pbTX6xca57B2naUERV2XrXQJ\nF3zfFF0WeYi270yVdkYD7cxdEUQzkpcK14GwqJVZFgGY9ZGr/jDKh2whjZq0\nzHigg6cPyWgauaj2jwyDP7ydx7BKX3pDHSRGo2H9o5CwFGHOfy27LYITFoOS\ncGdIy/S/91VdJ1+Vf2cUKjTsaQx4USUSxOfIlZ8D02n6HbtiTl8KzzH5oRKV\n4GQnfetrvuDBqasWFLtZZwkuKJfDAyZTWL4tivdyczNLGiDSgXale01/gX2N\nMPn7TxDxRdZrrwqaz5OMacG5nkspjeZnrZybwHpXBXO3B3oJgVqBMRVqWJ1M\nzrk6\r\n=Vl18\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxJeuCCxed5jdK7lkA2/78VzT2x8OY2I29aaqDdpZPFAiEAr7WJaifWc865q3FEtp2i3fq62ATjlj+JxLhvHwcXbR4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.15_1605822017623_0.046848688857047405"},"_hasShrinkwrap":false},"6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ad97ccc894b83bc3d33552b9b67f53e0c084cc37","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZtcOzKk1yM97JbAnkSIEalu/Nj7wezMNEnGDRdb9YEcjNbLUzSEHEUrR8VYnVT+kZTLs9RZlZkO0y+U/zgsrcw==","shasum":"5af7907d85a983352dbd255ee550d92fb278cd7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuZdCRA9TVsSAnZWagAAS8cQAKC001InWL+XiKkoXc8J\ngV8MClcKX6+z9TSvSJniV9/1prSy6Z8XlRj0rDUs4zU/MT1njLh1roLIU7Q3\nMcTPs00UvUfDsVmK/9TtelUzfNsIwfHyxeBExKjqBcuoQyHUOpP4tt0bveKk\n4dM9sG5luQ8No9fZdfsXATC+XI5PLXfKdf1Q5JB/pGpwXx0g7atsqIH5e365\nMm/k4gthnPAINlc2eg6+k96NMwqA7aJ8BBVL0ZjUfjGcHDx8ksi48BEcEnCt\nS0vo9XTRzMwjgwBM8PIf3v92LSnWpX4I/xtfxc5HPqZEI+rl/TAhISn0OdwA\nU9Ljv+/kAWWmK8h+uNdzMiZk5f7BwFBM7KOJ7s074wKf9oVw2GnbCPqNx5yJ\nRR0OsxbdjHhKNSk60x+vapEMb4I0u7WrPjR/wGUuC4QgmLv6NFaJuR2x6KLD\n9teRLwytMJTItii3i+yuJFQjq9tF5j3Q7Kad3d0WJuklkrcGV4DGTOESF14m\nbNuZSO6erz27qNVWcfflMGlW0jax6K8jt6hvDQU0LAEUAPcGlEQDH/yL1WmU\nrs2Vjp+C6/bKdmDC0Cte/amTtQ4tYod3hScXg+9CzERD3sWLXsCfW0VPNgbi\nUjuUS1Ps1z4FZEwDAE4OHUQjexqI4HljWbJTbRlh1CvKPXIWdAy9JL1ZClaY\nxxjD\r\n=eOWr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCHvm+wK5X1oHCBO53m6riuklehRtCfVhQNyEahwprLAiEAgKRGR78w93/pLfUIkIjOdvOWqlHq9o9Wg1qFImG58UA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0_1605822044634_0.24384788936106805"},"_hasShrinkwrap":false},"6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0","gitHead":"fa765036b36b71104a0bee2d3183a8cdd44b94d5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UBLefJYSBdZ8Hb1a7h7Gqa18uScrVionpHCdFH02rrWvCQIByKnxDGR0vUEagz6FsdWUn1jvsDVIAEk/OiDj6w==","shasum":"0a7c8111f13c026ebe23211369b754eb3256ad0d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuaNCRA9TVsSAnZWagAA20UP/jzZ4xYpazq7DIilG9EG\nslkfpAwjJVSHdZ7+afBaNpXWD6H7y/y96S85IvBIQXlmItS9D+631Q9JVHkk\nmWnvGs7K1YHrs+ZLTeM6jNi1j5F8XBr8LtfYzPejtmOjn5jGUYlbWmwL/OnJ\nxAkcUOx1d/yPtcXFSia5zWvF44UNcywGjkYmkfmfHDQFs66S1CaJUTjRvNHY\neNApRkz+B3RyrrVbaKtImwnYE43ntNNt6n2puQq4BG63gcFUCVfA/WnO1Edo\nyN6/pzCRKLHU0zFDtc2T+6z8acbMC0cgXfv2hv0YMtYQGecdOoYxrX3nqSMi\nZNmv3x0FIji2pNzI6qo+jcnIOSK1pNLK7fOIgBaMJEVTtog9lU9dZgSRem2g\ncYBxR23Dsz2lG+QVtl7j9L4XmKmJxq88Gatn7QK1XbfZytxVdgt17ou+aK1Z\n9C9f+jZ8ABE6VWRD8xIkUxSuBxH1Mk0qzQh7KyJOzWHE4i9wmzm+K+vRRHN/\nlw5oo9k55+RE/Mjfi8mjskMI3ooUeebp/4xcohNMaB7bdAI8iCqvEHqZ7Q2q\niD44Cfxn3H3H32+Z1zwxiXr2wKMl7vhSR1QZLHgvZr9sLmxjKVP+rz9ixTyg\nSbzY3dt9KDQgOWOGpS1A8aZq73kqrmJOLoAr1bzl5eBdonzRKoXgAfqJb+rU\nni0Q\r\n=IKQs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFQP4173S9LX/nORtOyqTKrjZvrVAzcl20xayKjzyzrAiAHlVVl8jJt2z+LTBOyYSXYGEkmp+rS4TPUMlW6XKmyPw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0_1605822093234_0.3256125522071207"},"_hasShrinkwrap":false},"6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.0.5","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0","gitHead":"e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-41RyGdbssDkdeO//Agex8VovTvUHM7qJEME2Cmrcr5pohOy8cbV0P6Y/94SVJXsLGEVFc6Q8UKkkMaH1EDAPvg==","shasum":"c003a1d32a9782bcf23eeede60641368fc86eed6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0.tgz","fileCount":39,"unpackedSize":228369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuadCRA9TVsSAnZWagAA5lMP/2fMQE8UXsLiHhKGC+nL\nycSVzu2ebKb0fMh9+AnQeuuWEunR/iXa/5NY8XPSknz8zOaMyomplUPHJj6V\n+7fzpxySm2+piDuyIkcTYFDC6GZSbP4m5HDi08Dd31Djb571zztivMEoka8L\nvtYdgKiafHUOnc8gZA2BREAbWB9i1UturaYuQ40X/fl0SyRDSE0EVpu7t4jf\nQQwo87Uvpd8nVICkSNV1sDQHA4nJFvYmyaVX4X+TBYjtwVdQosQN0TB8mEBn\nHeXYWEJAQrY7ikRCGw6k2WFj80lFkMs0el1hfLX6/RqRNPv0hVps6N+ZPcjp\n6t8+6nlEMDilxyW68+Z4io6/gRDQHVwloLXcxzvJrxpkfDufVcAstAQPGWzI\nMJGj0NEUQCwY6/m9nzlNWMq8nn0BilDDSFlgGHAiWiSMumc8jmmAe6z5tnWj\nASlJD4hXDyLVKEi+vAbkf9GqWTTI+ULMBjsMQOsvcacLuK7m919AuYLX4/US\nqGj14tFyu2npQ0L5LWnLkxGvxcplORwA4IO+h0W4p1cnA7GJEGGwbxSd7oZP\ndIBfhI9MtyFD37f2+/ygBkfdiGs3c7ruorKLAWmjN4Ox8Xa7wWJU+gCT6Rh4\nMQzq1pzcciNn7iVfw6gKgUaZaBg5I91T976EVndR2NxUvU6FZMndnYnuAVEE\no8YF\r\n=+RkN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0xj85CeaxhoyDnm8fVWFCjkC7Mz/KuT4fBhkODhq3lgIgGfcPLlQwC812L5Eff9/lO2aYb473JlpT/bMznWx0lyk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0_1605822109090_0.010942120309568981"},"_hasShrinkwrap":false},"6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0","gitHead":"8a833b00e022a92081170ed8e3ec26fb66a80ab5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8AzXlMtnV3KDyAcKVdwIyZa9KUAZZkC/LHHdQ3gws0zlD3rR3owS/wq9EP4H5ZJAy/KX4icbXpQX1ItKZOSCLw==","shasum":"cb9c871d428d5a109b3affeaa63505448e96da87","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuarCRA9TVsSAnZWagAAXZEQAIEn+HDu6Ffrk3rQRgIT\nFW5Lt7fuYxD6DOQmuYrVnI1x7pb8s/ew2owHdICin03QpfShj/Du7YOAYhcw\n+ATpr6MaxKHQSYLm6lkyuEJqLcKGp+B2Z6JG4UNtsBfOTEAa8J408v+hXFdF\nAJLDmwNad1JVtFmjE6yg+Ok/ahGzONWhZruEShATCb75rwzVZBxYe2KIpQpj\nOj1mNkIpe8B39gkxVoRgdJyG/BSHZlJ0zNeyYnGrUMXT5whxQtxdUIV7RN5N\nDGHvtlFq3q6v7L4pCjIoJmT04v5p9m0o06Z9TSYvRZr0qFv4AsRZnkXOxXSf\nF9CN3RCXSmG2BwRhsOC44i5sxVWml+uHPiTwntmE4an85buuPDcOoPrjbKfQ\nIqCs6MYVUoX5aPu1Tw4U2fB4T05lBoScwNVORVkwTUmyLZoY4BmHPye9gnia\ngfSLVZjcXpqWMcsLVyj/jY13tpE+sM8FIFmXMeJ6XS0Yk4RHL1NMEOjmkFnq\njzXegxkfpu4ZUTyp5QLODYDc6Gr39UdCNjHH0zsNag5wBMkZyuxX1uZD6Nv0\n3mDuinfwmBasI0O4x2fcC0Noq51FK9QMdQDNnuUfbUwIcz5p2/pkKrsFadL/\nNkqWmNNQDdAH0miH6lr8pXlGeSVnveTSaEeo3dWwsFyU13TAgXha5k1At5wG\nDuFi\r\n=elFk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrLghusgmbWON8vWlXu/OMI6GWngFDqQJfOcwF51gNUgIgIR7pHIOvRNirAgrNxzExhqCX5qP0OvTLR2/v02RVu14="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0_1605822122968_0.2463798363955143"},"_hasShrinkwrap":false},"6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0","gitHead":"ab1af21c25a2ca154f7bfa16952f0ae52a1940e5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-doDg9fMEsBY7QMkFBtnd+YIVqfAm0qucywqti8/STxeDyWddwxx34gvRBjvMpcyzH/Nymdq5KPEXXUviu8hjbQ==","shasum":"66d3154bd34580889a7cb54e4996d4a369d513ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0.tgz","fileCount":39,"unpackedSize":228725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftuy2CRA9TVsSAnZWagAArKUP/1uRrMEXbvTJMq6D0Qi9\nDiVqv36op7Am+5XNcMMSNbxpiSzxdce1WVzMVMVDMP0pCGV6/Mc8SpdsOjWL\nMS3KPdSgXFuAR5KqogZxBbLrqmdXh7IRP6osGLyIqVAqtq4EvFWQGYZgNAAY\nPZ6qZNAEtE7AKWLCO6/guBrG+W/DngTmaCNZUgsD/YDzAKzm5c1BbSxukYi/\nzGblQviaHgCk30Ebxvy7dN/J8PXaInmHfQV4vDC8UKOZErU6VnAwlhBd6oPK\n6m0RErptjA7NC1A1B0N0+J6/rqsA0Sj1PYxP0UbgUs5w+HGY7XMJO7FMj+I5\nUpGt6mjVaJA/rUsoRtRURze0NRfmtf9F9wWucOpAJdrZI1FauvBTt99FwAbP\nuC+hWvHg0g2Sw5MI+pwMKjCG19uQeK7y1juLb2pmuAJ5wLyz59ftYfl7+s4r\nOCvvjzQFFbMIYM7T2uI4kPFjWxaM/pUtlFrUAcHj2oBreARB5loZNJ+98/Tw\nTjzqKJHtvvic4vefFgmTkbbueP9kzfSO05yyjv0+9/XhPtkvyWW4cJJPNGdo\nGkKjLN1ckpg6jBI0F3EY5AE3p28cdG4tQJ+DP0Sh/Ev38hiNyOAhccHLN0PW\nA0KyXCopidlAOuOa2pzgY6Rvy59vyYyNVAXuAWSYdTWfta2Yj+Ce3omNtvXG\nisFo\r\n=dI4d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD07lloveCCcOaYH9HzTUFuCd+8XJ+UGngHAzpI9L31oAIhANMMvk0spZcNi8sL0cNcSt5OHshOdL0U3Ijp9MWfjUA7"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0_1605823670070_0.08369567448470638"},"_hasShrinkwrap":false},"6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.0","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0","gitHead":"2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mcIIoPA6vORZTyih7wBPgySazbFCOEVSAuVUQxl+XkCI7jnn+5lDB4Mc2QXZshU/WRdwZ8FFCwLD91faWwFLDw==","shasum":"9d33920a5b05bbca0702ce34f606cb44dcb38847","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft2BcCRA9TVsSAnZWagAASdoP/0vYW++LbzFdcyQHe6Zw\nZ6/QsycIl3eAMnwVmTs1kgTHAVm/Exv40SuePEJzkL/24jlP00ZFq0aALjea\n7zsPh74ByMAutlZvXH8NEH5jBR4xoiT81CzeBLiqcSzCJspQpFiU554xIWFc\n/AFcU4VQejGc/guVGwRrnIH9uNka1yiB6NCqo+UrWSdeYRBoxVyZcB02idZL\nEsoQat9FQNRDt5kUe2a6SP0Hl1R0rdvK/73mAzjRliRW0TCt+UUmD6T1m8fn\nCjc8llazly4JwU6DfGh/VfYe2boGccUVDPcspW5CthqrnRqjSJPZdkqLBt+l\n+XyBAC8o+hqaDEHc8tSQ58P7HNjHiCPqB7m5h2zhcVShgAetBUTimnoWlHuF\nqiJAoW7Qr0kzRxSy3iv8goGODecdfrBrbG0QzHs1tf9vjftFLBWOkeOagsJO\nb5AfTSOpxQKvEMaCiXkxt5ATqWu3jDRKYjPspz+ooGMKvngoSRbKZwcLaKtx\nAX4g/jeEY+FoqA/5vYeSIuADvfFKuCX2SQcjE+57IBJujgztlqN3UrSQSDPd\nfteY71Le1tjSN+onIk6hNRF79F0tjHg76yso1fTWKxhbEx5cQEYdGQpsU+k/\nHemq97e0WNOPHSHX3a75JstyDYhFOIo4OuUG5MSTKLL2l9SKJC5/rgtiiL6F\nGySa\r\n=AsvK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQzWEUHGU6yJ5mJhlcIMdfdUUk9fBILlC+HhlC8GRu1QIgEYzyMzjz2dLDSoDDogE2X8jLLnvKGW0c4AKvuKZFTF0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0_1605853275484_0.8935345784062143"},"_hasShrinkwrap":false},"6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0","gitHead":"78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-05DoM27evB9GiDH4SrmJEBSlvLuUowRd7wMvPDrBN9zdlrHynIuZIBV+h8g2LFH/CGHBpPUpaPLz/pCdDhmj0A==","shasum":"5f1865865e4cc874b8a18ea89a095b8b8f0cf687","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJfyCRA9TVsSAnZWagAAiqgP/jQlrcXDimduwK9lt1GS\nzaxyl2lNKxtteMgDhpPnWpBqV3Ve4lv8DZkPRKcA1pLdNOyz60cj/oJ++G49\nltJ385Rg97JJNMEVy3Yy1Oybp/TaMC9uqJFAe+bDNbHpi+IPjT6glQ9YtOsB\n8OUrP+6ZnmAHKiKG04cA/sgIU0HFOzBYGkel/lDIIuBqtsdDK809sO7t6wr4\nazkD03/haVnLwoLu2ALk9UgP2/Mh3O4OELRcR2eeLt1Bl9+i20o5d2SCM5Ip\noyMmcNAQI0LMUKyAGhJjcLj17s41sf0bgy4w78tncy+h+UOmd630zllg1AMF\n/AFf+3PyW+blISEfMoBawDbDTVF2FlZMEzlNCqH+HmpxGoosf85OhAMVHK72\naR/WVJCDurJbr68uVLdFfRaABXjvIWwa0kG+7Pe9TvCzu9rj/BDXUK3pc1/e\n+9uxJATVPDDM23ujRLLsDvBYvzmWrXY6dDX4Y8H34rqkOCPg/q4N5Q+aP3JX\nXtheK/qNGllVHQMa71uVcM8HxDUwGLfZ4y3IfkWxwjpuKQo2yhpBy/+cte+3\nWsB5Aqmp6aKM2APtPp+nHdP+wPRIP9kdEPDTiON/DLYWmTBSnLibXg0To/cA\nJzO0cVxQ78R7gHV5/iSJxo0QcxqI1gJAgRLKSqrt+ITmQmrGNiD37mL5yJtv\n7/RU\r\n=TCic\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAGB63nyDTR/avo5X+vatN3D4Thujlo1hA2mECC8ir9XAiEA5oo5UKBxFgyOdJOtoZVR21eSDtn+j0go8W+pcnBwb0s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0_1606195186327_0.6455535579647735"},"_hasShrinkwrap":false},"6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"35bf36568dd6d8702cefccbd5167a213ce1fdda7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EK4bpQWhh7ZUXWFSDCQEPsyypn4T0GCH4uu5asaABOiuhgLCdo+e0e+VaSo/uPDGfmZt5y89hIoLeGrZZg3G6Q==","shasum":"9da38454d0267cbf73ecbd8d67ab4895bedd84d6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0.tgz","fileCount":39,"unpackedSize":228366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJhLCRA9TVsSAnZWagAA+D4QAJVMPRtoYYNl+pcFwWC1\nDpVBH7Dxb4yAI5b83Q7NGhDPv69URQA3CXQtpY7nRaw9rfe7SAUt/w6bQ1Rn\nJ4IXFtTLz8OWal2xRt82WNaxBOfyTpp9+/2Zhj1TuGhVe2wR4k1FyCDQeqNN\nmbld9umuIZmu+Qj4PekqLTcKfzNubq6IEX8xZgEe7OO9FNNg3XAvWbdmA3m+\nd7UJSREvlgB2cAIMGENmrHrQy7/Od3n5h6LQoAE2FUvPzqpHIvPrefv/AqST\no2Wk2rVaPtyvst7dn1dasxv1KwplvnOnFU70jaRBXd/lGrX1FkvsraAn5lDM\nzTFZ4nSTQbaUcUKkmtpx5UWhRCpPddpq0uwbNa9TcQopgpLbyqD1mIYFT8yv\nK/nRKqwhuAdjYl/YQb6R8rke4QhT6QTp8JvlyjWo0lQ4fD/rChSYl6phz6cb\nXm0CD5b8FqFxYKKi9ZaRk84YnN1/rGp9QemonK4uhj+nu/TSzcfECwYmtekZ\nqIaPZzpszFeNBsKBOASTxnL7ZcGIkk9wCAAY0tSue+uywYDXZMMBbV7PrwpV\nz4XlD3CEzAEmb/KyU0V15G91ss2C858+W43DFRnQvXKZWU/kKsfLji+BNZ0P\nxoKb4c8Y7kNIrUdR00L7TsG9m3sZqH4JbqxjwTFcGoiT/vL6z1fsTSIwLbud\nSgDS\r\n=c3OX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEN+m41psfZJIVhhWdMhHm8clVYXBd7bYJ4CS+oTs/rAAiBeh1nLWc2dEPG8IZ3wuIVthHs/H6FzMBrtRYws3q5A7A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0_1606195274889_0.24592567311691615"},"_hasShrinkwrap":false},"6.3.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.16","gitHead":"73899a15ace8a1d461f6e1646224da7c19e15d55","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.16","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zd3ctxByJ341Sb8e5wU/eVb6pomMT2ZLOGdx7SzzFcv8C/1HyfipMHzt8MnfoJNoGLh0acExWVCkW0XNbXJP/w==","shasum":"7bb7be9190a98429ca971503091dd3c71c7bf1f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.16.tgz","fileCount":39,"unpackedSize":228605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJheCRA9TVsSAnZWagAAN9oP/0SjTWEIK94mJIkpKXzs\n8K6JWKHzrsDHvSaDnUSOWvq9LsPaHnnh2sInNoTxzZ8ZMS8I8C2MO0OCBZA9\nTQMAm4ll4Dxlm1rzanlm7ROMnHYHNXap56mRN2iv1TftyRlS3mtiXBEAPfi0\n3wN7K5tOqyHVuRUZMKJzjmivA3pkgWw/RcmQKlUIkkMcQ4lWMolUVQKQCiAH\nIsEMbsSCehsX9acMXpKXvi+Wp5jp6WmbeRuKBNwS1QDwskLIdRm7jKWQDu5X\n5VNM/Ds3J4Ga2/9PGoX1+8rlV80DPhOL9Bg8sQjxtmK2DiaM3RfsA3mwGsEf\nwtgd0j2oA0GDbgFKXyQqUPtCiz4wfoz7d5aH16w2piLRZvTuQ+qzgDJlWVv2\n+aDacJ4+SMO6FrV5XkVNXWaB/Bd4Gk+C32IvqIO6X6+M5imzUP5NET6SguaX\nUCdxWFn44brG2upQFStceyE2sZdxq/c9AzuE/mPpyU1vsIUn5Cba58Qvx5Yi\nZ1J87Jcq+zdgCjr4cnDPycFcx0VDU+TjRSWZ2K6AHz8+nE9Z3PdApqZEDfFn\nwXUeO/+OFAkut+yLea+MS4kP7fP16vNoQQRccZ8+LT0EOIXHMf6yiQvV69lq\nAPYtXlaa+nJkrDwj0DfHY1oFlC4dWGkheRxNQbZU5Rm1dyjGseG+3SbhVRll\ngdGg\r\n=ZJub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpddUck+ELRJQNS1n1UuAAUNeFjZNXwo1ON+NW7CAMcAiEA8YCjn1AR++dVWEJ6/WAARz0y1gIufNEZW7NqZhiVVWQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.16_1606195293731_0.2870520971693058"},"_hasShrinkwrap":false},"6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"73899a15ace8a1d461f6e1646224da7c19e15d55","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xr5EVbiZzra6r2EKeERylGzslGNNdJe5zAhizLlo3zZT2K0LaAxIIOspg5Bn1HW24d8NMTT/3e/fwNftHW/ZRg==","shasum":"c283a690b5e8cdf3f7189a1fe8dd2f3ef09d3c79","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0.tgz","fileCount":39,"unpackedSize":228648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJiQCRA9TVsSAnZWagAAMwEP/2PF1mjtvdSdrFpBBXP8\ntvvVY3VD0MszgARQWFbhc+5C3zkPw7T1P+a2xjvSYKoKXNfFKkkfVddAOHec\nlfDIz6qBlZaeIzOH1EhV06pSA7F3JEVMe8gWVuO9uwvKJGRKmVyd9+c1K//G\neYuVMwjiUOf5N8SSAqWDJKgMXSfRjGJQGPrmrfM2y3giijyE+tTNcqu1b6G9\nvm8tlDeaRyfXCHVfp+s9O+SGveYIeFAY0g+cJosbd96+Ezpr+X/O3ST2exs9\nJ+y1dRNj2T4uouED/3oyrIHG88YEk+S0yNaMk+KpEZy0qzmw7iI8bR2GNaT2\nh1fqf2IiXbDNPkZGgB1p4gpuT1NU9lQkBnllwhlq8NDLx5FUie3ZZfBWy50w\nzm8GVpoO5leligCcPWI+gGKNVb2iZ5I8We+IoDFAdJAOPeJ2z4+0MmnKoSN7\nOK1ihhkmt3HOis+UlNiMJSoV+DYVqxHdY5jEdLcGHleYTuQBdX0ljrrRvnrP\nDiP5+5sOtXdjDqY4Id1TowKtHtHvPp4PxFqJiUyr5kCEdun2atdwt9dMMS1+\npyL8FBZf/XcTlUrmQszKeol/z6bpCTLJNa5cys7uFqwuuHbrT84f7PQWmMbI\nqrLpKuCy8nhGR3jwGMyD1GiOJ5zPhiRyURlwnnS1OLuB4sXWMBG834xB2auJ\n9HCu\r\n=o/4I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV/SDsORZ6u12IDhQ+c6xePu2/uJUI7FL6lRo94oYyYAIgVP5jX+ZEM6rj6Q6bwB4iM+qDKuXt2VYEj+ZIpJtiDsY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0_1606195343980_0.31075086677614294"},"_hasShrinkwrap":false},"6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0","gitHead":"42194c360110e1b5d9be6cef712debfb3c8f271a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ct7uqKG8CHagKtf2NabCwlfzmyhLOlOJgjFdFVe+jRRajvwf/1yH657fItXb/WKx1lh/yHC6Ahx1aoAFB8QR6Q==","shasum":"13a426e5a1bc8a25669e480628c37d6e1fdc759d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0.tgz","fileCount":39,"unpackedSize":228648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJjcCRA9TVsSAnZWagAAh4oP/3ZYtojLY1zAzLggAgpD\nL2m1TtJPH0/m+wNX1jZE96tW3OdRM2rFRa5P2ZuDZqfhWaKm7lTUQkrE0TwU\npYfDib4GtMMDdoIzL6saOnsp5orw4Ssn4lnvlUKQWiIMGZMa7a0v+UB9dDy+\nG6Hi3felaFQKGVLIXR5DIRgrgg7f4UzeMXe6GkXIbaSIGyVZnRcgzz+qEl2A\nqY1zBtQmpA1RUFc97JZAP4TQaDS7VA8UKHBl2rNLHHzJtpncor3+X8SeeBJ1\n4zdxt41+XifErcbIevc2hD76V0GNwVHFkZJqNcYAwmqTNfPe1pFE6HiBu46S\nWsvCsqxG6fw2aJaD81PMdD1srgwVI66mUDV8v4LBoxmSx9oxAxkjYp3v3NsL\nawxiUXoBgGAS+4JC8FQBxc2rYSEs4nrxmjvcjwo4aHV/E6vgpSIBcc2F+Fxh\nKq5RVWCRqUJoE98z91sOHopdhKVTRXCSQUkIuXSBUhdA8XjztFKPKxLuebxT\nfMQrlyI5JqNjEWi/pk0bst3e1KMOg/aY/mPKDrlkBSg45Ok1yvW7aLKBME2L\nmJpXWC+mvXO2FlKasaI/FFIdasVTMpXRbIv+t0799C9lYMGT6IfOqseObx7b\niEtABhTvJUiLWBmdAQnNNWldgNRIu6dQRidWXdwJrmno7Q6Szef8kf9eMZUM\nu3Wy\r\n=BAWF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2tO20TJNZ3PTwhT4v1RK+k7tfMajgWe2fRcP+/rQP1AIgaNfp2tXk4QC6pF5/3avQm7cpVoQCLDUJz0fnZc9Qfks="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0_1606195420344_0.41418021954202633"},"_hasShrinkwrap":false},"6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.0","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0","gitHead":"799035fd68f41cc3ca86887c4b5599b39c8d5d41","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-a7PiFjvzRg+5JGJN2XtWUbeuvqfT4haoPlDHJ9VvIrVQ9IJ9eFMkMHq9Qc+8we879batj40QDCtd+uokTbBSdw==","shasum":"615b610fc654cc376acdcd2a64b92958f0f1f0ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0.tgz","fileCount":39,"unpackedSize":228648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJj4CRA9TVsSAnZWagAAHZMP/3gTzly3m6HPtMdqR4AC\nmXOfkydF4CDHWYpn5nN3GX8PXXMVC1ceuLungj4ImC4Jihpg+WyajcQxD7mO\nmB+dhHctLiAUobLR+MDe7XYPBVTeyVchJ+SsKZ4qdynhzyVIUzSQVaTOzaxM\nxoJSrXF1Qb8rLAuI1WP/Tc0+CE7qtuSK+KEQ/1PpWS0EAGFnbGh4stYuzcF4\nIOOiOhM+McDh8R8s/CvH0R50N+abFqC6XGF1q56ecZZbaqflIT6t0q0ScOK0\nsJ60WV2GelPY3N/TS0mQKqH1N1ZR55MhOg6AUyeL73SUUdiTPwTPJlV/4C9l\nOAtY2lHi2Bj5JZrjcmJ40eGbxSaxby2UeHBtdDe85pek7KHb+rzv63OUHCpY\nSdzvWhgGtPESSdPaiMTC7Al/4+f//KLcfFMmi2r2M18TIQNENlslGLkhEwv2\ngEOhmgP9pZZRt2nTm8u7fVLmAMfVCBA13Gwrt/E2mI9nVnzt+Z5WisFyIo+O\ninC35d5wtg4RFIeiMkoYcQG7hWHZG+i937wdbAG6qQaMPY1Y+HxPZG1hRyUQ\n9l4EpdDrjcEHhuG3ppUFmrPRhINx+/6DnCCV63c+e0IT04yA1WSycKA3S0IM\n3Q3ZXeOz1G1gjDw1XngmQEyIHb0WoF3gMBgMvxVZlv1NexxhrNlNimPtXkL4\nVMlT\r\n=o4VV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQM1sahZPxfjcM7PulJouKlotwI2Otxdv2XwloE9AWAAiEA4yL0k+gvAq1GfZnM3rA0FoMNKQ0v8FszlR7GewnBR74="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0_1606195447864_0.35858387544597203"},"_hasShrinkwrap":false},"6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.9","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0","gitHead":"9f5cc01c949beebe74d618a725494849691f42e1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-lV2EdPy7IpM5uPF9TRsnHus0h2YoyJ2V8de0vtQrtPWSXlCogE2V4AuDLShjjYWfe6SRCrq/wVZQkmOj1mMBEg==","shasum":"abf4cda838ad60b4c66bb81c85cd1cb74c1d8ba9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0.tgz","fileCount":39,"unpackedSize":228648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvLGmCRA9TVsSAnZWagAARKQP/AvlyQjaNnI14kjVPqLw\n9a8CWNbrqWKmcnd3oZf4j7mKMHZRlw/nXiiUz83xnrPhbm1mQ0J8B9mUySD7\nqJYJnZfwIgEkokL9/x91ThTBRb86a4OsIZV26PpXv+dmJmAzb4ArGqQfJYpk\ndm9gWWUmuO3hXxI6qLmmedg1rREGGDEhCRBXVSd9Hf5AR3hR/4dVIoroCP5f\nIcoNx92T2Al8RZjBkjwbxrs81RHdWaxl1Z6N4URprVnCs1SD9QEdA1g9RSUZ\nBMuNZbTnTv9fWHKNd8VjBBkbsv5VkJUvU/uKQHKRpNtMHghgEvefLv7rNZJz\nh2vqfTJTxyXigJq16nx0TREwhXJMaFQGlnXrD9QWcx8Csyts6flJQqGAK9S9\nZf2MMQ4TVaEfMZGmiyL2dEUhb4FynWvcCC5UqYt4giTJ1FrGQIfuOML68JEO\n9OiqttBOO5uyQGT0TPbpQdGVIcT/8GKk6YpjXL4c6qhPHPxJqcw+BZ5AXLyy\nfGS7pEfyVgviR5SC1Cz6GudYmp6r55+S1jI9QFEXpsz9EkSnOO+bzOfYlhYs\nWfTx1dVs7lF46WQMLOiwWLT1jF183eirzWrRHtsc7aG3AIN2qEZEDxLQ/wpF\nzoEcS2ywtteeF29pe3/iYbz/ZulPwVcHPVI7wyPtB8Y//nwcTRoChuabIijX\nUZ4H\r\n=JSYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiAQSJT8Sr7rgf1sTQerJ6u13lj80EstXVTvKEeblt5AiAE+VPApG80Y3KJlMvQZYBmAx/eP21Ot80Z5g+0Ne1mJA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0_1606201765722_0.4037167933163808"},"_hasShrinkwrap":false},"6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0","gitHead":"3c9056a9842836410b0d9496be6b86dd3187f7d9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-N7WrGMEGCENqWQdF0SqTHI6gETAtIah898r5sxna2O12T4+zL4SvlS2zobeI5mN3Alok+9CW6DfAAjbjJ+JJMA==","shasum":"d457b3042c6fe7506c3566f37b90b421d1fb910b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0.tgz","fileCount":39,"unpackedSize":228649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgIFCRA9TVsSAnZWagAAUb8P/iFbpMJDGrw6CAYTgq6S\nxHtugiEQhSfrvcE6rSgG4LdxJ2OSJfgPT71a20tNA0giPvp1RHkx+hjUBQOL\nif3vyctH1UrQK3vNkw/bGCUNslTy5SD6ZrrsMUcE30+L/4AJAl7cmS+ZMAhs\ng9BmOgzExEQpFyneFgx6dK57VjYUdXvYBOfX5mmvZW9xe9ucdMjeAGNdP18z\nndTr51xnyg6ZR5qvXSESKmJ4yKJCzd59ss0ZlVenI1XmB+R0AVm09pxeQdLu\nDBZ79NTUUeAoRyRtclwUL2QsWpxsGieLLY0FcVs0d0kjEAKHZzrVGmjJZe+A\n66UEDfhEsWFCU6zhV26bSS2itJqdOiJjby9TWp6EsKxBuahmk7B6tGhPKCLS\n7GRNWVHtEv32lUSmPut7lCE3x7Tw8nMDuW0LFnOyUeUlSyaKSnm6Fz2VDVc4\nG+Z5LC+aXhLCgLjXfxP8X335N9CPGScEm3nGZsTpVj9w081vDs+5Owljhvj1\nLSBgKILGn4YuPPHNkIFVFdUoJ3A+PQ6qkYOui4kyrbLx9md/U0s+9EIxtkiS\nwAQrhPtgJxd+64loY6JeVdIi/D7Xbrcto6rtRxlPWrnIMpvk6jDPIeNFY2Hi\noKjagsw1Kxjh+02XrwVsYhn+0+YPXqtK18WAY0/qRPUQUVUugMCYdyPS32VL\n/qHf\r\n=lS1M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQFjoGL8MSTkzqzAdm1cSkthPKXo7XdassSbeDMA3SAAiA/1rhSHbnry056wLMbM6j0LNRpdsKd29S13j/QF/EASw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0_1606287876564_0.09793574707502861"},"_hasShrinkwrap":false},"6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4f4b99252254bc28d3e5763c338b4ce918491cfc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-BOVHA50JCjUUb54fRhbLBXblSpNf2M/NkVLInFseW32duhMTVTaTbNv2cedgARc/gW/gFCXnN9sfOTAxkrjrnQ==","shasum":"c6f3204eb3fc0891477ea4deba177866a7e75777","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0.tgz","fileCount":39,"unpackedSize":228649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgJPCRA9TVsSAnZWagAA3sEP/RalvCW1yyhoRXfBboix\nkpBZWd5pRQQZodWO4hDvDKqaU4cvd37V+kA8SDVuyCbCUhIDfbrhEc080Mpg\nYHC4wAMxEHXHOHoKsumel5l44R07I3gD8YcoGxuugG3uorgSF6wL8dLb1f9a\nI6SfyDpbQtgZTcYuvqf6jxbNGn0X4X+pHCKNJRL67eXf+r/L2fDQBD1Hn5Ae\n/hviX9FBcrL0XDFqimzggwybuSyGT5VL+T63Fyvng2MPGoJtKbyWkmr6/1/3\nNuZE3x7EC4Jwtx6AcRSPcUdtTh2gAt0ZetqBRRdaBdAmhFo/+ozCgUQG46+n\noaqfeY9nXC4fZe7mKeCx7fsE+R7QyIY9c6q51k2L8fezxsbJLe4kqevPBaWE\nUj+wnVO4rl9IPOd16IKAoZt/x0iKXKZ7ZdNv1EJIeDzsoIE1JYglZXxqykNP\n48b6vaZdOe5S9mRntghy5lEdeph/pHti6tA/cbvBXerthEEDs0JxgRjleeAP\n1SZA0hdEuDAvIzu8C0jbhWIPTht39cupykIyYquAElJFwFhUd8+gaTzLGOXE\n8YR6iOEnMIwKpVkyhF0bxTqCEgJecba/SCYb4BoecI0G4ONlfgHNZLpwU1F7\nEREJAZSyrLQ5bvxl03EGJEzOZe1rYDNOQIhggIlPfyxUrUPWuH6IYDC4l8UN\nUXXs\r\n=rRKh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwL1yIE59aV2AsrTEy9zjxMLODbzfcy0ka7P8McYQUuwIhAOhxO02ujnm1L4m1nyoLMeMpINM/kN0dPUUEInmC4Vxw"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0_1606287951267_0.3667534020942833"},"_hasShrinkwrap":false},"6.3.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.17","gitHead":"5a780f045aeae2859fb090fb7fa1ede751e7204e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.17","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CfOkxh7YuOAP5qqneRWlBTAuKaXox8uQG2Fe/hNbN2aW2IEbnY76VarnjPk7218CN7jFDUaDR4scg56QiZ+k9Q==","shasum":"ef38032590d3718e911dec1dbd10633ee7a519a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.17.tgz","fileCount":39,"unpackedSize":228891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgJqCRA9TVsSAnZWagAA2NYP/1b5u+cmgVPQgioFORma\nAaefyXjluKaOZ5oAXrqqv+LoH27jynIUWH4qlJsj8FStqDF+7cB8znWNnLI5\naCdnZAoAydncQiowFozZU4S4GKw7IQRAFeiL3aygCAVpKhULKl6yyA8bOjF3\nA4+ELwR+23h+NSws3/yDFFXSGwl8QztpXKXdtKfDQKVrb+B8IYOBxYzOT4h+\nFB+69XOxeZy3JlK954kwD7i4ZFygDA4L8ShVjBc2Za/fEkZA9tPh6ndpJl1H\ni4dnfQP6dvF1CAD6vr8Yk5ujMksdbnmZfbK2zcUEjmM1FfXtB2hBJjMSk4dJ\nWzBSrlKosXRL2R2pEBSMGbN+VFKRMksxv50RgCkjg4YQU11hasBwTDbPiHid\nFIT84C4RAg19JqrI9GwD4es41GI7hWZ+jQVE/I5SE6Ptq2+MgmCcNvww6/NM\n+g1sylIhBwSKt6XBwX9oVW/mQMgq7iUStj7h3DIpHtX2h5jCKqPutSVL21P8\nDtdJ6gI2uq2CW70toAdA50q+eNLHgmZA/SUr6Zq7I9X1MR+pJ8lMqyu3CRrA\nfbesSiuSl6AWZxRG+7CWd6ZVB9zlhS8NQbK+xEI2nveTHqN3Nw+wCdnhn33Y\nTAGSINkAYFtEMHUN4fR2L2AE+qQgNlD9CXjXZWfqDjDMQ3InKB65ZUwlG+zk\nFcwg\r\n=AkzT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE89kPy6KyhxGM+61/4rbCJ049jJIzuxDH377Zj8w19ZAiBpeT907KBw0wAYU2HP/+Spb6GB3dRzgZraIZp1IHR6rA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.17_1606287977771_0.8374625969520353"},"_hasShrinkwrap":false},"6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5a780f045aeae2859fb090fb7fa1ede751e7204e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xMR60EyFgeE1gIr/SFBjeqUiEs3tS6qgcphLM8gTn5d28TmxIq1Nzs4DIN7KBvEYIPsMzUIMLEv3NSNmk5iOKg==","shasum":"651eaef670d4336ca6310a2af06c459c288cd0fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgKGCRA9TVsSAnZWagAA1+kP/RQliVfqEOMi1buZwQwV\nS3NNPaN21WgN0NdwmBkVXmA+FToRFrbysGNJeHl90hPczyeGP3whT38vcgNw\n45q5SHKk/ykEjzOQuur+b2i0jjLUiOr8ZeV3RIeNhpFhvQy1BrHNj46P53YV\nXa3yfGduFS6zIEDC5rF3IradcLFBW8gbK38AJLXO5bkwQiovKJpNhfMCJKie\nEkqpFkPUqJmb8J3hvXawlRKAgVzpjrMo9RHZHdjmAVIw1XOK3GJquavdER3V\npwfty+rNJ+EPoUk94oOi3QW8PMZXKqdcxEP6DSEetgmZzXzPwCA9l1HRwV9W\nnpVcVxfAO2nNwG1E2lL9H4TNvHVwnw9FsFPetY55qDbe1vKPXPRYpuRyyy3B\nhq2nunjfxOEYHwmwQ0Wu/bl5QC2IrfYflXeSgQ7XbWC+ANEVzRA8QVx719Le\n1n4En92DBAwllMHtE420sb70ERJjZzCG69aqEjnYn1FZdRNg9TxFnDisvHCK\nkCeZznocYx/TNHtoNfuSu1HTOzyQXdkHDHvm6XsZfAFLQxGYC3vlSktke3NK\nDE27mPUUpgC2DrhvlmEBg0MtgkDXR611N8i8JQJ+zRLZlPKBkT7Y6QU1LtII\nIpUydkPYN53QexmPHoIToKOYeIHZq1dnQ6T/k9Cdx/6XK4dINY69+1OsA6kR\nn8BL\r\n=nNym\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQINRTsudgnKLwKis2ATJ64XI7aZ+hWq3Dm7RIoMst0AiB5dz88YoE2jlN0T9BHJXBMaSTdvwwbogtc+pkmnD2j+w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0_1606288006252_0.5468653312702976"},"_hasShrinkwrap":false},"6.3.18-59f2679245990afe9718c870348aed41094844af.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-59f2679245990afe9718c870348aed41094844af.0","gitHead":"59f2679245990afe9718c870348aed41094844af","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-59f2679245990afe9718c870348aed41094844af.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1WYQ+/CetKiGoCZxBx9MBC+krebQ7v9whcL+pNXzNp0DAYHeZxz0XTE0Dx4Sxcj7A+iXrxJwDxbyz57PXgQbtw==","shasum":"e71c9ae005e4a84cbd2d79fbdae7160932bec459","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-59f2679245990afe9718c870348aed41094844af.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgKbCRA9TVsSAnZWagAA5AQP/3NdZVTsmuG4idvlmYop\n2fYkLILxd2ooru5O1rglB5T+3CyOyIcbxv5EZN6Lqb3XneLdprjil8HMniLB\n87L/p9HjbQhETu1MnoPZjBrMlSmZpgNeys6PtKakRD8ec71tJVOfFduxgUY7\nIRzfiesqweK6BvLETRDoN+ykfakivfucccMZFmfIVcTX/Vn3/XqrotvonkhR\naOvhg450USRnsopj9jUB5FzRbzw6v6TnpPrMLNZheCOTYxnAWrg+wpApJA6z\nHGokTf5fBa5P3vgWk092usS5hdvyoshu65cukbLfDhD3VHuPb7rVWQirLGbg\nRMJBOx5tqgbljtfXo6gqB5VI1xHXEveLSVkKQ6Hpqr27oFOgXquzwEfoQuMp\nh6JK8cQfYyofpbHc/nLPEWB7mtat9X/Us2meacatczgNz7RqLDmJamPECJC6\nIYvNIlq5FHB7jGcQy2pcthhM5HFDNGoz3Hv8uUMondlgJ+RztPQLYyWtllDd\npdhX4V+IPTpUeraO4jGDOaM4uGftqZSqIKtZC+afOa7zi4LLbGj+yJ1GSj3g\neQWRqW07WFkLkBjiETboKyLF5bMOJkByhf4LaWBmpkl5+ktTHHu1yWKF4CDa\noEBs2E9kvP6chA1DTiXjIo0AZd7ijjWvCeCXLmWUWkvfAPBNGRfMm0JcUsXd\nLLLF\r\n=rQKv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxJzbiaNi4L/midl8TIHDB9r6NraJyLRX2fOf20MDh8AiEAlWctOdhmdFilNQxsQGjOSlhS00nMisfinlm+lSqEdy4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-59f2679245990afe9718c870348aed41094844af.0_1606288026643_0.642810618124692"},"_hasShrinkwrap":false},"6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0","gitHead":"1632b4349b8fda5a1e4ef4a119693309f815c409","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-iOl+QJFsyomLqqEOuccvmknH1qh/uz6zpYdat6wF/91A6kNsOyyUNRm7up4xEYOiwRbog5k39zekfAbgXgjatA==","shasum":"565c96a8121fa6209ecfe1a9aa79d1937ef35c3d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgLBCRA9TVsSAnZWagAAKFkP/jkRyC3qKao7I2TsQhmt\nTHvEoHvoMMGnDsyn7hYlp3utNj5S/5Wm1mLt5YEaBkRh7mRd75qkL89dkvO9\nBOkvp3D8uSM6vrfqBCW4hIcAnH+8vOr/YmLws0P4VmOoUH33su15rNL0DSFs\nuvtBkaj8pcsTQbHBV9RfgwRx7iSz7eCBAzvS3bY5qISFkbftSWFdOTKep6+K\n1sgra6COjhN+XzYhP1Ar/ntr8JBuIvz3OmGAuL1eTFV34Bh5Q0QtuoSHv9aE\nh4tkMzgLJDswG5iADfSNHlD22fwTBAnlJiB29CH1BVe7nCfILnoCayR8VokP\nIWp8Opdo3UIrM03tJ95TqqLEt2WRGFZM745Nxh8ttGxg/P4x80SIbIMCgUVN\nudd8QLY6N0oyaXkN8QWDDhJ5/2ECmf2bTYRqtFOP2U5idk24xDtWwlfwbPce\nlSRC6QUyQAMYUBKFZz6GexNtjYMASQ8YEOIWW+8OaYq+rJlbMWT/xxHJf/E7\nrcrG6uLVpYddRyxtkR0fltcZ56mOCciHY3W4b/u9U7HN1UHIziHJ74VKan3c\nyhCYCBu9qlAn6LZDcpwb9V3U22XsX2+Rw3Y992B4kCtJ/RS8KAqj3xSm8Ka7\nPRDGaFiRPaEDQVwxd2UZGKw8VLUPVtFkITuc0VdOgxjonkCd8p0NKbuOmWJq\nQgtz\r\n=OfVT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvlPz6IPWg4jwO6P/2BZJXaA6U0PHeDOuNF0VQ1fb1XQIhALWl3Iv2FYqj2bS+mavEtxNMkNDu1Ja1vlxzIloTjwcJ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0_1606288065176_0.8809068161617903"},"_hasShrinkwrap":false},"6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.0","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0","gitHead":"c059d56c50d14f2bf80e84b4acb435f8bb88f30c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0XLEMzabght+oKHULdp2IfiZ4qtNb4x+jcoLGmXwHaoSkZE4DUA15Io0nOrNKYNGKvyMhujV0BN85N+bxLZauA==","shasum":"53700db2b8b90e82f180108295e240457717782f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvgLiCRA9TVsSAnZWagAAtNsP/2L4L3Cu+Km/x2BBKDPv\nBO4jZMZweGDE2cAy9Hy/uMAUfwEQuwENqqWThAoz8puf5ObnFi5eBgv5qhx6\n+EvKO/K6Ju8HyzFbYuHOyT5GGloFnadLKEsAl1fS7QdsATNW7xjAG+6mDLSH\nc8JsIZr7YJycGqvFkDTAuff2UeQHB0cBWBhTYbeGZH6DDF8qs3TX+Vp+4dfn\n643kX8i/zQlsZTH6j9e0KMwMFd+q4R3aaDb354Q1QoYkjuY1G3DpUIz0JW1P\nAn3NxdbPjrWNLHGcc0Rv13QlB7/8dNcHtVwgKtzGZGOiaC8TUhgHEwU0XXpr\nyvRxhtUTQbX2Rud6/ZkHmd4elt5CIXyu9e0Mc2YZyjxP5XztcXHCWSOciQ9I\n2WhwsBN6aHsCfRwhtYCfwaZhcUa/G3PhtGFmvscKiNT3sTBnfTAF5VtOjdFg\nhWTeyuphT4s5HPD/RwgpdwScy+tm7VJu4PHCOQzuQXsiunlJyZ1I9DLzuqUo\nOr7fCwBrWrQ+LUOUplw7AJZ/s5UJksblXVZTAklNR75rJFmb2NTJ1NeJxASr\nKtgLyQ5NDivfA+hcWxqiGEiDch8YJ7LxnbC5Dxjy5XDBOYdXvgNlgoZyrDhj\n/Sum356AqWDqrzoAj0U4zDwOZ/CyG/1+kVJNuQaAB7H9rOap6j69VDBKIEli\nGeBj\r\n=6kh3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQJl1/wXpfoBB+RDiFAD7nkF9lKqwhsjGUcPXHJ7+RqwIhAP+pne0deEy88dIILt7QOlX9C/UN9bk1y+V8dEKkJ/7T"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0_1606288098072_0.9214735799244285"},"_hasShrinkwrap":false},"6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.2","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0","gitHead":"62ff3a774e49faa509d2cedbf09c97e1cee32267","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-r5DElEXvH727BtbNOyp56YT85ja8ut55rP3Kkl46Vzt/vWny2SK8HX6lvtFlYrhs5pgVyqojhstZP/ejzI0Tyg==","shasum":"df06f2b60f6dcaf1b0fdbe7031b6e37a9023c4f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwZqYCRA9TVsSAnZWagAA3m0P/RdVYW0EpCZdOSbF6nEt\nr8MQpW0HUKnGs95N4c32Ef1CFSePKbODvQvjw2PjLpt+PjldQ6gVTWrbLH3p\nxgpvoWRMorV6EmeJy+ZY/57tVs0KP7U4hPkX0Yrr65dS0z/vlIzbKj4a+q4C\nRc56wtxP61IQMnrrRCg/f6KD7jZKL9H77rmk4jUlzmeiVO7TJg1NkQqjn8q7\nErvsNTvNEAQ+RXBUCOg25/1cszfX4DFNwJ3t2FJwm7jznQqUurfbPueyS25m\n2w6RU/ZNKC7NIMb7zk58v+WHTngiuach67w2RkjoD2OInEOqNfcAQYuadsGJ\nKiu8NkOUoAuKU7l9y6K/ZVIkfq17H4eZMfdj8Lo2D7HYCwP8nt2Y3JLa7dbK\nffnPaYOPC3zTmWjwYKIma/NgeMjZEREPhePMGBthnG19JSNY/4yLwY43h1xY\n2RoJWxX7jY6YLcr7mArpqK2K0rEsL7xS0sxLmdMSKyp8qngHdx4vYrlJvRRI\nYvdthyGiNKRwX8G6doAW9Raei+0A++knvxW1frs6oYOBZChdZ9BtZsDqdoJ6\nU0mlSuq+PVK5DBsKaFspbddiNjoWLAnysVOthJb73mdQOby9tNEwrttzLfBL\n4I4XaxxC0biUEF1vAs221Tmmf52+OBYqrgz6jLLMuHUnTe4hFZEtQj2aNkVR\nE00g\r\n=RuzG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrRBZrrpTGXpu7ofZ7Ly7wV/Ezvl5QCfSYN+LgJxSO2QIgF7MpruRumLrG/vS/4XOMNfHYf3OIRej0eOUnGYRN+80="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0_1606523543848_0.7154823385508662"},"_hasShrinkwrap":false},"6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0","gitHead":"74eb7595ad8eb5349f04c22bccd9e22e90ac244d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QNHpeRRDth1z6pej/YkYma3tJf/TX/N34ZgsOmeXs25B8HHkJ+TFy/b1vB3XWszt/iYYo1JFIT/3C1vMJRJ5gg==","shasum":"05a684e2e6306fa6a96a04640ab3c3d5a289894b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw8/8CRA9TVsSAnZWagAAnYsP/1cmgcg962mZj6YjjA1Y\nVO+aI10wbjtJI67xCKpiZKhubM5cHV5C9B5lO2PkRObiqp5v+5gsRuxp2GQB\nZGfOo57bnToqR3aitFMixGZrhSIYRc/0wozAHyPSbNtBZElZSb4/Oi7mju6J\n9oEYxE/df1TdMCQAdO8x8UIGiTg+GWeishHfHDAwljGw43+YQzwxHPsVzpEs\n6rY6pXjgRRlDLCxjllE+xG2AIXfQfFudKaBtfCAABvh658kVD0pV9j861qB6\n3XknZWPx+1/vNvFC/ZIaFANCUqH5l/etX/7C98HytnT87RH57bRgdGtlwZcl\nsLP6dBrEqYGs90dVS12Vn8WOFjDNcvb0Sn3WSAHNRNq7GkxmJGz9PDfL7CQU\nuczFdou9lyeVZPtcoZ8yeCFlJeHV7ycKvjbYi/+bm+CIrOKUAQs3c8PQl+CF\nSlMBM/GGOnWdBgixpxq/ATVfQGhtNXkopZbwiV/Wft1bVt3GjtdaQKNWLQ2v\nTxvN5iUcxiHxd1Q//ED272FznY3UznDy/rBCDcgAQKQiODwBXQmXq8ouGwl/\nurma/Q5yiWccsd57No5uQ2x2TK9SHMQ2Ra/+1bPcj1bxbPd/r3qulnzcF8fv\n7hjrHpxA9mgd+jG9GKVn0tIC2vB7GtzItyILklvZcdjYdqTZVCNkvOTQLplo\nsMjr\r\n=iJQu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICV1XetzulxeojULXH82oYJLY0m+IripgFOL3HHLMcKHAiAhLVvOgUyVClgxgVgwIwdSUv9C1mLlFTLxwIba481BYw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0_1606668284185_0.18804514163727593"},"_hasShrinkwrap":false},"6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d8cebeeb4eaa417f2650efb03caa45bddedda4f2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VPo/9DomKFBBTGE+46hnhroSRSxMM2NClD5MT1I8adoDphR/mSqMIPvYLazuy4NFrN4iGfMe1enO4/Q9mzeAlQ==","shasum":"f2045645e89667e33fbaa1145efc1f123011f7f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9BJCRA9TVsSAnZWagAAfm8P/RXFeTcr8ynI9WZFmKkb\n4pXGpwZ3vdnh8zM6Sz+gxQzxfgsQrmLu6n83+o6LVoBWhjiiPO5oPzrltbPt\nD4IR3eg0O0DCJzT67E2bc1a2KQVbvJ1GzcYQIKJHdA2ehziKsXiS0FEFH/Qe\neM5clXbfnvPdDU5I1DT66x1Tm1dBgUbkAnRnz/1EavMAFOFlZ26rv5G/iJ17\nMPt7KNKrQqRZafQ+AGoQHWGPnrxzFEav/Ou3270qnGY2rWvVkBdoSirtH3dy\nNz0hQhtUrvwbMidQQXFWYB7+1/CyZWfI+/KzmnufOzILTbJ6mRuvnY4J+Rwz\nSetm1Whb+ASlJi/AByEjPElWpP0NfCHElbfX9oAvHhvC/OzYeRAWfKJxXvwi\ngq5lEFeoqfXjTzY0/wrieXYxEYjiQPbPanrNpimIBsqHNJQW8LNMpoZvEhp6\n2/k17ad+XyI6kAVZvHdLnsNZ9XnfnnhzE/JFk4rV0fkm8H1iuKr7cbN+ZRIq\njt/a1v3kLAy5QNCIkufWSG+X0Et6divCwpmQc/zl1c5JHQk3XbQK+MK/B/Ic\ntBA8PnUNxBCotJf6+0qo98PxqQ6H13mfj/CPT3vjcfdXcF61rgxi2/NlAcUc\nJtHe6VDRnANdu1Zc8SLP4tGKSPiRkVkEm3njj/o5n2anAPg8rrk7tPPmx49k\n0vI+\r\n=GgtW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDJfbejNC7/leUaI1SLjA7LcRIqyuR4ZkXEixcA/F1fAiAdxL93ZcsjWPPi4QWNvjkNB61WqK9lsVgeoaT10yN/hg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0_1606668360979_0.9143257118802808"},"_hasShrinkwrap":false},"6.3.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18","gitHead":"fa5de9b2715454f6ae1bffcfb260ee4c8024765f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mR3+WEY/j1Nvxq7NXKUO+AQ7CJ00Zin7Dm7YATqbGCT9SzWGx7TSDFmRwPqsgZMg1+6WOSUzCAYnrDzJ4k/D0g==","shasum":"1dcf3314330f87a9d9c66e0ded1e896a2e7b9062","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18.tgz","fileCount":39,"unpackedSize":229166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9CICRA9TVsSAnZWagAAbmUP/iP8ssCY/FK2weG4iPk1\nfqG8AN4ipyVQX1Vujr5ftvkHMIjgLcp5bzWxjxEjNCxg5BREuSW/pGJ7piHJ\nFme+HmfAlOPWbfbv+rNU3XTKucoJjtAecdb2VV3YKKxmLl0F+Q750IYRV4fu\ngx+R1WfjqzhdEsCtxLRwM3ubgFzTdZMvFAP8hPupHGL9XEEruKe+ZnPmuYuq\nbyOBGnYu14BaT60hMWsPN1wVe/MMKUs4qNbmbXiWUvs1DTdVXvncj3MedY5m\nYV+0pkbX1RYwKBPt4jD2ESMpyUnvtVqtCGejGX/BWHKfNfHG+wYnXMOzYL58\nwDmmMxeZ5XIVMLrnXNLNqcNSZ4xtt3RP7vqnrukjuW5xeNrs3fJTkGa6wL2B\nZRrb6ShEP4GAZgxa6rtJORAxstBYNPGnmKMpaycQ4uhBt3/h9its2OaAaAtH\nrCHmuyNeSGKCgKQlsDef/tzmBbM34x+kFQi8KgD8NZAmtQog2vKKNaVTvn1T\nV2N21ru9P09icarZ4Jbums6ggMx+q+DXa3W3XdaNWMib88XDzKBFeVh7xsV4\nVGp9QHaaSEykTxSoRxawRXN3iySdi2PREvY/lsaihFAT8FxcATnHAIm73foN\n8TzqIx7dkgs7SsTOVubtTjjtFv7BkzpKCGBclvbOcLE2R7iaStIIrUY4Yw6Y\nUNFp\r\n=dN2V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHO66BMRo/0u/qbps+mztH50UqK5EHTKRMvCMYrv4IKxAiA25u8Sl0No8QQvTNKWtjVyEpVH0rcQvh7/0xfflPL4Yg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18_1606668424295_0.1097264839094918"},"_hasShrinkwrap":false},"6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0","gitHead":"54cab0b2115ab78d3299b861119e2944ad6e5b35","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+CCbXpTPIDdDLS3J/08xKc75uqm9ungaEMUbGfBlfYzvRqQR1oMEhEcL40tZZLcVUIBd0+zFkx801ESHBkwBjQ==","shasum":"eebd3d67d48d5d1c6d0b058164a501c2ca8d4592","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9CeCRA9TVsSAnZWagAANPgP/j0QBDUaeJqA+XL616OM\nNP6XnHWR9lv06yCLf9xVDFSInVOKVO+F1A4N1CxLxSsoF+DSy/eHfWX87hBB\n8vgsGNg1wU8R+IIhTHjb4gwubcoI3BxXEtN476yfRxR8ZxsTQS/CgIRb5QN7\nClPsnBJWV1/VvHDxMxgxdnibp+h/gqAT/8Vm+vHV2ABNoCBQwbUH6Wn2o/98\nWDXq1hdTWhNjnbNVDsfcq4aWXGNQ3MusImGhM8plRuXfzwIG7PQeYx1U5jmE\n5h03Ra2y3ebApwBJj3mknPoI6wDb7F6pRWfUZZr3defYp1+ad9bdDRtEOUxn\nXEGXGasIIu3h3zat2e8awZuGGDW2wmBDax0sWeyLYlU6l7bLelflwKRA7f8T\nTv/LLyILE3LA2MAEQGrXJpv+snvhD3q8ahvOOaFe1m10023QRJFOVUREb8iM\nFRKVv2+0v5G4+5lqW3ZIzOuUIkfDwabJwGMP9/U2LraJzjHOypPmsi7fYN+S\nED21+B8zM0JEyS+inQvmCJC589tdBy1uScNnuupAJfPUh4i+64MpI5twajBu\nPCLmihGZmVLV/2D+HUpL5Okgg3J1+BTdA/j8aEpZ9DHhi9mMKG4xQCFG6W3s\ncVoUHpbYEiKC/JOSGACdCxLJuTaIugkw4Vy4RJ10x8xvLdKmGB14G45X55uz\nV3eI\r\n=z+tC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6zvNIixMqZbwv8hxJ0NZlAVnHzugudbx9WLFSj8e+PwIhANCI+paYjlDSyBLWhz6zgh87y+eHeC3P931R86UtDcjq"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0_1606668445476_0.8206023258219515"},"_hasShrinkwrap":false},"6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0","gitHead":"060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-edmdbHAEIOqGpLAcOHIyoPA4c5knt+lvxNgoFZDMqgyCfHaXgI/NHGr4z0s6Q4/MtzrDbmk4xiITFjTH8sKl5Q==","shasum":"c038f2c3818d9d97be34223d3fa039cd26d50a18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0.tgz","fileCount":39,"unpackedSize":228934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9DZCRA9TVsSAnZWagAAhf8P/j8Ss/ae8fVwFDZXZ7fp\nmoKR+CjalKUa/yPEqfxKo6y7y7N5LBfS9B2mYoC12ToCIHcdDE/flyssWPMG\nIoXzWCx4je3A49cGMBW3vzvDEbHWBXOFo2fEYG1F1jdGNtkgW65BJ2DJRtYN\nNvPKFs5X7oopOZq2T7lQRCXL8IcU7PYs3JxEW11dCkbw6O9K/kdtY2jAFkkt\npGvkACsEfAk5d7K5GMeBYac7RW3qsSmVBuMGxriX841oVs2ymVDJb0+uEyys\naJ4hI1MSyLaKKPFlj5dCJSTKiZ4ar4O+fdUkuVr6t3QW3iso8VLVHPro9x6a\nSJeDkuS+qP5AZRu864oLPlOjwMNu/TCNtISQActaxeesaDwutUploJAtlCbd\ncElAHfQvwZnQF4qcsdOy4njTvmKjtTJXBUow/jqvfBwcxacMBaFsP/+yS6a4\nR58uGAJMQDComYnlZs6hlsYxfV2rw0wgaxjzn0gYmaBKS3/2EaG49R/G+61s\ns0HCZ+/GpoY6qIcxNUWMTbv09nfElbsSJa57vWGwlxy4PQz09wbCiKxm9HjQ\naUQwmQ8yrRBoRh77wqLm7x+CezqNsPloxM/20iLNgFSgSXIjS7pxC3tlJaqp\nZ3w3pxyfm4/Fj2Ufm+Dj2ygW6ZdPOHhaIbMMK0Vh2EQKn5nWh86a89nrZbKl\nwD80\r\n=tuEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbGWyPDvqgfFmDywklqltLTBp6GO52/RyFu+elyHzwnQIhALnlNVfUMGWSvOZGfUzsxQ9manigMGWTxxiQfugE+4au"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0_1606668504823_0.03226624398115985"},"_hasShrinkwrap":false},"6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fa5de9b2715454f6ae1bffcfb260ee4c8024765f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4d7tm3h6kQy2OxI/XfgJrGbvtmMeVQQrYuQO6M9CWJklLi1zwm2S8MiRRfTICFxIvEFq8+J4ZeDeStkLoWt2Mg==","shasum":"89bb12d02486d45eff7ad229c870bda28beae3d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0.tgz","fileCount":39,"unpackedSize":229209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9EKCRA9TVsSAnZWagAAJPUP/iLg3s8BHeouBFuKjVbD\niCx4JWtNmVLHFqPhsVBqcmpdjOscvpXwLGPYFzSEMq6ckjmfSG5od3sd/6PS\nZwmbFoo7so0QrqRJigCWcsOztLnGSrgOD1OGuJHtaXrD1qRzJD9qzQeuIP+x\nrW72a9MX7jaMho6c+F/SM65MUzmC1iNeHL4AKUCucPxRsOArpYK+ipG6ttCa\nDg/w/V9z21zFXeuXoX7OuMutHFmG4kWGX4kdgBxfK7YcLewQW4kfpBGlWcmk\nQNj724pq0XDlBRonwLRMPtpJuD3KkWBnpHYf3ufT/2TjIqzyEkjpvukclE9d\ndmq5RebFwKEY3QuEdzw8226IfjG8K58xZM3g/jn1Dolv6iSGjXJO4YVJYNN6\njpzjAWpWNodIqMiwf5IWkN3nRzQybcDwlDDZW+YdxGPBnr51Tmpt/IugzmnY\n8DVP0XHxIp8t8fPF/RHY5JQ4Bbh69Dl+hJVRONAA8AcjkC+5IOFifT0s3kn6\n28gsRkV17HnYX+4+dW59Gqi1f3oXXBFq4tzVuXIeF4ZBIHJXL6IrjJsEceYT\nL2NpAwnglvSS3RYhUxCN7q7sOgbmsi8VxeKvZSE4A5Kau3/SrOXN4Zyi0Y56\nn+k0YxsXFp7cecQj9MjuwkB0FZv4iUi9fgA7cqSDRxuWJc/7Kcg/GgFYI5dV\nNBlK\r\n=xipi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbnhIngQ7s7gCifc6V471wRZWkCLvuIM/HzO8pj30HUAiEAmF51gfGVus6PCIYo4sLOqm0ocjxczzW8TxPDxLq599c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0_1606668554087_0.9207941825653598"},"_hasShrinkwrap":false},"6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0","gitHead":"e12684ec0f9fc31717d3f5295ca78b036c4f24cb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Gk31irnpvvHPrxgjD3WAIB7g6xm/VhMqaIY6qJ3gMnW5fCwN9OEItanz9IxP+0nMQM/lzZ17uzFufwFakEQzow==","shasum":"c69e457deab6a0a198d1cf21ebb26c361803a2be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0.tgz","fileCount":39,"unpackedSize":229568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9EoCRA9TVsSAnZWagAAZ+YQAIZdZVLnhmTonV+BUo9n\naGn/CiSLFbcQNzsvSUEVxEO9SidYnpbnFceRWMCn5CI5LkuHDu8JxEgM6R4K\nN50j6V53B5OJU5lVPAZ2lqTy41EF0DZYGC7oyIek7sEUglBhW2v+wjiv+8jr\n/UbtcBJW9Weomlbp1hIdrSb7uDgXihT3ZjCeo+J9o0tRCtFTp+x1SO81+FBd\n2tP5hvacZPZKhGar2r7mbMF4TsVF0u8W82fDQtA0b586SKC64DaqLzlwZxCQ\nOtJUoKgy5mVA4ZNd+x2wKCq3B0wNZKGTM2AOII1kJ/PMUx+NngjTsIwIni6x\nXyUJUy0OM/b4Z3+mHc/nWhRCHYEoDwkHNI15t3Thpan6wuocLDJeO007NMDF\nPYspw2IuUFTWE+Y/sQgur7Jt+xsptbB8bKCYoy/CQ12wmPfBHWwtyW2G4MDh\nZLO3QZaFf151rXax5c8yKCCq2KIoLFhg5TpgTZLX63pLiBYhiPeJ3X1y1h/M\n/kOTzrsXKYq3k6cqeOelA5nhHPlJHoRUhYZW9clHakNInkhN/qG/svj+Q6CB\nFuyxEGkzPa2vTjrnpedwSCjkanNkfSYEFEdfA0UKXSkErb8J1OO5D4d2kYi+\nDArOAuuUKNfFMswTCIvgcfKWhmiMdqvz+GXa1aGLoBSHvW7EWp8OSe/NjPlN\n4Wiq\r\n=yRZ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFPFHOqJyEPAGKyjPKGwTFZRCPvCmialIwe/XaSIi2IyAiEA+s+bCsUdB6IJnR2kMAYmv4jCJSDYF1plhDe3PCLf08M="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0_1606668583986_0.6275589059794358"},"_hasShrinkwrap":false},"6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0","gitHead":"e4bcb63598923cf5e8a163dd979af6f3ad65d2bc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-137pagKhZnQ/+jTlXNpKcVYJ5Q3FK06zdXVqOvgeQ+m26f4bQfxOCb6vw0J7l2HJRYyBpeW0o9qDw6YnFrC84g==","shasum":"9a816e84f41ce35fcc34df14b7a90fef22dea848","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0.tgz","fileCount":39,"unpackedSize":229209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9FHCRA9TVsSAnZWagAAeFYP/RmuNOtMFTmD/l9cf0hH\nbwU0zARKr+Qhr+fBcGMpWsaK2dVl8Tpl5bsFwPbg8aYx+PKPKVLYTpRc1mDu\nIq/3xvaKFHwncGgJbAlzV8ldtXYSZD94mCX0V/0U18z1NzjwqCZOqNU+9Sfu\njW7uCVGYXqcIIibgVQgI9nkU5Ej6+2x6mw16hv/ZKrasqRzzygvzIu/S4m6a\n04KzxFnFSYot1b7sAl9Nw1gk4sS3K3NtWny0WiprIYNsfhjoVNUMVz3GllfA\nbq1Y3Qa5oJqAa3M69ayLrdKIDKGPGNCri49KjMr/Djwn0EZdOfes+n4SsXHX\ni2hU1pmTfq7ad+Mr52OPS6vzBPfW5c7K2NIYjH6wdfWXNXmi8CH4IGQ4xXUu\nzpMLhhoTBrIi0bwYMx7TSSs3wHMyvdfQ9xG9JoAV6X76e6REpXa7/pfGx8+h\nlWmXhx5PXXg8671OcXmUs/zoN3Aul3n2378RMIjnmiQYWtARa8oIYRVc0GGO\nVBMmYWvQ11sGDKalKPoDIMOIOn7WBrW5YG5iGdeNBAhATKZ7AVOO6SToe7r5\nGtEpGFlWWtvSRZihVoC2gAaYyiMwClq/Dm06Hama0wtSUKbLKBTFz6pyho7/\n0LY1sIxZU/lQOkh47IYyZk1nKpiYtWL1nfcU0joMiJCkSRjUMny8rcqIyYVz\nnwGK\r\n=SJz4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOzNsMxSyav8Qry+/hBUTaHoBxbIGyLYEAHRZEAF74CAiEA+s0K3I06iD4lS9O6+jQikbWK58QOdpKh7ONZQ4Pwu1I="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0_1606668615110_0.4190055808615689"},"_hasShrinkwrap":false},"6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.3","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0","gitHead":"81b64392e030b1b90ac8c89fa1e77d132270b9e0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5dpFifT7F7rYlFTZ6jDh2a1IVydGw0lPErNXAJFO1hWTunSJtdIbMOo/Fl1H8nUIJKAs8MufNmzq03af6JVZmA==","shasum":"1726b8cafafc567e1208b640600e8dd564202fbb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0.tgz","fileCount":39,"unpackedSize":229209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw9FiCRA9TVsSAnZWagAA13wP/idozDgGFvD2rSHLYrkc\ns/6JO/V+ANQ2J66gf/5Y7IxYlUClyEdvBcBeGnNAHfTKG4wyWvzxcwWO1ytW\nvLmH0brkKL0BHs5zqemcCoO2nGf6ZSA+ktoZoNCxZAIz5z9R7cAZh9Kj6ZDK\nnuGzx+mKjIlhf8pnBPuO6JiSSPENcW6gZ3h6sKqyE02Uv2sQP6RXB3sduQZf\naX4VLyDcGgNMfMnjjmtdWIkd62/myriU4GhJC7cfaBgaS+l3r7CxPsNeMqSL\nTB/g7+jMPmzkX/x5Ey28RE0nboNvm9mtqx8UxTa0tozimPM9YNexuy1t1gR6\nhcckU1T2wG2OyWKCyAzC2IlOO1GO2WkLS2nrVbz5QoDF2sfDr6WOH/x1nrfI\nw4L4CmPg8OS/vKzvlWXR5aYhrZLgErCuPZhwe+CFEF4b/GCKyFHqDg4npmiT\njVY4wm9oguIInU67IdgX6iHwyOtdnQTMqSF004s+xBkqT6Mx7aImoNGAZ3Dj\nvAHbtPkB6yfs9ioGROPU37t6NshgOmqPdnLOouQG8ZlaKqyW3LyvuRDuzXwA\nR2EFXneBkUofAzjCqwV9aO5EXwqzFMN1j+D91nhB8/oJwLiSxnBJTQgDRMTU\nCUVBOy67nJLcZZoUUWBHgmuGhIFZGsVgPVky6vAR+Rrd9Xlf+mnhB7kl2QW5\nZ2iI\r\n=Uo5E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxkg+xXJmNS6Ije/4gsOLXcTESjs2l4lmk1Mk0Eb0mUgIhAODTbQuDPijMyg37Dl91N/Lj/MEiVDHqo2XNLGyIUQ03"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0_1606668641994_0.49989126395625894"},"_hasShrinkwrap":false},"6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0","gitHead":"c3537c91d19f187e2cf280d8c5532c0acb893a2b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ssWT3JrrNwWjwTujpxSdaKJ1qOaqs0JhLuABFmOtHJO2SDMav1FxY54AClgbCP32Qe7mKuoso5Cniljdkq3qwg==","shasum":"4b0726beb62520e1eea1c15ca6db4ded8d47f90d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0.tgz","fileCount":39,"unpackedSize":229209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxODoCRA9TVsSAnZWagAAOx0P/ifFsb0KhESK/PPtonrl\nhFTWIK2hPbmo3AlqO6vYHLHRpmLo4xA5caNByo0KX8VIXaPmA9aCfMpQTQTU\nX/DW1DpY/XYWXREcuHJ3oZwfwwqoCNJuYxQfNao+9SlKs8z0Ymu2uH460gJD\nvYRl4Ec0OrQzpJXT+3P5PR2IoV6sDs8ZHxssPOxzHmUyNYun8fzJY5GoKsEk\nqRwozsN/XE5/Xf/ir+vyMWEq1Y0lCRWjd0Sf6afr57gYj2vY3kTe+Wp040GR\nnQEmHIduE1NduBZyuj8z0QIU/BrnrF2ONphs9GSYXs0+WcdZLuq6f5VWx5N6\nr1Q66M3mhO9Pw5Qnm5dicRazgCEWRaE/FrX+EQGvF7qLfXJpy22ZlFo+epy1\nIDm/CXGvXOYI/l1Qr05baKeO73WFJUwwvnZYmF35if219D//Oi2LKp31ZJXa\nnlz8/nvM+2IN6A8kd6csBD6iPFCnLcJgF0nfcuwa+AyVYeppuVEcLPItG5Y+\n6P5Z2C1ZFOQXsYpeSealYBvjao+g7r+IubtRmp03pbkHxFhBReCff1YMquDS\n6ze+GYHEAvwG+vWkrtng8WAIPcQ7WMhWL+VwnnN9ekN/nOWPunhd3PNbPvWA\noBUGVzB9OlKfcRmLPE0rtqlZf/AINrWJR2+oFF4E+jZ7H3lMns0cYg1oaj8u\nHyR6\r\n=vVio\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvlq46eKcTYBf/UcK4ormLvnq1FKTeLcS4qjGB6rpNfAIgJVycKsmyhgNQt6RmQAy2RowGtJKnqcq8cPITDqhDiXM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0_1606738151886_0.7208234245339817"},"_hasShrinkwrap":false},"6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"00f9e2a5e23422fb260b0b125aadd328c39e22ee","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UodKNfyNQsPiQDJrTlPbjTKzqmgZHgMni+kB0dQgJm3JW5IpJkR8Y4XQUaTu00ExB0nkyGlT2a9AUYBftktwHw==","shasum":"3b34785177804b6945f6b42f2380be15487ed56d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0.tgz","fileCount":39,"unpackedSize":229209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOE0CRA9TVsSAnZWagAAtCAP/jHZD3ROe5lyIHxUeS1O\nJmkRfc6CggEC4XNHUsg5NL/WpDPxRdsLq/uEQdNi3KFxBE+m4sSNGr0wtifO\nHVSyITainfD0j4lvp3BECeiGxdqkDJJDuaM0IV1TkjWrxIAugUUvR5G6ShZo\nnzrLHdcB9SfAd6znpTFnfygCM5PGlQlril6F+b86TrUg09FWSAlf2tqY3zkD\nL3eYRBQQlMzt2Io0Dbue3fy/yQZVKkAdhPwbpMu0TysAiXcUgHuEM8oR8sQW\nNxl0kZOn08qiEE+kBzRWc25letDN5mkvvNdUSiTFbMzAxPx8I+t/IlmxCg/w\nbHJbqqm9yWgABmAP5aeqx0X63SNVPPo04sYQNYusp7Ep/urE3HWqnTzycAXn\nfljyQB4K8TSO4F3kE8kPHqG2gRkSDREnkzhk9pNyCUFBYCPQG8V6zmc+9wJ5\nAQgdEQb7Lk+xkeM4M4FmSX92UWwYDNtXQnDwjFoRGDRyTwfF5GhjwI0c+yW2\nEXBBV/UV/+wQIi7cYE8Jljd8V9GGzhKFngHScXSBEpC1XEeqdKOIidPvNL8g\nLrTImRPST6VozqKj7ABxmbrXYEUhvtL8oh4EEyJ7bq5w2/w2y7xdzLxATaFI\nR48E58dyl/Y7PtXW6q0HN2JMZUyJPes3WX3GV/zmfup8h9JFnhObVdb6JL3a\nEHpB\r\n=Gupd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtjnRurp/ewwr6fdDsdOFzLX2jU9dQBQlJSXlgmFRi+gIgMhpsEkwL3cn7hyqSbxD7dVZY5XJEmzIyrLykrWmgk8Y="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0_1606738227958_0.9705833784311022"},"_hasShrinkwrap":false},"6.3.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.19","gitHead":"f7076ca42cd93d2b0f7dbbb8a434831d4cd64553","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.19","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9HCl/V4bCT58riDqv2s1WHmg5PAFoVZ/HpS6qzkoFH+Jm4At7KibSNJYHaf8iKq/fB8z0u74u7rYM4AHrIRodg==","shasum":"431817b0dc0449d8eaf5f22ffe8bd3f6100747a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.19.tgz","fileCount":39,"unpackedSize":229441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOFPCRA9TVsSAnZWagAAw2cP/3oKlMC0wq5CPWcN3DiO\ncf+BpnO0yihwWP1/7Ulq0ru7uSOvqnn2vbwjMYsIoHuPOodoWC0belO9mfPd\nXsfUk3RiPHag2c/ZvJk7N3J8JBwPeEbhbqPADwrWwaJP2E2G0LWaG8+zPvmM\n/ss5hLZZDWofnNRka4AJQpMtuesZzHwqp7x/5tCpISoG1MmKNHMe2eCJk9m9\nDpFKnutyXTTL4nzbfmKljT/do4iNFxlnOkdXtpZvXfc5mAtkvTiF/5P3Ycpw\n//1Lm89LaHKW1/Jkon6RJUccSQrp12pRCm0FiG7WhANPCNAGZkQdZn8ZE0ni\nMabe3jAkA9SlwIT9rZsacsKx+ORfvH4bKgW3xqXNg9slUKLPrkAv39S+aLBa\ncyaJO5g/IA1orr8fvEC+JXYoQY6UaMB3XUQDnaxrThInTzeeNwvKcHHTw+yc\nDYW6DN8DRum5ChZjG0Cn/HSYp0TcpmmryMY93rf5khbT5Yc2ZoZH8ZSVgi98\nsu+nGGQEph+8sE/JMlAHI8mBaD4UikdhJwlFV2yWwgCni1txvOsJ4Kzq61dn\nIGCEV/Yk5mikg/mmjWGEECX1lqnNRv6idIk+f7aqgigJeu9fRwPuJOtumyHy\nC9nwenyObES9cc/Qe78SXwT1HQrFm8xitl7USsKYwOjJmL6T6Og8dlriBW57\nGzIj\r\n=8kPT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMwz/Mwe60NKFXpMGf4I3rr4BFd5H5TmpZiM/k4muF5wIhAP+lIuMUEmap3k8m9YCGu8F48fqQffnMCpZX2HGCikCC"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.19_1606738254722_0.6306816141664733"},"_hasShrinkwrap":false},"6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f7076ca42cd93d2b0f7dbbb8a434831d4cd64553","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-n2VQNMGD8yiJPzrDU7JJXrMJpMGi+86NVUWvpvTwxEUh9IBxMGL0pBHSL5byDa+Oh9H3vLVOb44DnNNmobPmkA==","shasum":"29005c4ecd93edc697541325f5d5f10925ec18e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOF2CRA9TVsSAnZWagAADrkP/RMyJOQYQIN8OvaYcfVZ\nS5TFhSz0f9nvgbl8ltxmGWxtUlctnFs4kB94VxQldDNeZVpRoVZz8skv5rbu\nqVqhDh2fwzSt7BAoWDeseMQ1o53q/IcfVFwW2Yy5HpwIG0C5Ex1zFaCYRfUF\n8Lo5YLi4UXYmz1HA9vfSyKRnTPRUAbAFNrod+WLmxv5IsLpnJC4hN5+ZTbtd\nOuLcdZ+bpSPO0HhDS2QFOsJAjWk/vAvQYaegnHtVyRu7WP8iKJ+nJH3MIjEf\nW6/iCHcTmnhEo4GEyO8FFsz1MAU2n2Xq0qcugMP2ogcmxk6xpjg+74z/1RY/\nejhVWI4rvufwwhvHmd8UJhPYJLf0G/x7svtLA5ttz4ZcZ6vmRD165c7OH+s8\n7zh66lhj2PG0397nAGW1Ez6uoQogblu3BY+F2nMAeQsNO6yzkEGPRy6RT2Cp\nmh1DjuAHsJOhC4DkxKXMVn6yhdRm5elfF9qruNtIS56FF5WfzV5QhBeFZIz1\nFzF5ezmwnT5P3qfplfU1zrp/GnNZ5tTC77xJZ25MfKKXvSEEFEYO6odOzb5y\nZMXlhEfNAmfusjw3e4oCHqsZ0CDeBp6kEVB5orFddeNBBk/Lkyxyz3j+nwks\nzVNuD5wyR43+PFSpLrJJ1n7z+NqzNwA8/hZ+tvkaYI1thmJQ/ofRy/lMsfKB\nPVMI\r\n=wJvm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESlfdYY4JkGYVZmm+fAXDY8+4RCaAtpYYncj4seay2QAiARFzSgyqbkAV8R5UCRweNOqd7edhmYDuN68R47n3fp2g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0_1606738294005_0.8318297651456417"},"_hasShrinkwrap":false},"6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0","gitHead":"0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sBV4LseooTZZ9UD1hpQMoVGdoQkMn+jsItXUMxHuRe0/QmMr3sFFXgCaEf2NB1tV5eppUWcTOpQUnAfJxohrvA==","shasum":"c5754dce1bc766e27f4db3ff57c99e21a12b7233","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOGzCRA9TVsSAnZWagAAtBQP/1tI4bomew4MmUT5sthO\n2h3FmUewLBaWC+2/yumKhdeXw0Eh5RJKrVbr9VuHoDOD6CG/oS5dJ1TRO6iJ\n3dSJs1VVOza2HK36yaGwCyvLhR0qaSmCW07HnFP6g4wxBWoIr6jUzMk/q+vj\nCTjqyLW8C3h8pDIkM8PIgFFdnKG3kPUAaNqd7YEoSSz+XoqHG6h6u3z1PK3x\nTPb1cuxWFPvBl4FJvwzAwrLQQUqXj5143ZlThYaORSALbVKmd+Nw3aeJfUj9\nc66rdc8YX4mQcscAUrjNNfRN25EfCM5Q/isDVaFwhSUIwauOqgwElp2V30Ph\nWd9DVMJjRNtA6JEkDxpRiBKyaz8S46imnmOaxY8K5zXzZZnteX8ltmh6d0Zv\nq1H/gBqFNO3UU+EDF8B1EI1URvx1VlJcKm2zeeKzULOL0rhF7wBZi1fhu8yX\nAol7cht9xuA+RT4RpRUo2WMHKymZ0tw1rYd+picMUj8h7FurHtGqEQ6Z7UWi\nm8rNEVI3letJMDGtg43EZe7eL6s5GlPvQQRxXo6M+yEUdWIhmF4PV4ta0pXc\n6ermTpV2SOfxyTDs09vvXa+GvVXpDYMubyN9qBFsChO01YYZpGX7zRA+EkoA\nuflqyozP0lTnZk1tdNzL2Icc8L/WqQbJJeLrfJn3R8jquRDoM3rGovFUldYf\n1tDv\r\n=cTJw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe0w0LVpb8YkBsZT83l4i9ihdMxXVSjdzywSNK/UDjbAIhAJC0XUMa6k8tRf9CyJg0Wx7MwRhqx80G7IGqcpJ9Ni2w"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0_1606738355330_0.9551287843516112"},"_hasShrinkwrap":false},"6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0","gitHead":"d83f5b42d67d72221a169f5330564404eee20f88","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rKuFBVBBt+UVUZXJZ2ReJgs1wgYRI4xycOhgaiavdXLQn6LyVGcNo3Od21BvNwSqxUx5yVsrNK0PQPUWxLv/sA==","shasum":"5e756ad11331e2811a54ea1b7ff2ac94deb97e36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0.tgz","fileCount":39,"unpackedSize":229843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOHHCRA9TVsSAnZWagAAv9YP/iPtkIo5sXo4wPoFNN0s\n1pWku41IeUbUpiAQd9vi7dh7kR8WXvTamoNxq2pqhXWqhGM92HTKbMbApXf/\n6Nwnqou105jRWdluvvv0IQrLWPSWHdUFaZvu+b1MnxsTPhIMmUflFfB/2pxF\nD/iO5fOGzW9S77Du1NNaDK8iNo6y+HdC2U2fISVpa2ZFiVKS7ps9EaFa/N5Q\nxZ6UJCz6P1HhAv/eQZoCJnHi5JJbIM2NJLv0hzsCE6HSPyMcfWvEjdnGw4Rp\n1Yy8OX7A2xgPm8xFHg9sFth0WiUG9JLB7jF4psXN9KoEXqH7DgYBvnB9+yof\nVojP1cIGF9Q7dOI+SHEBkt2p05UjYSNsdsLygFFK7W/jez3nhh5YGJ+O+esu\nyKPaemu44i0qP4V2fcef8eaBIgTrvyolHr/RZJcuyQutPNUyjiZ0FiYadaUA\n+hiCx6EOocZTACR1JRH6sGjDHM//5USC/b2I5QwS6Bxy2fNawIxmBuCCLSZx\nA43pZpd6AVXNHlMe3xwgyH0iztbT3IhrPJYdlsei+aC9Kyb1LAZyVr7bKF3/\ncM26LagAF7DayQr9zn3OJ0SGQspcpz0oui97UuS6UKZYaIROQxD/rmmxSF04\negvlg9kq11APMCqqWEp1vYQ8Z9vwCuYeNYbhW+HjlITKS4TxgznwZWa92uOA\nSM7O\r\n=X5p5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKaLaXCnjmp4sU+Fozgkb06LT6Mh5rAtF2+eLAzu1gqwIgCUE7QkdNdvdkkBdjEhbkbVkk1tqq0yjfSAWCXV9HmVY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0_1606738374963_0.6055746279980858"},"_hasShrinkwrap":false},"6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0","gitHead":"72cae099a9c81c6d413a2a0f11c16c123d9b75c8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Hw/ACThNDMoSTQWALuDCLaWkLV5MXNiqHpHXHYFnuS8PJwVymTy/M7kAkG45eBwgiwYWzp1hCJAIQx/G0Vk7Gg==","shasum":"10cde38dcfb12c08023c138f947f0409ff53eeb4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOHrCRA9TVsSAnZWagAAJcoP/3cyesVHRee1ohhelO3g\nV0M46S9NMSAW//gNRujXGBaz75j268U5VlpYMm3qVxyMeKutLC6KUe5sNejx\nqst2ilzfvoiGWSZbS/+zdY+dx3SwIVfco3eih2Yt7WWJ28MmNwjy1BBzR1MI\nK/Xi8Jn6GJLXGzwU07KFciZ9+P1CAZ/GFSY/iszaTD1sMqR3MwBlG6LJ/1zb\ni7DaGmt8HhUFlZXLOfZ/IkdoImlAx7hwFXqNuuqNueP3FHDObXeR3zJydYLu\npkX/yPP8UUH4FOVqXefWwyXL1rxlfkZN+6quxDB5IVWjoYp9mG4pf+ctOoET\n55JfMpBaCQKNN51Sx87kUSInGdHpdoUR6LOyDILoqzPdwCKIpYJYLPOAFE26\nUmIFm1uXSgZw3P/vu+/At+QOl1FqnHawKzOqvuPTiKo0j0M/Mh3PX8SBp9jK\nnrA5Iz+8ABQMslJrao4YESluGbalfm1JtmVPzDuKrnMMj4ARMBko5pWqw8OT\n0OpU4Bx99r62WpXsd5NX3XCdCQkv5lCKzbCRmxUuSXjC8L1+IZco7K5CriOi\nysNNIphTozKWcInHBOiK5IZFWoj+qhvcYPximYbm5+4SyxipSPc4Qqtozomp\niBd8c5UhnyNGXTfIxYeu6ey5QD0x6ZHHMIJPIaVSSbL/WD+weDKiwlw8XISv\nGWa7\r\n=4Qi9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC+HXPeakvh98aKTnB43+QQRV5k8kjKdBMhAAcu6+HWxAiALhEuAC/xw8ub3//d5NgGh5JYExeP2E3qxgobffiJaqg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0_1606738410902_0.9505846656734251"},"_hasShrinkwrap":false},"6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.4","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0","gitHead":"606c6f21cb322bfc1f0c230ad168fa44e3bfea63","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jr+raCKTQYZjAeXAAm+Gqo7eNOZMe0g3eHrUk8LtwlfOXgYR7x3SzTrmS5TJIq/ghNGttyiCtxGYw8Ca6gCV7w==","shasum":"234f8e074584da4c715fab151d3143c0651949b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOI4CRA9TVsSAnZWagAAMyUP/1IYDkGFos0O6Q3EZHhx\n1nHgHWPG8ij+D1cBgnIZnIL2ex0eJNq9zSCQRxfEItGLwOoPDac8Pm/Dvi+A\nXjgTtNM4EDpFa98UHeYdZ32+zBVncgeDkBysMXELjSyQAkCXGcwNNp90srEi\nZB+2QRgmpvjaMEfy03GSds1C0AcuzOSH1rJTwDa5vzKT9OWKpY+B4TF6gPRl\na03OODewExIe0QavSj5RVrjRG9BOcbanRHHqmQPgQs6J89U5qkJslcXKHXeU\nWX/WhKLtn9/MGwIHDY9JC63Kyw0WsrVdFy5ibpf5x4sWC9BrqetsbE63l1zr\nIxXgHu8hSqlh4ox2GToxVSFkQjRXd69Ah2sjc01aPxTEHUq1LHsShD/Y3atn\n0y3s4Ras4UveocZ0/vF7tkfZ3zWp4LvxZ7Fj9/XzQMTKPpG0noRlJXdIRhlA\ncfB8y4RCpaUzPny3p9aaEp8dyPrg+1iz+fsAQhLkwa9ZD1N+kU57wKTfZMpi\nF8gqJcSAwwog4x3KBmnvaLXw5nefPXldJdDG7AX9874E/XbW0i/3ObMPxCmW\ntizKBMHTp7YzIXqezDrXQMQ7hk5xxJKzHMJxZpG5Kqi/hMXwipL5dtAz5d8c\nyEqdRz+KFi5JAsTse8VacTFaTPs2FWDpSrEDdX+ymqFNxFzISwSbnxO3cr7B\nwjJY\r\n=h1+s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD66pex7BMMdxFyXMlTntsWKHPb5nmHaSj3w9vMdkDeIQIgOqhQ5RNBty8qzeoZflD+OE/ZAH+nBwgz32G/ICQQONw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0_1606738488287_0.349491232590168"},"_hasShrinkwrap":false},"6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0","gitHead":"a564e5a2f82d6c92eacb936139ec16e6fbd03fd0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-P8YOZHFpRRZkbTc2NRJmF56RNMDrL1Q3zLswOZ4UJ/YnajN0lbBa+NdprtLPxetxXrTATMx7ctFfiS0+mPDtmQ==","shasum":"2751bb6446e3c1cb09948ce74f42838852ba9e21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSYUCRA9TVsSAnZWagAA9kAP/igLlqjHj68mGdK5y6vW\nM+BNQZMPsRl9lO8fsKHMv3HUiXOLC6XaVv/f4ToaOXyyG/lAfqfO+gV7D+rC\nB/mTa1jVbbeR/7Qz+6i57Aq6FdZvqXFWgV0KZ5HfK3K7NBFeSFrErWRBD4G1\nRNwevnEW7b4RRmpnytMF4dHkV1v2syPOyNg2VcyLfAvy9E9fWvPKplIuDxCN\nkCaOopMN6kCvNn13fm0HdtkmfwCUPky+4gubvnKNNpslxU7V8loW81CvGU+S\nLhOuuzUip7Nh4KexAmUXUiqIISKoTs2l/XYScrM/PT9T9evR9TIlxoAfLor7\nj6G9ILpN8IXgGfYC0vFsURJ3ucWDHQiSRk8boscRT/28CxEQm/QT5ypa1AFr\nBUFTVAqHGPhSH2XRlGrsbnqOfyVf0pvTG/Mh8X5FtZXaJGzzH/ASpMYPaWAR\n+6v2YAz+GCLkw3a4yNLMJn7kZ/mrzgMzKl8s7i5qpviwFjJJnay+SVeGRTdF\nV/5bmu28i8YiJNLqH3K208L52kZGy+xbaAi1hGYEbseMrFI1pwsdAqmzGicH\nIj6hoXsR/pzYOT0dPRUNWgU40eAzJOsxU4N5RFf/MBs9eey1o8J4fyml7lBO\nst6Iw6TTG1hsG1fdy57M/X6PrdyehzyB5We6/NIWOQP07+UO9q85QBOuHAj5\nWhk3\r\n=nXu9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP9dzDvyQGnjrCuzxSI0CbSBkarjev7NxfR4uoRk+reAIgGv6MTJO6hRpbLeVfa+Os7WRda9mI6cJV0JC/mXyZ0z8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0_1606755859919_0.8085225996402756"},"_hasShrinkwrap":false},"6.3.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20","gitHead":"99c0f370eebea1bfb26f0dc49ae461fd2037a34d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zl0eiIFS6iXwWsoQJqDMlxtomi2jN9CoyFI+3CC6wCL0crKRuUi2p0PkvUwL+Lg5UkT5Y1774D6L33iECO5GiA==","shasum":"45fcdd3ee3f82cbeace233a75b89e141d466c988","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20.tgz","fileCount":39,"unpackedSize":229716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSaOCRA9TVsSAnZWagAAySgQAJUlPEOKiirVJsgbHtPe\n169u5ugw0rBvgtsbweenl6RlDZdsoN0bK9oaG3I1mCVa/Sva0MKIkUfMkE+R\nYRxcF4+yvoo34EjedoEaVxKW3vBEACNscrHBrftuMT10iZl4XuIvMNghahyJ\nsYpHsdM2PG/GEGVGe757bK02QKhRB77RccXKCHPuw0fgBNXEWW/nGj/gYHSa\nY8z1HX49PdYRRyDk5dqU6TEIik8+gSeoKDs+DVhPT2nNDkJ9fVtGRvXPk26h\nSzWnv/Z9IGa+D+g/Oro24GsNauwm4xnDrz87MIlWjCsoc9s2BajebIX6yPt0\nAccinrHC2E5ZqFulC9HAvEhy9j1PDCeoVcJRtBhn6fzh7S9rmevlHF6TCcyu\nCPa+eqEpNZkzr8JjeRHTDrR1iVFpdVf5hp+SL14R/+zbhFwRfYA0lCcCx1D5\nlDCcwwYcvRaKz6oXUdtr53cKUupWSYNfbJlGogv4uw1nIHlgZvc37r1oWQRL\nX6srgVrQ5OAb3K7BVH80r4s1203rOR1ul5lDePSUf42PJc2/zw/+Y2/pKxEo\ngjPxx1VOJL5Lwgt4CeFx2uqW2Z198DlOGT5hNhOA4EntNGCVNE2CAzPuBANX\nWOWTKbIm/9otI6ojVrTGdFoUg+u0YwAKCVImte8gWlTFU2bqCaRb2CmQcEb8\nmKfC\r\n=RSEb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVgabBWIH8hbel4RKdvdXXeQUsCv4SpbMFZeElHPsqWAiEA/3d09TiEsIO0B9RM4DdqxdoSMSF9NVTmZTH0XuVT97s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20_1606755981813_0.9630136385407713"},"_hasShrinkwrap":false},"6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e290b154aa29dbac841f110e71337240ccbbe895","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ozB0T+7JiXolwMOc+a4v9TDbUT09Xq5XBF+PXHEBWvaqlQ7ow4d6Rv2PS4FdlOoTvEYLKrqTo3Zz/dfCqJhssw==","shasum":"c3165c1f658c21eeaf0feba7330b8365a1e9ddd5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0.tgz","fileCount":39,"unpackedSize":229484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSapCRA9TVsSAnZWagAA3ZkP/1tamcMUpgXeMhBF0qNu\nmS8CYxoqOgQ/SwokDRog/4qa5hiGP2HGQQ8GBW2Xt5Ts6KL2BlmqdrO1XyYH\nHjJI8bMikljJAQ8Vh+LcyOlfvPBNQREXq78vvfGyZ+DQMCkvVuk7QgnHQFc8\nKX5CBj8ZtjY5hD+DzKBNEv2bbC3cL4PBKyQPPu/QnNBpp0f4KnUF+69lm9Lf\nHXz6vSR+LBFCCF95KN1ZW8TRVU2syABpnPKWKF9sSb1Uk0MHW6yB3mR/B8ro\n9vy1OWvdbvQo95rYrwlOOeQ+ZnmynHvIM+6NEQcALg9caR5F/n9mXzaqYwyY\nP6oACB5Vt1SrtM2Ciy6s24+iXmAXHxhVD2/EqiLKD+3JhYnLXfiPZrax/boZ\n5YvRMWFOO89cVUpRjE7Z/+xyhV4rUrjDhUlfbakeYGTak6xi6U+AJWxrqSS/\nZYmvH1pumd1owukyGOncDSQsVGK6GWc6F443A50BRwS46MA/eTYXlbZcbJbu\nl7igF5XuFqVqvdWiylJ+zvYtukfhzpEvM80q9zgmAyJuOB0LbAhReVTZig9d\nSYeE5F1FSW1mBms0namtGmGI+cFyZnv70nLbWgiL1K0zLRf4ceL/SbgUxn8d\nipxsDEa/g7HEXmEgvFIro5Vy4x2cUwOlj7fBdNe7+IjuMiOknwf4BfTthqxc\nYd8C\r\n=r1DG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2QnKSaf63SqYsolyw3vjLQjN0T+QjYvNbiKKS76tj9AiA2vHg4rirMzxuzq9W10T6LTc1LSlItzk1WVvZVhz2Geg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0_1606756004321_0.24764464284609788"},"_hasShrinkwrap":false},"6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"99c0f370eebea1bfb26f0dc49ae461fd2037a34d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-G4XNHa3mqmUJyWtixp23epyfks+g52Y22CXrIL+zKqU6BkkKklR4QtCTcMf0BKlu4VgTy9bqUNMBBtVNY6CmsQ==","shasum":"f95cef916c82a6f700c8d672b5cf727abd6382ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxScdCRA9TVsSAnZWagAAf2IP/0eXhLoLimLPjou+gC28\ngEF2FNy2QpD+tadvEGMBZPza9jNhc1R4HQalZBuavY/9JhwvjxsSAnZ3MMke\nqkEHdq4gahTQ2PbTYk95f8F490PZ3WK2obHu/asVC8I/Pf2r0lOHJPEeMTif\nvuNf5BXV7aSS4FZv3y2lD/1pBmS8zuruvgn0qr4ZybhTYsHjC6D8EP3Yic0l\nzjv9zHlHs1+L5Y/bhazXWEYxRqvM0tp0jRjCCT7Qdq2hHOX+20xWipHezZi7\nhYFJ7CK8QVJSof+dRk9cXy/yYiokWIiCTOKp1MVrqq9wTHOJ8ZGw/TOcSC9q\nFuAfxOmtxhgDessAOxKZPpEVW7MHw2YVENO5TbKuh1xX+Qsf1FxQZh9UgcaQ\nlVAF53YuOSKMiEEWCLTP+y+zEyXSBVBpLaxljjsYY6nFQ1uDZRX80lNfuesd\nSMzbIhTuEPVABaljKKBO9wz2VWhZNCh7y62R+yd1SVBvA4ep2EMLbWTi6Vm8\nR/UboTpXeQC3xa3L7LzvsJ+MiUj0/BAvru5R3eZkFc1jDmuQi8joveF/glDV\nYwGJBQGQqs6dE1b7H7vUWECqTl0oC2p0Bw7DwxiqcQKHckpO4FVfUY11Ci5A\npRxZxtSw2WN+nnurp5L7LmfZoxfi8X/iSBkaQHC95EvcCa8DJCnm9ZE00utu\nlB3H\r\n=Kgi4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp77d/CKn/wKBWaSPFQWgcogc6teEJNCP2D7uFS+mjWAIgD8iPeevDIx6a5gID2fAROwXv38uCBEh9zOmDQzfNpsU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0_1606756124592_0.1544833630632807"},"_hasShrinkwrap":false},"6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0","gitHead":"839d5829d94cdffa0889550b9224e1f1e8e5a495","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0mRoub0DdHUgRBa+XiTNA3hlRcGQQFDNQ+69NtYZ2KPr0bBowTFgPzPX6fadycDW1DGPY72XBJouDqafSANuSQ==","shasum":"4b0e0ec7cea541ea6152cb3bc6ffcce7feca35d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSdyCRA9TVsSAnZWagAAvaMP/RjA15k79i3CWXvxHd5k\niGkA7RMUNmfISdsxDaJLfBpYNzhH48p0WqTUKKuvWuROmGr4MtMWjbFQ1vdg\nsu474Cyd3qw2pHae0jfeRCSVivbtibQhYD+YXvQaJust2odZzcKPN1rhuYG7\n/cOARXF7o4aYEzr+GKCFx5rcCRyO2sU9hni0CJsrCaZ9p42M4lr6k88+L4lw\n6Ntqc0giMG7cAP8zwm27vXBcxygckOwZLyepotuowNDGQJ79CJwYe6Duqcl+\nnZrbYkPoOT72C2H2im6nwzatdMbn212uTWc5IYB9lw3D1l1629xSBbEew+zf\n53m1tMsyQMh1K80iDoXIoDRzq8O3l6Gc4TQ/RYiRLVEcViY+dMoUM3DJ8jYH\nFRAbUeD+rHi7wPOF4fvA3Bh+5bGDMRevL6E6iE+JLwsyzD2x0nU2ZAdxTqBo\nntSmOpw/gGAb7gbdd1ofG7ur3h+EOUbnGkaWYTrTLba/2tAYY7siy5bpU+6D\nSf8C7vyMeiTXuDXCItgqvlGM5lkIjoOrQTSFuWRdEcBrK5k14yIPQ0njJZfN\n0cGoaNOpfVc/HQhW/TH+SgYS0j81q24Vf5+ND7siElOcyGHKzV5S8g4UC1lz\nxK8+xMlE5hXaMdbBeAcBMG1E6p59gKSHN3wK+DXV+8sZ6WQGqUUb3FJ1c3P7\nNnw6\r\n=Kdr4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdB1TALZvR+dID128Fc1/k46wN6KAWtHF0QlhkHa+w7gIgPJZ1AWYEyXCbwcdiG90U4sb0JRQVEInjMs1dH1MXHZc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0_1606756209544_0.5152836809933201"},"_hasShrinkwrap":false},"6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0","gitHead":"3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-98HuMDE6kX6DY0QWVm9cqUg+6DLZwkzJUku+Fyv7Z09qBA0MoAxNRquWmHbmGHuOhaeBnvZJ/pxtZnlw1p+0Yg==","shasum":"c59310d4bda9f59c12c96724ba9990904660f708","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSfqCRA9TVsSAnZWagAANZwP/iCjS3CtTQ6Io7cSjhDM\nxMmFnnn7p3FCNq1/8AKJeFhYQPLdSrd6T3gLPp8pQMoFua7/ne3orv9qdbkU\nj1A/sbwQMHc/C84eWHkRSdMehl181qou1ZPLwvVWjcw2lb8AH7FuLspvjftF\nC1PJFjq81Txfa7hLr80AunJWm7HdQclBF9jh9E0hU+WnJaY87qbaw9RyUZyz\nSEy/uX4bYo6Ije0T96POQs6C036a3LjuHdcgyYib6vzZGEKAg1Nbvj00uirt\nHxHvlCA5B9yqo5EMfEeE5IjhZwb1lJdILrykAkHWlB7HBSXrDd6V7fCQ2Lqn\n0FiK30UxhSl8a1x+2zABySOGyJc02eyakA6tI677dwqadE+n/K6TMvRwGK9b\niG4C5T0x9LY/jZo7JhvwQYZIYf2UWOvzogMU3g8LGcPujUE89RGv2gIODynP\nNMWWdWNxwijo8QIaEt87ouoboYrJPFsNyZ0lLK11NU/opP2lkHzYnMfPaeej\nIH5y7cCz7VjzkoLZ6un2I/lmU3/sja+koumQOLpmlmOo6byfoXfE+x0dj0uK\nxe96Cl3ntYuM2/u8/aVSfY3vdHj7yXy6j1dVzO+0abyub6QevKapBlp29K/m\n+LQCRsG9UwkwkPIoFohn54kyAlBGRMhTSn8xtGy2UxpqFDypiO8L4N0EmIhK\nfYxG\r\n=lDzn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWw3RdfZpUcouBds5z+RaZEdo9lD+7S69SD1mxjxzicAiEAnirVtTUNppHgqVsDFB8Vmi4Ty7LpY9jKjDLTOR64hy8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0_1606756329716_0.8469953870980151"},"_hasShrinkwrap":false},"6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0","gitHead":"7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5VwfOXiUU+A0W9CaDRHtuONTS5o0Uu2A5tb7Ro1Pf0Or617/loBIQBj9xAk6glHQY4zV/xX/oFM3g3eXRMENew==","shasum":"8fdac7fd2cd131c9fc214e9592f6614ed385dcee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0.tgz","fileCount":39,"unpackedSize":230118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxShRCRA9TVsSAnZWagAAk4EQAJukfYy0l/xpGTBygZLZ\n7PCFGOYiJZxn1nfVWsSQEaoxg4673tjGNTVkOZbP+5J+gTni6FSblTx1QjYW\nRA3+pHxLZHNf2d16WQ5B5M7md5tX09wPkA81B2CcvzZLgL0MEvSvO+d19LAm\nKnHpC8/WJjgScqHgN6vrblnRVvjBPg2wegW++jWFCJWvxnW+t13T2a6TS0Jk\n6hfGAaYKq5v0Up8Dac+wcwqVVhPwNNQ05nDeNiWCDISt8OAO82tVHTN1OJGY\niteXL1rn4kLgrMAjQ2uYlJvwBNUKxuAcggfU6z1YaY9BJ5CG0CHpn8VdTnKH\nnswtLvDkRN5quzAjdLcCirUTNzHSWcMndTQJjyYkRKSwhTtfxIm7ZSTjegRN\nlpLTqqczEX7jITR5bvxtbXJ8XfBkX0DOD0jEAVqHGfGNjxWB+sxifur7yrZ3\nIsBjKekYDtDdWsqgx3ghBgcznVDLXgJ/EY/llbL7LDXhXJ4iOBZJDpMukdLn\ns+4lmTt+BNRurdcSZsxLeNhtdeq2qW+wcwMo0YmgVI/STzSelqAaN2DchRys\noXrQyPfZFJks3xivz/Ea+DIiPsyMOei9N5qnR7FkcbWQr8fvKwZdHBZdU7C0\n24PleEvyPWXLGSMDIBImbOIzloaPNnE77GTQDQzzKLBtksQ5BnD/7UI9l2eZ\n3QcG\r\n=PFvh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbIwniBOUwCkIUIFF69WhTXvzcIwMOGQu8V3K1SWxEMQIhAJoKlNODEa62wmDI2AE8JtTrv5UwAyXIyjnrJjxwSbz9"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0_1606756433028_0.8592344875006688"},"_hasShrinkwrap":false},"6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0","gitHead":"62255b4f2ec9e362f7116d0e68e09133d183b722","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vw4To1EC3HcNDYuCpk3ShYw2JoYccOvfxLs84zSFh5bjCIE9GDZ4IsDMBjpe7VVmGkL7XtUfVZR8DLx379PPdQ==","shasum":"440c6f55d6c053a2758728ccf5e8e546e4442eaa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxShkCRA9TVsSAnZWagAA1OwQAIhPCwDkgwnOMb15bk7c\n3vDaYrXqUIFZgboIEm04taMkk8E8t3fsnfzixrTIskpQVXTOJFo6V4BiAf1i\nGbghPLYUqqhJubI9JzL3hUiBophFEi4HUqi5IM6HNDH3nZUtnO+W6JaMx8q5\nWAoiMg6tw36ThNjb3lizenw0ZdiJZV94jW19IUtcx78mXoVFrn1TnprESCni\np7x99ioS4ZREWpJlInDtgnJFwAHa0ehUgI4/ZDYmgO68Avjt8GBPSFOBUAlf\nbnxN0b3YlbzB8l+czuO44iZ4b8KjNctkDa6XCmF+ljpy25nnJgO/HikNTYzk\nps4duGBgd3wUyE3KxKmt9fBEXzDt2ZiJ2tFT/dHEGlSZKsurUuehzbd9p0A4\npCrDpzEi2CHW7KWd0px6h9uiBhxsKj+aFpwgHC3imJEKkcQof2m+h+u5ay0O\nqQn9Eg6qYO9tGRdE+li9DO55UGV7V8TY4QRXqXwASI39kbxnePXHhwfCk9k2\nUH40h0eiEIyXyPgpwkg6ugLoikLRbwVJl3fNiQqT9CpZsMT1teBx9OUyRUP4\nvpNgf4eB1mygUlIr5GkfASg1Xi0LQobaULuMxNltCqhWiKDVWbJGW5IqdQwZ\nZ+VWCEb+QXwyMicZCU7FoMKoGNntsE+Dle7ovtQJo66yy7T7PrTafE+uahRX\nHtwX\r\n=3/+E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM+A+tl4OIhpqkCoqKW60QafRLk5Nvxz9CEH9l5ycySQIgL3BzGxk1wwjnNfeCAIx6Ox75tEFloAlSjJOaHFRvu0o="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0_1606756451886_0.4959511470224711"},"_hasShrinkwrap":false},"6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0","gitHead":"bd006a37f63b378b83450898556c71f80c29ff0e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2mU20pLuzV33lxDpLiEnx0LQetIlURRJHFXgebubTUFT5Pm8KSQaMpKOUOwhwRRNq2fOXblRmOVwqO3dwZc1Yw==","shasum":"63f9df6b291c7a32d4267573491c796b7fa4973b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSh4CRA9TVsSAnZWagAADNsQAJMSfPhLqMmTGCajMvhV\nDcx+OuHMFcEiMlVnKW7SfkMiD7I0vIHyh2Vw7oo8yVrt8rUUIrjZfqwa9+/8\nNjYT8WaL3rxUjeu2Hce4oW2H3NsfHqZYSuDvQDAmIGd6ApHeRyuX81xgR5fU\nmJ76TFp+sQuvoq+flYxoekmc4oeZkDBdhNdpYRKCbPrZI3oJRnAR5lMaYD11\nuHEfn1bZ9nOLWcuse/0MYxyTiyk79wGSnVqryrjw7Mt6vVd5jNjxiS2vRKt6\n3s6ttT4GDhsRPXe4UAp1TX4yBEOVM0B3/58x1WmNGFcEBKbSOtTSLK6iWlQY\ngBooNGIBO2x5rNGk0+lnHLNJjPQqqKn8rznCOCZrIlv1xe4qIGFGoGemsINK\n4fpD3/cJWaRkvCrFNNkjrNJ2cWQTenp0rXP77mcb3UnIXC6fzyawlKmM6FZz\n31DKK67EMj2jTiIBcQesOvEXTs741IEuISWOAkRVKGqx8CGO0ZxqFF7aosto\nl3CQs7aiyX/PsOl5qX36CEvFPm3Kd/k4sct0CLpNlT+N+1cCBtPGj6NSU171\nTftZoQd1azP3GvIMgiGf2zBkTVz1DutumY1A5euojxCgXUeVQwzUvddNfHoK\nWELjKlk/1MW5BpOUdTR44RJkjrcIg62Fyv3nhjG15x+cqEm17aX3JXPvqPdx\nBYxD\r\n=/alA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElZGHtPo4VowU1vO3uz6reVUOPJ670hFgZuuwAXvYPOAiAetpJ1TYHV1S1rTBfdVJTt8sFwSfqirWbz17pKENGOzg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0_1606756471791_0.17542268185435606"},"_hasShrinkwrap":false},"6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0","gitHead":"b4c8788c62e8290a23ee2b060d7b16a803954a01","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6JQnk5A/ixkAG1SmXEb3N6IZFhZ7SVTqZxVwM0L1ONDoT1ZhjmuQNB5qn/Tya7Z5YJ+XSRurIM7vPg6RSswrmg==","shasum":"d3d4fa449a6afd594d681f25224f465a8b3db6f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxqaFCRA9TVsSAnZWagAA33wP/16Cm9ZZLnr1WpeA7xcb\nqVFdSIv9ditjjzBpIr1TyTF3M+3FjJ4eBDCqdWsI/4McxT27bUfUUrWETVHa\nxyPWSXwUFzy/x9VWDEelTyfokJduFdU2yDsEN8/2iIiabbjJ9ILRpiafsrjP\nVTEhdxMseZ3jB1gVrxZzUnFoFfQGo6AzW/k9B4lXAibXy/mZMtVsPckTMHhS\needJkAPIy7+ZM6JOpG3rMPIoQ19EDaigi694U5Dhs+jaPuPvpKs4lueyAEXL\nI+hv1ABbgpqzfO2Lb6bDxkw7qulVdIgW6/Iask0Wyyke8bqotnTrBAZWkKRL\nUgDGh2m3YePCX0ecOiDiPLWTaspcdb/WY80MShoezWP5d6P9jdUgxvcd9SO2\nQ0aORO08Zs+3b3YivarozHJlUh+SttzOnDYvrCJm3nNs1X6rTL8g14SYoXqq\nQRMmeOdx6NIvEeugikifKdJBmxZ0PETI/+MIogKXmw+xS28yjQpf7OJmRhE+\nBwXilvadtWdkCjRSVv9ayrizkiWg/VTeAy0MoHpfpaqSgHDaiSMZZPj9IHCI\nIcmvo22w7dW+1+KLMIwpCuBK5HgOwtoRDnetBAKNmazajpML2ShWwURrA+Ae\nCs/HjFcJMJdNSzZn2mYcr+T0ikdovCvqYci3ZZQ3l+zfA338XEA0od4H8twf\nwxMT\r\n=GhMq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj4lQ+Mn7NPe7QITEYgwCOzR9/5+YrKcV+cRJb5eixpAIhAJNyrFygUvCDb2waY/kQOra0XdpXL7AoJmdzvejqCaih"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0_1606854276949_0.7895876892494158"},"_hasShrinkwrap":false},"6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0","gitHead":"34d0010985ea0a0c5540e8ccaeb266d46edc352e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sC8c/6JGp4p3E6F8xKCnsk9rQ6p2wIBypuptMV4oNJmqroPB2cHAj+GHRxPj5WDJBNNDD0E+eBnV+rc2WOr8vQ==","shasum":"1dd2daf2aad0dcd89694e6f984a6fda95be776d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0.tgz","fileCount":39,"unpackedSize":230728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx5peCRA9TVsSAnZWagAA5loP/iwr+Mtz5Fgvf5apY7O+\ndpwJfnnxqkA2WlnKvOLlrQo6lHCIQD4+RCLIxmyXEQ0BsPddn6ZKH4dej7NW\nY/ahuJJPQHldkr7Ykw0/c1QPz7nLfIkKN//LnwQ3qYHuCj0kgKBW7GC1jvoD\nIGQHAy1aF5oIKcrpQ0zDuHfaQSJIdFhkcG27nlkXSrJl5YO1+/70WDL0Dobd\nhHRjmdjzTFVvX1z3gS2ABV7GL+ROGLwpi4SEeOpwaRSZFExm5YeASmCJN7rb\nk0Bzq/CkLVjTdASRHiPy1hkeDw4D0Fqzmj1PK9KexfIOY2mjqRPDYkMpEpI0\nqL/oOHoOaOhnKk1YZ7nNSkwjrvE6sNbOnWKnOgkhuD5kk5md9VZOQHp5UqBv\nqjokAmxF2WUCBP0FB1WTtXhiSuqONTjQ+kEZbgC4Xywzyvi+SZKUVgxdcunW\nLRkjk3iWJ5BWxv5xzujExtB/JlhPXWj/GlmtVICTQ3rY/5sl0e6+C/y9GQTe\npcRaEuyHbPQ238HuQPEHWPkbdTeQuLczvElVum8UWjBnEP7GK5IQ1x6HScLQ\n/+6RN5hoCSMxsSJDM1BG2IjMSCwW5Uma6S3jmccrwtCR3LFqjxOzEB54xeKZ\nn5TuZ8/3kO8PeKbjjUscg4iKewmS/kU8b7idonEH8RBc+XoUYTRBVJPh68nj\ntg6Z\r\n=dNPD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKSh97MgkFyTShcHa59I8eA7roRrFmvuuq2d9KSxxoYgIhAPKlsGcQUjwiAdjhZKoYf+ShVyfy3X1yjUszy0E2NoY2"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0_1606916701829_0.35596152623908095"},"_hasShrinkwrap":false},"6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0","gitHead":"2b45a790b10593f26695c0550be1987499e6aee1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/A7fV4/lxdFg4ZTAeafriJxi3BlGHpWoyA8aUQJGpfmiCX9zGvlAL0JDk9c+CFbjufgESCpMsiHXmKGahhtr6w==","shasum":"a9ea1b6ff20af89925e0b733ab92fbf4321f4492","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKqzCRA9TVsSAnZWagAAsmMP/Ro0laeKQmIanOyC4o3/\nRKEfKccdcIr0T2oOB9u0uBADoqf83vlr5uDG6Km8hV/nr7R1P+ogJXfNk2Rw\nF9SM9Ac71X2Fn0ITAs3bDD0STtp5xN6TVZPJnaB0j7eo1izHG5ZPbTyW1V/k\nTb2I0J/G/eIfPuwj+va1aue1oPJo/qCS0rl1FYIdWWDmFu/jXTXTNatr3OAR\nWJJbN8hus1x6i24yAR6mROdTGDBa5jeFCWVOA5CvZwICoQ9XHyLlMR2DYHRz\ndhsR2ZiKOMVQGJjAzWbgC4IuJ3sHHCK0KoUOMWJtStlH3++mKJZOfP5Ul1/j\nhyx6Df0DTG3oHr9OctxwG44xcWk4WoAeuzp29yXbWvRUK5rm6gif4sfVQFHF\nF1zD5TZ6ipGMPjR0POAuvTkfx6r/fnFtz9YYi+OD8/F6cfpttS9LCTZ0jt4Q\nl5bMYFYjyP2hv+yLd4YqlMH8NzNrqYnYVKafHAHHyBbZI6n2pkulKN5V4pEb\npi/f914ddp0Bkzr27tXF2qArHawAXmjJ6MM79NKPnk54VhgNhQW7845PW5Qf\naeNTzKLGOvGsQurAv5z9E+dDKQnoewOvsiwEkTxpuWyICdtzIIx7vwQjBALq\n/kjt0peStZjtP2l/PrR7CkNeg2M7xThz9nISjI79Ri+xT6SXBOv/y+3AFTVP\n/1Uj\r\n=mSiH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJLtxoFd0J3l7jjTW92JubC62G4VC/IXcXmyO2WRC9KAiBDOstPSdkOZhX/QXscl0tuNBVOGyhFkYTRWaNgpCpFZQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0_1606986418969_0.5365044404917148"},"_hasShrinkwrap":false},"6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"394e0f49e042001e4d0b00017824cbee73fd4b35","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-H/mqW48MtQoT7ZG1M7P/rr36PFxgSqrXriHDABCTPpdcK3nCfLZBxJwQYDmw7HkzQBQdAq41VIZQMZVbzNAa8g==","shasum":"b15ae060c5368864180adfef458b545aaef1428c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0.tgz","fileCount":39,"unpackedSize":229759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKr5CRA9TVsSAnZWagAAt/wP/2AB3babk140F67o9eOY\ng5AwJ1VFr0vXtZn2RMx0lYOxAA/ozl/P3OJ6baMs+A6udVXQ9h/C7Jw52DrE\nTCk4hXidtkpeNARLsBEOyZ7bfTBLabAUyStvNUoX1KvzNeTNT2E5YfwJjDSb\nnFZOjFmIQSGKC2o96a9Y+YrKgDl9qG2+ORQqUhlT/9miCMDAeg6qYe2ZOZ0R\nLeB0labWAnf1V6PGWH49UDjXBU4LzD0mS4qHU84XxaxHwIJIb3GYoIJ/gfGo\nKi6EUnYvX+i9rNiWBepF51DNThLN17awXvlknw4CuD4T4EhO107CdMdWeHVj\neMC2mdM4+QjyAhNIrGRaW1kzV6zGFEq60EP61AJqKVS0ysMOkdXyTrP0ahRK\n46lfzwoAe4qnZ9Vzg0tGwj0JwIrJGKrwzyqk4eoNLnJELZYmWVy7r0ZvIIF+\nA9m+K2aE4dieLLn3IXOM9mtwlVx3uzWt/yeMt9kG6RVMk+NPspH++9W4UAhT\nTvDPadcmI0KUuC8NUpOZ7un3Cq88AQrTF961lELFaM6Z/XQ7UYTHuem2VvHX\ncwDtDAT/H/b/psxQBnMDXzDg/hrIBZJNVSt3ZbNZcbfS1ltcNs0n7ukE5bnx\nPinRnqUjYvbCTlxhp69hZU/CzV8XknKnW39cjCBRlBVwXfjAKoK0bveKo8u8\nQqSU\r\n=wnPp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDUr8+LMX43w3dN2nPVo+nWucYGA/miM1+RKQ8bC9BrwIhAJ5kgvoQi+Xb47qeJvOv16bR4uPGXMnC+3niCinoYAIC"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0_1606986488460_0.1903156094015488"},"_hasShrinkwrap":false},"6.3.21":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.21","gitHead":"41c3ff9756d43f422dba9ddda68d4520a462bff6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.21","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-X2SJqFwwKunQAVGiKU74ueGK+zPZ22ctk/X3HeXStCbYl/lNSLaDiA2NsiUtUvCzt6B10rpE63ZUGNJuMsWVjg==","shasum":"bc07a354175c45906f09eee044748340d1cef73a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.21.tgz","fileCount":39,"unpackedSize":229992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKsYCRA9TVsSAnZWagAAR2kP/jpsmJtSf4hz6R+abMez\nGCzJ0HhZf/Ip2S6FFzRdUbqrAAJ0z/gIJUUZq+AKlUgiEJvR01QSDkLTHvx1\ny5E0SvpM6nrIKnNQN0+I0fLz0ciyX2R97o3yYH1/aXd5jeC3TPsiBSVZi5Dy\nJ5/PX1FPGxxdjzKJ7W/OlSuHu5WzceOKaSQ/qIAIfs9VVYw6MWrkkGBFsyqk\ngKM4MjTo6jqmpkWDywOqcqG6eEa3Ka5LNMGiOpxqF3+iMJ/BmwLYmKHgh6u9\nd+qUgXtNmJ3kSvqBSuBZTIJ7mc8u6N++Rc58kR3CYkISxP7FjfBx7Jwxo/c6\n6J9FkDWuCAdB//zwVD1Cb4WbKGprvcvwssY0a98RSTLC/+HyJ3X5lQg40Hzc\nSRrXcxocKmVaTVA6a+aWJDEYChqj0/D+n3KV+LC0lHmS22XuUuXqsAK1tBzj\nqXg1HEDZMxLIHCrrhaaSeoP1nzKfzLwVfUihJgIjAYnkCr6Z0ZNS5ilOOk0r\n8DeWA8Z2ZtQ5wfpLzY10OJd+ZnKTcvcfDcczsxFxYdAhPTi1zQKmNmWjrdfR\nvksoxW8UYlRl+AXE7ux9l0wvKLB3jLzzEd1R4wKq5Wv/nLPSxMcwIL/szJFp\nqePIjNa8Sbcl3iM6DHyibcAW8YhNpYkkPR2ziy2JcN2XeV8pbpWY/8Eo7uST\neogv\r\n=zt6d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOTrIrADWBaayv6u4r7qQg5biHlMjIfDYlPsJWJn0DawIgWboxKSPhuP8ZdBqK7tw0YphYOCWCKOWXoX5Kilon7+8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.21_1606986519642_0.23982139432034133"},"_hasShrinkwrap":false},"6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0","gitHead":"766e7ca3168d349dbc9fc6b84e8e2599f6f1c494","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZaB063ZJxXEMQFgcyoCtnV/9QSOKlkIUb/mD8NnxdqDdwRoHLSVbq/iW9xgJgR0JhfGpCnTNZa5X0S98b5vZKw==","shasum":"5bc0f64e2ac6acca1169723a830c994f6b67219f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKs8CRA9TVsSAnZWagAAHPsP/3dXs8IAGcJK7uNYa7Xw\nBHAib9EpuSo5xRgQJuoNZfpDkE0mG6CcHV3BMeC8aYCYrCX/I67rRavznvFd\n4pnImv3r1uIiaFSBPYG1b2rhfUZeTMJOu7Pnpnk7ff8AvOle/XinHdMC2bOP\n2QBaD+ZZ6JkaayrOveu9J7YblKdJrxYFoM1bwPuimTFEpk6Woa84heOAmVSG\nx9SyxQFMHQdl7euYRYzWKH2mr++k1AyH6jvZJBmPxG/ueWY5kIIsXhBGRo9w\nRh9Tmb6bdN7v/CEQ6te5sdzst6Q3wUqVPHZcnryUWqdK65fc7aSBFMBnE3xM\nwD98SMSyOf+Wwp5/drCHbEBh4HQ7XL6tjvKZAmwYzDcFuvPyXv2vHFCrSnTu\nAWry6xfMHjQ5WJRQT+K0fBNrkhAThXjuIwgLcrS0JrJXiPFfUWWCf7WGXW2t\nYzwsZfz/kY5Stij4jUOeWnlbL5wAl/z/M4NFdphMP/cIcla4SuhphUeIZIKp\nzMIqzPfmK0uiYo42pktfO5sl5RcTZx9qLbmXbWXrea4VoDlitjhdqBa2pM9c\nadJ3wEXZNtsRTfZLaTNWsOsNHcCISJmAuOwbRS8Z4PTO2c4/stU2pRY9cCaW\n841d72oDpJ3L9BN5Acg5z9e7P4tvvyUp4GLt396dVv03tQxoYQEuMU5z9Mjy\nLARY\r\n=YZ7A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHqX3kSU6fIujGYduIwlNxEIKRNLYyCVLvw05bGVSvBwIhAI3qXfCxq0s5q4YYf74I2ONiVHUeiHQVVBTxyBPhjnbI"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0_1606986555629_0.6858405355737169"},"_hasShrinkwrap":false},"6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0","gitHead":"dbf95293af5eca3a9ed52d8428772a8a3f0193ec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Bu/HbX4tvZmLbmBGKUeUbzex19YuUGUvTcghan03qbb+t9Vb/jH6/CkQqWB8yP1uSdRoxMgcEdip9nJeBEeP1Q==","shasum":"7f4d64da5812b87e610ce11c981016f7e0c58442","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKthCRA9TVsSAnZWagAAeTQP/iI8uV97igzCUIfoVSxO\nQ8frea0Zp0xN2J5ECRaEmbXSvuDTcfLwooBQnou9TwTJEuWPgL/RJfcGdKhU\nWt6kGxRshXjuElCoUcUVnatNB4LTqmaDhGEGbP9J7CSXuU8zkxUqJmPHWxXm\n48MkyXmOxWQkMgh/1Dic/03SI+ZQzTybL2lx0nnGBmODD2EyAPgu31OHIvpV\ntPfh1tMGAc7RwLDEIKlnJuh/Q2N9sxCqiWMoNzhgmN2cV+eoQu2aEaF2Y9qJ\nKQ2B4wsdFw+3rWvaQ0jfMQtMxOS3bU/3gcKPAvbZOfG9Kfmh72ydNOQH4evV\nYESYFDxNBh4ysbj5R84HiLRlvrvy9twGAgymhrRkpYMO5EbjY+rpO2V5RNcn\nZwGN47FuHWhljC1IqUzDo+rTw3JtP/jq4Ujx8jGdZCf93psfMPdsianoNt3U\njFplynjW/qDM7yz+Q8tJKcXt6M7CDgl8TUgykOeHTfDhLWqGH/KnfdXiukvi\nKTkLQVqnpi+LXP8ik7KD5KPHVcaANvflZc4qhyltQVKXrSSnXBhrldFraMnE\nmhAPkW7U0SxUbeOWkMzEti02TjM++1U8Ff8Mk4zJ5Rc/9VVdzlztLHeRrWLx\nFlo1i9a618xC8K8mCafUCk/Ayo3yJdcR1PG4bZ1TnYZAguBUuenJKYNO4NA8\n45an\r\n=M2hS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSPfgC42dfRJLZnratC31D1+TU0EAORj1EXh88+t5FKQIhAPeSmmJidQQL/GQ6XHU++m747sBz0pnLAYA+ye9LQtZe"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0_1606986592875_0.90261699814086"},"_hasShrinkwrap":false},"6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0","gitHead":"58057dc9328c6215cef5aa62771ee10b065e8939","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ogqwmFHF3RtfZUuiJX/FwaXm/ZNOiXTdmqsShpu0PoxHG1xnN+QZrTPzdp2xnGBu8UwkDqMH+SfZjK61FzUVCQ==","shasum":"829c34a9628a35995e971eee183de891d4da8799","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKt/CRA9TVsSAnZWagAAMnoP/jOIa4tjx7TGV6f95SIA\nTk3io/lo27pwhctddWGE0xD9WE9vnYO1RxI5mcaUmHONUS4ZsJmYW6hZwrrp\nBOzQLq/ih6lpCUGA1zt+/gH3HRG/rLWYfTBss9oP4ngU/VUQChBSAMw5NlQE\nafDzl11o65izIPP/KaGtbWjoxizaYFf8a+a6iygMNfAsxfyXHzSoome7pwm0\n6iByNZpGB6aEbK4OMCplHObKgfPLS3PYlfZ4U9DPhn65ZNSdh+zcAHDVVX3L\nGqWET1HyZo5rH0NUpHXfl+sRHf1j7d/ZJ+hIGyE2vCbbf8PfzG7BdH1SQlIV\nPyyxBBh6Mj7g91aXByos5onAGzF4seCeTQl1n+3PWH2ETN6odoMJgH0O+7V2\n//xQiExGlzKhKdqJQPrAQ7nk7Gmegcp/VsmqzIkPh1VKDYwVW774LLvmu8Le\nPiR97OjsrBwwIivkNKqNoZ0pd7fiBtUeS5PNJ2MF78IYr0y3smo7V5OUaRXF\nFIiactZpeUKcIlMOJ1v7mW0S0hUMPzTTp2cMRMJZVjgkUwwS5VSpoWu0MN4w\nubMd1lO+h6c0KXIdI0GliG/DnxQxShHCsevCUL8a4xcXmnCOca/hq7UesasY\nlw92897EKNOsD8iZaND4v9/O86JsakEPAJevMTfi21tAZWaMlogtk46MY/Fz\nicYn\r\n=fSke\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvPxasRYJB3k+LaqDpG6CqhnrwqeGc2xFi/euTYYkonAiEAwaKL4il97Va1agENe3pMKrfc8yIC17UMf1KeyU9cNyA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0_1606986623225_0.5746564574228734"},"_hasShrinkwrap":false},"6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0","gitHead":"71fa4732279fcf1aa6714556b041db00c09d3e65","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dlXmR1uaYS+2yKmID1ifhnerkjo4mtnnBQjR0HOgyYoeyBOyLzXerhlF8ry0bRC1ZqK/SxaGh+LpJszB9KL4fQ==","shasum":"dd1f292a68fcb00b5ea979e592800848ac3e4773","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0.tgz","fileCount":39,"unpackedSize":230394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKuLCRA9TVsSAnZWagAAtroP/RjTWflXHI0Ji3FcRhHr\nu20iP3F3GAS2zmRQfts3RIFF5b8jAKNWHolhg6iOQ6QsYsrnuOrljV0DHzSS\nnbA6yA2RlLBIyxKRPOcmRYtJEyPL5RLbIZ1YReYHF7w1jDywqQzYPM5bRpn3\nufsf04XwV99wIat1CUFRo+QLIVOhiVTX/a8v+IRTN+mXDANQpGngQse2FdL8\nH8CGeKMs+tN8fBN8q1JD96RiSC0SMnAZB3SVmNeQeG1/hh78M2xa6rYHQB0D\n2lhzK8Zu4AIcIJsRQo2DC3DwimUZ4Oit5mM3l5cgKoymYK2fCwnnsnET8kmD\nakVkbONiRVIbTBMX7h6wj6cWRCxIIzpCIXHwdBZNm6C8SjrcciZjR650q6Y2\nAIp/+xbVuNAgo4dOjSr/sAkcqJ4iRNATF/TMN4KNcNcaVz0zuhHI0wJtjeux\nx2K9/EnLleHPh7I6mz0b4/Pfgnstlf1iyDOKpWiUh0om7u2MTzopDFFMn2GX\nQJve0Y+cbB1W4g55Knylx9VBOLQtuXkeVdG4iI7uuYGwh+5DnWkk3iFkklZN\n+m2kaAm3ioeUsMAr1SsNKlTMIgeWZFoDQGjMXIIXKoXTcI2u87p/7hqBUGSq\nH8kSbwq9OiZAuxqbnOrVbEZqLNkBVCx9abeORkPdn02z563t3S6crNmxuhKf\nkwC3\r\n=iisu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpZQB0+YEoeLPyOp5kBI6sQshJy4wgP3I7Ygeyh242SQIhAO3uUahFWNOMFtt2zXFa3O7IO8K33OcG11+58410WMX3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0_1606986634424_0.4814507784014046"},"_hasShrinkwrap":false},"6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0","gitHead":"4010518fbf0a99c6aeb91e08a26db2435741fbb1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xuJr1Gbz1FdPCTpPed/fqVz+Y+/jxCiiFsSqg2aVvwJHe21gnjqJwjg9LqM87oiKsyZAmLG4K+oXzB+VrMWDjg==","shasum":"50650821e365a1a96126153404c44ee44b2aace7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKuYCRA9TVsSAnZWagAAQ9UP/AsYsoMl8exAVXxvosn4\nn8Xgfy9f61ASD0bQqBh/3v0L8KYcgkq6ehhIHZ7O3pR9EiQUjfX/CchjHnPu\nIbRV5qKckrsKv8aGsP7ECidUlXkaq6kIQnszGfZXQJ/kBMlX3DBQSVzHt+nG\nx0hZxzd4tSOlOTZ7/m4J8XCoMOy8SRixELgDTvi+wWovsOoDHUhMXmbFZQZ0\nObkKaEa1aO6ipf/PY1owWQZl1izDqc6CZK2kaSgGvlWaKaVlmERNFiKiA8po\nlepRCwDiSzH7uuaYBQ5fb6kldDEN63CKW9N/1vADqqVeqxRXaYhnipPiFNtJ\npNvTBoGWt3tJsqWw6W/SH3CUQuCMOYLUZWA7m/tRYiUsHxy4z93q/sbwJfIO\njsBWO01B+lrmziXGL/Um49HUBvwlN2/BmgYnyZmKIZLBREpaog2pOFOCF0eB\nB/qvpszKq8SXo55MjZtUR0xEhxl38QqpFsnSStjWX0G32TEFo4DgNe0FId0i\np0oLtbIDBq85vN4Y6li4rMLJsdoMEUi6ho79vvYm/buoQfBkO5pmWhnnRuGv\nKrGFOAHng6JJZ+GF2MOf5FS9fHhgNVaEG96oq68Rn8UbOQWWLQPXFK38Wuab\nYO4jp7YgF4LuqgxKKvbhGb6ZWJhATVf6zu0G+3Xw5I6TEIGT9358GMlbg/p2\nqNyN\r\n=Y2uv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzeqGCg5uyjLef2+0I8NlBISlWdXAdm8MLOdme+/HR6AiEAoie3TPnsPI7neztl/4f658S67l632emcJ6C0BGLLMfQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0_1606986647568_0.15774127981176544"},"_hasShrinkwrap":false},"6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.7.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0","gitHead":"42b16961d3a6cb284ba946f5f3ac0ff4ab27710f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9aGMPe48EuGr0GMp7G2sS7QOoOAnojwCD9e8RH2eA90bNXkZQKqN1vkIR3ZKzR5MBtrgEKvuM1EZJnnLiLsaEQ==","shasum":"16d0a47abaf9658b6d4b01cdd8cc6f6daeaa27ed","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyKv4CRA9TVsSAnZWagAACtEP/RIIta6T3MskEUf4AoV2\nzK4/dKwVZuv4lDzd6TJktgdL3onrIihkGKK5PjLX7Uh6shcckkjxplx7R8ei\nxklbHImdRPVEvY0h80/shMxAxIIgV4g2l2md7t0jenaldoIPRGw+N0VzVStX\nsCiL1oLPJST1Ma2/iBZBKzWxv3P+IPPbZB5BgxNcXWsWihl2j96C39sadjJG\n0FeH5MpsoBVBNp9npFr6GHZCrbCTUHadiQ2JGOlWs/vNhbdHezOW+WxWjOGe\nGkPdJFuwYQmcWTjvO1NMuALCKhhEvT9+xW8vVzhHDCPjfPmD0uoyiinjjzGr\n1ZK7ZamyPaDEStKTIKgIUTGHprfMt+CCpOBWLAdp7zBMO5PZT4+uvDqIvZX+\njwW88gCU257RJcNN6XxSlzBsh2IIrBbqTHK5bkwLgmTqlRRsnuMgziN5iN2G\nzcuEROVp76vbWLMU5eqA5MSn1y8ajbgivo1S/RaUsdBdd+3zWP4g+t2YmvQl\nUmx+yZ72uBjXAY338w2iNVR0LrLEdTMSefgvWrOxq17AD1BqZPTOntRJ2O+A\n/UUZimZ9TN9YpSSHSEC/H96PScgdWgRy+zlzO4/oPBkx+kr6MD7cDVt7RnmC\nOZ05isWVGMWq8O9HsiQtO3j1WLr5lBXEWnxdJMyWkVaVYA14tVjFss10AM+N\n6+rm\r\n=luUD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICp3j1VyLcyssnvOCQnrVBlbQOpBF4X85XKjv4Vhj6KiAiBjLypXT9C3566U3Fm+Q7MazbRyEn5x6Xh/hGAiAAOESw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0_1606986744342_0.16593305384678336"},"_hasShrinkwrap":false},"6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0","gitHead":"cb138f5d602702ded42afb62e216b49b5acb7a2f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PCGY2zlTOfqAnu6yy1kr4if7Nlf0sp0etuJoInqRUekvK5OuIeMNgZ/GsFtg0hNZ5IZXN7bA60s+57OUKt0hQA==","shasum":"826b99362ce2c7b93969a601ab92d82abd2f391f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyV+uCRA9TVsSAnZWagAAw90P/Rr/Fiqc+YJE+7ShyZxj\n7IK5baNHj4chI2z6Lg8HU9s8J8S42gQN45Zn9J02unatmz89j9CisdnL+LXC\niZPQcqtmrMNT2TKhKLK+rJyWtfe5Ye5a2/BxButZvHVlN0dq0DfGVQl6EHTE\naNMB8vzirTaGufgEZJYg4qBW4rx+iwaCGLaRD/Acrf9gEJnjzcdJELknpuul\nh6hfTOniS5ZK8EcpWAcIPgQQRbmoUy+6ponb4bUi6FhSrWJpxn0OH8ncCDIF\nZpe8VpMHFAQ+RCpASS8ndlsIWjSh9W1ItXACSql6NUYSMdPcw+uErUmVUVUQ\nvSn9joMTQEfn8Sz2RsjPTdIzT1uT0TNMIbtt7Hk+e8QvZpQW72e4ltPzXs8T\nL31Hv7q0Kv2bdbL8xNt3CfppoOd1hLoojMX083Ak8kPSWNGnMAcVh4VbmH7M\na83FLX9qrw/vw5WjrXXAVy4CumLyZghQIj7G2fVI74z5tfIMrUqW9Ang3Aeb\nUoFzPMGwEUsFKoIFlKwR6bizbIwhhGCywe0wY5694tXYEUnwcLMo9rA2jl/S\nDzVu9ykti3RkrT9pH0cdbQ7Ckrf6v+HCNs/nMwiLS4FtPldUekPGj7EiDnWR\n2jlA9BMCcriJXIGKKbUxJdg8MMqDHm+yztyQvm7Bcl7Lb/ysU3w9QuIbyrlA\n4VIq\r\n=27uQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDAHAjui9PkC+WYua2Yz8i5PAKqb7tyg3P/E/9unpugRAiEAxRobMywkpvkqr82duvxuG8DCkyQTZzmIiXw30wY45eQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0_1607032748990_0.4395236564034075"},"_hasShrinkwrap":false},"6.3.22-2817613a29954c0f482136211483513892ca68b9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22-2817613a29954c0f482136211483513892ca68b9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2817613a29954c0f482136211483513892ca68b9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22-2817613a29954c0f482136211483513892ca68b9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ROTJtxhZhlVFrQnis1HhJ93me0nmoWAAI2DUGLeybYu85WqlAc7KaErhR71EDVdaMNtS9QJkTeIRRpPuuo8OgQ==","shasum":"e0df0fe544f820b5b0b6c75d2e9388ccf0f41679","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22-2817613a29954c0f482136211483513892ca68b9.0.tgz","fileCount":39,"unpackedSize":230035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWADCRA9TVsSAnZWagAAeBQP/1b9WXj8MV9bOgPBcmyl\nGk54hw3jGv9vyZgpz8Y3eMzVhxKGiuCxEEiSfSXH001HiQbscrNcK6CeflQj\nTqCii/sCvNNgptqDL6b2bMhTyiAimxfDZEjdcbnaPIvKcc99u8FeMh4lNG6b\nP4svkCvkomDA9FijyYNkAM5akBo7LzssD+NiVbq4m+CWPdNFGk7Ah2A6Ivme\n5a7WNRnAfLbA1VEcUP8Vi+OrYoikb7IZ2djdKu/0ttTsFc6IoDuvusvEkEol\nTb6TbQXKKK0ZNqsG6X/zgOtcIoqTOUKxNWK0r9PrShD/HSVg1gII00YNMylh\n3x2duJCHc4qZdBfLpV4HmxVf8tReZdEobY4wA2WkE7Yl/FJBOn6W7/PyKjDL\nLy21ZjN6Hs8+yKeuFE/rp5YCHgrOTxDqMLkqooMHDSeRD131+boEDLCCHD71\n201Wv9y0fWOH4Sh4iKPy8GPildhD5XAj5GvsZzqJtGMaMFpgP6mMjG4UMfol\n7Bat6UcXfWEzaybpkkhHXOlDqEX2wMm8Dmwp2AkOrxlkJpolgZwS22KpyYfx\nomIN2+28rfAT0fl6gReDGxyuaLOelyIo5S82hOjhic0HtDSrlawp9QE4LW24\nmdZsHQDGOkjei/HflVLPxwCnR8+3QCIoo6W1Y1ex5F1D6FHKgO39eUNK9x72\nXGnC\r\n=wtwk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRX6PVYqo/mmptZlJOiw3zUSGhKQKjY18BZmeg6DezHAiBo5Th+9UZljBqgBzqdaVNsIkK2MWGerbDdziv1X6J6VA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22-2817613a29954c0f482136211483513892ca68b9.0_1607032835263_0.5882819191540318"},"_hasShrinkwrap":false},"6.3.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.22","gitHead":"34607339a10e6ba666edb2efec90fde9fa852368","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.22","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yNM2YcNLthQXF8LhA73E4nDgiVYVdPnVsYR/38RPPWUVI9UQ+gsgGV5IMuNnAwMn1Xk4Kr+F6GebVuprnY3c1Q==","shasum":"48afaca064c259ffbc0ec5dc6c8e8d34e704d072","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.22.tgz","fileCount":39,"unpackedSize":230271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWAaCRA9TVsSAnZWagAAuVwQAJ3ONEjmhMy/0PTu+qVQ\nutGZQKEly5GfgVDmVZ6VQyzQbQIDo3zenZJSCZoGMt0H+0eV+S6IsKgTHc7k\nwQt/gzFeRYCsFVjrJcdASksccVJTwzqmUfGd3naNUeAbfdtgvQec1+MDpL+T\n2U8BO+IzGXzIfDbeAu8e5mYaGTloORviCBbYVdt7Vyb8uudcVguIpNUKcy0L\nwgaEM7klwnuadcVqhhaXlmZ2oRfEdLmPvMLF4qAuNXDNcgJ4LqNxX+74ACpn\nGmNeWgyXEBzMWpvUNkbPAZs8VQ13p5bAuBWQW/KOVs2HCXpQNCP/iT5VyFmg\nQ0iHvDy5CHf0OMua+bR+yA1k0VceCgkoH5c/UWckgAg+u/cPb6wKsSC9v6Br\nfkeOreP5LcQLz2/qhhfCixgp9yWh+dCM5DrwLLSfoUTsNSflA7csW3G34V0b\nRdoltjuT+obiADN6Q/7EObDGVJXghi3W4yZwU7OIPfJXnzy3L8O4RVopfUGW\n6MEJcHhaXwPIzAfBQtOd9GqACL1vG84xAi8dJIyQS2kHcY0AkV6sq5U1CFYv\ne3mp2Px8HlMEjywK0tA7idMDrNTovKoJ+Jz4hQKJGP61x4EF5xaUQOYO0IZL\nluA8KyNZwdy99ynkB5tCNFvQ2oAaGNPzNnnoNWpNu5h6U9LSWg75WgffzQ3S\n/lE7\r\n=eSXb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTy3Fg38tGMPoM2Kljg1Aopth2pqnx5zpCrqHZmxDXKwIhAO6l4KuPbLWUaX1k6q3jJ4oL1BSrZdK6RGK54OSSi2VY"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.22_1607032857725_0.2659010653452154"},"_hasShrinkwrap":false},"6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"34607339a10e6ba666edb2efec90fde9fa852368","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-q9m+kHqHjfVSIWpGguckOERKUYf1ciYWJs2F7LL5oePVi76YM/geMoFe8Yb3sxjMWCAv1/dSD6KgpwP34cSQqQ==","shasum":"bc1c2cd854de6ee8d498cf8bedaa3bdc6ace64d9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0.tgz","fileCount":39,"unpackedSize":230314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWA1CRA9TVsSAnZWagAAGRMP/A8GuIeETIhNi2wCa4L6\n22y4EAgFfs+LgL+RD/NBWH16WNiL4Y6YVy55eRbKLnm2Hp0wBnBh4IjOgv4f\nP/qEkrbuDUg6j5FMemV/kz4LZiT55aeB+lwn10NhYf8CtbVJvK8y4pB9AfIe\nIq9SAI+n1gQiavt6v5MLGWrr0lwzg5g15f6g63e5jxxWxoQcqFBOeGZmqr8L\nWKyRYtcjVIdofwInlqw5NKyufQpsYmBWo33Sxsic5OxrAuY2Y87ljAAiW8QP\nqT8/X30MC2XKOv+pyeC6IYSgOPVzghEZpWmwRprCjd3TQavf1Fa6+TG9udJD\nSn7ptbvO9qyaqT3ZUDW6d7J7dJ2vVlLRDObvXO5BZKuK+UZDQiSpPfhpLL7N\nK6L6Kffg0DnsHyP84/Dihk8vSk0OTvVCgCXQACeQ4aM54hqnniYeazSv7QzC\nDhXr3xTA3LVzOm3qJeho8dD/XfIN2+15m/nEeDjmZWryG6MiTbIx7EoWC2Sg\nS1f935rfJX6xq0qpt5fTJyeZAqrBDoMkTDbb+Sc3ICaq2G0AV9LLNQ+vzUS0\nOcQoachWCKT+6AhyTKOgYQkZQMzXOzW+yFf4V44l6ejTnxXnayYKpKF/d4FN\nLedUD6E+OyI4W4PQ6Ua0ZkRIVQa7IHP5JEMCjc4yud2D0yJF7VIvKzBJpsuM\nt8cg\r\n=2SS5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrb8At2nH02Tj14cIZa0EnfV+Mpx5KZMNg7Pi4kY8cyAIhAJDAr0NQbQg4Lx0wdpZBsuafhoQQW2vfDAjFd4+hZUbh"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0_1607032885067_0.9817102673298885"},"_hasShrinkwrap":false},"6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0","gitHead":"fd5f17899326ace5dbcb71987dd8a456e0e6b5c1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8HfDtiEJqGd92MM2FAiKCZlPHOJWSfQCpBb6ToHuCuazezEerGF67ujKNtKQ3TW20PSLOhYteVQFlDeY3v5nZw==","shasum":"90d75f6e5d4005e01f7c2629f6d75f7710962728","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0.tgz","fileCount":39,"unpackedSize":230314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWBYCRA9TVsSAnZWagAA6FIP/0L5EWdko1si8RIX2t8N\nBHCCPuI4zTGjgB6ItrzlRgYY9piwLwX+cuz7aCR8w3fDGBbJZlFbd74UDwO3\nmpA/QVWbP5xoSV/hFz8FKomrgRhm/c8oiI94ZLK+eoPcJrLQySnw6g7XEF1s\nv/dmPFVmIWopRwemKwl5h6t4q+xOKt0UO/qzteeW12FNZHaHYwU78/BrV8Le\ns68E50Y7wT7ONCbpMNXeAQzr91HyCguOodZGPGBCGWPCUDqCdkPcyYHcqU4f\nCq3hcSgEdz/SrSDG07Aex/Uqfoh85pHLOQSVEBRMI20jACXQDV9ZulX5WvY6\noMiQj/COfRBxPHo6SiSEWpSmLMqwCCBueMIjHbNKgrpgtsNV3C22PfbdaYfO\nfCprG+p1p/alVhrVTVlAfSzbviINkJywhRMnvy+mumZYmjpnNb52CSemYK5u\nhntguyMtqeSFeh5cmMsXBsBILIDcrBXX7vdcSEHz/H3JO5qXhcq9QLr+PxaC\nel8pQZHYCSLHHRA+t+jT6e56gZxiyFjc0Z8ePdiFm4JS5fEpowZcRq93l9P5\nNxoUtCzSbYFXrMfc6NafBhsPG+G3SAy6PBMovC1TttPsJZEkdkYekS8ZM8/N\nJusCvyzUZ/bQwlpyITTXaysg7SfVYUSCXVbJU1daQhRgSyqnLaBTE7RhC7Ow\n49Ug\r\n=A+Ax\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjRbaCtXYNe7KGuNfk0UYW8VORkIWdLG8Pe/FoghGaUAiEAl2lpQD6UiR2jJ2KMoAm//olhGi3SAmszdG92iWSjBdo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0_1607032919731_0.04110631299456102"},"_hasShrinkwrap":false},"6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0","gitHead":"acfc8c2668aa48eb5ad890f251e59c000b20a0c0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uHHSmvnn+AyucVM9gpeqnQU7gl5rpi4d39RkD0y9syUvCnGzulE8tEhWUcVhdooTRayNlwD2L/neQkkS+opvMA==","shasum":"9875005c9b7348aa9048bc318fd56ed97fccd09f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0.tgz","fileCount":39,"unpackedSize":230314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWB+CRA9TVsSAnZWagAAAUoP/1xDpqJKYN+bNaWKmM49\newRYf6ftNsQQc/hOOgIFesFz/IysEgCJytTBeYDE60P1ths6b6yVVC5Tj0+k\nEnTRiqtbUQc+HCbJ4JQVwPw4qUg7AOsGFLHCte/hwMWiESWJd5hTlzgWCUff\nxlWB+omLd6gfobrUUeaD9GHsoc2EsgJX1svzSYWeGd4AuhyCptYeER5CQyjN\nawwDte4oXP44o4+l6WsIyx9zGsd0FESKC5OHn8eQyMrFx1Na3lC98cpIM7BM\n+EOX8x0hRB2+QiKySjdhg7gBojC87ifQPbmyeJ1PPrVVW+TApV2lLW/05mfQ\npSnJMbVjzllNfm2Zq3Uz9FXRVSVYjId1xvUlJ/InzkC3BTUMuKEHn9TPbrh3\nhX2TEnetmwdVyrl/e/3VYHzpIsFZQ/nZQVWvbBwQqhEGyL0fmq/dFjwjFSmo\nF6OqF9jVbX7Lhiyi/oBad4xSMM8PhOb3C/gvUtJHVavXRJcOuVaqtiUN8nAk\nlDukn5ya6JCZ5aPGde4bNHGHVK7KFqoBvqLB+bONRd2NuAx+d6VTxAxNwD7G\nlqdn8tx1y55Ul5apYYohU9Rpo42H55RKXtL/f3oQnoH5d4CLWg+Pv+mBzfvF\nRGhQ793FP4tOHvbXNVNwc70fG35D0NFOh5HwviQahRrvmI6mNKkP8HDIywMo\n/Peh\r\n=76uJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC51/CkyjuzY7SWCKXjLw+Z3f4efYr11OoguyQ3/Ub5ngIga/PtEhxgtRxpdXqcrGaoh+aJU0SMxQKux28x4JO4si0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0_1607032957612_0.171619127643311"},"_hasShrinkwrap":false},"6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0","gitHead":"a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+23IDQbuhx2VkM7GR78waIOhgs2oiFh+xCC0361H5N9IcTcdBh+LenHTQvbfUiQDx3AdaoTzIy1U+eIwWuAfQA==","shasum":"d7f8ac219577aa322ffb33905f4e187d3e173f9a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0.tgz","fileCount":39,"unpackedSize":230314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWCLCRA9TVsSAnZWagAAw0MP/2WgjiXTKqaPs03X9CAW\n+mPkC5PmKQXTmypxopvf7+IsZaRaS9wCj33TWsjdbRP0xz5Y8ywjtm/ZCVzP\nJHGgKHc7jF186tZ65BHYnNl8AUq82ui7t1Apj5BbvbQ37ixNNBvL4SgCUCqQ\nhcM3C8kG243f40I8R/qKx7jfLRHYLwXrDTbqKYao6OzvaSjKOMA7svC8+uAx\n8PX91MghvvuDszHHEM6P5+o57hIMLSnOrGK1YHxtPOzsLOW3hT9Yfm91Enbu\no/cvWALIgNTiQV4LYbVPQ6DYzKDbWdgp6GNz683rdsxpMmWFURlWAdz0TTAp\nywqae6HGpo7otiIkIMXa2mr77KmnqfG6Rn+QeueKnfA0fHOm7ylSsCE2qPc+\nI+Sptxeo+XPN6GS8hsSfYVnYNGfKhNtE7XoSwSZN5VmhMVp9RdB6/vxPAaRm\nb/h8roNHoxs1tuto7utPc0g2cqsNBHanucGOKv4Y6gX7EGHS3mGPZVpYPI5W\nsRz+ueuquiIwnQtwfx9LExscg+c4Ix7FYDHS1LWjjnx29qv97fD97QgkGg7y\n7p1bqDhsB3joy3bTkE4hEgFAMT/Ce8U1XbjMyxdbzAdMAN99XAMb5X2EJib8\nn23eMuP3qjpaNFbdiSoQcKcjYz++0Spl5KY7Ixm3OiTWrutJznSJZu6eG24z\nwjeH\r\n=X9nu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz+INiRyX+4NE1NyQlz4k5xInOXEtSTT9+GCZWXwKHUAIhANbyQ0ko8s5tRB2W2hogB/sypGrsxeg1aIPvWVG1Hcv7"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0_1607032970827_0.2019759278224178"},"_hasShrinkwrap":false},"6.3.23-87fa86253964706e2b8320377c97efff46bef503.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-87fa86253964706e2b8320377c97efff46bef503.0","gitHead":"87fa86253964706e2b8320377c97efff46bef503","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-87fa86253964706e2b8320377c97efff46bef503.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jMERDlpmyR7QWlbJKngimpuUgNtUuS77uUwxoOl8spylZhN3hFXBHKx9L44CfX0D3XxvR41+g0y0jPlzNsqdww==","shasum":"a781e281fd02829941003383631884111a297ce9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-87fa86253964706e2b8320377c97efff46bef503.0.tgz","fileCount":39,"unpackedSize":230314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWCaCRA9TVsSAnZWagAA1hoP/R5j7aAD1lL/oU/Mg79/\n9FBNESx8581oAJWjwdpS5PV2Q10z0zXiIQy98nWle+BVqoWRmUvZyXCfvCBc\nlOQ9b3GVpj3qalvyZ+O07mFFuiYFG5hcY3eDmGNk5cRI/uXfW7PYGokUb6s8\ndGm7kewqadvPtCmB+Y9+uWpdm9mP7aY/aU/uSkZlXzfA17ElWfc2y5a9aCbS\nCtmSTMREyvi5KW6Q13E/aMbOV2nGVQ6cjnWaUXtkOAJ4H17Oxw2Rv5AIlcvJ\noTxU3raeJk2XpZ+Q4Xf2g53HwWTWZ9UqY3d7FepgMwUFVBAbActI0EBgciVE\nsc7dpUlIqqAxqN8rd5SDxXhDCE3YHigVFyigk4451FqGlAuolLDtMls3sBP1\n4T2WooUx3vm1DMU+FI4RfkNeYU/8UQzoTA63M6dmsnFGMUwn7OgDR6cpKCar\nfeiuwqfu53QMi3VKmGe2ACmvc8bv8I8vchzsyNoiijRfq8KCQ9aiUZXDEjwG\nifv289LgxGtogywJg7goOCbORBZE1qeoXIROEvNB0kG8i5Cky757F41gFs6x\nEktSzELfZNmj5Bkmj/kTmYHS+yeunTsJVWpQjMSka0sPisHSWiAH3ILUaF16\nf+6itz1ma6mG9YywwUGDcRJHseM65a6o24pXzciHqhavrYUgKVBJEstcA9Mn\nKPBP\r\n=sMOK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/Br9xDzvkQCwrVUrpQaPvxPyZ0L3I3A6rm9lqJp4T8AiBQrgfmdHeLVyy/h7nxgwVrzYumaNwglgtxQUWk1nzdDw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-87fa86253964706e2b8320377c97efff46bef503.0_1607032986377_0.5522643250403878"},"_hasShrinkwrap":false},"6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0","gitHead":"dfab9189ce6a6802a8efbc82a65d37f57f8ebc19","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OUYG8TXMOXJD4w55hsDFgVDGC55uUvxNS11Vh95OweMdFQoXVZ3dAKxVKk9y6EAwGxeo+AJeIG2dzwNug+A+9g==","shasum":"b27bd9c289f97d90a54b512fe719fac992c504f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0.tgz","fileCount":39,"unpackedSize":231285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjG7CRA9TVsSAnZWagAA/+gP/3TpkxBGd75Qcj3wIfAp\nyvAJAFtebrE9xK4JYDcKiu0wVsE5uC/MEqrR0UNOQ399oSMge2lZYhv6vazG\nn3eHCgXRtD4N6VYbEST2vV9ic4X89svQUnge7Outlm2ynrj9xuWWyM5Tr6/5\n13SbNeuFfDMkiByFBhhBBHi0bT9lBjSrmxCAk2eiKNbRI7/INS9fKIAWVPJO\nOajNVhh2zbH9Qd8g5f+oQzvnmpYg6loBNh6AdQu/zia0VJYJQbUiTHUpPgGf\n4m8pFQeRPUZv8sv97YWwTj/B7KTAkhbJICX+LufZwwXmVZwkaLn3q197uc8w\n+6G59ZjuJGqh+3Qz8B8AACgHvJ2PaDy4Gch63Ll5cb9avWX5XM85hMgA4may\nLNaoKxX+jyrzAS9fsahZb8hLlyFx1mx6olenkjd62VTnj8Lmt9cJAq8nfAaz\ntyZrInWTVXF1ICC0KWBdMSjCvEE8bjLui5Xm2/i03uJWbsYGAgq6QmBTdhHD\nMPMGLUDGoP7m6BQUfTusGMhNVWuaIGXJlTAkpicp3nSHmhf5IAzXeZslbix4\nIj6jYqQ3AL4WdFGPblSxsyyJ6meHNIVC4P0qVdKeUz3a4uESdOJ9X7bpd9/r\nSl5Xuul6pDY0mbi28m4YwEGjN9SCdeweWsPEjYlg12hKvrJBqhCFeDYUH9bd\njx68\r\n=/Mxb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC860rln7W+ws6A0Sqf0JHDn2mgnkpsZvBnfQDoAA2c0QIhAJOlSN/0wMzSexeoGY9fvdeO0nIk9RhXLSsrhLEPCt6M"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0_1607086521800_0.5633931888780601"},"_hasShrinkwrap":false},"6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0","gitHead":"28bee00f2dc70a37f2badb90739c0333c045da43","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/BMEGxawAZ+RaKvodjzG7B7Gg36FxyxWGF5mWakvgQPC+yo5A3B3JM4BzJkJR3yoMSKiRAUfCKDaZoMn+iuC6g==","shasum":"8f228848c4eb0e245070ffda029dea4895d6420d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0.tgz","fileCount":39,"unpackedSize":231285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjLtCRA9TVsSAnZWagAAtcMP/i9VDFwTVsafP1ReJapk\n1bw2mmVhmyFRLtC2uz4kM6sWa/Xpv6ugqHYrs5261+nrg1u83RXucBDab0O0\nNk1Ao1t42sTWjjfIpUKZH20BFeVL5RtW6mQTuhy5zJBwSCKrsXh1taKQfsFm\n+axIOMhDIg46heRx/dL986WfV7iP72QFgFzNfSzWGGiK8YycV6Vq5+iJWliT\ndJ/4QcYVPEOE80dv5QR5nuPy7tWIMgY+bZ6u4N5HwrNZ1DrYXXUdToIzHVxg\nRdk5Dp/g2w34S3COxOMEsTYTEVaU2+mqFUKdYQ5b9PAlwmeCQrSyxVlkmt88\ngT8hh03xRdCxtOp7wrvgMtOK/Q+E0rewEjj179JZt+yeKCduWFdOBR4qHQub\nizCNurNhnZRq2A1YTHzM3XZZS/o5t2ZaZELGJdN3iUqMgti+OC4fwGHtjq6x\nneL51eXmy92EFzQL1VQMzxCNa8P+6Qgl2jZO20gY9PEmuhWHf68spPoHjtXL\nq495A8i+GYP/9CKHUHP67EzrS4xRCEfiYu1Y6ADsnIe0sxFhzEsKbgHic7fd\nUZB7u0eUJT0A+IB25k6SM1XOJt2RX7dBzdvYvMiXCTgFxZSnkGaAuixCwPuH\nJwutTyfYvYmog2e0JvBjnasliKS3judPAOOjXd2HyBvqdAtM9xtb0oUlCkCD\nTCck\r\n=AMoa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvSoRNxLFunzpC8Ba7gcjwch//WEV6ijKKG2GYXFOrcgIgYdCCTEnacYj9vh2q4UKLX4MDScmSpPks5lgdUcqHouE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0_1607086828475_0.4200042173513736"},"_hasShrinkwrap":false},"6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"93e35c129bdb7d779b7d35dd958b995825ba7de9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NHngvquVQf8AWoWFV04YQ+xjNowav7HLO2t0p3UgB7y9pmZeLt5K57z4sSR34GtLGdt4qOxZ7FGk9xWQox/E5g==","shasum":"797c72769de38a1adf3626d73894b09c2f856638","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0.tgz","fileCount":39,"unpackedSize":231285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjNWCRA9TVsSAnZWagAA3IcQAJ5PQlYtv1fmwE2mruaq\nUH+DFaUmHo/Ht3hALgyMQP6L67R0GPEWsSJ7jGHb6puzz8g4BFY9pMMkWSXd\n5HOrMH48aMGnkhkaCqbgVN9uiOsgefUPbKuBPNA/jeVZbI2XX0wj6yEcIUKs\niyBdjUQIQo8bruYZQAjQg09JlCobHH8kVcm0klWPPg7qnMZlSve+OBUwwfaM\n3k64Me2QyrK6YrO+XEfV6Q0OB33IfXC1+a2Kjsa6MxgnqRme4aWZ46Rie+5C\nEIIAFYKm8y7AectRUvrJiD1URlOb+w/TReK3Py4lZro1PZ5DONQf7v0jfoL1\nvGaAeUiXTdWIBpj0zNsS7yqsMouyv2lPv+/K0UJIjVThxO9EAfD8FKJ+YB1v\n+pi/cYsiwoBru97vavBnyfxdNvCTrSsE7WtsKWbai4sDXW/pNA5uYixX11xF\nJCLcNHUR8JdNmVCvheq67gQsLoKF9TlmEA362dXU/cMdk6nRd092B4V0kJn5\nwkz2JGpIqph5dScRoJrUcgtnZXxDploGvQ301Z4U+XpHRR6HuPj4o3uGlnWz\nNYSvd11eXy6IKZfkoF6zb4NDqzoTK47bm2WKteGVCUcbb3gSn62MXIZd7C2F\nFnr6KZqm+d0Isghq2F2p0ltACVRmb1u06wyvvoAjnWGfiu64Fewo2HOSnS+H\nJQ+F\r\n=p21W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaBzn3iElJGt7cKyJaTfPjiD+WjBl/dj2ASg4qTpYV/wIhALmGQYbzSOCe5TmT+bpxNa8Q85GD4ktORcy2n3b2Bgz8"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0_1607086933382_0.12172328495049789"},"_hasShrinkwrap":false},"6.4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.0","gitHead":"a668a375e04fd1ee2582bf0a38c8c89db1ad6d91","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8Mh8VVjDe9dRv9PfqyDSXR+OKn2bv3tIDPmqA7yJdwyOntCqd5LIbLod8Fa9XCXRp6aGiRPhfvcBaGkoaf2+2g==","shasum":"bd6d3d09b8fb13b3a8723752f2f3a060b7deaa28","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.0.tgz","fileCount":39,"unpackedSize":231524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjNzCRA9TVsSAnZWagAA9HcP/1kxyL8LJYEh25v/IKia\ngmwrWUxKmSZjN8GHM8YIaVDPDCYQxSaiAjEEKTe7ALjLQ8iWoNaCGeF6orGW\nzHubGMsiSrPrIr8jN0WUxG70LGXfT4CUEDIAV4zgKyod986N+9l3nNRsejVd\njevFAsZIpNAF9GseZVO1MFq5fMK2UuS3/jk6CLOUusKkjT0wTXK1JkX1EVrv\nZW/8JJ3xD4mKK0MITXVPUEal1AAE/ySXbPLLrTatHxC+3svFFxZA5GgKgOfm\nLNNQxIWQ2xBbYTzziwCj6/vLh77sN2IyhiCYV1lo8GL8vlnWkYrfDlRgU8bl\n5cD1lxnS9lsrs1RFl+3o0oO3IYPqjqM7fQOvmVhp8no7DF4Fy2r02SHumIB5\nEPgO9Z+vk5LW4mg/grJQvZcJp5bD/zpPLwPOlxGjsBrIxeToXOAxxzlo8kaQ\nqHbW9A2TgiHPzXfIM0pldxVbQV9zb4tYQk/qLmzDlNId7ZftmfKHfD6AlVuY\nQJOiPZ9XSrJrPyP35QI96mmsB7pyXRpyvrFvEyCizxl+TB7XxLzJR8KuX6+k\nnKr6rNW5XxLVaO0PURBdL1ZzrwhuvpYhOv0HNyutwF9NkXBhacv4mvQfDS7E\n796Bg09SXZWz9WBftgo3L3dg9vUE4o7qsnePFk+nvaxQl2TjCkqeEXTYjNq5\no/3d\r\n=f0id\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIGQlGER4S6DivQgKzUeIs1UlM9NPSY92oHkGDjW5D+QIgfGJdKRe5SdHR53MT55YuFsA7kVxuDBnakCnDLinZ2Hs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.0_1607086963077_0.8010353003634916"},"_hasShrinkwrap":false},"6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a668a375e04fd1ee2582bf0a38c8c89db1ad6d91","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EGytMJJFTa7iZxTLSazpnR7LIYg5xqBALDjR24W7rs+Pw372CpU41jCl0XPRDssizcxpvqgEitBW+pNiPa5epg==","shasum":"e0393e874c082f173c184d47934e2a0c239c6765","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjOLCRA9TVsSAnZWagAA7pcP/0li5YwOD5KtXEnsK+Wq\nrCzjtK/qIIpAfPWzZbLAMjgZK0hJX+PuN+pKjwwRG7tNa4cgZvGGdVmm102V\nucN3FXay95xKZDoZ1y9jYRYDXn6yhsJqQMR5+R/Xa5RR9cr0/EYtWN1zaU75\nAHbxy1i4t/HXSldzl8yQKFCG1Pc+a9cTRqtBfUCMl9QEIkfbECDOj2ea4SpX\nJ/axIEWL2knsJAkfcTDvQ83bzCSAczfeB3ldGUWvrs9YUvvBnwTTuJcwzx7e\noHbasjQqZqUoGy12FqpmbbO4KgQSngTEU59xcVvpDKDkPMlUhqpD479HSYsg\nxcHqldbCZV/0Oe0b1dmxUs6B6YOG/99HciUSAFXyWFGyLufrHgEtDbSIDw9F\nRRdwl7xeRpAXdhmS+lhB/q73hnqDjPRf79LNZv/DPxNubew0SbMKO+haIDXQ\nsfnkvZCCnvg1bL4FDmIIlS61sg5XBBc0x8aSuRBH/rfFttbSuMXM+9sTlbPl\nuG0AU1mifzSUZ6MO6BzPNgMitESWRTr5dH+eRzqCaSnCj9Mn12uQFys5UWoW\nXL13n+SbpY3n+CiRH85uIrI9Zx9bqe0YkULWBDuY+IvrTpnTNXoJVPAiRYYK\nmy00EHOY/Ah4LBhW1/MGa59Ga/OHNMjkiP9GEUMl8SzzjPk1yllNj8h5a9j9\nSZFB\r\n=X47g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGU2JYV9j1/7qnhFL5kG5Y2K8AUFpXx3S2VMcP0PHJsuAiATVxQJv61z+VV04OcFEWJxv4+IvVaBYbhAdj/6irwvzA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0_1607086987367_0.055804534843568954"},"_hasShrinkwrap":false},"6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0","gitHead":"2829120f15d29ebfc8c41284ed698e08e875e9cf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HamIUDAZ+VweLeX2enuvP3RgWsd76yGKjLTqJ3MuVKeOvcUYHd3WFLdoFd2rkXAQbgk7SJpgLvKkxWU1xANsnA==","shasum":"b29c3b331953b0d54bc6e6c171ce21107841bea0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjQFCRA9TVsSAnZWagAA22wQAIOZPI1REnVdlbmg18S7\n6AsnCLvF3gUjvfPUWAfSHGf0W8eIMpvLrmzDMnU2lFK5GxyHDFDj8TQfhWE/\nIS5zly7niV0BBHit7+4yeYJA+VxcIEgovNHWBUDbtYXLazfIGFNgct8OfjnF\nL7oBfNFCj2PPMr4SEf0x9ALrnyG6n8ie05FkohtoJFEkPc3O+Y5IlDP/IqEu\nPQoiNuqpXblmiHq3yFjUQWywfvkdTX/OuCeOGublOhgeLEu18IjTSFPjyDcw\nlhy8mAjhRQEwyP+ZYoykRKHaHkho8OOXrwD3Xx8aGAlTmHlRH631NtIlWjwv\ngqQkLffqvux7As6UV7ANZden/DWn5tM7E/enZ35ddr7w1GkbRCJqT0j0AfR4\niOgHV5Ak8BRXU2LMPhRdsPyuRZCTy2GQtLSTdINEIm+4j1vEt4Y909hYjL8g\nObec+PvU082kc9zcOQdmm4+RpdtTAjsdIkOBb4N3OPwiMBNfcB1JNJ8TlO3x\nE6lRd2UAb6O3XOeDzWhebCveh/Ntlw0+gWaeiDf88WFHUFIZAazAQ9vc+5vb\nRsw73q2LR33Z0bWrivy2ijc5jwA+Y+FkqGQw7bRX8jBpUDgmJdYqYJXBe8yn\nVciYh2TADVBpomZwInJkGWhtEu3Wb+ZpX+reym2N3K1J7R/BHIdtuSxYuN+U\n28Gl\r\n=zopM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCE7E/NrqZyJxs3m7g/vc+E2D0fX/H0jpKvKAJi/IoHvQIgeXzTItyIaAnGGfJNDlCapqKhOcB8r+yZ20bm5ARgAVc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0_1607087108557_0.33165878551770733"},"_hasShrinkwrap":false},"6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0","gitHead":"69d492a03ba9aed89521593c6f93052af39b7a85","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-pR1k1feRzH726Gqe69BXK94AZjIpazfp+3hHeoXoItJcYbstXiIRq6bope16mM30jcYrH/8uh+sDMztw8OftoQ==","shasum":"ca3db306b3396e0fa0b31d44a7de2393c42fe7e0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjQVCRA9TVsSAnZWagAAESsP/ilwqydQFRtDChPxRIRd\nVAJl7066Npi6LhkWzMWEbcR7FB7DF7lxUI3ce0Jkx+llNLaeTDAXhbm8WXNy\nOMY0Lt5reXzhFMvS//E7FyuTiY7U1/AxK/9u6Ebn8AiaYxzCUW65aZ/C300e\ntjE5t4xl51PusRKzlz5EmXM6FXQHU8nwsqetCv6H7ISyQNT3puUZ7FLVubak\nMOYSI+fj8gzccv47x8RPJc3CA8MeKZtM/VGkx5IAN3i9XVoCB72WHR0Dp5PW\nTd4QUMyvM8/ImwX3co05onRVAzieKXNYjELA1obgIPl7QrSn6vXZJ/jCna4s\noOY/+fpVtytAGIHGXT730G0hVLh4KqDx3Sm4XTw6xlg0kYpG9l7OZegZ8KRo\n2ShoRZDzDQEhonFwBCiaIM0ZmoPdmnm2Y2fyIxtH1o/ABZUPSr2KsbPGumg9\nU92p49BaDq8LGJR8U9k6KI6fxq8Y7c5q5M8WEB+siaXtLBJAVnEBnWGBkZO0\nkBdOdvn5EVfClfm1k0n7vaaezZLyU2LksyI6vKFnJy6Z8HDqnjl7XKRdb9z6\nRXFnzvNUkWG2cgcOCALXikqezqjAOuoP7XMHFkSuvpfDuRZOwJnPLJQ1Pqc+\nY7ZkSuML/D4Wh0Qe9zwZ4F8gifeWwPoAIjH7rX3pRNV+4yiDPMbDelShufdT\nMENy\r\n=QMrX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxk9Axe7eAtLAAsOE3f5VaoU7ZbozvuW4zIHoGC/6twQIhAKibOXtxH7jDXRnaruJYFiExfbjYCeFAVcqVeggza+sy"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0_1607087124454_0.8015335340741221"},"_hasShrinkwrap":false},"6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.2","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0","gitHead":"5a91eb06e3127408a45c5f6375f00ad3a7b17b23","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-x1X3KMCtp79uKfVz1+TJ7suMze5Qy/kiJszNlkR76ttFrKe0TvdygArQeavbAIw1box8oaGOJQmNmO6ee3tf0Q==","shasum":"baf9b67c38e0984c7825b08abeda60d7555835f0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyjVGCRA9TVsSAnZWagAA+VwP/jT60bHLBIUMxPY8ilsU\nb2VCDke6ylRcHRQ2aFGelO58CVkJXWjireXa/CPOH8hyHX5Oylc+fY45u0dI\nDin6wYZwrKptPeGYebEvwEY7+7VgHReasqBNLL0FJkt6Gqh2MXq+gOTQ7bC3\naJsVuARaGtLCdsQB1wjuTwh1z/Il1t33xj+Nt1MDwUEGDqBK96UGLU7ODNOn\n43IKHaZ6nuMilQIFa/AEGCvlH72qs9l4+0PYHEPT2CZZ+qVRztKon24DH7x7\nxZ+B6jcSyeUzGbCn2s0EswolA7N2sxKyQ57K5uDPWkmy3XuigmJiV2NYUDcZ\nvSK/yRA6Km+WBQGvKeAPOrsBVSxD0umrwJ0RJjw5rgGcxNHBwTHkst+TriQx\nxjeAKORm2XI/OE0p/MvvWygUnt8n2RqE1OCIdYmNba7J9rQINiuY7JscMg32\ngoLSjxcPr6E+sI54zxgJ6q9tgCADAiiHQD49H8gIl+7Cr9Vi2hFdfR7LcYFm\nBk44Gf7xoZUt4xpiocbM+4oMxkSBVyH5apOEMYu08I0OXmnGs/vp6EQBgb2Q\nMspCZnADftqyg+W5LT0co0rvBa4m1XNcUS2Le2P/meALfBfzHW07+4dFJzcO\nX+OFASrsSUweD78VFP/GX6ikVombnXrSOAJx6iTsWr9aDMbT75x9lV86MJER\ng0Gc\r\n=/G1M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1BLoCLCaghKqVWWhu3dI3saYrxxXUkjsTslf/j1z0HAiBVF6f0ZjuSeGBVuQQZhi1DFKU7FzvTQqaSC4gctcJLlw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0_1607087430463_0.6713786036104661"},"_hasShrinkwrap":false},"6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0","gitHead":"ecd9b29159a66c1e2e09ba52b914b96e6ade2f06","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Kovkbxq6oTKceyrMe6pEy8L0nrtqqB2FTi41Fr2N3UXa5EQrwB/rYg/oReVvDH6YcDLSYse2EQ74UTwFFnFqWA==","shasum":"56623a74c861743f5ac170d40ddbb1930112efbc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylmSCRA9TVsSAnZWagAAk+cP/iHz/jzKd24h9CEpIoTg\nGKiwZteU8q3pB3lN5bBOr6qvPIZmi36FXGccdwZ3xbKnzgJ8Oy8VgiS/gOtR\n+xCscgTT66fN4zl9QvLAHI3BJ75tqdLN65Fst+EtZ5Pk4TCPGyGOuxsCw92N\n7/bdtASzOKATzES+BJcd670l6NZevOZis+Ju/Z2SGZ24Rwd1xVBd1YcFGm+I\njYj24rgLA1ff81stUTj+UwfKUfeSw+NDQz/lif7DFzsG6mQeLFR9IdbLuRtX\nkCAgGiEUFGNPhQWpSQ6b5LwL9rbqaW3NXHHjZn6Fw/wDyNU5/PSZFDkz/p9E\ntNCModeITFOBNmhMbpl6IEhwgJIb4hJNOxF1ydSCTMEG01zuPLhB3vXGjsjy\nkeFcC0Jh7BXdKpdUxka1xZ59XHhS/ez3zYKmuJkOacWAKtDlkLeEmDFzX7xM\nC1bvwxQFQwdkGGzlSNE9krJQGH4NNW/LXfZu2+dpBWw7vuuiBsL4uEGaEtRI\nohM8LEkDtex++O9TKQUWuExD+N1WQ35v01ltaj2qIjt5wiCtpiKuPpJnv87f\nArouJvJhrovt/FgKcjwos7JbgSq0A7khAU1ottaW9WBHkv1Dcvwx9HIiaB7s\nwrZJ159u48z6F67Cx59KTAd007uhpv7D4N9XhFKSNJDhvUGBivhrx1zytqZ1\nnjSB\r\n=2DcQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdFhaTE0Hirg7BzOHds0UVjHEQMB2V7/H2u5ecgK9EvAiEAqKaGimaDHiMnWfkw7ilgqoQseKi0goIXFtIirL9MVW8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0_1607096722243_0.1595513772217556"},"_hasShrinkwrap":false},"6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QQMPCpdjj0f9vNg/Gxa0iAx5t/3EBry2mdCYXNFPAlchhnRM13xqdkJlZLQ+xwir0bRXyfv6wreAZ1Yzn3k26Q==","shasum":"bb0e6748a06ea44bcd73288f951d1e42150e0056","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0.tgz","fileCount":39,"unpackedSize":231567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylnnCRA9TVsSAnZWagAA4MsP/Agu2Rvk87w5S6IiG9A8\nqt6Uzp9KZIAmHhIfZl8Cxo4nzhdMDEpJHAkibft9HhCF4kmn1fKNXJrZY2SU\nhKdasef0FZza1q3SDBazuvf7H9MkMXjDfzAYUfxFZ2GafR+KW4f+QcTNFibk\nhYzPAWS5J1zWrRGJS9DMgObdX3oHTBZ6Uus/LqnwExIrCb2HCrONc9ONmQ9I\n017RA0d6PZ4K31lofrvd3S3L3K/06CJScFdiPBsqO2RzeODaoUduIM1z907k\ns8u6PVP/klS3i0gzUNMEXjImEZXAIe733j+JaacXsCM69rLkhpJxVleVFllu\nQwCBo1wg3lXKl6b/dH2EVkfsvn06lk31EUxXdDXk+vHrzNsditWXcBesXApR\nOfKP9GjAT2uTNGAJl3UURyYk2ExeOZUXIkvFbpB2Zt/kfKJWUwSfszSQ8pcV\nj5ZOX4ZxT7npkPbnqa3HjFSbDv6khWIEfajqhscgvqOrl9Xn5d3XnLY+YHMh\nF2KfqwwXnoFUp/22xJxu9RnetPQPN/n3C3tFlbSjeSlsJpvhOK8qW4/dPFzW\nmPOWTklHhY9kDqEmQrsOZnBCeLlgqnn1upnXOCgRc1QZFmkEZrQC+Eey0chF\ns78g9yj4i7aDf3Rv06QDLIvCPSSDYImK67mGmQjFqn0Ipg2s4ix9r8brzfsD\ntv/S\r\n=HBIC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7jtOac3dbEHaYOv2msHGDNbTzH3Jerun4xqAYt+I0JAiATqBQlYMKsrOJWeLKZbdPc1r24o/vzbWABjK+MqbZivQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0_1607096806962_0.761579524554062"},"_hasShrinkwrap":false},"6.4.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.1","gitHead":"a59a497a1f1d8778502d4988ab12091a56d4c3ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.1","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-XJVqJVmcbtqZ9brSQ7adaBpgwJAQ4O7yv4KqpzFcX98l4FhMd2vYSvqisyrS+GoCVciSQq1kXa+ZYj9lNekJ5Q==","shasum":"e3b2610c9f34b9b43c1c87272401f65744df656e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.1.tgz","fileCount":39,"unpackedSize":231803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyln1CRA9TVsSAnZWagAAiSQP/0qfZT97pRlcu6BYz3NU\n6UpYz8wL0nRqKkqZ2K8Z1MURjR9YlWgzJn9R1oVPwTFlsd4Vfhv+fGoHn3L6\ntSrgaY297APGPo0oDnitMgShbS/Xa1uXBK/5ZgcnODA6mhWTsg9ztsOWptrp\nQWKNr9Q7eUSptR3AvTNR9VnlU27CKWw9rNxk5cj1staVyzqqO6XVeYoXguR4\ny/tUw9774uCl1FkucffhVZGDYg8GD49ZsP20xu/HjBqxY8yMz6yrhImIws0T\nMlPTwp8DwJKk6NL1dqSpyjQOzWZDH09UXb6aFM3mO5KI/0a0j/CDcbko2yVG\n+wTfEIIpXe3xQAPvFN0SAFPe4k7sk+aBwEOr/9w91cjNo/9WaXPI5PU+youS\nOHvOs5+uEHcFEjuyzQqBQLHNvQim6dmX1iDSuqit+E4K6syJlJ0CwOMEPkKC\ntiC7ws0/m7I0INWoe6ypzeB/Os6ZMfHUZdqQh9VYrwdcV+9iZKHYYhUhZWvH\nCqr6jMgCg1+KOp1O5Zwhe+MrlrB3Kg+R15LWW4WaYJaRaHjArIvlaBLuWdEl\n8hoCNzJJp1Sl/yPl3RC1N+pCuRIzS2qScqc9Icnb9sahWUf2POsOxnqDUB93\niU5ZGjq8cREMe5huPFprOU25EJxFhN/EiFqA9S1Uq0o1ltLs/fBiZR0RkqYv\n+BoJ\r\n=td3z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa+KIyql5nhkRsqvlS3t9OM8Dl7iv1tI7b+CpjNjyQbwIgLuBbXQLpAXPJEZZh92xgoCDTnXbuN1uJUVaqbC//N+Y="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.1_1607096820594_0.7177651886137677"},"_hasShrinkwrap":false},"6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a59a497a1f1d8778502d4988ab12091a56d4c3ce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uSwv73T50iDIu9GZSrx0JqxUM9cdYaKBwDcd3pM8Om/4rUj6QKq+J+MUuF92qJnalALHkjo44QXQjbNBVyV2pA==","shasum":"8b86bda97a11d571169e226489f08041bd107999","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylosCRA9TVsSAnZWagAA18cP/j9AyZpkXKWVQyMBrJdg\ndBjqk7IJw4hftXonOCPaROmKgb5jJPfHsA3uoz8/rHeKc+P/WePKfdb9Pm3M\ny6uF/kkRl6Adk6pK0JuM4JiNvG7dqbOjZC8qynRPevspK4tHAFfI82sz1DZ5\n60bvqlzzfup4l2E+WsPhvPR1YlOqTetz4p+kMX3Fgko4whKo3rkaSNJVfbYD\nC0oxh/aGfKNCfFApHfa7zpo7wri/7FZl0jQ6o0yDan8kjTFGLn9WDqkb7byu\nLwuLMLxUw5iRcJj5ANZNPdWs3xSAOtzU1DceGkJMOqbQNgt+g1kQWVTZsMpA\nIWDBfGoySjDSGhG4WTgRMK869cY97K782vZFTtdZ2Kp3gUsQb5G3X/XlzgzN\nVS9mil9hr5xQjqQwzuQVleyLlj/9ckm2g8OOXaBl92mpIPN2lRefRh3/9yO/\nIcMiYe2Y6vDG4MOTpquqBwbrH0gL7DzEf5+tgTp8p96Pc+RUKovUNJhTq+A4\nNmXhcyPluNuX+LjO7Gy5fWFsZEUXLqIc7ao5dn1J8XKQOOfL2cm4HzzN/+rZ\n99dnzVRMQ1nZyVaXjY1jHTRcEp70TGgriKLkOgNTv+ANpoICotuAIU78k4Ys\nqykHnZIRTGNoTnxEpDGQnrRnbt0iQfaQRI2l3cwvCpKFcVjiwAXiWVHZDIqq\n8/eH\r\n=m5Zx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF8Um6HAqUcq6dEISTJ/TSZ8/b3ZAqneeT48CLfHd1VGAiEAnYVBk94x/A1QZG2EgzhZehFZhq/x/XF6x6u6wo659JI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0_1607096875961_0.39371531237829793"},"_hasShrinkwrap":false},"6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0","gitHead":"3919ba82df6d613962fcfd3f8b3a4cecfd87d344","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zddPqHiTDTRvtrOZtJHIsvWlgpaRW0D6JlQOYaRxGHP5hKi3m6Phi7E43g6wFDawY4Au59ByK9oKQ3ilmtXuhA==","shasum":"8ae6248bf546cda23b629d6f920233f9606d4d8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylo9CRA9TVsSAnZWagAAi/sP/3KFny0oqb4LbrktheJN\nIzAvQSf90OhSF29m3YznE+nQUt5f++0GC3pOxXyZ2wwlEi8UJWyx72/w3jm7\napJTD7Crome63keVOfaP+4JOk0PM6juGNdsMj9RvE4ZKpcqzMZPOliVrGMXa\n7LhkMeQiqdMUvzbfjsCTBs6i4TKn0Yud3rXz/td+jKhNx2oWQ7rtkBuml03c\nua42gnTHYnnlxqbVmU658qBF1GrXwctFOwGDOVtziP5yr+03Y9zEH47MOa+f\nxs0CeVi5ssWf+Z3egpjCOePpA3VrLnj5GwLvgFqJi9OoQzNhS6r/FiLuBXXn\n+g7JkESsJjs9m8k8psStTPnvU0aTK+R0ukyGV6NGwbT8qIpIBOvbVWywtHG+\npo84bPAjwWl5f8CGaV7zXYS+un+NF8T6BtjdfaQsOxOc/CDyy2oFLhQykPpy\nES/PaELccSaaL1RVY50e1T9RapEbP5ra1TqnmQl5KVyGUGrPRAb1P7Ap2/iE\nxnYXurC11rRYeiCzlgARl1As/G22n1v8BaXnuT7umb+1b9+xdkgjxbCJtG4R\ndH2kM8kaU5ng+/QYFEaI71WImqvjlQ+Q6oQ1QtgrzhDzpoCD6uGah+heVdjB\nTokCT/+dqEcrewscp3TdMps3h3TNNsy797HKQ16oRKTO5n9xxXCWqLyMwx+j\nisdZ\r\n=iAKV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkGSJwL3zaFXn2jwdwMmEUaOt53gjyDbYAIDajq5flUAiBccWFd9zNS3VbETlCzvh6Py5GW/H911kKXTPOjwOewGw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0_1607096892671_0.1962972998284691"},"_hasShrinkwrap":false},"6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0","gitHead":"2fea3f4072f007a50aa4a0e79a891fe70c18afd4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eki8O/gLNwS6G7H+CnLtkduL39ES4d3mDon/gAK+HTtwkmlKb6S9fQtTePaO97AVLhF9qUUGiqPaD/n3tHGfdw==","shasum":"805c045b584d57e117281b88c7beba955c95f32e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylpfCRA9TVsSAnZWagAAQz0P/3lcyJmZAkbW1EDOLeL2\naFnGUBU1t5TrGV/XeHlXlgZpyRJFL17jCuU1J34h3O38/PEWqFYB1D2Tg/JR\ne30RjIBBO8pEcXeCGDFFWbs6UApVP5cq37pyP8sLGv3cKxHfTzPf3RPSwZsk\n17Kuf2E4I5NNNaAidqxvd74Ch78k2IjKK2ZAORn/xZthgoHX3WiNf2OWlZp/\n5jRoZx1jD3BGyuzngbUZfOQTWe+5kuF/fLdJhv9Hil7oclXyJVXxwMf8joBA\ntd9TPEGgFkUUgnqtGp59t+DHYnbYrSRNC8FMIx9eF64lM7E/4jcjdgHUBWth\ni7oeMQoGYwH0iwSh5PZJiDIor+nKP/4H7yu7BkWefxT6eb/7iRHVAgiS2Lar\nsG05c7KfOoX/ACTf/Idln0y1tGy1waz2k8ul3dcMH4CYyfuqdLDW+s/Soyd5\nduGX6gMDsGipjpIFJifW8/ZZEazaVKhJy66Y/jUtSFxutRTzrA8AO7KOUTjA\nDaklxEMM5N5gsl6jxJPryITkROf6AxStOCgcDq0UlIxdb4l92B1F0L1u7IXt\naKKG+Aia3OCTOEE4imeUWnYVw6bR4csQnZgAjc574QtySed9yE9mA3/RwFFb\nBOZ4+rTlNJFkQMzAUWlru+x+AL40sWXFtqMcbL3pt0SxTy2gbLAx1z9PX7ZB\nJtFX\r\n=bXTA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVOba6ImA054TxNqKNzKMJc42AVTYwnwJV+uJSz5Cr+gIgRdDOKVgHsEDnowJqWQtZQLEepd2rguAL3Ve5sZfQxWA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0_1607096926845_0.890235335175642"},"_hasShrinkwrap":false},"6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0","gitHead":"c1a248c6656ed56b6523b4f03880f0fa3356bd5b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TG3uK/IDlcPh5nSn0x7dNRbN+p1JocFZt1TiDv0i455qU9xXhJ4MrWYc3yuVBZVyguA8gQGtJ0izOq/8QtO6oA==","shasum":"8e5266d37517087423766b494a070ed6d0ae7208","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylptCRA9TVsSAnZWagAA+6UP/RP4jiiB/YqX+Wr9uqBH\nYtM2oOFSYds0yiZP1/zNDKRbv3vuuvx53+hFyxcKDx6dQa8v+yjsQOQExTBh\n3nygCFrw9Adhtr8phpjnqc+6xmQVYQrfUB4Bd9vDXK1p8cbWq4esU1aeO/De\nZducMKuABNyEMxHP0z4Sdzrn24Z3N1UFu1zlKLJlOTbu0NrpJ57W6nNuhAx+\n7Z9fL3zWWdIvX9Fh1DECZiKmrn0LfHUANBPKS3j+QZ8Dfx2kpRtQ/V2nIH/H\nRKAWVynMpMIa1dJYRbtnkZU2F0QM8mc3pShNEOmvOz+dtbAze40moOftIeeA\naAZHQslu9esazBvaZfFG8UmZPuntoo1XmEhmCcqQj7m7ZId4h6VoyeVjFZ8E\nZdVusDG4zRITTEYkDA8v4yItHvbB8UxwQiRyMbqMHWvJViorFcB8sWECOLEL\navhxxFM5nts1NzNEnegyR3yyaCKSveV4gJh7Z+hbSwIb926FohBYR+ChRe2I\nH55sJwmhFjxVSd3ZPk2kvTi6Bdzs0+5xh7qyVZmT2tMgRdGqctwXupjmWQur\nd6PDpqzU01+MmNcGlKZ3CwDffYn1BQUsZuKf50CC7FnzHioro1z3TsqZR88s\nXxXo60f/6pmaRxFSE1fVa+AsvrKR+PYLDdnkUlFWzJ1DclCom6lctNqDWC54\n4SVj\r\n=+kmI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrISikgEQeFkPfvNaqau2VGIY1KYjfTkaW3o/iakiBCwIhAL466zLEtDbpHjUQ0r+5/h+W3DCRUB1jhiTJ7XDaNK6H"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0_1607096940436_0.7013549537785735"},"_hasShrinkwrap":false},"6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0","gitHead":"f19326af400b8638dc2d6d80b211ac226f256a67","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Jt/AVRBoFCiIJ2jqkkbwvX2bhOloxV2pw60KUaDsxJxLr1z3JQYzWfKQoWx5yjb0NKSytiLLyZ9RC/pVF7zdIg==","shasum":"7df3e0464651e94306a498a42a951fd43e2f779c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylp7CRA9TVsSAnZWagAAUwMP/RHZ/fsY1fB0l+1IrGs/\nUVoiuEFtIF+6xPiYaqp6mwCpnIYGcEywLv6Zq+0p7bhBsNoMTMAvyHzzBBlo\nF4qAVuXK9gxBA4xCSn4UkJdeOGFXIILmzBJgxWTPQbaphehbsxKXI5AmRJ4N\nuHvG9mPFgb+IGreQLT/i5p8QX966RBRvYgGzvoTP80RpanWXtaLKrRWv2i99\nkUBDSV77E8fprkLeU38ji6Uq616b8GXMSsyKdqX3RBNUWf0y4EsaTuuneV1v\nGiL0tldBOoNoTF+pyReDIihxnvo7eDoVPbw/ACb5Wy9yVIlRkfrMYdnBHGor\nByceSWWAOxa4qHZxO8DZpl+S3vO4gZV5sQ6z9jW7layoupjexp006D6zWqfs\nGmhZiA+5YLxTXs6KOTYKhziiGJlQfg/Ek4sK4TJcwolQJ+ESfHI5f2NytaOt\nCxuhoVLgWSlEy/teOPRjU4HXI+CtpDEO2Kpa1ki2lMrCQaBfC/D7orTJex80\nnt3F1ecCcl3EQC4axFWTjCXD3Nmw5smUa3Rlucwk05FO4K+6+7WET5k60Sdz\ndgI5xxN1E1/VhCn8zZxTAIcTfxno4EGMR4xGhVkl6r/WdAEIS4gIcZisa4b4\nk/ZosDL3rKQZmyZvvXLTz/RV0OZOBfJAAOEoB01MkfyRaTWeE7YqsatCGq5g\n0lIL\r\n=+w5V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaTQQNGaroYA8P5tW+o7ItuhyBHROK+zu9hysGPH/IigIhANJznhK5ZYqit9lguIdCwkRk0sdyO5qdKI1habbq7qBy"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0_1607096955292_0.6649645908853441"},"_hasShrinkwrap":false},"6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0","gitHead":"3d8a9c754adc4d82754975b49a01e86a30597110","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8u122dcTRyovihjI+/o2tZEkm49hgg59Syyw/88hWF6WmbXWARtP1L4ykaGlcUxte7SNsMBDFPLQAux3M9Kt1g==","shasum":"b9d927738e28052fa24d38340159d4e668535b5d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy2/YCRA9TVsSAnZWagAASTMP/j3otyaoYge3kvgZQkPm\nyF4ucvRJsCgzFI6rb84niwWw5lJ4WYY6GbO9aisfeiLpbIf5dOQbVgfvBXD/\niSI29vl3E/rdRcKSDAKE8PtjAuryb4IfDXiXuJTRdir/5OIBDx6PbULo7qsY\nsOUjv6JJcrfPOXu9oCeRz5XQrlVmwtBRMyKuXAxmYP8YlkXaBPsgB92Y24JJ\n9UiZfLMvohyOJvSgm19bJhczsBz7+njGmhqVwlULb0PsPErW5GyN39Xkgmrn\nZVdJ79FxDSrbHl0d2mcHoaztlNxc6gLFHhei5wQHHCyow3saKl4VnVxP7XPt\nxigP5rVY7dNiI+BQeRWjXGALX4B1PSPvK6BRRnGrUPJVVEB4fTiKyZ7Nv2j8\nkbUY6B9WuYtfbsT1kVgebhpGQFortsu0gIkEOHxxY4qHhAo0qZ+KUhLgWnic\n0CQamoVHkZCsWGQDXEJ7Y5/hxuFbyxLHKOO9Q8hc/YHp7GHblk9FQL2ykWcy\n+q1bdvrpfA6ZIDzJ0M5jOtl0iLG8OT5GhNMt/Xl8vr9qyQFxFIulk0MECJ1x\n4XA9bFjIqZzzw7IqwIX+xq3zdwpxogkJm9cRBdKryKWAyD1D8DI/dCdjE31P\nmBO0xQZtWPJ4xEQn3bzL7/sNFjOyozqKw6BJIqO2NkCrN14OyOWfKVYjLjOm\nRvvD\r\n=mGX3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQYNgkKMsKwD3Pn5iwycWAKGJcF5K+iFO5dZ0xM/nncAiEAu7CHFDFycz5Z7EhufnakaZAOddORyZRf4YxDLnGDFc8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0_1607167960147_0.8838368569247783"},"_hasShrinkwrap":false},"6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"190fd18bca80821f2fe175ee4392dd66ab69f3c0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-J0jsrPguLcmXzUlQkSTJpPw9YGWo+JWMv1Y50/ZX1iOsthrKcwoUNPLczwJUpk8pGQwMl67jE9K394UBDREXcQ==","shasum":"1cb4dde88a4fe687b3360d57d405495654a2b0fd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0.tgz","fileCount":39,"unpackedSize":231846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3AXCRA9TVsSAnZWagAAhpcP/2Glkwh2fVCZWR7BM7Dy\nj8aPzb7Ayn2w/aUpEEgJHKig8epH7bpQOjWGlJ1THLUCRs1LT9vGHshN0HZd\nm9jmxbrLf+Mj3r42UMSJTjPPTZCwLUjPtJ3t2N0x+HvqPAopHIWZi1uHhlrm\nIe3AFLCVrjgkAexCn5epLOCIDru6Wv3iHNaFiudS66GDH3Dh07gzUwM37b7z\nv9gJQZm5tU1uEfr1xLZ4EMv2jB0PgJXlRXXgbIf+znZByn6DmeW24EfwUOSS\nICiUMTXygnhRYqd2bS/s5IB4IGd7DeU5Dw+dVD506n5ho1O5YXW4l21ousii\nkSHUITcJfJES3Qu/bGnW7EQXRct3xk8H/d854E6lB4LFOKO8sAzJdUIZWoTS\nRwnpuRjFID/BeFsm9jr2aqqO9mhIfniu8TcUhKQ1uGwcVk5TxNzYDnH1XB3O\nwsfYBZbYAZK7dIKDBVgVY30AaywYgsGzVu9LIcpb2Of4hVo3hsszT+t/axoV\ng2uaxN6pbkgk6dc1pJHN3fQJialOUKFIGrwbuDFzRuhxLvIhlIXEhgc9DaKq\nB/ZWfsrnkAyzSsQrYg1RhEYBRVstQHJKWDMzNfiC01vKpU7remd2xQDCha/1\no5RZs4lSoA04g2PLdTgw8pgTO02F9IhXlVP9sRRv8RAMMzMtm6gdBiycP4I7\nq3v4\r\n=cgMC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJBE8TkX/jCm0XSkpbke3i0FeLz7IhXANqs2tTJzXBrAiAnY/L5zGyyY3A90ZqzxaWriUsI3KPRYmSJw62cHpNZjg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0_1607168022482_0.7318700472573629"},"_hasShrinkwrap":false},"6.4.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.2","gitHead":"ab16c3659ba81754babe5a8e84e7939a69079d5a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.2","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+QL1LlRHd03ISZsos0i1uuNGE8G2FS1j3WpE/67mcHCEiIsRDgG2RNHaEwi/N/qqBuhihBhiv74Q3nvMYPnBPA==","shasum":"9ded278af4288eecc282233dddac04954e3acfc4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.2.tgz","fileCount":39,"unpackedSize":232074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3ApCRA9TVsSAnZWagAAGCwP/2+fbE7a4avIHo5Vu7Is\nevA4cp/hbJgu9FKcXWMj73qunSqADKS8vTV060Ukqcts6QOYoYrIHcuiObiR\nUwsEuhGehd5WjzifupkIYprvU+p/5jZnY+Aef4restqey1NqxypWLK/hxgM9\neJ6eO8u317BLekO9lAqdOQXeoXvL39iK9EA6JJ/Fm1ABxQ3ngqkFLIonjeA4\nYZgCl5dI8p3/wdmMQZzqkp1Ydl98qd5XWhyKObaTzMBsXQTZxWFxE29umVSp\nwdP+rrZyapE8Q+EBcDHgKwWBViuoC3hlwEZ4S6xGOF9ehWeqnKiIVitGK7jB\nS5ZmxbDiJ/RQYOkZnjyoRNB1WT7OEsmaFYO+ZyOIjkcjxgGwLrqafkBY2vpi\nS+6OBq/c0lKjLN3bOFBO6ViVQwsJbSFgEBZ4ud0q2k+cGvczf5ijXGN9ENpT\noKlrbFqBlJ/U7eEPZd1yWf/2VpD0Kr9UHZ4Oule3gN6w/NjMbj8KW0nSTGuP\nzulDdXY5zKjiEadAZEdWSUEts4B4TlLYfaZHxnFl1oni/prJURlNO9iQjDIn\nieOxgU/Qc2jKV/x6TkjCZqjCBI2nr5fVOBiMlfSr5rZOixCogl385zaiPwlw\njgY0RhqQKTvYD8ac48drDcdeyn++mLLLtxu6h7y2gDUH4R3Ealrm789E27o3\nEMDZ\r\n=EO8P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID27c5rg2zkLItnOpW/LEwFmNLRs+J55KejosdQTYek0AiBCVh0zba57wp982C1bNY1HJbc1QHg9sN/naTOQkLhblA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.2_1607168040380_0.7297764644727425"},"_hasShrinkwrap":false},"6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ab16c3659ba81754babe5a8e84e7939a69079d5a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SS23DAxnwpk2OlKp2vnRZV1mHsJS5BnCkH08HzEpvF07fN1VKhYbbpEsY2KRAUoBwDMvC9X+EwPw1lO+4g4Hrw==","shasum":"62d590ef7b3d30e3eb37d6636694a9a9658b6b52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3BDCRA9TVsSAnZWagAAuAUQAJrNhfWpK4PcnM6uVIf4\nZhDIoWcPwveB1W6ZAAGGT1j002+fgcKOuhE2+QcPcRt1gCRk2lXWC6QjU+7l\nsueswqIR2rCEioFnfgho5ss0tu3/1Bf5aOkkcKwiqgaJpvKpq2p4oiMGYeMh\n5V7W6V1myn60Ptp5rZAEE8n+HgP4tTzP+PdmytXCaXdF1eQ7R8hbED4CAJ42\nI+MmfRpWk8vf5RL36BAzOV2wJtlo4qBxtHVjr5W9S/ftHKXqD61QdXURrxkE\n43M25pIV//aG+egH/chuK4n2gbrsWyc108XxdHoRYLUihB38quEl+xXkETN1\n+kTkmt6dfe42q5iONcHe1l6/UkIAOqbhTfFRrHQZ5J7gr8+gk89dd6WT/X6l\n6VV6XKNAm0NibTVO80tJUSW8vpYMfqCSv31viF6SkNCY9UynrJ1H5fJHQFFz\nj8q8dHFcbA3clwOqeMhtHn0EY/HFDSAENc0a9gJWdGeNTZc5sVqfxOnaGbvP\nHzXvXi3bfUivUiWaihQ84vCfwEg4FkgOhsIGuYw51lmNcujQ39urvmhxK7Xw\n3fK3oRGUS5/CPzG82P6tuozyvrmNIlKxeA+hxbmsjTeUkmCAyKESiJhnCPG6\nAvpOHn8TV4ZnDKjoFUH/hNOhnd9pPzZgrogrPJvMwZdTcs08P8+WXIeQWjbS\n1qtN\r\n=HPhB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1i9L9twm2tJ60K9fRe7pUTK5k/F3lp8FGI35DjAWM+AiEAzzjbwOgKNtoRnfL4Blhhul9GlqjrHakt2kcSl34nqdk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0_1607168066822_0.7178328810941819"},"_hasShrinkwrap":false},"6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0","gitHead":"fb4a3787a44088d3666116582fd9dafa9f0f3439","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-tZV5RdUJWBJBKywlgJOHlB91TtBLnNI3U+ypWM4LispB5V97D32/pFxAwi8w7RxEc92NnzHzGzPGq5ZEEmd5tQ==","shasum":"055c51e044cccfa0a04cc2bfee3b607a715fe060","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3BZCRA9TVsSAnZWagAADlUQAIqqP8NUk4Suh19r9ETz\n1ehnQvyi+heMEyD1ATFN3H8/yg4eF1NrJ8Qr49LyHyr8CzmHPRWpLYt2Taav\nQDQJYOX5ClV16nc6P+8EgomF76kdtPrGk7A4H7CxwxW9LH52vMixkvKw4k1h\nCDDa7xLbB3pPKbDkhsXaCBURJmW/q8HhoBiq9v65R0esFW7Yooc5s0OaSNiV\nZwC1+mDOkGE9tZQWqC5mHsgutxHTXYmfOhBAReoQvzJsrizC9zUix6/SKP33\nO2EU9R+wvGp/EbHTJ4yOhS7fJOCuBcEVqjMVm+ddQVOzhtHaXc/AuoXez2MF\nXqEAW5CMfScfMJP2NymEA9+N+0VU99q857VZ3mAil1x4EXDFanxRKw9+qLHg\nZQimD+naxphomIsu8vv6DnKa8jH0Tx0AdXIuMwbUZKJYu3NOpK9WFQA7wK/9\nV21YOkrEYOEEvNCE1wZJNHlkf4WMhkqtDkeewJVvWmcFqlewcqsD3o38jHcc\nKlOnjJotlkzqpapoyUqR5MGoM64D0t+dKKrSMiicG8rhS44esRwN4iRiHv2H\nGN0SIMtnQ4S5bm4X2MzBopB4V8AxcJlwOuiNwdhk1aRN6JwPixEjeWFvgdGm\n5bPW3oyqd339V5d+71S5rCF2yhkl2Mp/N4yOZu03+aSykwZsor+aYWSIsMEl\nDnPj\r\n=N17X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfD9egmnnv8NyZ9OlhkooGVO7qoil0YpPgEGvVS2duXQIgHL5WGIdXrtOBVyWPi6cafN6A3atmreBButtsGjuFjcs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0_1607168089378_0.8208242914968109"},"_hasShrinkwrap":false},"6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0","gitHead":"81f16b40d75d75c5ead54f1717405cfefae7acfa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-s21QdIJpAdCoeAVWSBkoqYlR8c2lvsr9sbDE+UjW451pj6PLlhi3CcL/7OAAK/FDIlZvoGdWHX74IGwK3abnXw==","shasum":"380c63c634ccf2e729b7b00b930d6f2cc7c51db6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3CLCRA9TVsSAnZWagAATxYP/3PqqJsSC0/1kHZUPVgK\ncEBVVJrv8FCty9nd0KKyJL2e6DrK6BC2zsfYUdKDtG4P3VyH222PBGeSSwJl\nqJJo+8VhKU0tPxbjd2X08b63q0SW1ftWnDQ4+EV2h7ulkcpdmiWSGk/GbsdK\nKGj2DkD1TIQjVZoV9HT7FtYMp9fdgg1w28hSRI/NGYzKPudlEO85KDx3nwQL\nVs8/cVzck4pgnL1ARlmmNogAe7RYcgBm3M6GYSwJmXosyG1QQiP4oRxNcE6q\nZ6ka33r5azsqa7lmuxPky0WGq+LwFGpp2Hck/rezSoNPnHRF4PX38UKUxcSj\nzEuknNIw9iWX9Jyzyqw/RMPwi05aQOW1Rlt71lgfbqqZ2CoemSjh8TOKsjHo\nrdmjRiuf9/clTFBDdkvWFS+bPuv8jWwsqvHwoA85XawRxxei0IqBYuk6H9CG\n6/A1AJ6gBbUaktqyhgrhp7UbG33+gAZ24fkG+uQpXvqh695jUzKWvpcD6xu3\nWXA1R6iFqQeh7PN428VMOsla2mBbNdPvzVr+0BLS0LDLOlWiik8ya6e/hy+n\nU4K1azymU3trv5aZoxn/G7Hq/6ApNQA8XcXpJHMHcqvPcffLigaAE7qTagy8\nc3SRec9tM5f+jXOrF4CZGk38KVOn3MX4zx/q+Cz8NOALgjBa56enWDfr5Hgd\njr6e\r\n=WPRc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgqos+bG6LfBfDpNAyoJ6mgSu56EtotP73MMc3CS+4FwIhAIeLRc8QXtSrePuRwZqqlKQD4mo2oa1TjsbjxRRdv7IO"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0_1607168138644_0.8202224565413947"},"_hasShrinkwrap":false},"6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0","gitHead":"1bb96a29efd30e846c3ad3bb54a552f358a9ef44","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HtGaBbaz0s1DtktN1mpEdP3Q9PBQmYWsE+ljfJ7f8EelfLOXdYXZUgQYG24lc43geU64eWTXC4tiE1KCBVwwlQ==","shasum":"4eef8f6b64ef9a9cd44e24735aeabcd35edf0e7e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3CgCRA9TVsSAnZWagAA9bwP/ReUK9OKcqO2Ftgwq6lo\ny6kBPWWc3FYTEXyyLLH5Nj9mDDs/EktJKXlA/u2+bk1+n3prjRRPpr1tKZkY\nl+1YCFZrxPdKLiwsUB1LyXyjsWgiG4Qvhqw6TJ2iOkpTjsRO5SqXjO5ILxCF\nok9RyvcLn/LFWSyF72jU0i4wlu0mv6IjGzgJfJr2Dd8hManu6tOr/81JIxJI\niceDEQrFBOlyFCM6RY5/yvoWN+AqY7x9xdDbhoGGaaxPpMedlza1T4lA054A\nJZmIXVcrXaU5C0VqFvtbNP75XvaxMlpT8m8Jua4J1lHM+DS+j8YFlDbahrLG\nnlyVK4h6PruWIazbFMgCbQKSsvp/j0I2bp1lrcBxua29Jj5mrVgMbBCa/RfW\nNOL2iwU/FGac+W7jHidd0wkJ4JAb+uZ9+muSG9tIQ13TnQfI4bk3Zv2VDf84\nPsmzBqmIJqAhW/u5UdWWa4mwBwnGgqPWJ9oYu82LacmPhNarX8TV/EHeFYic\nisyGJ9e2pqW4lpZcc+LOHu75aHmPXouQagiN+e4akbRyuPDWs8dhPr1bg0Xs\nP3/36vCuMGN4U1c3ZdEdxDF1UMp51UVA17y3fqmfDN1zoEOYWH2ZB+5wZjyU\nx6mNNRLN9VLVkuvD47ZOX6gEGKWvlUzXO+XkyxIX8X7z6txrMTLFUNSwBooM\n6MRY\r\n=1g3o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBxlh9GOjk4YCedOD9UMqXjB3CevmMiXEoxLdtuWcyWAiEAme68XIvWZTS2SZDep6HT/+tlgMddYCM54JMBiU2ORf4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0_1607168160243_0.10277118980938904"},"_hasShrinkwrap":false},"6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^4.3.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0","gitHead":"0356e036e163105e16326e34b37f4e1c3cfd15a4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fJLhpEnjem9sisqudgi2p/GB1PDHWoySV90KDNTGBo71U7VyRA1K+x6nBc7J0KQLHBGdhxpCbsw5VqLJtHn8YA==","shasum":"e404dc3b82c3379552b83746c90dfbecf08f9851","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy3C5CRA9TVsSAnZWagAAFggP/0vVTtiuFas8PWN8LiAk\nbDP5AigfKQ7zUAFzfCPNwc0u/+homu3n506mPoaGqD4x9+DYlc6+d5GcvyLJ\ncunQiSWeLXPWyTmO+XT6vsbq/yOs7KZDG89XfjogGNGyLBhiUttWearVABnN\nSyOM2s9/7hjVWEV0hG3iSkII8l/oEVDLfgmGZyBIqzwjpx17YiPcnA+dhg+2\nZp3PCCx+L+VESOs5S8t89s2DK5ndt11GLmbBxWNPHxh8bVe1Vre3Ntp82DuH\nd+3y82Sj9BvQ9NESWCKKlFBcVaUoREcTEcjGyZPn21yu/RaOSqtrBo6CWSkB\n7vo+ukz5hzmK9opN67yS/AkcBuYNwudYE9p54FSQ5ICyAFqsQ8OWtP1o695Y\n2705qRV/vsenMx5yVbv00jo4cicM6FvDDg6JTRg6VqBr9gryrNwDlR4Mr8Oe\nHPT1SDV4PyqEznryXQlA13XjTbyiJrEqh2eFy2Ie/nwpKnGS8wnZlnZ7l4UR\nniY3DWfd2S5jGu3OWIDlEwFzVCjZDIgjmLdJ7nEkSgiOnog00AxTOBeGqGNC\nnFf8Q3gbftBKzcZJsRXDchp57wwwR33ig2jiAJ+jMU8ETXlxBDTvoOWptgvN\nrxLc1zAhbI1r86g2m6RPu1dFwaRUZ8DAvAqFaJBXHd0SA3JgPK+e07imUeKx\nNOYe\r\n=64e8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzwDxEdjoYio+3qzXgMVr1wQlLptXdop4rj5PVFnK1KQIgHaywOG1klXKkUE67nSyob2XONZvK1cs/nHXcmDSqgvM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0_1607168184677_0.40911048931425675"},"_hasShrinkwrap":false},"6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0","gitHead":"6ca52568696d73258585695a2d37fc36dfeeb9a9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TMmg55Jp/QZhdePSIAnpPKSaKZMCVXbm1Uv5Zxoz8EHI2+NQ8pvzkeY/sQj6pIVmbEz3EwaQvNeSbGFmJhPk2g==","shasum":"b29176bc2b4d30efd875fc2ff9dcf253b9965a9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW2vCRA9TVsSAnZWagAA2pQP/2BuFnPfVYGBLkTbkoNW\nkYTXx4agg/t2lnAG7MvEMnFln/c+3+EuJTrcN510aY8VdJW2EbR2m0WiUW95\ntBcDWLC3Ef7ll38Gthi3RstTcuZZWOtqfVhG7JTV2giCNCCIMW92bWELRhEQ\n+L1ivLecEzSc9U2qWwHstKJwEcxk+uI11Zo4VYFZcth3IG1ZW2azi19vWVhx\nA3AlVddznWHBZbQh/O5rR1IpGi9MYweeJ5mT11mKh4szy+kFspjsUx64UDWJ\n77Pikc+rjBp95yN86kduQeNDQcUFEQFxkEhmUKwAyBhqwFP5LOkb/uDQ9VB5\n3h4pK0iY7JS6emuLHa0ElNeZG5WTHIzdGNbBl8aeE/vJiK3wL9qZ8PCTO/om\nlwmTYrRcT65xXSkW84fx5CoZrHpvbMzqaMANTrFuUYnNB8d0xCrR9QRFxhqd\nh4TDlQbQIZ6pO0KanTJweb3zjX+IpfrH7shc7fEzx3kFBlCrkDVqoTMI5kI6\nesCt7ZhfCfASUaBPBVterXdYZfv8l6iNRV6wjfYLOkZmVvjfEVXRa8Z+onZa\n4i8tMTs3ofCjFREQetoaWzH1XkPhPEjUGbhl/YITAKyjg4yO1f6YnfV7dS6n\ntn6K9jVWwUGp9SzNPiKT++jgBereWRTH8vdcU2QhVYW0bhOnI6CNwaS9LVfw\nBknz\r\n=rN5q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvX1gGxZe4hyQxSIZdiyw8kQGEYtHgLfeEq/mziqvCdwIhAOrN+oeCrjDapVYi2VL7P0fXdYXJtmhybz5hivvifp/s"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0_1607298479000_0.6086544630613793"},"_hasShrinkwrap":false},"6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"452ded9da564b8f1ba47dc3b2d282db33582a6d4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+NgFek6yWWA0Wz1KroDSgyl1sFPz3EL6KvBeTPOm7QrybEto0akyZP95poE3DCRz7fgmG0UZBPMAwObSOtnTTg==","shasum":"f834ed511127d02e71071b4ef4b523d897e9b1fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0.tgz","fileCount":39,"unpackedSize":232117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW37CRA9TVsSAnZWagAAymQP/A1+NGDZ0RtNhOIQaWqE\njiNIOBgHx3cM/jrbTCtLchVfaS3IoRu2+Eh+br+jXBrWTJVOyePtE7z+5iqI\nTuZ6EV8Oy0G6rY2pcCkXB5h29p3uuhf2p5QKo/bolRfSggMLgAqEyxkDPDcS\nnVQ9c7ijaAhGWJniIjqQjEJ2CeVeg/YTR9rVlWMMAPusToaTdgMTETuesnF7\nSEiW3r/8Z5F7f9d4HiivSifVtueN41olDzUvZSSUy2d7iCNEOJJr0mCPCWcd\nLnyyzeHEY9EwbjezmsoCAxxuk5n1kAujUp9qcyRMTIHQHSp2dOMzYLk7I8I+\nifuSckIjOVFEnlrw4/dJFu9TGX2BKOGs0SKtjSOQmXbPOYFeDeflvyiOYuAB\nwQY3UJvbCTUATJFTJ/kuYmVsrLjVWSwVKl56qEU8ZIog8EU9geIwnXDJNOah\nKeUA5i0NKzXpWoBLlj6cfkHSpho3VJCkQa2CXERAl8+R/U/KlnC45VdI96l4\nxKFjsRB4pZAAXOwD5ZjPTOrjz6egMH/aEmJa1dOMBcnMyRDyLC6Cd/u7AxIU\nmp0W8OYE+jnjmz/LrljuiNlt5w+5m72tvqRb6/45p3UtBW6h3MDACRuwGo36\nxobUqe0glNS92AjuYx3bUiiabRHH/WZcP3V0rSNoEGO44T0iTxbU5erQr8lC\nLCOC\r\n=h/aw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDznVqlvBQqGZvJOBDsnv+tdC+m8Gt5G52lcusVK2IyhAiEAqeIFbjQq6LDTAm9YRhQPANrFgieHL8YKnVE5tz43OIo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0_1607298555100_0.25553588109748926"},"_hasShrinkwrap":false},"6.4.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.3","gitHead":"e833efefa7bdb11e8d620f3e6ccd63b042e1f345","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.3","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NE5ujknoRyz61n5CjVqg/aTBqh8SoRdszWWM1eN+wPsTcKBpfkP4jUpm3bIPJAwjtx4up6XV41vJQX6nXPZTsA==","shasum":"0dc015eda30ad0630d07309e08d6e6e2a6b82daf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.3.tgz","fileCount":39,"unpackedSize":232345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW4ZCRA9TVsSAnZWagAAkSMP/jzAU88RwPRYiXfVu0dq\n0kcEvxifo1U+PsZGufCRn5+HoSx6VZaJ/ZhHMwSN4tTe18kHT891rbR6xe/x\nh2SSgOlm6M2nFJyXd/4AwYQ8mxq8hTyM2crv7MxxRvMr6VWHUUW+LysXOID9\nt6k8Hqo7vybFeepuAc9/Ru2lq+IEpr0GjUVSV/Si5/fD2vHb+ArIttl19VDd\nLvwjIbXpJMDDB53+mQYcGs0621s2RwHgZneNxfuCuaubbzQSYViieo5OxCxc\n5GDy6q05XGpxgS04raTFZOCLYoNVD9BfGKHf/cY6NbLxPOW4GF9UpRXwSExw\nTsSC0gLeEgqDCsPW1w/0xmXKQPterG5Z4pV19wNeyHC/mMNyQYwQiox5uapE\nknTzxiYp/iwCTwCShJmsQAJ+xCVVXwXy9VXCqSdumtSEEV4PrYbdoRY5LN5j\nByoE89gYeIt9437fI6ex6iufKj2epNgav9tTO1e3ef4poFFK/JsXP9HLi/Lq\novJj8fOnSXPVyMsn1YXw/xhtn4CeygIbmu4GdDqfYthmYVz/wC8ccQQCp3M3\n2hxmuhwH8qyvlHF6kVhNBD60YNURN26w6Vw7eW0AwS62s38gzi+Gmz4oqUvC\nKXMjOcxoa5qrTSJQ8gyQmEqdj9TLnlMsL6cHQgng24pKzgH+EJrdOC5HwKl+\nttbn\r\n=lCqa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWFb2r4qBweMsL2up9paqS8hPVIbH0cMwnQooNZSk/0QIhAIWSeBcGxCsgR4BWZyNFZdFUg4wkjR2ClhAPxeFN7VJD"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.3_1607298584616_0.9444837985665631"},"_hasShrinkwrap":false},"6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e833efefa7bdb11e8d620f3e6ccd63b042e1f345","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NblYWurzNf91b2ukxhQhACX+HEIpQxZpLsmWtk19MiPbX/mbzcBKEfVXk0NUlgAMPY6RT2/x+HJc8+Y7CxxcTg==","shasum":"ba6aa5f103cfaf0e2b179e13cd1e189d2fbd4566","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW4wCRA9TVsSAnZWagAA3e0P/A4w2HT9d56g3Wkrd4rd\nT3TQx+2hoZszQ49x1q9vv/v0DZplt7q7wStyH0WyaZTqDWd1OePSubipvpzA\nEu0SZ/0EymhNdFeCQf0eQd6ZYDxfFV/U8T50KHVcvJFyFy5/N995C1Dyu7u0\nd4cYsaTI5Xd5bCNVS8DVadOE4fB87WXDbhBNaB6XoTZz/g2Sx4tyRkACx1fa\nXXHSG435Y24kae332LpzrRbXcvrihKZr3ucQ+OiKKYF08hPwmN6I4+2inW/M\nUipoW/0+2spsrLP/Jg8xb84o3YCWhIC7itObbn1cOLAtnmKcv39iKJGoAMCq\nS3TFxK2B9WBCUirZTXiwCU9cowpHYlkNNySRKrYKNN9Wdy/ck2fU2//t8q9Y\nQ892AtXF09XJqZKRTfWKutCKEchitM9x2L45mhuZbsaso4A35kiSA9NRFypv\nWCx8r4v2jegkPXA7w4c227xrC0RrInLC2YFIEOACiOg3Tuf+b4cWCfk4cQbP\n2y4hF7lI2u4vIAMZoDC+Ru4LI3l1Tc918ipcTp5rudB3kXXJT3gQAMI0xxwn\npBGfzNO6MIIcmZgmnF98bIhivX1IrDrq1l63UQMF59d94iNuAFrzbO99gYDt\n2Nt/0xXZ+jn1UOdH/raOdDqm/DBnjkrMu5dzO+Bp85cgjOt7tHyq0AsrRWGm\nSoXf\r\n=qwgu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgHduiR7NsRU7HknANbmd6pmXg9pKdmDKdoZzdANSu2AiBqCazBA0yfYvKHzzv0Edk8BQJ+YXS6hQM7THfUe6jq5g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0_1607298607631_0.04496748607586487"},"_hasShrinkwrap":false},"6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0","gitHead":"bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uSAIwsKcr+uWqrRBnAXUTbqbd2QfD7D3CQinENOtbJAdYQqplow23R17yb6EhhhWOCDpV2fG6fx9FerYbriIRw==","shasum":"7f9deb0061e748696227e530162b3637d4de2f37","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW47CRA9TVsSAnZWagAAKLUQAIR/PJgPpTop6VIz+LKg\nzYQ5hv0C8cTN3HcQz/ZD52c89AELkyz3e9dUf4XpeptKaOL0TB08BZn4zlD6\nOXHpwYai46XBkwID+4B/lvLyNCzrXShyojS3g78uHEAx1EtfLJ8zcEMPy2O1\nYp5MmyTi1qjEveuIkfrXtydoBQhX4jCTfFiKNMyOq+60laVkV3tVG2lZMdln\nNa7FcOglNHSdQ6PcjgT+t6aJuqDLyHOG+e50VtId7fGTQl0N3C4GVHthv82P\nBuUkcQ0AOzPe30aeHQZmKjFNsnneGelQp3TBs2KI8z+sd+e73m4QZ/eu7PkJ\nZ/WAAELQgf0wv6oI/Ozg/tWZKX1Mfi8LBydX6DFuBTuy2rzGkWg2lwfE/I75\nS86rTJz7vV8Qdot5gpBNV8tdHs5pY58mvwtZwGXLaRRu3k6rT63EzjGdmDkK\n7uY1YKBzKdhAGtQ5Uisb4k364OI5meiMJtV+V1MsLRFHHBo+UAq0Tj7UzMoT\nf8BWuoPWraCVmsPoSc+4j3weQGX2vhtEgSeLRf6qG6IN2W+ZwGmD1tzHzfZm\naiqFDdrjPU4dmfFBu1eE3VwmNAzQYvaDFAgpf48QGqwZXJaG4mV8EEvtNcR+\ng8tbiJsM4GukCj0ijTsQ9dH5+lLxhlnu+5cUMxvGoPtOTZ4SJNzJl5qPJiSr\nvwUZ\r\n=3z9p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb31s9J1tMk8RbhdzxI1TDKX0p+kRDZ6mDE+HX2RaGRgIhALbsdiGnZqlpnOStEdJurCiFFZn9cvIfTLXrW6tiGxcf"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0_1607298619015_0.9564434175897201"},"_hasShrinkwrap":false},"6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0","gitHead":"cbb25a1be17105af34ecbf0e1957d3b12b73b9cc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PLVqRIkbdimg1emwE3N8OPisqwY64Q5b4lf8pm6e6ihQCH2RVx8DVJAPP6+mUT6ji+hHR/d018i1luGoJMwZ4Q==","shasum":"b525f0784aab64fdd844c6e24b47a5c830850e7d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW5iCRA9TVsSAnZWagAAIpQP/3HEVovmr1SmsxHcvVvd\ncHDYAzoElVGTPgszZQ2hVeQ054kBJ5yOstI39YXQZ8b5vHQvp5rHhNvkgfpi\nqk4nv5hpG1MW2+8pjceuVi/kk3PCKHLYJ4CEG9PM6XE2ekLeg5/S/ZG1s6SX\n3Xhizb5hNBupLtLgkY+o43Vq3AC3oSpv4db1Qge5tuPc6ZHYG6z3A0MBALRx\nJeiUslmggyQqsismHoaGbhb0hHs2wWtKZ8QdfkkYCurf3jJcwunK8Iyveq0N\nGat5K1MBQr5ZL57A0yAv6Bvle+Won29cPSOF48Jg51xcF5lnB9WqprUoea6r\nv4CSrf7pWRaMkEkL/3A23FK2KN3vs4f9gWItpTQ94UW2mXSu5JhT88FVzEWH\nq6r6pQjUcoRaCHXT5SlhzuyeIUOpbKhGrEcigj97BPjl1+/OME1XJuS9wmHM\nD2cRC/dRE/UXYj/tJFcS/0xBFx4CUjrgEbpS//PGPTtQgwLxWTCECSjJw4st\nLul7s3LkezFPqJoiUGDpUACcpJYIC5FMRUWd2L8c66nu7HH8YbJd/TyPEKEz\nz/d6YnxOaYyOpbL2iQyHShuIKihfSJVS2OoJOPEZRTb+iKx1bS+bv9nPXX5l\nZCkjr0zMXGzZzcuCUA/DlSKzC9JWeCzNvpKTNK0dFcJJ6vXb00u12IlToV8I\ndjlm\r\n=uXo0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4uWHp/NgWFMNWr/Bg+o+lLvMsFGa+l1clGV5fQK/2cgIgRlrHcBo5fchrrHXhYm/UKtuJZ0HkeqzSxutg2D6FO7I="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0_1607298658029_0.7326799969226188"},"_hasShrinkwrap":false},"6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0","gitHead":"cd24235c07b8a025562ad75faab0073e0d451e54","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-A2D9JxJKakJFXNqvz3BrFSTs2O/dQ0hV0mSlbs50uv3WAmxHCxMWMPwonph1lB7pxOBh93aWmXjPZMoGxQePWA==","shasum":"484b84de2a37d20d1dbb98e4d21f1afa9fc44a38","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW57CRA9TVsSAnZWagAANM4P/0NXma4zzddz/6t0pxqd\nVE5f8EEn231drHxyVKOzJBvOnAYKenFRHCmlM40tMd0P5YuJ3VqQDIklg55Y\nLDGjHACku5yrIU25FSR9HNbIrJA/Ke6CgVePWjMZYQ+Tfvs3Sz6U1lqptEO1\nFHLAxToF8RFRoXlLIxUjpYYMZmL0Y11aNZO3NYyqbufA7uMZ2q6E6drE2n1y\n8i4Uwsou6fn137rRq9VrSaOYDEsbo51Louj12kvFFZ6D0bpTPR+UwnjHh5UW\nCMEKAh2vy/mHUeMjSkVDEqA6dzAVMg4kIkrrHz7v5x3+waYQPGt5rpNXcoIZ\nUyvEgSJCqPg6mHnhj+j0MwUbBnXiKrkZZrOOJa8ZCzBGQSTzr1dy3a4Qvpzn\nY7nxa5/H42UuEdUJqWKI3fRhXgcKRtsxOea9fwLC/mVUH0sTnjUXH8UcF0iM\ner/itrWIham1Nevqsn34QOdyUEkD9gdov/tEd5l0a/BGcugnKJr3d84dcPy7\nM4D70euhMOJj8zrH70uTrQ2KRAWubyIKCqHdcnl6VoCd2x5+LdTL4QoyivvI\n8qRabRCIKOEwaL0cveOJTw92z4Q2cK9bvtOYtEhRGCV5mu4U+5gXTiASZx3V\nEbPzc2jOSH7r2zMVnsKlzCbsJ2ifUDT+fNQOBoDS5M64R5mKVDx00Efh1cGk\n9gTr\r\n=Yqgd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQqNlcGttxeN6IpW43kcCpavDrGfkMFJkf1uh1r10ecAiBWKJwF+6FVWLJ+127v0jVGpo07H2WVnu3eaTJDfuOq2g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0_1607298683223_0.36609444696670246"},"_hasShrinkwrap":false},"6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0","gitHead":"a206709f05000a0e321770d4746fbeed7360992a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-lprDwz8egAFjXTodpwFLUbcqBm/KFTnWK+0Arn2DtwhY2tnfEdWNQQtNRDT5j320hpLjw546EN3o+JpNWR2Kvw==","shasum":"bf2cf008d0205721046f36ebf583330d74d0e170","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW6GCRA9TVsSAnZWagAAazsP/1TEyNJ75jx/uLJrFJ1l\nCjhZgh0R+Ht19CyqRcA8rjk/4OaD8KYL3bvMQryFRvUhHLSDNm5BCY2aDOic\niLr1fISA4gsdMrZ6oyFtDGtIQ/g578TT7hYGaP+YBxYKfjDM3QWcmUlk56Ec\nI8rJjWqkzYfY/zDNv5+v13S9IGi/g5bYlAEvg6XR5ZOeP6ueaZfrX0YLVLPj\ne/DIhsdWfgrRenU2FAyAznHCtZvv9jObbpaLT7kq+JX3BrVo092/wb3qhIRT\n3MRX8e4v6vSpf0jf3+vXpyV6F2aqbMKrY47inaSN9UbVBDycrQZP9Vgil88W\neDMec09Vurspv/39jRRGtIW3aAc/wNPKzUxwrz1+NTlRMjzYjoK+p7S1Wmjt\ntYaiSpgQD4l6xc1ZFljyT9kL/Q8rqdoynRg8bGbbVlLjQ/9QKDLUmIRubnW5\nQziOM15R9BHUyVYbEUBmXaP3YoWHgKq6CsPm1HvbWdBhUVKD7jO0oTCl8C/k\nbm4WD9J5UXiPRs521ZUY/53ZHgKmFQwDIJ+WUynBQyiJ6IfrBf0NiJ7hg9FZ\nzOKTAFW5MWYxX0luplFV3K5euf+P5PHk3hG4KBhN22TuCiNL8BU6bVLEvM6P\nuUZJeR1lHDRpf1UFJ+09P3lsbFtGzuMi5dICQoaq/OipaJeRvg2Q7Mg0p+pp\n3Jry\r\n=QjMN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJRVHrpVxHWvLIQb5ApN+RK4HZ9nexQdwzMjf5bv1d4AiB4sqJ4Os47kHxU5YimCPGKkP4NkGaZkB8jZIdNZD3oBQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0_1607298693931_0.7344126760514846"},"_hasShrinkwrap":false},"6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.0","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0","gitHead":"b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-tRTZxc8xiisA5MSkQX14bmmSHnoNEY0e2QoFv/1+P1CSe4sE4wV9CRA5uNWevgS2eFQTKnf70Qi5gk+gUAvqlA==","shasum":"f820a2a0e73a5f2150896584118e8a1b77058f5e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0.tgz","fileCount":39,"unpackedSize":232747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzW6XCRA9TVsSAnZWagAARnQP+QCK9ylpGOKwHQo+7VXx\nSkjqBX4GTjfZB4nhsM5S6y5vmCcRdIz2qGX/BMekOJrqpIvXWuQgaNZAuXdC\nexJAlzt9ZMGy7jWYtRb4tmbBCJojK/+YTQ2dMgAyOlLJ9zfyMYQK8ATF+Qji\nQ5wmyY4ive9GZsaV9hkBREdtNoGNpy47u/geuhxtIhTTB/EATX2GdxbeZOml\nmVuRoamOJB7OmJQFA9rYSrdnF9hqzGgfRdKeMfXHMnNXS9wLVO/Kb1zvpHWp\nNkgtNmr1Lzm7JcsW2cqin3jdB5aNwgYx2eyWzkXxm1GkVbF5ARBK4vuTZ63f\nh4HTGlgo6y6J0gqemnwWQ5fZxzpugMMJIb1u21WIXyBIMfprbzez5HpC3OM5\n01ZpQgsPRyKL8a3VfFGhF/EwaVdCevqIptJjuIXbx/ptSwTWDnPHx8iN6etT\ny1WqofumtRKwLUH5yolqp2QvkaISN/kKUJe3HGOmHWizXrI7Qbv1ZkqYlvOF\nnQxG5K04Me1SsdX8xqzIImbJdEZEiAGg6SRLNGsrvQhR8fkYYchZ24hh9J5V\n0aiFH/n5vbYysLe0uQ4PT6mtDeDL+iuRMdBGOwO/ghjqdUtWh2m+KQM6p0wy\nXLTi/fHYTj61LIotp3mUbq0eG+mEfmORgD/XcUhE4yuZvJoxnq9jdWoKF+qK\n2a/S\r\n=Hdsi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ51fYeLURJT3bzonqr1mTGc+mZ9WNHH1Exgcl8zomggIgWdgdgJ+sXaKK02HXcw7wOW6uMiJtR4AjW9IenRDKEEI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0_1607298710891_0.7819487374069671"},"_hasShrinkwrap":false},"6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0","gitHead":"cf7f46c30b27d68fa02ed296d186818b94bea1f8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eelGSdkhQmXh5mbdsxvp4K8k2gjGG3h1LuWL5ElvsIxtdnz3st0wcgmq67NddNyrsuOPy8ET4UOb+/X199O46w==","shasum":"e9bc7211e41e6f5c9e9ecc9d64ece50c94eccebf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkHpCRA9TVsSAnZWagAAjBkP/jZLSHgAgk8yi4m1frKy\n29TpB6rirnf2nVoOYKnyow/pYJlJKF8NmWLMcCePswZKuqF4/yHnrax3Jw8j\nRWZZDEoUn0gqjaqNcJznHPyJi4PyZbRV2zGMQBp6QaaIAqVTmiGzDkg6Dvoo\n1xHoNHei46mrpxEiHg6ExdOApovx4M/l3j415vl6wMOn3KPq0R4KDDkBDjn4\nmQc/bFirR+Ua+J7TjsO7h9RZWA2fG2/rhmsH6pSqdEikWL3iJNqWWFZC1Hoz\nTH3Ul+VKgI0CZQj0ysKbCkPbHHjEpwvhhhas/DG/L5A0433UkBxaKB5Eh9/V\nT1BmX8hJDS8QX7ezyzZUdT6dsCu9hi6ePXFPAR93TobdnIUd2LPknnum1BKs\nR47Bh7URYOMRNyNuovPfeUZWUSBsn8BNl4YL/m4E8eEw+dp4xVBDBty4RvpB\nS4bYAWyz03/FPcM0HrEnxwONQ+oE2pHnCY5PvEri/fV/n2LFnFOJnIX/Sa3v\nygXDVoLsSauMeXlnHo80VOPRHHvmrPNCJNDVGGqg+/su8ARuOODAgQuvoi1n\nKzmCS2mx04HPciiccM/a2RDITflZppcT9KxmOunC0HFhX8VRcY9L3FsKGO9v\nSA5AumlmqIVIwSG+Ao95TDWdbLBs3MyUmgYgeBkX/zDhiaiRe1Q04drkjP92\n1Eql\r\n=+PGr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6WZw630L6mhUABKkJ+sSOY8SBMtng09ci/r7XnXaoogIgcWE0pDbb/AyrN3S54DK7sihHtk/P+PfEpmIbNY/4e3s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0_1607352808725_0.2114131498617542"},"_hasShrinkwrap":false},"6.4.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4","gitHead":"3272e4ac41e5623558b4aee24e2a796bcaae9c85","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Xw88obTMu4kOOedrYFs2hi23AQv1+kwnGaHnfNL1yOzHq038RAbpO3AuZTmWFTizcZj3raC0DQ//5RSOtx0poQ==","shasum":"f67236815e8aef21570c8a514d3dd86878bf044f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4.tgz","fileCount":39,"unpackedSize":232618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkJWCRA9TVsSAnZWagAAtdwP/i8QbcuSpWMHdy8m1TFA\nBlqBvu8N7zj7E/7bXQ+/Oxl1237ADCrTNbRgjNyxFCgjSNb1h/JFbW/fdpn6\nuDp1n6L8oIaElrZIRqvA5FkHrBLAGFyQd+Nad9qeLJGXqIQWYxkkjZC5jbQU\nBl8avUU2y8biURAf4Kb7rmxOK6V2SV79K7Z0c0qan63w0bMWtSLgx9ldlORf\nCFgqCTTrbOjK6Z4+IlJIPMIq7yDCZySdR9kxrV+2NVWoRWeqz1F4p3olQDjp\nHo0v03tqmYR4YChOSWoJqbJDOPzbWfB5JB1cQ6swJLPve4ntKoVe6v0qvsIl\n8pl9d4Ot7n1nmH2esyL/X+APZplRs84NwUFKkA+bAggPXhTtcG9YFLR/i01T\nMaEEfozRaE/2p4kc3BEsNEASasgQ99/mg5GDojtekrsGWcgNkMOwY7WEi4Xk\nQTz8rcq0dZKqh01TwWJMp9qY0yos5cBaRBJlIu1wA/tVKKCSwZfr9ixfZ5p5\n3INEiHKQd8guiy0+LB0JUX7HhNmaPvKXVIzOsWn7/XtwlVAUbMjMfqjwX/kM\nPAAvz4gzekJhGZEXi1ZaxtkYUenK66c3KtD61e3GU2N5Oc1hU/UpYNIXVMat\n1go2wWKBVTVH1x+h2fJZ68peijynupu8d69UIWVqcyR5nQWdbwh8xPAPgX/t\n14kq\r\n=mfTX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUcL11Cq+Y/Ndm4v0o9v5BG5VPz/5P85ayneP9oCVnZQIhALfA3FrJCXqR3cNdzaHHsmgBGmSeWKk1gAIRr7Rs3UxN"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4_1607352917877_0.48208272960091225"},"_hasShrinkwrap":false},"6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"02c056509681561a4bb3d045f06b81694f1c142d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vO83+RShj0ougC5s4XXOv/fonlf52Tsd33f/fuvvcf6nLCb3MQ1kPxfjgDSLgBNCFNx2A3C3qxgGq3cPgBXu7g==","shasum":"2c0bca49e7ee8250401ce7cf7ef5fe92feb826d6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0.tgz","fileCount":39,"unpackedSize":232388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkJyCRA9TVsSAnZWagAAECEP+gLxc5ycqCMwTpeusYkO\nT49x4qxBd+XgrcbOOcznb1k+fKHqBfbsVsggPOyyBEUWzxicfemL/1kNmdXQ\nGeSgVTKPqPqMN0urOnuQ1XzRNEeVyG0Gs9EBFP2ftJsRnyZZjoteOS/3qZ9v\nBgPb/N3a723FriTNdCngJbrQi00bD6Hikqe5JUtFfDw/WikKVODO7P2MhB5R\n6DmTc16iFmmRkCeWAw6ehr64pO9HDNjqu4TFclPCFv++83ofAepXdO6TVrxj\nu0yjMqTWXZC26iAKQMKCcSEokCdmQ6+V4zwFgTPa3fH6nIg5UqKfkdx1AJ+A\nofpXMWrQF+Lzc4QjSMyzAOIlrhOBaYxxJQ6/aJJIR7T/0le44mISnMYBIHsv\nWLrnShXixGno2EqqQGNLmh0cfshit4U3HVVpkQFRMUAI4Zyd7GXvhXd09INA\nWK0g1/8Pv6FaaJNrXaDX3ajBmst7lLnuOX/k8tFGTg7gmaQWwFI+4HTFkLIF\n7C5JFczCF1Ux8OyrNaLSH0IBuB9d6nhz8NGkuPvFDm5JQ0XWiP44KOcfOPfQ\n2RGTVLYcAT+hflgVaCYiW3j7qHJ4OMTviw3KF/W3BFVDQPl529O534I/FeJX\ng4wKOhPBz3RJctD1WYdvLthp7/AKZczpGRole4DHdOjoxsV0DqX1UrR5RiP9\nFaPH\r\n=yhu2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZdpQ//gOimZRx9iw62Z6WsSxpIFGHuZTO40P7ozHR1AiEAuL6/7pg4wHd+gTyCtgIW3NlBLGoqyqmWhSLgLew1NNU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0_1607352945859_0.025029320169718927"},"_hasShrinkwrap":false},"6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3272e4ac41e5623558b4aee24e2a796bcaae9c85","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZUmDJTMXH9PMNzzFFJaD+QmYetgo92yC3+K5wIlscc97lmNXozyV6zEClXEjNwb2wOx2aPA2p3cTequNtoAF1A==","shasum":"259cf6512ee91e515727a5e16e9d25812b318cba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkKHCRA9TVsSAnZWagAA1JMQAIPi50XfcTl1N4rjPWbN\nnD9zhBFbZsMGfU+tbpi8qMu/FWjL1Rv3aRzMdTciBp3gaE/VGJl3oiVJs0aP\n7B0GIq+vfxleqhQKduKNTaF5T+M/oJ22VTEL96c6eWCciFLP7aYlc4/lATwM\ne9Mgu9lLnj/I6JAZiJSDsSl4TVLqVw1jkJS02R98rjUSnxbwLAi8fElD/bSO\nBApz/QTpjxQyGfkDGTpWKwjn25/LISKieJh+nxHTeqhla5cPrC9pVmAzs7XE\nyqO7pJu5OjCBu9pW4xLrZrlmgD/5iny8uggc6118F9hLBwNikhXftXtAmNuJ\nTlSsJEz6HDLcEZa5WwOUCppt3H2fjxOWb4OTnMQY5hDVv90lxEvQDagLwydB\n9RIhyWuD4mXGqFbvjctErjny/Ggdwfss7qZgerlu1OUg6iBmSHU9LWxOfPZl\nw7W6fTFh37syerjZNVQdFqavzT5Z3JKeV5C7xqWsad0ivdjO6SoIbq8vHPF3\nTPaSmLFUemEzKAKpCClsO5bprjBq42XU6n4H1SCa7G+/SFBNgp+PK/x2vvJZ\nvsgTME6v32WXHz++yx6tAn/L7NumyRvlUuid9QpWG7rIQUwCfLaKIa7OLusZ\ne0ObUlzDkVD1NtbNBIM0ul5CRpMe8YqkSmH5GXmWOarM8a+UirpPFLraf3cS\nde1e\r\n=+XhK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwECQf0prSNHkcXvNTQRam2RzNmgH/Zm2Iy+im7Ne8AwIhAN3vP7W+YQcnmo3Bvy9DpvNgD7+pZtyqFe/S3UiHCNhJ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0_1607352967052_0.7190361567053625"},"_hasShrinkwrap":false},"6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0","gitHead":"feab6a4a718e9fcf75814659b84a6d1271ca0d42","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3wFizHfmg07PZ5+FjUelNwcWIhqW507T0pxghhzi7zA5Ju249glJ6kHg+2qv28fokZuTaea68JuzgUOsHPMZPw==","shasum":"bfc742c59d3051e6c59bfe6727eaa5672f36f1d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkKcCRA9TVsSAnZWagAAsd8P/jbGUCFOvSapOHiJLRaP\nm8MQIrvybueGde90b/Em2l09lmFR19wEVfxeWGdeavN9ogiQAAyU/WAW7sZC\n7Mq1Yr++ap/g98lubgH40yWHGvwnCLHcNdoHdEiiz2V+3l192L31HRJuJKNb\no0XkrXCkUoFze0pDrVZZroR5CqytTvMfOGOgpEDrSHFaW7yyUgAjA98eXSjb\nGs8yRq0LvOLWqTIcTH7My9khNYSEj3ryTQsgzZOm7ussBj2jOi9Eqhi5Lv3h\nfcceVPamBv+bgrYGMmZ6TbzTxoVWYaOWi6b/bdzF83SvxOZDpNtkMgWFBeHr\nJtGM2SjUybYGA1UhzA6uWpoWZ1s+0nhh7ciS1/JDB6MCY5VTrmDTAMgkfO3B\nOwx06p0+rptycB3IUrtNpo9k6HyRDOEIUne+UBQMIyQXLz2cxmM8d9IW6YB4\ntMZsGd+HivU5KX+6r51vIzPLHE4i4ATFGQf1xzQiN4IJdegn5kA1QcPMR0Fo\nMotWWV0nQ1YR2QxYdJDXGMRtyDKwl2EXbUicnmOQC6TLdVTc0zbkOikv/+iL\ng7z8r+lulBg9zxmVzD99oo46L3M0+Qd/q28IS/C5+ZB/q8CS2lMUnT1+RXTc\nsORsEdEG87KeYT4OEUwMPc8DhWzG9/V/xdVWqZ8Dm5fKgLDmp4Q+VKjf3f+p\ngGzE\r\n=3mnx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKUnHNAMhb+N8hpueD2lPU1g26WUiSV3RBK7v5zJ0VuAiEAveRs1ptAMUXMGRJ6IvpM80ejZxhapu8e9Kv9DlCs7z0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0_1607352988000_0.6192032757812909"},"_hasShrinkwrap":false},"6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0","gitHead":"199a22faedea2b279285f026435310a3fe4157ab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-oP4PKFRgc6tXpoUzeuyozXg2Zmy75GOjs7pJwGcM1AX4cdLpqZpIR/cfCO0RfTHKVAgBThs56FMzwLbmVv2ilw==","shasum":"fbdcf7dea70c78a931d9ae6935e917add82cdfad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkK8CRA9TVsSAnZWagAAqaYP/2x/Mz3R0o0zfqk0+TMm\nn0F1xFN2CGGHjXEWkg8w0xDAF48PsjXnCFuDj0qCg/ZIjgN5YZD4qPasVN3A\nrXVyqdAaBc5QB5XW10fXLQtZQZTsyGaZvVe63wGRhB1BUfoIh2QNcauWruSL\ni8SJDaUpNosIb8t4NnTe4/J8YK+hR7S8fHdlX4uQalte3d6BclYVpx+915xc\nw6zrzBwcsbAj7YsYQe2U6WSb+FDYu5f3TZA2db+DxUBypeyp7/s/r/2mhOv+\nD+JFYxYu4vf/j5m5AyMMfFafUCTPlnzN3m80Hw4S111FkCznERrsPuGrWY9H\nHdmJF15PdGiauNBcu030EvQB5hWk/adzn8DbEQ4MAOuB+quMQZqzUoYpVyJi\nyj8FytDNKmZa8i358Vbx26J5v5e5ImN18pq2iLkawD/jOFcJQU828WYOE/iE\na+2kjedctG4X1LtpFpCEpkEBngTfGWYDm1cKtg/DQgs/0McbfUVnXHyQMDf3\nwufgVkkKF2obYF3apDa1HLs86/uB0EQrXXrNoSnXlhTOC49PVq29IMuQOizZ\nrnXQGu1PTMneEJYY/JyWRoyi6gKlkAoFuKY6dOxEmVogo5A9f/hHYmR5egQF\naSNcc2csFDi3ycTEKts9HICtY4/hxooVQWgtBe39gDYIluDNe0EgO2ubwZST\ncAhR\r\n=93uy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDWApSXJqq637jbyzVoM8Agfl8Hvr3UYJWlsMrxFFNjlAiEAlc/Rr/SaKCDRA/WaVGVp7yj9M101D0zz8TsaAPw++ms="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0_1607353020116_0.8610713863167667"},"_hasShrinkwrap":false},"6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0","gitHead":"0638cec7c4442f751f649ce8e96fb309be040fc8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nvwTkrXr0ByzRE8DzXG76NVIz3Oa3s/nFYJjT8Zuji+dm+DTaLWRE90WQ7D+x1YoEOcfKU+IKLropGRdv0dt2g==","shasum":"7975fff7763587a2f2873ace31056ef950e40758","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkLgCRA9TVsSAnZWagAAGtwP/RW3+GeH53drlzwnpgto\ntCCDNIlhVTLV5P+wOp1WvJvDFIwUA358ujAHH1wVTAVyyHZZB5ce69xPe+o4\nU4VmFXAiq+purDUUUCrote0NPQUw2Mb+5rel+OiuFoHE16OeJWDTfQM3EoVM\nM4jPg+kmeAwoHYss2VXvI5TZcIYQxS7PwVvFWHsfJO8N+ovXovLE3QEtUGav\nK3ksmZUev8cFDrZiLyVt0flMyK2XkHwIhCTdsnGFF45vKn+T4Jmh3LdUmTcX\naaHorjBGpYHfIEmXzaWgR//JS12dgvybcaXkhII6ZgP7y3iqw33JlRjKGANG\nYRkb6+wgo34HSjasiayaDf1lziUHMIDeLhPSn5ASOwdb/ngM2BiXmTp+pEYV\nea0A+xMojvJhahWgWSTVyyINOuhZiDN4vK6MTJypvODtd01WpgcTNey7oNbb\nKU0fNvzoUhdpy/+xkEOLjf7HcZgdWIpnKhYfyfCu04HHnFmYwBRZeTk/LlFw\nm+llZTJVTraw/4/3KtzEg2TeP79PRrVM1ezfA62f6q5CQdpdF3CJ4AVtm5tu\n9cedX2fGoZiOLr0yDrrPWmaV0f8X0gAKqw3CgvhbE7QskBG6B/jViM+Zn/bz\nEmfNkxlOVFpuR9fyA/l6P5HFaRoBQfADAGVNP4QThj9UiJgbogpcYYKM5B95\nsUe0\r\n=DWJj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfVeLvf+085WstJKwO2v88OBAqZsNx5QabBo/IK2YOxQIgZTHKlMktVxt+cGH85aBzzn3z9FpUSaAcHqdQB3UYYbA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0_1607353056116_0.028885898132729126"},"_hasShrinkwrap":false},"6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0","gitHead":"37039847dbc3f91ea2e691f21cf644402fdb7ca8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xDKXKAbbz1/oPeCoZK5sCSDzlfjA4iYkJnulkB39SN3DVxCqSculMl1LH73XwvW+0z/ezolk0vdPhxnblFHU7g==","shasum":"8531bbaa20df0f0eae267d82cd09c6f2314d8efa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0.tgz","fileCount":39,"unpackedSize":233020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkMuCRA9TVsSAnZWagAAoygP/2up04MqZ2fWqcBK1hXl\n6h35K7sd68gw4YML6cTkbftan1qGXHS7JZKC+fJTadlucle0ihJZAoVdSU5h\naeLSHEGWqM/2SLqTkD3uboXGm5F9slrroZ+UWeHpk5RsPEpHeU9FID89klS7\nBDu2Ho363ylYDEy+JcgWJxAvmgfwNKzBB7YoSa99kA4236BOeyO13gjMnAjh\nHgmRDXAE1W4eQiuMH100bA7XL0SuRtXRFzU8oG0EZsVx0RZzKCSEnAKmmj3H\n37y8SJBlWDXEVXBRXYHuNMuAkY8tdwCiq1NG2U7+qGXugd0W8RZtLOX0/6gm\n8r1Fud/xrW7cZWicgBA0JOzF3ZD7ZxxpFZJDpesFtq2RQ2cijaa2hG7H804m\nDauR6YkNetbhZ5FxO3lUk2ksoXgXdxzVlawzKhYI3MULqHtHQP3bYmuklxj8\n8AJ6e9980yhfesd/wZmgQJOUMECNtPNTonxHFRa7BjbLm3TH2geCkKYk4Pss\nkV1CkuSSF2h9RbqMmfIxjfPn2HZq8RLaULFsOmHRKhDfgiSO9iciHCPAu7MH\neTOyFCZyoVgz0b2otCSi3I1iJtVYMzj57Q3Xn5/QjcrLXrMMnMyUoQ9LKIcY\nsy7itfl7mdqBeP4radCcH8SlM45ZGrKangcKNNOX5qWMpDryVYLX+swXmlEj\nBfv9\r\n=MKhs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBJ4iG3vY1AJbPdBXq2tshlK79GU//XI+l5VQP/CR+tAiEA0LWrl80cR1PnczhWmA7trTjogwn5FJ19il80IP8eDGE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0_1607353133845_0.1475230784813184"},"_hasShrinkwrap":false},"6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0","gitHead":"8255902a041ce0d0738e422f4a190fc38fd1e40b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JA1vUPYv9BqT8LlPscgtYg64Zjj8iCUQR/fFkt3vY4ExxqfHP3tTfRedf32mF5sAk1IcRg4Qo0lJJzz/vKplCQ==","shasum":"40b310f7316c13e13df48677d4e0573895101e1b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkNnCRA9TVsSAnZWagAANIkQAJUyAYd1a6raUfcOvrHB\nscuWlJuHj3Nbl0dufhhDFKxRwDcr9OEp3WBVrpmtRZqngGX69JZTE5KnbzWZ\nOqlIqLhO7PYpgymIzWqhzMrPwlco7vyItX5dtr4dxVKLSsPdD3uhGYZG6zQD\nQc3lfVQn64Jl+iawdPw5pd7XHrDsue/s/CwSU/PlN1fTkPXTJf1jtIVbBqXT\nLvZFBa6xgVkscANoVhERw4jWyPiYqqJid/5lQQYM41ax6WGHLgk9e0oeULwy\nD7l0t1s4oDWSikK5GZiyJenaGwrkqPUjxCRDkpGRkSafuvT5Jl8l1PL0P0S8\nk5WTYdOfPDRkq6pSblBWkydSXJftNT3Wn5vr56MEDtCnfvjrPdAhLRVvhRDO\n6FaRo+mLoXHWpPoYMePUVIDk2VVYSAuO7w7Qzb/AgDg8gJqq9ziuFuzMR87E\nTTaKnNSMMJ4mzOVje9uwSa3NPbj/HcOC37U8ftT++eleQhvwY0VImYGwcEUq\naCeWDv6PyL/UqfK41T1DPIOcrI4/4JBgVtg4lmQtikbrQ88gllpjM23c8WIo\ns1FqTIMldp7eE89VpMdr3VZ2CmObKkVkUEedK7hUIdmbRUF+E9pb3pBuetEP\nw0A630KJ+zGyYLvOsRI+/f2MIqt93BKAJyqUzXO8aIMt4xzQXr1lau4jEW6t\nflcz\r\n=K3u4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIkuYAHy1PjJQ8tXz3H5BTCHjX8rA4uZn2FSKMdshtMgIgGagqu+xy4qtqnDuOmjeL57uJSuujC+aS7pKkWdtzO4A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0_1607353190685_0.9007691178708448"},"_hasShrinkwrap":false},"6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.16","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0","gitHead":"831410c14f3316d7375ceadc27edaba4f6c7c591","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QKTA0MHhYu7HiIMSOM0Cls2rycr45YpdeoGe6wpqklD2t6GZTLgQ/48BKOiBX5kParfO+I4Afp4giKfgB1cuGw==","shasum":"184ddb40fcc0315f44733935206df21cfc3f019f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzkN3CRA9TVsSAnZWagAA6g0P/2mF8aEa9mkx4wTdfj5I\nvak5fI+xF5Oo/ZzIi4+4x2MGiwhoSyjJgcXFgFaiKYLZoBemzjMSQ1IYk8br\njF8P1G31P7xPuO6adf7YTVnd6XJaOrSREQVShgC5Vfwpp/UTgPHR1rTtLavM\nS5EQoFKLFOB9mZ4d70WpDrsxjtcOrwUnuqMPfo0ZSgg7kLWa42W//kwQAXkq\n3cQ7oBhptlQ/XE6CF4lZaXaH9nUvSKwE2xUUIEfRyTSOU32OvjvkMCw5eYOA\nvhYYOReDLMQkoLFp2CwopTF0fCzu+DwnQEM2pnjsZxZfo/uIY9O5Nd2Qrg4P\nqvybrcMq9Xt8IkwEAerPODpFVAYTB5r9K6/Noa16esD1iMBiuRPQRkyIdZDp\ndYwh+gW1BcXRdN8GCISj0R2LJRv6oUDP5pGmsXJirQYbxjUGQqCAb0LzHOU1\nsLTZ7j4sLnU7PGvDzkusNZ5DZsbzgLd42Lyr1yZlwnLIK+pNPq042i97NjJH\n7ou4VN4bYZtbjUBMM5U5C3zZ1Q9GESkIgc6clvnqOy3hXr6arMxJW/TSm7iL\n/Z+lVopxVo5TLFaHQ4kC3RpX8R9fPAaZUtkg8b9xOTgBu8uvl0oR0WIPqrLZ\n45OKdjWJmYdlfgVrhLuJviJx/26mhRsqQ13YQpQ2sY8d2JgCCcvt5uyWBlAn\nffiE\r\n=eiKr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDi/SEp7CiBv2JL3HPKeglUDKcxX4xMpRerZnmOaoy4AIgaQ+eFDBvbDFgD051fOgjOxJIAE+5vG2lNOEMX3e9i1I="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0_1607353206812_0.7474576169736489"},"_hasShrinkwrap":false},"6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.17","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0","gitHead":"4366d49f5ec7122c1566d00af0417751f929439d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8ad5UK0QD6eWzhqYw/Bs5WAY4yFUARtsCXToU1oOTpRHGPhZKnHbQCwK0Ny5CS2P1WaWFFH5T90UycUkMDA2mA==","shasum":"aeeda5598e52d2ee530c7bf7213b25ac3ea7e8bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzw0JCRA9TVsSAnZWagAAlMwP/iDGPoOBTJH0rycO2fkH\n3eMcQ2H2pFUoBpv95Ra7ECL+Gdrasx6aq0imc2L9cio7iF1K/gcdakNKl51a\nQxiNIppAv3+r1eb4iKQx4me3RbUPgGqVKqh+M5E01ZhXRZXGOfgmgigSiWWy\nPlJgPI0QAc6x5GCDpuCMNQa3R5m78PH8YSXKcQBU7RDxAdFIfMLOwxjZfYAS\nuRljFexg0qSpQugh5upd57iUkPq+IrJfgO8B3W0h14rsmcbeHuCeswpu/2v0\n0Rd0rTfV2ugF5jGJcQApXY+U5Ds/Vubu+6ZQ8ywFex0p+MNLQtrgdhOvdVd5\nQnzUaQvACfaeJqL6XpbLnO+Y8swG6CVg+N+Shl/JnryDOTe4VYlROxv5dbXU\nhWceLpndI5ysYfL73hQDWN3hRmamsWoPbKLBeRzOjyhWt+IZDcOijRl91yNF\n2ons4wCYNghf/M2zqYC2JlQZagl2uovp+Y+yeQZxmD+R41pCtgKpWYT6LgCl\nMZ7mEDtBf629D9dxBi9Ha/uGxuC9L8oxIGmW4aACyxq1rWH4oW8IQdPHBl98\nIsUboADTL6KPrfc6FEPCnnwH0mn6HT/JvtAUQWfXTg31U+Ni1sWRsN4/NkC1\nXc5aL8j4ckQjgEADKQB4f3pjCuODz2w1081aJ2SuA/k2INZatmnylvfLNozm\nT+mh\r\n=avPc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1r6w09tDFiPxFScvxXljXesmjlg0HyvZCu8mkt90zoAiEAvs2tsG7yUgi6jw02m7GYy7ikxK+iMJwUgsqW7v61QnI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0_1607404808426_0.6489447503861889"},"_hasShrinkwrap":false},"6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a5ac14f58c988be0b6dabbb4746e942a481f5fd2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-KQJB27Yt+hBOx82YopvKI3gYxuz5LZAv00F8eI7EPwnbotIw5XWKBJ2/0mV0OXynZQHUdcOvXRALlXIma27AKg==","shasum":"1a37cfedb835d4611ad6e868ba1d2df0e1face58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0.tgz","fileCount":39,"unpackedSize":232661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzvOCRA9TVsSAnZWagAA/b8QAJhEvpovN/nuOhe0XlFi\nFcskKeyAPOGAEk1XzjVpp0WTg0pb2aIWqf9djWvRZ+xfZHeRcyRFNSFcjxGW\nn02b+aivQRTl2EXekqV6G+MEp2JpO8+8Lc3sRVZ4MJA5S4oi2vZI9PmCCoyr\n/hM8HuDEzmz8mXX0h21NVUNnvGksJ9908oNaed9dC6/QxK3l8qH3h8nUlmNN\nGc1bLs5mGS8GRsdgADfqK8DCZ0dOne2T7IkJp61Ee+Db/HS7DPpPm9DPcWTi\nXQ87kxO6KG/UAuvxpieLXXgbSJsVpq2FfXVlpXelDWSqKckv5Nr22hv68Wka\nsn9xjSd4mO0zPjEl0LMNfJpvJM3B9AXsSK2rrr11qqp+yejdIAc1K4IxraQM\ny3Juy/Y9uTxxrIHvccgGz+zeV9EepiovANAEIxhYgl3iqpqQXS7amOitQkPX\nDefWyWMqja0QVIuxUnI+uxxcCuXl7RyDGjeeYXfXqFQpTafncydoWP0/Izz1\n4AUaVc/nnf6UgRHvQ/NjtEK+r+iarIr34FZaqRiTu5R3+wVYIYlYhnRj/A88\n452UkjPqM89hJE3Co4lTY8iWDrX1Kn5HPIUbTsuu2ZI+CIvXj6KLFRzaCYyd\nGIU+XKOfqeS1AV0ayF2OVc3caD4p2AdCv9X6UeQ4ZPraZ/3z4Z5eiDUz1A+n\ng7WF\r\n=8V06\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMnoC6k+VBf932xNVGlO1Qh5MV+MXoc/MoZYcP/YJlZAiAgiPADm3OAXNzMac/inY1KUbvD8AxTsyLo9CCQ24ouzQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0_1607416782026_0.8163101187913364"},"_hasShrinkwrap":false},"6.4.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.5","gitHead":"816c30ed870be964aea86196d96d3df5cebf2edb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.5","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CS1arYiyL2Hx06bk+uZOnd54/z1TM6hjZO+QwdhBPCt7lAHsF9zIjA+GKeisOOPIoLsDOH3x88sOO4O16C71Ew==","shasum":"ddd38cc12c994ff0eb27e7a08c328d202ad8b3b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.5.tgz","fileCount":39,"unpackedSize":232890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzv1CRA9TVsSAnZWagAAUGwQAIDC5GtQQIBX2kzvn1cI\ntqPBZgWQqxEFH797NblTqKIZ/LBuN6nVMgTCPICJCCJnv3SqE2l5eBI6ciKh\n9mQ8rT6eNpUl5dXeo8cCg5vmr/gTs0Eeoq7/1sl4cqy+DKmD8W45NFRjDLF1\nxd4sKXcZVSfny2MbFYoXF3XQL3oVpa6virIvUiBgmMy3kNMY9Ij1wWZn1DTf\n2qu1t/G7feEvD17AqeLfLb/cxzBDXesbFkIDas7yXA5oNhc3rX932wuqsnjs\nc140T3+0oK1DYPbRvd09k5MtLl/q1NGT2ssFnS/zl0XxxmJhpoDBhXuVtGrB\n/7T74FbbRud3nuOpKiqZLKLDG1owzOpNTTtmnjohZCpXU+TE16SbEZbWQEE1\nC0yH8Jmj+JdFR4II6Y5JF/hhG/0OKkuGYkXo2SJxkMJWIpF0QeLmL9Ude2Kx\n+E/4NegwUfazgpKQtEoiLNEIB69fToLvr+cOQ4Dr+pPByqOKjIO6Qt2SfsH/\n9vEMGwkU44hJPw2t3+9w912dZKgjOWAlbq4bzjeyor+5ERip36Rxn3xvbiCv\nYXUmJI4mcIE/lfjWsRicfDfEkocvRr2QUr1qLlvbFgNHXynwvmckgCsBgBJx\ngV/eoMLLDKdvzLUwibfV5czDZQ/ilhfI1Lh9sfyBLmsniIeCNfFENFZ/siuV\nBaMK\r\n=CwBp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMrpz4CqHqJNDoDwQhCdPWh15eiblTQIm+pRtRKdInXAiEAmG1WT9a9+hBPGRWLomAbInIFBEc6Vev0LSjt8amkrCk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.5_1607416820968_0.5161654046106701"},"_hasShrinkwrap":false},"6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"816c30ed870be964aea86196d96d3df5cebf2edb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-LVhWarasY95nl/B91BaLsTLZQg5mFd2fxERbqDfX018apmoDN9/A0gQdH0k4RlwVkrHQOisa60AdjKsbTeOx0Q==","shasum":"9a62ccbac9e387f08e736be05925981062633628","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0.tgz","fileCount":39,"unpackedSize":232933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzwQCRA9TVsSAnZWagAAfBAP/RYO34ouqESp2OWM+0Za\n9P08zazF/ssBmQ9FDgUbS3yKU9D3qboVSH9mYc1kAw5PLpX81z1FntWqKbG5\nOQIiGh6ul+Z8D4P79QtvPkmtG1qqi7MP7h+LT4QyeeLSj5fy6eTmxPje7Bo3\n/ZIE/Jwl3pYVhcFY/xK5bXjKxBLW7jN43VfAgTNrmAJKcwDm6nUCduAyPmn4\nUxCtqD59A3mkQ0YKaC4LXwk93w6LOacRLmSfdbADM6bHeBKQ8XPY9ecoibSl\nc6vb1NXlmg2uPY+Vq3Czf+/jQb/puOaMhPESQnH68gfEYgE5yb2oRiXDB28r\nIUY48YBmoNBSNxs/EpmzlGYj3qKkGM9GUgEnPhJRHjcqdmvKYEhrekpX0Z+A\nUAkQvXHdl/Nlz5ZKOuiBMfZtX+FgFfhX5bpnS2ErzVoddJiucLZ5SQOKECUq\nKFRG4jnlTTGTEys+ZML8DC57uUTQsDSMm1ZbI5AOZz8dl14EaKAkQa60fh0o\nThP2SpxTZjJ5rQuBPPF12Ab7S1hlTaE0ca1haULj6NM/REaWet9IUvuPp0Ma\nK+9cWnB9j6HVg4oTkWS4Wp2fQ9KwVJ/ZFV6/hKVuM+ifwalS5Wp5JRWWwpdj\nv3/IkSoO9D5C7j2gW3XoI+k3/BXxqAJgD4zYm9ECU3VbcTl8NYVdYC1tvqx9\n4cT4\r\n=ftna\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwS4Qjfv7c+UHkttkttTBTMjci5fjtfmU87pczb4crFwIhAPNv4pBcvxlwk2quO2ZkjyL5sVm7d0+UQDJt5G8akU8/"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0_1607416848076_0.6782117940897683"},"_hasShrinkwrap":false},"6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0","gitHead":"783a6f94708e8d4f99b8c5813ff7f1256834817b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vd9poXrSbMwWnJX9YTa8X/ftMawODkSP0gn4iR1LzMNhPiWZpL68QEr99k6LVe/8zKzl60NwzZo1pDeK/3NYjg==","shasum":"8b7320baf9671f6735877a64f032fff7b16ebe6e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0.tgz","fileCount":39,"unpackedSize":233292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzxPCRA9TVsSAnZWagAAwrAP/1JtqBJa+uXeN4TDNXUF\n2AkRUTREvbN3GclRkzfxBypulJLiUoOfPXbFgpZUrQA+24FsTsTdMa96hWJJ\ntNxVFEOH3GTsIGQN8ltlVmTq7MpacAoAzfLevw9PvM7fN8u8YUUW/wskkPmW\nWNQlFh00EFEqWPwMJ4jvhbE0esYQKtM0CDaJ+j6scuDJbXx0wCXxy6pz1z3V\nvGb48m6/F0Xcs8Gtd3IDhfiAJ3m+JGylG2MfPAHh05f5mVNsUGHaooKKrOFB\njsvI7U1BWjmo7e4IMa8JvoTD+PszCvGHYhajcqFIZwd2ReC538FlLqZW7FRQ\n+xJZR3VgPQE8Gy2mL+2F3wL5sXndYhuNJEWh1ggl35oakCplkv+AWOKv31QX\nBsObrpu0U+nU0LR88CufEj/qTbfD4WtuLipDD4HpPbyIjSeolO59bBhLlwz0\nJqKz6UA+s95WVonkcvWiwb+FJNJv6R5n30Q/nQbx39rWn5Tp5Mn6sB9BM1fa\n1o0QENQ4UhrbS5Hd9yY0jtmdEf5eb0m5i4QkkKjBeCb9BPk+uAfq6/RxWSdD\nxC5X9xyfyWuEzxB/y70zOOWvyqBGRqZIa+aVqzTH72GiyEdlxUvluvqAC/z9\nE29VceLrOFoNqaVM4Y2Ms+5DJTXgqISyw27/pucNQilXIP0jgmNgDdyoVoCA\nJRi5\r\n=R3sy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6kGejiUUEMjdxPtqvWnSggAYQbpgaMxCHG200LcNGZQIgeo0ytangtOgs0X0O2i9yd8ksXoM0XlU9SBB76AHUy7E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0_1607416910736_0.7672895301207783"},"_hasShrinkwrap":false},"6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0","gitHead":"1d205036ed753ef4440ceeb086ec5a30c22363e5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sW4U2xqw9sdfoMs88KdTeTFF1YLJkkFPUtIhUGhLsA6HchGIuFeXA4ErgzhAmkjWBzo16nJ8akYPGlkl+BIfTg==","shasum":"f66cfc06549e975cbd69c235d40204b73a0fdfba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0.tgz","fileCount":39,"unpackedSize":233292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzy/CRA9TVsSAnZWagAADgQP/0ayV4vAOZyFwdyNA6Ri\nuqimor1EssKZTpZCr6KWFrpV+wa3vhwuRKNJLwZwnmoqNd4s2bTnyJcQj6WX\nhrD/RsKW5B96QGnhoaDuWcPqYoNeb0kBudmSrD2CvWEhWaAq3DIZdbRGjolH\ne2F438OO2rz2/2ws/PTXtINFvJUMwt1OsaNFJmxccKjP5ylHTt8ZH3XtNH8S\nYU+24cXlwpofBS8++biQUWo7GVOTyb6wTmA4b9tSPX41H0uQ7pUZb2hUjr0Q\npGbfjs9+8/dM75oPfnASlHCYx9GXYl1IGFDJuqpjc5VBsc5PzHK5lZTX03IM\nWnzWmj7rQjfsfA7bOlPsIJLtqUt8h5vt8lI3D1gxVAkKGhFCMeBbNCliIVsA\n6U0jOM0zgoFQdFaoHfwROLtowhu9MdmIinO+Ju/ZIDtN73hejvIz2uZSyd1F\nw0el2pIjv/WgZUG0h9SMmBOmRxhlW5h7ukcF9FHqeAGKG9AMxgBIHKHv85hX\ncEMg941Q9H9bSxNteNksGTK3XUAIhU91KjT23/TmbQqx8RchRFU8SC0bHRkv\nrThOw+T9Fx4fpD5tAwnq22Xb7Z749OT2aaL3HA4v9zzmX4CggmElhkwYjzC5\nwQBZptr851Ds5lapTK0KWksNpKWU9PUchUG0nv7MUA/N7xpKprSpdwa+mudU\nrYfn\r\n=dpss\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9mh6/wIyFlKZkD3L8ZhDPxhc4HoNW2M+fIrFM51+f3AiAs4hzM3neURTwxYWEHYsO92IPSJ3zmx3HTI7ZLvkOV3w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0_1607417022509_0.4106826756645532"},"_hasShrinkwrap":false},"6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.23","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0","gitHead":"2f3b07f7d767d844d00cc5fd975f0770d4746674","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VPywE5ABeGQJKeEyrtjTX26IckdKGKTzuC/XJso8w4LFcflOqPjlDofRcUhA7zYYWz5j8XVQKhOzv+OixCwJFg==","shasum":"1099f9c188231223ad49ee18be82d2fed1e9ecc5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0.tgz","fileCount":39,"unpackedSize":232933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzzUCRA9TVsSAnZWagAAmZ8P/0L75OAW9o63m37Xzkpo\nu520ZZCnsOiSdMXjmNI0A/Wsv54gjINU+fzZjJcPuNThmqPo7sRlQpZR/vkN\nhIefWhnyVWSy294g39NJB2fCj9t305UMRsmFy0xVtIykdehPHXSmzAYWAoep\nxbUgo4yRJrXPqa3Kegflo463jOgxoh0vNR3I3AWomW8BEp7UrEyyE6hIw+Gb\n5RXYexQ3e2xP1ozuvB0K4M1m+OdTQ3ynXCgCJYuX+Hl4ioiMRUe9Sbfe8Mbv\nSjrh+cZIH2pts6aVh4l0mn/tN0//01SNBn6cYx2q9ZJEBj7t8BhTaRiw/9rv\nKBj1Okn2f/ufunOOk60yzu93huv5TvPaFB8kYkg6Nq2KdNRqYAjKKbPRe1Qb\n/cS4iDUbR51Yls6nE1D2YJ+jQ9GQfryjQsq9RmbIK3jKA9E6iF1W5JE6L7hq\nokLbtWRo0zEcpf0bjof3Ju++FaJttuPz2iwC57bZr/tM7TR7unGb78y/4ttD\noKwP/Eis4BYnlz52wMeBh8svhFf7qBcSxSb7NBlhKL4NwcFxixFJfOE+Ipis\n61Qv3odDOu8PWQQSPweLXXsNTjZLWfLpQ7NemcSKJM18N8IhVD5xUDDKA8+Q\nBM5hFW2Uv72narpfavTApu+ABO8ohvSi8vSX8rSHve3Em+si3qcwIrAavM1c\n5o3X\r\n=ynRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNW/CJY6Qn/+ZXCeq+IW1KQZT3dJ14+2OfcuplVrlwIwIhAOIpMznjd4Kre+8thLxSX71vkh2tnzy/ACx6h8wqbvrX"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0_1607417044307_0.05222217943402785"},"_hasShrinkwrap":false},"6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0","gitHead":"7104010b03274c9a8cdf6773c0cf8997507a71b0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5lhAMtVTzLlG8LutR245Mq2w+ZMjuFdqdhM3ddwROPQ4o+9rNM1VO5+fujKSdb/zpZnqo1z2JmAQGPiF+k59OQ==","shasum":"651e2186d69d8aaf783e4799cefb3badbf90cc05","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0.tgz","fileCount":39,"unpackedSize":232933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz233CRA9TVsSAnZWagAAhsgP/297CU83DHmt6jfcIT9b\nlzqHFx9xxrf7BluanQoxrJ0FtSGLFh2xLXCSjBFTj/09XxHM43Ut16CgCy8v\nJW9Pig2Ak8BcmxHgx04pnIGZxOXas8f6FGbrFquxiFMc0a9e7C5p1BZsw++s\nOxj3R4QXp4pwV8Q/eyePZLAOfxpV3/bqdSE7UwHMAf5HDxMSlMBSukn0ul8C\noxnpj4ypSugkQriXqQh+fmnPP/1RMdWlMXFEU5ieG227BdVNnsdQmsRBsAeG\n7iE7CywluusHb+yvB15tbqdVvIUsiXtrfTkhg9vpRUo2+rjpRG0a5upHI6+3\nLKl/km2Cvvq4x7HBNVp4rtA03n3QfgSgQVYvf+Ei/GeHlwlVSIIkMRg6D6tH\nn9WYoTHRjmJMrke/5gaBr976ax2FS/qX1SoImiz5hTaYWYr81SZdVHyoOOjD\nX39Jkbf39HYCJ+U3bP7owqo42jO/qWRUyb6fF1VaHNK2rBEyl4FMGKlwXWP6\neA1/GsDKsyPUdaGns9BhA4gnjnidgI1Htrqzwa+vGQFBEBsKv24UUCw0k5k8\nmBhZ613zDhBT3+DEd2nFIacWuos5w7sD/cj+vb4EKHFKmDztAcikOWhjjdM9\nYD61jEwMx7Tm6d/BMkbnH0EY1I9K5og5s6wd9ozm+LTVxv9AfOp84QohQabA\nwnhB\r\n=jLDF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFJBDBK0SgWIWvXgtZnW9zP9B9bsn6PsPAH+7VnU9NlAiEA4bgg5xwCCq2g9dPLYp8+1kPdswC1EMd95nl3AS9Xkog="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0_1607429622595_0.8670720644058931"},"_hasShrinkwrap":false},"6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"af13c55df4604623a469e5d4680ea942fd3e306e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YzvY5uSLppTk/dpB6fOaS7NUQClyPk/2LUo2xtCsr4GUgyFa4tUQIPUpPX7y8tT5RKNlYzvL0FoamkDtYV07Uw==","shasum":"7f69df19e8b83d33f92b6a90e8717033a4bcf81a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0.tgz","fileCount":39,"unpackedSize":232933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz240CRA9TVsSAnZWagAAJmkP/3et1+E6sDDMYhvtgtpg\niZipb3NnVPOnz0jwF0RWu28bc//WCG9UYxugAX2CgS17Ff9DtwkzJGlqHa8V\n91Tn9jJpJ+iZQ0B6skh3dCg4z2CLLZgtpvH4HXeLoBb9RV//TUvqoplnvsHZ\nCeJj+N/23/cVRjc0LOqZLs/acdzHnIfv7kCgoiDXeF/BZi6uE/zwPfZ7LQgR\nRJnk7ZfzWEHIXwbiXjf1Lp/k42VVTFMT27LfIJx8LBjg/chYm3DDHTY6YDlT\n69YC+vJIh1JoU7QtNsxXcZWBsv6cLuYDo96Nz6y+RyXiGrSMGtkhf3kOLvU8\nPx08EkXTzB/8h6W7G/aWc74shfoypZwhlqpHma6p1xxCF7+yHovLPXy2R+Bt\nnkGVz3TYoWmAEg09l7R077DNjIDwpfDwLFwI3c9G83/JtnTTdTF0OaXq/avY\ntR+ZaIPkw8rbI/qrVpcybHpzUFYrwEEfiFdyEQSAAXDyvF6tWSuVOakuSs2I\nzRh1n64PCMuntwVl1nGTFO4wHa+w2mrNs1vgskuQ8n13nLs+MMo8PpWN/wi6\nZvAXu2V3GiupTc/eVtw9ale+GzDg6mklQiEXzkDzVwrwlmVA5e4FPJc5qen5\nAt9lBOdfr/UZ9gTen8EoOalUciuaECm52CjbhHmcUs64fhfeskvGAkKoCVig\nZzLQ\r\n=8hzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu4rD0Skasbgxhb+ZorQz2nfq4IwWdHd/CS0LWEjcgcgIhAPLWaHcAzHiNixGRR9Np3O5nTS4iCpCXKrMg2CnqVmuk"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0_1607429683572_0.8957270897601721"},"_hasShrinkwrap":false},"6.4.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.6","gitHead":"808c0a6db614bb3066af323fa3eacdb2d01d6a62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.6","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-l6MSPFq60qonNgRtG5+GQGXf3amchMs0mLfNJ5UYWkfdxpDUwJS+amwg/FoJkK7rWtlenKlK4cvg+NYzIMF5IQ==","shasum":"e01c73faba9d3275ca486940262f641109772003","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.6.tgz","fileCount":39,"unpackedSize":233172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz25GCRA9TVsSAnZWagAAQqEQAJimXspDwQb/nBwL4Lqu\nmxNdqfmlwa/ad+E2+VJCG1iSZxhXi0PlC8PoVP39uH9Nm2yeQKPCZWVhq5vH\n2iYcKqothYX17k3w9AwtdxS8qjf7S+8XqjESWKbQmC0t4yKzfNpe1PORwURS\nLcIewc8CFaqBPFnUew1s8bIvc7z0iS66nwafPV6WIq0x/nl2LQKJnulwrcY9\n1GuOa7d2mK9+8Did6kW4o127j3wwRKvTzzByH8jr6PEp+esDiPVMLx8CWPdM\nDXNTy1u8tXiyR9/tdm4tUxQoN0Xy3YT6pMPouBmhW2KJIJYGiIuq0NwnxN/+\n+OaLFa3VrAho6UCfFwfqdFC4BuWpNXaXzBP77E0YQn0PwA4+sR1LbOxc5kWn\nOLzojynhmfmgFMRCuyAL6NX38oYj7s0/xqCx/CEs9s/ZXzLsi4g3a7n6e7qc\nrttM32RQ+AgvgLahYcvznECjBeMIpJyGVRk+acuWej5m2y3C2iBMKu6ASa30\n5eY6qFmQwW1UF4+rjFpEYSRwpFvGPMYFWL5Orlu3/AjCVGTQdwshhA/BWO7e\nRk0yA3cVRefi4vwIA6o4H9HZZbZceL4CemRXaT80CRYvVVeSKRzA4MsWQRc9\nPJ0byC4q0RrkpugF62h0gJJBDVrnxJ4ax6grP+9jLZa3UKg0c8H9BNSH6951\nJx1M\r\n=UOFX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH72MqYaYb0cKSTiPKSv4KdYxFG3zin6mHm4FyS/mlZWAiEAuCZxxSizmywWWyUgg/cZ5O2TLaoUjK1dFADBE4u/g5c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.6_1607429701969_0.11855165675169954"},"_hasShrinkwrap":false},"6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"808c0a6db614bb3066af323fa3eacdb2d01d6a62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xxMAnVgFDOVL/sxhgbewkz9sEfWKNdXSF0DLXQqGQT1HbSXpLKATYdHbRZmV9/jem7IGgJT6aBCpTS5Nxu2Wmw==","shasum":"45231f0ae76bb57edb27ef45823d1938c9ec6944","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0.tgz","fileCount":39,"unpackedSize":233215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz25xCRA9TVsSAnZWagAA96cP/juQ6mC2r0ccHpT8a+hR\neMhh2qqcAsmwhvQKDFXzsxNzwrH/zvzsTWxrgG+kUCOVbH5C9Hqw2FHhgz5d\n/hl9Pvf9kmrgvDQ8I+hmL7jAfETmIVlGGySKptqX/jP7gzuVAuzDH5CNSZG+\niA3qy4YWR0MHq1QxhtSE6GvSFTFLcU35hGbB0456Ql+uAGNrrkEHOR2VhbBA\nbqbrcItfXY46E7e7mOhNuRTiEC1MYz3COVBMNBj7jO4HeIhnaUrvhgGR5hbi\n53tUeqZLz9uFOCj1SJpZiiuioUOIg0qh8CZVBZoDtAQLRwwjdJvCebJshz96\nohW1ChQYUUy0WBFckS26MVpde52zv+ghbg/ApaoHdAsbL8iF3t75gK5LMGYb\nbv0kKSBBFZlJxk/PuUxX6LQTX+lC20RTzjz+tdbsiCgvYAxs/k1hiwMO9ysm\niGNgob/MM5YcQUw7FNh762C3jyEwOoKEwTCfmYzEVFKfuPQggVpJgbdCVkkq\niThNEWW5OiMh7MYV3f8Ztdv3RbSGQiUYWJRxsVS5fsQvNmcEYRw6ttemMv/K\nXZ0nh3zGdTyHaA69cud3Hm8+trZ8d9YGq+HVfdNR3tpLlHxOJ3JEgZVUXmLg\ngj17i5T4RVH5/fDVGOnWwqxy+j6ItqKVN2BJdUc9E4T+54v2MLTAMQE+04LY\nsaOA\r\n=Abxc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPUkUNkxnAA5f4D+mW3meR/N1F3TDM/b0fQpFAhEtqrQIhAJWL7oAD6FIzPxRuGedUmoRGgcZ/05fGEZnNxChhSFof"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0_1607429744778_0.8417123654669592"},"_hasShrinkwrap":false},"6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.17","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0","gitHead":"f52fbe821588d00a6b88277ee3d7e4ca4a281883","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uNwHe0FMLfKrLHyt/VGXmuWKLdFh9cS1s0f0Ylxw15EyfX2ymj5+oEkrcY3y9/rep/T7QEOPK56IvKmwAnvPPQ==","shasum":"001a13351c2d0d388088b7dd89078d02e9d822e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0.tgz","fileCount":39,"unpackedSize":233215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz26zCRA9TVsSAnZWagAAM74P/2D9pFzmbdRLWn7Du9eE\nuf5BSe1n+TkDsm7mkTrnubP6yLU1KTcob1MAmoLsGbojbJLAZ/JwwsnKZCBu\nlCkMvl0OQaK0yijhATGwhLdKfDDtWSpnUNkg4+51GZbIFxb1H5DmUIe6fx1+\nq2QI+G3G6bH2nt6ME92t7j7mPCEr/pLsZ7zPUHhBc1r2Zuh0w0cHnbX4u12M\nppo7J8qJ+rzp8RULY2wOil8DqIO72z89dQToIxcEOI+t7adkG3AdMiTVYZjX\n4j1nS7M1C2kr1R3LLXhjn6YgNqaWr7XGpoBjaJlR18V5iVzxiVPdsrClT3n4\nzfTtntzALjrmf/JQ3h6jX6LwycvSyQNE4EXAnhxorJ0pdVbR4SAltcWVsMSk\n2mnEwhlNu7tzPSVtSeehF9cxGc9W5WcNRRL6iEkehfN4EFLiHCthyerAVT56\nwkq9K/G91+n+14WpTNYb5adend9OBDHMPftP+uid6yhGMO9QViy/YLFAk+2N\nBuMx6qaSywbBFm5fMA4CElxbTm5saGXiWiLKnXnJviAMPeNSuko2ma7BfOdQ\ntQzlWzQ11uuVm2gGn/9+wbH8LweYyOJKGpGQC1tgDXWZovjKpZPwWgAxwzU5\nBD0G8mWtxII9NYPUdctwIOQgIpc/vMxH42rVvmU2C75slAE7cCzcBSLD8x0n\nlYNd\r\n=OHDQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD01VdQM9ybYBzJZcWBwDFsl+oFyMqe1fuJWRbXnzr8pQIhANdC9VOt5dFsYhoWY8JThn8Wiy1Fxk0sFk1cQlkGDZ6s"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0_1607429810570_0.10692101778806018"},"_hasShrinkwrap":false},"6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0","gitHead":"7d190bccf4a6dcd63df91ba1a16094503a703038","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xfNHKBeFKdRjFzw4HPZFtH6z6laWuUs+KOo9ul5pEdIGLbsKGhs4EULZLMcF/NQie0QM+NFdmyV2G2BpiKZhpA==","shasum":"c79a43b6f365b41ec50f7be7683afac3f796db0a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0.tgz","fileCount":39,"unpackedSize":233215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz27BCRA9TVsSAnZWagAAFcIP/2pkzqGOny48ibolULvS\nsl0M2MP/SSuf80gnh4xiwY8Gez+SMwx1HORddrcQ4/3jvpid6bKOo00rkHQv\nAXXte3kZVSSjz7SOqv3UX4yxt1xiUWeYlzd2IgIbGLx2sjvLijFyfdP2svp0\nX7I8WETQBm/og0lW2iLD0jmeS0zkQt96ek9eToALv9U5sufMeRvpSTHjzYb2\nc0YQFsQ7CNIbLrGs2GiXs1j4xUKzw0e3g5nbovP2kAYn3sVWZdJgaSs6ROCv\nlHqb+xrQwkNNL6vVu+s7QSMhYsLAeKROmVB5kUcRFOGVGrTuSCYxW08f3QG0\nH3Wteaj/ditVWzOWT5baxH7BrgktLlvxmsZKcin9TYRH7qiUkTOol0jK1MSN\nxonp+5WHH2/rgOVZRB3sX957X2KhVjd+0+PZ3p93TJ6eDRBfTgURd8l/kA1g\n2JdmXL7ZUHe9EQUDoWJeKwPb10M76QDV4rPLMxYC8JlhnnKFHymSdID9CVaJ\nmENZfme7eEd+hB1Qpc84CUezBXtVRJFVS90Cj2BNTTuWqGxE+x7mC+YLpLRK\n9F1qeToy78kLEyitVyVTHaKH1NWtO/sUcwQYoJk/bo7B8et9zj/k7X6QbHt1\nSeXjyuoQF9U2pPL9PFVY0VxFuWp88EVW7YjncjZl8imt6xdoRwdxeB/0eN4x\n5HNx\r\n=Cv8/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsWfz1ZrWa7K7REiSnZeiyXAu7vgoIt659xUGEsCtMtgIhAORr9bHHcbaF7iSs7HSGbUv5d4lAxqqWFfFb0eLJnQpm"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0_1607429825418_0.1591333232089216"},"_hasShrinkwrap":false},"6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.10","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0","gitHead":"2862077ed738fca8be68e64ebdd9d6b3a8224e74","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HQ8pewjzwF7jcoid9y3DQ4dbruGWNkE0Rp/b5sSkmyQhQHLX3E8MRTHzoshcP0TzixVig5oJPvSQ6kT5hRt1Vw==","shasum":"ac577fd2a58a45660bc09b9ba7e9f8b64f7c2f97","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0.tgz","fileCount":39,"unpackedSize":233641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz38hCRA9TVsSAnZWagAApFkP/R9rdTq6k0NQoZ07Z8lm\n3+doqIb+9BiDADJyOWFrRdPh3k9MxYcuym3RKfi8P6EKu+/05Ye8KsaTTXUj\nnpXNXacJadu1ClPTqbE6wEaxJNQ/R2julekR3eh6J2EYKBg567MpdHz9/15z\nRgzeBzvHbNN176oiQoy19NrzzuvMLFhc4kU1CUKF9+fRRyfDbiFQL1fGlr59\ngor1ydoSTLeF2SkgNyaGxhAU2TrTv6ySG16yDGS52rnBqbIQai/2RYdhSqJj\nieznUO0Xte56ZwYfGL6YEG99cx/LfG8FCTUfOVWo41tfJGflRELQW/iYSd6v\nAT5d7e4RA6S1ViNc5obEZeaIqbBBL7mD8QaqiD8ZcY5FLoCR411PL8TuSmm4\nUukrxEmy5neiMNQIlI/88p44Gs3D8wvvcpfxJAkGGQZB8OLZkUO+MZBO2uuh\nYj63yUmiC+XLdDBDQdpxRpnuVFr1v/6prRtV8i8T2SdoHdd6pf3uY6o932OK\n4GL8cRx23djFW/8FH1f9UDbKKB6rW8aUr6w4fqkZQ7VjDzUba5B1vp8I3yxU\nkzfmM60b+lF2tdh1tVCuXpiuuKhnRr+rcm79B1uxLFuCgHcl6Nlys8rtLi5U\n11HIVDb+L9ZbVq7tC24lNoAmG27swJDHwITgagIKUXSLsG6pJ4MaPnJfakyY\neqer\r\n=yaKz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuu9t1qrdCQkjgx9X/tjPlyqzwZ4rwqsAeNTF8FJ4EOQIhAKbpN1eiIgoULPBD9nML+7RTQGWheQXQNloR5VlAeOJx"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0_1607434014415_0.6481020120345393"},"_hasShrinkwrap":false},"6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0","gitHead":"0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-a8kqXcxJMUwd11jfppLhFZQFPZ0uFzPoCfAruaIHzmE7qAhK13A12QeruQ6uarCjN5zsX30i4JXIWY+m51lM1Q==","shasum":"2aff831a334b1ab8eeb8e1744bb37ea6cfbeea3b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0.tgz","fileCount":39,"unpackedSize":233215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz7RICRA9TVsSAnZWagAAhDIP/3UcM8yGOUTYVtiLRl26\npA5jaBxDfmDkkG5BR9qetXGUh/BKIwRXnEUnmIioVeMbEkV0FqSXY3be+Wic\nNbFQmjFg/OE8aIGBaE3Q3q19di96WM9TlF8A1M9GJrVC4nDDpfLjpXtD78pe\nI8luS4qXW4Py809kabFfSsLvglDy70MFBGuYHu1PcS3NGSQ+wnp/WekWv08m\nJw0qGK0mKOLo4GwPs4RzCmteZtF0sPdSd8kcX30XjhpyN9od7GIn8G99vo8l\nBRFs/4M7YLC/1A10BplPlyNDC5QHXIMvSF/MS2pWjlBxow78HfkjeXngEBoo\nMSxLp0zPlFDnK5ZGpLruM1mhv0u6QtQFPlG7CSE1KpSwUK/v21HqSzOHaquU\nATQnePG1RDkfkzOXtnBgd9BizbzFV3ecO6lXvbshn/17mTIpaLTInBud9+Ux\nSN4ncYUsQGV/kmlzNHq3oF3ua57btyjmbp635GtwidWKvHTfOfD0tBl0/Ttf\n+fK1HoDXr8jR0+YRLsQI02rUP8nXuqOM8pe6L5aoe2+T/jH6mYbRQIsWLzHu\nbJM/hBua4SNywH7WMZDk9GpCKVoiFVpkZzRys6+wUa1bf8fhmSN2DzuntNYP\nIUQMjPJsEDe8gRY+4+w1ONKzAxmPtYL/XcZrlDB4aS7hL5Td2rGtCfhl1ho/\nnRYS\r\n=ZpYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAIVL6VP9bVNhdwtQy4m019n/7StZ3bo5Uy3/DZbqCB2AiEAhnjJG4Z+uxxGyO4if8zq+aulBEEu2c7odHqgPqMn0tI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0_1607447623462_0.08741897602590631"},"_hasShrinkwrap":false},"6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6K3IJR0dVQXFdO+MpLR30ASY2OoaoirwNET8kRKdBaXzcfRDaQIPaR9usaAwAfqte7eFk8QfjTltBNVNRntHnA==","shasum":"5788557817da9cd6cf209b8331a8e5d5e6e46f9f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0.tgz","fileCount":39,"unpackedSize":233215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz7SxCRA9TVsSAnZWagAAXD8P/0af4X1EwWZ8jAoxbUxt\ndoC/MT6knDgVPZaFvpUSx64JdB2785gnjHiapD9Y3KC9/cBL4/Nz9if+QxcC\ndlulxbgIjAPtRPtKVH1r8C7vZ6iEw7UcsGh6RH1HHsAdMaGiKLvfGOcsbRK+\nLMgHxQ+VZ1LRQ2JXGt+qsszd4roL2yE7COCM6O1zWdIDWYjPkMsY68eujDud\noVwCTBTGL7EFohGot9BHy47E+ce1vg+SESI+xzRwpafkwbuZZSClnmXsHuGZ\nBMUo47Jjhg6qCPeur1n8NvZhT/pEyFLYJi43AT4c/9RnDX7oLqzBsqFzfCa+\nomXd40E4om5mjI9dENLspSSg+Sy6MYrxW60joQwHz/SNjJaCpKKDkHO9u/Rd\nu4Zj69qzVYKyPOvITRdjW4t7tDQRkk2syW08qUzZUxPKrZIdL9J92d80oloU\nS0jwpJgQxIa3cHa10x6eemxFh271jslBCqojOi7H6YFAQloFVjCh5p2Uj1uP\nnyMcmxNfX9DWBlUazE1HAtmRZepY2h4Hub5ePa0U+Dot5tBNpilSwQN212/P\nNXwcKZfHMj2iCOfpZCjATdKc7F0EsqD8oGVO7UJJ24bLnfp6gjQRt3gxROWi\nuz/yAzKBebz0q5cyJ0C/9bwn3oN6nM1Fjq/drP5G0nB6mRtK6+SjxZRO1SgB\nhQVc\r\n=UgE3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYuJmtlvTyIpJDICdMSchHsowNyjEpp+Fak5MpxWqvlAiEA/K/dLsPh3zLFQcU+APeNRQlPJ4lXztJKJaot2X9fQZ8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0_1607447728717_0.9669343132514501"},"_hasShrinkwrap":false},"6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6fa418d0b3fd6e0cabf97e62a377deb8b901255d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-thtIHnRqbzAQnGodPfGD7AqTSlNroWuou7S5zjudHsI0/ISzv0o7DnJJ0iGDJdUse8mCcRoUUBD8Lj728gAiQA==","shasum":"02c5a7c9d0f90f9a067ed0e888c302c9f323a4a6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0.tgz","fileCount":39,"unpackedSize":233498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz7TWCRA9TVsSAnZWagAA8ioQAKSJyV4ZuG0V8wEvon7z\nARl8rpGrvdDzJyOQz9xMyvzMGh+hvoeuI2RZKSvdwEnrT/E+18Kyvl83zDcC\n0XaHGNrGGuS/hfWU0whF9D/2AjYZ8d65+BFNuFg+OGAFn5lCDMQdfDx+3eaM\nhsFSI1W2erXV749p4CqpQxdKGl85ro0MmN0T2kp4LNcJKw6CdqTtBvUgqDQO\nVcSvIwLrP8IJ1X4F706nkL3b5Ba9foFVndqPgficiogsb9fA3leXKbr4MV7M\n4UVH5PiTP9bPBmSEVSeSb3xrwMJSZO4pPNFyA+kXUL3vpEdm5P7WdHlsygaR\n2gvAoao6fEOawomWDA5XJiAE6xE1W8bAkcuiLUSxeajbLaB6mf7lOtHTp8qC\nBK13e5iRwHp4E0MpdwcBheeevIbXPq/seDUg0AXw65QAn5kRm//WY413WhuG\nP9p35HF7ALP1k55asHgWlGj5qo8XS4uf/iNkF3HHei4jqd+gu9QopMaJ/ZH/\nGSV7wzyvkwMvKHPoYcekYUDzq+tfywRG2dC2APGvdcK6EnC52QXbCSuuzmho\nahSQOZwHpX1SAgLeD/Ugn4GvSPpFZKVxkmWOjBxXdlakcg+TVIkQyrQGHOB8\nikM84iegJ/ImpuiIwpKJy3hhd26y7UvjtLxBVw6oQZX4NI7I/V95PvkCcZ3r\n4w8I\r\n=ML2J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsMgYhSJRpOGnIPp4p0bUkM3+DYLx3AetceL4wrBTycAiAjSnoD4Wm9Y9QfpmXNtlGoQMSl/0zteaRIom0Hw9jo8Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0_1607447765641_0.017340027444578077"},"_hasShrinkwrap":false},"6.4.8-476ef1c543826748242574d6d980481eb75230ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.1"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.8-476ef1c543826748242574d6d980481eb75230ce.0","gitHead":"476ef1c543826748242574d6d980481eb75230ce","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.8-476ef1c543826748242574d6d980481eb75230ce.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7IcTpoP48zh40fmIntyx/CxfiD5DuFF+Q7uHP4DjQMMXXI9qqOUrVrA2rx9wgxAE7WAwgzx0x9AVugtyI5T1Sg==","shasum":"c712202dc8409be8aa7391cb8753c3dd28317789","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.8-476ef1c543826748242574d6d980481eb75230ce.0.tgz","fileCount":39,"unpackedSize":233498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz7UtCRA9TVsSAnZWagAAjWwQAIYiixDh2FqJMvkvGWJx\naXZenArFfah7EqNn6N1QCU5hFDD9ffA6a7YOx175205zzbmVy5CBqxoO2eMy\n2lQC69zSj4Qh5lj2m2YWH0K6bIdMaGABshFujgIY3/EYzkleZAnIb5H17T5S\n3iekPlk//Pi0mGq/2cKN4zyZiQ01BKSJF5ovJ4ZzQ250zH/po1VRSPJZT/U5\n/uRrgmiRP+qFyWldkv11VwL3Cz98Kvf3NsnorlCJNy8MB3e0z4ZwYgFbld+9\nRJ+lWUuoBoomZFkjcqOr7nQY/fqIxUgIXhUy5Ge3giZPw7EuTqHf20MQyxQK\nhhdliYx4Ybem4c0/t9OtuqML+CnMVCpJ6U8Hapf64tmrcmjzcDFKGmBNSpxm\nuMSOVDH+732772LdeBKYyKb/GJLW+JBIGfpyQ4uAIN6qfLpoNqQJWAtV+fv+\nnbv9gBzJgR1+dDL1jQCIecM6gxf8myUo9eI2izkHfI7IHeCanU8ONb25YgiH\nYKnC8hW4VQXCdcZ4+uJyiTudzh9LWBaDgYkmJjgRCL2M3BXOpd47aAA1YTy7\n95Hwi4FJxKOh/j8JOo3/d6DzmYjks86CcL1OtYmD/vxyyzRzOlJyrmFT24Ey\nhHvUOgCahtQdeO7HW6ZYJD7tVsJW+VleCbcKMz+OUBnQ2iJiWemro2yM7TJl\nR8fB\r\n=URLP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICg0WMgiuQhiL+h5TpTg7KyxygjLez9E+EVkgYzz5Q0xAiEAvMcw+oEJePjOwPZL1RAySgC1kSdZ2BwD0voJWGnLkOA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.8-476ef1c543826748242574d6d980481eb75230ce.0_1607447853376_0.4950666367920966"},"_hasShrinkwrap":false},"6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0","gitHead":"fc78d93d82b2a9f1728e14df87ff40e6b47db68a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-AEpFi3TP9JL4VjEKgU5L79uudyEtCJd4B0TJlmvly5mEL+ikZxOUaWfBit+n4RIUxrgNrsi+Psjxv6gO7yOzEw==","shasum":"3357d215ed27ca0e0693fcc2749433cc87b9354e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0.tgz","fileCount":39,"unpackedSize":233498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+ifCRA9TVsSAnZWagAAgjEQAIFQ4dEvIjvmM/DEE+lb\nmfrpaYRC8UJjWqcs3cREnt3FaC0dyfbJJA64avjwCUfJfbmw3xreZskZHkNA\nrGCYuZnmR4BS/a6RCdF9CYyAXK4ROfX5Qw3ljI3tTo3cENrnIxkPwGBJ2QDW\n7dDqBml1Bbuy3gd65vJ/qL1hS5M/zkP6/6IteOUGDEp5IlJyhuhudWDKvjTQ\n5wXxVjRSIP0iXYzi/1cMNHSj+ebtnP0UCuIPVyj5do3IPXIK4z3oTe+m4JB6\nPS6JighEIGIftx0EAxt1SIetgx2aOsTpL/sOrwmPwFeQFr04Yf6XqrSz6NT4\nRv4qE2I5G0cjTmDO6jfn+ThdgwiI3v0QP6AgmbQd3vjmQmJbei5k1SRFDkei\n8jxiARQOBzjfXiLQY0+5GzYKIOaBIvjbRV6iCHC4iuZ7MvLNjDXQOlOO/wgB\nJfDbIysaaWbKVxMi9TIQT6+f1wdqkgJt5sFv9a/XmoHJdeBqF8ml5/GYC2tl\nSMd1+Rgwr8Lwh/D4bCbJqGkR8uRGH5Xfv0dJ8e7lNk0pEnCx8EiTCCrQm/i7\n2Od6NnJvm7PNbwPtPGk6aeqV1oncrFj4PVw+67dXa+zO9JoehFslK37fJhXn\nXZgnvKUH3cuWva4IsZVPAtNfVuepjDnuc8NlebJ5H9PrVh0Ugqvk0gU8uYvf\n0/1S\r\n=18uI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEDQzculd5L5n8LuaTdPvbM+5ZlXyDMFcnh2kdPsihGeAiBxv3XWCjD3W2kuzIoG5ukfx7ZTMVEYvbNIjER03NfEqw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0_1607461022687_0.5048795838828293"},"_hasShrinkwrap":false},"6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b2f63e6d77724274f1bb13caca3defdd20e77bb4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FNCz5Cs9E00w/P1YBwooSaE/hIuIzEWKbHbTLj2JOOaiyMF+VP7C+7xRhMQLJLwXZYJ6/qFD8BEhn8iH0eNWVA==","shasum":"59ba46c892ff68f1100c030365e80270a567aaee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0.tgz","fileCount":39,"unpackedSize":233498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+jpCRA9TVsSAnZWagAAcvAP/i/yMoDH2a971Vid0Ivb\ntVYX/b8yVMsNd9rzZOE2fYJgr4xnz/1vgUMTfNy8CopG3vAu0E1JZCx5p0Pj\nJQM/16+LifqYCvmxaKBO7Iemfy2LAkOD9n1MQ6fcRSf+nljlatezwVdqZm74\nfucOkE3wxqRf45nT6HqMVRUkz59ZGNJz6dTRAqypSpVe2pM74iG/3Oee7kFw\nIl/5KVqV7AlIkpfWHfMhLK5M5LDfFubRnkyT7nlWKNTOq/uKJmYWsQw73DXB\nrJSgiq44eN4G62WP2i+2S+wVogrnxFaXQgsjT/FHSMugYEQrqefuHlrRUwLT\nFDR5GYeG269t1vbRkewmYZgBC4pzdicU7MlHZZlkmZckP+r0+3gztmAoTSns\nqX+HybgfJSgVB1qPntzZC24AvQssKWM6Yk4L9RGNb5FeRksKvG9MNsDnnmbu\n7Zjyyqxcp5/smbXylzPTDUcwV1a5yLkvB2aqye2O2x+bKjEVmW2L+f90tiCf\nJX/KDm/g+MYi5VuM23SNln1Vo9crBNh3OA5FT6on74Jrx8aIYFL78pnKoW7Q\nhvMUd0fAE/tmbw6T2Wgtpt1lWek2VVtrGtWJ97NcuqLKHQlAdsffeiy/5B34\nDoHJrO04uM/0TUHuniEMp3TXqz/Rt8FzNvN+oMaNTSQ+u4yhoXzYLN4MFCId\n80Zg\r\n=MOkW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcUjpTvuaOgQcAZqgpWy5CCdawNQmSTr2NAJ7Kzst/hwIhAPITZEZo4OZcBmTanrlGHcGrv6UvGo5KyCLoyQvqfSIY"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0_1607461096534_0.004491776176230644"},"_hasShrinkwrap":false},"6.4.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.8","gitHead":"e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.8","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YSwIvjiNZlZV5YyFQhQgWm0jHlVn8g6aNQSCWrtJxobRqKnsSZTJnnxHkA8sD0ZHrYSvxVH0EjC0cSLV33LfEA==","shasum":"47b0232b4ffa378ff4d5bcac093edaf721578841","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.8.tgz","fileCount":39,"unpackedSize":233725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+kRCRA9TVsSAnZWagAAircP/3zNaP4AP07qB/KCrdf3\n5tTeZ7+hlSU3kfBAC9UToQz+ErKavwZamVwf9woSHZWkB39gFEEOmqXxtLE0\n1w4gB61nEAjsR6pSViFVWtHE4KfsrwgxBiE88ewy+UB2nOSjEBmKBnD9XITZ\ns10KXnkaE7V6pV/LlzJKlGJUUaIIGN9v17cKDmjuJxaTn9KCJVeqaYOa/T/S\nBa5QAwWH/Cnt+hlN08No0oGpK1NJbxQzCQP4Ll2OCSuso68OsSQ0fKo/ZORs\n5fxIQ6KDZcCjJiNEfYWn+M2XcHcTbClCnjXk4xXwI6FBli1qKCZ2ZNH4qMaz\n6jE9Qm77iUowXxO5AMoMIB7+fMZvWrYTJsjvv/el8kMCO965VNxB5isVfV19\nKu34Wyd94JQ1QBjmETTDOE/rVezIKouOLjTx1F865+vWZFJyMTf6xMJyggp1\ng3MtDlwtQT5XI8U4yW1R0muuUlDEBm/fQG7wYBBmnaWDY6J5zVB09iIxFMhA\nr03iY0Klr0dnuT2XTI0r4N0gqNNR6f+BKgl+LY7yR/dqwMnzQV8n/ixy2n+G\nUYQJ6MsfY+r1DWpDT4sHt5DAH7wQFVIL4LwNWtldQHPOJhkOjYw0d4L9lCCm\n5FVdDyr9XQwEuWsvdYOBiO52DIqkqm+R8q76oZfTJCnRoa8dgj3aUnm/0sXT\nIP7g\r\n=DgQs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5HftRad67QW4T/dzOKtEqnwh0f1uWKeWP78A/9eKLsgIgcQsHifiN6efDSW8De/nEY7YDM9cGcJrgFh6LQCdDPpU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.8_1607461136725_0.5947897738406625"},"_hasShrinkwrap":false},"6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZxU6cA2jhP/8EAQKsN562/uV2/eEETis2lT3m8JheGGRrOdyu4paC1WpMtobhsM0J5RysAf24Wq3jopZuD+Tmw==","shasum":"f15f73f6205ade2fcd2aa877129ae3672666b445","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0.tgz","fileCount":39,"unpackedSize":233768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+kzCRA9TVsSAnZWagAAPzQP+wT130Z1Zf9jC/MFYRla\nf1GJDeoxjmhqH9fSgCahA6fgUhRc1CrqCwWHIqbuE57bfQTZHRjKJRaTcl5k\nLnkXmC8SwHxnk8KexfSCk3pEPysX/l9aExpmeleScv4xssVOEs0KHH3PfLFz\nLT2X3zdEPsi7PfjxJjXVKj7bCNZ2ZNyP5Glr4HGaM+WFMNwEOokJmxIvb80Q\ncx4b8lCe+VcPjRb7t0GKwxauy5WD3V99oOKQWVi3kwaDxyZKloF+h++F/iEX\nHZrLmA9SBd4VggBwwpEx7Y5siPCDxamY0BFHbDnB9KE75WWlERd8fo/yb4Ux\nuR7De7HsvmWHUIGKsYw29HBlXEb3RDQUOMooaVNrwdpVLVdCzxqQHGfrMAj8\nOSbAwya5ccPlAITJnWhcoqezqVer0rl8VgetQS10Fd3ALVr/rdr97AvoOOdv\nyRWmCkPX+pKECDXI/rX7ED4GCz+0i16X/BPoTB5XIXIpVjXMyayIu1JFWwI4\n0CGqYD4NIXpuOkwNJROIsTrQ4V5auTcZlwJWPeZndfBarpCNhM7OMTHxa932\n0g4zc8MF2Au0B5HesWXFs2Ya+u54xI4+hlENundgMII/KIejTo7lfbYzD07d\nIR3bGUj2fwaOXaPx3imO4V/A+jpvx0izCzZfEwg+z/esrr3A6Bif90Jc6g9h\n8J6A\r\n=XJv8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcTodQpVkKd9qrhZZMTTJCJy6/3SSTtPMx05ujoPuLSAiEAsC8pyRbVnzLrrFwU7NQ9S4dHtB8OhbGrEnEHvM0dbyQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0_1607461170628_0.2765555567731153"},"_hasShrinkwrap":false},"6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.15","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0","gitHead":"6669ec85f0da131f09791af0cdd8296140696a2c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-XMzY4+go/7FcwH66QmNHflnrZlbQD+DQ0UnOzqDFgjuWpArnIU69h/NjFeELFcu51ZsDx7KvGpPpF6diKayQmQ==","shasum":"e302303dfccac3170abbcae23d47f806ff911026","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0.tgz","fileCount":39,"unpackedSize":233768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+luCRA9TVsSAnZWagAAgyEQAJHSjUVB7gGA2aNKeLyI\nspgFXadFqZwDQqrtudyfwKxH/mXziCONYyBAdRXReo9VPmMeydl2YI1XQiaZ\nsma8JzB/6umRJmMt6tIQmCMDndrHndePyMUWwTs91dTw+jMEj9et4yMqR4+p\n0JGXAVyzvaTlyDSJ4Z2zNVzcxYoBj0q+DnD7YMnlE9U40hoz8F5Yyn9amwuL\noilTsz12n93GctWu4z1fxJO0iK1Q+7pT4NIwu9HIYcxNZAQa8p49YT+CMYoE\nEeaWRterEA/Hd/i6XYolP3OtnbEzrpuEFMF7BYFWT/2xLWnhszf0kDHKCfGt\nIdIVU/zFLT7+566s97CFY9qpaEFgAiAtI1q8I4oHI4/MQ9kJ8f6Y5SR3vinw\nuPbh7iOnng3s6U8ZbgzgNgtheBxM66KYpd7pqKSaSbiCKpfcOH9oE10xaGgJ\nINqsVI1GGw7sa67e9pJlJNFfXd3g2pHXWNdkyKFeF+S+jfLSeIMPEhRVmTXw\nl++tX4HqCorhkjcbPUfl0d14uV9xp6HOnspUctwk7EoatRvkLZXBjVl2m2nr\nLT4z/4qNI8TK5zZnhxeXbAcxxM8tKky1SaBD1HX6SIAghWHJsCNot1xM8Tbx\nn9EHrnerFo0k/9WaOTRIhq3vKeR1nznxlLbsXaC2m7H6ozcBxsfigBUsvrUF\nrN2Q\r\n=u/4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLIVLtldhaAK+zbc13+/6U6/EfPqp2Bg68c8TXzpBBBQIhAOOAYwcNoo7um/SuBQ3vt9upHN2IgDmVilxQR3m0UGx3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0_1607461229394_0.10697753664191878"},"_hasShrinkwrap":false},"6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0","gitHead":"46a70e79b292fbdb731802071878979e9c36c620","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fMxpL6ijKnAudFEw17nIbO4xyvXNQSQoJzc5uMADKNo8L/8GA37FGMZcb1GNeR6gEKdKUZ5JQ2Lx/qNc9KXDhA==","shasum":"f31f5b35ce7702ca366eeb61a16b5bdd26caf8dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0.tgz","fileCount":39,"unpackedSize":233768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz+mNCRA9TVsSAnZWagAAGeUP+QD5KRETRweJIRnhhlAH\nb/fj0DUg9aW8w47QSa7Ebjsh8n/tWHaKZpJYX0UsR1iODbtB0Zv3gLH5IVMx\nbh05kmeiWB9YUhNHn5zkCSpxTgy5QyVd/gA6I2wR6Q/EvgFDSNZTinhgYOJP\ntzISFH/jmcqWsfyG4SYjz7RnAMsEOdjoBI46mLuKebCkmThhtBWrKrRiRDk/\nvpVXbDIeDoMMcfpufs1OROxhaWHYmQwTsdfCRrRP4aENaignruY+CORbPoVD\nnwrh8MhicTUPXmZGMKhn2P1Bf4ZsLAcgiwVIYYjN8qYAexC2kYhfF/HtpTjn\nFMOSkvUGxf5IQwBFwhFvLur1sgf69qKuHe4ufDBSuJwq6FRw85cZgcXJnIcg\n9SaeIUCoyopB6ZmFBxYWPZ0tF7Tf6wXJSRQlvrehInD59HS/PoFMMPOweBhN\n435pN/Zv34nkCV0BrdFIaUWILdddjHqGHW4PuK+/8+sLOnXBdGG3MWrus9C6\nYDXwmRf5rzJsOFN58x1BWe5LfVrx0wTrP3KpOL294TWz1S+cbG19/FD6Y03B\nzqshHA/yJyJGQ/VdVUkCzAzS5JdTy13FVca/mExQ1OXLH9v8pkGc+3DJlqYk\nUmxNN7zaeTK6qcGNtmhQ2TT9h/7yuuezJL2zHr4+KEIb3/z1oxvLnXmhaGcu\nNX4x\r\n=x+7Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHX8ICdpZc75+IGhhpV2lMoXS0qL3P5g/IRUUulN2vKgAiAaTSYNa1BwzpHCwdCCRSqLyu+OIFmh8GXh9zIVMLlAwg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0_1607461261314_0.27526245421019757"},"_hasShrinkwrap":false},"6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0","gitHead":"d5117c45ada84b11d0c14dbd69ec2b25643050e4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mhsSP2B6MkZDaU1ghg6kageXte8fyc767bC+nDi0S5kIgTFCOrqY9Hph7y4Xmnv+nwZiCybOvnAkrvkqhWpFPg==","shasum":"d0dcf5f446ac37ecf0eb0f80bd83f2bec1e8a62e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0.tgz","fileCount":39,"unpackedSize":233777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KEyCRA9TVsSAnZWagAAD0wP/1aVWEwRCEaJjVaxjlDk\nhExw0kSiRBRMMMkNHxOIRW0yiwJiNe7APPqq78PQh1BV0M5Edya2LQEnxNUq\nk/0n1ThIzGftmIZKwHGqMPZgYjkbNnRdmS2Y8y77YaGY1EED4NEakDfOx9tr\niJx1NpVG628HuVNGd8nMhnO2H0n2IPvxWTxoGH3IWJMxgJLCzzhJ+yrfqp86\nBfDqaOQiOucfkfMSQticD84ZKcviJZ/ZQ8tDjR5Ab5G58R+pAI7TEy2PpAvw\ngnAdhbtMNJ6kUrZrBlf5fb2WRnRc3y1LF8XgrfVz1vf40SdAGdFWSRA7L/ss\n+uY2bjUSxZDH2Wi9ZZad5DYtZTyA0Lxb2rHcDYmqdZUedHDJ6HmFyqpsdTMs\nPW712HKDeEW2a04BUfuVQXxrBOZHjIQ+OfQjlRF3jxj204K3onGDV7b9TueQ\nh1UDlNsHei4/xUI5ulqvttOqoZN6o7VSzsG0ccOyP7obN03SC5mm7w2V1XnV\nf0zKDnoxbxMT8HE8VhdePE9p0jHjaKHsTPXoEwYYXqTMwCju9OuFH20V1arJ\nmdQq5b9HioKbcQvfmWUcmqd65NOQoBxlDxDFF/ZtO4v8XJJMuzP5AZI7phu+\nYOT35IDRo82ZlqXX8yTIbSmzz0X3yQmAsFESU0nj9p90gyZau+lf0UhERHEP\nzF/A\r\n=8Ej0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdVxCHtwk+iV+r7pRw4+R5e9p+dO8x16O0A4m/5rroPwIgMCpV5CfIFvcCfigIDEso+6cODlHgKWnaFhf2JP8H/Gk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0_1607508273580_0.6881955722123112"},"_hasShrinkwrap":false},"6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0","gitHead":"bb18674a2f2440a95e8b14a9506b0479902b001e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UMsclhKmvlCxvCdTgceTi8vwTnPVkAPAOTN5xNrv64f30IzHEz7Uzj1z7Q9+4rr4h2HMX9WVvqGjFCiWqhtqWQ==","shasum":"57c8fcaaa29a1d955b16be35b2e737e2cf1d1c51","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0.tgz","fileCount":39,"unpackedSize":233777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KFRCRA9TVsSAnZWagAA8eIP/R9r01kGoaeGNFQKJcXC\nziXCH4PUryxUqw8azZfimwF3tpQwqrq4iAtI24pmg/Z8rNCxU2FoqE/d5X5m\n/H7BAP4xiMX9fmEvzeWKL+G93dTv8U92diXcOvfneyXM5bgCxISR6JX9QbXD\nH14SRjmK46etujxYqh0OWbOcRb/e3AFr3jmz+WFTKT62iAEcccU0ZTbvqu6p\nrShUMidv9yu67hocpPGYNq6TZAf+dJ3ML74Ajl8gvOtb07vxkqEu+qpsQkNJ\nHJDNg01kaWc9EgNK5Af171X52AVo91vLPmsh5SLYbZAGvkDLU/yrtARC4CTF\nO2Wm+WUBdWxJw3elA7ApihLpdAb1c8lZTshaMZG2Iw/ClZGHfrTn+NbRCYuT\nMK7Urx2atGpzZaNdAaFJoF0bEqw32xlXGPcq9A/TrOHOxdIpwLLeJoP8Rsae\nbpoobLk3DIzsgUJTI7IKxzVX82ABaRVIKxRxtQocLq4/6eyX+QPcep1zn/QL\nTCwY1gKKatV+E3WNOVqZKZZSEkjmELpc1ICxUBLXcb3sXjy7AUMWvczpkjmf\nKjizur6oMzcg5J2fk8bncxTosFaGwz8XXkF1hI3xed2AlFUpGDTH3l6RGSaa\npGAraZ0knMVZhPjuLGq/CivvjgXUeepszuv0dgdIlkaG0uRMgLszKVG46Zfz\nF24U\r\n=QSQZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENaTLnSz0+tRL63bkjOgDfNV1RcaQcXdY4/tgGxUoQNAiEA3wHqmzDH+hRk1HHq65Kp7eW6rAzILOFQzkjiVM73p2M="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0_1607508304947_0.5534439634615325"},"_hasShrinkwrap":false},"6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d135d41ca2e0e887a20265d47c44097989306779","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1r/S42L0sA+tCqc+tUgKuRIPPZMy56DeT6ttJCNaYTUDNAKNyPi0Qw0IgPDK4lBug3ImhO7wrAuWv0+NdNo22A==","shasum":"d36479834d62359b915d6663fdf13b1a1d33c01a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0.tgz","fileCount":39,"unpackedSize":233777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KGACRA9TVsSAnZWagAAtdUP/3kO01P/gwklKA03HWbb\nBqSKV8T7TsGTugwEW0+gEpk0WMDG0HPwFjy6fTqaflKX10XDLor/qQ4rzal/\n4D5HM63Xqh4WRHjzeGDMCDH7Bx55C1PpCUAXz/peZj6ZTh9dS/PRpcF4cVXh\nYpasgKnyvorvR+npHj08Muzr7Lt9ao05412DeWdfpbEEf5hok/DaDHg+Ef5L\nBtW34GmdWVuJSA3X5XscOD88yq3mMPf3WYdbNRptE6ra5XDKLovFE1Ykhsl1\nRl78dpV4XE7YAoiKfe0S51jgg5q2zUNPlkbdzSutba9z1xD0QtrlOtt/j2K7\nmDpRGi9HjlgL/8Gd1eYjuLFb3ItmdmlG+TE74GJcMpCSJFJP2lwO2maymdNq\nH08wlS1ra7KbHESLgSAFmNQZLJPUfWaXHcEjqU+AsLzZLYdYQC39ejYjQKEG\nVe3+jIGSW+V7iJmmvE/UoxpunYk2uFMXXOQizjZdDdEZhupQZa6vFF50jds6\nqBVlG8FzalAU4+BrjQZ57VZDHKOkUJkzmiDZ7m8JxfZNWecNfHKctbxwxisv\nC+bS3hDMKHYEvwXf+o3H9G9716QPaRsXrDSdxaWuTtFNHJSwHEpMF/v0+q66\nHjzdPhLLB61AI/6EuUwyBz1x6o0szkEmqc0cFAOburyJv5YI5x0vKDCwKlRh\n+y+q\r\n=O2Cj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBi714Mn2iA/4eT+r051ilA8vjrMn4lgYted35xON57sAiADJEEO9f9/iYoXaH0IiGMbpkxDEMopeqZp8utu88T1wQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0_1607508351640_0.5418738126921783"},"_hasShrinkwrap":false},"6.4.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.9","gitHead":"f3886b7b02cea0beb3955beb03c8d08a5929ca5c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.9","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wULXTPZzM83DwvsIH1NLv7L2Y8oN0e3f7lEHsv7Xz2eTDJX+mZmHCOnJondCIqyQTbVC0hFQPGBp9s5MX6Vd0w==","shasum":"0e664e06fcac6fc84c48c7811b79b58f41d6301d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.9.tgz","fileCount":39,"unpackedSize":234015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KGXCRA9TVsSAnZWagAABVQQAJDv5j3xwmVSVdjon3XZ\nsfgtrD1FxJCfQ1mXqoHHRFSlPUVKqW2SqtO4CpjMPTanEzrQZ527y8NAquB5\nzsmYfKzi0kvz6EnklsB0gFTPYwxlvIDW4QwF4W0omYOrwjaw1UMUhsMdsiy3\ngHnpcCm4C8XRsKmXhEkHY18UTE/iO2zCn1cwB1eHKVyg0P/grMNO4aREbiIN\nTzOsOznz+JCH2JkvLlLCDbmPNQiatW+o07ApPPI/5PbY2bD8Pl7HrTQiHSEp\nrBjuQYnhkOU6c/overoqoia84E2FRt8nggzlhy5T+u/HrwMeTf2CWIHKFHEi\nZZ9/M+XEE+8XQZqZ0RUN9BKi38hdKfSfBddBTrVZRU/dzxe7wQwpTIv61fNC\nB2G51bzb0lDEFKBznkKxM8YvYLuoK3sKshQFpsNtY5ws4f9kfSi6pJfuuFRI\n5/zbw/Lm/9cyxce9W3oxbRTEWNmr6ZIEO0HPgGCFQ+SZ4dUF8jmbMWttAreT\nPuALw00GIPBjow7facsf9J/0eIDLwuPmUQQN+B44kJvYURXNsEeuXbLc6Xcl\nY/Hk521swvamCFsuGHAg383QLMcoe3ZyHHPvmnkhL6NtqKt/RUdhBKK0tdH3\nlOljS0Pa5JOEs98312sOSp4tMuLPoJuQaiMixDFN7Go/M1zYKf4rW4VMDEgR\nyqNc\r\n=Q3fR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHzdqZFza/9t1i9WBFEX8LStfEM7POEquYfQI+7nCdVcCIQCLbeBqO3aWhVplTNK869s4zKEnf2QkE9aJcms9Eg8gkA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.9_1607508374804_0.18843251225046664"},"_hasShrinkwrap":false},"6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.1.2","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f3886b7b02cea0beb3955beb03c8d08a5929ca5c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-48bffe81SbLBlqVjQ3gAngy7dtglGY9spMlqVRuqao5dZzFYvPhd1c3jfa9qL45r/UBoq2DtqFDRbS+pZFxR7Q==","shasum":"fc6443f25dec79400730141109f878e90c92a8fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0.tgz","fileCount":39,"unpackedSize":234059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KHKCRA9TVsSAnZWagAAgQcP/2aP2UgEo3t/bv79llT7\nitRr+/vyuJsD49A9tCA9oj9nI7mp/hAl+NRt7mPwCFe/L/irJPfgMIlWOhqc\nsOvUs5rMpU7+sOZTnAS5xnHPa+VMX7CgMY+gMw77PrCKJJRcWyUYv2NQZPLv\nVS/6gUa2IyGsNPreg0DXeTY1tNtt5r8Fh6HSM/45CJmyDD4v217nbm/yw38v\nuPpH3P0B2LkWWZHwd2pPLjbr8vrEdwRdm8sNHq/ZAX/58LEHyfgGD3XZAqFS\nbzGEI6wCzBzEZ1sPmEmpRYcRQeXnzEaDo8Jywhh61fUNgF/Xc4yW0f6bHhSZ\nBn+qrDzKdqQU5SwL4k6d+htmg81YQlQHkGrWf9HdVygwo15kLVNC0yXPgLcv\nP/S6mWb6pUGt9SeP/EoJoOMmX+v4zZLyUu+goU+PvoZnlm6ccBSTduzTUrKk\n4NV+TQYNhDCyQ2YGbHxjCokUnADFANThjhrC9xFsEwK3MG7jX51eZTHG1Jtb\npKQx4Y8qivAoOaxgWV1TfqOHsCuA9Nmb3RvJehbEp7K/2QhwMd2ED+lUt0Xr\nmCI8LKiE3ugjepCeT+dZR/yqyzH257NjfCPfV9RELkoFVR6FvI15Mb+Ae4wm\nooW+3vPseWMn5F6xrOqn3dpng3ew/zF1pIU326a+E5kXzuqOiBdRWUNKHjZc\n2Jad\r\n=lfLx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIeH2yg+fP/ZU0mFqvo4hJNl+6QqJbUlDlQ1ciz8mDMAiBcSrctKfEbOPGBKO4NT0IsKCk6p4qQGlK+fmuU0Rr+bA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0_1607508425703_0.5734921915368156"},"_hasShrinkwrap":false},"6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0","gitHead":"7a78d3267bf61f041db5bf0e11dc82571a0ca77a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<\n  SubscriptionDataType\n>(collectionPath, {\n  converter: { fromFirestore },\n  filters: queryFilters,\n  maximumRetries,\n});\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ypHfspM7ggVezx+ZftfSAdhyIdd78OG5DxvOTk/E2uqKjzdlQev2bUAZfW2xxoYHHnXLcKaENEus+lkZCZNRtw==","shasum":"dfe83df4d9e7e0a7df216c7dd74961338855a1a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0.tgz","fileCount":39,"unpackedSize":234059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0KIFCRA9TVsSAnZWagAAQfwP/0mdmV7DV3gDCI3OsfJR\nStMQKgCfCWyqmrqlKmgdwMWlPfewAwi6R5B0wCCevY9CRon3qeB4xCqsTsTJ\noZydZKMQSvOuVScNEKuc70ILvZ2E7zhCff39Tp+0UA2WT9hVH7yJ5hpNfUY9\nc2lUSRdYQPRP0LSSjh34f53jwC1B2ARCjhzdU27NONCILzcrgNsYJzlhLuNi\nXxgF6b9j5IgIgaSYYyCUBdImXrSu7CiOWwtETU7EKTW6zX3dYVM9Pj08FvI+\nFstKaZP/P0pmUY/1wiokHJzUGEi+jfgxvAlHntA87pH9HKQZ1Iz01N22UFEZ\npAT1swMJMNiZhlyVfguahUJva4SpThg9krrac4+w4D/G+O/B2M1AjIk5MK24\n3SIFWthP5wMJo7bQbQK3OOZWd+nIjzZkY4TU+G0m9dyT82CqtsgyvNOQ0oit\nHgSCbWh4U9mH66AABuYGUODebvVyQCn49TlIUjZRhCdjlZZkBgLTXeYPtTod\nZtfLrCiUgkiKZYclldPPLW8oKDv7BE6bwMJwT1M0YNAHVciie57EJ3btDgiL\ngpvGCO1oknRrRTupkMmKYV3uG5Pyzacnc2R4X3+GNpAMqDaGEyZbd1lG5kG5\ndwEMXzaI/raNg+MsP9M73M2ivHd1ETc1eO7j9i/gx0nYsfafX21B03txBdmx\nmgir\r\n=HjVL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFcR9/w0DyY2rPC12tXu+n2tbWCJDyj4RChszQJL1fHLAiEA80Wd2nn4nZGO/RC+NDZyU8Ill2/qusrn9IYO9/QSUIo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0_1607508484812_0.9738565576859937"},"_hasShrinkwrap":false},"6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0","gitHead":"ca8f1ad096f37229c656a41243fc4c43abea0747","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sqFC25K8n2PBzTMP/FZHAFs3dnBHx7CY51B+sPvKCgq7BsCdRSc8fJE23o+Tish0e5o+iZJd021xOmxWAzKYjQ==","shasum":"af515fd526b90ca7624df7bfec9d598aa24cc33a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0.tgz","fileCount":39,"unpackedSize":233776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0LMHCRA9TVsSAnZWagAAh+gP/j9DOfySKM6FFAMyK17q\n0YlR785JNrS/gHqNj0gzo7CIVcXwtfOPgJNRuQyprc+H2pME2e6p8soMe1fx\niy4/u6L1HTFw8kYDMznWANDcCl9Hz7P1ZxPmHev+K7Jd1bwYm0QEHCvC6NUo\nQgO5M20HCrmlQj8UJAYTTiYgoZ8Um366lMS37obXb1UEWiwk1zTOBno3NCLf\naKnBFjCNBETkK3l2jtQNrHyCl8ts+cY7B+NQc3ViDJ1J1KxUc+TIAhjthKWm\nF7PDdu+xglthqRJ4AmfFKoHHCY79XkVGx6MQYZXdDBjUhhZivbjRyIDn8/TK\nYCXhhL9VYty/d8UKjfeO6m4dB58tY1d8jjOQGUeLM2r/rtnQcl5Z21vAmCP2\nrJzjHujWyIVRUEdZFzQxYgYAJFv0ZhTTDYutiql3ujYLcUwR5W53PQqZyZbM\n5EmjDz4bWLbm7T4HouI/UDl6ELEpJDK4ks7mFVwm/KnLTYykPa/jm7KcLk0f\nHDYn5jf93r7Ye5BN83kyzDDXS4febwlapQFNj9c7hINNKhFHpMdyW50iAAU4\n1cHYehfHoEVmpFbLVAMwsvM2M40D7iwPq+hqLMDhSn1HOm4rfYnd2Py9Cadg\ncHqS9O9bo3IoN3oKd+chu0YklZbw4ah6FpzgPz+oxVc4wRSRuNiixFJ/I+Qi\nJ4Xm\r\n=FmlI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGf3iIFfjvRcM/hM2fyjbVP5y8j864KttC3OubMkSRPwIhANex9c7UOelJqQobMvkxkU2qscGiw7D32hRx7NEpQfa8"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0_1607512838473_0.4806878329242026"},"_hasShrinkwrap":false},"6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"94ccdb8b27635a6bf4e62f1a2c2b10d158247910","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-lDupbU6BhQtQ2c01jp78eQHnl1sSdPgjYk8USGWJ0muLpuOvgSyuIVvrnCJ4vXZ46AK2AThoIecY7dDcrFGGig==","shasum":"149bbceecac3590acccf60434840a2e9234ed7c2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0.tgz","fileCount":39,"unpackedSize":233776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0LNYCRA9TVsSAnZWagAAnM0P/0rKG6sa9UKC1165lVgK\nDhFV7nfDG7pK06CGzwzNd6HjUZu2vX4JD7iTVgWgJLJRg93+7t0JcTgQxhFZ\nFFQHerNJNSjaX8+MALuSg7MjHquAfOoh2jlAUdYREvA5dRGaKM7FQc2NPsOK\nBxPGJqHoKnhKflvkyMiP7XzVhr2GBfKQVXiPrUrrO502tzSMljDVkrNL4Blt\n6dzpQG/3CD8s5RvKDzuDuPENH6uAOslylXjfFD+PK97ORD32xvJlrMmXAzlq\nejS2i2tlOHTUuE2EQgCak7pq+l9VT2FMukYnCii647Wl4H40UURrX3Dcp/cU\n3o4E3EquwPlNovczgjoev5cwLkl3YVoytHjIBNfcEBNlhJEXXM9X+jzMLcNz\nLCW7TBa/15Gf8y5vT2h3i4gKfFRyk11RiDIDktxg/+53Vlq06NGwl5sT8K+c\nooYk4+M13MFWCwtAieLovNouwbc5Z57SdXy9Dwh44UPZUGUm0aiNp19rmZbj\nUFR0MBr6qc79qmP98ut5dK1gxNonyebjCQPMDQ8sYjjMCnRmSA4kt/5bSS3U\nHbd9meRyM05Se+ty/uu+2vSnnteeYQgQwF8mazfDhQyPG4ChBUoVJwaxMJkD\nCZPDr6/wFa/uY8LbbEAmjub351vfbEqoNuezj7daKJphpGducr9587a+qU7d\nfE/U\r\n=iuwq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl8jWXzUe7XYJAouc62SPUPcv9LQF5TK/HzaPkTJIpdAIgP8pw85mNckgYatcfWFAaEBeqsW91uQhfM+reA5yHZlI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0_1607512919665_0.0004558393974527508"},"_hasShrinkwrap":false},"6.4.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.10","gitHead":"c418d6c7a41f388c831b754215de57f6eb53783a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.10","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TMEEoBMkevFWYzQSiCrDkMv+gA4kb+7M7PnOuPGQbQVsig9H4KKRl7fr84XDtg4srOn9+Oj+EdmQBvzZiGHItA==","shasum":"12d765fab82dac121a86a40f2e4dde001b33da7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.10.tgz","fileCount":39,"unpackedSize":234009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0LNnCRA9TVsSAnZWagAAS84P/0BFjc2J8Rx/RFtnKIPF\nrDioQS3i+F4KqoBem7l12EUjR3re4OVQXY1kAWyywTNTZAXE+tIVGGDt7cwa\nn+gX9y3keFcKXwiCTKSBCY7Ex5xPR9ge3au8IMcZ1PQ/aKx063yTKKRU8I1n\nvuosgzXuqEBFy9vNmMmE10Wav2YZPa6DeKmujzlm267BjW82fXpU7aBpg/i6\nloi6+ki7eIHrpsyR2wqvEuBsoHi8F5VdMCR7clyfPrOEYQPUCEEiGSg8YoLK\nYgk2REFzVj+arA+j1TspSvxvYUTFkRlvpywGamBynHcfpRkT1whIqi1v4T/3\nKTvCreW2W6i70PJYcFpZXLd+JVG9EOvfeWy9fkKL7XW1VWG1LY9kBoyukS27\nx9Q6Mj0s2MVZQ8twYYcvjxsVnwj0LaVLLhuj/WlISFbR9AIG2O5ujBoYha52\n/dCSTSEZmaCLZk754Gy6GbEcdIdT1xxx6SSS3dvuKAI+dDjtZaYzJW1jgGLn\nOLQu9HwPu3Nk1/eGKY7o3w2akK3UliF1lbM92WBjALkDxq/lSSi6tJ8ifSKJ\nydEPnfEDI5Vb+E6NsppnT+MSNNVvQSPgxobC9MQvv4fNOeThyPE55U44+Uno\nXPW7Gm8TGx8jsNYvnDyygRtHhWuJOeHkpq3ZWsRnERcLNllwmmbbpJVh7Kt2\nMkUV\r\n=QV02\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAeSNCY8ZM3DKsrvaiZBnErHa8TngR4uj2nQPZfUJ1XQIgXPNWJ6ELNHz0/4JltQ4e035NL6aoSCUGx/iiQrSIEJE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.10_1607512934759_0.8693848364384416"},"_hasShrinkwrap":false},"6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c418d6c7a41f388c831b754215de57f6eb53783a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2sES+fRLxJZj43vLmtQAD88KujKyAewdv5GR4m8iMGGHL6TcKA2Ld9bwi7VCVWVRUBqVUhjFscZOTCnFN6rO2g==","shasum":"c2e4e05d261da5b0863ccdd950e2c7fc97ff5ac2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0.tgz","fileCount":39,"unpackedSize":234052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0LOGCRA9TVsSAnZWagAANiAP/2UpNuFjMG2FFd8eLW17\nM5ufLM9L9AVMn4XketcQIO/j2eNWAOvgZ/7h+2ffaD1fet8G+1nE/xiK3jYD\ncuEI90Oo3LZn5YDuTj1ZDV30bb+DAUuIi6S2YMUtrOZaWeU2kHOXwgbvTR1O\nSWiDM40BE0xGcSlU637YFsvoMeBi/j+JmgP6eG8eS6GbE7D15BhTnscZEKjg\ntlHKDnSVZ6S4tb4TUs16PiblTWF3Z8NPrEn5iIzW0FcWRqrjDkZngDY135tt\nAsxIB6p2WlRaJm2j3X3yiIwITXeVML3T/AE6BsfWjMAzuW1UTfmNzNPzhV3c\ncW8NIpKVu/jCqn++186RGAd8kfLFx2sk5NA+M3JiRDqXDNYfzZ2+M/10Orxv\nNnhBi1+s4zA2qE4wxrIlu7e/cXhSesBl7IjYcVoDF/RZgkhj4SBNPVMP3ROW\n9ktqN3POMzQe/9N+V/An1Cr2piOdGEMFlEMBivqdWBUmepjAn1WbCbfb9O29\ndIihpHjokc6vGfFrXrubHBTsdM59AWvT4U/V3sjVZFX/ly6qmrZpNnspd60d\nonc7DyUY8RFxBVwaFqcecTnSFWh+XU5Sbf5adPFQ8si4jpgG2W+b4xZQp9Rl\n2NBDkhM4kgUo9cyydnMtt8bFr3273RUp1Jy3tVUqTg5Ik2NuoGnb1IpSAseT\npl1Y\r\n=I+Ug\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+RGxm6rSEwYEIAF7g8yeG/AvqKpCwua0mPazyNdYBCAIhAKKRAqd85ZmtkJmW6R2LrRhGvUvaA4mtnfFizumKk7us"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0_1607512965665_0.2456792753006718"},"_hasShrinkwrap":false},"6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.11","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0","gitHead":"a6f29f5c8c702726932aa94a97e554794b7ec5b8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-KQVV8Maa6QcKTSWf4C1uoQbLs7yi95zLUhCLAfDHkKhD1KAtayR60WWPi4QQBAkrCMPCgyHl+nc5jZhXlIh2Sg==","shasum":"b9d10987fef4c9b18547e7ae637cb649fae6d374","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0.tgz","fileCount":39,"unpackedSize":234592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0eaICRA9TVsSAnZWagAAI10P+QAAlpkVdKoCFY+PrBMB\n6AsvKpJXgqPzvW6fbcmoC0PIzU0PPKHgVx6u1GEf8l8YeOvdk2ZonaNXBbq9\nNXbT6IJWZSdP1s4I2HhGpb+T0vZIaDMjkamNzCOfNAo48T7K3zL4k5krhMe4\nB2//XYq7LiEQ4ktQQ7OtJUNl1ug5eWMZkLPwtLPbxeQYR1adSZxqjPB5lA67\npyuSspBNCcsr2Uc++EjwxqpllFJowlc2k9bw4QyxRzFmO9JFZbd6po2nttoh\nUbxNFTEIDOAR2uRVvfES/6+wh4nL1M3bwlqU92/vI2aniKrliVJl4evHTBRw\nJ4+cIhX2tE1P3yVBpGMHa8erGrjRovr/Al2De35A99P/hZ1FbeBI1eWgaGlx\nMA/RuU9CR5Rr+saZB8Rk8Rj8xsQmQzs50p0I490kudFKJBbcFahI6AVT89vp\nlyYfkYNJYVj7TTIzjA+UZOH46cQCYym1jRam/aT71BO9CQ0QtRV0PvtWBhvQ\naRrT3eAtbCZMRiRHuP4MxC9NO8YF4H7U7+Ng5loHY+0yWq1mFXXC0SR4LyjS\n+epq9hL5p5BLAY8F/RWJ8ExjdrRu2PU5oTFOCr+n9+QujhKCYB4hYCSTQRJi\ngQ/UMMxxwMhld03ixXiX2xUWji7g2d/67YPiQuIp8h8bM3jEFBmj9IS8O67Y\nB1Ia\r\n=aGC9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyQdf5alIEhbgVfHxJhnWUnQGVO6EYCAxzktzNF1+4GQIhAJ9utbfrv21K/mVEsqTE1tJPWgMxndpYaUSH0nTT9gDq"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0_1607591560101_0.12785908647617816"},"_hasShrinkwrap":false},"6.4.11-fe231c53b200540ed0464b197549082acef3d990.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.11-fe231c53b200540ed0464b197549082acef3d990.0","gitHead":"fe231c53b200540ed0464b197549082acef3d990","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.11-fe231c53b200540ed0464b197549082acef3d990.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Xn7C5QysuvbVkN/YpRlUk/7R8f5r2PmzYw9mstjh8hOKjIVpG5xY+2EAqIclbIvpUe4yquqvqw7zLIA1LNHUUg==","shasum":"0f6df0afb92acbd9a64be34ddbb9e3302625aef1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.11-fe231c53b200540ed0464b197549082acef3d990.0.tgz","fileCount":39,"unpackedSize":234052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0erdCRA9TVsSAnZWagAA2z8P/i1lldm6aMB9LVB++ybZ\ncCsayxwWZAGhUhLJKxTj0yeXQGdXQr5nCjIgVtwshw7evKepDAoCfF+OQDOr\nEtvIdefMCbbLD5ZQtbndo4PO4F/qOfc04liMOWB95k+qMXqvgVgXwjTYWDWh\n0jlAIT+WfkJpBRylLIABrzLfciw2d8H/lJWuFa8X8J3JAZcPZk82SRMNTzdD\nlHp7JUkmFBJlph9iU9TQ0JMC4SLSeA3b+r2gxGvV7j7JtHuWNzTUe2zUBPFk\nl4FyPV1VqRc79hQMmVxfMbqWlVTVVht4+LSiq7Z8o6X7XAhZsZ099ys3qVdf\nPQdj1INsqn/q52TbkBGeXd+RYXdrsmcZW3ZWpitGnk4M8MD0Hyahp2qyY7Lw\nOD4jRnYIaFlP1wtdSWf5hbftJu+3WlyKnWR4jo3g6xiwk9XEOGE7wwk++THs\nLW37cFvgjdSH+cRm1ixojuOM5eJI2k6k6/IWocpnwKY8vhRi5Aj9JWfVK9Ps\nHRUgTU83b9nEZGScf/nUcSOkVDT7aYmyyw6FLdvFBCHOOjvusBmjxzuUxDo4\n9rzvYi6e01JmhDWoRqWUeptPCpsbVuhdWKmJqjHDE5tvIiNUJz6/rEslYnzC\nNxDceCWs8WkisElgQMmHvelL8vWv4E8RIKu/A6qsFJTxR5EmpLnkQkI+vB2W\n3d3C\r\n=MB0x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByq0quhMk9UTxVzfWmXwrsJafXGrc5HTlqSaIb8i3CjAiAMm4h21qqwcEIwW9kqEtiDRw5P4K8tjzFT3tOXxcFYSA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.11-fe231c53b200540ed0464b197549082acef3d990.0_1607592668527_0.4311864460106376"},"_hasShrinkwrap":false},"6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dc7796f268c8f93a834d4a1c2d8dd0d53520d57e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mg2ebh3MlvvmWMEmDY6kZHip0JZVJ7BPI1iwgSZU4hUafo0EoXvSWsg2O1xTSlb0c7h+rdePh48KfN5ov/7MFA==","shasum":"3d4b4e5ba79a2798fd32df063d6a4c38824edfb0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0.tgz","fileCount":39,"unpackedSize":234052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0es1CRA9TVsSAnZWagAAOq8P/jF0xFxiajWSVaEexGJX\nCHuRquUaZhJiEF55u54wJdxg3eeVO3wR7vmU5Qk3XLWMiRee1YUkyRlubINp\nDpAiX/Lu7AM29Zd19sIe9LPUqyJHHM1HKnWdLyt7yKSJ5HBRNiIZjc+QabuU\nSa98MEGtN/u5uXwThguOB3ZNEjQwg06lUC+7v+AkREClDLc1toC5yW1OE/c0\niQIYKaIzDQRm6UDGDMmBD27wOO2l8sp3HFv4PbamsdsCwTNNsF4JsICZrT/W\n8VZI6ftSzMgFU1GNYIdE/+g6KXwD2p79ncUO2a3a/EZCtEqjZBqAd8+49ZEN\nrFQn3rFTryyQpsOGCxgpWyP0xACbsg5RsvxINracW9/1zBibwv18/Wv7yVtA\ntTyenoQiAanfOyOJV6FaKu7XQDwES9bV9JeL4ofETWY63tBAVndfCP2a3f1B\n/GHKuk6h0MLW210FWBXe3ZZwuLCJV1GHi7uer2qPGNvoen1x6wv0qVNY6MIB\n2J2E0eLmaYLKSguIRtBWgyASGmPrB+abl6lj3klhxYRbwrZLGQoQvkJSCsYc\nCM9YotRwOGXqPgT4OSOkiiFIJyPGkeyJRQYwdXj0Jkenv1YOX0g77Ovrw/n0\n57KzBhZvdrWFtmQSS+ZJ4GpoGrdHj4bzYoCS9eJw+PS/ywkrZDqzDpBli5vI\nxrXF\r\n=Kblu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkzCchuGMd8vyaXFquAhqEMxeQA25KlClcBO/z6gPYxAiAovl/KZC3P2RgS45F7bYhRL1xaJaBLDXs6IDM4lsRkkw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0_1607592756524_0.8367620375312621"},"_hasShrinkwrap":false},"6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^3.9.7","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"44ae01183c353a5052fec61e6fa81badb7255dce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6ZD0OoKPt5hv4fksBQO9guWna5Sx76sW+IFfd7MnabGsEyJFB50jJNK0ytpSQC0Mn9mYSiSwvM92WOc1rEEBIA==","shasum":"3abaf46241db70ab2a6b34933e45f01f006ac2e4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0.tgz","fileCount":39,"unpackedSize":234338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0etVCRA9TVsSAnZWagAA9LkP/0Xy5+sqRa6gqpMBF8qD\na2zmwYpO76BvHGSdExfC+6qrhSJVfD77UlTxqVT9b4KUNjp/eUrRQEq/tbRe\n0JsIxd0uvMmDk9VQULo7rKEv2aKmiqsSoeAA2fErCMH1aYaHxCIJa5nWzQ/Y\n2oXrntO8m6tuDV5H8JUKFwPfMR8TCFSdgVfrPSTYWdqPAxEAAEXkpSQQ3JxA\npAZVPp98LIxOBVaC1ceOLnYXfnmpq/hctQLUrriLbU4bvb1gzjrLyZHbZwdi\nC0TVh/ivcF+9Ihs2v3p5FuD7AHyH+MkkyGssKaxBQn3IHuQ6F7dpW6TAT7vP\noE1lE0nsdoCQegsgLhRQ90v2Zoa10Z7aIpwHmQOOAPeUkpMYsMygMReqQTqC\n7mJ3hATkbISogrXTLtYIikoKeEgXWBRq9LMig8XYVq8XSqeBZ8BvZXvyK+RA\nAJNbag2lrHugcjRmoQA6jPwBJFOB79pUlm2NTn7pwAMF7KRcp3jXLbpvTiqp\n7LxeJM7fMKFMK0tpFZMGf0WQL/ZwZeDr93i1/Afu6BwyOma9KYCz80t9bx3t\nkZ3c1hEHbtpPGHsMkTw3QozHxfnksCLWXDd0lZWFcTrXBr5i/OhH2+0u9z+o\n0bR7xmmljSWsTSb/3x2/crvBQAPdmbsLR8z6VVpdClw8rz7m9MzrQ67kcCzT\nb0lG\r\n=GGZT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5GTgSJcrmU9wxOAHRK+3k+V1TFS9d1Alo+pL/VYTrtAiEAgpmISsKSXMwlFweA2o3mmEtBm1ks+KJaf7HmeQmddIw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0_1607592788673_0.4648486821883575"},"_hasShrinkwrap":false},"6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^1.1.44","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^6.8.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0","gitHead":"afb83231ccec7c371329a1ad329e50bb9b85993b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Gp2Qxt+cP9RdpDHKV+8TCnWTJZ1Lj6S2isJhiY/1Hsf7Q6uuHhlwKhJ3mpt+UIzn50x7CjnwkjztK+04ahLXGA==","shasum":"5ff3559db04bdcd38578cdf7691f0154f6d5bf2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0.tgz","fileCount":39,"unpackedSize":234763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0fQKCRA9TVsSAnZWagAABPIP+QGhWHefKaBLzTpIZjcH\nBZPRdgM8jJa+5WQ0t2WQdV8XYXmLApA+9he06JCbNw2hDPOo3cJmLnXSVC+3\nIfDkfY+izTtBbRhuQuEsn0gg3KAWbZ+3jOcTEPO1uDeEPjRtOdMzOc1ZRYvf\nHnztOvCsjkg9+V55QOEEIRvkTJ2rzTh1iXuMLgVhnwq77ACEuMZ0g9mHQBwG\nwjz/gGLGr7wwsKx/ny1Exeir/92gj2u8vCFHSKZz0NewtYIiTYts346FEL34\noZjSNVUyQjwxIPC3h6t8a6szP5GDHvd6vpIL4VLcV7knScv4VsS2zuCAG0eS\nZ8uhGiDM7KlTYRuuTeC03rzlLpBrEu52zG8XagWJ/IYn7eUHXPy4MGbOjrcp\ng0W++txJNiOA3tfEnSLA6LVPCUDc6Hq8VwTouWV50s4kemmlYhZbe7ZjQ3J7\n0PYYxMF7C/GwuiD5KhdUKFkYvNkJk18bURubnG6X15nBCkC1wNLzMkavHMU+\nbfWctcebsgPB3gjSEhhoe9UKNatBQafSlYVBzDUB5FsAZqRU7kxjFBbzt8Nd\ns1TUILljSgSXG/zDpy5U8BRZrXUihwW67iMidgMBrgsTG6+6yqyyU6leiJFD\n54KHCApZfqjFt5bkXga/F3Zp6dBxapAU/7VYrp3U/R5OM/R11ZOh59+Yp6G5\nJ1QE\r\n=Ha7v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD98l+0B5ZJoTso/bImROnPCbiWYbzVE9uZJ5V5D6uvSQIgUUNzXFvafQMcn/wOvrgl3D+8WmQToDv+4+uBifv+Ayw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0_1607595017662_0.3762449218442572"},"_hasShrinkwrap":false},"6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0","gitHead":"7d38174d58108831dcc4caa90022635eb0b6c656","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DZtJFSJEt4Z0kBFRCn4IyA70LnefLblXpHtU7caSCp/FRJcDx0Oc1F0itxiU36/PRzQ9u5p8zQqfdd5GAghNbA==","shasum":"ee754605d0fc1f9d7073714f0e95ffdb68e3da46","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0.tgz","fileCount":39,"unpackedSize":235865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0f/wCRA9TVsSAnZWagAAEfQP/3aueZoF9c2Gl5dKbEZB\nsZTpM+p6XKu7LZvf+nNgxJ+vN9uiv7+oP4PEFAEa7tDBxAuvbtGhH5nG7eiJ\nHB2T7pwHkhHUdysA6INur314LNHLYfFUOP0OE/ofbLhySkfk4LpmpQtiSxKZ\nVv86FUr+Fkrsvk0QZf6LXSQrJZhmf709z51Arsbhl8LKuLZrrub/Ji395Alj\nXoUqZtqRzHlnpoMBQ8Qqh7x7fpy66mfRkFWeXurlt2ZUyJ7ui+er3IbontRo\n8GIn0ztQVVLE9dqh6aAh8S0e6YruQ6CnlLZ6FhZ8FNifVX1xf5BLB/W6Rz12\n9P7u2bgJYXHiPwqhlfbif8DFrk+UKxqkA2gvvvdubcCneOOyWw32wSKbV2z7\njgTdSMn5WATmvxzXlLLMgH26Mo8FFP/1mMnGP9p8aAu/0PxuPsHopuMY/M3l\nU8p+jWsEn52sFvn/HRczW8tSfsGKzbb8a208ybzzMzHBUnq4UK0cC1T8OCHm\n91jT9bQ2p9QBVMRl8br3/RLVhySeFp5I7HVxqEjg3Fy8u0Vw0895tJACEpTt\nzqb7bwwKFQu/UcYpG324TbP6f9FOtS6F/URs+xYl/o9JkIai+hMeU4Uz9wYI\nUqDiNZV/sG0JZOtguc7Os8zUObyjtHvRy/R2QA2Rg6j/25oSylFyRlhTXiNd\nB/dc\r\n=7RUp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzvCCi/umtVs0Y4QxPxVIywh4FEFUKgKTeT5dgb4yAkAIgKIT7ViDsPkmqrXsISNiUoJVHVaMzCzGnkDDbG3FSOQQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0_1607598063818_0.5547755353435029"},"_hasShrinkwrap":false},"6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"34fa7f9796fd3c28a328c88b0ddd4608cd88e99d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MGXRsHii/5dq3OK+Mq42tL9eSKplUevFZR4SZKzHijrV5ePE2n/JF7wlzW20t3GyOECjl1M1a3ALkN2LpaISLw==","shasum":"93355f44e265e8028244b59db739e323698fd00c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0.tgz","fileCount":39,"unpackedSize":235865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0gBOCRA9TVsSAnZWagAAgn4P/01CNvPtgFd1Yi48vKqB\nRO4Du8fJdEYlGC2ECmTuxx0ZEWGzWJl55LiIfBAKOkah8k0CIrgHS2omlv13\n90p99vGZbgyQHoc55FQd1FduBxwmXj1VfFJrxwmgB2siKgbZSZcrmkxLDuPW\nfitydqkCcA5esdiDBEu59ZEjy5jxIHJ1/X5lBPPNy1Xs/2PBJPzTmqfdMlSh\nsK+rMNil0gRCJIhtkt4ZmQ2r8HfNq8SrkcZRUPR2t8qdY7qLNQYSg/ZkwgpN\ncUrJ9g1iA5Zq4Koihs/eB1f6nnWGknIXFy9WitfKSS0UFWchMum/uDlUPMy1\nQYYppuDOL5ZysfZIoXaAtrEGe8uSZu9mzTVJuVWsy86nksYXYesD8izwsrCH\nO6eMPBzXOvsU5Vy+4K9SIv/ScnrIZo73BOHbYLL9+UsOmHcxKKS5ZEnV7++B\nSGPH6Cv/fFm5jC5FgNsLewcSeme75Veuzy9pnoL/GiiT79GxKa8iY36has+N\nQYL+9znV4hH/k1XEKZpqtEfoMZeN9UcYjZ4su+KfDTEUCnO2p+SFHSa4ipUo\nIFq5VFPp0iovwyaOMmyw5tbwrcjoKTE6wsXa9kWiKkXhdKgf+jEjOW5itS2+\n5iv0inxDxJmO0QMIgOqusl87hnxZAXxvm715M9xSO/OyXAfw02GRvcUagZ8p\nW3V+\r\n=Tlkf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsM4GnWBTgFnO/vd9TRVIpdBYQFkCIm+fcEZ9YYagWoAiEA6V3jpqc+6H/xluMiCdA0Rw4y0iawjP3AwdUU25h/Tmg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0_1607598158085_0.26439036701066954"},"_hasShrinkwrap":false},"6.4.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.12","gitHead":"67416f98548b63fd9240e1f442a984a1997bd3fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.12","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nk5pmBH41sYaFjbNCdVTDeyGh3RKNwEwGZpnJMEEJdytz3SRuz0JMiCiM7ONXzaKV1j/7qh+kop0oWD6UJVotA==","shasum":"b787f5868db477e1a20ea7efbea95a31cc34da08","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.12.tgz","fileCount":39,"unpackedSize":236101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0gBsCRA9TVsSAnZWagAAQeAP/ikyQXtIa0P9HEJRu/4Y\nxeA1KP2WNC0SZwlhzNvBowF7Q3zRn7sExx2Qnw3pnk4t1xqHsls6pGZS+JVL\nQsk6T7mHyro/fJF4luwfYoW795qIBwQVwDAKv4RiQeLzoAfWbK4We02+a/Fz\ntR2NRZ5b1SE99+eQ2T3BkJsWTQuXrDZZa4peocVIMXmlRRU4YNRZsjRM5ZWC\nynLv3heoLcwagwquWF6/ZJCfjkz6nOi41dkkJ9LVkp7GK4xpatVIsIa4UyPb\noct5EcmT4BMLqaQtSGQP1H8ruVZbulPJ8xoBrwr1bUdAi9jESGpQ3dtJP4kH\n6lQDDEO0WolOH6WK7geL5zAYHYC/t0kxUHJXi0NG6wr11/DWIbyapPq6bCBU\nAeJ4gs8s8Px+yqZwiqKxIdxvXp6xvdcUqwGU8cfGwe0Z/qwr3t+JGKvl+UF9\nYpvofkMCD/e67ZBdsVcZzbdOOZa1eVCWmnGXwcTDNg8WDMbBnN+k0Co7x7cN\nEwUBmgCCVKycQ1r4nWCY/JTBdC4xYGQIHy9kIBdPOh2wU53II5tZSjekA88g\nl+HCn4PTbm8zXifCw9izQFTKaRRFYNIGgXu37OSIven4xcWnckINnO3iO8Qh\nUV6ZI/fT38pO3vJlq26jpw1OltgOMsWbJT9qDcUYLrZfb2h5fPE4AKJ2P0DU\nG3EW\r\n=85re\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBxsXW10NciMEqaWewFRvMiVkuJG3/7MxjvOdS4EHoGhAiAn2mx+HHK31udn8/ES0Ks9ye+Hi0NoCdeOK2osfRiG5g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.12_1607598187811_0.7279721108676003"},"_hasShrinkwrap":false},"6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"67416f98548b63fd9240e1f442a984a1997bd3fe","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cLPzIKIRlsLUYw96aWk9/FQVAPxgxlHdtpGkqgIq3/NEV8Vu/gOq+FBZw4TkDS3xPIPJj65dnUFKD9ULlFqyRA==","shasum":"fa912bba6b07acf94f4d977e1e10603f73e38ee2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0.tgz","fileCount":39,"unpackedSize":236144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0gCJCRA9TVsSAnZWagAAg7UQAJDtdcCXEp6Nc9Zjn6na\nH2NgMVtFAO+QXwhH+n+aHKFO1f/ap7vXUsoDvnV+Rh57H5Qw/Um6xmsROqX1\n48A7/jLUpoe8XFY5NAtLWEsif8fvpiIVSmdmTxiKTE7FBNoZC24JUTETSQ3G\ngU6Ml3/pHgmGj5IRi+t15OPbZcpUA5pmvy0/+wfvFhIOfEUzPceso6OTUcLA\nO+EBb8/yapSsY1SoMairy9AIjb15LfOo8BFrB7cm+UenVEfqL1SI3pfYBajo\nVZTF3FrCDjSMSXLOBfOKjJYfN5XPu969IvhwFAx25WSWgro7TqHdi8mjF/O4\njvzFNPuX1NffRaI9tMhqjtJYZA1JYomtmjE3QjGAXbuk3ZEgl2PKbXWKB0ne\n8er3ibEc2KWgBAWba0bqqloRZ7nSqb2ULrWnzeJ2wKXDufHqL8zCEBKaqcMG\nB4HY0LCwERuVzvhRVsHfBclrvR2doL6WL+SJSC/j8SOu6UJPLEFAnsHiSZ7w\nNycszfpcBNp9y1ayxXhqvk5QzAS/6ScjbcOflX5WYNf0biq36+E0OHVn+KLw\nuzYf8bqxuVsaeKdajphxfn9Uf+DuFxxgdW4PxYXgIp1vVRQe56CGlvLCX/WW\nUJbWEvPVeU71d2KQKGNZO6+cbU/EbLgnR5lknStxawDi9nrTj5XaUgxGxDrV\nZkX3\r\n=krY4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXki0W2SWUpBFGnEpcc1BwMUCN4gddXFz7TYy3pozqRAIgJ1dJyDNQ+E8+S9xji2G0C1RRpVYSoqxtNYSmSqyKSHA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0_1607598216803_0.32769622491657646"},"_hasShrinkwrap":false},"6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0","gitHead":"0a0cd1f3864d9568f73ff2d4402a094bd55b0f46","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-etQ03wWlLa1b4fwY/BbSykco67TU/2ccF7swMlA/w1tkahQkcEPya+9XDJA1RWuYGMUNCzfHYXWOjmlXVXfh5Q==","shasum":"23b69d5c393f61b212d4d17a0be31066216840c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0.tgz","fileCount":39,"unpackedSize":236144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0m5pCRA9TVsSAnZWagAAndMP/irkyFIjmATpZfj0P7/I\ntQ8TUuU705J4cGUmpnyw+ki6VwyCgfC+4ER4+s7+qbIyJwaO9F+rVjtJTBAR\nVhCJ9f5Kj+4GM17RkU01WI6/pHSXaCHsrA4vmeSoqvdR/uIMVD+mopjjIajy\nQVgu0oFyKa6eeYg8seVuLnew9AfPG4TQ7h+nZZU/agEupRtlde9q32/I3joi\nHfTY5H1wPV1LgRUDIx9EB3mXY+7HShamc+S8AHSbqWfllRFI29CJnDf9jx8Y\nuYoeiKaioRaCu91QQbro5CTcv5zUtMOuAygm9eNDH7ORuGuyWmattvdPPepf\nzCb/J1j2wYxg03DGx+8l3ZnGbSsdBFZ7dZm6rX91pvWcRcthg6xupqbU4Fc/\nv6v4ncRWdPTVlfqpUuW14r6cVI5L75t4ZINRPYo1LvFbyd1gwUTWaF8uhGi9\nugdI1aDDAy5L5Sn0AvWN3UsfcJU3e7NrDedAwiAZS23e6lApW6r4ay6JLPb+\nC9Sh0dIe2ajtuL++VA0xeFTOXBFZ3vLpVCvnlxGgL8Lm4AiCkZMOo6R67WSy\nCbHMViUTPeODhPeRK2LlqVc3kWwB47gDeUXOUggyD+tK98X3b/XyyJi7JZUU\nflWNWKQNjqV6b18/UJHCKl1pIzsOROyYAqzsreevnVjfiqLawgf4OjkmBs7+\nvg0k\r\n=kusM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCITBqbYgm8OEBag0o+VBiaWVtPjAA+RRxci6UbgyKQRQIhAMq1ZvFKHk3qZ5XaUscD/m8JrRYcgzJyZhv4qt3RveGa"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0_1607626345005_0.08136488327822367"},"_hasShrinkwrap":false},"6.4.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.13","gitHead":"e41cf4bdc3101d9c5d70bd5c234d127d7e40f647","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.13","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+q5AsD0CjjM4AsUyAkmQiWorgJQK2SBF3LxWrsMQ5/Qjuvw886s+yjBfRT7qKuiH6qXSby9kuVD5VZ9gnRUBHQ==","shasum":"5f28b9ce99d700be9bbd5bb5c296a97b591114ea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.13.tgz","fileCount":39,"unpackedSize":236380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0m7ZCRA9TVsSAnZWagAAyTQP/30NJFzpbG+9nhwHF86H\nYIRDpWHupI9lyRnCYhZQFL9FmN5TL2NCQ/TEq42NtD1NA4SiMKYbA8cfOkZ1\nK7RyC9g5IJDnWJPcgCnj0xJls3uQumIe7ZM+hCTdFuBvKjkrdIaZ5+0eFp5A\n80C7XCrTPDD2JVR7gnajVX1k3Dwl84VWAs/hZJln0x68Fu6jebzvfBQ4v4cB\nwHKjyGSqwX6J8jWZ8za6FLVS1r1CECe1ySAbcKVUBho88YGewKjL/4OH6i/Y\nORV44Tg/eIhlJBd2qfMtWAuZuD7nx7VxSP5JvZ956TelsnK1iZwT5IOcKcAX\ngwy+X5pBlBEwwBzIbM6a9YsvuSy8ouK6nLMsXMhk2rYc5PFjNKDXSdUDbCgS\naAJ+2Z8fVn1h4lihw030OQCN1ey8sHNtC3h/rQbr0cY3tZpoRlhvw4QcgTo6\nD4H4M5K3KMqKBzg52Ilkcfulk3MdqNVpQMu0hnAriD8pCTGoZx7g72e3pcDD\nyIaY6jxk19gZj2Me9sBoLJuD8DLcdpsAmwYRCSDKEY+JAVpArqffTXItdRyb\nSw9T7w/tEhEMrhwe5JldD44SDkt04IzAWRIFx3Gn7Px6TzIk7uM5zeNozx5+\nyDYlt2w3Th1Pn7QN5X63kWbie+Q9w5qTVpz4LhUk6NMsRmilbJEwqZy9lttY\nmSNd\r\n=/VSh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRK1ecYlBwCtH7h0lop3g5a7Quq+sQDtvxw8cBsAWGIAiEA3rYQ9NHqXv3bGw8+9nA+FKZkft8oezQ2/MaUpQezwVQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.13_1607626456982_0.8617149772012926"},"_hasShrinkwrap":false},"6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.18","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e41cf4bdc3101d9c5d70bd5c234d127d7e40f647","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-oEiBZiF0X3WjCAYmoDcxAhmFi0JlhcbcHUGi6evQdc6AmsU7viY1pSbAHJRfUnY5cRQFSwMhoA6VIMQrxMm3MQ==","shasum":"5cd19a92b41b760d8e20f7e52488c3538eea1e21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0.tgz","fileCount":39,"unpackedSize":236423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0m75CRA9TVsSAnZWagAAWB8QAJP54ALp5zbjvSFzp/zK\n4b515lMyzfaHPJgAqDw5O1PXNOnqbQsZF1PtE8gYaL3vKaFc86wPANH3NGsq\ncV5L3e1mFOWuDusp9729l3MAZhfjzwxv6d5PjfZdTYTc3gX3+dnxhTy8B7Qk\nJBvZTMjfXagqQD608CmiYogKGIPL5dwhNfZu50qT3/ikR8fyjYoKmt71CwaB\nL0wo1ONRa5Up6n8A58W+CoZ8ThN5xiWyzNRKGSYKi4B2v4aKpI3RYyBWcL66\nx6mBiYvvmLxOKS6UParRkWZfWwz/cq0cPuLOakH+YeIMEr3HtbDNXW1YUoVd\njwLYSm54dnM9APqe4+Ui8aJFOZdZQlKdTia5IAkzfxpCiXsFTKA6vIz10Lk/\nxl4fk1/NYtWqblHR66Lxk7RNv4/T6ltutKrNGEbjwLOUe6xJlJSC20+4VFeV\nel2OH+xsCks0vioQzj3BocZbAWq0fk3DVFznugfTCTXD4QBaSJV86VGyasYZ\nxX+ly+5g6rfFf+3A4k+sNVE4o3nfZX0frCtTgQHbu939u/d9Pv9nAgHCefe+\nbiTY0PUeWpwZZn2EOk2EhoNdsUHjrumc5tbhcyWWZ+i9M9Pp30EJ+h0Vwc+Z\nxSu168IWetkzSmTfTA0oPV5i8kqd5GVQ5Fpgq24avjxFZwQYUNIfzDdnZNlZ\nh2c8\r\n=2sYc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv8IkKfQaQaqQAD//kq6/n39Shfwz+1mr4Yqd4WSwnZAIgTg01ymmumNyovmB9n3zZca+umPPlEFcYa+PkeAMN9UE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0_1607626488602_0.19004130912099115"},"_hasShrinkwrap":false},"6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0","gitHead":"90c948e243b2609baa957331eba4dcf66668dd20","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ybHy4bAh/oSuQZ/UroGvX9HDd7CpPWCmW4GDreOfC3AQhHQE7KoxYvsFai2p/XWTy9B/JDSCu6509GyvPKZcfQ==","shasum":"82017ff27f32db8a92661d0ada87caec382bc545","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0.tgz","fileCount":39,"unpackedSize":236423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0qXDCRA9TVsSAnZWagAA1goP/0tJTDWIdFqs47UtSwLb\nmy1aSXFXKm5C8jt4hGJH5wvKtnEM7eI9nGPpjxJHf8HU1ogwZVot74pnLKdI\nodhoNBiPo6v0lj8ERHIl3INf1ppeHqFETCKsUmQexC4gaGQtUMbsw6Jf41hp\ndU2bdui+0IqmTCOnsDya1o6M7HCkiaBBcR+UA0l9uxE0mMjsgFn8qvyl+f2/\noS6lajdX6OS0u99M8zQk5nUJvjvRFYtSgd/j790KHfCdZShBeokn6102dsBV\nPD+qNvcGurEO80FG3/Wt0I2RhL8/vHN/8XUlbMxbC3vHFrIhOVqj1qHePmSW\n6etx/9ouR+NdTunmmtz2fRTUxJHG+udh51UlRaquK6h2Gb4+3IVgLLswooTq\nAfJv4VCKOxBtwc+qBxTwvysHU8qVJWZHefZnJU/hZX0GuxLNg1+i7Hw/SklC\n9MSdl16Kanop+laYLHNy7jgi3P/o10pDoh4PLPFH+36ftBcfAOrC7qn5oxNu\nvGt4h6eaygXUFRVf9BAHZrnDnIzkvILOJZtw8kxbG0ITSbcdVHNuQB9EZtl1\nZ2MUvMx8lll3B1nEQblZ3qpU/EzsXQkrKhUnZgATjNm85+UbQ0FfP7+qcG0R\n7iy59q3Mf9xo5XZxGM8lw3LfhWC/172Oio9+a5uTJ7/u/kX3Yz1X/bd1Bgl3\npQ0G\r\n=+WMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo7ftyRvyoDNVzpvakV48kqK2jjMk8tvHljJSbfDLB8QIhAIkNyb+pf/5wifm0mXFb2VqOzRtLG02+YsRjawBXPZh0"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0_1607640515167_0.48678496447080666"},"_hasShrinkwrap":false},"6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f62cfe94155b87d068e1d417220025381c2ff842","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-lI0nDNOKDLtgEsHgJ1nrgUHyK0V8hhf3VNbLhl86zKwSoZByTE29E16JhAV6x0Zfu15leat4mJxMcGzHJJAb2g==","shasum":"7ef6c9584b47c90a1ff2475f44b47469aeacdcc6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0.tgz","fileCount":39,"unpackedSize":236423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0qYXCRA9TVsSAnZWagAAkXAQAJytXV79BLRqeyyV0l8h\nOkKhontUb1ItwDMk86foOd65EwsqBJLtq7Q+WEj7yJyGH3fM2OodV6qms+SG\nKnOd0MAsNkMVcX7Zer5zsdjpUZYhtmi2+6M5bRlcBl4JBVhaGcB7zuaipi2z\n7IHnq6K+R9IEOmtYgrq4I3lHc+ZE2385ly58OxgV9mdI9bXT1kuGVYF4Ifhp\n6PKla5iAKWwgGXe7WfhksN8RhQdGIoVZXxagdemlFJka0BuGPT9mO65mAOtD\niFZ7aW6SvBeM1Ax+ZYurio1RYw3FgYtP5y9Hg2QNnPd6bOOacR0HpLdVFoce\nACd5CN5boDFqbfJbvLMiI9XGMqhmcifNHwu+Pvaul7Jdxm5/ZW9t51g4slfW\nBNi0La2Mu+PsHKgMX6PkQMZT3HBkBNRSiOJy6Xy1yHln0lfw7O3INMMWkkcE\n7p6HYSfbsLUcT7J1sHnJ3JQPzSUKdwsoYBA5p4tCYbaSkyKrQ+NJruHFxB0g\nN0tDFHrZEV0gsMsG9IffYk0aujXN7jNweag7J1L7wdEfaQ433bCuhp1y+3VZ\n0U4yp1bMpa5CS3ht60PRYE0rKTxle0iiFjb5vnLtIuRQloSZR8MYKn4sVBp0\n9rLtrmSq7IzNBNpXTR/b8ZKk4ZWTXN+xyaUbuunLzBiqj1BhQ40Wo+kUbwmO\nLm8B\r\n=zUl0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBWe9yfp3GImT+JgdFMEkCefhUTdvcLMWSC+4msBK+eAiBfetl9QBlJImKKRLhcBL0FnVpHXyIKfE/D3lIp9dZNhg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0_1607640598785_0.24217234560812329"},"_hasShrinkwrap":false},"6.4.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.14","gitHead":"1f276bb8bcf090b684d37f17b8cbee0accd889ad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.14","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fhep1VCXEc/f29p5+yADIRIzzjhSaMZB6vkQv0GUSkh0DEFDYYVu/QKcXtHJw5QTehsG9dY0Flfup9m7JaP11Q==","shasum":"1111508e14c11356537552ab51b53af21fd620e9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.14.tgz","fileCount":39,"unpackedSize":236664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0qYkCRA9TVsSAnZWagAAtDIQAIKAHFHLzcKj49fVEBbr\n0GnAmoiKVV9og3vBXuiJ67HaWzHO3OvHfArSBJRkW7uasMm3x8O8O4gH1y+P\ndYQsuzyHkWEQ4eVs1NTXJ+1vUBAi/I7vNw/5gG9AUhm9Z/zVBgRRofXgqgr6\n0c09wlhMyeXUYEpkBvRQVbTOlsJkz/FEjD5e4D3Y9IEWZ1FfXpX/750lE3aR\nTB6PciTZd87IA6nx9D5upAGx7ecgdTlozf2iEfSUZiQWnKEEfId7tT9nywsM\nT18vVLFtXGmdqWGXMSOvmygUWYiyX2tKQqrOX4PUkHSKi/bordwU0HCOdu86\nHPwrwYzQTfZtabqJs7wIDYsbwNgha0fNJQYhV+aA6TsY/5ZH+DZM6F9POiWU\n45OCNrsIOJRkHM7htiUs8dbhoG8GnKVz0PJHiaXRab5tYef3mjxu7CcYtunk\nOjwLfTxC+783NPO3yrZ/0ZJvnfQrELSbHvivCLEJr5RfQCwyFlXGSrsb81NG\n7kbnuaJKAg86joxJML9i6RUk77e2GBQdNIvTF1ijd8ZsuPSdcQH6QcGTOW4U\n5gB1QWuEPeX0xIb7Qig1yCOkE8o4o0X3Nc4meJEPcaCD/6o0gxy3thqHRERQ\n6vU/C13iKYNuL9zagHWGu1vF2n2Ai5jp4H5WJ4V+x15rlb6TnIVBzvyDR6a9\nclwI\r\n=QQHC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9CArFtjOkYZ1H13C1VEtgjewKg+0vXCaeP5YtcgihiQIgY0xYDRv8ZybpAs2vxrSu534YsJ11+6qg5hCcBhs9Bg4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.14_1607640611952_0.3310885850084646"},"_hasShrinkwrap":false},"6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.41","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1f276bb8bcf090b684d37f17b8cbee0accd889ad","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kpBslFkXAw1xYAgBahTb+aR/aGb0SXnPwzTKZH5ddYCkQ1jrd8NQyJVN2BfZVovsS84MBi+YGLCveoi+CY51aA==","shasum":"b56b86eb529dcfe52c73fdac04ac32a814ddc9e5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0.tgz","fileCount":39,"unpackedSize":236707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0qY/CRA9TVsSAnZWagAAw0YP/27LJk3gpL0y+AY/ptsM\n7NfPvbJPIluFQjy2ze7mRqyvo5VhxR/VZVJlSpzUdniqEG3B6w1jln+v688g\nfBO5VY39+fjdsTWpmMYJFWueuN/UQijCNrQd2F0U/smF1rHnygpN1UAy7WT6\nirRF7A9kQhIdAIGVqF/DIryeZ2lB3Yy2mZ3wwgwUqZFPullHKCSAbWyO7+zn\nZZscBDZINVDfgv3HmSAbtf5Jwl2YOlrG4mkjgEy3mH/h7KA4cbEP8VIAEEw9\nx7s4bLeJ6Y3WggyM4tXcxdKu4UkuGNmjYC8V6ecaHRYgEiiONxFcyt/68oCb\nJdJagwXj/B98PDGgpDTk9ED8f3xpp5JOGjdd4RjvPNdkEORtewe0slaqmL3C\ngTGlG0JtJvmrQ0hI3OAvYBmcEyDJtEEy3SlT0xoHToQm0voUqjf/hUZFhTDs\niVtFX5drRJPNDdJMAhYTODtgBRk2fPy8q23Y4o6SpH4UNnpe9an5w1CQ3hCI\nfske5P87wWR1w4pE1BUhYANzJ91xfx9FGxblLuOf5ECIj7sfDQbjlDq9EW8t\noZnKwlDo7YlsdixO8w1qQITNiqpVYj14OgiFdJvGZ5sCXB6KYLEqXnvhEbmS\nDib2XxxkBarg91QTNw6ZXiLWKIaAGcQnce/GBQw1LcKMsxpimxgnzRFbgtKs\nH77c\r\n=2ot/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQ/57Ef89zOJ5+NNrkCIHJgqPz1eTOe+ghuwJ2OrsgeAiAtYk5lsYZLaPxt4/0pgpyDh1+rd8aukfe0C9f0lQdOnQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0_1607640638720_0.6706806186775003"},"_hasShrinkwrap":false},"6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0","gitHead":"15728056983386a22956561fdfc7db7771f7ac54","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MNETAbZ5miR72LVcP4NfQZWQ3Kptyv3RjrNtHg4waGqZWvpApe0uCop8I5MRrVqmdQIhrbdnel5teGO03OLkFA==","shasum":"b2ebe1f9048979133235301413263dbb064b23b9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0.tgz","fileCount":39,"unpackedSize":236707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0wV5CRA9TVsSAnZWagAAvUIP/iukZNhCaIqF4GOgkt0s\n70tb0nxQKHw3pgxXJ9KlQ5VGWEdpOnIwtJhshflzp6qknhVgDLsLi41gmkta\nlK5sppN56uizNnZpYLJCd+zLaqkq45NF17DWrdN/nZN7VvK0thv1JJ05UT7R\nlbXgJtB7HFzIpqd6m6i2osVHubzH6Vf2/UvrA8d2kPI4zcsJlxJBRtc0likr\nn/VqLpI5j4F1TvxATyfC6v1d8YtgWPwYbWP4OJ1qh+Xf1X+pHoZOk8tYmSsN\nChX7ZrxxU4ZG+BdxKSZiSxBVTi6wf+m5VJZr+Vm35QwBo21UcmtbRLpQpiOA\n5oiebCzwpH0P99YPN2w5FRdyL5/kVqPa9XduTqpPgNSy0qEglQSyZTf9MURL\ncMAp0GvdY1OhVuxpmnFUD4/Os8wHlBrU5qWo79C/0McZQK87QOgQNgrrtmCj\nEtE1LI8Mx5EQNYXEreN3oyQu1mVde12Z+UR8ZId5WBL43aN5U1E5C+3L6jFK\nP//I17s0cLukQ38S9kiF9K55NVBGIjf7DPO3hmByPPEcs4wysXDdYokyShW0\n5kSlU/j9VUrHGCIZMprnMVih1aj6kxBMloKSPRq5t48h4KDnBGv1RCIUdMXl\n2kKcu8L7gbCLSrNZKE5f1R5EK68H//bA/NLEydk6rqVnD/guwU/DTdhZZG7p\nrGs+\r\n=Kug+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEev7ZTGGyDILOquxAhOj638LHQYmyfzJbiz47fHTDrjAiA2O/AGYDGdwnBIquO4FgBF79iRFKIzEfzOp8NWiohVBQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0_1607665017021_0.3689763609301391"},"_hasShrinkwrap":false},"6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"75f41eab05f6176f7efeec7a577b1af8f34e21a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zcSxPxfTtLeIderhI4QndfYFU2lAtZr1+58726qoGQ4402QIK0TElnqA54V9G0QtYJLN/HS5A1gZwV+26SdFpw==","shasum":"609b1a1da9bf356480718965fefa368d8a0b36c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0.tgz","fileCount":39,"unpackedSize":236707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0wXRCRA9TVsSAnZWagAAJHQP/1NNucE4EWKTJu6gNa4x\nnKPiOYTiM2tnkKn/x4ZHmbRxZOHZMgdj8E7gldh5qpZKV14WFuC6ROAyd5N5\nDP6mSZ6IngUtAmeHeGXjgR02NI04342uahDiTIb1Iaq+vzc7h6+Cyy+D+Y1L\n9XnPgpGBL6cZwleNnV1K6fEJ4Kn11uU+M/q5BJXIWkW22J1tOnNkf35riKzd\nOxol56Z9riE4zTnwE+aybrYbq0ytUmvuaGVcts0GGQS0QgO27HyzJr+iCCjS\n5OtqBokckBvQGbbvDKJhvmn+mZEyP/IOyhmwqjcAuEYiLEunMrfqAKVQQ8vj\nvqOMD95ISgdKF1ai7Rz3XOTf2lGNo3/WpEUJfdFFJLIUUpCj1mrZmN636IDz\nctzTb5X61kWmf/1UznQlDSRyRksdunLNJ0SFkDgxgrlhoNye/8jDoTmjYyr3\nyVfGXg1G5H1qGb/SBw5CDXcdSqzKvJ+AMyLNdPrqV6weEeZLt/UEJ/4bSydA\nwVJiQb8eycnAIJ9RymaD7SMAurJaiZ0sp4o/hj1IDXoNgq9gKf0cZkZr78gS\nMalodZqFjMXJGhfyYTh7KMSLteLmpKr2U8ZKkaLRz6Bwv20a/4ZG4Nmx7z1X\nJtxpSaMzjISTR1slHzv6s7f2CF6W5pwmUNVIn80ium4P66sQpM2iUGfgN3h6\nhwNg\r\n=2FQq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm+U5CfKPUQopp1fr0aOBmqtxKjU4794S92WIqrNt4eAIgfpfjaF+eNDootKQBplKNkDmCwzaShUB97DiNOxVwEbM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0_1607665104606_0.46897064076596373"},"_hasShrinkwrap":false},"6.4.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.15","gitHead":"835df33b8c4331df2508d0814eafb98871a20ece","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.15","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-a/5jpdBZAolqcGENuvc0PuGjaXMoM6IB16GQyPY20ZVHm42khevrGQeQVe7XepByT2MStixgjeSPkkS6d9KTtw==","shasum":"3ce9fc6d3e390ed8957e565f8975b8cba67def07","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.15.tgz","fileCount":39,"unpackedSize":236958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0wYcCRA9TVsSAnZWagAA1f0P+wRt3ApmMC3X74Jiincd\nO7zU00boqxsCO4YyPq+le/dgpfPXrEJMAh3ZolKtr62ZJ7jbyMwPPOFwS4QO\nbOVHbD7IDEd4ojqPSt/r0pxzy1GtWXuTT8Rvpa2joi4Gfz/8K6rKQHFi/Pop\n6P0CoXjfGhdPMTbE/1gChQUBuz4CSNwMrYDdQzAW2wa6uM28SUrWVtbUotG7\nN+JNheVkdz4kDKRQdsEbLY/x9L1I0a9GWmtOPq9FOXLgY44xOgRgVLFzfs8i\nr4aULJKZtsMfge8ubcUdFheqyL9vjCh23WZ6c21V5o3OC3+4Zy0JH0NfpzDY\nf04Wum9cJzZty7+Z60t/LfTLizB47MUgoryDJCaonLuwEdJu8AuLNYHq2r4r\nCkMGEHdkK7sS1HKMeH8kVzArclTVExBYxvbkVod/Vi3kK7ksCwrYyTT+g0Kf\nW4DCnQYizuQ0ZyY7Lj1JvEJsZobg282lTSRe5HBhMPbfwxb+2u9KJI38jvGJ\nXQ9WYS9HLnDKRREH5MS9fpuy7iSL5XVHKF0tuwGUxoq7IvcEJSoWXRO6A5D8\nH6WVtx7zrMkf7Wr2LRJtxszdFKK5VS2DFMH7WOct1+J+CoGggdPOnFdkpMNh\nkJIen3CF9IF6KZCJuVuYFsPd1CqFCUUAhDB8B3KdgazN9h8AKPWnbdymUvzx\nun7K\r\n=i3hV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyIV/QERV4CoNhOAwnSWk53AcSNWoqQKbHSRNlwoR0CgIgI8thGI4xECrzj9kR3hZrxmI9q9DvgyywAr/LyBNTKvI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.15_1607665179355_0.42223014600289277"},"_hasShrinkwrap":false},"6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"835df33b8c4331df2508d0814eafb98871a20ece","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6sh3aNtNWgbEHsCADE5D0E4+5CuyeJN1icnc0cvwHYUrqscx/Ng0nHxXqe9y7R3EoLwDJ0XkIN+41OGKyLt4cQ==","shasum":"c842e8a710f076f93dbb4fdc39bde260072bdc40","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0.tgz","fileCount":39,"unpackedSize":237001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0wYzCRA9TVsSAnZWagAAndYP/1SycI6e3qf36l+amzCZ\njJdOZm+axckhn1rlsIRGuS+ePsfuDBbqnSSDChMt/HPND/WG8Z5HrCx781cL\nj7pparuLZqAe+UKOHSxFy62qgQG5tehQyt3U8yCeMRx4f7Onj58l7qAq4SS7\nqk3oxPPL5oYMR3vmraSuMCZO45f51ogee7oqgLoWaDbMgUVYsPbz67wysWyp\nhiduBpBfMVc50wi005u0t49nOdFe4diO3wSAd7DHNJlaWg++3klyeyC1Rkz4\nWEzXmmYPhf7OdzQNFG5ZQdIEHK6wKAz6l9jtK341BzekNaDuPBWxh/QnJ+sM\nfKUQpAVR0+6SfIcwnc9rJv5oZaWFSTD5W9UR+2ghASnugwixB6oOBDtobC4f\nlkro2fcq8UYnjnawRjAbmtI4VSnr6pARWzy7xJl6q1BFi+Ankz+T1Da45eKx\n4M5aDHCxH1yxgaFs73WJjCp+r5jeBKAe2srOjdBcils4V6V8SaLawJxj8Ls4\nfkBaXwwJ6sJ7HYQEt3xfAkkXaWj9Bb2Y51uSs3VtUyZcIohz0Z45OMS92nfE\nPLcTlJSRnMYYAmHIpmFSX+36KOfutN8UK9ShFadCXqZe9yYLvL37eYmy5erB\nYJGbTXkYNIHjCuz8cZRNgxGXjdwNEz7WKcMzoidlT6psfpYopH4HssDJvdHW\n6LZz\r\n=8hcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbJPADbv9x61X0IVyvubPiTTDOdjSOilOkbCrM3EDeigIgZD5zRyCqioR1giBkqn+LCwQtsxOeoebQdHFJHwnllWE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0_1607665202337_0.3387559235292339"},"_hasShrinkwrap":false},"6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0","gitHead":"455ee2c6f766beb4d1fb382b64027fa0bd55e71f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vzBXgj/gt6Hb3Y+8m2BWtF1vbykYFmnqLIFfzgU+udD37qv5KG+0WkyOP3bGnqn7BJV8Ke4JxWcmdcl5ASY6hA==","shasum":"d5ecf58c381a26dac3ddc80d0dd773139cb9cb95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0.tgz","fileCount":39,"unpackedSize":237001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0+X0CRA9TVsSAnZWagAAnvAQAIWP93jL4Rm+LUtKB+W4\nUmjcTLjYDA2ddXi4ncx/32ubYzlFalpjd/R3hb2ijUWsp4aFb2QWoJLvdYbV\n2W0rl9rQVaF9WfXUj7GZsqnuvR5e70cfD5Dh1WeKJpFv7g22mErbQh1MRt2o\nyFuccptNHxj6yuryLeh+ce76m0JKHlErKQW8buw2xJZxsHwLOgKR++f45rFY\nFaTGbVLeJMH1KWEc77DgEzepHz/sJ/FSCh8ghswE6WcxV6XVPXTn2GgCp7nI\nTipwKZtlaGtAH4ASIAqlg4gr3uugUuM2DeNHifE+jGpof7heHa1KZ1vrg323\nqI4apW33jugkdSrTU9Na3RMUF1LYRMndb2lAMffMf3fx9F30Wx1Z4Ej+3FcJ\na1ILVN7457P1M1IlLBTk0Semh3+42jFhJFSU8QkwaLNFbumN40+gYTWCsQoi\nE/EvbaJBNeelsWvEqSo1ywvhiBzOFNZN3qMXPLTDJShqz8NDEmVQauC9Lprw\ncnS3okzOXFpU4TwUFuPljfR+vzTbp03K0EnbpJRo5Vssg7ulwlcc/z0eejHF\nBSr3ugARAsiyxhvh0Jpk2Vbh71dixtSmp6w4fql28hWUDL7h5b/YWKgHP2MA\nBD0pBhHGRd5WJs/d+GFJa8oe84e6XbajirWohL3MjAQ8TJkk+Z7hgSHnxi+M\nPODr\r\n=dfBb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSOQTOoSdznMVm5okNVD8slxrUTu5Pe4owTC0ox8sHvAIhAL6/MHHu7PY9/pTdmlyZRyVyjaIMG6Ct5gR7dMxb/Ude"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0_1607722484267_0.030783512158062187"},"_hasShrinkwrap":false},"6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3dab4b2052734c90ca5fca9b1752270e892b0967","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-gr3mOj1KhOsAEpgVMMiJiQwSHhnzFSpk0xAvm5MM3dz6tKAqop0Jmq1+YPD+x02/Z/qsGTv7sMOwdzobNH7EuA==","shasum":"5d6d22eab508814286d96349792beb3da95e3de7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0.tgz","fileCount":39,"unpackedSize":237001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0+ZJCRA9TVsSAnZWagAApBMP/RKQ9VR+PyL55wP5t+B5\nkmLdQpU2xzk0J7jTxn2iT7gkZQvjPfOrY2ZYimVnW1HEGWwvaQuaek2sQoj1\ne1NUX+C2zZG2O0CDUpVxRJON7VpoJV1PU0KtA+BPc5WDIcTs9cigvGUZM+0J\n0UGQv5tpNd34zzYBc95z7RFYjFuye8I7EuA+AY1Lwc/HXHpn5khkaRAHAoRO\n9cJjP64HoYpvvfl3nxteC6TXjvirhkKDyxqjiSaGEhC7Ixlr4CEALbyswRDL\n/+19P1c+pQhuJKazHNXpQ2ESrOfDlPtd+fD/oHZgm4C5TgDhqWyrMUZ0E29t\ntU+WfqracLJyZ4S0Z83T5sc5r+4kSxzf84K/7m+jSpb0v/rWEEYBxedCjatb\nUwHFsgy42Ldvk+K47J/AUpSEEizz6Skd3M8fGav4hEyooUBjoKktBpA2/0OM\n5aTPk1kPxAbzS8tFAAE00Vqy+uN9bEfjBMSQeabG/YnhxRzRe4J800kgazku\n3jiQ9DHAqN2B3R252S52t7WSoy1uhi0SYh3lQ+zFFMg9UZ8mxJMrTCCtA8gz\n/RkyheINdAXHOWlrADSmRuWWDxlovVmzoQTy5VupvBbvEmaHDAgK9aAmdRDv\ndUAvV3g1Jz6fn84h1JtBLdFS59OpD6X6iHk+mR6TAiDzS/jzcZ/jUIeFEpxT\nH5Tn\r\n=sOBI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDubIebIcYuadTl6t91CAOp/90Yesm/H7vylwoh+qcXMwIgAeBxorIRhv69ru0OCv0YuwouQ6uTID95tEvuC5H+PBU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0_1607722568810_0.7989435663144098"},"_hasShrinkwrap":false},"6.4.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.16","gitHead":"6671194aec7dc188d4824c86cd7dc6548589d8d9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.16","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MSvppeR78n+haJa+qOBG7IS7SiLmro+jztY/6QyogBY5J2WoZgf8WZNy93NQaBAnPBtdrS0cZp76o+G4Y1w74A==","shasum":"ae2a3dad64b4de7df5a21a5e9e835da8e50fc7a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.16.tgz","fileCount":39,"unpackedSize":237237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0+ZbCRA9TVsSAnZWagAArbUP+wbH+TV3huPiBQs2mSLQ\n/UPsDfOkSDJf3Js7JiayMITZ+fIcrt7kKdVzMAUAloXQA8E274XLZIYObFZN\nLHKa1NkJJJGdomO1Zrj7mFSFAaz4alyWi390k2z6+xWlmHZ9YLYr9NdmXGER\ntMG8T7hIkekOATf5LNmtEP6b5N4H6HOXVESIeMze/rlhd9x9iztCTia7Cd7q\njOdfoofOciU8baZj6B3c/kP27OUZKI5KthJQG4Nn3JcvL+K6HfVkVTxmgJ7x\npQyRhMFpLipKT2XUf+DkLMHWZjqDTiJRKycihj87dJTyq/9TKwG95g40rj/6\nRz3IAC20Ijjg1zHuZ/MqRC5hzRd8lK04YgJz53O7O5q+oUKzc0wlYgtPBxsi\nQ3BhzKNPS1jMi0KXXGFei+5blW2KDMPSETe6wXA2yT8FRPwzg7NG/x637i7A\nd4hDs4PVdLJWew2XDz+Ag5QHpthP9/3zyuX75fGFm8Vs5eeK4zk85C7lwcEy\nePi/oD3nOftPeWfaYuJEQowZcn9oThulKkSQPMGdf2KhACny6aeWYbdyApoQ\nsDDF5tZo0kfoVKuI8bgol6pigfS8ZxmZKHHlUaP/csfSV4z9WiRUOVcETcw2\nBoBMB8e0bBnGG8+Z9QrveLBd0+UxLN7AN3QRGhWZlJtP2tVF1zrEzPLi/Ya0\nsCp9\r\n=p7cl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjuPQrB/y6en7BHRsfcgrFgpeG0iWCdPbFH11ZJbMZcAIgeFAqUgcmhCH0scOfF/sKOETkKt6vUN04KJkvOLTUNkY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.16_1607722587344_0.497226945657931"},"_hasShrinkwrap":false},"6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.4","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6671194aec7dc188d4824c86cd7dc6548589d8d9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nLFKjZdXvEDAswdRTm1rNRKqtuYONWgTNnMqs8nBeGYWujRz8TqXzcB/OWXOHdbkdBCC1v1s1kvMmWqrMWOICg==","shasum":"88914a349be0338c6ce89bb5ee71826ff9213673","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0.tgz","fileCount":39,"unpackedSize":237280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0+Z8CRA9TVsSAnZWagAAH+MP/jFxI6YEjOgdcoP8A+z6\n7wZrCDmGuPt17zCZxycpMwb1KjH+Qfc9YamdzXWAWdz1jrinn6F6VGk/pTP/\n0uux72AlG0YLrtjDJI59l/6Q8dWxqmXkPqvHBT52OH/YB0qcg8vVPn7kkFD1\nIh3bn5migdq8K0vv2h24iMF5hpLGWItI+tVgfpSvkeh+ZJ1H5xDBrRypbbx6\nC+l6mfavLWM0J+FW92RzPv2+6GV563yRhHZXxULwMjL+817tdG9X1NvnR00V\neDVL+a7KkN/LTLYIpwLqlNv0sJ9uXccpcyuJRDtn4mudeHstq7TQT460FBYQ\niiEYzb9TTbTBy3/DJwI9H8j36R568br5wvVOdb6NSl7ATj6QCOqh8JvGHjwP\nSpm0u+DSbixshfE1aHMpXI1PR7MVVmO5sXWqS677DtTUZwf2rhWhJpJw13Zq\nin/2289ZmhCGUHysolI9mwkiBnlCGGB2zeibo3b4E6ADJbNrVRae/Vy+Mkcw\n1NZbbrJpvE/5iUBNFM+CHGpJ9PIGZxzEo9LX8KGL8xxjmXpT4xxthnJQZQjZ\nt4NmtmFY5fnp1ELtv5eomVAYfW1F4mi37o16Wlj/1vnGDF1WUr16ftfcnGcS\nyVvYMTu1EVBgdSGn2+RbIJHvIZz8fo+RlllovO3KOHpF90fSPjWu68kxx1qC\nNVDa\r\n=PQ03\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQA7NP7cU5/RkWfq2dw7Tm2i0TMpZ7KLQji0ZOseNG4QIhAPKCkCLsuFufbj9wXycsb664dH+DjLqsdm7blRfc54HN"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0_1607722619519_0.3491412946398307"},"_hasShrinkwrap":false},"6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.5","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0","gitHead":"2cd9695326eaa59d994f7e89303b0d6ba5805072","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uRQ8Qt1M0RWmqc3L4YhdT0W4bdaxRjTp5DW9tlZtBLvv2SH57txCAJf2darYD5JhswKaL1crBkpkHS9OOGF6/w==","shasum":"7dca4f0039278e9cc499687f344e78d0b81c4a91","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0.tgz","fileCount":39,"unpackedSize":237280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1ANqCRA9TVsSAnZWagAAzuMP/jfkk1XKNVf6uBdf5rqR\nRfzwaiqsxltt80rvMbggcMGcO3jqQHB36dUgQETpJ/ZhIrf1eFolyioU7PYY\npKEvBXS5OVguaysSl0KIRSeJ2Y9aeF6cyfDE7j1pDBr7PccKqnuuQ2SkqOJs\nZgUDrhUL6RPvRqAEZm47XCLxUfgA2tn/Irz0bErEUqzqHX82bV+vDOW4vB9s\nBXkjVqHp/YZdczqIxWlDQ3elQmxog4Wzit+mcwZ98yzybzDzgZjW9OQgEiXq\nomZQVgU0l2bytT1k9+Rwf7p4P/OTHKj1nExiGeD9NYD5nPw69190eCS2vRv1\n08WwkaFAGWeq9C03wJAv7OR0J6FCC1z5J3mw1Et/y2RHle8v88B3EUkrD5Nd\nBn16ZHwL5j+LlesaWLv4e3FER7w2lul/HJ/t44xHFV7ld0hCB0+ZbbRzxzi7\nsvvTtIqRDriLzvGIEkYXicHLDK8nFuDtCPrM66QJURDlidSxzgxs5aS1BtEN\nw57/uNrC00pEkBxLaVaB55BIaJljZq3hGn3d36ZW4Z0ugFJcEcRJF+IVtPpm\nXsvdprv04sQYIb0xKxSLdY2GOgqrngdSXWLeRoWhs21DKGPMF75oV5kVNC/Q\ne6ODewCU1VcJOrYHWHQ2nQzsFFEXG78c3jCYboBKWPNL/lIpn5NtpWmz662q\n4gU0\r\n=0f3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICe6D2qcJ9Div6wDExyGCq9DnTeB31eWHuKlSxLjCSEhAiEA8EXkfCmkh2BgY5gF6xK9gbXecoidtXHHHZQug0kBNSE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0_1607730026067_0.8266317064283577"},"_hasShrinkwrap":false},"6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.5","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1a5d2d3ecb359ad2e638c309aade3168d7d534a8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-GPjTyOYgdW7SlX5hJzEH2v2A8eCAnru526/KxbESPv8cJArvunieOORgQgdmskCaLgWubHLJHxNBa0rVmLN+TQ==","shasum":"b9516f233440318d29a81fbaf6f3eac1fbf90a1e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0.tgz","fileCount":39,"unpackedSize":237280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AO2CRA9TVsSAnZWagAAXZ8P/jBHlv/SDTm60c1JrWKM\ncDj3Y+AREbjjuBNvxj1e7quj8zAlZRZ7N+OZVOYWW6zpWM+Ev8NQ/vAGq1nm\nQnVSeuWCYqqVzLX2fV4tpN/+xUi+TBAPhSeFt2ZmE/LCdAxz13azCjr5zw9/\nF/2+6VQReyHZg3qEnn5LTNfAydX+HCU/aiPAwpFjECVfzhweZXRQewHtO3nW\n1Id1IzCMpUwwoDNZ5z0EF0kgTcQq9/FI13CdYaNGj+XiPnXabMwSF2GXhF5E\nDzaJEIzE/GaBFDnTzESCF7uAlIrL3rJ028vvDLgVvH8qkSjhCyjFkZFMFNVd\nMOBAIsibentN4tEaVWhCf9aLx4lOkmvMHiSTjCYGf8DFZsU1woJfaCqwggkd\nBwfs/dtyN/y3P55dWsokjfq9XPw5HUOFyVObByygweH22cftfFWM3NFQRRhO\nvTkgtkLBRCzTc1LLiEAjPPs7NKjctsVW9iqRkLKxCFWp9E66srWN6Msaoykc\ngdLXlgEyienw1+LFS5Yjl75n3uxI3uTeQTHKJGhftzS4W/qr4843mgwBRFAm\ngB/cbnSJJrZcfiScWpQI533afiUpxo5WjfLDsP0Uyqq6bCaQa9IQZ7rAdlfO\njkgEeSkH7x0I2KRBOemZFZaWNH3YSd7By2+ko//e7FVh3kn/yRT4qIiqWLe9\nB47V\r\n=JOLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICAVL09u+XLoRDdAQ9wjh5mwqdC+GnVGhvqiKYDiKW7yAiBTlsC/IgqZSpR36jZnxm8rBAgcZn87N/lpGpOPu4YuhA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0_1607730102214_0.265326252386066"},"_hasShrinkwrap":false},"6.4.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.5","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.17","gitHead":"f2854239a8651c7ef6a9ea3d00443b3b7d7b4382","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.17","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sCb6i5dp35132kug4QMTavk6u7o3L7y0GdOomn6ItVEvGPFUXy33y7rDEhDrorgsghycXL+nCDblZ785503Jow==","shasum":"1b758b923c804c468b72d2886e1c626aea4f3bc4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.17.tgz","fileCount":39,"unpackedSize":237511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1APQCRA9TVsSAnZWagAA8msP/AyFKIUd14hJuzbWr6pr\n54/Zl6pk/pCV/DzQPk62xIScLDr/GYbMmQv+sKYr7dgY2YRutvyRjzXr/16s\ngsVGnVlcvyTYww/RurlfsrWLVGRTiS8aNtiewLg+bp2uLlRaFouAH+4rAxaT\nG27Wr0pzxGDiGAKsYKZ8eWzfhNze/ky5pRXB+tUor7JWHQF2k19U2RJ1c9jk\n1ro7+himMm39B5F3RgtysVTegS9nSiLmqZDZh1G/s3dk8OqIlsOAl6pv/eM3\nEO9LObuKyfNpiJ/vP26qP7AblwpYuPUCrv4ipHwmGGPoI2ZNtw5Mbx/DbsZ5\nLKGEjoQk22zSTHG6AyER37uORDuBYv+mcmoD4yUeYbRBB2qbMRsvOtnT98qh\nEEWfczQXPBzId7TcZEdaW/2io3gjyTQJKrLNNm5RjSODRFPqsq30nh2E0+ML\nIxz2XjXC5VyQfx1RDO7XLvQzkN5c629F8NW5ueOe41BSP5fw/rZe5T/yaxeS\nUif102eLGRNquvm8kx7+rIXvJ34isTcrJ5ea/FCICI41RFHAj9qBVo8OAZnT\nAwzVNIph8N8MI9rdlHXyd8ZT+/M30lp5D9MFw7rm8feIlioeUSNmpzGjmlLa\nElNT87P0ukcLQtbY8rb6NsakLjOYTmAOeoUgR2o6iZK8ADvGk/VrZ8GoTzQJ\n8tEW\r\n=UDLw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyj8icHnBpZXjLac5r0XDyESRPWGZ3JerT7caA0w13YAiEAwWNrvzgPi8NvVF6KoLwRhYtfkGz6LQx61tLL4rr+i8w="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.17_1607730128093_0.6498453767172414"},"_hasShrinkwrap":false},"6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.5","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f2854239a8651c7ef6a9ea3d00443b3b7d7b4382","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-RvA1zzTC4tUxslZfRHc2uqxWykFWYBqux6DjV5FaMG2SMLau70YKd5Rq7DNePCK2u0fH1Ja5PdrnekYX2FBlFQ==","shasum":"8e6cecd755b1c23616d84195c6de450bb61a45dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0.tgz","fileCount":39,"unpackedSize":237554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AQVCRA9TVsSAnZWagAAsT0QAJY5RTGf8NffT+DFFWsH\nWz8obN5ReUajY3dfx0Dl3zsZzo0cpRJjfz2PE/DMjl5oBf2YeCxxqex0TfZL\nrMsILJAEVNio4AtUJxYifI6Rit88xrZtNJvDIlHZXj+XPAPkhRtjfgYZuLcf\ngJ7+vP6IV8G8PmYL9v9bkGiE3IF9n0EliBG/B7T/oV2R2UfbQYGKl50qvFJL\nFOE56Q3YCEcJwGf8McBjSUFxDJrycsp09b2dbl+ME1eime4mZ0HW3pfXmYpX\n3WKgzOaIem/xzLensyVCdGgvZ+8IYdXXlI49n2b9xY0rdrBZ1ybXyzrmXazz\nFLNYONkW8k3TqJIZpjn+MucRG2Z53q/egrQU67evgxeNzgCEePsbc8PARx0U\ngn+Xl6/+FybceggjAix1adPWHFb68a1xvUK01NzpgyLZI7m3cqaDgPAs6tYi\nB6HDTYrXzg6CYxO5XYDTmpxfq9pVHRSx13SZrOy9yPh7MS1XMHOE+OpHc21z\nEAAoQXT6r6xIhPt9ERhnxaPz3ZjS9V5gEj0qTKyvnR+d/VrAYxOdwLQOqffC\nn8vF7DZYGDtR69O9sbyT5L6ul888CEPN93CK8mgyhFJQI+0jmpFgIg5gXCLH\nKUacmARqkrob86g21ZYuXc+gdXSh4Yej+Dafz+u5SWn/iM+N77F3FXVI1exg\ntlhA\r\n=Fe3i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5TifmrjwS/K2DcHVHH1n6l4J5uuBTcy0ABLLyl0soTAiEAnvq6j3RK9lJFEkiW1Zf1az/4leoIWU/mWCk+4Mhlgzk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0_1607730197391_0.5887231195898102"},"_hasShrinkwrap":false},"6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0","gitHead":"8dd0f8484522d5f28b4fae21beedb9409be413ab","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-nJ7NBRiOD8bOfxCIGxdTMS2U45s2QRaQ5IveSm0H3XpYpnCGMB2lQ6pOHI2Vxd8dYaYkR5recyfjGRj7NzN+mw==","shasum":"c96541057454099e0856703955ea20991f142b18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0.tgz","fileCount":39,"unpackedSize":237554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AXXCRA9TVsSAnZWagAAbiUP/2DuPLZSzLEaJACzHtcB\nbRQXIrX2VjjBAIN+oEOD5aafxZPqOq6OxWsHGF29eoZAZVYmOL4rxf3hKAi8\nnhz8XNmq9tPqgMHlCWS5K7fDW0bnXSrOEvzqZVCDR+NCqyaywbgV/Pu1fCwY\nnZxMntyy1P3zksvoEAn8hvO7l4r+UbIz4IKJu6IZ1mNlIL9Vzb3iakpzWlVz\nlEK/o0oon1I4NKL0hanX9XoeylaS/O78lxmNOo7EAJLzlvqqG83/SnC9mIfg\nKxvkDPxD9oNgTaP5uXozxTQdqumWhZKjyO3w7OxCovfFQ34O6v/vt2Cf06oP\ndLRTQCqudlqF/woJE06PWwqNJ7QKJv6gtKG/JmPjeTA7gPTTmCsNy9s2u/2+\nxfQbswOHi9GaKcScx5TNR7U8yCXfIH/MnE8JDUfx03473FByH94b7IIYxYPf\nNYrm7+9nj7h/MSBpWMFpRNGoSTyjnpFC8Siz1yOupY08hbc8/mFFw/KG2ZNF\nHf0qrHrxp2eVsUNOmuJi+VPRhXqs6K/tLLefYqnsgnrJ5ERfc02GHRKbo5hg\nNlSWOy99EvUQDZlbHp5erHl7gKPEw5lNfHH7HpBB767JZvRWpdEQtY3QF6xt\nIXCOw+o1OWhJ5UhxomSgNhOpbz06GfmZLfKgqH+zU9XZOhAIzGThn8QJMO4F\nBRFf\r\n=PlxA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChkOFF2APY5Fkb+icVuZA+SHufbFU6W4jVDVb/yd5OngIhAJj5+kOf+6eKKNCXta/npEx2Nl7+euGcFQO+sP0IZI/q"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0_1607730646909_0.24562577855157053"},"_hasShrinkwrap":false},"6.4.18-c00535ee38856187086e664985d88f45b776cb77.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.18-c00535ee38856187086e664985d88f45b776cb77.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c00535ee38856187086e664985d88f45b776cb77","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.18-c00535ee38856187086e664985d88f45b776cb77.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8sqMtlfesNH08hUoQibIsBuwSr4EAm4xcgelqVjZSD3/n30yGxxWcftAl6mGSy5Pqaf92s2BMNvJtEzFUwQKpQ==","shasum":"834a08e90037dce228f8c515b081df7fea7b4c3c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.18-c00535ee38856187086e664985d88f45b776cb77.0.tgz","fileCount":39,"unpackedSize":237554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AYpCRA9TVsSAnZWagAA43EQAJy+vbM+qFapXv45C4d7\n10ZbgsNSebH8MLF6u9HiuJ/4+hctzFSFwTV7xI16kqPbfepdVjboWnR1KeI4\nUXXuZ+N7tpekRj6uC25itQds9Fj6Kl5FBhNktdRdE+tVGCM9UJgYrRkfuaBJ\nPw/EtueUBTumPGcD/7wsARhRXc7IAjR8PMm5hTNY67UpOrpFiGB+MzYXVKL1\n1cypX/EOkup37jVa2PwHhIbJUkFvMK1IurDQfw10BrMnjmS2tu4jRaYt2mEJ\nxCrsLrE9czi3k0wf4C2Y0bxSOvbTTDO7a/Ah3NZyqk3cIeQ+WuZiDYuOB0fx\nFkI4OQ6nM6lFYHUymF4uNiyPg8iI+kncr/RbUqcMFPwrNdHNyT4RpPS5C2un\nPEAmj7NvU1iMCTxg52hSjpL9U0C5Y6HW56QZqKCmiyQwGoIL1USdim9lRYck\nzCaQLHk7C7VRaDZXNN1zXQKmsqrQVZqPgwDMLnvuYo8BZrGWAaG9PPdbUBQt\nXvoXXRzlFo9tUQUGuJ1M3RF6kyGDuTrSbIl1AgHR58EuZtYzmhE8QbQ3ARqr\nEJh3RASTXbwxEQ68gXZsxx29pZ2owNbKI9F8SQoFCNjeK+gr7aQkMknNIUvU\ng0IAgZRW375+f3gmoHjLKrAeHKZ/uAJThObrS/UknsPWiiXay4WPi115yKSG\nUWeW\r\n=IelR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBLk1IB+8MRQJaJQTUlEWCWrFN39oIcFBq8oqzKTjjfAiEA3SwoYubEHX76yuhl7bkjpUvN5/04tup1E772UPrECtI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.18-c00535ee38856187086e664985d88f45b776cb77.0_1607730728458_0.6806239047115332"},"_hasShrinkwrap":false},"6.4.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.18","gitHead":"6329a6589dcd18c710f89645f79ef45d1a6ffbec","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.18","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Ophqhcifst6X8EZiM0be0375fNs+fiwkx7gi6/hOwq1e6iR3vCehmUMhGI83xjdHCbiE0u5QG3Qff7e8wP5lBg==","shasum":"69e73cecf8997fd08381cb833bccbf42647c308a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.18.tgz","fileCount":39,"unpackedSize":237785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AZECRA9TVsSAnZWagAAMq8P/3Xu2Jbc/LShMD6oWZcg\nN5dsdC1Gr95WuWhuktglu5m0YwmrVZsg5Hk9e4lsNsfxnYlGbAokwbVpXnwL\nR1Uxdc3KNa2n049UDxrD1Sh72F8QT5YhHRwSW7XcIUIUwgctbjy4kqZULkj+\nYxvDO6LNZPpKZY8GePpN8TYPD9kuGykiKw9VLZrcufnyQsKH4nJMvhbH+Liy\nRjFaMQjLOduOvBV7l2J8ZFs9N/sygAFx6ZnFxS6sFBRSn1o+rQ5H/XPqyPJU\nXJt/Odq9Qr7OxEX3cC98tPF6t1un9GuU7AwMlDLgLfebp4NxCzhMVD7vG+fC\nMFE840RDBfa3Zk+BX6u6sUL8amt72K3QY5e2b64LI+dZnVnBpRrwReBQ+dKs\ndnnXHep5RuSUi5JJTa+C5JtAu4EPw33m7XJZUFHGHxe9+o9MF4894lJvGT0Q\nnKL9Xe3H0DD1jpqTm/hOBwIEDBNBWS+uX9R3C7rGIJQmgkdO7irHKT6+6HIj\npY0KP8SpJM5CLr2aop1H7ZCt5h2Gm4CYBiEdTkEIHPKFdmianaZb7cGDw5UO\nSX3LBZXOrdNOdq/lxpk6yq119g9+fCU3Zej6H/iD0+WKCB3BmgHUNGXsC5cn\n4W7g2MY0TeK08ZJ6SmjYBiFFB8TufmF6WYMYx2Eg8KysnBagB0RmspP2fsXw\nhNAP\r\n=gqyT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/vPO+rK6tQ5A0kDTloWUI21IYN4fbY8lZFOrlHr7o5AiAJD7NYGcXkzUbeJrHjoR6KG8Nx1H6JWfSKGsYdiLHWkQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.18_1607730756253_0.42356060698990516"},"_hasShrinkwrap":false},"6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.8.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6329a6589dcd18c710f89645f79ef45d1a6ffbec","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7p69KARp2LuQif3F/u4EXzaacgVnuCx8rnTQaYvZNuJuT9vnGqGf3YfACgocPNIosIBEFBj+2KM/qBiyQ9ZggA==","shasum":"f9560a533db104c411c67fb234f1c1012e54fa49","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0.tgz","fileCount":39,"unpackedSize":237828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1AZaCRA9TVsSAnZWagAAbtkP/RvzIdjXNwg4Sxyz19v7\nu7jwws4TPN2d/+r21GyI27J+VYixy7twBuaKsP/q3CzpYC7vfNLLdFlP2HLv\nutWJ4FdxZ0FSnPaU5a2tPgAf/eHBBQQiQZ48M43+UsunMN9T4acQIztH/G0s\n32F/JvhrecGxtmL5ekJyybWNITZYMOKweNDcgYxNGU9tGwFgIZAoM0ABNtEb\nbtvwpSMhz6Sr2RxJAtlxCEG3esrwkWdMqC2oUk5iV0P/6RSBUx7KwtEh+QdM\nJlhFL+Edn/NEvEf2aW2tZJc+ttJa/kbTUe7ZaTtAZUWKx4sS1hRn/UoJ2Bvn\noGL7GqysJvhWSKoS5HWtQJiPbwV/hE9cuH0dwvISZnTb/wPYsO8amPcBY+Ou\nOOjLxZVSysvlK3el0WfqyPX+ne2bx0x2pMLlMDjvOg4iFLipPZrc+fCuHC3w\n/RP89fX/nTuwelJHg6ikOwM6q2WUpdD9UOySgiYqHaE1eQ9g/WlZjy7AfIgx\nMY5uygi3Bbd8J1NBjJAYQXlgD3jkVFM5t/UCjZPFNthJMLyMF8GCea7SO1dU\nRwumu3gOe1ygtCxVJBjuhE7iOdGqytK8M4ZjEKL0mxz/r9FpLuzAHSA++yFd\nHQCErplw84kugJsi3bYvrtLecVOSb2X8JhHcyrxS7D72aD97e3m/zLdCQn5X\n2er0\r\n=eaUQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNKQyUCBGyyo62JXtYe38aN4fnfkwF4qRIDNznaneBMAiAakytU+L4Y40gJQ/bhJewkawBo3/SprMtL/ZnEYlanrQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0_1607730777660_0.21440754733227685"},"_hasShrinkwrap":false},"6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0","gitHead":"36ed4a4a8266ecf4818e9e0b83604116e40dcb2f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZuKUgkrXbMyR17Wx2Zp6T3nxOs1uHZDS/bNgYSrWpusnOyS19NOV/BebuEXoBEHPIbjC0BEKI6wR8JI6GH7OHQ==","shasum":"ebc7a1ef0402e48eb0a5df7afaa6081e4ab066e1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0.tgz","fileCount":39,"unpackedSize":237828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1LYECRA9TVsSAnZWagAAfBUP/Rh8bsbRCldeJ7Ppsa41\nxB12IVOdk2bxshV8HUo9Pil4PaHsb5HAC1N7vgHz7sAa0uFMpmXfFtdJlSFU\nH2li3bqpXfk0YYwLjrVEfUz8hiLH7RLPRHEQXT0Vps6TsosXPY+nltSoiitN\nwcriCpzvSSYvHVKPlsJFUk8chZxIQLSb6Uxd09QMJxfTl7TyJe1QiHGc/NFz\n3AMkEDwQ4d175hG9swGQo1lGzZ3pDNb8yaxBgLsHHI3mq1n295NNovtruIYR\nbE/CGzdApJ/hBpvLtTLMvFRvx0taX9PoasomqCE7kwW4QQdBl9PXSJ0j4tH9\nEnETgBcV1MYxQ7DAl05Dd6ZSFP+SUWDhhIvXPHA6GEryszXEpNwqtGSvik5g\nFPzpd6YOLefw2CVqs/scWzf2+WBoXdhnbXeJiwcIicQEHrlH53rfBRoFIDeU\nVPz45tecvdw73+YmECTnJgD/PR7pmumbQUoQy6bjZsmc2pgy34JUZUiCc/0t\nJNt2mpxREw5A2ca+W2clroLHH9ABNmMq24cVNmDEJ3VEcPmirsnpKD84dZJ5\nVP8ePvcI7C+e6o3ru6vDQdNlrgELZeY0r5T17rnJ36hnx0UcFSF+rWV7j0ri\ntFDhCLs6Wk+B3YYWBzxNI/kJFq+PjMgb1poYpTOcz94b3BeHQuaMtzyyf5Ay\nrp+f\r\n=frnG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6hgMrhXynxy48s/qLvfxe0lYH/0mZpg+Ejokhzq9u4AiEAmKzttuHLWA+EoznRNxb/w1NG7SzWcGkBQKtUgwfM5zU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0_1607775747952_0.09831436547945849"},"_hasShrinkwrap":false},"6.4.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.19","gitHead":"ba627162b077a04000602931f4f6c1d54f0b57a9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.19","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PWAX/zDvvJGaeDwTHtljrGz5x2NjwJFBjKpcaKXEclVD7/tqVyWHeUCyU7Uvj+Zil/PrR5piKNOqOTXx5H4VRQ==","shasum":"b3ec856312880c6142b85c231eea3ea76b5f94fb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.19.tgz","fileCount":39,"unpackedSize":238064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1LZ5CRA9TVsSAnZWagAAr2gP/2PsPV+vfVo9/aNc7Vyh\nIETssviqiIN+SLgHrcbQUQo4MgNtn0+TzI//mCcM7fN6LFfD8/6NoklDhes4\nGCe8RRRkgWdS8Kgd+Vgn8WCNbIkaZPa4GUIiJUlx23gWmR4sCVFLksJNo79S\n+DEDxQjgu+YMGRcljWFEs7JlnH18TAci506Ju+4fwNJOKXkH+DAEUFGwN8jc\niN2GrNYD/mUE1Z9ojGUcqo74qZqCwL+RcYwtf/9nt8EsQF2GZEqWkzNYLsy8\nrwy9UVF7ju7Ar4iiKcxCVGi378spwgmzLBcH0GwuvVZAfEr3Vtl46tVDWnm9\nGVn/tsS9Y6R+PzGtOv0DVfL7WkU3PweWnG4+l9nE4lFhUvSJrhOpUwqwQ/yr\nqRLvTkk4UPOgoekUw/V9hSLDoL+FMWaZxWzM04Flcb0t8PFkEHg3wSPJXLZt\nYHS4P9ztgj1r75Ki/pQWoVf6TY+YzdLWWtJCq4Lx1+5HieqYZ83iUpl0Fym+\nTIAihvGXKMCk871jmeSDdXMkAINtwTXqi5HrdIFMHFDlENyZOmHolJ7EdjW+\nDfgQjk7pjTIhw0Uq+p0eX9H/koXdKbLqr/fUosav2Gxw8uJG4Ui3zsiKmSiq\n/Ezk20vL5Og/4k9Wuf3WsTcfciy80IyxeDEiAQ9mRBODQTrePtQKX+Qh47Tz\nenbS\r\n=1WQk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHjVniDO2HZTS7mnyOhH74wDpUG9AXCvsVZeLgRWx3kQIgFslcodED/MB7cLs3aaIg5u3222XT7nKzgTVfAKSO7lI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.19_1607775864706_0.5696445345318051"},"_hasShrinkwrap":false},"6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.12","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ba627162b077a04000602931f4f6c1d54f0b57a9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NkQ3PBtMmW1LqrH3g1i51/M6CHSW9KPfhyydUyFyx2JVpO80rqsbJFR6Qyq/kerEcVM1D6xGVD58+NKbczRfUg==","shasum":"172a43396c6ba017d9e26ddf649864b44dead087","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0.tgz","fileCount":39,"unpackedSize":238107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1LaVCRA9TVsSAnZWagAArU0P/iuqjiCoq67yIr67261i\nK0IKavXLcHLXd7bID+ExsJmbMoOTFQi3iffoSs4Kzjaws8hkGvmduWLKoYdW\nxsQjLZDPVjjX83eZLCNt7MGu5OONQfitGpPaa7+ZBJ1AlVYvZfeiNrOd6Ek5\nNHUjIimVHV8NJu5wGywApqKu8nPNevI9EAs6Gnb8vfcoYUn3eW2EXwVlwjH2\ns+/hEj09PZojUtF2d8H2JXVOILRokuye4EdYkFgCwBEqZU8j/Ni/nPRDOF6P\nlK/oRuqoxJuOCKIu+nncfgDNyrRqSDgdxj8LTCoxMRuxKb5frVdYDDaC1hof\nnPE8iZAaPseqsJmp2kgMURbFF5Rx3P5/yz0UHQ2I+Lqv1p3iR1HVA4Y7+j8k\nAVzA4uF0VFBYJfQLZrOCaI00oT9IRzuRu2CFmmhe63Ekq3UNf3Ruo/SrAllv\nKqcypEJU7CE6/qJ+3dd9Ya8YLTpAUhzB8wSz0hXLA7vTiJq4pECrqn+X4oPN\nF5q3bggzi84hfwl6J/Z7ci9YiCTFFQH2tqdu+Rh7W61U+pExZiZyQ3s0ZS1N\ncoUb7lfo8IoXvZjPEM74y3whTCfD4ycWATneP0EA995UljSUg7k93JSQ7rjb\n6ytXkhaCjLq4V1lABdUFTEzfysiP+brZAPPgUmrXIEu8IxdI7rRWisBBTBcB\nNhKh\r\n=umLP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuaEBecryAeclzRK12GPuNoT1Ec6x0w3Kq6BFw+mUdXQIgP5KON60d3llS5ayyfucVlBp6UqAunhWJKFmAdh049go="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0_1607775892656_0.790073190354895"},"_hasShrinkwrap":false},"6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0","gitHead":"3d67a06a50065b68d98160ec83b1a7f05e65357d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jDy+VclKV6Tk+ZeJZxZQSBUAcLHANCJPShVXADGIK7IeRg7t6SEMl5IDDKSNaEVPMPFCE/gRvOegtqSKxJCIPA==","shasum":"6ae3d7d036e884a712a5bf748a1b624aa5441e95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0.tgz","fileCount":39,"unpackedSize":238107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1QMsCRA9TVsSAnZWagAAhyoQAJwzpCw40AEIhjCbdOfS\n6PG7leOR3dbDkESGknE43Vmt4cEFqV+ahJLY193bQWq6Dj09WIXdJ/1DslQa\nnUx99ks+OJ+UkiwAemyoI5qRBtgX/IBV+Y5d3cm6EYSl4y+4Z8SwKgYjbuET\nZL0+WidTh7sbuSB62wyjF75Oaam/ZBioB+5dVSO0uJbsTep2a4SwaW9gUSoP\nvy23jxkciA6FaRQ1s9xNtUxfyHzK/Lv/PxRjvFMaWvZExwrd5xu+ejZAfkkS\nxtotSyDsBLsGn6s12dwV6lYRHv/Bf7+AWK+TPRo82kEuQ3O9y/8X0tIlVdrH\nggCIJyTQSq41B8XEpp/l0AgVsVGqKNU3C11SYdrhoEBN8/dQpVQjXJ/H366T\n2VxQ+zf8jj++tXG3UNs+WKDhppeKv3twGAgMp1/wT97BkXAf0iWS5yfanqVM\ng3NAJlaM2P3CUdnl0bDgFiTuc+1Oz9IE8NA66DL200+d9qjatP73WDL2ltza\n+FOqbey6k+Y6EenkynXWWkY/v6Cv8qh8LOddt1WTUPj9DCb0HzvkLg3blwuu\nLt9/Mdadf7qP7kxXxxaDjoAMc+nHYUpDaX8uuDGw6bxpUN3kOpCRyJhYvpTv\ns2vpzai17d3Sw0zrX7Wl/ZpERZOgPxyYMgMx3mJwrB3Xxnuw2c9wLvjF7H0K\nfmw3\r\n=eNIQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChVxEVNh5olT0H8T74fhxMEDJ5bYGFW5i9L4Ooewr8vAiBEl2zqQpSzlFHFjobvbmCmK3k0Em94WDD0B3AXqot7Zw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0_1607795500174_0.8036388030925892"},"_hasShrinkwrap":false},"6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"11553d7c94bca3bebfdeb4f0c2c443b14797b238","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7QS4hie03fL9jZ0AWul1ERsam49mjuOydnlY3XbPPgnGe7aJw610vGU+lnd4x8CdWNCwaqDD+iCylK92MaCIag==","shasum":"d5ee6ee2b5f1cd5edaa75a3b574831200533e372","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0.tgz","fileCount":39,"unpackedSize":238107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1QN7CRA9TVsSAnZWagAApTIP/1LP7AjaD4w7obJYzwUn\nWLURzdqeVGeccw7P0wp5MHPCsnk15GdCKN1H9mZSsaUskEPc3H0/52TWwyWU\neCVzPYRRIpy7Q3vJ0zf89k9EnZUjw2feKaxaoV7fDs2jHDIfKpW91Ggsvc9c\nrzLlAoul+SNktT7eC2SEVmTWbfCtlu2L/EyuCAfyE6FfZreHzHZDHMEg7qzL\nr7qXBHYXAUD8KgNBzzL8PcOX077oENU5NTHbzXzFyxEdHFy66lrBg6h7dkiP\nrhQ5IsWh2W7cKyP14l3p0d5IxTXaM69KAiSWdW5dQw5oDWGLbl2A6hpinxLS\nYrdL9Zlwa0LHur0Tq642sFNFoob43DbsIFj1oqS/B2W1L9B4S63N8tw70PIZ\n9aQ0rK3piRpUX/xU8HZKJJ7pBloW7o/xZ0Gid6ow+/FKh7i5O+1kuKP3XDHh\n7mAGTkqdtBuUr4mTKGc7vucBX49tSlGDnAeDxhdV8Jq0eHVMHIKyQguIHYdu\nDMHiHUnnVSK4zb4ra5WLU/AHHzXmY/t60aOU/KCRx6GekUC48xm9p4TQHh0B\np9rPbB9i4lDTXe65qKh+jYbIjVjfsSc0sjZEKLQmINZ4RTHYAL1IEksx2hXB\n1GrcsJpL6Fr4OhX8m7dm6dTRPTuj0ND//V0fKPE3u28bM3L2qCOxqLIx/Qj9\nfioZ\r\n=9PmC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBT/E9YHcxDdL8xkauCn7nkKOe4D584m7QYtqLbRDKJZAiA42KwvirQSFGntc/zTPnskZTcVsGZL5PiJ5tE8ytRt/Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0_1607795579071_0.9481895125598989"},"_hasShrinkwrap":false},"6.4.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.20","gitHead":"81245fcd06c984c01648ed8b0bed699368f33528","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.20","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-02URWE9iz/hhgkj2uRJjS4sFqQCmasFtlIiJEPLj+xB4CKNfsS4mo8x8N7mIdWbTm0efZMrkuYyMC1NT9FB3YA==","shasum":"a999ee0fae2716c418b10a94d8bc5a7ca83229df","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.20.tgz","fileCount":39,"unpackedSize":238350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1QORCRA9TVsSAnZWagAAhmIP/RU2A8td31RJOzhDjtsS\nvge73miqVwZmDI8KdFCIewgSUfC8SWMIdxGaNfSES4RtnA8Yef5CpNXRTrDV\nawMMW4c4Xvo93tXHArIOwFB1UFx4URKEWsD9zR2lLNngvehYUAEQT9zwSi+F\nrGP9aqPiYMDHVdmhH2modJ/We1tNMdq8foYbRHRrOSMVRWP5NEHnkcZoQqSM\nNlQh/r1vjeOKGiIpvEWbwnbosOiUEX0GegXCUtfnt5YDoMKyim6zxLKbPn0M\ny0ckeYWycLDjhRKd4pGTNXorn0pfN0wrlyfXbBIa1RtQq1+tA54RFZUeOTwU\nJynTC6U4rqz1fHVsMe+V9fRrpjgc2ZkLwhJPQOWV1pDK1LovpmQw+eeV+CAL\nHNrv6dtzDxuHBQpXjJYqtvjku6D7TrGq0kYQMadubNnpQt297l7G1UnjT3rp\nWIQ0f3oy20AR46MGwRNi92toIRiLN4j4dKCPZQb+Te/pz0Vfy6nA5nlox1pC\nDALN9alGqFtsr+zuHxHOh4zzXPDvWb07FQmIauKH7du+539kpoH7wlb588JQ\n/mZmT6t7DD1AR0nLhNA6TdhbWN1L14a3gaTlgpkRqrzXTPLn07mpQ9QCRxQE\nZ3Sp3uhOkbMEUrbcdDXQ3fEk2fJp1O0TxGHQK8UdBvsWyUB2XjjKV8hbclKC\nsoE4\r\n=WUb3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjXXXpCzfAEOnTexv4Vtx8hNcpdtUKkfDuwjKZ4CpeBAiEA4uNL2HzYtrObZh2S4WZOUrMy7QmgCKuURe3GiKtlmh8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.20_1607795600531_0.2360220250720293"},"_hasShrinkwrap":false},"6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.32","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"81245fcd06c984c01648ed8b0bed699368f33528","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ON0/13M5Qn00t/AwPpVhP73R60rj6NNrz/9kDh19HjU6bs/iL6aVB/Yc5N4KMv1zT0XpEpJ6UTmCGJzRn9Gi1w==","shasum":"533b59993f4b42bdb7882d9462ab363c1efcc462","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0.tgz","fileCount":39,"unpackedSize":238393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1QOuCRA9TVsSAnZWagAAZiAP/25EbUi9mYOZKRxdHv85\n0pX8DLobTwqleoHOxDZ/V+NfL0qPYBrxCXmaOme/LV/pbycO/P9s3ycIhWch\nQB1jpiIoY00522y5tjY/WtRpZ7W/7Yia+XE//zRterzFrWgxgsqhSnlSiqi6\nUgYo5w9Xi8LUa4U2whm39ZZbvWX6PeVYc7dc9cnOU7UNtWKz27YwHuKGk62M\ng3+3CerjcMfAFzkvn3oAmhwckCQete7RAH9TbjBR8+KbkTb9gyyBo9zbtfQi\nEA7WbO4Uzuv6qSfPKivg8p2VyvEN/cfCHSpmv8i639c80k40wc+3WaFzjh98\nUhT/H3BNKHuYdD6kUJ8fAffqu4+O2bBZjmiptMmNls++A+EWd8m8w7HaSQRk\nT8b5JxqUszY1L59EFI/aEYsBeq/hUY/9X4xCKsB6Md3pGbd7xUysAicYHKq8\nHZgBqyoW866li05BOQdFQUoq9k9apLIipxQip3D1uSFdpHf3546dfAGaI8XA\nMc/L7PQGgcv4Pl+p4smVu9EmUmDTgzUkQSCQUOBxWI0W5UrRZtycnBkl/BW2\n+CPb9wRMyz0UfZipD1c8uaOXVwjokjFw66imTohDMUn5huEkBw7lRLulPYvl\n2adWEl/mxIxmLhyjXyTNULycLlAczk7JedFR4VyX1PNZx5TfZXNzo3Fpez6T\njlSu\r\n=z0Ja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1NjKt5i/qU9q9HvEg3EhRTMVRsM628HNAtUC0yOzpQAIhAN1X6SQOgehSCkG4FVABeJ+PWMen6aPmRgyavn47+ZUC"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0_1607795630106_0.8794765060676792"},"_hasShrinkwrap":false},"6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0","gitHead":"0505d1afabb5ee521715e989c30cc8a9b3e22193","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vBVJ3W+bn7Aaoy8bZmyALT6ppqdvQpYys9iOZjvfQZDNjk/xyN6TiZHrlT90B3G/kfbASwqA319Mcj1bWsT3+w==","shasum":"70b4027cb924ed4ff4367975d00d3ad86a5248b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0.tgz","fileCount":39,"unpackedSize":238393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1djdCRA9TVsSAnZWagAAsb0QAJGBMkpqwnZa/ZoxONwx\nv14CgyfZ1CXrewUERI7Xw1FM7BQzEzHglS922G+KyNCRvTkgfE7e1Q7ciFBn\nLLTMeiim6yh0ATmTy3qVrLv4GbNkZw7xZoryMnP4BWCepeS6thlcmfAPJdCE\nP4W703P7YkUzG5PdlIaG7koG51eDyeKbGchyJetv/F5eKZnNlENfN9tJIznl\n3kuCH7zxiAT968en330wBTyZpylnCWKK3+1R4kGVEg9vxVSyCPmkkx1aYIg3\n5Q56Y1lu0oGH8semjwW0l6TpU/JTyrO1ZREFPOIyL2V1r6wHTB5NQQW8C9k+\nper8iY+VaCy0l7qpv/aJ6sTZ6MAGSBC5l9Q4cUtpqSWaa2dqyQ9Ooe1foc/s\nQWr2FCQRtUikV7vBGHWB6BlRjd/Ht2mPLuUM6NpnkWmnAoOVV7hG6XiMuTIM\nBRQmxKKN3Itvx9OjqcgtgbIXX94eDK/8rfgVneBCCfRFf7yeh+JFnsQPcOvv\nF0ZdQ3NJ01kN4rdIbfuw7zUpydQL0UusXSQV9KTlGGeIOVCtxSsXpmcjND6r\nPJgyThzGtPzChaDjkPe43L8U5tLsd916tstOCmzz1p+rdx5G8rJWSXZWLEjT\nbAl1TOjng+L6Yi88Sodpi6YrLlRPeDKrRQjMWg/Gcnbgwyz5+31DfA565URK\nrNfJ\r\n=KasF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm1yPIP1j9JAyVdDXyS8any+A+pLeUlfDBTgcuPos+KwIhAJ0XHwFIRg9OpMrc5bTIObtl2DPBzn/ecFuymas056hP"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0_1607850204433_0.3236162003328569"},"_hasShrinkwrap":false},"6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.49","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"26d6545899bc1278d59b172c65d54e6561e5427c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SwcvePVgx7dWuSGMLcUFrMzf0pjWjJTYF77epykaVOb60PwhEGgqVYgJCfD5AU1KrDCIGUFDYWzHc/K82/UjHQ==","shasum":"3d0262d44be44685c155083be3c640be788cda57","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0.tgz","fileCount":39,"unpackedSize":238393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1dk9CRA9TVsSAnZWagAAfwEQAJZ3tX3VRgMyxNFNNba6\n7bt3yHaRIBk0Zt/7pZAKVLcRt0qs0wz5M3rKlsFkF6NMkRZS9Fa2Y2MrjMky\nOKDp8X2IgeFeA2a67M3PGoYifF37Y1wMA2B/39MO9YKd06RXlaslecWfbxrR\nrfG1TNKlIXmqUtX1lHEEo1iP/Agp/KkWN7Qp19tjzO1xF11LL7rf3WKC5dlH\nqKa1LFOu62Olu7KG6k0Eb8DuW5boxMVaYcMaY4JmGg+N4FHMip0k6eijbHQK\n+mvNwbGLrQonM/p9coVSU5NSMXvpHaXjaWNBABLkdewLvVWlU2gdyjuIGkdd\nVm05cy+dOb4vwptHQ/aZZBqWf6FcN16vODpZmbGokIEd7SZ/5gF6Ha8RUrgx\n6gUhfJKv49bO7WhhbIKMiNTJMxC17yW1WGaIPu71AAc9VqTvNheCMMGveGPV\nPsLSwI8KX5/qXzkqFd3c61LWRcPcJ5aV3pHPizhw8tC4KKe64Z+uT8NMVzX9\nWbxBUmGOSLaIZLdKfC2M+vjdDpShyNgP2aOvhzOBPFW0obpkefxj1S6wCurD\nxC+CQyYcLsbHpe7x/5tli6G+qmk2hFccSu1yL9XhOI9w89fvwq9X41lXcPmn\nCcpCBcF4AryW2J9lxmQS+tpm56YBj8yD6Zi7fZiCpbubBqICCtKEIZ3WYza4\nyWK+\r\n=5ksS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTas4V7KxsWixC9acWqeuODvhw8yPpyK9CRpqFUkBh4AiEA/FzL2YlLHSGiIuh0JzHl0+9/pX0M3irxmmpGqFkG7Dk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"acazacu","email":"alexandru.cazacu@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"merlinnot","email":"m@merlinnot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0_1607850300302_0.064584874032658"},"_hasShrinkwrap":false},"6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0","gitHead":"1dbd879f0b9298cdb0515ea659f2db434b803a99","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SK+KHQaVp+6Znu9gVf3r7vU1HyHwtJ7Gxd2jAftCWk9WC9KhPw7Rnd9GyLg5ddg4Yhd8xorieqhtpeXzbLPvrw==","shasum":"66c455e3d6ed2ec9bdc7dfb5858f963378948339","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0.tgz","fileCount":39,"unpackedSize":238678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1v2DCRA9TVsSAnZWagAAeWgP/RZOopngRd0mrmVIWgdk\nZUjQctoQu76etNB81dfQ7OCUmP4+X8Em6gsefyCgIl+mnMz9V+wKsHFqCPIo\nZjchqY6/hXvksWQFJpDDXtu1T0CPwy6DJyruEmkVeiB61aGc3MRSyGqXzOKz\nCEyl/v/a6uBiCfWJL5G+peCzRZWE/sLvSBgHMttwC7fxrefXmJEZkcP1WgaU\n6ViyXwPTHRDQY4DWJ5wrXaMzlF//AcMrh8i5/kfyZRFo7Av3GKvKY2DMdeMZ\nsG9yQ1RhWXbtw/sA+bp13R3Sdsv43XWPIzEHGVTQSCC2Hckv9A5/JqnMLRUO\nzjPABCqCI63Cq3EFDtsWu7u3XFG3nBijx14BkTMwzgF4g6j3S/n7Ks85eGAB\nB28kmJR7pRSAWEiZBOU9P6VfAPUBgjc662om+PXnLQLc8aY0n8s9dZXxjh+L\ncLZUqlie9eJv1ry0zhiBP8dmPKs/LjOfYzYcO6IwAurAzzuPp5ij1VXEhgmN\nMJdmIdK2dEMqBqiEHaWUlibsh+TgsZIun+ysNRLHTYVUQvpOe03O1h5htmki\nct86FsaFDjCDNoiUwvZvf7m59JIKjnJA1aHrHBOyRxOpqoappZahG8pxxlSo\njx1cdSTVJIx7lcw/B6mfbWlLErlRF+3Bv4nJFUpY6L9ZnE4yDTRbRNxdbD7k\nZwpl\r\n=wwMh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwlHFLuP941fZClVGzqwnrYcKcBuHcpc2OrwGqTL8aNAiBXwHjb1KFjZD70cXoIARMll8flpwFiHdnl6oJQIDCBTg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0_1607925123372_0.48516432298113354"},"_hasShrinkwrap":false},"6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"212f1dada127ea24ffa3e32ebe046a27a695867f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ayFptbUdJLMiBWS/zhtTmRkcpE4YmC3n4Qw3m0cQHtAgyd4szuubQeLhS06XkuegM9RV3km3JsQgdmvjDrF8+w==","shasum":"4cb7b070397570e9459146d6ff2d659f5416dec8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0.tgz","fileCount":39,"unpackedSize":238678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1v3dCRA9TVsSAnZWagAAaGoP/31zB4wJg5Rq8R6lZOrc\ncf6LAoPXQ0o/68VTxg5NZHAu2C96nmu9B0PEyhMkK6+v5xOErImRaT70KqMI\n5KlCLMJSfDNji/03D/xJAk/rOKn8r/ujoyQwXsuMFTmZ5LEMlCPdzjofYf7e\nd2JZ1tnJdIYMKy0YxcDIBCy10wOUPwv5bCphyHIROakcAG9o4LkC18n8bVGq\neQlAGkNAxwGY3BosRTUHemBhtXscgydmJq6at3frlyFVkS37IBMKnHTEVUjb\n1edBiRocrxndFrXkF2K0tsPBGO8iNzDWLtSdQOHwEJT5zuflshsOQrzXLsfC\npiKuTOH2OAIgmChaDEUz3EjKv17ae+ZYjEcY8twiBrV/vTHXn9VYfEcoRpl9\nBWtrt4Q7rkZXgS3XDiTj2hDTuz1IRJnbnsn4hw2U4eF17jp3rMumonDdfUFn\nw7mvjBqUZlrIb4HBMrzEBwq8YkbbadOdQxP5bOF+VEwww91CiO+k61EIa/Wm\n50aZpMlch9+Ct97mvGVvnOYVh75TnxCLLvIJhC/aK37Zla08ferhNiZr0LlF\nldSP6PEdjyWysQxt62PyuWl6Ib2fEJ8peJ06w2HJffRIu4zqBNAznFa/nRY5\nDhwiss6n/X67Gov+O8sXqgHGRcH0drrqNScMIsijX2iLqQqw1S+a15R//hTZ\nFOqy\r\n=jCWy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRWsiKdthckCnRquPYudBcOFKs7NW0u1A9U/qTGlZHMwIhAOp79wzqYo2t3I4KzjFpETSC8ZJsaQZ5WUo1H3iJ4ze1"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0_1607925212687_0.555474284992318"},"_hasShrinkwrap":false},"6.4.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.22","gitHead":"e6de55d67833e1e6e9667fdf3f4d308045f5fe17","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.22","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dMDo3AOgiREz95+2sJQk+H8vnm8OilMF4gtiyPbTaSO/fbJpc4+/lt9H3m8zaMhxCT1IQXTQIRZc0pSJoa3eIg==","shasum":"8832e7908349ae030c11904a8a9c414a4afd03ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.22.tgz","fileCount":39,"unpackedSize":238929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1v4RCRA9TVsSAnZWagAATrQP/2NHtX6R3pDA0fl0fvQ4\nbCwcoE2PObjFCZyA9bt6bgPZtmNjwUPlTrgksrUGeOPDWLfGvJCwrrs14lI8\npOqZdyyanyXZp+AJOkgoCd0UDAPTXuWP093Or0/M9SR6AOmPt8zS9czM7ma+\nZHfEV6loHTPWE178uv16XMgYiuNhdfM0VUX2hlSfBVswD1pqPion2yNhOvNw\nygjSHZll0TSClMawEu/OVvxOOdlOoOZKraz25bfh3XahlcL6Got6CHwK+Plt\nZ2pZ0AcBADxxQT5BVpfkcgS+v/OVmOntvPNg7LFIRJ9OqDj0Tb7kq45l1C2u\nqUluIKUXqrJJBHMgcLt/ZGw4zXvxVs8w/+THINClonzxRatimu8OVr7Lqxfb\nISf3MUHG6PauG2fjNr6h6jRvgIhAPxheV1JRYi5qEEA1ryLqWiMmaMkTkn7p\nHb+NmftINmjsXp6/ZwYXdpZckVfThCrtHagEkTEb1edQj8ZuE10uaHrvC8YD\nECJbuU8dkT6NDTEsmBvTJp1kl2t0KbLLfD7bePzucejzRqm6ntgA51g9uDNc\nKKXyl/+FDhr6Z4c9XSDTbF2Qf22hAvQhcHp9Ev8NF+Frs3sDQ6bvF+L7U6Kj\nGkQv/tey7Qfk/lDQ3GETnQyaYWzlb6gU+zpy59K2Ciw2R+OdVKaCgpyZjRFA\n9CTG\r\n=qe51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFo/LjUXmNzYNHCf/qRuTjJkkNH/p9f3fGDGQV3mPo3AiEA65V5eD57JcqN5YfRrHn3G6rZOE8TBrztaCIsZ09V7L4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.22_1607925265229_0.4929331115223994"},"_hasShrinkwrap":false},"6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e6de55d67833e1e6e9667fdf3f4d308045f5fe17","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-bPEhfPRQ7IIbnMFHXobPN2ACGzJQGC/98CwC9Jqbks6ubhk8fKii+U6Yw1f+UMzMK9NlqYtPRdzG8HTdio1FJA==","shasum":"01fbf2e64e371aec61737ac5e48914151d5c1c8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0.tgz","fileCount":39,"unpackedSize":238972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1v4nCRA9TVsSAnZWagAAtwoP/02khf1D3AfJD8vFBeyU\n+r5bFdCMxI5iiFkMRGAsndlwiZdeMNX6e6TJo5qAwyfReGxHUASKrIZ7ZBrR\ndSQXbZGbNHFHmb2MmsiGctSZY7yrSQRObKR61B6zflMaNmsyQF3AbMWpcsCn\n0LTSBn6v2meDX7Iypphs0AFuktSxe4obXbMnytFVq7Dqj590C0d6hrwO3p0m\nglXSJknk95NFcoxS6zn42X1hvTZV5DfCL8vQ4wYarwkWTQmayXrTyTt/6NM5\n2p9N8dhv28i9v/mO+USfgVnfddVp30gieEvsrF+/wsOpG5JxDmeyB/zN9BL2\nzX2IkcO/lDYzIqV5kTAPpCBDGhsenufA4EBshoX86ZPq5kEswpea1d/xb7Cv\nRCTre9D1u3/3+KKhooSnWeHyACAI0n4FUgXP/tSs0XttOggAN3Fp5VUnbln2\n6VUA8BFsitmRcZ0UGcjwJGFfsybyMbowHT3gyjvHTxSNzKRR+LnJ7SbWvjYz\nhBaZGTn+rNe1q3OA+xwMvQkXU1oqNCzFsoeVqT+rrdOTwoMz2t7oWcwLGokB\nQ8kV1ocDyCbu5kuB3F4Xx8kxgmkXVGbCaBQR9bFes5XRG2zBnk653276xN2K\nn3IWD34lhn+APq9bmItwFsEFzcdm8egDXj2z54IkIcoKlteaIBCGjNEdCMY7\n92mC\r\n=Sm+A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUWMZBaz5ngTjo/muzbm97IfOtdY7cJjq7aeKOC0AURAiEAuNA86LxLb3Jmq9pw0qhgrbTMJ3IuXgLCNB5c93xfshk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0_1607925287234_0.04029182497391304"},"_hasShrinkwrap":false},"6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^4.2.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0","gitHead":"88f84f0b840887b49c903988fe29ff69aece0875","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/Qe1YHiMG6b0MJ/gcqXyF9j5VQx9B8uTr9/5uE3ywft6AJVFWTkoCYRc5maKe/QyFDXBenwOj2QOmThAKQmlpw==","shasum":"d1e777d09f6854244206086b4c2cc8ad133a6528","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0.tgz","fileCount":39,"unpackedSize":238972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2En0CRA9TVsSAnZWagAA1kgP+wegzijg70nSGnfPLYcg\nsnMOyjsCIfQEbWWKMT5zEjJv+Y+VyzAimz+k3yPFLn8npuzqgKvwwMFHW7WP\nfZ9PpQ84wMHmDTcZPKL4SSV/7y36GuxqzVLuYyvtOqpxn0XXc8SDNPKJZHnV\nq5YhBdRFMlArCE/kNtRx5HQsFey42g+NcRqsBzlicju+/d+EUuuI1k8nZsYB\nKtrtG/gVfBMkBekWGbghAMcNT0HwetzWpP5/Hoxl/ALvEmXx558bM8ajp5y2\ntZqo1u86NSPZpNZM8NcKgOkJhtFhw0jH2SqDT6HU8w/Ud9p3mxNCLu9dzMcO\nqdzM5iqO/ZM8JLgNUKfBFlkmGQTD4YccUKDSbDXMsr5NA3CCqZrzYCJuTuOt\nJYhB87zTonXEFmZWHYUU1yOURhkJbDQJjDxagzFoJWouja/w3aEHpF0UoPLl\n+0FHIeBiQ/x/B+LYfKIZbTnWuscdx2si0Y1VnnGmfmXQXv/jmWiQOffyguup\ndNyRw16W17O83bvSIv85bt4JDEe4wDcGBSmkL1igQ0B/icYyrhg52uriQPAF\nqDgqAT/2nVueNdC1IPhd7+32FbLRzWzvol8e6qGi5kv4/67Ghmntnm5IMBz6\nmxWg8tae1cM4AejSCQl/7DZpcGNRyqUBqoY1CHK35Ox6G2m6RNjlke4utJGv\n5lPY\r\n=ODec\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFw8mL1eCT6Y9+Zrw/zIbW59Xkp4tZY8HBmVHQtskqMWAiEA+OLCx0/pXQy204k6HFHyz9iQh4xeDvkNJReYRXtUqIk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0_1608010228006_0.3674603739370341"},"_hasShrinkwrap":false},"6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0","gitHead":"38db68bc6c9e16feed623e12ed7df6f4f221de45","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-L6n1mZYtsOBRTD9n/emiVQclkr7pbDszzbyL+ThkJWTnMmMOAqXxV/2vGt9zqHUBJuONmRWMKasxpa7dzzpwxg==","shasum":"85474d7d878078850c10b70c9761f9cb584a945a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0.tgz","fileCount":39,"unpackedSize":238972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2KwHCRA9TVsSAnZWagAAC5UP/imWkEpJsFsDkqQH7QWx\no+ZQQPATOYMYQ6jV7MmPB/ENo0iJ8rnVRjnAsc1YiD8UXqXv5yuy9rmfCrkZ\nKh+mKMlMzG268A4ZxTTrbFDZXOAbjd5xdeMPSMZrNRDA+eXnYbIMqgAhX0Ca\nPmspHWiU5512KBNL3rW+ALBwc6TndZRQ4H7pfF0P1aAvwuLKxu70bbvSkQe+\na4cr6U17biJLt9CECIvjTr20QYsnefkws4b3P8VGShTzUAELKn4MiH63QuYA\nZJj8cGWDzg4joV5CWCY61fEpL9/Wg8gdIk/MLL9bldIihiVAeFX6zsD0meas\nUnZew6KS8FT5ftGg2ZUqOD+PtB8ULo7TJXBSJ8osXuFyMJx4vlUzXzxOPsmM\n57OJzJDxq0stzAcP66mlk8OJ0PCXWJJtb9ZrAqJ0UwuAV2Iz/5tBxELxlmxg\no4CfqxDWNItYe5e3eRi/Iae4tU4ozislsLDx4m2KuWO+cDObwA6zaK3D3YQL\n8gC6wlcMfHowB+i958kG6wuehjtGZ/iy0fg/p7k4rcETWu/AivqG8L+m6waI\nh1U0xRHaF3yEEgRAJ27vnqDl763k0eae9hjhzvxgrkbOJesYuaZpVIVVGcmG\nq5Vg8N0HDZiA6kpRYrW2ebrAP4tQ1MAuxY1MdhfCx+tM13yORYOCKh5gldmI\nA6ij\r\n=+Gls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDS6t5vK1bbn2nYgwtCIOpjiAEUSkjWZL/eOg1ArkPPaQIgaIxSmDXBzGCDwCYMD5dGi1c1UTh+cu4CZChOQqFLNAY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0_1608035335333_0.48994910165685046"},"_hasShrinkwrap":false},"6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fdbaa097a9575f7a339f07bb2b4ecff7a6a58572","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Kz9LbrqPQ95pdO73iRtK4JBIR1+XrHLbjNTac6Iojt9UB7whzH6zIbs5rpt6YbXCq0jMlzZ/FEwttstf4yO28A==","shasum":"a2b783209180d02ff2b5d908bd472aa0f1e670ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0.tgz","fileCount":39,"unpackedSize":238972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2KySCRA9TVsSAnZWagAAArQP/i9QSWFmAFqkKkNFgQ2q\n/zyZpfSR6CzLYnMPTTsKxDk10mymLTWNITppHPjl76H3qStnhYOwO9MrZbeQ\ny88iDv+biFXJmUR0E7gNvMk5ZZaGoSdo4BtfEpKm4h5UIwxZsl6wg+hpCqLb\nTB2/WuieMAG8aMgJhOMagNP2CR65f4QS8eXMMoAc80paosx+I9RYt8tvh27j\nPzc05v3K7m/k/B+VLxi9MDPghCFgM/S2S09VDbd1VKEYHuxRw4LVUUnmfas8\nSXT4OhOun5MveZTuBpe0tq6XTvNM+1y8Gynqvhg95NBAWj7jUVXLNPvI09Cv\nHPxjs/uH59cbYIJOQ1IOATePYbLE76K2zOVDXtd9n4ugypQZmzsR0+YYVL0v\nzMB2pv209hgMjiK0JzKKajmbkSzsQSSsJ/SaC+pqaelCBkXw3BjD5+5cpCO+\neo+HyGAM3EkH6t17EsshIzRUoXe+aYbEfGB1CbBvjc5oZ+vvVKnvM1iz4CHA\nauZhye6b2kqp4Xtr8UN+RYSkuaXzndyCBmD2wgNHz8kmonmymA5np6n7Xqyv\nfa1RVJ8ihK48okJR4/RsiUWHkPnDXzcxmf5pZjSppUhfn89WyQ0/N5hzevMz\nJ17hDezNpvTm4hvjL4gzI0kFJaHfAVBC1Fl3GK9PMLoUOQUaR8+NlIGOOagi\nfhJ9\r\n=a/1A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaqbqzThs2/NZS1UrgXoi+F87vWDqeuU2igmZT5jfRCgIgClzHuD05QfV/TVZWaFCdwuuQRl5LtJUWu4xYBr6SdCg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0_1608035474089_0.5165037943600028"},"_hasShrinkwrap":false},"6.4.23":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23","gitHead":"397df079ce12b978b68b34288b43959a8dabb533","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9U0OTRjoQXH3+T9sbDdKeWet3dkxs/9CS2Ui4y65/a6jOxVa9YajJKnVeMsxnX2LxfPntMzW0jnNsQbLHPFLLg==","shasum":"08be0af7415baa5468e8f70650ca9c14ee05cd1f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23.tgz","fileCount":39,"unpackedSize":239204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2KzbCRA9TVsSAnZWagAAuwoP/18mEhF5l8dI/Nj6aXdr\nIL5WO5FR0WsTH7sdnFjAVt57uDG5dnsRgixkdrqSa+7+8gPCSku9sX12FWDJ\ngbDomsgEEI0wqC02oDGZ6RQBJTDPLUtwfdjRy8qXTB//oiwT2LLplLlUyjz/\nLVIZpcH0kMQdVRo8qdtqVquZrfxZDh4ogdl1EWeMKQcdD/yd+ovLuAjQOfJG\nfs5b5mdWPDWHXT/OVGGKVnLAIVhWc0LLjR40RI6JqX7nEufFZLpRRCWiUwEi\n65nUaB2SWMa1mNu6SBTNvgEzYHOPf8QF/9ER3x9Hq8o6B4ja4kqPdh30IgEr\nnDQnqSNhV9K7xU0U3D63HfX8pnPokZ4D7uMH9pps0mDLSkcY29Qhp8SV3U/O\nHmwdPH446kSHtQNl4ylWPfm0rnWUZIaoaRo7iGB073M6XZGKwKyOrxPJMq0N\nPt/xhR6k4t/3dbsJkP1yz2Uy6/c7ku2C+eaQrSm459C2gW6Rk1NnKs9wA6ls\n+zneexWnYIdbwixIDxPZMdsa4rP0mq/Ko4dA3GBNFww7463sWw48NDVJotfT\nGD7ri9OH9buA21Ttgu7hsTmjJpBx/9yKYdh+L4I9jl5U7Czok1RigN9TISBP\n+F7cvMSb0AGefa+Ykoc2K/TXL73scjgY5Ny4HVrdODLqalgaxJS7swQU5A7c\nRsG3\r\n=G3X8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbpV/cP+xfpokUQOQGXF0HUUO1QASLUrhS79eeXVt9HAIgXHwkLfAsX375JF/suVdzISZ6HJ5tzPE05sMIx7Is4KQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23_1608035547130_0.6073385783967546"},"_hasShrinkwrap":false},"6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0","gitHead":"cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Sf4Tkz8IujnPN6nrAOwh7Z045fGz/Q0QvckK3Ewm1emswAKpqz9ZyZnRVWOoiKKBUYnMrxH7XHiH7uw7jLuppw==","shasum":"b66486701016dabc7b5bdd6dcbcf9e1f92e97304","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0.tgz","fileCount":39,"unpackedSize":238972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2K33CRA9TVsSAnZWagAANEkP/Ruvg/Z5yiB3HKFXQVV5\nYT408qe65qxBreM+50+L7pC8xuzOr/oq6GBML9TZ9c+BKzOXuKxyxbrfaA0y\nPr+Av2F+K0Oh/m1lP8pUA7pqmxEEhRbTQyZFkHFPvSB9sDz3PqO5Reutm/1s\nT1qfZ9OWqv5OeDBDseL2Hy6zVBvSROJ+yoeCtvzmAdWFEF1F+QAaJFOUvkx+\nSJEuS23OsT/ZGddhPkM968B1ZEkxhs4cFyXIYdgubTiP8BJBBqzkqMDcX7js\niBqZJzy65z3BP29WCGOWRGRIyPmYQ4/Xl40gI6WjRJ2vfUpk3OEQxu8vtCYq\nbwTBGv4QwwPe4KFWNKRgUqyG2pIwGI16D1MG16yJHXG5APTVfY5rZNwEBUh/\nFE8hjf/UCNoo818hy/rQudp73wggz/khb/NuVgFlXecMyKvkZ4y0QXkcU6A1\neIdwKaT/kNhC50+Ha7XH8nV9/ct4Via3/cTKoYmuHlYx+szQjJwrwwlEMH0/\nsRFfoAia1B9ubdGI6mkCjnhrY3/4LLVHj24EDwl4BUiOOrwtPkkRrLDayZXN\nnH+5W2Y4zoHuIWCGWrcHdov6Hy8sBxKxCrNV+NxxRNo3gIiHECLSc97MV+1m\nzjbXS7j9vrhXKrlNdHgJp0taPZ4j52gjPKFAb6j0IXbJxUX4hJT4tqsEYcQX\nR0Cg\r\n=H9wT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHanVjrpdbBl5sUMyPE8gsXG2F8b0cFg5YdgLIbAt0/AIhAJb2/DdCQ81iF7zD7E9pQVNLe5Rqqj29cMOZ8PrZG3Hq"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0_1608035830650_0.9214259259173769"},"_hasShrinkwrap":false},"6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"397df079ce12b978b68b34288b43959a8dabb533","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NiQ00RwLwkfc8BMARY72mHpaE1Wr8+4CSCG9/fJodOc+dCrO+5ACV1hQxo46ZPAIOHC4ctsuVv3K4Ba8XIjldQ==","shasum":"4e65b7f561db9eb0a92b2c3315b075a88672f36f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0.tgz","fileCount":39,"unpackedSize":239247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2K46CRA9TVsSAnZWagAAB7sP/RpYv0V8S5yepJSGNh9b\nQBEGRQK54tDbZPzG658DvY+pvT7VH+ufy/p9ctUvaM+SrTd0IVRTLPVhVyd7\nuBoS/77IXQyArQ211mskyefY+6hbdEy18GzQeraT6akI/Mym/0eioEUGOcAF\nI9rpH8F3CZ9FrklX2DPFTVKOQEHP0TdXLoS1BnbpJ22e+IbSOW3WU1B51LWM\nVdYJEIZg6AOHUG5NVdJIP+Q8qoaCMdwG336HwIXg/m+JL9UXHq8xyVnuLlwC\nFDolxCI+wEPMy0WNvRNRyhJg6aMxvzc7PDdRPeGiGXQh/6tFJrfnNwtyij0Q\njdPezoTQ+RVyoU2RusWHWfzZD9zz8KMdbcJMLVUR04RDCVSPnn/ui++fS6Xz\nKQiW8KWTqXHUmkpJgaj4jcxQDy8YEYN5XUX2wmtqPZqgeW1T3DAxtPrNn23f\niczguCGdcd39qN0Xo6MGvbBP8SrnmRhDR3vGK39CzdEmTtmRq3wopeIvLDwP\nrL/wAlusBy6eAHWVpUvmsEJPi6aiZH/Ijne6kO+tnGwF467Z37OjWN2PdkKH\n+POARH57vtDKxNEp4Y8z0C8p6ZJ2lwmbNrf4CkpnNm/QCTz6F/No1Ss+hs3n\nK8PX86UjpcghFWxl9jZzlqywXBfDm6eFXLmIBV1/ezL9JAZypFqxljgUeE1x\nIHHY\r\n=nLnO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4NHl20lCuB/I5mpRjix9Szp9EONVQGe/tv+73BXwYdgIhAOaXKDi9wkEu03EMAXNY7o/F3Wqu6cf6LblmtI/1MeDP"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0_1608035897787_0.378336669008007"},"_hasShrinkwrap":false},"6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0","gitHead":"69a943a6453579c1ab8f30885bfba10de9b8d4d6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+CKh0Le+YWyaAv0ThlbeEDjzTjoV+Py/kQSgSbSJLMNxsxbKx9eVL7zI8XmKmLudXq3TPlaW1AwDqGr9u2mERA==","shasum":"3226e967186541034cbd65d8493a6db80e26afaa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0.tgz","fileCount":39,"unpackedSize":239247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2K53CRA9TVsSAnZWagAAoKAQAIEKzc91kYY1+kptNU6U\n0rNhabaleWv1hcmLPNxP0+oyXJnn4gtHlNEOr4J38nRYUx26JkkJ1oTvOKXA\nEBRSyrN2ZKz6pp6NGdwAgXcqB4nfzNCP21/sihMN6q70njkpv7+0kbgHAJkg\nKboi4vLz9CRm/DSQ/C3W+PN1JGtufYNJYxWMncDHeeVL3QG4jvR+em55pnS5\naOe6Auifk3L9slEkoelRFphV2YbwUh9s2AqHbOhar9o/dEV4vvuOI30JAZy9\n8PXmVwZvNiDTaJo9Lk2rscBjmG24DO8zRgiWa156me2uVx5fEwEnHCbHt67E\nOTy/C3uFS28p0QuMzVhPW/6fKO7OUyiZUBQWCag2m49T9n5Mzgp6ajmc2NiC\nu0Wqj/Ah5QZFA4n2zC+H7FIkzt+6SzA9mNHvJYO4i00iw+cAJBDPvkSXpdLf\n489uCZyqtsRivgLy87sdod26o0rvgjST6jcXNv7VFhtNqCAr5gdVeyEVHZdX\njO9Bnti9qWVBtDDO0bQBrzIn8Ry1kcQyrRx4cRkR8gy0v21FvtM/Hr1319as\nLnmyPT8ksCDb2ul+KdS0s63laKqx83mUJiMcCUh37jnJAT9VvV9q/pKFqnbs\nS522Xyl5a5t8MicIsfWmGJ4kgSuE58KSumgA0vSL8Pdnrxt8gXCcoUCPKXoV\n9XzM\r\n=BHMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI6t4AIq+XueNRgY7DA79ZIBMqIwQN9RN874Skc9H1iQIgT+qcQ1KXhPgpOXJNwEk4Bxi0MVtS9eRk20Ak2KeTGgw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0_1608035959238_0.5619411480097789"},"_hasShrinkwrap":false},"6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.13","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.5","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0","gitHead":"080d7395359c4c53ea0c5d1c683172f9d71b6ae4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cxkibvml7EteSbdCkgLF0ZK9aCZ1XzTYdlBoow2BzSZSbr6RVp8mfAY/vZjuyEkZoscPk8xwfPDH8dkMPpnGBA==","shasum":"903e536ff5c99b749890ff34533b9176c066dc32","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0.tgz","fileCount":39,"unpackedSize":239247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2N7dCRA9TVsSAnZWagAAurcQAJH/rssW/IEpN6/aw19o\nE9931iLgH1cYOJSxeseUdDTe6UHjOqYzd+jXfO0Efg4O6P9pW7qXisF70v/l\nE7s+jeqBArhbbAes2BzU9y6U0Ye2vpQPKhJSDHcvPE9idz2qyZx3zqAK70wq\nwCDvdbUw4pTGuAtME/FT5k/lLuiF8LXzRBcjqX+FY0WOIqucMesHQavt5pzx\n/TE9OWfYg2If1bmJeWNN2fy+L4+wlaM77XrfyGRG04sPbA06DdGhp0Ga/wvq\nSYpiY4mM45ZsPmY10kAJf8ukPAmuByg7h9V7XP84AzxCjPFaso7Bx6O/fx6M\ny6T1Jhwp2xxH8aLJs0EKY/9qOOkpQVwAYSunUglZofQ8OGOF7C84Eufo58ZX\nxaZf8TcwnuHtT/bi4qxJl36AE7n7xSzij9utBSlCAbs6/109WTDWC6BoURnH\nIaXVqxByUD0JJUazt0AAx7os6YPvCFImgQMld7qGBmhWsK4A7HhtJGjv+/XT\nXQ+DQ++zr9VkSZVdYifnHFXjAlCsYTGMTdx8vHA0JVwm040X0auCNkBStE+Q\nZOaK7ApWEkTxFg3FV50vD3IQ/GZvw2kPqZzTMYvA+esLYh8UYfrmwYGbsG5s\n9wfJMsyh3hg+XboV1euiPtqY38LOGOT2bpWd9HTvYylgplS8X8z3/yC05izb\nG8hq\r\n=FfSq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALcUSnNrP4nXAhvizcWGTxsgz1j+K1lqFWF5hhE5zYwAiAp+PFRe12NYC/t+sfNJ7kAYCeFsdvTbxwjXEdCcXiNXg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0_1608048348470_0.9992434529675036"},"_hasShrinkwrap":false},"6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0","gitHead":"21509318644c1c76e350db89f7f61dab8ced83e4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DwOSsFjL6RIW/OyA55rw87seFjYb7eavbL5Gin6+anFsEZw9fhzOj4PNSldBsg9BM0aF4gS8XDru/HqUXqv9MQ==","shasum":"fa5853c6d464c08a3382a7429e45740f2e7386fe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0.tgz","fileCount":39,"unpackedSize":239247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OmsCRA9TVsSAnZWagAAaqIP/1NLumTb7fAcZuIIIITb\nZ1kPcNbZ0EB3IdqizZAwmspxFIKHSYEIQ9vzyNudgSqXprygVwSwfa8kzbXC\n59xy47OpEKjlMoXt7z84XBJHVFTJlZiIDiYi1JrpJyIW3bPuP8QhTfrDmnpm\nmVT0AqmMJjIbU3XB5ZNX/J7slN8jP7xXdPA0HDeXhb5tlHw4gIoxu8BfFyn+\n4cJ2c7wnQqSxzU8PluLfqFidxK/SP6DrWJzsrgJfowIcBHxJjZshTAYS7D87\nI5/9NcgIGgCfOrRAcHjJnZRjrI7lsw9l8rRvvRdHB7y3pHD+yn/czsENaBRv\nanpJyAHQxg6olxEFWB20aVBAxMxiJSbFJ+i2SyMsswO/nZ6qabwapKHzgqS2\n6Ko1VgjYszMo5dAgkMGKze+PjeBwkVZbgcOjKSIYLcKxDOlQANTJxZirQwE+\ntldGOWJVlVOYo/FO1Rj4L5XFQR/dDotkybIBDhCTlLhXIbwTNgzVAYt8GfQn\nJv8uAzyLZGVV7gTal4xErOlL1Z4QYWbS9CBtYY07lr9RWfh5B4mwbn19N5EX\nsunbnVNdrsp6ERepAx72Wa1EEOXemZ5GuR692KcITV7+dYWi3n8P8VhCwt7l\nTaPmGLNf+ViOnk1Xg0UAgkDAtNfc1Ucu3YxjZRtBW3eZunEokuwyVkZXkHnV\nMU2l\r\n=bsIO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5DBvMJPjpdhTvVTRxL5BVRLOll3jtakW9pjAtLGtmgwIhAJr5TR8U+llOH20iI6IbNDsf98cPZsXpnEPDrS2oDTe0"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0_1608051115709_0.1419668824593201"},"_hasShrinkwrap":false},"6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0ac3b92c0f8145a2efce8eb83719d3c839ebda28","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dRnzPQdPDGIqOnJ4wOg5ZxbdNDCNQAibjSSgY4T1F8lo/XN/PyDr9uWvEMy9WDggavTsL1PLAZmwoyq2HugqmQ==","shasum":"40885de852815deb73f326ca6ca90d75c6e49e35","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0.tgz","fileCount":39,"unpackedSize":239247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OpYCRA9TVsSAnZWagAAZ2cP/2QqaKu+PLSG5eu0F0om\nzsjQHIiuI7U2BAYQqj9HLqozobpe5qUgRINfGinTmNn7ExvlMdgz9Ei/mQ0y\nh49oQBZP4AfyJHknfys7A/ksvI9oD7qJ7LtHuI+QqeG+g8dXe+ITLz6+w2DK\nCBlBrZnP6p8TCfwINV3j5znSHGJN/Vr2R+KrF4JuIafzcsO0hNGKFOLplSJX\nN6H+6zoD57X0/Ru1furq9OX/AEjRoSry1SlWvwpaxsFTuwrhPtSTTLQPgzem\nVvn7fRv3Dfi0R0bp1jPR1KnVZCR2zkFTyy6GNNeItPQobmbSrCvi/r2XUEiC\nnjHPHop0l2XKXygA0yVHU9erBJFIecr/X79LE1O9HysN1+XmSK4F93b2bLSO\n7AkRq4+sxZJoMyJoocfP5R1buN/5sCYLFmt37h20qrxXB4P7a7AuM8Gfcd6v\nsai7Ltx2Kw3DYPVAsTI0223hPMQTADSPQzXtHP0Zx/8TAW1xCQf0qe1UVju0\ngOhP7N8Qnk5QHf7zB7PH3qxh84qAUDoN1KiXMfHuCtFf+v6CS4knMVwAH+Dy\nXBlgZUO5lMTwv1lPJ39KJQYTATbOPYYq2Nf6tw9SQmWukZiPNFDLmlhlneix\nUSLOJ+KqVB9byqTQdYbtXj0cs7EWXErE3JZDlPd+z8xh9N03SJHloFdGYyb9\nM6Hq\r\n=6P8P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDImP2G5Tj3wzdGHH7TzgyZjyRwqKLyUI2rRad2B7l/iQIhAMd+rBkcXW0WLbQMaGN7VQphmlXeqtu3CrXdvFxIMmI9"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0_1608051287695_0.5472372569584127"},"_hasShrinkwrap":false},"6.4.24":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.24","gitHead":"0c67495450bf2df445dada5f2d2d5bc35fecd5ab","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.24","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DjvpposoJv4AUx8HAoL9ksYmVxjuemzUyMksUtU5BDvC7lUtIR3VS70ezcPefBDlplMAMauWMJtSzM1saTVJHg==","shasum":"3eb53656494300b0ee925e96c32b68c9b3039e1d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.24.tgz","fileCount":39,"unpackedSize":239490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OpzCRA9TVsSAnZWagAAY4sP/1X4rz3/1qcMACnI2Nb7\nLvs9zmcdgmkH61BW74u/qaxWxUJVzvuYWx9d4EiqIgFZATme/064xp3GezCI\nJ5kTLpqRXT3x9fs3oHt0qmUOH1dKoh6lm+MS0WR3xPj5CJYmhztJYC0xguCr\nlQpBHd2khNvp1NLRkFGLKC/NaGm1s4XRN33dU5Xlt2PKe4lcslJfaR4v1ufj\niRKk5RAPzlIP45nxtXVVrnwJFkrwIxey9eiHn83QGRFyX7QrDQEYU+8iS8cY\n3eoz5eFZP0RhcroSqvyzOb+zWY9NC4fpKAAveUjM8It1wB22HbYIV5NdB9i/\nHTFu90aLqN+mLlbAKrMFBYBOGGK6ekHXGCF2N5fXiKWWE+MvVd/NGzHfWxMl\nU+bZ6Vu0RpMVIvmq7x9phs+w5l+N06xGYFhjAqbuYaViK3abF1UyLczVPWsT\nqHwXq2D7gSMLjFF5V4PXh5YGrXmcI274HkSQyMfZ0wK7RrK4ElhCdQtz4DZL\ns2KZBE28Zr3/k3n+nTKbYzwucODXgW1wLSyMpvyWQp0h1GP2tc2bBtFnCAc4\nzIj0Vmg5SIfsy/P5irA/boy6MmQzQXJ9mcaTOPyg8vwDn5JoXJIKcq93Gr/u\npOcJBwvvLmuIAr7adUVflu0eG/yDPHvpGeBHbBrpuNfqHL9VniW0gmjGmevw\n1paT\r\n=aDS7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpXD0BgvogsaVVa243ckPkiBxtopzCmuG2WGPqKuAPaAiEA0doBEXclMRe1/OQpZRYhzk2lhitNytjy+W9rwI8oHck="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.24_1608051314395_0.9660129822833696"},"_hasShrinkwrap":false},"6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0c67495450bf2df445dada5f2d2d5bc35fecd5ab","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xghgKISMJy4C+U2UubLyoO6RJ9ZWAaz6p14ioh6cXXrtn5aBnLTFLNzeZy6LinyVynglLxMfc6L9t4yABV38Og==","shasum":"4165f496dc6a37e6da61e6f2a76601137b654768","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0.tgz","fileCount":39,"unpackedSize":239533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OsbCRA9TVsSAnZWagAAR4UP/icPnbeK7VEmn0DycHuh\nD6z3DeVfFF4oO4DfmT4xjzYKaxIG8O6pvDyuGxc4uRuCGUpsU50+JzpqjNMh\naqnjUBXsBnBQ/w0iCLD4dLxCdL8TM7pnHmiFv2aGPfVxL4XT2cRllwzEG8L+\nGPxxKcD8h7KEGocKN0FPGY92eF4AzaLNdTI0D69ZsN36xU+W8UQfLSarfS3e\n8pIcoisVcrsh8q17MnkW3VF/mWMmP0/SKM0RQ2JXmKemq+t9SjnBJgRgpL7P\ndGqKqPkTw0cNe5zIKcjGSmATby9g4zJIzq+HwqxwtVYHcSWLgvEbBaXyqHS5\n5ebQfSEqqjqOXZMwvbFb1agWY6FE6wpHAF3kzbihFjfU9bAINRTTndtCKHxL\nTTLrlcBkf3mjYUMQXiHVVUhdMLAyLdMq95OIBkGz/jkjjKfDhlvcy1nYyZls\ndZR6JOZ6mO1V3mYzefDe0hwiRjlPQG2OTXi17E82ZHExNXgmcIEOn+qOHU8e\nNtMHK2ebJGGjjWQ63SM6p8hlVx5hVYKocYuHBZDzFigTX5hSWOF4oiRWT9/+\n8Ew7xqSM4XSyzV0WFocUwjsi62zwLK9eMhtXg8PikY1tGnCOQIGtngW8Qpgw\nqPf0UBRScSpDC/oyIkcQT2nfD6ypIljj/dtYucun+Bv9WK7b9jD7mkiJpo+x\nHs8J\r\n=BlvY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8ps0RZyXuSZM/OaaTiCVUxH9XML2zynWArKQ2hwCoowIgMnw2wF2OVIyuNqBkLJL00KrXz43x1Vz+nK7McVIukP8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0_1608051482580_0.03475151242722663"},"_hasShrinkwrap":false},"6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.6","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0","gitHead":"e2cac5dea07713cfd65d7c144590e0a05dfccf7c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0W+ykjxm6lXGd1d89o+JLiHg+sxwi1+fgAniWf6Pd4PSYysaSvWj+Ppu9wmasxb0d0KG/ZVVGjIYbegizC1J/g==","shasum":"7de4baf4ff071c471c3963b676c43b073b26badd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0.tgz","fileCount":39,"unpackedSize":239533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OugCRA9TVsSAnZWagAAe5oP/3In/SQ2hqNUQ2zk/eBm\ncsVXhFuLm/T68KbVtrSE/xLB7SfbSIXm4d9WHpBofPYOdGdLPNtQWGoHtp9w\nLxIzbVckk/iATZsBkpF2UeSKMtdgGwB9iw9ZFWsKr540UGQF2Ur8ywwAmVSo\novOH2o0QinlQYBA36fR2eG2x4tJ1BE5pQj8GEH/+0gb9KGuVo1YPWMhqafwA\nhQyyGnUzSNnrN1j2SqR3ctYmctT3T+1N+TpVtfouV0Gi+LjZf7AGjJmOGQQX\nWCSS/FZlI5rJZ0uqGP22CKJf2D4062rnxQ329SFTl+NAAct6lStsNw0dgd7W\n16JWDToPxLON+Jibu2QXgw75IKarkYEEPHnKkeAbtS8WoEXafNNoqD3Mw0x1\nE2EBYK7if8H6dQ0zYa+cgLN/7SjSQuyfmV0ycD7M1+uhNP+yO7+4eTbU4cLi\nqms0kTHxAI9bk3hlJauSgqFk6I+MrjhPfinzIuvzpq3UnnOnRrwvCeBEVTbH\nbnPYJXgMJHtAX61gFhYZKoa5pyP7aZWmgq5mRMcHwXHunbobehc7eGive3Fv\nmhpxmcTp6yxxcpC/pN+PP/MSpJvWHm/tLz/waStuQgc61eGTMOyUWLFUe7EN\neI6CY58QBDxUPJ4VHvTGsJ9MXIToT/P57H3GHnLQzfEAH37uufbGvg24+262\njf4a\r\n=HtCx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoFEru/T/4aLu+J4i/AQg/qcwPO7e9GT0gp/Y2MoGoWwIgQuRQZ0+14yBGiF+HEeSdJ7ZZ70+CQM8o/6y9RkjLXJU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0_1608051615272_0.13483842387717138"},"_hasShrinkwrap":false},"6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.4","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0","gitHead":"04ccd866ff5299f65318a8198aab91b181ff2924","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-801YjH7uvgkPtJ15H0sVIq/eO6ea6veYOpR3ADFKzA/66jUJVm2Dw/Kso/B34ZmshhNLjyiwafdTvh7cRafwJw==","shasum":"a1d0aa61d5915e60fe775c399bb853ba54967888","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0.tgz","fileCount":39,"unpackedSize":239533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2Ov4CRA9TVsSAnZWagAAYH8P/3zgYDnQ3uFJsjblwQlx\nYSo2n4/Xj98gwZRP7R/dRl/qDyaV4ZhgzvkEZIqYbhHwGKVmp06WfDmA/l/X\n7rD5Y6lC9Yy83VYTYwU1q/00MRtwE+V2gpFpCYhQgKoHhfqIDpXnLzFTqRPP\nP1qNBHgN9svWXr/mN5ak3hL1htAECXtk9fIcf0Uk20edKrw5YYB9a8afwtXG\nXZXLY1YupqhTrA5oaTUqk/CEWUimYnPP3xck0wNnWzEySmd1X6+mQKhJPIrz\nKUue8PkrZ87tIpAd++iK4xRNEgxugrgUH1AT+w1vHO05zbqxPDgDanH+dEXf\nDl/RmL864PnOlIFeZ5c5Z3AEbT/J3P77CP5dVndeIEwuMYaWuhavqNCEojTI\nHDAo9GrPfIjwPIRy1cWaKa2N15hPVfjGfylR4rlXYYm/TW5+ukVA+Ft3mvA2\nUwxOhHeDUKT8M0O4truS6ymA7w1CgmE29hLGZ4K4L6Lpcf6qwuropcZ3FGyU\nX3Qa5JqUQhhG+lLJ/Qo/apZ7iAnHW3JFjl4qdoZxxdv/gTzZ4tweyZx39YAp\nty3SljEh/lqRmS6jlAFZd85r/dUcQpc1xJcQNIF3kDBRpm2FNyE0b/z9w4O5\nYTTvQn+dt7mjKFZRGA0Tg1bN2iuI/3zHjA0pR9jdQKzBTLM7+f5bjSQkL5W4\n529H\r\n=El3W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCecYnZxeuJJAnzh3LqUQOgaR9xuTGkelvzONGTvtEcAiBDdOWgsqbNUsoLLrhdr25+PHqAcBPIu22BBfXaIGsvng=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0_1608051703985_0.30040584121732206"},"_hasShrinkwrap":false},"6.4.25":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.6","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.25","gitHead":"aeb1fb0f58029de685f5775179633a3ae44a66e4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.25","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kICnYSYuOLpKIG+cFT27QvCXSh/Ovtgo9mWSDQwhXvb7mKycBbydrVCX6qjcl1IbSDkPISYnGfH92q0xnXmMlw==","shasum":"9f4cca51ea7111c03881fc6b29dcc9c60863b533","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.25.tgz","fileCount":39,"unpackedSize":239765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2Ox2CRA9TVsSAnZWagAAAQ8QAJG6XBBqDH5d9VODwJkJ\nN18GzxdOMsyKSth2Vtt3mfx2jY0Kze9NV+cH6wZFXdnlSjsTJVUcDe8B86mX\nAPJdo7Q6ZcA0SwlYdx2rbtxwI9MnlPql7KWkaiMIGDoig87vazyWCSnavd+Z\nU+g77uqGQurkVLNQ8cHXgjmISq/IXipjQlsQi7eC3ZPLbloSw4zEYt9LXf2y\ndktQP3H7db7Q0zL5/F4vgthJYqJB7Wd7XX2oh77J8OpPC/iOwmXGb8/aIaBo\nGux9nMr9ODF02+sTxzu1razt2Tx6g9B/ADyk4b5kOe0Zmx6oxJShmBIOZG9N\n65QiSjaA53xy4o4xTPush/IxW5SHW5vXKkHrVSTwV1N19Q8InSvgEMjnxNAl\nlpocgrqcqlQL3MbkNHHqKtPAT+92FWMhuGlfE76sUPTiCNlE3Sjgg7FqolUU\nqOLOA89AS9P1zRnSGasIGkAkM1hB9so6/ICqOar9zfjr/02sS2wIa9UyUGaz\n27rUZ44RLn/irEmzXVONKnkf1kLYlcv/Kd7iWiLkKPWj3lhZSyQ9CUIVubFq\n0nITk/OoaWks6SO+UyVay+mkKMED/3izWLdCRiaoIl06GA1gf/P4lg0vmPML\nRUSzYM51uCJ1dpj+09OXQIqFFfm/FuNJrT1IkBPeaILyQ2Pn7AnajO3cHeDr\nUxWn\r\n=SuE7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0FvEjo7mD569Wk+ZVVmeIbyOFbnOUcbHE82YmDn8MDgIhAJjz2nm760x9ATieFHTSxYx/jCmel1SxFvfN7Db0yElt"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.25_1608051830115_0.2359394442265288"},"_hasShrinkwrap":false},"6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.6","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"92815400669eb8a4615c919b80ff3997011361f6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DVMJNwKnFl0w2AmTD/N7z8opbIqpdHQLeiX9k/oWvwy3k2mcKK6t9X7h6C3Z+bJD4Ehzf+RTun10nax3EpVmew==","shasum":"508e366f3a6236ecc6f9a51133674b28a6058890","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0.tgz","fileCount":39,"unpackedSize":239533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OyGCRA9TVsSAnZWagAANw8P/3k98tI4i5XMmMcdMN08\nVxgiIoMacHC7JL+19+gT6E4WHeIXU4HukBR5vmMUCjnFK20cys/FE6478e6h\nEqpdqhGru3jhYkZ8Drzb3rJgmq4RriuLoVfPbCT4vNphun87RPLDhWLbbVpP\nVIhgaLb9fH3oEDNjg2ghVEA1pKI5+MIogBd4RvQ/X2fR4QbkQwGvyb86msy7\n5Km7ukHCEyeClqMiul0W4yYFnntroDJpcj/1hlBulbYbh8MJSqfiXx4rLVsW\n2m/eQgWz5FqcKplvzCuy9pIIqeNTte1zX0rJ35iWpb25qCBxJAgMjiZOHl9a\nZAdsU08/9dSEhVVZpeOE4HdAgVp88KVdyMIyFvkKs+ctEBZEcVWR4YNowmup\nceMeu/hak+tTOVW0baWHMceVcoHAPCl5ff7Hlv/cbhmTCfHQe5vXtx4s56tg\nFkWK5Jhcf0CCIgAWLXmHsiG+CvVIl4nSP7fTM2PnL7rNwbgxqbbeFDrv8PKT\na3Qftl/2xh8dZhnip/e1a5Rev563xetXUYY+SU7X8zkW95TnoVPB9an7tAkK\njZCjW/QxBixlxZMQ8mBDDdcxf70fxg2/F4HhzJQC+Rkua3HvMzC3l+DuulkS\nUh6SH70su/065WdI7ucG5AqJjU9ANqOdpN/11Cc8L3gDlxnFaR2Gqh4iFcl/\n3W+T\r\n=SLGh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9myEJXemP20TEJjf75HHq948D0X2hU6ibpEPcdMWndAiEAjGmM/31MLbj/YO9tbEFBlstF2QvBMuizwPmshaNEZYM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0_1608051846122_0.19585708338771757"},"_hasShrinkwrap":false},"6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.6","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"aeb1fb0f58029de685f5775179633a3ae44a66e4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wsaefa3237/xPkAvYarDQixL4m02JY9rPZp1/D3Alp2c3sr0OJLcTDx8tNKFHcJBonKpNnusqm84+GSnXhUSXA==","shasum":"8d2518cc84ffa6e5de497dd2b8627e8b4eca742e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0.tgz","fileCount":39,"unpackedSize":239808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2OzOCRA9TVsSAnZWagAA5CIP/0fMm3ivCoXzTruSMyfD\nABM2HC6IiyU05gjggl++IFOzlqLNaS0eiO+ce/OSRK0f6jwbBHgH97jHPRBR\nvXe0jAuYIpwY0TbRRnSYyTf/BACoTnGY86S8D1qizGjohbSMtOhfhrX8jIlR\nmp0WjNBdnTe8LqH9+2l21kPKnitRWq8eoUMNchXqSpZjWQJxdCnQkOzTvNB2\nOigLfEGabybCog4QWogyn6CFmax2LUuGu2o7QbPPOINHXlJaQkMR5XQCaqwn\n9JHJ+XCRZ+fAlIVQgRs8hTjGq0ycR6U1KeOv4R4w1m9r5jXud/TGauQZEl8Q\nTKAWmwTYj2tZMVbek+EpD+ZJE3v7kkMZSbdNv4+1TKgr+D7acysNyCDY0egv\n7oAUJn5VYiN4T0uPXgMp8n38I4v3GlmG9VBnNNqdnOVnElT0ybwEVqo1h3DD\naaYTXVbYqqjdVHQuts7uh23i008mTeY5UMp2ibuvD+oSjXSuJfBiKWKOKdUe\nkDPfD6qAjBx+LMYBWWgetV7MCG5MRYYDFKs7QUlsboKkhi3+cAZNRXADzuPN\nnOpf1AtxGUgDSzVMBD1LZsKAECqGmqJ/Y2xOT6CjONguKSjcPnXj4Oka2CRq\nQJfRYwJ0L4jWIuVbwgamC9MHdVo0nrvTw8AKBbCFxJsEnOQYxif1fYyiJhrF\njo2t\r\n=KvVl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTlYWbcStMJP+sDPV7D+ToTD4HvFhv/wndqk1mpqXJWwIgXz4yjmBOky0J0hfiC61vaQ3C55B2pFimVL/EP1LJhws="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0_1608051917750_0.5438653490445005"},"_hasShrinkwrap":false},"6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.6","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0","gitHead":"f5582fdf9490f6e1d615040cf75389b7a219a676","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jc0kYnWa8ecUnqtOaXz5fGUsOi8KtfhWFLBctbLfhV8fTqVVxzmmzNIgMiTgGDPx6h/SUsKzRxrqyG9vtURBdg==","shasum":"4dc42056cdfc5ec93d941444df97472ff4a15e4a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0.tgz","fileCount":39,"unpackedSize":239808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2O0TCRA9TVsSAnZWagAAo0gP/jWXK8g/Fx+DwF6Az6/V\nQ1bnmvv4wWLd23mGy21yDdDJB+/CpcoPAQqUeWgwuqWnATUpkuOLGO2WFL7X\nKErsdpd2oeb2ynSr1sGbm53K70yoeHjDhtak5guNKyPMj8Kq7rP5ULMROvEl\nHedOUA0aP46vLw2+RoXAwD/Jy/Akmp9MjVf471W9YGo6DHYslCebvpZNVtKG\nufQcUYdUX/aImNYMUI1ri8Qt0kwRFkXs8YRU4MvCfarLCKUDt2WKp5XV9ve1\n7WISxswUdcZF3EvX73KS++t0lbpW9H2D8aCeRpNUSWhgquXgDXEpNiOwX+L6\np72VL+8berkvDXOvgR2uRTSAed9I6P/NQX8ZqhUQYxCBlRmfkCY+v3Ch8kGO\nxZ/l8Y/f50PXrbV1oy3EbJa5wxGCa5sxjy+1O5zZ+eNxDJT5jTlCWGg+Q7kB\nG8CRZOfYG89OYGgkmXq8+eWAG/ZhMwZgLt9H812695xBTkeKJiLrUcM8DvTd\nkCyh8OsOnm6T4zpBdDWpTlwpHaeJN1cykkaSlOZQ9hV8yQyqnnJWBXfgRto0\nDM+DwTs6YsJISl4uBtuuLbuNy9j/DG07rq4zmlrkN4gDfd3/j+JCoxo6jKHj\nE9TKGN4ss+9wnYOMbGOUJGwkp5ubGOrQbaPL9vtusZbwtC+ztwRz/bMo4dJL\nE3g0\r\n=Ijla\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGUdfRBCZTnXiJEaC3upGbvBQ9NjN/q+4+ssaOiJUwjAiEAvekuSmWkhuyo7OFA2PsoR6PvSxihHrUUN1j/yIwbNA0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0_1608051986542_0.7947598512150134"},"_hasShrinkwrap":false},"6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0","gitHead":"f3a96eb5072710fc8ba439336a0c192ca313cf4b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3tdExNglo+t+/EIvUWBid31Z5nOAYKcLR5O/9WDMX4tdZBazR0PxS+FHtBeYKn3R/W+FL6bL7tLDmkbFvMmksA==","shasum":"ab663bd4a31234521146ab99159dd4847a0e06a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0.tgz","fileCount":39,"unpackedSize":239808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2hxQCRA9TVsSAnZWagAArBcP/jGA7zAlZFjEJ0/6S2Sx\n1NPh+0d10Z3sj81vs8wSqtwSIQMxERHeyXhrDuu6ijmG2UqlTUmgeCoBpKgH\noszQ42Os1XemvuSC+31lS4dgO0+Nz85+ndoTOl4o9R+zQXafv9MT9PRPyGYP\nZDdExvURkOKq4TWledKoaxQKAHtyxAB7rVtAogRz2bBQFLq5LnntkVeaGuiV\nP/tK21941G/0o1TAqd6fQGzKZBsrPiYPc1g0hSsCj9iruhYpYXEAcjYPMEi3\nlhzbUkL74arlkPalk8D7E+zxDrwOsSdqbUtii/B4mV5P5tGf+TqoyyYfixFi\nwShvFA+2LbZwjPVpH9fywPRLYCgwUFGTneTqLy24AU7HLDDak57tXEiJF3U4\nYUCQUizTrq9CXRZcGKYCQQ8ahTxK+9E+dHlXZRtt5Uexi+64Vnp7AV6K9ii6\nzHv05N6SlufpOpoqbdS9iitSQ29NY36Xvk/6WLn4R4F4B1jjn3gZZJ9LohWj\nXY7YPzLImdOGpH4kwVBHLf8mxY3ZR+/Z9LsnEJDoe2py9D8lBjK3AxkIWBvu\nf9hBe7sePdLqiOaXeiz84PfytKRcr0nTZN++g/jHBf1hqpM3Z6M8Kx5K+rhk\nD0oCXjNyj8EY2lURc1zO0aGXI+6CzGZxklA9jTy7SOyuHipIwVAFSrm+9gD1\nc0gn\r\n=BG6m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI03KIr5IKrRvQZLnX0UB8+sE3UnaxsRP7soHEeH2RXQIhAPy9F2CbC9oPn9hz+NCuadlb9iK8HrhnNBg13JLIDYlE"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0_1608129616091_0.0009008242008379241"},"_hasShrinkwrap":false},"6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bf6800d5f8c5ec80425ede2ae6e149b3d7221475","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-13is73YMIrNP0o/C589/lozc8wze4xktXhuLJs2QGZZQNy936DYM4r+iTFQ8ru6rT7VU46toclQ06XQQeyWvgQ==","shasum":"8c78cfdebf6cb719f5a7199ebf8a1a6f1456e8ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0.tgz","fileCount":39,"unpackedSize":239808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2hznCRA9TVsSAnZWagAAIPQQAJYbiN1LBlPLZxZITFbd\nBrPQeslJc6AU+hfzcubaDTBmWb3PsYCdFUxrjwSrxI/zq588gMORB1w6t0Gs\nrE82XkA5Nvuzk0/mxyekF/jKiqll9DmOoq+GMps393T/+9WIuUi2bHs0unOO\nY/M8BKX2DK1EaLi8E4yENQzDYHbfMEzD88M2mI5vEPxUhOTx8khwfmUK6v0V\nYZDWZkIEJbF+kOgOuqJB5HKzQj7T381D7P7TRYy2whuXE4/2A81NOAyG8TWL\nE0+wCTgU8fARMi41xn6DMUrrS+6cJBinbczU7r046vk/ytyrx9AF1d9Xc2yK\nkaR/kYxDbG/Ebg3RUZfO78RwBAtRz+HIb5pSOYExhp1S8GxJnA+R4sjG1XzG\n917PiTRmC/FxVLw79zFd5qn8dvNrYuheRP+s23tGfgIlUKu/ds8Ku355M0NA\nAFm0Sytxu3k1wqmRQ7T6tEMvey/Oqk6ZH3fUhMC3r+dPhV5hznCmBOueqF7t\nFlM/T7uap9Vbjlu0m5y975HkDp7kDceKyPLKJ1vX6lUJw5/MM1uZG9gpafm0\nH/l+5xrdKI21MV3ixq5YqwmgrCTXdZ6IlQmDu5+mamMKwySpL2o3CFSEZ61R\nzjz16gb7/9n8RffGTRSaHyu1Vr09EAqNK+Wb1mfLcU7RtOBkTMlKO8bAu5pi\n3OiY\r\n=rRoL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY0VUxA30hjMKEgFVOAM3eEs8yO2adhwHHw/yWcMoeiwIhAMo14q8WJSf3Ucaoef11xaPwo7jfXXvXWoeZKobVqBMB"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0_1608129766967_0.45635132426013847"},"_hasShrinkwrap":false},"6.4.26":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26","gitHead":"4ddca1e7a872fd68099f450d3b1f214da1de9541","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DinBXyFYAdREuGOz2ccqE2oqqzBOvF0B/a2mEynlc6I7xGdnsNIDpNaWJhGpSKGaGrK5gYRW9gQKyjJTMzEPbQ==","shasum":"6df3796dc30e028f56f9bec581a1504b9f0d153d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26.tgz","fileCount":39,"unpackedSize":240040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2h0aCRA9TVsSAnZWagAAEscP/0y0OI5uMIP1ep1uAa7p\nCMI54di9gAgnzUGOaxU5/xlaFAdovu2VCYouaHbQy1HnsNeeaMdBs1LORgO/\nGWw2ZDz2aJIET+9voMOJ8uGLAaV+bg2POH+YFbie7+Wc7RaCA356oQWjAfwL\nZkrwOVycEgRcBEXxji2LUnPVLaft/NxSHFCvkKve09RuAuCbZGmd7wK7zSe8\nZ8gV1DdeDzdGX9p7pyapEBMujoXnT1/WAIEHHhCKi/LU5EoBlQDeC0SlUY+Y\nBOMDIpJh7kVIY4RniQ0Km+a7nh1FKmgAx8r1q0ClTeWPZMpNl+FIt6+eWyHT\nYoJaFz6rq2HJkAoB3udTLiU8CFnHc8AQo0QPPdOkDs8P8wZ4YFyZRSDrnzPl\nToWvT7fYqswfsNZSO0O2qeEXPH5lc8Sz6+9ON1wdQ/i+l3T01WY6OqS61KOs\nqkrqbQTx8AQFfB331vkqMArrlznNuFg5iPEzHKxtON2/BWuPhLGW6Bh39qsT\nM42GoC+KUyqLFqQJmcCIs7EwzBE3M7TQPfEcbAtwTLuWb5Kk2EokM8DbtsqY\nEPSCw82D42dnhargzJBP+UE+50yQIQ5NZ+xd+O+Vnq167kxDgssrZW+4AsWj\nEC+ZU6JvW5EqYZrqJ6gxKvpZ3xryM8QA6VPzk6TrMungM6GqlDWknpyjpsUt\nI3ZQ\r\n=QH6g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAarhRRErN6nn6N7bNn6NNM0COjza9WgF0s+TPJA4cT4AiBfoBLY95WHtX5wtrQemezyXKvNCyXZYedKuMfkpm0aEQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26_1608129817476_0.38535792585105555"},"_hasShrinkwrap":false},"6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0","gitHead":"bb1aac872446166c5f1c8ed18723a8e6f457e893","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SJ3t9Ee9rXdRmVIwVRORjxwsptmgT6JCTWgzCu6GDD/oejDQRirGi7EkQSAJjgL+kqAQS4GB5YZR9E6z5dbTVw==","shasum":"59a8e1fda29c7ca06b45d5cf92ef43d62ead85dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0.tgz","fileCount":39,"unpackedSize":239808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2h2jCRA9TVsSAnZWagAAE9cQAJIcZM0wopocupIqlJi+\n6rWKhdteuzQAGEvEAwlnFwTrskW9lCoUOdOKVlccccLIB27J1W7FVQjKD1pe\nrQTSbsoswjmXSqYtsYaVlnUgClNxcpzxTMXQkF9T39MjFbSH4vxtQZmNJOSD\n01Xghf5SSuT2kgQKyVrOuibKFDkBG89LacS+4nAfoex/Quap/4xKpq2FW+iQ\nrJF+YtNRNl9UsBhRrRf34v9+y4d8E4CxMFxxSITWduj1ya60WPJnlv5DIzIB\nIHhHn0psbssIbgXINTuy2tHL5s19y6LtxcIImeZW1l17m4R9/VRYUVoL7wlc\nVdFoaG4+xQ+ocrO81qcrCmLFl0MlNdoqM70b8J69mjbcQ3YvWitTGwc9Vrsz\ng6Qw5V2s88VBTcRlNe7+zMOJNX0kYmdmFNa9l6rwJcdKzmxglfIU30a2dsWd\n5DXUDB+g6P05HKlD6jRMxDi+EotFV3IF7Ac1tdAT7TsnzWKohXDn4XkzHp0d\nqNdi14NALprfzaQYl3Docne+h6vFjizBI1Xv6v7JwTVjSJQ47iHG6vQrHYhQ\ny2Hp2dqquMNHSfduGcTAkBKmAgo4U7+ZNwahs5QyBcyu3ivIne5PelLiRspG\nk0gJ62fWl2g3t5iWOX41PzBs6cAktTIXhJRZ1bD2VlUvgu2khyun359oWdJA\nMxIZ\r\n=I2lj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7od38K1izV6jGSKV3DMnPIdNXNqNIF9ceAz1f2tFa9wIgDORRgLXt1c4EUaYOyyMyEU6zNMSCDCd31Ab/omysbkY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0_1608129954940_0.8585716576803921"},"_hasShrinkwrap":false},"6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ddca1e7a872fd68099f450d3b1f214da1de9541","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FskdVL5Kkc9bmS/WoGdbHOyqeSHXOXTvIPN1VgZIiWwCKHDLFhrd+dhIycWd9JDV5uSYNK/Scu0mgJcEqGLezg==","shasum":"8113e4ca4ea8bf06918df622850c45612d229234","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0.tgz","fileCount":39,"unpackedSize":240083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2h36CRA9TVsSAnZWagAADsAP/091F+NIah9bfeZ8/F88\n+VnuQm6yJZawF1kECFfc5YGVp7FYqTHC3i+eM3tM2X161k1dn5XRVUCd1fnG\nAjjICNgLk08RSm2EJj94XRO1vODV7G2IdBw2R7tCAF7qS1KaZiBteEIEDXmq\nNI6SegqQTeMVTI59HLeZH0c8Z5PcY1y7FHMcIWxnjMfhtIRkGsDxHlw+xDYj\nT67Nwib05JYwwx1aQCa/amk1I4FQ19s6bA3EycGBaIom682tP6gROPCSgjLE\n4XB4dYqrySpJqHxYCBXcIQqwdZrTtd0lQJMtHBO+KwIMBFkILjClIdnfaGgq\nkrCOESValNowRiaE1ZDOIxVMFVL45r/ja40J0lWjy2TePPAk+HpdpX8U48d1\n18ntWLNeWhxYMBJtH1q9w4CNBmh5EPx50e+sBldDvjX4x5rULVJI2QZ1pvoC\nN5bq/fLemiSPmeCu0WUSAVIpT+QJDVj5tA5ZS0cjOoKzO1KUEgQX0MeGsqrP\ngZpetx/jVL3c2N66B62BS2hdmZPl3uIH8XOhJYz/QWSxaWCBTOmHxAZibg8L\nN393QoqFAhieYaloZpSB4qJXGKiAQGVyTnUzfIGtbgJA9lo8QxI8z+bwSgRd\nbSSrnirMo2uDFdBaQaVml3gM60RSmvMm2Nv3jL+h+sV+NE80i5/Mn7XQyy6S\nH4Oq\r\n=kenZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBqOBFLg9ZHHAgO7KiVhL79GgWrtsNVeblwnf3oCM5M9AiBNv7Tw5v7Q0mdAUJbyQ3Uf0gzkfQYL7ne4GTEsuczFXQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0_1608130041816_0.5531980466484201"},"_hasShrinkwrap":false},"6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.33","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0","gitHead":"78414af83ffd62881d29b9aefcea4ff51a2abc69","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dnqm4lko6doYMJ6hZhGl0Se4LHw717G2zt6aoKtnN0sAY1Zcki67glrK5QIKHSVeeW1CUYhvi++OV3ec/IJYLg==","shasum":"2657439311b5b50bcf4723c6e1e64fe4edf650b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0.tgz","fileCount":39,"unpackedSize":240083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2h5GCRA9TVsSAnZWagAApckP/34jCrx00ihzIAG9ry8k\nvv9ZKDxCkDZPzGdIwjGzhcj1HOxLquF9+rSpyRjv2mnCUgjfknNLaaU1Uhj0\nE91BrlMf6kRCfTxc13K0BheIEL9tVZ9YZpnIHSAibdh7I9OXv7Yfsku1AU8O\nJBZo9oF/Di6zKle023DARFLhgdanURFOGsFZSkEnTDVwN5ARCxnM2q2ZP6j7\nHuk8GsjJQNtXYSPXazjb8L0D/Ygx8Wf8QUX+H9oownRzj+1xMeaw7hYZf9Di\nmJsTbvcQk9I1faHeyyETq0ps9tp+tNFRCbKZDuNFaCows41kWIkTFAGdJ/8+\n/ynDYr3+35TnaGzSIM0uOQY5LPkn+pHddpqZSt57Vh39GKyyfDp+wA4qeKxS\ncwY2DmqBVf/Zf7HXjR1dLCbpAS73s8SXJCQ9iwzzZRq0Oq59FfeTGesnGJXp\nwl4NaGBE2hpgjsRd6iaNcL+nRi73ADvyOgvVUkSP5+kcMwE4Vz7cNV/59b+f\nI1VpWjipORjNbaOKNaebjHZfmE06al2kSY+lum7pEkx8rhXBQJ9Ayvq0aAHj\nrZAumnQgpNf8MP+uXYMkOyyaQ0G6mLaG1aukPpGtiLZmsDFKaYKqi/vsBkuI\nD9KbPZ+YhYGNdktFd4alq3LzTgx4vYEsB2oG46h9+P/JVoBtSmK14S4uYIcq\nfaXE\r\n=StTc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKFcPak2zEpBrT6Yee2JAvob6huTiX+TZDKJirAGdptAIgSmioJDb3/rHYc6kLWxiGSQgLjsxopQr4o0bFBPJ5Qyc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0_1608130118458_0.9863483730562712"},"_hasShrinkwrap":false},"6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0","gitHead":"10973d81841fbab85c9357174ff89d9b8e8880bf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OKL3GBrUtWJT14dSixI4E2zmU4NBRgPfvKyjqSvzN3MKLtMR8gE/QGqFozBHxkKkQWCQ4omgGpnSesuuFMJahw==","shasum":"4da7e26c2db9dc0be7ee9bda31057c6622ff1d4e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0.tgz","fileCount":39,"unpackedSize":240083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2kSVCRA9TVsSAnZWagAAsngP/2IbOySuN0HlSd19YmRk\n7O6exsUfx4EqzH9JAhePEICrCIJq7ugVul3as1mbs2lhHqJwd9dlUFgtzQFY\nQ+dd0TqkiIu64O7JFmMzu6/FJpcRrI9RKFd1pxGIG44x604L2SA1QOZfS2P/\nGYR47dsF7qRO+SisH+L8E9Uzm2L/0p6KCPKNMgBj82iC+QM99pm1fQs39g4K\nBEUSboHvePXVjnxp8Y7cD+WmbvnghOWLiQpXQbL2JE5nIpRdderVlj1SmbtS\n7xbbJ86p5TNiPA3s0NUjMCuQD04D8y7DQE43esa3aUOpORzOaWXtjsW4AbyJ\n526Wt8sAfEx1VBN9ole6xb61xkbw0Hn+tGJiN+Fl/A5vmFiaTBe+1w4ZgseC\nrdXUHaumoDQCTE6tiNy7JuWUS0th+ZCYWLFoE397YF5Hkqm7NDwUOy9MjMYj\nH7Z/xKIMrcdazbgyG2T4L7F5wwzcpQ/hbk4d6QTDDuc10jQBrLsLjC9CDUAm\nLgu/PEmG/KxQVEqAvuC298svd5t0ESd5b8kjg7jGNchgG5+auWmFiLmS8uyr\nLHm/RPKGkdB5B8V5HXXeylzC+byUn/VAhdxAuq3V5/cgBI2tSWstPotMulZm\nNU6u6ANsFFIJAmq69+5nJN9VTLnbfC0rmK2E4jQLj0BewS/HB+SRxNLakzNR\nO4aB\r\n=nl0S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuecqzIQ7dZdHAcHN3dyBdoT5iUu8ZkcGMjXcLKcT1EgIhALxVWpTnlFSJYqfj7BDl5glAitNa9AjHL8GDApo/gDLr"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0_1608139924472_0.005435106873062923"},"_hasShrinkwrap":false},"6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9da5396143b594fde6168b8023707c01b3cdbf99","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wAMpxZDN+9N0f6WsvS5jo1kb2SaFbUiNbJtsOBozWOxpNXlGCsoJpNfgq9cQq3iPnDhRGs2Ice3nc++5P+XBzg==","shasum":"b5ce17ee8b00bda5b11f328c997778ed82ef4cd8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0.tgz","fileCount":39,"unpackedSize":240083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2kUDCRA9TVsSAnZWagAAuLgP/jAFiecNeeaxDDjIUPs8\nkq6IY8bQSCgcfmY3UFk0wdw68XLGG43C0K2sfn9GrnO9ZiWNuyNVmes5MtJC\n0Fvo3vEozkr0CJZ0Q2EvFFv+LgvKqR3TSLD82WD56f1c0a6MUA9X7Flye67H\njyhcqBaitCaps8xaRLvbaeT9AsuzcleL26bBedyVWPprMqWTuK1pVH1FR42O\nw26ru3r17x2Q/JtnAxoVO+6ORjmTVRYDIMQJX2FBqEgBsqu581qwPNzgvUOv\nS6avcM1GvyhW2ifgcPf74nKmeBP5smGukKLNagvRAtGuhVY2W13G+quWQpap\nGNz7vjS0PmeHYU6pMQVE25ejsAwtgr5Hi6n4ef2xUZTYzYjKxs1zR7IZSQ9A\nWupCN+8bHaUk0944cycWT4NVCKY4Qa3G3zxWeZky2rhny4zoI2TjoSo14Mmu\ngkFscgah4qCRoKY3v3DVsPkaXVr7ynoZV/9cK1QRkNajnDAajlIi25rtDERF\nyV19w/3/stjY0l5nnzcw2LaaIYcUp4cCJ4zF/nhC17jqSWraaNmrGK8J2OW5\npt61LvpR3eI/yOvd465BU9GX7/Qx9fo93/iHJfmnwEQeykUvmtYKfA48at+C\nRw0MK/kTX0JMkeuOVxyRruQBJYW7vyBtokfmH+rIoUXBC4Pivv3FKwX+P1i/\n8Zbl\r\n=W6b2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDULNT1oCaPa9u3jibsGmsdhzNoXBY4YIXeaBdqV/Fa6gIhAJPnvuwp0+1fMtS6ObkxWwkzezgfM1jhUBQLdJvZut0V"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0_1608140034457_0.08038750415361418"},"_hasShrinkwrap":false},"6.4.27":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.27","gitHead":"1b335c5b1360309d7450bc2e109ff52d385db03b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.27","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vidFgiNZAqCcR7V0DEiMxUkigNdcoJ6cPT0lephxVxVcOCT7joea1+fysdwW5MjXYr+dTSutViwQZWxbdtLmqA==","shasum":"98f8cb5a12be6e200bc19d97e4d6e2017912852d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.27.tgz","fileCount":39,"unpackedSize":240325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2kUUCRA9TVsSAnZWagAA8hcP/RuSRqo2qMqkxrQjsPPM\nRBDe4wAj5OwC2jRS5L8T4pqVuPAqzxxedKgs4mK0xND95Jll/pRtGiE9GNNN\naKkW46GbLIV9w0AFJR6kNRcKyFB1ulseSu2lGqdXT9Dt1p7KgSf6mjuML+VM\nQE+zOc1Y+teM4OEiScdGDekkHPPU6xiloTPZEhD6rWu/yr25vgE2RPGuOZRj\nztj1USICr+070xR/rVLfwa2PlmrQJqZbDVXcf92fnPV43qU8RKB/3vrYVtnr\nql9LFEsbz9m+R1u+i3qEaNLPSp1nc0Z1uraJeJn8XeV7apkrKr10NDlRsvug\nQzh7tViFqs+MpPTfg3hjlA1a7aPpupIA53TTMdldux7UGH9P6hh/62HXBuqc\nVSKsCp509pW7dRCTHyXLs2M/kp5Cclr9RlN05zFJoS7zIGpR1bWeSxlhack/\n/nT6ePbpnTmpbx2UDteepDcrtxwrEcyiBfwwhCR+Xzt+z/qsTLtNntqLLKJC\nKhtAOTPS5oj2fmCOxCIPjRr8KTzS6KgYQTmU8Hb4HIuuDj7I1yQWcZMM5dB6\nsKq0tBqkpdwEl7YIPhUjNHRkIETMFK3d1JRXb504Oh/Cw+nIJhfGXZGMOv7I\n6VeCQLF85KP0DY8KB7pkbVyUR9LckT1xSzcBO308gDe8flhG0fMCZJ40Us2l\nqyxK\r\n=xda6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDu8ROGVzy+xkb6qEAZQjMkaBS+/4fiQCVkM64AMkDzCAiBjB1BEybbNyLP7OnJTwVk3BILsw0JUtVUADO8ibYjTZw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.27_1608140051548_0.4272624566313843"},"_hasShrinkwrap":false},"6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1b335c5b1360309d7450bc2e109ff52d385db03b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VMoZj0koyloiGPGB8Gn8zpv65VOll44Q/4O8fJr//SU+DfRc8asy045dpHpHnIqw5hEPf/ifkbUmNrPNTnRwgA==","shasum":"e537637cea3e62fcd9f8cbe99451bf2203368162","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0.tgz","fileCount":39,"unpackedSize":240368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2kUxCRA9TVsSAnZWagAAiRYQAIrX9Z6VAfH1vDNnwBWe\n3P+EUgQraLHhSvgCsw0fbQf/V5duXSesfy9v+UE2gLMukhK/uRnXJAGacUqM\nHp9e36ewtV8vlBFl1PFsJgabvUXQ/oH8gHlqLbSTdClbnNXlNVbuPG5Law5k\nD3BsX19zeqRL3UOwoubFftktJM4JF+AdqgZ3SAaxcwehJMwyFdGB4QH8OIfh\nLGrs4fdfmajZF8w5MygX+UU7RPBultY2XsmYVGue1bgc1F9ZsZBQKbgNz4rF\nB2pAsj7od5tEmoMHgE7Z/XoaEcGpGuDqDq6rnD+AqTn9Io6/IPyDKBC0e8jD\nq/XBSYyKwiUamaCzy+CJ12MxuF+7rl/e1baGIp/8EhAoFq9q6A4uHRNzaxVh\n9Ifik0Aj96y/G0vk7MnsHPdqqo4ylCcN5Db6eum1IMc3o292jDBdCmH6yUj5\n7W7mVzdxdvhIGhEl5B44xlVCdiaSvv/1/dd4IhL1lDGsZjpcgWPlGlXGLhLs\nLkm7FrDZlN8QmM9qviulYajhkNGXMMNr8PQpaZ/oNHxdtdZRsvSqzuEHodoU\nkTdmBq+l5s4patnATFPn2DdBSTlERjsg3f7PvmFCx/kDw0d7guNGOqpSzThg\n218JwiFjY3TdhESXZ+k0xnfQ3XDCFaYPu7m7Ifw8SVnlYABy+KwdBs78PJWa\nzq0Y\r\n=2fCp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUOCigDYmGwa/gBiNmwDOqtCD4H7P1XY3aGMhcbJEhDAiEA79m8OUcvSKyOpwZ6oFmYDX54Tketg72+GVsr4kQoGHA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0_1608140080898_0.12469463784993029"},"_hasShrinkwrap":false},"6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.9.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0","gitHead":"f70874a0dceda3c3f1bacb0ca15d4c212d2918e8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6QZrhMdQ61KdXXmTxyheE9SbtwLiif0vTf1S+7ZtjMnRx0J7b64OafnSNxJw4hZd1WY/t9OQUgmtJQQN+EKTKA==","shasum":"c596af8f70254672b8fb7fd1d6eeaa3f033cac17","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0.tgz","fileCount":39,"unpackedSize":240368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2kV7CRA9TVsSAnZWagAAD5kP/Aoasqxs2lTL/Bo0KlkJ\nvgUvQj8gFgudNld0FucUFSJxQHiN6s0sw3YPqt1GdnzaK/mtN9YoJxJ9z7Aq\nyrEe1WylI7wN6icWZrVJaDwfYwJGhRWFl3S1lj4IInG2rXKPwkt68hEmMVoX\nL8D6b2YIIjfLn0GaRGKtIs9cTKZMP+FLBVg0sMfAJfg40irMT+Ns75RxQIcZ\nq7/Vt/U1ZjS6B7N6W32SMIJqpRJmJQaGtwLNpuZmCQ5X0NaWsG/YVA+ir3vB\neUkUMFdAsNSzKyeddXZ+S3KVLCxdfYD1fiLBMv2/z622XyRn4SqXGOST6MdI\nKzGduARUY1QEJaWQr9aNUrLVLYPzxwKJnU+aYEcNSu4xNzz8qFp7/Mqh/nDW\nybJm113dxZxbFtCA3Lw+wLFGs/MEwyWGg/Cgs2X/r271S3AWOaBvT+ZrcK8f\nBjyYxZKExUbBQdHyBBD+oS5Y9y0fb9q3VvXq/ePB/rhVZxsj99vg+8y1imfk\ncMxpE8EKgGwJKJqlUoI7gW4lOSIxYcFybHkTLpX5UfptMiy9bjrjlLcK8sZE\n8En5bdpNxrEiTrRjjBdemzYULZ6yTAb4ep6XqaIIPZqNdZvOOkPXmbvp8tef\nSc45iwMsVKTUkPe62qth2A/DsgaZ6Ri1ND4olcoIhECbWjGl/PW6k5mfsIx7\nfSdq\r\n=Yr6u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC37DxCjXo7TeZxiGddsGBq0UanLq2GVscwJmhlDJS+RAiEAzWCw92hZcV4pPNaWDwKjV5crCrRx/FN3CewGS5mrJyE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0_1608140154699_0.965894433752126"},"_hasShrinkwrap":false},"6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0","gitHead":"fbd49a88d980248deb58e69223844a0cf34267f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vQfX+oYL5vo7MFqvmX+aL0bQfXNQIp1OfSx0LZj0utSiZLCuCbiAkLCRhtUIUhaIy0sMHl5pwKyi/h90eJ2Usw==","shasum":"6c5f121d2819b0d2dec37245a0e5e83b5e01f57b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0.tgz","fileCount":39,"unpackedSize":240369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2nEPCRA9TVsSAnZWagAAsowQAIuJpM52JNA0V/ayN3Th\nNxJqbxt8AstqQu4BnYfzATkHCcjnLSDT9pK18RNalEtnY+0PzWdPUZVA2lpE\nE/79mRC8RBeMoPcOV2KGjrn188kNXbfkZStMbcS8cAM7oLiIoQhyW0lK5jwa\nFbNkD+kRYoIh0ltOglEscWpNdIZVpOMyQlG7lT1HecD87/xHiHCm4kmTg72W\nVnGoMmjGHhe/4ZMRJD7+WxkW/prt3WqFxFQCOC2mSZo6hB5lmphkX7FjEyRz\na7+HEiuN46YjLp2rs7+K7+5C0IULrh23LPZc/a13qqrQm/s2q3cS/xuWrJel\ni1AwniY/lqy05kwvi9KATwT/XRxLgThB0h4UFThtchUlmK1E1adtZfHOTTZK\n9dNcGRLPFrO5TuaZUexjoeV6OnXFQ7B6UCYiY0U3MohGPmJN2pM+flW3sChl\nukeFSwQhRMbMJOstdcECO46mMaJPUrDWlGue5+iSfyqbWjUatbnufOgV/yyq\nnYb32K+rsQMXkJiX6TR2a6p+37/tlJDxkvCbktUcnV76KSFeBsWJ0+wN40Ne\nsIbi6+I5v2nF3NAxgj5FihGRQlOvWMuGr7fDMbgqPk0mLJLJ0P//u8599P31\noipgJd60m5g3mrtKlbMkikHZabIef1DyB0OHyLgcJ6N4gpU9AsUm9+EEye9G\nXeOP\r\n=/EuU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrK3396eeUycjRCBT5ExsrnyT9tJXX+IAc+KuHfZNIxwIgQQZ5DIJdWXiuAQm3V9zktMHKjWaZBrLjh1PadZhkG/A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0_1608151310919_0.7827974656238863"},"_hasShrinkwrap":false},"6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2e37e381554dbc26ac53be058405f317aeee2e03","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-v2wyyagtBW7tJp/BVpu70pLbebkxlxyJYzjpIo7gSCcYMH/uYXkruIWIXL7mYDpD0cxDPB9xK+dj/zngt6ya1A==","shasum":"20b5085cd06fc2fa911b3416fab3ce9d81f2eeed","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0.tgz","fileCount":39,"unpackedSize":240369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2nFZCRA9TVsSAnZWagAAT1QP/00xl6dlrO4w4GKbQkIV\nqPLRCwZqSDoqecsVXPmEkY+kxrvmsP+OO5S9XzSCEA4ATy68Xotrb3hPTYHN\no1rNvirFGPJO4YtrHfeAJWvfi9rXrAcO4o7fE6UOKq5w2zvL7aycsVqNigrM\nV69qmbbdii+/N3mrF1xqgJhYZ0fdIiB1XF1FMJvZY0lK/GIF+ssTNwhVMwj3\nJAlF85YY6HUgI2M6rE5MT7IPJPHgYo2c4a6SPGZcmoJmkNQKD3qgjp6lrEuI\n/yjPxh4aj4xzC6577aC9Kg8KgvKLyATqhoCbtQDLytMc+1gPsC5GvGNnJgew\nt2XFclm22RItgEQ8Xt7Qc3XrqLcJxeGwRlMV0vwfBbZdrKcCpIsQI80gbZoI\nWYUJUEbzVosYS6zNeFw4/09Wm6Z18/yjloWMhQfbj7dycR9yc0QTgPF4RXpo\nU2nqQqCGMAne/C/xBk/2GJa4mmgDgyNxbUmLHx6roPGb/+/JbzLQQLIAI/Mz\noA7Ih3zRQ0Chcvyob2Etz6YZNqN/pQpK4TzlID0ze3qpFMfGJGoteYiofwNy\nLQzQouiogvZ0SMZBLhZ3w7JjAFAHdJY27jYQQGqWJE76u8MQg6ijo2zx15+D\nWzxL0QwoykcQLsCbD0uDkPmlfmki8TWdK1S7cvak4iZFFvWoGLRrYEpesndk\n9HRO\r\n=3aiF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCffhCA+O9yse+a/uA+cEej3O1CSMrHi+p38YmUbaAS6gIgLYAvm25aeX0Q9OAESMzs8/90V1uQzCl6UEx4fXVu6Z0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0_1608151384977_0.4882360354270674"},"_hasShrinkwrap":false},"6.4.28":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.28","gitHead":"4ae2b16e55853506e3ce10e5d2feb19ede6e2d68","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.28","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dxeuYGOrnwIQvbR0zJRBMcJjNlzs4vVQf1HIj+t5PglVgod5wlBWjybYzj39d0tN/BsC8j/LOkjX7uxXB28Mmw==","shasum":"8dba1bd151b29e8a13deac9f5c0d12fe5614e1e4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.28.tgz","fileCount":39,"unpackedSize":240606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2nGDCRA9TVsSAnZWagAANC0P/1eCv/VOUbq1sdHR/zvi\n86Wzw5/1a+Pp4Wl18zvqIW016aTBN2KwY1tKEq+UHQ6hiFG/kKFIDApnd+5T\n1mpskDZW0pQCZxZSmNK4D/WRmRVzVqnWG6bfieYJMahy8wMh5U/yHmBcOhHh\n1gANIJVFXphV54lfnl8bcD/JV6N7HiLIn0z+jFCS611AINMWm6KbyGYT2Kly\nXZNOWYM52UxLIIS6E/Y3EEhi69IHc/baR64L2Z5dehfEznaEWqAbxrsFwo7Q\nZnoGMcOQochPXfWmdlknQAN2Yc9BqEEQbUCozp8gk/eQfjk5i0au55g+EyD3\nuzmWvFZ0Nf4SpBAysSTkv2aO2tJffLNIEHwJ5PSOx8f3NG5RdA6M8+ZdDenj\ndkJkh0o8CfUgy3gF6FgQuMCjzZBhmY3dCWowdAMcBkriM6+bMQ2pMKD0E1xC\nlmJYi4wx1bMIhQiJFRrrpqamsCB1DMxeVr1SatNRu4hoG7IMvq6XZh46QCYN\ndHNEkEo5E12i/wd8osyUPxh7I5KLw6mTfTQEo+BT0r5vKFH+Q1YQgFC1yWBS\nsJLlH7oO6gOZWkejgsUrlpOlH9+4ysvUa3MLf13Q1489UVq8RoUp2afsXxJ3\n6ShLuhlvhDDbIoadg32kEIW4b61eOTfwGpRe5hK8gRmvHveypxswwxPndG7h\nQGIj\r\n=qoBD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXTaGSkTNCYbp8ssDoIfYe81QbeesfKdtgOEm7ZPA9BQIhAMrbJiSmEU4kEQPbuFznchGO18ZNHArC05zGceUgUlLT"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.28_1608151426991_0.7241592772743279"},"_hasShrinkwrap":false},"6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ae2b16e55853506e3ce10e5d2feb19ede6e2d68","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vblr7bAAmOOjY5prdqPGEpPyXW6a67Ra1tiZooVotqvo7HiQOuFqmtmp5jLM6sG5I+oVqWNYrtkA5uIDXnMf2Q==","shasum":"90d59d6bffa908cfbc43c94e002a313951e00a18","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0.tgz","fileCount":39,"unpackedSize":240649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2nGYCRA9TVsSAnZWagAALFIP/RPCaiKRpeqRCvI2Rstp\nktjDfAEmavEc8R3+WgoYCJWclalqeQ6rlJLENSzRXCV5CiUQ4lzINEwISmkw\nSEG+2XIg53Fmv+qtxJindyR87LgXKCRAgUjeXiqrznr1Pa3oC2a8qYmsoHr4\ndD/8X+h1AlQhyOzKo/anBZwrCd75MjFziBB7YV78+SF/ayGZg2ou9tbLaRLp\nCgns9oShxDveMezcV4T2umPGpdbXHsK7hoAk+rNvas2U/u07oTPgzToWULct\nDayp7yo91vZ//X/SUuBczdeztltJ+eBsAhTCzrzdu3ho5IxaLvAxLu2CO87q\nJli2ValI/0nJaJ4uKJNgji8C+5GdP731lbxN6djeu3ukkm8Z8N+njhiEOtkU\nf7Qk+4lJFvqKxSb1Z+ja7MyfN+ApoHxhAf8XD0am56sVAzfEFmmmQkOK/MO8\n67nN1BKVxf3QNA5hfsEYmsqjjfZyfN3KgQ1yFSrY4U/ibVotvg8GBjMkVvvo\n8gmsnS232uXJkmLLYzo6TlTCcd/JqAp/rT/VNgw7CaRMsfengJjj53zhusrl\n0jT2n9QqBhKipuLInsBwGHSePmDYVpMj1l8ncBI+deCAUHSH6I8xfqw258jB\n+UrtVb4ilj3h+goNJ5XZ16OwyLyVtus2hSiLq/j9Gbf3F9hoBvELwEOJUXrh\nD22L\r\n=ntbE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSALECR9ylDHX25l1h25PsFgbvDUUqkR9eMpg2zDFhiAiBD+buohg0l864RQ5fR8EI5x1JRyUuZdkLRxpTgdUQO3g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0_1608151447341_0.20795760108438244"},"_hasShrinkwrap":false},"6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.7","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0","gitHead":"f674009da00130732f2a90c215d5d3995fe8d247","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IMsCZlYsvuHYpLCd9B2vKPmKOQzk5zD/r8TQHdCcH4XWj9rmfB1jdUcf/1hQCzL4NGaKIoydFcfLVRKAqPdwcw==","shasum":"6f257e82d3fabbad53ac5663be7d23eba22f15c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0.tgz","fileCount":39,"unpackedSize":240649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2nHrCRA9TVsSAnZWagAAEKoP+wZxvZZucLEfEJhKG+Gd\nmAdwtn3fbPk7w3QYn7bKzKMGil8xDaZGonCuM1DtLj8OSpIvK8/S0WnjvKJ5\ngBYtMlRGRQKjfOIvokm2eZe1GPUuT2RmuWAwoJHVaYhxmoqmu/HrcaptOomx\nTpOvm1rhCev3h8zEP3MC42EgUN0IYDPChZBPhkNU4eTv8UanMTUn61HKXMp6\nqD3eD5QLpw6Tkhr8mTJCoeG5xW/v2ifS72NJZZ2aAh4V33Qi1GuuoEUwY3Lu\ngFKaUgxIuCXOZhDrgPjSNtMFhoEmRQgpPBdZilqOd1QGEiuMcaolhTywSDgw\nlsrUJ62FpC9qHfqZ9GsQrZ+pyWdQHvUIWIhFlvhQOzXIKC8hmXjr7IBM3typ\nLc81hdhUD1dhNpKPLq5sjatJFt6BJwUFLJsHeK0Y372XXdLkZyF+N+wMSOfv\n2w5s022JNutxK1tYbw8ggsE4D+Wj95ki+SuXa/zLYCwuwrZ2SehiIbvrtiBk\nlFlYshNR1jGH+kO3LMgbifNI0rRsrHXHy+sR4j9vm2c6gQ8y8WxgmOZ3pZp4\nEuebCTig+HVeFh3+r9aYA7gArJShU9z8Cw76vLgrEiPOP3TPX7wx66PjXNB5\nvDUpNqamehaS90ntVeebLIszYylvEgzhWXIsOEcIXGiXGVLdbz7mxwesoeMO\nLhAb\r\n=3qVm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4UV0p0A+mqnzReO1YUd00QFaeHEV/F/r05v8MNfkwyAIgTCgycequmPk7nEU+x7oEf7G7DdvIG9S+dGodJryj1cU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0_1608151531157_0.13314342709966054"},"_hasShrinkwrap":false},"6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0","gitHead":"e62647cbc0b5bae715d1ddbcd21d7145a51d172d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PYS1sz1gnDrssrHe1y8UlEaz6hnVad93oBRDXD88ks+IDnQi4Z9ZWG3zgqwrrPV+iiWw53ocBgLPaKaQ9hPfZQ==","shasum":"710532d50eabe86829d8fd0101e700867e52a033","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0.tgz","fileCount":39,"unpackedSize":240649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf20yMCRA9TVsSAnZWagAA7XwQAJATdDjv8Lu20OuI+d+n\nmyb+42URQQ0arkvQEUfP82IdlIK0tYNvK2Br3NJ5cBvRMqzp1LuqKrREGR3F\nzjFo7FdMCH7fu8+wREklrVAg2kc/8y8ORd0Zs37uR3dBh6Xp06OYNCIs4KTn\noiM7JUAXeJXjD1k8sMJ0mf9j8wmzWvXOjvyePl+d+vVMWQVPWIay4WHZvgMf\nbRaGPLFMhoeizawn9nRzbD4Bhtpmyicpk9xX26+zuWXcgDgXSRm8sgdOYIHQ\n324DESy1kG8j0qRrskbeSyJzH9ptuZFLARZFXcRJlNH0qomvQoJIvQKHPAsd\nWeB3lbJ2zVZNA9DOZAQhvcjk0KW1VbPM0jhSWOomwM8La9UXgB+co/aFEHNI\nfLrBcC1Y9GgVKTgRTn81AdGIa1NzzkMSmzTV2fgRqLD+aYm+PqcO6mRNheCg\n9O0Y7L5akqvIN4lCDBrP4//bqs2ko63hrkd1lUEMHknvswlR7tboolMBwt3z\nM9+HE5v4yzzaE1EF/iFx4fkc38SLgQiQQ6lO5kx9w19oMzIXLcKA/46EVE7A\nfjDVQQzP3LgmdXtqdR2f+8zTUKFcWoe+esUdmsEKeDXMKBlYYvQQS6fX8dNB\nyVfkuDV5n3ZvS/E22nPv129JycY8BpobcOHH/6AZToxrS7MRy2qliIloSarV\nZ8i2\r\n=jQco\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGuo0+LxB23Qt8IXufaKoaKK42NVygKwdmy2czfyyRm2AiBuKZgYqplwx0y5/btfTSqAx6BeYgbvrsuTonGE40bAHA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0_1608207500007_0.6063515793259233"},"_hasShrinkwrap":false},"6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-riWsvI1tSioPvzLeLrNYqRD0Ro/yeCQ08ZAELg0xGuHpiHBSPghgSw5MNzY4Xy3lNBRKuDFiHqb67OlJQODj+Q==","shasum":"aeb07c628e3df3446c27156d0f841d439f6fef8a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0.tgz","fileCount":39,"unpackedSize":240649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf20zqCRA9TVsSAnZWagAAOGUP/jge44REKgGlURg9CN0b\nccCHbY/PEsndNfGeqRHFEcvVMNx0iBZaRejaBn6KruYeUjljEWAKIsD1yf6S\naghDrYZbt+9D/0ZvmLyVlS/NBogJRlfsY1S3AV9UGJl/2shM8VJh2enMCZ9r\nu/dgKbFWPvhuejA8hqumZv8Iq93klRIemt2pSiEtTXCiUsFjCXseRwPgSAyY\nb7nQ2OwOVr5ZzcJcMXvQZm7TOwazGqZmi4WjbtYk0t7899tc5fgTDARF2TKR\nupqwbdrTI6wJwJ1rW7a+RhQTbe8MT1xGwpELW0ladm/N2N/dvZrPdt2IJdbf\nMp2xLPt/iIxjYRg0hOnR90ClrieVjGgYi9GKsMWLpxozXk4BNRvTAsdRMcDl\nJnjp/Y/48CImW1uJIDa74UIQ2Cj1mHRiHZrZeyDwTuSe+CSbzMG/ZfmfpTi5\nEe//XvcFGehBQA1OpyjAa7pZB2AhgvIQkyik4R9FlrHeyfpDE0oYCoxU2Uq6\nEk4wcNqGH4tI+6I3L/2+i829o0nx1mDHKCLAr6wj+pmvqxc+zAj98ocvr3a4\nwyWKBcqJv+3xz8GzlYAeF3prlrlU5aO0YNt/3LbDx+ExTYABlraa8lokQgL7\nOxDR186ivYz913KdkhXexQkBInMkc61sg7qp1v767HACUn16gKLwWUrNcXRo\nWCED\r\n=N/uJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5fFTbignsEdJJfQFynhicavRi80lQgXARtnB0x3517gIgbAWCfNE7QZmy8HsZSOyEilapDwOpEcZiH3vaoJI91RU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0_1608207593331_0.635602899924048"},"_hasShrinkwrap":false},"6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1e4c564baf5608701e0686ecc8c19cba18b3bd08","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qw4M1Vfipo+elFl3kAWTYZf8R/FT3fWirl07ZvC1MRQfC7Muu8aTkV4gIP8y414tFl/Q7qpTU5AWijdWGhpvtA==","shasum":"02bd37f9d253a39c75886c03b21e6b1e22a92ccd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0.tgz","fileCount":39,"unpackedSize":240924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf201lCRA9TVsSAnZWagAAImsQAJvMmWpzLA6nn7yDc8JG\nsQYbBN6zFSi9ZUZ83jLvGRQF11otyTsZOaRM+39AOgRUl2pQzixm9diA/GZX\nLQOkos7n6B3wT/5nfJYbf1juRihOJV1RK/25lQYlwMdGaL3oJ/awqoPlcq5A\nhJetpb4vL81wS02ntEJE4pZreWqG+ob2bKW0SA1IJVLxOdqWoSCtETzQlZSe\nuEYBprf0Zr38iMQBnkeW5ohaZNLG4yqRsW/+LyXK0ZY0i6/ffYlMe/2xpUDY\nHwmO2dahtL+fzJUesegPw4HyELtfT14cGMDBUPs/YKhdl+/gEYWc/VnTqOQd\n+FGjGy8f/rFTeP2PJfl8OypNyaJSIrvcFfaQyaNHMk08lR9BIcntDYNJBVO9\nQuNBTUZsUI9CZ5i4tIOZAqeUNeaOXiLI3cFTddjvyENmrAldyoou3h/sa221\nmmewn6Ulg9KhlOoh7bW1bYxoin6dhYNProBAMxXH2uqwSedpg2z4MukAUdeV\nDAQBkS2WetAlwa5g3E8Ih24aSAtPe/vhfzdB7pItA9lhdtqwZbJwwc52G5/W\nZEa/gPFRc3qaTG2mwywwOgknsLYzeTatcXMWOsRMXeKmkdZVrhyBvaF0lTKj\nM5tJzZDVW1tvwHyUMbYcOc5VZkSdR7RXoB7NLcjengQnv4Ij135/xnlR11T4\nPxqo\r\n=tK5y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ/IukOdV5c3tE4doU0AwMOJfQs19zn7Mh0EHBf+LZHAIhAMtWukheZbU68t/aOR/wLk9rvxAYnGGpUAK9D6U7s8HR"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0_1608207717353_0.7519147210205535"},"_hasShrinkwrap":false},"6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.15.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0","gitHead":"42a2eb3bee6417dfee0349e15ce1d6a11265ef9f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VByKcnn6vv7g6tx7wnGaxahg7/NfYDkcFVDp/PX0reBGHao/T5eRWbXxGNiFCx4SR68dueR+Qh76xgpruTc0IA==","shasum":"cfa40906ac7a9335895a129befb7f44bdc50e25f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0.tgz","fileCount":39,"unpackedSize":240924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2030CRA9TVsSAnZWagAAlTEP/A6muqzO2jx1jt8GxTWW\nPJDn1rghcf0qGOs6rZIoHr3LE2sEYp1srO/ieP/1dLqStybnB6vpETDjGFv6\nfSoKg5fhiVF7e5oyUaxwlidEMcRRT5frCfi0ntKKZ2oK0llx0bKNRmYFudSo\nHWTqkE/CU/LX/I67sDjOtf8SFk4MjK8nolyIrqSwT50d/WQqrEc8gjY/C89/\n2Okv3Mog4J9QZqixZV/BBkTdDnPNrPjQSg/rWZD5OeOe3Ojx9qmaykpMf8dZ\nzRFojYkb5LzzBQ2yIV+PJb4vc10mBokOpuGLg4Cgh5Qh6h3p4BCtlEMthgLL\nsVF4HhbnOPi+xQ9Slw7YpfHX7UinT+WXiv1xjoqiSELW+wzUVmATneeLgV8X\ntwmws2ZrWdW8JRBA6TqpfcMbAskzjmgqleZNnrYdiA3jyTYxI/8ktb5H7nhQ\nsis007a58hLMtv/rXi0X7Ey3D7xQC26L6Caqzjd1zsNz7ONpEcqT5uuec7Ho\neBG102QNfn5xR+sXRNab9AMpKlWDe6fkf5NbPXD5ErsD7XxqucmyaoCDDvcz\n/FzBwtKI8tJr64VEom5WbaXxUfaEbz0JUL6SPqcD+S5PkDhKx2qQzyn+jRIY\nMnPx40LO6cUchb9RqHOUOtvPChy0iCdDKPGE7FJtPr2ia05s2lgQl+otGvKP\nWf5o\r\n=6PA5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2tPlrSaUH+/zIDRT5lLNEIEm0atPXcmSYzcvKsJnPPAiAPXOXC7xKMxmZyAh9yU7ShuDF4jtni/+u19widigY9tQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0_1608207859494_0.029832163029031467"},"_hasShrinkwrap":false},"6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0","gitHead":"5e384a1310047eecef5c011b5a4085c9b9ffd8f1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qZZeZ5MfcaiwELWrAFfMgbQmPWpYJYfRGqZiDZLtyHV8Zy2frylTeMX9n/XrRzdGHLMNeGyqZIMPEO0Lay11QA==","shasum":"d8e7f42c212aed241dc396cc5f7f02b19e7763ee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0.tgz","fileCount":39,"unpackedSize":240924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3ShACRA9TVsSAnZWagAAjcUP/ik5CFvrT9NQjASYfdNq\nTcnXDZRrbCnxK2EaaRVhi6H/EM6l2sQFN97RLE56zQdYGePE/fFCmhFhKXA9\n2SwWvw7KJl7EJprGZt0dj+5GR02gpD9GtAErpb8uDl8v/U41Vj/jG0+y8KzZ\nsr73MPVT7qW1CS+ll+/+SWsz9AStSgCLwCeBFgxrraywm+mMiqVwb00lQ/d5\nNSF6J8B8Rt10Gj7sFCKMMpSEQaAEzwnAbX1aTgLSG3LD++SAz/QgP2JDml/y\ni9Z4qw/nVIlzVHxJYwfN2SZFG4ioRUSw8lKa6SRrdlJh3ozsfRYPFtM96FJs\nXyoOKwyRq/XrDioY+6ZlXOLIUFJVxZhAQbt3fN3fiuUMUzVfUoKKvAoyTjAn\n+8s+dEtAhUGHf85bdL3pVmL1uP8a9+rbT3KxGY+fV9aCNVIPAjNsyd+krGGN\nrUnUSyraAPjT+TQmzHoOlBpct95gShYoaYoNRUJZXZDZTDhJLPV3QOzPjc07\nX9lzmUxNmps+kdxkGawSDTVmXu229Jnv9xiuoE6sQhWkfED1l6PGkD0VOEsV\nF1m8B/Pj1xMMfjawPgmnTVnCNci+4eVeUuahtPaoq6wz1Lr0DEhJvol8Dn3l\niSfZyc666/gTQNjANqnqCRtsAn65JKTRI+g5G6DrPKlFQnucwrFIkBUbDOQP\n0iMB\r\n=YJiF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQxCMB+KgvDn8p8UhmmckfMbXKA4heVJ2z9cF7Dpve3AiB179KWt556TyOQiolguUa+quoy9bpmXAXXFWauG4+t6g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0_1608329279805_0.21087345624970388"},"_hasShrinkwrap":false},"6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cf9a6d8501af1038582efbb2951b6f206555b050","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-XSpqEbL+Q8DO6iBn+ZIQ3wE6UanlRzttX1cbk8i9rzXuSmi2evom+S1s1EPm1o/sQ75CmpllW8sgedbiWq2gCQ==","shasum":"5ec33c348e4698b7bd9675b63a8a4f628499ead8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0.tgz","fileCount":39,"unpackedSize":240924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3SibCRA9TVsSAnZWagAAN2QP/jt+gdPGc9F0oo+Qs72j\n/s3naFhHMTM8NesBS9xIPsq+WfrlZJMClpc/ABIWcv0ruiHlbGe8kuVwq7dv\noiCFS6QysufStDkUSrfv6oaitiDoxGeyuBEja9Qk4dYqxgo83ER9t2U8Yo3V\njXcCCEklReakgTxH7qk37dRGVdL+hgkYm+N35NyggODf1yccu1yBZZxI5NvO\nzjoA3GK3Rg+HW5sgL2ieD0EDNo5IDvDVl8PYTNanFVsvrt43J1vfVS+SWKU0\nX06WmvTGuNQAA0JE+GhNkmECPWrJa1WJeCI8Ek9UTOKvb7XkyL+lnm1NCkA6\neP3D3SOskaDnejlHq1XP2OoM8/MR6hkjVLlSJ+P978mUDV0hUJERWfGkUgGg\nsdCuGs58RKlgAhwFaYpgj/9Me1RQ6jyo7xYg2PWY0sR/LD4QmjzXg36uebb+\nroOrK3ELz+DTP9gMh0IjWCAEKkNyLlMdvM+INonOUyHVcw7cprP94RuKK/Wr\nx7pvWpM97IOyqmtTHWrRrfFY3yDydOxCJ64A1Xcb/su66uU7P00FjawCUsKV\nqJrbzg5cPloGzfilQ0fLATuxAaB+iEGIwVgalGHXxtcfPUT7Vi13BrgVYc+2\nHvbKRGgm8kpQU870kejK6vg8XFbZnOHrRpqDQQ3m0D0lNto5I+KoSYc+r4z2\naE6C\r\n=MIYe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7g0lUoXQgtmzXzVviNIiMRZJbo+LlH4w+0d9Tk0B/AwIhAKQVRRMa7wG0aMx8jvJ3ZxvY4odZo23+5ZYaVJ4bQkID"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0_1608329371149_0.5970494905504884"},"_hasShrinkwrap":false},"6.4.30":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.30","gitHead":"2220c20dbb85ba6cefb0df79ee31122d6c93d54a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.30","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UelBqGxX+JjTHRt3xDpXY3jUBJznfUn49gT5HnyfwwjhL96J8CaBaPniGIn2FctW7wuD61/uXQKLsa2Tf1SKiA==","shasum":"314e3c3e48d98f18eb0e0d3fc4421426f54d28a1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.30.tgz","fileCount":39,"unpackedSize":241158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3SiwCRA9TVsSAnZWagAAALAP/33b42XMujDkKszrP3EJ\ndOKXzHoMC0D+1GU+7ArGeqvTsMsaowjrJ+zj2Svc/c4vvCe6ne0buzmQc67P\nimFrpEKCYS0ZMckzmEc1XqN4qEiI7GQydC6V+n6f+TheoDoCrCi1WEs+8X7p\n5krHYdcwB73b/d6pt8pLqaDPklcO435icsnYBgtVYnh6eocHdTvL1jSkz1YO\nmAns/V1jjFM3tRwTdQmGaK2UpJwshkigaEHPQw1VhDy8UBhWgDeSceoKPSVj\n/BTIGaLjhd5dbTHI8fkToUd8VdM5wlkLsK2F1KzRvteAPSlE/sbHktVvkcYJ\nwizvi4d3utWTnNfUiZnIADp+QmzhnxMZpnRtthMk8WwxK9WGoED6jlkEHmy8\nccEbughKWJwcgyEavPfbDUaBLewx+zAXxp+okv1z16ICCsXhKWZvpwZkuL5c\nPfGWTen0P4IpmWoL1ePFBxlYybkzsfmXeIfw4SJfSlW2C2NxXCs05NmT9kC4\nofKYeopWr88LxDd/AunRAxZfKnZzy3V3RfHqYrskSE4vg86OozGAMeCvprDN\n683GyxovZr3/ch6MgkAbHUFrYs32HBlH5iA+qey+1/Geqi6c+azcd24+rWo0\nVmwadWkS2CcchiZsf8WrvTvPBZBvBiawrsW1ZpY29djzHoLnmE8mYRuxY1F4\nWhuo\r\n=7G4h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0wXq6Z0j5pNg52Bt6z8LWGKJyOMQvAto+laqWORpsagIhAJBfh3n0SpqocTbIWzUG2R4ker5zd71ybA6TvssjNEf/"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.30_1608329391981_0.488643845720911"},"_hasShrinkwrap":false},"6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2220c20dbb85ba6cefb0df79ee31122d6c93d54a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qq47HwTXTBOspr/O/zAkFr3bRGfdLXJXNWy3HZRpyK+qW48aoNlrQUm0CKl3Y0eWRNexwJ9BP2D6MGj4Ov4xDQ==","shasum":"bb39f3f9d75b9ad77d520b6435507356fc9ab906","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3SjbCRA9TVsSAnZWagAAFToP+gJCJ7bp6/Dg9tlUsWFb\nnh0RqFyJreGw0SfdnWYdMCoPTNeZV5MfiFW9Y5ARvXaG+6BqE9To9moh62cB\nhYAQcnCjq4xIvi/0hB9EOboErSEo74AsVZDib9K8q7HPq3yMvKSer80Ec/ZY\nvN665mTmNud3kigUHUQloUdEpbcYhnLMaMn4ejAW6gZW1nGgM9MTfERrxCAm\noFcmPui/Y3vOfzGSNvoNFqsNS2TZApMSAevA6IanNlEEMbbdzl9IzJCwOvSO\nATdi5p6yEwljQepm+fUrVeOcEHkSi0SH6RIjVn8loCMCt1htxnQ4q+QpxxjP\nGe1n9g77RVMU3EaKNrF3A0s1WKg2wauqXRBBNHPqSN2942ukBvMyb8qk4M4L\nkCuAPiX+iJcJpGpVEg8xtRGs7bFIcXE05LJ9/Hcfs1hcKZa46Phx0QrqXsva\npWKxKl0yaSllZ3LkIkg9jfzyH3pn18FQyizox+/+3E5OvQTkI+gCqGb1oBN5\nJurj8TgNRR+0Kgfzw2XXtDOYPpduewdqkvqf6P3AYU8b5K0i58YOATUQ3N2J\n6eKAqJkC2Q9HwgeyRZMQ7cMDZEgqavp0mnhUSBP7JscQemywYsqPRmdZbT0/\nxZ3y8SshdUf3KnikwsgdO57qzI5Udp/Pm/iOKuM9IK+xFbL0rHmckE5s7zfo\nCAWE\r\n=PsRl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHveGk3LSErLLUyNhZB/ejLpH/8CLeWzLwcfagEK8ZY2AiEAv88kGd6XrzWGDGBhLqI/LQsHPaxwnIHs9oOwJA1NlzY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0_1608329434803_0.136311780300852"},"_hasShrinkwrap":false},"6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.52","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0","gitHead":"c0d0e259caff3d16689dd0abe12a0869426c1408","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-X/GtvXGIHj5PohR5uqYCT8E29WDPluv4V1GaOfeIrAgVxI1copr0xr0eJw90an1ajtU6Lpy5jydo+W/FbZMGUw==","shasum":"590be06ef6c026a48864bca1a314c3d4610f938a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3SktCRA9TVsSAnZWagAAK+IQAJnrYNDRV0PjPTGhhXXB\nkHfgiEQ4o6ne23tz08MtlaZdHHBsKzkDQCb7tpVNCIKLw4DAA01EpQJlC1DH\nAk6Hy43Wnnf1wM+uYrKo1uP4QYECqxIMFVbFjeE9SU9B908NmXCvTQLAF6kz\n0EzB1WVxPjh3L8DmoUZSkf0uoGPLRY9/srN2TpMNEJFd80viNVLzdIF0N9EX\nsPH4HKdkpEjxKr9cPy4oCYCFfG2tCRQzS4irdW3fbxNcR3rk/6IVPez5Tnvl\nAZ1cZvI57z+4nRTSZ5RvqGJShVDU80TOsSGDf5Nc4AtiYslHIxtm/8xMfZM+\niElhRL1zM0LNJonq41CS7H5+HAWYCfH2y/6mGsoVrz/zlx08XhPktNUKHC8r\nVWqps9GG7CAXOmVyKlKuZRPdYl08n2Zm/GqHlnAUOtTMXe9riaIIb4KXRNKF\nY+bXZ6fqiyMjaeudS3ON3qCVFUqC+rk10mGXq4mKtFXzkqL71RE6jc66x6Nq\njm3xWKFu3l0TOWl4lCH3fCu0Pgf1rmHaRQlJI8hv6nRKG4mdq/6OYFbTZrsn\n4/w3L3UlU2RGKyMt18Cl9Bhayn7pBljsA144dYHwAQqyXjlagAYsYM7Hf8rS\nRpSCahNAejV81cWYOIzcMRzfB5eMy9W1D6jiU12iHBgeQ9XtVlPW8/V5PRU4\npbJc\r\n=Od3/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4a2IbjlBK5v7+IPSTtTWhyLyEHV0BAHP5594mlXkswgIhAPteIUJTS7rY3TZFOYpDrNst4wlX4Y3tGg7n78y5uKv6"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0_1608329517090_0.5560208249345915"},"_hasShrinkwrap":false},"6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.53","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0","gitHead":"b152a2775a31cedcbd8b6b4960faa8e9d235b55e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-++TuxCFKmPcQyNPfmbWsFOm6KCvX7Ftf3N/M9v4Yl0+9Qy8T+/r1CfXA8TDoUJITL5bnDAcJLXsUQaKIUJESWg==","shasum":"d6867005a80b102c63aa71c2e57f0b1cb4bae1b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4DUNCRA9TVsSAnZWagAAWyYP/37NXrmdt42YAr0N0+1Y\nOO6Vh3elXi0NKnGeADj6sAwiQKQMUdIjlR9qnjzS3+XwMDyfb5qXTT1t0Re0\n76yWzH7UCImF0nf0pCGhZJ6lSVa5TbKZMHC6SAcRYpHz4+rN81Jr4+CxsJxK\nsYVbtREzqMbJMlox47m2R0nlHPecOyXAmfV06TQiJ1Yl0QrPDtR91fnMN+7x\nA/NHSCdFrVtZ7Q8jJVLvgecekGcuuRjvwRnsnloBbQogxl9NjQsqUDqN0CVF\n2eMVcqhwcfG6DKUk/cb1ZnWIcjqJR79UgPPe58iqFmJPJ2BLrj7FFQODgFzV\nR5xtB2XBG4pxS80Ag4puPKOiXNDmCq3pGC6EXLUOjBzNyS3nu8M904KOxgvA\nguOxiqCjC0YvaF+yM7nG5pztdKhLB9wQADOD5AmwNQOUvBpEKf/hKogG9xnM\nkDMLWUni+CpM89j6sXUB2j2j93Dp/mXEBtFlQjsVpcgp4EPafec1h22lBGX/\nJgpu8f0nZNcASSmZAWT57Ag3c/w3QDiGwG0tlCyrqhg3H/JKIDFYwl6OVOZL\nBENAwfpR/59etqKepZUP+pRb5ZFslsDJu8mq1W8I4X59clHFSqJNywXMEO16\nKvrziYZOttUGHcrVSvLHbBQM/tIUIfN5dFn7jQpHvDzjHYk6xIjZWQYGEi6b\nrWRT\r\n=t0mR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCZ7Cd81iQNyc94sUXAgd+cV5MSZd4KC9kStBDG7Zo5wIgHrQoG24X8n0qMmS0YacIZ6t+A6grKV+o3g8jccIKxcs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0_1608529165109_0.6248913660917699"},"_hasShrinkwrap":false},"6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.54","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0","gitHead":"3a551877cf0eb4e128da44cd2928ba6625954558","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-tTVErzTIDvn0EyM9NHNaEGdgaYgGoK72Zd/2gcvguWJx1we+X5WMHjj2TnsgGwIc7mYdeqA8sYxZNt7Lvp4Aag==","shasum":"a2cb3fc94490d7059ef6a42f2c41e4e0e9194ea9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4YYmCRA9TVsSAnZWagAAkt4P/2K2G0oNNv3S+0eMCSf0\nWSsBqHdnlKBP/VTrT36Y+OuJfIYkGpj1JIIAzZVvnJqTfakCrzpoOVZx0f5c\n9osBh6wTHWW1GGimwfSAWmHVFnjiIPvBT01oDebvYZ0Y8p1BpQjXZvFmorhZ\nDaLF6ww8Z6yLKfaxwIoszWx7i0xuf2LcoANaresLtf7J3alNJzZKFdA9wSGw\nRjJDaD+M0QioLOkoPCeyKrUjwpZJtHcFMYzlmhOjx+4hgOeu39S9SJyLchSo\nzAPbWhtj/8U/LkHTTyk0+azQp0r4RUte+wyP2LWMF62qCFggas9wHjabtY9Q\ne/kwHKBKu1GP/5xCdCyhw6kjJ2W6eNPwpHY6xjtCNuaCR8vazIYa8P0K/eZE\nOlxSuutp8MdAMSJTCEuq3tkqUIhq+4d3CyVmW5/KlHnxA4+8kLEUqPm4jgHI\nifSqtu9ANJhYH9r+jBp0NGma/9CMH6EqATsymM1S9f3xWj/Z2UpNzpV+lAmb\nfBDC1OTfWemwGLNvobyk8wx9aad39t8M6jtIEX+bbuMN+hpqZgNE9+asJGg+\nRFeBwDr9XSG1oJrhn4tSeKa+IpArw3Ybq602e6DnofYE3wMJlLRSh0UVW213\nDqpgsBsjQ54cLTj7ZPQ+6GTUolwcSFzAaO+w13eBMvNBBDNZ3QiOikdcy8IX\nbHS2\r\n=v9Wk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKNvZ6Xir7c3VyGzrIUUNZRI1ZIatHmPUuDy5HGO4muAiBBZoyWlsilsucZqkideEIPDAGBYFoitZmfmWguJS0+AA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0_1608615461535_0.6800084904805055"},"_hasShrinkwrap":false},"6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0","gitHead":"e512475ca1a2a8d802438c92cb75c869c9a1de79","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2eoNczX9SRjSUSosLZs9j+pJBZy+DMGuQYXHoXD/346TUT2JIsKaEl+Q4htfxrk1FSmjreThNKf9ptYpjQk+8Q==","shasum":"f77dbc7fd6c86f0f60ea0699c372335046dbf385","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4Z+vCRA9TVsSAnZWagAAt1UP/3dbl3HTOfcZUo4VXFZ0\nAZbg0ZQLnoKUgOa7ZkAEOnF7vOHrbdJMomtiGKqqBIIDbIgdqVsXxyfdx8cX\n45zokRijloaD5hw34LDx/qAKIF25Otah4WDAKjqey8OA7Osct1SocI+rh8rD\nVLbCtvI2wARxI594jggsq5t1kYpky8X+W6md08g4Z6CQhv8AtadWGtXPpOus\nf3o/wCyltxuJrnkkBi81+TEscp/peX6V84JnjAOsIiBO/h81HTg1YnuqJQAJ\nAjirk00rKNkbY6cxXzvZUmfh+4WCd9gxu2XlQabxxlG7IX433NNtmLlzL36Z\nHxgakGge9mYtfasPKFJeefwf905OHy6uwL5uTPyMXUfCRjbqudhvJ1Ta3TbB\n9hcC3aF/Oj4IvHERls97jTz517ye2o5yXCKYmJ1g+CgJIkcd2l0dPdNCJegp\n9yrR/7fIZzqpxeLYbndFatwXWGA4k96D5s7fraDZMYfg3vekdqMPNfp9FPcT\nlwZwn9J7fqQBaUi5GfzxBkb1BsCO+UdxmW+A4gVMMp0zV55gZgCEN2FyXtQE\nqavcAAXygxnG+LhC8ivLRdoR7+e4w+w/8Dp3IcV1xFBOHdFBcscpaiADki0C\nypS8/PFh64sFuEVOjJV2AiXmSDmFa6t8+hUAY3SQJoexiesB0QhKEyT24ugW\nwLRx\r\n=E7js\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICA2OOQCClHnJWkzSTWaaamcWRD1AGOvySY+YlCFeLZ0AiAbvtEv1LTZcI7+dN1JZVrX+4qO6HMNQs7+X11B7od5nw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0_1608621999300_0.2788619265997261"},"_hasShrinkwrap":false},"6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"13feadf18ab8ce317bdc22882824808403ee7b7c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-feb6HyE9PRtAeTTA5zQ49+5Xi5f7xb5DILsUy8WbHTvNR5nbk0bZs/52Lj1M/qeLrUP9V7qrUFykHdwu1AMsQQ==","shasum":"cfaad70b647cb9919e31da61921ed74fe2f5795e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4aAGCRA9TVsSAnZWagAAOusP/i6BbTkEV1fA7Fdwsnvf\nLbSC3AmMzvSOApBNkGauC01NE9sYSc7XhUWFiHjGkDGTB6oxqSJGbBvbl2vP\nU8BsjMe1HO+BaixtHVEfxqqQCE/s4jFnrlrG5aY8/ZCPseillbg0b0KeHFfg\nrtDIrY7/AomL5vXSwlTNIc40cFm98074cjs9c8adgE1Wbw0g7cFBckU1Xykf\nhKwKOJd5IIvuj96JBMek1NtDoSj9KaOf6Nb9laDy2jNX10/h5bqYPhWymk9x\n6U3i6AmuyNOFYQfT1FVJKpUl59yyeruJ493Q4MU5Zz9+IW8rDcvaD5VgAS6k\nQHn6eTaOI0zaTB4zyGDUPkoY3Nhd9Jb5gk1m71uHrWTaijDuCWbc07tEna4Z\n7+674MmrILMNhzS5zukwETzKIPR2m+wIF07MIZ2jfiV1oA/HQP8pyJV2arUx\n8jAfycbnvhlt/VtrwSLCQy7iF1qTZQJs0E/Vp1rueKNrKnw2o2aSJ6ZRz2TE\nVIX6I8L8faFm4Q64AJE3xs8k1uQ587BP2zTx8j2I24ez63ruthCg7vqN+cat\npsv8+9ARkgLhmUv4a7prmie/CUX78MuLeKORb/W4XP6L1qMmzso2FUc/nIyW\nmsEmKtzpfCqAvYsXu6YaOhChrH1TH6v5fPNdCj9Na+3MO0YgIGvMHIYrFtVO\n4eZF\r\n=H/Ga\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnHWJYtYBff90u1kKK5qGWGeI+S7hYeJRHeUUYwntJiAiEA8apTpSbOq8A8++6KOSVQ3LAeMn26doi+sm0V24bC5yo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0_1608622086055_0.3357630905797424"},"_hasShrinkwrap":false},"6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.55","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0","gitHead":"cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-aDmKXpILxmybotYqwSCNMATmBtMd+X/9mTaiPSR9zEXvTmf19NElGHIqzLp36P/xypQQNWaujyctf9tCrw+J0A==","shasum":"93df027c9e5a6e6ae2c7b63a27454520bafe8201","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0.tgz","fileCount":39,"unpackedSize":241201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4aAVCRA9TVsSAnZWagAAB6YQAIfMjAlWL+kS8Ftgc7rI\nl872KhyxkzEN4tDywR5swXzMjLFKuVbj9djm37mGMMossKSAzJmyluiJlH4Y\nV/6NH1KVL2NrLz/cWZdMz9TVmmq9Hvy5L1bospH+GnaVDHvStMdIb48uQou1\nPoTnhHQB7ishlEXemSNIEq5mVKk74AHPp9q7vQThJWAs9bSd9vKHCWwwyHza\nG4cbSQaU5LRm+AD+TQRL8RpEpCGFbb/9ry9rV5YtcH0mRAavkj266Fly+vbK\nHvmaW7b+CrJHasV2k9sUsCVyK13/WrBXwifPtKyPaCO3Z5z0XykhuZEpOt4R\nu9BQHDOONpC63sxNKYnzrR+THVBDEcF0dxJJVsXhz677cWegqOrfpj+IRAlI\nCuqP2SKd8r25IvGQoMrVsmBDPmM2ERaog4+jThPI7TaItDSF8D/eR67pYX1k\nbSotYlJ/SI4R8IaVIsK52ccv24QJDR9eXxl9Umbun1icSCTyXmaLSZ90Y6K0\nq85EiCjREpW1IXdA1ZE4z8GTmmlFOInOUm5Px22BTjGn3/2uCo8pPnGWMsdj\nc9atfR0qJfG/gl2UhSZVOT73LHRT/aQM0OkwTmhgrfQpbWY411mCe1lNqvLI\nsODmuRaOabg83QQJX4x4Pqn5IeNrU80Y/BmrHW2sP+xejX2Cku6zU4YmlkZU\nLd19\r\n=dfzU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFyteTqrCXf5ihZDCsh3CXWXeKE3pAs4LwL75Z/5H6GaAiEAq20ld1cUexIr25S0BuHc3MbrPz8bUfj5dV+rquyQIK0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0_1608622100815_0.0895612431125361"},"_hasShrinkwrap":false},"6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"77597f2705974f47a75d15a91494510b88647e7e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ieVvZUAEGaWNXwb3PeQeUARTPRl8R7orhFZ8oP4GDRmBMjR7wJZtIP1ERdRZb34Y9UKTlSaeHEx8puC/6NHbag==","shasum":"8e7d2352b3a57d19224228b8db1a8c9e41df733b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0.tgz","fileCount":39,"unpackedSize":241490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4aA3CRA9TVsSAnZWagAAfNUP/1Fq+2xn4J44KjlZoKTg\n/VvmZxALJVAB7hZkpLNdybseJ16n69V4B39QM7IeFD7MDJpp55P/TsKwszPE\nhKaXCQCeVot9zkBHFFkzCto0QWr/wSX9LD3Q2hC1sYdY90ZJZ1nic3j7Pq8h\nRuNshSe3VQ0aGnF2DhitaVkRkrSbUS1JzLfGDDRbQafVct8hO0P/fgIsyd7Y\npzo0TgSmp1YuNh3J0d71vOrUNoX6NOZKUH7H8cWu0BOnxpl13rvXnYaRvZmp\nByHckEYR6jGuFutOsYn8b6FjlLXnkg5cZfb7ULBYp+Zea1B+qc0vA082MqKd\nU9yOhPBj3R+ockhVU0QLEHTAa8VNTVnCurVsc268lKWYkm35/TSEHt8jCWGX\ndDRgHyC6VuCJCetBtWlyny9XCPcjFkd0afdbeomb0lvuxYAkgKp5czhiOdUu\nMAwSsqrTJiN4Aa9pPDNU6Y7IhJmBz9aMRFCfY7vwfgbKe4Omog3e6MGarQol\nTxCQ5t883KYK4Qr+NcqZIEMgC9SUogkIlxSimhbaPSa0Um3vV082VWajw0rK\no594sue799g3yXOjcQCoR6tKiFVXhHQ6YE1yAGd1JYZ95tZLWrmWKLnwCCW2\nn6VPVnKR5y5vDQNyqYN6aGtUgUXCMzN59KGKYiik+Cf8M9cdezCID+4my4tM\neqod\r\n=WQ3C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQZuzDZeXOwhV7umxLMbQpu78aXhJwY4BXwf+JtZWfJwIgOsO67wYgOYCDT930Urra9oDKoB7I1HIKiDsWhYJ76q8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0_1608622134422_0.7818861003021456"},"_hasShrinkwrap":false},"6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.55","@types/jest":"^26.0.19","@types/node":"^14.14.14","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0","gitHead":"9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/2w9poCtH9hyrP/BmnjhVMwURJKrUHqEfm0+gdw6LZEV4bur5+yPJmT7lfv8KWXbp9JKo24SSZv0fyFY4vvYZA==","shasum":"d03418f21d36030d6e3028c38f3b4b6556f00d36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0.tgz","fileCount":39,"unpackedSize":241490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4aDCCRA9TVsSAnZWagAA8hAP/246uUZgsLrJ/VC42K2m\nKuRYEbxjG3zkMNF5VKriYen5a+jEg50Uxyi3I6WmLT0/ytQkgPpFyMizqXGb\nhULNMGQNMO1AcO4RWrgHTFe6KPE3qSatzj4lvYZp4ly06ZfhQk52Lyhdlhdx\nbb9MIQW+ZOD+WaUeNBZpiDkuC593Oclb+T4WT2heBscJCBtNOLZPN4ABBKUy\nQBBi2Dz37m2whXCr87TG0LVwhuxisupGzHOAS+OPzlt28pO50Mm9eS7TOfnx\nTFO59tUYmyT58QSZok7cNXJAQTgdkc29SK24id92kQzv4jq3VqXBn7jW7rVI\nJERieGlS1VW05T8aNoaLhz4/S9ggycPSVIhP4qFPpWlGnRqwdS5GT1glT8gC\nPe2cmoOvBq2WaW54GUqb97rtgZtOYvACSxYAduB5e+uMASIu3B7b6hBaPwoN\nmb/GXL07pOTCqM8dJ9SMubN77sKb4rA9VoQhoMGc7l0u1/SZ7RqWVpFwyUnA\nxnOnQgrkaTZn1i8nCA6ocp9ZAyL/Y9hzqTEkkR9HAXeRCNUgXdvixUcX3QGK\nKpLCkegNFvp4LcPuOAO1LzlyipSssD6JYTXKGfYAIcyLdmCzFK2EdDJtN1XA\nu2pcFZlSmFrQfGmFdEu7mYPpayH/i5t+6cJKm/0T6xTl2SY+5lPXu/Z5JbFL\nylAl\r\n=1xI2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBc6733MNhGyxqOYbd1RI60kZpib2jTvurD4AWKy2MUGAiEAkzlhmQUhsl4evAChmR/gQ57qNA8uDZU4lkgDQDxpg7s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0_1608622273969_0.46304987083321225"},"_hasShrinkwrap":false},"6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0","gitHead":"336aa25ef74a3cfb1437915c927f95d6f4a9da39","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-G5rW19nkBAKihgN5ALXPq9h0KkbZFs7RFNk9+YMy/znxijpk4t3BBGJJvxLt7vTwZ+MF7K3w9rP9oqBl2YhSGQ==","shasum":"2a81bc656ae95d42793235531c8968db4d910ac3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0.tgz","fileCount":39,"unpackedSize":241490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46l1CRA9TVsSAnZWagAAt2gQAJLNeuUa+XS88KM5h8d+\nRnmvmIee5FDwN22Cujpmw40i/Gz1p1N90FvNW0rfr5aWfPpQmDry2vqIu6ll\nZwNNoNkGzraYszlUzkfXxRhjxdON5kAAExeRYbtk6SSIbUM2JtywDWtyY8wf\nc0GWyOAoovX/5lcQ5vNzRj3SkklBYde0sfFYC0L2VekwyJduAUq4nnX8iwZI\nix4B3QXiO4NUNGXldgxvFi2W+RvA65n7Jy3P8aPQsZKz7Mq1g55PEuc5ptq7\nKNXKTvPFA+SfkuYLZLPdROIL8bZqV8vqV7Qt4c1So6MAb/11SclUuNDiddoz\n9DzWh52mePSd0mxGxOusUR4BTh96FF++um9cXz1OpBKa2wTSC9Qz/vWHmM9v\nPN0LSSLmB9zfOpo2Ya5sk5V0UbcMcz/Bsb2yJb+T5ENL//oX5DYxyLuXQhz0\nZaLwlakD4zEWi631L0tXQHG3iE703NkTH2E6WLlnfoTQgW+6PhZiE/yZnD0+\nXoCaIp7daUEBtlicoE4skQIDYKmVjA1xkvfZ+ZHftrIAYIq1kv1ZUJ8NNlKt\n/Qml7IS6g2cYbjoZLlIJqwI0X1B7RhWSWcTe4T4E+RvMk/Iyt5yt3utxJgq7\nss7XU+/Lz+0ajVvL7OJOk3jJDHx8EWC0IFmvGAqHQgGSWtMoQ7VcopfsI9HV\nciUf\r\n=JaXD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzIOnX3qD054B/aWwU7jqTl15Ql51/i3853RWfANY59gIgZMwgj6y4yFtgPutoUv7j2U06vGWFoIXo0OXX0Cs1f/o="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0_1608755572627_0.3946080614067453"},"_hasShrinkwrap":false},"6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"42ddfaf4d270faad39d9117637fb4617e5a00732","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UaaR9Afzp1c5SN1CsF7RP4KhlqipndjUXxJSYvYurSiH4ov/Zbuqg3uLEW4PsqQ7DJQX6JNYrE1oo0vXafmx9g==","shasum":"bf4230cea85990b759885d4092f3ec3cb4ed270d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0.tgz","fileCount":39,"unpackedSize":241490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46nECRA9TVsSAnZWagAAKC8P/325bFF/sG0iUu5q6fd2\ncA02B2cKbrLiG8jcxggK2aRjV0+nFS6qbk9m+YICCtczO/ZcootWlZVQEKeU\nyPWam+YD0yq1TQLfhEKofAKOh0DRqrQ5s7M0uXF0U0Q0h9jStLnhX9iQcYOd\n+cBroju2U3wPyWvelVUKRhBJyfLpPK1Qjg4+itS05ZjvOkZ6TgjiK7QdzfSF\nWq8t9o5gK2/TQFYSWt7PETgq79kHkK65sst510RWg3IxlxDJciWWHvmFJhH+\nu1FUiBYoHjNoRPWGY4w/xkKxs35myPuPuUgLjJnq9iFPSiZuoo8i7KHOCEp7\ng2qiBfAaPg0PCPQcvRFXBbTfQjFNJsDZn5JK562Dl1+artBqUjr2kEqbkKH7\nKgUzEh/tSbzFUNi8O+ga3iPQckcJ1qbEP1lBZVIauWdXR7yD0msnfPaxucW1\nauPiWySRx+ZZlLpj6DbX+0h+MZpWh8uZh5oFY42QMq6avtkiKnYcA+EToOZg\nVy2MudhDD+IMKwNJKfhyBnhUIgPs92Okt+IgyiOg149aG9wuSedY3eVXg5HY\n7XbOWX9uimddJvilPGd6tVg0eI6WCWW4WpCw1F+Xo51v2hAEaR7GpEbOdUj6\niAfw2SAOXuNvDa3rI65LeXhTR+uyoOimJXzOFe6WHpZYlIjRlllcWULzDHEu\nJ5/1\r\n=yDoQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDIq8Z3QisC328dy+WCMtHTgbQh4rynTIMrwu86BS10AIhAIxpVlE1Oz4D8Jj0i06p7NK1G+t+n9hUtVF3/m0sWylz"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0_1608755652184_0.24925183389110206"},"_hasShrinkwrap":false},"6.4.32":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.32","gitHead":"b53eaf12c40a7c8bd898d1093dd625086d9319ae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.32","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fFnQAfEXGdg5Drq6pdW35Ncb7SY7vO1lqr4Po5z4QVFDGxmcaKwGyUXqTHrGFLLQM43EHXbrp1fLgnfucNl5IA==","shasum":"a06819cbd868dfde0ac9fc178c4503db19e3561a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.32.tgz","fileCount":39,"unpackedSize":241733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46nVCRA9TVsSAnZWagAAMakP/RDhlXNqrJeU949TwamP\nmk3B1Ih0cmXoiii0sHFYzUKdXixeT+zT85a+C9qruAslkdRAnyVK5rB/rIMh\n/86ow6wA+TZwlK7pgYULDlaFOFIBsjxOxrAL72OHxE0nOumOS8mVGpYjp4NO\n61NRI40xt6uTEdPEYAEr1H7goJ+WYgmfjbsBrba0Uw4PSXHcY0q5bpdS5ND1\nZKloULrzlsUIYaiz27FR+xY8cy0mxYqWshJ0ovVA7U+N/ZMVCcUYhVj48qAd\nukg24NPrF5C3KCzWpkANpJ1ZutcXCvRb7yIXgwbhqpHl6jWN0UTFCg54qROD\ncqRklLjkqrWHNYBfzZNPncvyZYBs/HkllbDtZmNwWzEm4ww4g9t1eCxieJ9P\nCtuXmB3MpJ0fPY/bB5aFqY2R54h0ycNm6UI/QYFJPN1u4J7e4LvBEDDUOHQb\nJpAIB6IE2kaNhy5Vd4jau1UsBkG9A0ZwT+FdMl/POGABoa5+JMYmb5Ff3pGq\nLBGTKH7NoIiSa/FqkqF+jzB7i5oraGSRA54mAcmDrml0HCfE7rPE/NlpG5aU\nyof6IkHgDwRI0tADHho5dyRhF+SgBtLchHCJjnEUNFnskVK4Ppd5g7npkPLC\ngrUgKxNSdmzF97WGGRJS4DNHOul1m4gJnd+A2NXbFfQCCZmweE1xeIE0twJM\n9UuA\r\n=ql8Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDL4ZwrTkwrSOp2C9m5C7zvr/HvoZxbwczzaITmZRdWAiEAhp3xzIvbJ5vknUXZaKWkbCR37z5/xWLFbnmJNMLcNTU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.32_1608755668673_0.566086944183654"},"_hasShrinkwrap":false},"6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b53eaf12c40a7c8bd898d1093dd625086d9319ae","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Dz9lGgFVzhPT76FSD9TDGuUoCC6EhjK7/jBmpAcFlSOCRy5w5PLzWU2trJgoSpxnuINFheMkOm52860Dh+rrMw==","shasum":"9c1029a86e60f67e7a4867aec52d5e1576eeb0a1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0.tgz","fileCount":39,"unpackedSize":241776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46nuCRA9TVsSAnZWagAA8okP/0LOwJkU4C5tYm9+JAGV\nGMrva3OH1qmBoKaGskjYiJcnXIkDyFwPQ8a3wI54Zc1eT1fZKg+nlKxEa76V\nDOUZBQb+CaqztD+kue3/aSqiYarEN8vLrOLwLqCu5h29VBFc8YilNdTi/ozU\nn8S5Sv2ZqtgGyI5phw4ehVuHtvfQgR3nxpo7CpXzpDcESIuygTenDP2hqDh7\nMAj9LTcIHQS73MeVvKLXn/rk5k1g7KP0M7/r8GNnlWlACNExIrQVtc4pPVsM\n4YUq2Q/2edCyULurqw4ibG/9moR/qYgJqRrP0rdR/63p1sOAyUafCH68bVyh\nWDMj5Tl7QaIxk3nlFDINbBaAMoY2jxHOvo2DYsM9EYceUc/MMyeqNJuDvPKO\nhR98qaDZeATcH+MfGup7nPtRbO5ue18x61ORsodZ/5sc92nxchi4cQtY0SLf\nPlzrxxBuHaGC6mp6W6i/i8fLYoM7qCdvsE65d9QSGQtiLLq04cflHI06jfK8\nEwYanknX1cSMTl7slphyFGcP3146MswAVp3iDhFM6OeZqMJeMN0l5u49FF6i\nj6//x1wv3OVwUQB/Mm7xRI/s5UczZ+FWloByy20KI7QMWqp+UVgxlxJ5APCh\nuMmTJGVTwshK0faQlhsjbDAyWfmNzsM7HaT9vfZztLgEuCibunhxGRxaTZSG\ngwey\r\n=4eFX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkDnjrXSUdQF53W3yGb8qKAx3boE0F7/66iOzfa89wKgIgIW9mTOSR30cGsfJ2NlQQLL9KMq72T2n1UB7d3Kkpf3Y="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0_1608755693306_0.37412374491636524"},"_hasShrinkwrap":false},"6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.55","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0","gitHead":"3121a1ec83262e31d80299d8c5274f484ee85be6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-BB8Hnihp4AFOXb9bBQ1BkkCtgqccZEE2cKNaxmm+WQ+L3tVTPtgvBYiuyPpgsE0zXs3xXmf1kr5lByiFL9RIqw==","shasum":"a7b0948fca747923da044488e4fe5c397d440c7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0.tgz","fileCount":39,"unpackedSize":241776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46pzCRA9TVsSAnZWagAAnjYP/AlGWz0YwnUGMuesGcjN\nyEWRaRNU4Cv6JXvJa2J+83gVJZ+ErkOA5AZS5Nc4ipPFMTQ9+Cb2oW/vDWBw\nJEdYaiduGg2Gs7egNcvtmoIzOB3RCjbcdSvFuGMAfPjCqXXeCM3EtJlQoD37\nrFBdRaSlo7JUsBTeWWlxphisRXULRd0tAyNV4miB4/UjuFaQxF8XkJdp2by2\ntEcbEFPU/tCUZPwb/t97fqOYiW7oiMF3ooN7BiJxOjkikM+61LA8L47DJzpS\nwDzrOlVhQ1EjHhdL4T2+iqu6mWGUix7atlCDMzL6Tv/QZgdqIUdr0EeWnksp\ntpKpthXyHGZP3lkkoN26liW5XROIv31a6TigDGMecWL6VQBcDu47DPPTsZAP\nb9Hrw90WZRY4syiGvmeJRWNefP6f/lETPUdpOokKxWfHO2MJTiOfjkSNOgPj\nHw+J+RGUnw4GYs1rZGXP2xVPGQsW42+BBnpM4H52LoRzb4qrSB8tonwb8Zk/\nlH/EuOcMxTBFWOXP5AFbBiEBwc+dAShp83KG3oc4loMO2kExelV3wwzDxbJW\n/LdBSe8Q7XOVKgkjg35RXDTBorxTnv0L8iXQcED8O6gC1X18nR3uTH17GoVF\n6DloAYvvZuhi56YFo9cEMw4exIGHs4D+QNlm1ZqU0CL3lXIqj4pqgsygKX+N\nfvLY\r\n=dTuM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQXI1TgERO0/CKy9/wxxku8ly0SUI1U0c8Puh0OjnxWAiEA4aItU2+wAyswZbI4F8ZbhA5TjoSG1d7+I1zSDn6Wy7U="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0_1608755826393_0.14267204249994392"},"_hasShrinkwrap":false},"6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.0.8","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0","gitHead":"141629388a799aac51c2f95311aad52eb37209cb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zid2sgqImhosyabx3apnQRICnL8qeyo8cjXKM41jspRzvsfTj0ZN82M1S+GUOJ3+8v/14UOi8plzi/jjyLpGYg==","shasum":"c1e02588a1bdd1b38158dc70b41b68e5f12c9b85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0.tgz","fileCount":39,"unpackedSize":241776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5CXKCRA9TVsSAnZWagAAh2cQAJ1xgbRO8I/x4vUupvAq\nVfBUuljNGpxmb68lT4iumOZWLPVkHHCDgKD+inG++QEVNA9sUucYa8BV8Zt/\n6QdzOa8PSGe9wjqGoriHXwfbQUKPrtow1tkohdxAqXPFtiqSwDLCkOPP6jT6\nIE8TSs2eavPmTgqip777wpHGg602QCzKJzWk3zXWJqNliTrVEtal3MYrETUf\nGyjLJQjOmcPPMIapCsCgceDFAs5Bo3OHFWiX3Z1U6l/IcPXIJ1mzJzc7zLZh\nQABQV12aWSlujyZ1Tf0Ic1jX9tBXGwdHjbUUDlzuk2xvKp7QgaM3hbuGDWMb\nivDnwg/zKlPrka67b0RawAC74/Hhi5rYUw0Hl48flHGbpoRMgWyc0v+EfYSb\nZsq1cM/88hChx+r1CMo/abhbKZFFdsuacw6Lw8XtIewsfURbm35wmfQrU/FA\nCJQ9Ngp+IhTC4/5hezBdvMCsII6s+4KlyEVOtbkf1ZZu5t47ry36enH7FIBM\n317Sbwh9XuWkLvbyL9QlJtOBFa5HD7bjnIA0Jr3CjDrkMmQ+QBSfOJ8tfbZ/\nfQTeVHJNoikpwlAy7m29gaBMkKxjizYXa/prewzCabmgU3Wudyvf9WsSFpvO\n/r/CG8I2T9aq/+Q7JngtEAqDQT/7TDBalQwnJshAfV/rqBaIKeiAAaZRh2LE\nKBNF\r\n=0DZf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5ENdmHk3d/Oh+w0fQR2lSyJm7BHYRfYnZHITqO7I0HAiEA9VwSzpZZnVyTtw+3iDyhdqHE+A2n1oh2rW4b8GtxcCA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0_1608787402046_0.4358334103049586"},"_hasShrinkwrap":false},"6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.0","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0","gitHead":"c22ac0c765ddcf5cb65320ad9e95f53b0409712b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mP3J3jcAn8UySNyncIABSM8SfuCouF9Ay8hE+WyLhGNJk3VrFhZFbD9tLNgiHcJfsTFSKVNCRUTOExlpXzqP9Q==","shasum":"923e17448ac67fd8bb72ac7d77522f17e1789e55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0.tgz","fileCount":39,"unpackedSize":241776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6EXtCRA9TVsSAnZWagAA7XAP/0idNnDZMswjPTGWmgfb\nOl9MHZwlBh8wn9mMsg2RNu5jV+n+nv7ObjZoMyVVOeInaGgs/5++BxPBRAWH\n7Trs8iEGrQvvKk43QI3XUqb1ilRfhrgOWHQD5ZmBbQuxojMXCvC+0hZ/HmFk\nYMBkigxA9HFby82DVOtQvn8rDi83dpK6gYaXOYTK6FByfioNaUt6QHj5p7zq\nOYTo3hvYhexRd3MW98yQN8OTwXdRLPSuUS9RhZEaGxsXIQf1CaoMvK891L9M\nFaRILAxK4gI8eRgAqzg8Vxd9igsVgFhWaYhh8e0pm03B0nrf2hGL3bTVKwdq\niOdW45DIGL2vAiyMAyvBbv1yj7vpTyj+9qnpsN6FjHHjEK4cR7SSpS2qB1Qj\naKTqF8VyqtE3UnSh4hiKSdzjLDHRZfqTusp1w5u0BeTunGnpjUpJZao5c4kj\nTCTiHJy/31xMcicDobdTLPsr4A7sYzHG9TD+gJVxaPLzygceGeqYFpVxLQTr\nrWhbWH46BL/9sVsgAv+3l4zDkZQrBLY9IiiCeaFnVR2vIW94hKsuhxCEyAJt\nZMBegcQ4DSwa6VtdvNZgU2btjVNa0FgB6Yp23Gob/EGdIdHug9MAjWYFUqvm\n8WZQR0Rrthtv6BTrhSDGnH/uesFoIcRAjnWqs+lGKg9aZzXmWUR0rGf0k7XK\nqaQE\r\n=hRct\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC35LZeObT61rO3Ns1Mt8EbUole8zkBXrQuESmMqEpi5AiBQP1ZH+sKIlOHn70nHI67hboOXqupoGRJ5kWloufzMlA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0_1609057772769_0.7578955478456895"},"_hasShrinkwrap":false},"6.4.33":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.0","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33","gitHead":"e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zhGDQzsCzLib/6wrpmjKaehf+l30XjSBjamMkkDpNzysAbGc/KIvOz0ynjm3cXKjruVBqHd9lPe3XxggD+c1QA==","shasum":"f6e80b7a34398a2b787fd1f56e70365f2db94deb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33.tgz","fileCount":39,"unpackedSize":242008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6EZeCRA9TVsSAnZWagAAh/IP+wbOHy3Vt+PxRroY4Uy7\nD5MugfLYiOwvsHYedM7yRxoUIfikOqIcoayyrYbvntocNDSyzSiR2MY6iZtT\nDpJbdIzMkARGDci9UlPLeMUfENUxkWhzW69l3ZHMrqBvqg+6maaAwpz34KeQ\np/leEJptTHnCu7NwsnHWVls0hINco+8tgenFrisg155mj8H0RIbFkfW6+c9W\nEcICFBxDLTAhUtScdX1peOS54KMtTNbY5ezWxQb22DPWViNbkrpDFqAFv6mU\n17CThXSMMnAEC4ZHN8/uRZsnwPgqqXcaQioPqpdYXwSfXuhBDgxjIQFnbNa9\nAx6AWEtSDAq1btFysMiWJ6So7xXu+5BI+vb78LVUdYKie2IyDcFIBDDbR5Lg\nVFwQ6L9Jx0CkuAklY0LFj2mLXxM80if01zCS9kbJM5m/qf0M+1oLZPXzPAlL\nwW+StNLX6N6q9Mf3F3aKhlIy/Zux/du0YmyGK+E53uU2VH48e2XYsptw7Ev3\nojxdbklVZEI/ULqmuP2uKOzVrqJ3ME25bth9vb0RTL99CgbA/aeUCMh8idUr\niLeGysdELhWDvhxNDG4FQb4KT9bUQc+K8a7z+Sok8Jw8d5f4jLFlCQhS1HNP\nh46yHAigv0dk+7tvY0vjDZ5J6XwiYlaYOoSCK82IxtxIUq7vAMFVz29YQkAR\nHgya\r\n=euuD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqKwJR0DlsCnZqK6AufYcmwnAzZZasI7bC3q+xReKrSAiEAgf+1SmBkoISNoMiDV0ldV90GHo+/P2rZSFX/8afufWI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33_1609057885518_0.22787600191307256"},"_hasShrinkwrap":false},"6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.0","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"23cf2efce867a9e3221df67f05dc452742444ae2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QYpstZqhibAAyRiRwErrLSn8VuZU4PYGmd3jNrns8VkubNsZUCWR54HQEDg2caCRcukaO/8qEuncYRXCGHC4GA==","shasum":"367adf055ca15cd915637430aa96e77eb002f9a0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0.tgz","fileCount":39,"unpackedSize":241776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6EZ/CRA9TVsSAnZWagAA8C0P/j7sdn5HX66gQgk5KHyD\nKT07L+I5OXtcoBPj/0o4ywDM/gR2hpCM6+GGnDrGCbEIYp/wNH0nOBe1Ii88\nxofA/a2jYHkNJOwnyQdHc9mICU6J8nqqtrkUKDLNHS2Anf/9geaEnbBljK2h\nHt6mkDkbYgRiJYOU8Bgt29Nr7Q3vXxbYiuXJ9fAM+JfQkTG/eqBVndyaOGql\nQjNyJ/sF33KqruXHudqMOQizYvvNKVtLDyNzDKdKCqGjBTHR5GcKgtDgH04a\nNlfifgtl64heRjMYa2RKwbC50XVZxy+HsIrAmyYsQevtInZadonQVhTemRcX\nnAGXr83pZ2AfC8n4mVg8iVEzbNlkBWsYA7+CPNIQGoIaATd8F+PxMoVSTyO5\nX68PG4nRKqwGQdkBM85dGQhpquDQFbrm2Rx/oYxVIg6zj4FKMWUwh0nxDu4e\nv7qLcWe4I8UT4R8gZoLLIZ81qtXiRz0Pio3RfyBr3Qlgt9YjGm7b1WPdgBjL\nHWDGWMMLv5P9+nvjzzqJ4rXPVC3AxAAgpkVpKz4/+Uu0z3S22lb5HCEbqumU\nX2KYPDlqJEYLx7Db+YkKb2jI82Lh0NuSdEDM9oojYjh9MwhcOxo+ddwozWai\nVyKuF6F0WWZz1fO5PmbVcV23o3ONhhzIuD4gnYMl9NwtQYGc46DRM6Ydopwy\n344e\r\n=bbgQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7TEiKbfw49klLKqylGFbFWppYjg6ihZs22BtM/Ph93gIhAMu/XaGlb29dN8pM5E8iwheRAk7JzDIVz7AbwFwOu7c1"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0_1609057918798_0.07810515194913403"},"_hasShrinkwrap":false},"6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.0","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1HkMedlauvut+LooQeqONC43uBGlv27Dk/iiDjTXtqzfViYiBU9/8VAqFdZSGMJvHby+GRpb/MY/yPPC4YcExA==","shasum":"d06a37578fd1b4008e75d0ee59b50fc9eeb2a25a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0.tgz","fileCount":39,"unpackedSize":242051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6EbLCRA9TVsSAnZWagAAQNYP/2zqDJUg75bGnI7CBSue\nRHQz1FZ9fYO3cmOtiIFwglpuqz1ijTpF67G6cJ2ZcQ/km8VZtiGhWN61rMK5\n8nDfLGAb9+Opr2Zk9+JdNetBKBpoOvdK59lDXEg4Pr5VfT70NKv+FTNe87/m\n2RUJGjYqEohOUlhwQB5eV1F5WUWwTe0BSneG71AIn1LZUFCmxO45Ld6xiKxW\n+SNPiQEpFlme3OVV88KuJOktKHJTlPAVEmtUUswdhtw30HH3vE2VGxKWbScN\nyVjE/S/zI5dewbv6cvxR3phcPvA+FLquefcJZlphT/+sYbLsv+YExVtZaRmc\n34qZ8lo6cJtetFDssjA8eP9uqdLy7w71kFZl+2S5xKeojWLcBEGbAM0beNIY\ntpxkMz7XNNWcwlRmeLf+I/wU9zoBJ5KzENKFCxSfGPeDfBltXM6gT3mICbJt\ntCPaPplgA/gc1QGn+B7HojcPCDGKZ4xX0on1hKZskYwebwKap9T5RuV/cDht\nUQqZe4tyJ+W4Ha3vsFiiK8raE2ENbMfJzY7titIu+jT+EBfJUYOJlOxaSdNd\nBNb8skYppuK9sYbIC9vnZDkHtZkUsPaKwHodDkyg0EnIag/bTrRy9M/pRtvK\njxUDEIPSNt+fpXEtgPXq2ovZMgn1QA8B6e7LfkdC0re6L5kP53tCt2zJ1r3K\nCqzS\r\n=hOYR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtww6VZBllPt6TNw+NMWnMBvqXf1RlDAPUolY9Zt7MAQIgB9cU8YpKwKEu+LODHB6+5+/4RkpPFrLQhIqi+GRK0rg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0_1609057994773_0.5886974572354238"},"_hasShrinkwrap":false},"6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.0","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0","gitHead":"794fa2995432c6d1fbc3ae783032d6ae2191d250","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-hvGODWwMlA5Vr7VBT7a5sdQEakEndkz0LiD+MiVARtqx4XVjq6YebPaE4fuHWM9pg4oK6Swsy5nKlxFjFzuoXA==","shasum":"80fd528bc1b6ef3a84730eb1b42b48d55a021f64","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0.tgz","fileCount":39,"unpackedSize":242051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6EdZCRA9TVsSAnZWagAA0aUP/jpD3k85KYkW6wGXNnKR\nkcLY3Ltdxi58EftF/vg4Tq9RRo/nElNFthRAQUhSyWHnRHDaVKY9C28UgyfO\nnvrbdQJI6TzcmJRBgfiXudH2agS4yi5S7H6DGwUpD5xDAQrFJZMU2bUCFPH9\nkQopJSBLKkv8i2d0e69HbomWy6r1Ee1ZrbYSqe7VI8Yf2Lcweet/We6JmEKj\nA5EoFUWbZ1/vwgXBHHmd5CHbK69iGUZLp/5HJQI8xAz6np9FgGAvmO7clf2F\nMnxy+2w8De2aZsG6RtDa/5W75B9C3qa9Tle9acV/PIeg5jayqc9V3PkLJDmU\nqOmWfx0o17Y/asizXpQubnLQKtBnTYFo5KA2ed+I/9ppvWJjVQKgX20BN/TW\ntkevy1qgUeGhKTIWW9H823wGxIVe33wfAB4EGb2RQqI2QbJ2GenZjKKFDIEH\nUXAbmMNZn9KV9bxmk2M7jiyhAWo5JKCZa9o337Qj5cdocuBqLQKJrInw/6aJ\neD/skjUhZfVKJg+WCtqbkIOPufFuzrIQZ6Lx0k1Ul+uwGwcjQhYtL+Lo+U0W\nYPV1e1/sh8L697amq3W4TUTPepiqEi8V+4kl1zT6WCfwtrZUHxuFqhbu2dsF\ncvfYZcdsos3If/Pgqp9ondw20a1w96E3+Nm72aiapxGp8TlB0kU0304n0jc4\n4WPi\r\n=DWj5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBew5RQRQS4ZSiaLweKNk5ei0bplddZUNFjqU/dX+ch4AiEA2hcvipLd4J8nOiJeDHRPNf/hJqkJG2wSs9aqsqYXsyk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0_1609058137311_0.551306218316008"},"_hasShrinkwrap":false},"6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0","gitHead":"7c1c57143fe656728c38a3812b4aaa7bcb88dc82","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SYZbvc+cqH138byPNNhJ4vFc+5886Fv+X/AoT0tdNVVd5q7lnwvKKq/7JoBoHQtEF0lchRRkxHK/pdsmGmbcLw==","shasum":"ce358d589bf105dd418b7560251c66d4f805faeb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0.tgz","fileCount":39,"unpackedSize":242051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6am3CRA9TVsSAnZWagAAwgkP/2PqbyLWuigiMKCIlSWU\nc0ccz6vA+KUPRWKlKjA0pO4iBCDLkU2gUwLnv3JP4wl4VDgeyQBYKAjmBRyI\nba95INgP7WTOYYUVuCNBskTQmwQnIp6AHWk9qGhbmEOPJAbSWJ4L7RioCZ71\nuqYX1izgTMOa6Vc4S9meANngzCJ7U8+qgiaHZEM06+MKRokOalNFA26LmnDV\nyHYs6J5LsSTJIXrUO6sCPvfYbe8okZdAbi4lvIg9jz/zKSeiHvPe1WZYXFrI\nmm097DFv7S2XqSS4rm8Odg7tYKEKjqBcrapjdSd2Jm64h+/1PtomMa/IMh/t\nBjmbkwkW2qpjM49o+XB2CH06WPdrpC9GD8ant+Vb2bLW5bx0K/tTJb28Es1R\nVIh3eBKTEaUkEi4OWfeWvnRGmTeXiINHVwGtdeV7BaI1CRRFiZgpllQPk5gI\nsbmIFtZ9IOiIl7V7Aza13MkVKJJxmpTfDNn+g9kfGG2mCxAxw234cx32+/Mf\n2GjBrx9Wg0ONn1fxv8kmCY9T9Ds9jqzervZaEfygojUN/Gf1Gxl7eD2PPwIh\nr1unLMdW4d03/In5lzFGQp7AfgRbGEpDzA/GvFal2VetybkfOIe0e5E0qxs0\noVIAJWHzGrF5lFwzoQfpN/RduEsjIXGN1EJcH1wJPy6t+uU9SPAJDL92Qe05\n39Tm\r\n=aPb1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXK5q3IblgpxENBtVx3cOyJ2m5rU4P1BrsvtjdyzpwAQIgbZfPpf2sZfVpQe1N/0rVnlSFPmE6MswKkzlbvwxDurU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0_1609148855084_0.8361791640872795"},"_hasShrinkwrap":false},"6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"93c2c3e66e3dbb0c71cde9ee72f53473642f5a97","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-xMEBXuvetGIqb3QECM9kC+slW8eK3vvocpnJ2COhmLMpo0iz8ro7X7ot06x2B0ACuCcY6LdRlBT/mhg9yy4j5A==","shasum":"e1b99854f9b890d58bd01aaf491fb8bb9319c147","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0.tgz","fileCount":39,"unpackedSize":242051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6an9CRA9TVsSAnZWagAAa6oP/jfJ2PCyDdt+wxsXCJNC\nX3FddqdfUBJ2bCvrJkeuutPemvLJllVn86BLi5xiZ52J/Tiq69GiqiI3ysKP\n1cn3+gLnRHmPao1yw+0FgfmvUplw/D8OvFoYKrRVyOTCCInL77vJV63EE4mB\nLhyUlvEwr7ITmhKndUptvNnalB36YnNe1NDhLMFblN+4SpOQiVa11ediUFnK\nEWzEbBHmmUQJOHhNvxeMRRst6kzBmX9KCw1g5t5fuQQfTfYh9jwQGP8DAYei\nyAjBHfTquaP/LktxKuq8a0XHsN0ePg1T2PrIJKQ7VRWLqMIIS7A3/7nt/Mw9\ntZCz7B9lLPKufqTaOiXJ1h1wdyWDIEgUGU0Ud6OwYRnuB/2V2PfjqpqoAi5E\nqLqlNoMf8djpOP2potc4LuiQEuEjjP33BvsY2YDSw+EUU/cSl5oT4r4FvZEh\nBvBCfjVu0MXDKj1LrEKlBfeDqjAdtz3xn5wUknUo5DWC77/10dKApQE5StQ+\nM4W54shxZnRRC+Ev9e46m15Ik1M2FTDsFsOQPGupbBEvbRZU4bYuKXOlulMp\ne9kc266dmUPAt5IcszjbfFVp1BlpJve3bdFdNYRX8sqSDpubkUIP/xe8r0br\n+/vvI55Lq5Tq/Of/AoSRkU06h6IG3bT3Kdj0WYVTpLno+Z9YP2sJrvwRiUQ3\nbfAD\r\n=nafX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGIArIFg4jlXll4D42hoFQBe+rhlkqHuybo/MAv1A26wIgc+FpZUKkCkApTP5oRDuz0/VxSjzLWqBXb+cGn++7Zjc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0_1609148924708_0.36559299147071567"},"_hasShrinkwrap":false},"6.4.34":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.34","gitHead":"d2689d6d8fea8a1fbab29f1154648016dd4800b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.34","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UibLbY4OK9ZTVK0G6xDIhBv7WGTxkKrWBQXfRnh/9myp73vbIpw4AYB7FhHoJOI9Hldl5Ju5Ap5KG8cyaFhoqg==","shasum":"b7a9a1c41f1b152a3f1d63b60720e2f06a101434","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.34.tgz","fileCount":39,"unpackedSize":242283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6aoXCRA9TVsSAnZWagAAykgP+wdKlq3/GJPVWXQ6/JtP\nndIzKl04PJWNQM5HfsUDJd8VRnFwZqL6niO/yFnHRLyNsv1HopL42IbdUa+e\n8+tDjhxN0fp93mxr0PYoVQMY3WgYfxcrliGuVzD4obnuJ+fcmq8OitathoxO\nHmgTNS1SnJAjXBOvutyCgS2Ct/HKJBoZq4jzoRdboXl3quf8u1V6J9Hou9c2\n1eyw9Qam7IMvw8TJKhVpDj6uIjBB6aoHpzfsasN2b8LOIjBalv+4l0FWDGE9\nmUN7G6neGYbIQ9K/uam5zjO3aEAdhu4MBAoNt6UJI/B1bdLCBO5QkJw84jLJ\nvQMrHB2Dny51koYurSA2c6JWD1s7oxVMs6OOWuzPV9lrLRRjlXnNekLy6B0W\nyRQ/FwyuEvQdBn+zRsCC2Dg9cJ6DWTm919H87BZlI+zDxv+QG0BTpSsBMz1a\nTVngwl6uEVxEBlrHiAyfTUK4yQYr9/hewdgtWJAG9Jd6W6D0ddu7BQL9b0zs\n8LZnRAGrjLIJE55+ZdIjc6FGmYEAtxRt3Y9Zu9dhY44vdCommjAoa/6m2zhV\neuJS+PAX39UiiOxYS/WENtMRjZTRTebOL/1tSsw+e0wviUilou0K0AoHU2cl\nJ4Ufr4b2LBjvEN9TODFn3ZhA2uXvGnnaqsfdjxSb9WDWijAk1TjCSF/NovYh\nwvyO\r\n=WAk9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCitfDXPtd1zZVYfSpUkGmvLzk5VDOPxbS5QC96w2tUQwIhAPmC/ck4JC3eCXJp7b4gaU62PrFhKtif+TzkOrZ/XAlF"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.34_1609148950974_0.11526181146552328"},"_hasShrinkwrap":false},"6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d2689d6d8fea8a1fbab29f1154648016dd4800b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mePZoulL66jNa3uzBFnjyrA84mVUJynsNWQMMp3TEnctJ1grYpL5iSxDbDFZsilrm0P9xMb6UyvviD641fqlQA==","shasum":"fcce32290e10080d107e311468d1fbe8acdeef69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0.tgz","fileCount":39,"unpackedSize":242326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6aozCRA9TVsSAnZWagAA5k8P/1haFF/oLU3VeQdkDRPB\nvWUkKnWJ34yEOET1D6HLTTgzYI2C303z2ilAYFAIIrHf7NS6ZocqdiOHyYOY\nqS+TriwJmePuIskUdyz2GvFN06SfqJaiUHzWZaF97TclUryffwRCT9/kFplk\nWqV+Jofx4gVy4ErS3fdDwF/ElQKzYQiNHLX4HpcCiR++3uPIcUrETOlKA0U9\nMfStJ3T6OhD0oZD+H046CDIdDplXX9L8y8zK+Rp4SykWXStKfmryrj5aYKyj\nta7R5ItGf3FCE9mpS447rAgkGE1hQCZKoBiEEmEBnwHpNkmAOf4RxiphFCr4\nhUaGGyT1Fmzb/GUtr+WipmPXRWkEp6YYv/x9C1oNAFXPCMi4zEDxIrGCHgki\nC7+tfn+gh6Goinl26B5kA7uT8m5+IslMN6sdTK7a714K/rY7oL1Hx/N/uDGO\nNPo7Ua3HonWy8frjklYCr0tYPnur/4u++2q3sggEK3ooaxuP4E5VasCvOa7h\nLCyUE0TVNO24f2HmfVS9tjClGN91STi8zRtMuwM1jxD+U/SQFHGZWV8Wize2\nGu5lVQOxHPGylt/x75stSywJSEHX88/lZpLUGUUddDK25mt6r6a8351wD1CT\nWzVw+JRAlgz89IERTC8tmHcNpGNM4ENafKpptjOTwY8Iwrdf5m+ssnweSan+\n7uOC\r\n=F+pr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICO0YVO/oiaYwHHBi/xXP89FOpG4F2JP51PtP7fVnLYXAiEAjESMagx/UPAlY1i1Z2hFo94PJvt5fFA96BlTXR541WM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0_1609148979395_0.4296751607783247"},"_hasShrinkwrap":false},"6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.16","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0","gitHead":"28a43cd6a00156817aae87e0a15f8b3bdf95ccb4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qOj558W4JPPbgKtLbbYqDnlRIBJ20OWwHUelMZnsWUbznIXaRCmzO0T7g7kXLz7ej1eUQAtgIsRczzrFJuFi1w==","shasum":"87faf015a945134e6633d3fdfa4ea89fafeb8b93","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0.tgz","fileCount":39,"unpackedSize":242326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6aqfCRA9TVsSAnZWagAAR6AP/264VrlqkxXMxt4Z3Sz8\nxBZPndCvvPpHXTUdAlUJwUyUTQ60+g3KUyFARFtG+AdU1CFzAVwpdmpXnxvs\ncyFMpszQ5hcS9EQX2Yo4ycBj/qgOBBY/YUMNDVFEOtH854jp03Fd4VMJpVVA\nuBWMCNQXQlNx/NaCtTxmc6A0nmefK7AqaqE0RKF9CTeKt3665AGpdv/UB2aE\nNeSNl379+HFt0KAmjnb4MsxKSm3vPMIfkWhKMjU8yfuhdK2JYMgOIyUuhQvd\nndrmD/A2AigBW9Py3dMbq0/3aoZWS4g9Pod5s/yK4nonkpESxjpWxxCB7b4R\nG/3y4xK5qfmDxv9DV9OZH7OlVd5+8gGHMGNntpHIYAPLwGsBprMn5KO/9T6R\nwGM6gEKB7hw89yQSXHNxzrGZVSZZYAQw6m1pzC9uvUtX+YCTltwyCOcRjqPY\n94FOiHgHsJfYPwSxytkVZGBBkQ0sGGss09RXaOefsZZZ5RXmwSficOnDkX9p\nk04GoEPsWgXQH658cgQ/EES1scpW1eLWOYBv0Pi0n0whPdRCFBXE8YWB9gfJ\n5Uzd6FsXN0pp3a3ddfXlooOBdEcZ0xLpTvbM/J1c2gkfTsoZ2FLGb4O7Ro1E\nuIlk+MG0KaxxEvvDzo951bnfArdqk6FFJgXBtsUuU3Y/wBDshh0hKO4T8DrT\nAB7J\r\n=/V8E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb2Dzt9eS0Q9dVvLNPlzRbMGaue06D5p2EGni1KqI7LAiAalqfPCdeVIeV0EzDcsiqQj91porYUDlbtbsrcpRAEkA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0_1609149086580_0.791820757897896"},"_hasShrinkwrap":false},"6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0","gitHead":"68650bf87f18cbe7abb7753433aa572b6570cac5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-lQvhzsymuhdhLVgAeqFnhSnTLCei41z46wJKL/Cd/uVkK23P+Y9p6BCaAGi6PCTz7RqkPMAggtEM8y6Udv6Rag==","shasum":"75d669fe303402d96b3abec0ab8c7c373f9c3521","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0.tgz","fileCount":39,"unpackedSize":242326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PFhCRA9TVsSAnZWagAAw7cP/R6+y35fggMrzJpIa1Fi\naaJp88BtPinSj67YcFiEROdqnGI7Tu86uwHX/09IrxqxdUN+2c1GhDzT7qBH\n0K98YvstuUQv71e5WHCMMO97XX4+9oc8AioiC3B7EEpKDrk70QbmEnAaQ7M2\nPUf7GmMwB6+rXp0Hmoz98MZ5e4Lh9hjNVF5gYVg5KnC8Qq/pjCXZ97ILskrj\nn/J2mLyUhUmSxzPPvlKRAbaNkhc3xZIL2u7DpSy7A+6aIgsXDQqt5wz0jX/K\nvlU1cuAaSYhPNdfwljgX/pRau2GO9lDXuEz0IKOKkVrBOiR0eID1/1QcP4TA\nRLpj/To0DaKmNdDkluyTjZ2kHVCqomSXVjmDIulBRMQaD62MqamqPOsQzx3f\n59BxJsaVx//4eUxPDA0QZM+ih0WHD5SIj4E3B9lz6KBll8vtU5mp24oykrKb\n/MyunfKvhNArF33pU56cxItZyRCKNo020DvUlibWFThzR91li1tCejcrxAU1\n+Argrc4F31vsEpAf94H/0CTfXOl5UtGmfKvKIR/iPrsZ31qQSnWVWiJTDoRB\nDeuYxwnIJctZcSoGTeUW0QbKjX9zFFqZzQ1ZVOd1zLpiLE/9DpTrWY0LLwJn\nI4q5+/WDEu8pFaMi7xSI2hMXGIk1gEuyF83M10feanF0CLRtkQcNjg0GKEvQ\n3pYG\r\n=7PZp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5NhXqfvCok7Uv+qAlOBK8e29Map8jyoAKvECioYzxtAiEA2SzhCZBKeSD8pgs/UYH1n2kqWxmZHXIxZigchluBlgY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0_1609363808573_0.5977623870789228"},"_hasShrinkwrap":false},"6.4.35":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.35","gitHead":"86729c028fea6800a0e32544b521e7d7df796e1b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.35","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MPARAgM2RHMN91MJxTKS1kfYb3mlHdfgErCjZrR4tptznz3SPTwg1VX27FGYuL5pXEUFrAsJHZKxq/DVzTTmCw==","shasum":"f6ebcd6aadeff6837612cb028bdd5e969e070c88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.35.tgz","fileCount":39,"unpackedSize":242569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PHNCRA9TVsSAnZWagAAEBQP/18rueZjg/Lw3ERi+te7\nmFDpuR+bZ0OT6smTjDAGQef6h8t2kuYXCFzJ2J1CXGEynRpYXNb4olxUD2qy\nj2qAyS5f5Pnj3uBl/XHIFe1paZQDlha/wSM9w3s3VcTNzQpeb7gkk2mG7pU0\nAE0vuRQ7LyYuypzecxqraaszVa3qvJUKlQoEwVbil18VD7RwruK6XsCIkEPs\nwyDnpQcsadgv7eD3PCgeWnuCy59Zd5d8nMcTLlqydAHnQtr1do2Szdq/39s6\nWoMr62ji/cSmXTDtTz5c40CR5RrZ6vO7RLLhcRTa/3LlLIyq6Y3QfijH7VSR\n5xCW3AX/EP1WCZFw8ty/htuP/LerTw+2HiHCdPQeiPIhrmIBJ+u+4NS1QPdV\nzB8yh4nprKyktIi/ziq204gCgfmxH7oN4dxhYEz+vu9NLuxQ63Y+7mfB/pV2\nGlhHQ9accvsjiLuNJfMwoXrOrd/TPjO2A2I+uIN4ejTePmq6f3IDLC3lMvy8\nLqmxqjb5IuBjuQgCjMvVl+6AiKXzpYY0ifIJl3pcqafIc6Nlh8K9+YMwmc0A\nFMeX3a933bf5j15f02l+7lrNBeB58PXt6UC5RZZ84z88IY0XJCDjCBxA6giY\nx/Cr0r6YiLN5VSLDXGyzlu6jrsu8HbnZ/Sv00dGzbj806ASEPEwn8U/a+fWm\nf8Y/\r\n=OKnG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpK/C77W9WLKeyq68OBC9mfwzDgVE+G/IUwmUzBRW8VAiAibvC2kyeaKxVV2AcaaSviEzCXnfitmL3Su97/7yjEnw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.35_1609363917120_0.17065091216979522"},"_hasShrinkwrap":false},"6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"86729c028fea6800a0e32544b521e7d7df796e1b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5yVJ2Sdu2lozUODM/2mrJVBz/PU3qovQen+G+oHLeKUPBQuuCF4MJRcYx4MCoU/vpLyv+vICaLCWGgceed7iEA==","shasum":"d3d2082d0c02c834dbbbf7d2b5eccc795f239236","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0.tgz","fileCount":39,"unpackedSize":242612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PHjCRA9TVsSAnZWagAAFTUP+webnRvHDDPX9NDlUiiL\nmfT5cKd/SlQpDS+eDKZXxCvVFLfuGMf0omlowhygtGJNr8yK15UzIOOK7Bp9\nLVc8B69ng1kvhQTNUI5qLqVVUn+oPnQaFC+3jTqAWUjVIREI5OypmIF81Mlo\n01ZSGpbA3g0jo9hpD+exsvvxNmsQfpq+CALwiubGdCxdRn4AD3nnX9RzfKjz\nHlCdqVo44Mv1WjkSyjZxSf+zVzVLMqvgrPiWi5sVJOwmnyMQ7HBxlCh538xf\nPyYI+C6qMO+LAK21l5OPCH/qHkhpoyOAhVaMOYW/mE7XELRhHV/IYokFNatD\ntAxN6OcxVheAOGtUzgapu2azPU7/xnyoGlFQZxuA6/qu0zLPND7I48kqNRQb\ny4FP10UNNhKezfuHKThiDWUQ0noR9+ioYZYzFoq/WDpdjNd014CNSHQSXJWU\npxG8m0JPFyskBNn91WL9J2CFZed1S8GJfYHRVdk59wQAwxUb1M15wclatLWz\nRDpjEc6lfl3Ypqhexll7Omsy8NQftpgSteA3J9t19AGBvFl+Ul7wgkZ12+Ae\nlxlLO4Ek33pOc3Au0s9jpWaRnks2iUJ+kOv9DZKhkuhSO2ByKPpW36nAQ2Wz\n1kNv6aw1czR7YIkS5iroQ95lUQl1wC3KC1ztLuPhR4l/MKX+ZDzM4mbaC0dU\nfltH\r\n=41jl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTF5rrb+/UOUmBTQnH0DsNU/EMk/lyiqOFlW4D82MXmwIhAM98rEzEd02H22X1BgsxuBqw3M777c+Oypf2ki77wXeZ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0_1609363938353_0.5670033395194141"},"_hasShrinkwrap":false},"6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.1","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0","gitHead":"25dffa546edfa9062a5bf916e918d43f9c505bba","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-GV83ouj3MVWg+B7S3yQNoHw7pVVejNkgsGN+AuzSPylOElNj4f6Io5C/L3fFogLvvJdFfjU3SQYTmwye1e4uiA==","shasum":"518ad0770198b81ac32b8f9e16572120761fea85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0.tgz","fileCount":39,"unpackedSize":242612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PJtCRA9TVsSAnZWagAAszcP/3PkGqk25Zr0e34/FhzN\nHz9R9JVgE5GZA4aKxFKhHwaRcvAR5AWXkTZCINRN0OG6P4e1R5vGm3hfvcAG\nJvbrGTxj8g2luIUS/iDo2bvltRQItkM0/AW8y5HaFk4SJjyMlQ4olrHy2hRQ\nodVQJurihqJNt+2605+tqzcVBCtbLeleYDYaqbPNPjsAh7+0FxMmrxseK8WV\nnIw3sKPBfKCagaYXH//5BOBxyt5M10++yl5s9pjQGz8YK+Nfd03G6UZW+GHF\nMK+6vJeVi1yoqjAdcr2kvrHCywdI8JaNjGwIhMjo+yJWTcWyTTpvvMQmWjT5\nqDzp2o4ae2MgOPJIDba7+sSZfPc4NcBLJT/Ok/2B89VVCv4CRsg8K2S+RRx8\nFsJ6Ag+NB/DQlPtq4ROVgWdVE6wa7hKFVSkreREAgObLj8et0VkpcG3eO7xT\necURPvEno/U7mst6ijj3G+0k3m1TDHpNAA069pwXIE95M61+Juqk6TyJrc7l\ntJSlRSIEqRiyhxXKXmQsgl/ZKL55thP+TzyjKBk3+GuFQXwq5yKTPFbTW1wU\nOqzYC3B02RuTTKK0lpqb01cNm6iOQrwUR5GwnFRk8daCvGjBIqQs7zn082XL\nMpv6K68nahmrlNVsU97xoWWWjAl+K5g/GkDHK7GBEOYIcGyBnE0hvG/Gp8En\nymje\r\n=6wtm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6unrPnKqet9HGtxcUg5k+V43sTMnbov8bCLiqrmkuxAiAck4UaddK8NHN+GhgiU/mIpmxji6sjlPnlE8HN0Dv9og=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0_1609364076735_0.9531561311557373"},"_hasShrinkwrap":false},"6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0","gitHead":"5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-P5ckmFqZZjAP/TsNvADcyxQr1tabXNd8zaaa0+o9A64GFGtP0M3LrjxqHo/fRVmphugsmalfQX668LYJaAeJtA==","shasum":"fb9737685bb5ed17bfc10db89368e33ef50d224e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0.tgz","fileCount":39,"unpackedSize":242612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7doWCRA9TVsSAnZWagAA9lcQAKFaLpPcWX5HSNRejMma\nEfoHc08zjFqkrDvpC+Y7muPxKQLWrEa04+pIYIqZYpH2PF0HrK+kYUxzbp2v\nLXD7kc23HNVoAbpPnJv7DzukPx7qG5kzysRm3t7YLbfs2/BgI9o7Aad9xxwU\no+CRPvZ0VDYo7udDts/XqD2Su50bdpDTLtKr2kIasXsFUyCz+co67ebl9oBu\nmtdb2EMswlo4Vo3fZ3R/DKkNMTRagn/WZbKzpHnMonF6g7IzvIH0zaqWERXd\nYaGGEDoQiU8VnLnSlltWcfZqcy1t7lj6hnm4TmMx6LqdITUfj9/8g4g8S7Jf\ndutUCH6iRF58am+519h4S9gJxo+c+7sflOSwdz4bWW5OTfyu1TXxwzJwiRre\nc0TdRLLuQ6/6dkMFL4yDGPpeZURwQ5iQmLhb7usRVqtF6xumMqmpW8oHqv6+\nW9vy+BRV5LJWnzlqJ/ViApUcPox6nduYag1EeXNY/rNGijJfsP2CPK/Xgtw/\n8XGJJmYTNPvW/gQ6xwSd45Lbv0w5oT2csbi1v9ZB6OHYKTBTcl5aYbVP+aMY\nneWMbXxY8izkF0m4+GBIY0jl8DL5p2z4IwHRjLFOkPIkjvhw2pXgXrkdhm42\nnrRy5cS6CLQK4/0JmURugdEd4XdCf/dIzxMzKr3sI0bsBF8NUMV9Arx16HbO\nJUgu\r\n=cxWJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMPsNXP+QMIwxVUQLMhpfr+G2EuYYcaXORC2v1hO2I3AiBOUj3dH+30NIaPpdbj/v7Kxknro5q1ELUKhTmjBTpnRA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0_1609423381786_0.06607442406534614"},"_hasShrinkwrap":false},"6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0e037f0ebadb6314321c790bca98dfc3de2e3b1f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-n0pZJOZNSfspkuAVLSn2ywn9/JZ31izssA3wVyRpbIEGDjXfXaMFn+u7ydtCcWZhaybJLNOVq2+jPHx2POUEWw==","shasum":"af64a396678c21a30230439cf53e3a083517b61f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0.tgz","fileCount":39,"unpackedSize":242612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7dqSCRA9TVsSAnZWagAA8YcP/1PaiivHyo57Loo2Lgv7\nm0LPH2KIXVfwKHdmYGgwDUkDHC2RNDfU0l00rEQkJ611dKEqFMnDOICh6awH\nToQZMCjTc2M+VaC9t1X9KpZK9eJkaHDaZUwfTKG4YmXPGRcKb1ZKzwOzwRBt\nx1ZznH6gwXeRxcxg+BUo3n2Xlml2LiXapa/G+Efc1K0cyxmD34bio2IJWxuF\nUmzR8HmxUiohgBMJqwn/axJ/6y6hpgLpcXoPa/Dn4w7xNyvwBSlB3XDkkUV0\nrLpx6JxlEEReAmwxk6vpJiZdJk96jn6SXvdwYYgwVGVGNrV5VLBQ2Q+1Iyww\nJVqXBujFRNeL71etqrFY5UOH8IRPiw6PV0bOZJlN6+P7O5t2Op2svBc78C0r\nL8Rv9Mbr+EQyWqz02Pl8bP5OHJ/TtVYBJMczzqnm11RiuzwLS7W3JNcnIUqZ\nRbcC9SJ2O/RPoGdT6xxsYriGLSYf2yQ5se0pny4lty5x101I1KJHYJlrOdbI\nDOfD1SNfsJVSGiT1DHE1HEN+WZRwMHWemMbiud6A4S62//NZ26li3iKdv2Mr\nUmqFH2UM4DFCBI3jmkSOwMkTILKcjYNe9poEpwOlNj/qGa8+N4pKGFGRNY1x\n2p5kspu56AfYAI6SOEvLLzYQaIAXtDUPArlS6Q0UMbkuYj4E1GGJqZtlHfyq\n8yDk\r\n=4f/R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAVKrmH/omzV58X2Ke+5PwgSInlrvOlqclKvEwy5Uxl2AiBkcHYU7go/h4jsSvRs5tSx52JBYa9Ncp4nC04+2ukUaA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0_1609423505891_0.9829238609453228"},"_hasShrinkwrap":false},"6.4.36":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.36","gitHead":"5dd2122e379ea5d29d9273eca3136757e8d7e6a7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.36","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-tpbQ4/SvJsI9GTyd1uSHQ5LhoPoJL3PDyrZb5+wN2zrL5DipVGneoj0JJJspAAhOscNRRCpX7hFFEj/M+Qy9GA==","shasum":"20190ae5869cee09cb0686f007a5b0380c29032a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.36.tgz","fileCount":39,"unpackedSize":242844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7drZCRA9TVsSAnZWagAAjycQAJKp0Jm5gU9gvuIs52mJ\nDgfHiAPhJN9ZnziX25eba0y9iEswzdh71UijQcUJYSsmmMMGFIOVR/dZUt51\nlL1sQNe4e+HvhSFaQlYLiWoCemX6lgiLitqADvkE6UIFsYVuejh4fOX25UgO\n+gOWLLQ1EkP53jKUlr0kudm0yCTg27m56gcsEIZrb4Gtlr9RD9N5hYsl0j2t\nSTFgLjD4IzsBXmCNGH+YE4glvQJBz+1oJsigp8MaItc7Til5tIIzTIunyi8a\nbtf/i/cVmyVtRJrDtkmw728q4EyLfhd4lQ9AcnMRt7uMClpq5g4+PcPosP16\ncuT+o9Qw6VoxzaO+ohZDYtMuQZCi56V/gybjLq+uR3XS8eQlONP2UPV5JRhV\nEtV+vm/zTWvcyyQvRktQbk8vGr3n0fowFI2F4o88iuyJ303fsOW6t/ZGaOvp\nHzRB8xVy831p8seF/5vWwAnb/V4bHP4NkueE4RXw/hXfEhdQlf/AlyI6jdsS\nQUPU1ltk2CldvRGRY3U5SXeocptPJdFiNWq0LPtTHKAXZhu58tTCgBEVNtbq\nmokzxmPp3pwhMdyfG3clgZ4KL3rTq4XoT4yo+E4HvucfxS6iYXVrp5Z6N2IX\n089K3GaTYfADys64mb9Vkxeg/n56tBdY9U7DScLBR9hFPN0WU1Zi0PEwzr0m\n+Ykv\r\n=95lc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEovQfz7PHcjHbz8kKZCEwetIJpHcHjLswg8IU+hWq74AiEAoHDbAmbuydS8jwvJLJEK0m9NquflLgQYNllhwmen64s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.36_1609423577102_0.5148207907620677"},"_hasShrinkwrap":false},"6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5dd2122e379ea5d29d9273eca3136757e8d7e6a7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-R2DWozMQSAfW/AMWtKxOr06kVeKkj88FgRhd6WIB+xmoI8a4B8weroSda5Gn4QJ3LcgX8K5Bqj6758faMmQVww==","shasum":"9b2b18d42f1453d128ff87610130d79fa7bdcf92","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0.tgz","fileCount":39,"unpackedSize":242887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7duGCRA9TVsSAnZWagAAOvQP/2s0e5WtWwg9yEuHWQx6\nJGp4TYQvcjZQJqI1yBhmW1Hiz6k3kaqQwS03m4LzBGLSQ0iEK2a7knSVivev\n46fIEbk2XwCb9p5gR9kG7NRFePScOCWiHJEB/0CMg/fLzb5Vj5sYddM1nD3i\nwAgDi+6SWYy6AscwEvOGYkOw50w06kVTiots5aev9pTsbJiF9ihZlcV1n5SU\nyFo+qNUbFXRshUwBmg/s+lxITtTO5hi+T4ZjWnePtoHCwKOQN0pfSAA5F9JZ\nuCl5M2JH+88ykIVjkUZkWZvFOFk0NFSZ8ghIc4+4PbQkzZzuuu6Oj1Qow+15\n83JYceBM1izKpC69zHe6Nlc9GouupPRpokCw67Hn3ignaGlo6rWDOV85v9rh\nlFicJ9D82TXEx4DfvAp2NURZH1/OxRjcPEt41FCz+XGcqAxiqLDfhlPE/CYA\ndCx4JxfcYxgYn1daSeH/WzpfBsK1+1Z+jWb8TwI7jWwrGKXp58BBsnr0CWbw\nULLijNnHjsxZtx4sComnELpDkflU7Aof4i8umxGOCPIdIv+k4HcMqx4PcfhR\nYvnxOfZe02UVmEAkOSEsUsc+47TOc0QVC0bL9QWtXSCPT0n8akFKSL3ug4y9\nTS8HCr+XHSsNatN7cB2TY79BfnKIk9/HGWZjEO0tYvhSj0qkle8cQzBuhD3L\nJLwG\r\n=IEnr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUWn4/d0V1qoQJHydbSujVBiPpB1bFH1vdmFUt+po24AIhAKO3bfudbmZKf3daG78pOm05qkGrMJvCGpYimWPnM/G1"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0_1609423749947_0.2109909124418936"},"_hasShrinkwrap":false},"6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0","gitHead":"6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ROukEs6ex0/JcKuM4aFhuS3gZJx4kcFw3+rUCkYiEvxjoZb7ohlCyUZ8bqhKyqrjEbYcu5m/HE4ul0YaL2Tkgg==","shasum":"3fd3fd433fb1ed0097e4b2b0336d0b6a50f7f0c7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0.tgz","fileCount":39,"unpackedSize":242887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7dufCRA9TVsSAnZWagAAwpwQAIatAAht3nazdWpZBF4Z\n9NnCDXTmxEozo71MxmW4hxQH177/e2ooWh75+tMAtJBcCW5mZlATNIJq1sQf\nRMzZYfZF+oFsFRUq0lkt7S8u5J73n4CZwCZoKL8BEASd3rNYokn1m/lnfmNT\nVN+qBnqzJUSK5EHB185VwwlJvF9BSiVlIgzZlPUmL8jnJdHfLqWTIN26WEXd\n8pL9Q0JQ5Qk3dpyhrqNqxr7xIH1RLPB31qBe1ch5QEQJYt25FjjjkZH/dnr1\nqJk0D50kGRZgiOoeNIsATT26narpuyn1xIwUySBw5pA2OZZ3eRx5lgsIIxtN\nWJOUr6ptvdtkSQvELfL+gcGztyCuJb+E91+QFoGGd1F9LCwTY21fHrJ2ZSny\nPq5LpXf/gKS5GWzyF6wdqs/rQnoz0eYByzCh7bHaqAqWnorsIvtbQ1z9KlQ2\nHjMqO/LNk5m9KO41g4xt1znrXJjhXoewDQeS+lGJqbYxup3vLAnUyT5mXYse\nBPaCMRO6aW3rHtjJw2Ikty0Y77kbGNksmilC9LP3A8/Rr2dnPmtuwB6xhWlV\nO+3o4IZmVkYjIccE5ZPTW9MCKr95fDQR56lJ7B55G/oDIPB3CZLfb5hQLHA3\n5L0HTEE62BtQFmATUbLN3o8DcafpXTLBP0U+VfAm7nyi6ysKDiy982ApzilZ\nla8R\r\n=8xHZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIvjcTOe2XTdVuECp0VLAAVZYXbeIY+f9pg+yRALn5pQIgMrxVGiXMBmCE1IE+wrYnmJTNfi9H/MAAG3vaLIraxbE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0_1609423774893_0.47714261450049733"},"_hasShrinkwrap":false},"6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.17","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0","gitHead":"8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-il1dEMx++A36IsDOHs17f4pfKJB1qm+MZE9TEDlSb4at+I1rlkx/pBulHlENuVXBRbz18EFOFAuC8q8wJTHFcQ==","shasum":"6446ef12869d9329c1e5eb95dc8e045682834a03","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0.tgz","fileCount":39,"unpackedSize":242887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7dv2CRA9TVsSAnZWagAA+GYP/15yw80ofMEVKQYO+ngB\n6K3PgdqHH/LqTPuTCVQSotyxcWh0EJDL+VH0SvEgSKxgx5zq2NNB+jRzSgUd\nNWZVV9VunJpmYg1NDomTGj/MDqwptAdBP10UiDL3T5Q5lQwxXzbdjlYlL4/u\nGip6I73rKVLhGRtqlD294M8PjPOc91fGqyr0XFxhj+WYu6ZtBlBpQ21AX0gx\nvzNF/b3Z8LiU5UCUht4BKQVyywWxZHFynhrYj6Z3lybRBgCMeIo+AzXa0Fa2\nDOLxJZJzGjfBqDEx7Cxmvp4TrHwnGutR0dlQCXm5XqFjtQkE7/Fg7dyVm0lf\nCGlS4t5AQC6PgTD828MQV6FBh5p9DU3Btz1nmXLmYf6O9cLHREKnS6Vwk6ZL\nfj7ZzJhYyIab0qsBCBYJA2E4ACh22VdDopFLsp83cwKIVsJAk9l1u85sHKP9\njcRIkv4r6tV4h38mXRtWS9ohVHNKC/PBFycP+flqNFPnoLpnkSvdcQNM8vAE\nP8k3VzyaxHKc60gJHdgWse3mv3nPwdixK1LAVQMCNLpsAu332E9Ni1+Jm10d\noMOCPgsOtYnYjWs0hnjYA47fKExKm/vC2LIwdLcnEFbiSgOnl//1a8EBQmaD\n831Hb4SV4gYxKdGGGl3+2IrbYIWu9YRAzJmn3Uue5ylYrUjQb/04nUEzkPLg\nZVyY\r\n=lNRC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkDMN2zNN6XYxDeQZgGYnAGIKL9+wB/FYkyMAdLYM66AIgdHYFHB+saYArAvjP7pwOHPmBl/IiNUMYRlqHXIwdKiQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0_1609423861961_0.8868672730736842"},"_hasShrinkwrap":false},"6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.18","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0","gitHead":"12f28df622da8f3d3d45d6619a3d93f1b92c686b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JQxIHSmo1eFjbiQ2Z1U8COWr6+46ODVwf+zoFOi2tVbV4WyD2ZuAItB6IrIAmTWCc327vDU30BsWzUGkYirYZA==","shasum":"c4c324d6f2971fbfb6e947d38da84c7621f355fb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0.tgz","fileCount":39,"unpackedSize":242887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72FGCRA9TVsSAnZWagAATlIP/0n+OlcL4x77SmC9quYw\nSB9dIqSybmhvD9dTTMX5yG7CBUTFv31TxngZHqW5pXuFLwWjxqju8hNHh+On\nguQCM2TBGyK4QgqOnoHhhjB3COluMzT1WCj8ywczvALgI7vhQG64wSSCvZeM\nV+fSl5Bh0IuUo494/4EtD5+Oxurf2JiIEvgJQOryT9uVDww3U4uTRCUD5+gA\ndW+6DypCSubDc6rf5iLSHJGaDXwZ3TFD22t00sBzKpTp8IyCxanA4k3njh6Y\nsJIjn9Dvp02oZeZOohx3jREubfor9FMvEL0TIjR6hTYuJQBoAe5tn+nYe+xp\nzgkMnjwlO1HKeoNg8cNo1Rq0oaJvg1wsbxAUh5MD1UU38D9ZHjiq7tYMyAMe\nbHnZwkhqP8BhtpOL8fz5xQ/lgaYCXfzwwrUjtAxFLToeacjszvyqLze/ebOs\nwJT1J+oPODH7cfOFZ3DDlEYX2UnGdEOzGXiQJtR2tHnw8FguwOd6NPxSJIBb\n1gsdPkEp/YJDlqvdqA+jOz+GdOM5JUI59uBiQYnBn1ZZTWEEVPlpIqtDBifI\nycgXaxTnOWYeLvHdrXlOcJ9G8YdG+PIlJooWUqC58X0Ai5/iH8FzjhHWflPx\nlrMoD4HPAahKhluWfZwHHFOTVOvExLSWm1QoCcawbN5YKZvxWZSBOvOM/A2Y\nfQgt\r\n=FcZd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClCmLEqkJfwnwEwBCXIwDwiQPPqgxZa0594TNlM3lv+QIgCQuUyPafrLN/9LoXjvmIPqluoCIlD6nwgqL+al1dOa8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0_1609523526046_0.7258422531147288"},"_hasShrinkwrap":false},"6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.18","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0VlRw7lQDtqfG0lwqlJEIKmUk7mieUiS52e7aS0S8Zyl7BDMu07JSuEiN0PlcfOnfFrrzkfyaqiEi9eeIsCXrA==","shasum":"c99fbdeffb1e890e21d966bb5c1f51407d63b46a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0.tgz","fileCount":39,"unpackedSize":242887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72GCCRA9TVsSAnZWagAAdKIQAKNeqoSqvjUE6w1wiur2\ntFmG0e5Ly75mmjx5F1lptJxucvIiUT0rjt/4Qcti4g2Z/cDUTofpPw8IN57R\npSs3sPGKTpTHqLVzFsaZK48XVxDrTuPa23fPlGAZTqIzzRiqJ7mgE+kO4bcm\nqmNawiQFi/urRm+/LANSV09Wlti0rPfZU31sU8IFvr0RXFWIPsEDIZUz3K5H\n5cCZd5RHglCeO944/hXi0RnJiCe/PuG1Z9+0RgkXSJIBqmn0ZdExgZnJWluH\nOXN/zDKgirIeVo847PNxyPrySzZk/3ifJ/VnxaPQad/uyACkwLv+y4H3gk1A\nMyTN3qkjELkQ8x4DKvmDzGfCOKJv8ejKZ5OIyzlmM4a+GAfTKfeai5hTlmeZ\nVHm0kEg57kGsH0S0lQ+0ILCzVGpJHaG33nxFE47t/9CfDiVW+Is8fsI/3c+9\nwgCvTbAq30PFSTql2Kx05+PsbRbskdo8+YbHWdOPeLGZ67TuGNipZOI4qu0W\nIoHvtx4ou1YKJen5j6rROSZJmu5xXIoyJ9qxyEalJUS1rnkm5aGJ+Rf/VKnQ\nq5Wb9lJKp/cj5dmcDZ31PMxA8GmeS6b/c8MtcDiIqRFJavUM93iKrUP7Aas8\nT1TZpVcODY55uUmVfgo5zHLcg+5SE8WUVWL2UrKfnBVkihIGp2Z3eLF4J+kN\nRsrf\r\n=yIrV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUBzr1zAF2WC/++MhohvqE6PpmuYtEJXBWNykHFPrWfwIgfIrG4hBZyUTOkB8QawdJ0lG1tqP8eh//KSoAX7y+3xA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0_1609523585725_0.5848111039228994"},"_hasShrinkwrap":false},"6.4.37":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.18","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.37","gitHead":"5b91f09412029f13843a985f4c1d84e5f2e8b2c1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.37","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-E6bTB6rjTg53T837tgxlo8yV4B8DI1yYr9wGEUHMXLLphJRPvWQm7Gf2XNVrxB9UneFi0TCyeAXjsUP6d2E/cg==","shasum":"a9ed86ef09442e8c9621d18ee33164f51abbf84f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.37.tgz","fileCount":39,"unpackedSize":243130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72GUCRA9TVsSAnZWagAAzAsQAIkrzIggOJwBhWwa6xau\nrP+O1XOmMkCdeFAncVHx61Q1dOEKjqLhPy6EZp2OwKslcZoYnd+rKiBFhTrm\nnVv6K5Rc6VB1QB2nEDfNlD/3lPmgy3w14uohj3qeJA8qca0LDX74vqrY6FwD\niujwx7Lt+07yqVCeH5TGjNN08d+j26+yerjGpQJC/WZViH+wdSEvNgjOIX4m\nx0e2T6fdbziBB4BdDadKeru+d2Xd0P0c0eV/3VZBRci42z9cQcbHJC/Dl9Uq\nf2266HD5mkpqXZZ2P0zpeqKadtlWgfoluexiw5tp73yRScqA4LFVGImwJTYB\nhgRr20sl9NmU4J7/lTtHdBHEomVgX+uqtcG0KD7PkrkA2+0vdIQz+gXCrU+s\nrUruNxVsFaV6hqecN9lnkY7knop/IV22Ex3s6LAqfLumdC1zqooLHoFZ8J73\nKnM9bxCAneLmGeeUGThuAnu/VSZ7a0BjQg3UC3XRmWNMVgSuB56RWWPqYy10\nUORiFtzDl8kg+OB7vIQjEu0LNpu2EaYdYUMsUQZw+Y70QNnDMK7tjHNzD24f\nyoMKzlkZ6wRz7XAXAf0AKjJTTuH8eovSJwX5kxdOYf2lIeULAjgEEW+1OOk0\nzpeDm0uybpV65ueeOPQLAT04Hv/7n+Bh+C0wbGsyVUhWqtD+rku5s7lC+QPe\nOeCz\r\n=lwTh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvlr/VQjS/bBp6/SU1cln1cl2SodsdYKBvMH1HyBfUnAiAZpMQIww1gCRK0nZ7N80JPE44Xi5P1M1DyMAN+SI+KtQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.37_1609523604230_0.8555200170351844"},"_hasShrinkwrap":false},"6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.18","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5b91f09412029f13843a985f4c1d84e5f2e8b2c1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CofhZ+AP4mqW3T63Gsf5dgu5n9mwAOAy4/VkLHNTDHhgqxwV52DGtqp4Gvd71+kaz025ogwFGJhsxEcNRsJhNA==","shasum":"2b744a4b6c9251f7fd7e43604442ac51b0bb0ddf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0.tgz","fileCount":39,"unpackedSize":243173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72GmCRA9TVsSAnZWagAAhN8P/RpzJv1bdFR2bOaT4Rg7\nd9hAEZKKBRVb4Z15MiIcvJtRGsk8LgKvfpN+hhvMUswFrCNVZogMAKM12yvx\nqJhQ9RGoD77Db4kVaEZViUMHwKdVU5uciBqRwf7cee0e4MxN1cjO9LBzneUq\n7Z3QMj4Mf5KTOKMHzzp++X0HHWsXLxsDvDUxnJ54UoX1U3GKAGsby8PbXVaG\nBc9QawcJZFsRx/OlCMBsPaTAWpGXg9ZXqB8dTyfQkrxxwlyiqlCNioYACScy\nnlLV9CobkLvFoU3+LiOUVhcYJ/qNTEhoqSyGB4YIiKwPmS+g7LvSrYpJUnTV\nFlX0vzx7hHF0mikZQLC4w0riH38GyvO5CcAWRPFUv7Mvlt1coPyoU5utqa5f\nuBVFHgegFHuWORcgy2x9YiA1Kfk4V3cHxhPkkp216/0Alnnn52ZK7nOt9N3j\nZb1tPIGoo2xXklmJFPs5TYW4Tw6hVV7U3qcPzw3EiKrR0mSlAekdqnHmu8H5\nwIckBfnO5vGiAHuly4QGI7ZX8GPMTcNAp4n+Ot5avP380IqD61GnBDQXQsSG\n2r9IZIR517BQnkST8SA8k3CuregavvSfjUOuTsEMnMJITBpjTrmMaqUan6Wc\nW39B2izYo8ZSbShIXRswVWWM96qdK++PbHUjpDDhuTJRrpEs9gMQpdfLvG0z\nVnuK\r\n=EG6i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3rJCfOcemnvWB1Rw7ScKpSEZO3+eVRq6iay2CpNjVVAiEAp66VNoW6k8sU0AuTFdKIGlguzibDmrXsDfkMsu6SZWQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0_1609523622066_0.39089479007657935"},"_hasShrinkwrap":false},"6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.18","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0","gitHead":"394a660110c8a63803b6a54a3aaef45ee7335253","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TmuBSuQoPzKGovDxvgbX+M3kzDTZoU++s70PcHEfYX4bA3D1pEU/1TdMYfi5y1P5i1xlCx4W8ERSaxORwKfzVQ==","shasum":"142db1f1ba6b7590ccd5ed28912beadf48fa2e47","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0.tgz","fileCount":39,"unpackedSize":243173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72IgCRA9TVsSAnZWagAAf6wP/RIK2pNpYaqgd2Bfb7yk\nF+ZM5MH4/HCS/rrR6z+3BZyb9xR5tBl8/i2So7fN69/4D3fqFqmey5CBukLe\nnfeeEF3+yEDD4P/U1D5oAYyShVR4hZePqZ+3CTSK/1Fy0/7HuhKsuImqDnw5\nDBLuXrH55oFtQUCuFLxZidsb4o3Ftcpr+Y5TLOqp7C0oK6WKoWQvoDfj/Z84\nYOUSkHVUwP+axCVjY2sZLzLmTDSEnSSpurNQqj5NYJNByt7Up+hMr1dWhFMg\nEj4ZbEwvfzddbtvwym6l1rLCN8ms4XB+hJwXi2sT8ic4M5YfDZo6skEvY7zs\neQbQw9sUt927ZD9gTkwGqJ1tHIclyJcmaXFu7fKTuOePOimkgtfIIFMr4C68\nYSIC10jYAQsoQvJKuaZTrlDDqj+8TrfThtFPp6ZiRAAh1Z08+eRlNPSG4gwX\nPi9Yel3zWNgPgPlSY2CtgfoN1gql6pfO1yxdhvQ/wYaUGblJneJsJnd4WSnF\nzKeZvulwhtJJiJ3IfOmnfst+U6AEvDAl34AKQPKS6tssZPAev0FVgkjhBXcx\n3BpZTFmAZ8ZcqL+cZ+e8Tri9UPnK7/UqQ/SU1mJ4ShvfOeDQc20L2xcN2ZQ3\nwY+pf8cabNvbOzw/rO8Rgcs7PllMu1lGhdDW+V4jTxe+y0fUbxo5LMJy0dcY\n01tc\r\n=Msim\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDItzZGzX7Qh5/jGHRGMbKu7Y4tfMhQJx7adtnPGdJCpgIhAK4rYSrWQIHl9jZ1Guq9NqiPP7EH9PiAJw/HBtWwB1ef"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0_1609523743951_0.08141418143946644"},"_hasShrinkwrap":false},"6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0","gitHead":"77308c01d54d048025a5a98f875adaa7becae185","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cz+QLzKZouDMmr2dEBhpzq2Zo9uoKaX9+nKvv+fO5On8oJuwo3ggMY1/CyNInWroILNM3TRFsRpFgXyirL3GQQ==","shasum":"39b166d3d9a4c0c030679bcd2b2ac85751be8f24","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0.tgz","fileCount":39,"unpackedSize":243173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72TvCRA9TVsSAnZWagAAoC4P/1JqmYpuoIuybAFvAoZa\nvT/wMaETpMBjrmmWljewPDmbxINw06omcJjIuDQFffckGZkyp1NHB+8wuxIe\n+0FyBBBd9WPpNs0h3Z3W8FnovjhE8v+F+jN/r+yYRZYmkMwR3YZtLmR+3YlU\nGMudeW30pDNKnZQ5YiE07YNsFXf/awYgapJAmN7O53RrHIyTc/Mv76qRAqo9\nTFm7eziJi0hE6W0OHPDXHlXeJ95EZt/FuPYMduzW64Ct/9I5EQ/tnmh9CZCG\nOw2x07ujoCUV7Scbw2AecRxVptHSoswGDptDJVr4g5IKOEsCxuMX14de1yzV\naxJ1HYcC3o6mHBCuWD/EswCy2DuajlK1zVBREO6l9UN0RWudxR00B7WMyors\nJA5EgVkyUCp6+KWeKoaI8RLP1ThXUH76+iEAtIa5zue61GCFgQh42WVXW3hF\nxOdiYOTStR3zsxAiN067W2jFGdMdlYn+Rq8i+gwhphsEorYclWuTBWm7xtoT\nTE3nBolzGusaBUT+AYXtNe8mWb1IGAhJtW9TesL2kIodfuwLqNVcbBr97owB\ndYxKss4jyk41xTaAb5KmoIkcAK2/6zkY2FuJW5nIy0mlEv3lRAXPj9lp9mtF\nxEBmRUNgi/7kzlU6OKP1xTASwIZ9I7QUTIk2i6cIzJbr/idF1w5KNL4spwbH\nd+M5\r\n=3s6r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbwA1pLG5WAAE6JVarNe9S3cC1bZmdmKG6qLo7/Ub7vAIhAPox0d0VLtH08ZT8BEtawAsY4C4AjI2doLX1hQbfvgVl"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0_1609524463062_0.15617551703050436"},"_hasShrinkwrap":false},"6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"344c28cf585bde610696f797fec4c2e9b3605a57","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yQVzjH1jR0WuNVWowPPaQG3yiYqlINa5zSoM7/S1nR8QPAoLgFqNj7cAZEk2i4dfe0D4B+NM+tMBV+WKrz6EQg==","shasum":"abd9490a4bd867f156577c67e1ba387200ac594d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0.tgz","fileCount":39,"unpackedSize":243173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72UbCRA9TVsSAnZWagAAWT0P/iw1JVwMYYPA4g+ia3/L\nTbi/G4Zxg4p9Awx+GYiGjpVCYzny4yghxTL0AHULmcUTqojfW0mpbzwjlj7d\naOjW4wfP1wzlo4fZmc3e7Uhh3pu9M9nXkFeHO2g4cgaQNt2AiUD2gYm7yC5n\nN52agTHIYnauf9Dwrb8CHbNO3+s57nnhE0kW6lYsaW1tq1erRojjPkirGHx0\nJncTCLNOcaBdQSo7GbEkSIeDLD5qfX5ZPufAy0DopysWFUXOaaoQUWrgNnHY\nTu8SdV2FqT1Q67XMGQHE/C6qGhTL/mCJ/ceL+D0g7fc3sdYciX/T08wcCS0g\nKs6Gtr8VIYxmCvtUTEw8LlRHSu4KBWfJLo+8DsYVD09ohp0nSrqnRedBCB2D\nmtHsQa9DSlNCrzGuofsFAGWVgOty3+qefD4nQCU7CkF4yEjBtrE4r4Q0t47t\nKIxytxyESsHdsLHWlXNZs9oMKiMK7x7akbCc6/sS9wOE+fgQJwqKHreWjlgq\nM7p+twb2Z2L+TJ2BZmMksIUCVHA4vT1EG8gc35KMzT37xoQpIV1/O9+qnh80\nS7jJGzwGe8n2kPy9bd58YK8Bz4+2no0uMZ6o1lgJFkNTYMwdaaRH1a8lZxgd\nM/t+O801u8q7Ikg8nZlaNcssdV1hyiOwGKxPFlxoigvqRzgU9PUMGgHLRa9L\nYHnm\r\n=n/6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj1ebj2ic4s3+93hgC2WaOpaoPoKSaXC/kZ68nhpo9kwIgOuUBc25K9grjbfKAIcF+WR+QfuOoY1btbK1VrUFZjkQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0_1609524507326_0.3018402071677415"},"_hasShrinkwrap":false},"6.4.38":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.38","gitHead":"20fefd4a3a5c8c47004106f9b0268c5b94e7262f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.38","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7H1/1aCY9RhmbBqyIb5fZ9B6AnA7BtK5Terh+OjG2hVOffDGrDPw8pLvsXbQQDhcoG8IA5ORAADJqCKjqzzb+A==","shasum":"b389661f87c2ec4240cf2b457f67357160a5a18b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.38.tgz","fileCount":39,"unpackedSize":243416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72U1CRA9TVsSAnZWagAA2Y4P/2ce+RnTZE7XPr1OGovn\npAxW5Nqt4hvrS/XuKf0qDAIK28820IKNnyBCdRuZEHjv5vrmulXh/GJfL3rz\nAMD0wYkOZ+D/6NspWwn6WjKGioEaiLel5bzYtkclOiBG4SVzRILvzRk13aJe\n4Lz2Zvj1AMnQAS+EBNsrywbMsQMIrupp7KkIXxF0ldE/VJFQKUuNHw+zD4Pl\nHsb1HX6fdK5ndSQYa6wNvMC4HU1pc5Bj43REcSoeaCmcv82qW0Fpy5IUHBxy\njh0v2Yv2HuHSll6z4kvyEfxiUkvSntpY/9fNavmza+LKBYP86XUF4riNaJBt\nqqw4BFGFCCXPlTHsOq60WOI83USmvR6ePcalEmg+x9QIIzsJi+SrPoGIxOJQ\nwuMjRJyXlA77qV/vRQMFJ9HVs+ZWTnf69c6DXRLAHWc7G3CEmWwQ6yQa4FvY\nQgD5YnimhF1nkfqLXjBcPJJYsBm4nbzA9TfZEsVEQv6sStpJyLSrniA/iOVl\nugs5D4bFQFGZfYSSjiaV7wkyCFo9gUdwvva0t7pnnbs7jKacD5gq+iO3j3lS\nEeH6PtmCHYLB4nLltb5PJYOa2+JiWZTTDnVROHcLRivO40xzd9zAdNM/0z26\nNfU8vTbPP0U48I6PFeZfxWyfScFslqQtVjBLP9dKYgQ/ogKko9iWMZsqz70l\n8BG6\r\n=nBFr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDrjcWFqibRizBBN4ScUrhuL29e7XNwi4I4fqfVniuXwIgA4cxGBMGQzdvQ9X/0BjMkv89sc2GGyYvAGodQqLHL3U="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.38_1609524533196_0.25387093492985957"},"_hasShrinkwrap":false},"6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"20fefd4a3a5c8c47004106f9b0268c5b94e7262f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-V9VPZzbaq+EC3SmuWFYw01alnGgJEb8HErSgIvma35BIzO2ggq/xupUI5f4JmSH+pQDw0N+D6XCQJTJ/kBUS9Q==","shasum":"1314644a8b0203feba3ff56f64050feb940ade13","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0.tgz","fileCount":39,"unpackedSize":243459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72VSCRA9TVsSAnZWagAApYMQAIkP2AqHUEnwHAMPk0or\nURUyzIRt/bPBjWMFUpWyvt9yLYIrgtXdc6P/UwG0Acnh8IOTziZzSnhCiDdQ\nve4JZzTER3BJzGTw5mrjnqEDDL1/cLJ3JpT5ubRo26mfQFin+LS4waW8NdAJ\nZP9K3k8Lto756ioZ0PTn9jbnp0zhACYlfiA/wzT65LsbWp451fAejjIrVvJZ\nD6xfYg79XPG+h25tpG2H1SwSgkMU8Wa0zOjU/W4XQPprAeZ/BMWhmwPQ3Z29\n56b8eR8ZRQ61CTOpqzHkpMzJd+/e3BBXmBVdpPhfEkboa7y1cfBaSBrMNCQn\nsDI3MDisgVBLCtDxRABKEiIg6PKqGyfFCdJNxshZkWRs6dOzwJt/CbZs+pz4\nfgejga28omJM7UzXubDrqdhHZDhlrMFRQTp9IIt6Sxrms7DhWFeXe/maxwzB\nnVM7XonssYX23mUTsSQLHPs9aRKyzxZ6ZL1hmSpuIePISu+UEm2J/pa+y8Zg\nrNBFU381sneDno6mKNraqxQv3Iq4M0R3hW/WoOOQV5Pq3DUDahIZMsOlMSot\nSM8bUliaZ0W5ltsNbuiFl2pEgfsWzq0ZMCwSuMmu48mPNgH1jCym9kFDyBdt\noT8aOEtpl7KNEyx59OJo9KNOMrqq0LfLWXbfGiEG7WkbhahZZdCo8VtVkocn\nupOQ\r\n=8AvN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBsH8rQOt0Nq2aZokI7ybac9pUkan9FcrKx8pkCJNwpAIgZh3dw+bvlmGv6OkMWQ6w6U1sQw/g+FHGNmSY8JJbe0w="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0_1609524561909_0.5227570742151271"},"_hasShrinkwrap":false},"6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.16.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0","gitHead":"59e5adc1924e4abfc20d1dace72784c3015f63e6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zBTsdWmr2NkhfkgQfAjrRmADzo7uue35C0R+FH+9hp1xCUuRmstJ1xAT/J91GKCgh0EKRIQlptdQ4q98wpC6PQ==","shasum":"22ea0f9cdc1f1871fac2d71bfa6bc0624234ed53","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0.tgz","fileCount":39,"unpackedSize":243459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf72WvCRA9TVsSAnZWagAAtYwQAJDBDuIDbcosTyfBTWSM\n8AhTN4MgrkuEreQzMc8vYqPCm35uxD9vBbvN4uiEgBdhJpRDeIAtlmCsHmim\ndsSE+K5zKm+PILsCyDgxKkS4JGMIPYs/Hba9lhWWpLHXCb/wY7I1GVmLiP26\ncIiUDAygDF8/DJgqphDuyIT7Db5wItQIAC6vdNtaSx1EZsKGRNWX7k47z5jG\ndPVfMp19HEV6o0JJc/pMAl5UosbHgEsQii3XignNA843RkXx39tYQBDKyR4Q\nDCdygvc+FoxubP9saC6A0TXVF9T+cFmrfl/5DBn7UySXhU5orqzdpyqPIzQw\nDEaAuyjrxh+VIfMhKA5dqOLOB4wVlJ9q5SQeuTSYE5gAddXAALkOMII9Ou8x\n1eeLT3kJLMk8PE5vOCQhullj1Idgsr0TfzzG99io7se92N+4vRktO4ip84Hk\nFHoGdlrxc4Yh99yqJBe293X4x0q4hUlZopWG2PJRsBiVgNWP+CxVLeZJnCas\nhsVmKQyxgu9oBypmkhNu/qSY2uBayyQFv3sn/c1exSgB9VdhAvbs0Y5/T7op\n0aCNIVdbniQOlU5RTiPRZXMhswrXvgEyrD8NUelCuoQlY0qC4HtVTwJKEQgM\nI4N2jXwqtgL5d0usNkBiNVeM32TdPf7nMxPndocExzDeSof7x/TbRwmSZq0z\nvD2e\r\n=ZJKn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2Ynf3RbFDaCsRwnDCRF8XL2BfXUb7IkhSKEtA1j3g0QIgA31t2UBa0Wihv23r6ffJ9MuZQXtw+oYo8ZNF0sJ6h8U="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0_1609524655101_0.819995895028599"},"_hasShrinkwrap":false},"6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0","gitHead":"105ffea981c9f1784b42533f6a0c19b447238402","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UfXgmmvqbt7oGHPaQ+U8Tcs2kLRXemRkND40RxPV+VlYtMm6roA1mQQ40mywm2hGeSL36lulkYjO8dQVN4MgIw==","shasum":"56d3fdbcca4161a753fdd8fd42df94218039af50","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0.tgz","fileCount":39,"unpackedSize":243459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7+QTCRA9TVsSAnZWagAAI1IP/3MLifEhZSXS9RhUw94Y\nGu0+KFu6nnNDkyi8ax0AJJUZzHEGtlVHscIuJ2MHyw+BvMf3mGgqehAepBVu\ndnWzPN2Yg7OJc1kBPV1OJsUM4Vy8wHSSnM5eZefsTt4mhmj/g600DItiSbA1\n1En+LowWDJc2fVreAKrd0Y//AOGFmlkRK9dFrZu2o82ucx6oFONrY2gsKanW\nAC60oSTrShCcUNlO4fOsFcZ5f3NzQ9lOhEfceeZEUXyP74MEP5Qze88r0IWd\nUcZZb3Pt/sjWC8aXfU8U17CXxGyBTsOL7IMCSoEw1DMb/VO6M1IPVf/dwE8/\nBNZxDltWjC34PB+FcJyosF0dsIugaJkkQPWrZbpJrpnIFIhdatldk9DQ/h6o\nWyV9zp/7bXiHjjUjUeD7t+RAxnGZopD1vywcdXGQ935pax4mPew5PljVzoTC\ntkuKNGKGpPtBPHkGxzDzer3v7eEzBFllEd6MN9+NhbYYF5NKsnc4AYrN8Dnc\nPF4Xa5euz36c0LlVVlZk2im1luuISbiESeM5MpyKS50As8TfxSjqrCFVFaxZ\nXYHSrPK+vA7Yb5zt5lA6V8QGDtBe6FRHK+FkBQWXdDzeqcdKnWi/W+hPcr00\n4goc8QfZ5B+2I/7nTk9kGMpZ1CiaqZCmC6KL+x9ByeevKZ+xh8ZKBUDXk99X\nlFlJ\r\n=hr7W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlLooJ5lQ7JjcmphnLDG+2WAeUgakIv0Ww9IZPkj4EnAiEAiLSU34KpNA6VlD3Pz6Zt/mUICYh9PgvqshlSshwbRlA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0_1609557011129_0.23543072454147107"},"_hasShrinkwrap":false},"6.4.39":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.39","gitHead":"fa2b7fd0ef30296b3f0416df38ed9ac951463170","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.39","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4eziI5J+i2RHFoGEwPqhtg49xmZSdUyrkib4Ux124sUrlO0n/Kg8DFxHE6nIHgmaXYcEbHkzqpZObqcVjh+Kxg==","shasum":"0457257a093792260abff6aa8f5bc9a8d41a325a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.39.tgz","fileCount":39,"unpackedSize":243693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7+SICRA9TVsSAnZWagAAsWgP/iNbWMz1GtOxiM2GTapc\nDTfm3Y+KuVKclMc3b8suworggi80FazqCLRQBfKtljCt73bRP8M1ed1teQKM\nn4maviAIp/Vi/Yeh0U4wdsv22/uLu9ghABX+4AjFtDTOFNjm6Cw03S3uNVQS\ntrk5g9/chu0/0M7iBG2CFrpzTFMtx1jJpbvLHLqKDobE3Dn3vuFDQUDYnpJ6\nY1PLR3cIkYILV4zhVrcuoXMRrkZ+U/60/Em9Pc6wLCc8Qh2vrRSLlCkNFNWZ\nQYl2oLaqzKafX2+0ZhBqP4QZzSIpoorsJ8q8Qa4vFMPJzXT+4PcQWDvJTAcv\ntFImxaCj6jx00vD2z2GPappXXDRVYDs/AFwEchMqZmJ7ZolhNc/LiIt7Il5i\nrfnqanz/zLFvC3T/2l22C8uzU1ZtZ9JeezP9WLBy2BcpAo16FYVSCX1ST/hW\n+2DjQ5l5SxjExA3RF+FxaHWcuGm1X2vuWhLIsC89gGVBjRMrfnor8jNFVPKV\nME2DdJzbJfaDvC/QPgDAO0IZto5k+UPcbLLNvl+AP+S/Ud2o7XtGNQsNuSM0\nC8eeUWTDwEtLNY2pTHOa1FZDD2+h+kAEKuQQDC9HuPvYL6mow8UIv/KLE/Th\nxTKcjVRBO4ojgIb1NzxZ8nqtDWok3CrdxTDYiiTjPRTZK2Fu+K99lrmXEoHC\nUfWE\r\n=Zk9Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY4B3oTUZLnWNuXdv9ZmwTnoi1Ftc8G0E5ohKLpR/gWwIgf0eylF0b2v9W+vi41xYY8PG3KDuo6KBCu6A2PlQmSKg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.39_1609557128212_0.31769606273203843"},"_hasShrinkwrap":false},"6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fa2b7fd0ef30296b3f0416df38ed9ac951463170","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jUubLts5ZabGkTsOGHQ1DnNC+c1uNKfxVnJAfml3uEdXeXaOwh05jQHyVTQdzKT27bZnaQjSFLwMSMQF1mvOfw==","shasum":"54e0949aea0b8bd8df0fbe44ce5f3fbfeae2b3c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0.tgz","fileCount":39,"unpackedSize":243736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7+SjCRA9TVsSAnZWagAAKdMP/iynjM2uMRNk20cSKiq/\nGpnk+M913PB4DG6DpYcASpnwLS/bgajtkfHUOli7sF8nVhOcca3K331l9uEv\nbeASiCPW49pqh/24T39xwFRXJo8QmtPyrJrPbichBGi91sUcxP9jvm9baNUs\nDUrfMkbA4Wla/dgzNHFra6JqcvJuW7pZJXgi4JM0gVBB/Iffj/vrk8SVp9tp\nj6ziRmnEyHk/tajPa07v2vUcV3VibPUV/316wiPSSm3NSxCmBiQPqZmfEsIk\nIzR6hnnzT/bCqsvPacbCp5JCv6Hs6PSZROzLlpH7T6UiCtNqp7u0cSw+qS8c\n8rDWCXTeXR0vhMGPVNbQ0uZQ/93V/T/jKQUCLbO3M1YYCYmkLDE23xFD8BPw\nRT7ycvD1I2Fbg8wQcjNz9NBNT4UL8GuaaeBYsWLf0gnMf5jQy3jT1+MsUnIP\nqNGwAA92P02RejQoIjZiACe+STRvU4r9sO8X3hTzDuJ9CseAAY9K4uD9pEky\nyvmhqCya1WieORE/f1Iv07Ltbhp8E+TTFJq59b0OXZlKCEHWHceK3gfCrMHW\nT8QW82w97pGSbvZx0mRwwAftCQKJngfL4vFr87P0aPzNmI1ZuVVQlU2Emub9\n1/r921gQlulRAfiGtJY4ulT0Mh5VBGKZZVYVh2KmNctjN41QDa0lFw1ZbBuK\nEpdH\r\n=kAuR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGBJRZjNxvHacZXQ8LeBcBYYFc2e/AwFub78jbeV02FkAiBopvOlzXiWAx2heBySP00TP7yT6U736ISrq80Qi4RWFQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0_1609557154946_0.7829035415579635"},"_hasShrinkwrap":false},"6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.19","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0","gitHead":"406041063daef157ebac25c433b4b31890dc4da4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FlXnsFe1BofWvizNB4C29S7vIvKDZY1kzuDLSbwcbpf/cXhLZVjHrqFpHmpjhnPB/VsKAA8XSYvdWicaOpBYyw==","shasum":"773cab78221660314b41458f493c46198fed1935","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0.tgz","fileCount":39,"unpackedSize":243736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7+UNCRA9TVsSAnZWagAA/RkP/jM7IEfMQK+QunjoyGtO\nHc+D00cF0b7Z9lkfx1uUJ/L2iiHcGkrNhk/qZmMT8TquOw+PuiMCS1QSiXgY\npdjN5rkjCwgTnQgjZc3ye1cQRXll8w0J9OjY2IuJ4jmZ5iKcCWRHQBAmVVRE\nGiiLjSyDSVGX1UALNaLSrLVQ8fv+jyRCWVqFX247NRSCOJzW69UjCe4cfG/5\nZy6or+BAMwNQUGzVO9VzNarpLJAP7Iw01ikOrz0AZbqXcUY4cT8vMcqw/pNj\n6mSSf7cpARL5xMKsCR7SoaG6Rr3cv2YELCGGTvN/Nv+o3AoxC4wHryOoZBEy\nCBUISA+Aa9NgqreejTCh3RzbQE8RYOqXu1D2klngCxWhsCfBp7UaUmdSTBkg\nFhcqogAiexsmnnUeTw52JrMMR61A6wS1a5dUT+mTZamEwTsJJbYdIiP/C+O1\nrFWj5wUXSsg43oiin8Kp8RqzRea/1rGmck2iUy5DDBdy6M/hxMRTauOpczIP\nO0/QPcqyyYwdTxGaHiTLROKHzE9t9gRByb1weMoqP+NqyTCzdWcXvD6DtU9g\npClCNtp0AXgTCtNYumFDCMqxyUn7PAcEQ3NW5MkZIxDyTI1ZZk2kIwH34bi1\nBOlzuzqif/9AQTOhCqt2rMezlMePbuSoRja0jIB/A2cuY5px89ghswo+wrG+\nQ93P\r\n=THHf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFS5Aylm/YDPcZ7Mdsc5t2P3IDunY38hVo+OQye9bvVEAiEAqhTgF3NYKqnNIo/xVm8JcBCHMVAPKZSOtwtxwZVykVg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0_1609557261267_0.9664848959032322"},"_hasShrinkwrap":false},"6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0","gitHead":"05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-BuM3dcQbokD1+J44fl6TjXp5ND9jE0SKUSRd0p58ESfYBs5Vlhd27Uz3c20UU/cVvf9r86RWqYUXKNXCOzkfFA==","shasum":"914495d20c325739acdd40fc4bf0b51faa273302","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0.tgz","fileCount":39,"unpackedSize":243736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84NHCRA9TVsSAnZWagAAoSYP/1rJcVkD+ff691IqMmTi\ncPBA55c5bVLC0rqWYVG7wKpptXM/6d0eWrnTfdU7D2o3gDZgEW/qT0viiGFQ\nfacPaREdupCD9MmvZG8BCATm7HqzmjRPp7pcNBmi7FPhuysvADmtGF23ajTd\nvp2sjOVrOQ9vey0kBiUcuuL71MfQ0Yt7k7OEPohMgy2JPLp5hyKeFXjBlemk\nPxGncPV3RDkhPzy/cXhyhH4MvEMntW2s/RSd+ZMTatwdxUq55lb1wMzHmrz8\nbH1NqvTi3mZUVDcA6efrTI0+2PCxyO35uQZg7ZcTnNWu2PjdjcR7LHsd/7tx\naJ/Zv6kutvCHpuvmT5yOJ0eNlOzeb2e0LMghLcOGINYte+kYZEtViUF0sx8/\nhR6ii48Ll00JgEkrdBSlZuQbZpmaJVOSJyk2Vkr1z2lV+qFMGxoyTLjX9Clc\nmAaIUwCrSTSQszOT01pOCYgJGhhbie2aCwLZJ3xKFe5A1JKjfmLY8puY9MHL\nbca4Foaz3urhyPJ5U5Lu4Fj2bv9+HO55SPV/BqoeUK9XeGvYQCMaGRk9A1Pa\nvvg/ODv9psPv5MWzT3XPE9GFhn5ssIzPqG0hs2WXLApRYLeyAJR4XOs0SIHy\nuVBet0AvHz9Lom++8KhtKnGzhuwykulGBzTLkOSzSUH9OzXiIKdpFDB+mm0B\nkMv0\r\n=aFLZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPLIkgPKMcc3iX3UnD2z+ytzIsCztmwkyy3YWKOzHhDAiB3rdQKA7FUkbKOr30QOfFVlIkavb14M4KCmR1dkELorQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0_1609794375262_0.04083515248378755"},"_hasShrinkwrap":false},"6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4fca56b7f1dc6d051612de79f7a825a3c19b33e6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-aLrB+NjWVO5Ewq6+Idr6XPcG1tc8G5oB0Ih3ra/Uluu358pOtjdZfnXpSxeLARjibjPGKzdnfmTUJxMBBSsYJw==","shasum":"37178a566d6b306ea455cb9ef9fbcfd9b9942819","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0.tgz","fileCount":39,"unpackedSize":243736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84OsCRA9TVsSAnZWagAAupIQAINFDlTit3BHe19enCyi\nMr/z4Lspc/ZHDX+1OXyZfxervJCDZDqx7vvhIgD/aHmRS6y+g+fgZiR8RWZF\nQ4Zac4cDRmOpE2EubPd+zWm5xC8Ptq2yAf3j6cNpjS2oVNWEK/trpXoQ6tmY\n/JJYmO50dNBHGhRCzWrvoHNJpTAlwGk+GULX5EmQ4GhHo82rrKW0V+LT8OEK\nsBORWmyW2tSmxcT5GbzKeYu7cxXBALbMjQOjzgGP1p3Rctasnm92RAThxWgz\nB3oLrtzQz/G7nsz6JaCa6cx3ltnxk9y3uX9SvLSG45vsJVv0pM8SuoQGGUKQ\n6LTey08gSOZWGYV9AUDEJOsy/CEbmiNvITjs4slmSV3o4yCbsG7I9K40rjhl\no7VzHHSyJNiss56YAIwhe6X5r8qyQDfRuVeKgatQAT8LUeWV2xiFb584Ve8r\nIF4mVB16em8aa3cwLNzBCBKwjfWRkLMhM2FHd8As2uIKgrcekXXbN1l6Mo1B\nqpsUoJiCwi8BgOF8HK49u3su5jWa/IdbLC5hF7rS3j3JjlyHWng2JsUwzVW6\nyUEO3xxQXd6haoMRgbuSKlInpCupkdt1Hltj98RpqjELJNajOjcEZQmkvfv3\nAPKjf72pHF4rrq59IDfNMOoUajGVL92Q5z3ShkQRZVO/RJ3qxDMtIgyJT6j9\nZsYk\r\n=5/ni\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnuhL1gRXvSMMVaPQSGsl1fUtGWqhuiqDYctIkc20DBAiEAyVx/nxuVSEtSuzvU8tuUWItNaH8ZEfipgXy4quNL4Tk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0_1609794475673_0.9357087375923843"},"_hasShrinkwrap":false},"6.4.40":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.40","gitHead":"ff0e34ad73d57c651fd213acbfe84371f5c42402","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.40","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uiP6iIEfQAheSiJvxtwtAzVw+tDR3TfOqF2eK4ujvuFLH95DRUb+XDBYLsLApNNBMwfc1qUiXZ5LYQwzkuCeBg==","shasum":"b30a5fe639bf7e7f0901fb04722ffed975a72a73","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.40.tgz","fileCount":39,"unpackedSize":243979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84PACRA9TVsSAnZWagAA65EQAKUELVxDPdnD+dyvX4iq\nFQd0JWSbkj6BSx4iqHIlEvNw8IlhUZTcbXumRKjlt3C4W6THupJDMYO66n1e\nnEP9oPPExssD6p1Rw3slVwDfCCM6wLLln/hIzTAlDQqBseezjIVDo+nHxXb2\nM6fvkmkM8f8PmjElvtwjJCcHuYhtbJutro3C7ppVhFqt98epoip76/gJouL/\nox4Cj/m30Y/OAsW+u2YoUodK+Zpc+m4IxqCKu2UE+vL+jHtDSlTRJ5pu9Eay\nxUQMnim2OsCceMeZ4nu32qJ0Zxgr3qyCNf0640Fa3R0OBcSUs6Ct6iHoSPHx\n1j5F2gxjo3Nv2naK8Wee82juUhGP1bdlB5KkjT4SmWSwytu8eISq3BDzUn1L\nARBmQrvLzmgIL4PQakrFusccYXEexXqKCKY8Zd3aV/Gbd8yJBLU73BDnvbvw\nI1bqYDrBaqMIpZRSOGDExARdv6zpChnr0OOR7c955SqvVTA3lFzVcYm8JtXj\ntWEMZebzIO9AIPNlRXu+vD/vaRAP1AlWgFQWOELCpKLAwl3FQPasKRFdkDiH\n+4rq8l+OlPtWGO4BxjJDNsQZ7KluuPJ2kM9CrKISmpOthpLuflmasK+hPqj9\ntNRsw1MVGfEwpbxD73oAXGEu2K+1re3VaiH2JjrbDIYNoTFF7unJ9W1OUyB5\nO2LA\r\n=UMaU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMSdU8pOh7hUIvlqY+KLxHVB3sXGBJQKgQTJ8/qirlOAiEAhIzPqlq9yemJ8CjgdXvRXewuDcqX5qsZuXOfdcBJG1c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.40_1609794496131_0.07225304473546168"},"_hasShrinkwrap":false},"6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ff0e34ad73d57c651fd213acbfe84371f5c42402","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9LjIyixSo6Qb+cE31YcNfu9EeiGpJgoSfEMOQ8y0UEPPJNceEyRW3LcTSzJxprx98JS37ANKSOZDr1ZqkALspA==","shasum":"3fba149b60cb5fa1397ca82d8bad13080476e9f2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0.tgz","fileCount":39,"unpackedSize":244022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84PeCRA9TVsSAnZWagAAmr4QAKAtzwZahtT69nxmjGdh\nDTwUpKsCcpfY1H0TMcGHZGT/VbSrpZnT6jFsuABKBCKjq8XI0kDEauUcjV9U\nt2PwTJHydibXrBrD5Q/Fe1Ww6SHzz/PASTFx0fulabDovlClojIH46NbXO97\naJJi2YIzaMIpZ6HkCZ1mchrFqLECaUjuDgE/lFzi2XZiO2mqTsnAaXll42h7\nm8aRWpKfNLjl5MHKidefrD10njFzO/zI1FitkM01F3Xgpv6TlkJKEpChHbP/\nUEXA9Ud+j8eUHzTtn852BhTOW+HU2ZRgFutwVkiStuJ3k+oieFZfhMURYILl\n9zi+3daSegczx8wBtCIAreFFBqN6gBAbjcVHk9WbQ/ZDy4Hyef5gajg7FpPh\nZ1flYkHny8CvM+7W9OS1JBKU5Y9mnJvpTl/YWaL5ObF3EPetiloRJavfKvA9\nBChZVlA6JUSChDwX9L2fwmoydfZMCtHWt1f6tMHy683Lt4e5G2tNMEjumf+D\nHG38kxXR9iWQe3gVYYfhzrVyrHMzrY+InYc3GTRbmlBPHvqyYQoe2n4zkRKp\n7kf09NQvpLkRVRQdxueScotRWd/t2chvpm6cAVFYojMQmGcaNX7OIGL1RbRS\nyrLOsRwwbsns47BumeZ6twRiBybk/Jim/aJKgy5PgtFj1Wq+Y4yMJnCGMHiy\nsvNP\r\n=fA6H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWGbhn7eAfdNIT1gZFmuJ4ak6EAorzdJZCyMzpJ+gQugIgSTS8SU+i3WsUtGPffwdewfx5nxMe7MvEqshHHYbntpc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0_1609794525747_0.6586484962883761"},"_hasShrinkwrap":false},"6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0","gitHead":"77de43fd113638194f9337caa9aa08283d703b81","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MpovHY7ezI3Wcx+Wzh4iZloh9kLaITWOnzxeavwFJ2XBl5WqxjaUKROUcMEb3VJpMbTS6nYBa2LScoaWSiK9GQ==","shasum":"e2cd203037e346f1581705f28ae345c91eb9a5bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0.tgz","fileCount":39,"unpackedSize":244022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84Q9CRA9TVsSAnZWagAAqXEP/2Qlddexe3+W6GspY5Xf\nKZTZIrtN04YARMQeretGF0W/cw81OgrKnqefiQKGO4YJ/QXLOKTIdXbY51/y\nmZeW0i+1ZNMLrIXGZMd81mqHW+zruflpG9nrkyopJxAA7ouRAnQHrqmyvn36\nColv/zzUBS4ZjS68GOUS/g4x7fwr3/mSX9zU4mnrcMpfuh0WaSqlk/ZeZDuJ\nm/65P0slxBGl9X/nUeeIGhXtcn0AlodfUvSnvJPjtjotKt20lEBZBnZh94+d\nlPl4lrL16RdgAjvP2Gdxuu5AY1/oc/KGLQs3SDWIJnXZRJ5qXRruFYKuipSj\n+yptYPXIU9w9o5j75x81lYzsvL0ZP1YacX6wqw3PxEye7vmMfK8DJuvkp91G\nCfh/NLRgMtjL/+RmlHlSOWZOb9VMmwssiU3u1NEczUmRnTKJyvF/c/f8IWJE\nl3xUTXwvM9AFVENNR7SF3+yIsHlP/hICL+GLXWxgt34a73wO4sRqDeeTOaaL\nWVBp1DyVvFkEtiyRNnCme1AKkEu4+9rQUtllIQCiOPPDQq+zbWjdVz/DJ84n\ny1VkzetwkKpAbt9MzZEzUm/FxS6HFUNyhikESdQORAPl96l6ld4eTXH1uABu\nkjuk7wNMRYkrIFl2MpbKNnaYZrayD5Mo0VJfiri+eiQITWLld8PIJCf8q6D7\n0J4H\r\n=3M1p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7VCixFtleH06QL/lNUxqiK3h+cdHFkzYUlefRYWnh9wIgeHNwxhsqJNYj9E2xyVEOhFfyhthEuJPp9mjbWo6PafQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0_1609794620248_0.1686383412768344"},"_hasShrinkwrap":false},"6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.2","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0","gitHead":"3a3dff5bfd647da648b807d8feb702e61b09fab3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DyfvDX+l+9hUN0y4ZX8GwPBP5IIJO2Uy5Bubs7pT9yUn+hZBQGqjAeCSrDctffc0hNrsF3jFitVsQR0KgUaeLw==","shasum":"c7e58fb5fd70f9b6d94ebf1d62939749126d3019","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0.tgz","fileCount":39,"unpackedSize":244022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf84TNCRA9TVsSAnZWagAAOeEP/143gWqyRaemSwZsbdIL\nUulTmlUQyDUJ4GqFvLp6YMQdjZRX3PKb7nBRDKGomTcnFCppE6AAOdIBjIs5\ns6DGsd3yUOzGKN4Nb9eUd8vS+7GBpg32kJUzuQbPIRMeR613Gzh3wH9AA2CA\nK4vYWCDVbZwlL9kY+Gco1WStHXnRFhlQ/8IJpZTJGrTLGx85wu1P8hdyKLrA\nISWGXIvESmTUDk31YgqNU8axNmhJA35pAiQxYKWmNW0xXPmLuY+JNyd4viu3\nXGg/Jx/NmT695fiuzGPk7KeQO4h9c2G6nexl+pdnm1N4JU+Es8VPqbjGW6tj\nFpMHiArHSzNJGPn6pyMxtGoLgrC/PLRfD/qBign9ZBhqndT5eJPvQGHIHwVb\nZiPbNsDEFygoSzuGbFSBQ3ZDEGYjVSaxELyTWtV9gsxOvrEZhhbEQfl1SkST\n8pjvn11Iv7WyJeJcXebKuQJtzi+YcCILFmYb8s45w9Vv89w+FNeRaPUMwpBw\nR1XFum1b2hS9pMDX1jZVFwdRhFxAhf1HySTZsHqkMO8OQb1IeUa5ja9cnUJC\ngfIWqQHSR/qAJUoiJuUG+tL7I2ZEDTPlY3aColptui2SjKT0hOiWchfqS/IF\nBe0cnSJsgeN44uJ8MOaa+7i/QHpz6SCR3Im+lo/qHE3BZE8r66LW66+mIFbQ\n7g6B\r\n=wK0l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4JqwzfxkzCiSkoVfxi9kgBTWqiZiKTyoYdS+BF1cslAiEA0cQy0kdHTGD9rDvTUKm5DLjsB25/cYKfhKXZVnenuXY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0_1609794764527_0.7300881725330184"},"_hasShrinkwrap":false},"6.4.41-34950411b106a76929134cb8d724511e81e00327.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41-34950411b106a76929134cb8d724511e81e00327.0","gitHead":"34950411b106a76929134cb8d724511e81e00327","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41-34950411b106a76929134cb8d724511e81e00327.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kYnovyTwhwTQlefoHy7PCqJnZsRYMthzRXJqJgGOX3a9ffVS7LPECscTatsRUNw7kntUypSuiD6dwXPCtjnnHw==","shasum":"f7c84916306ef5774e5453e2cb1eb64632c2b614","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41-34950411b106a76929134cb8d724511e81e00327.0.tgz","fileCount":39,"unpackedSize":244022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IW+CRA9TVsSAnZWagAAFhcP+gOjbCE0KpX+H+eOkMdR\njlsDy1FSLTI+fTauD50vQDd/mqfLVFpCqfFWlAdBZ3Y38WWdm3XGUQltamER\nc650wBq5cWWR5pTj13pxi+jAAZ9Ik3uVOfnOd+iXcpVGpY5ULuoUls3iuNgL\nDrQZ6awdo+Ji6LYFtDvzCq29BsbpR1FOkOFJH3G+OeP/lzQlbOa7G4Ikk0L4\nIz5GJg/KviYl3aWDpParYAbgxyfdD/LP+L5FTrJ5TDrIdb93SBExrBnaoMSI\nHX6rsylKuuXS/5aHRPg+8AoEFi3xVr1SrnfjNSOOqlrmresIaViZ4m+mc4UY\ntWfHtvCQwLQV0/dyOweTIXrDgaMSummQ/V2HPlCFkbr19PkTGCrsP2EI0ZmR\nr84SaOg1mvvaH14CkOrJmn+IOe+QGvBpUeEnj2hJpKhDsY4ntUGCZS5ff3zI\nVu4z3dkTsdbXj56LLfIl3BvyUdAtUwNq6ixd6SZfo/56Heq5s0YV0WdxK3jL\nHTU117FZhMAZXu9E/Cxy0PW0DQmhxetrQ+qqar4Wwz0joycf1s8QHrrlXDws\n8Oj+HQAi/Yc/AHIyYnGxUVzKvQve60R+Qwf+SaPKp4+4LOGPnwOxcQvbnHaJ\nISDQ+n175Y6n5gCTVnKjVbzq71W38V44GFlltbIFRXRgblZgvIhdiPDWEika\n/JGe\r\n=RHpF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrR3dT579Jnb6VWvRY04hu0agtIx8aaz4KLp7jWn8MXAIhAIzGvs1y7jN0V4FnivKhzSmLQgeN/pxlbqP6wBFdpbwI"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41-34950411b106a76929134cb8d724511e81e00327.0_1609860541651_0.8559870449852838"},"_hasShrinkwrap":false},"6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4cd3aa8a18ff2539365ee48db451d4a694472746","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-XHBOZ+A75EHB/xc7cgkibFjk/u3lZb69Kj44W0PTRfRPHkyC5p9Gfor+jR+xUFyvfP9rSjK1oJVMShke640cxg==","shasum":"035dac46e4a86fff14d77707e32a25909e242b9b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0.tgz","fileCount":39,"unpackedSize":244022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IZECRA9TVsSAnZWagAALPAP/j5kA+htxhBxlJQmXSD2\nNVxyV4jgI08sD2m6CCZ2il6D27odLHPveSoUmEr0ZzCsqe9FuJWilOGOjpUE\nZr1F93lJ/o82x0DmDhdQav+bFBFDx4QddsM7SN2x5VOutCUudKJzc1posDdP\nnphKRzqqanOXXeSbBpvpkdmFRsxQZqCNWj/1hxdV7qmIYjojJGUIWBaI+iFk\nqB5VzuE6EKw5uHpJ1yyFMObNFKgRcUV0OevhM9X6Nz0+qNDWm6UbXGxn8kV4\nd+WNAXzLDUn6gnsn+dYeKcMALb5dttutsLvlZiYqT/71h0s++HG5PdurWkBn\njoGJd7JMzeJXq9EU8q2wFyT/TxpG/RDfUd445czY6ciTpO1FwkAnpkOFm4Ra\nhndIQDD94+A9kwbRcRDvAd2ovBdowohKbTGiXitl5WffRkn4KS+KASy4jQPo\nMcYjplTnuA9Gi+IvY8bKkIC/XQnn4myFKFwYMbF7AVWL20nR9XvbVkg4jjQ+\nzz2uaDOK5mwyHBK/VucjWSVEQfpB4HNx9bPB6TLyAzD1wLF2qis6Z6me29wU\nS7PkxcIAHIcQpRVHPu2IzWKFxyNy629bgJrDvs3Lo/7Vi2zWxPcg5yUrhoX/\nizRvtQ7Q9CmVlFiBFjPli12cPNOJ5aGTzO4oneiu8flwlJRZjr+ELMHs8HYY\nkv92\r\n=t+fR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbxBLzG1LcjGRBm+JrRai5JfYP9WLfAcur3y9pyAL+JAIhANx9CwLszgIhIUveyCOFJihHYDVCMHiVtjdRse/lOcGh"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0_1609860675533_0.554720770540369"},"_hasShrinkwrap":false},"6.4.41":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.41","gitHead":"06a1c86629fea8d6144a135077fa92c1c0590f8f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.41","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OECRkKAyfSHSoNVyTn1SdpisWianl5yqGJH1g9rm/Olnl44qkqFj+Xdh9vbPQhTnB8JRLoh1ZYbhEgWHpde7Aw==","shasum":"e171fc6182e365a12701d3116047b012febcc455","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.41.tgz","fileCount":39,"unpackedSize":244254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IZjCRA9TVsSAnZWagAAwV8P/RVfs62CCvf9BKkk3OaE\n+yK5bRYeSpFyz2stuAAX+A+Y9KOAxQ3uio7Nua24XmcKo8kPHRp9NhnWNRuS\nTzsYK6bbAhPr+ZHMR2qHRP0POcBvdhyljiUHT2PzK5C0Yf/RhQnOad1ywfJa\nlrblRiqoc5nHm/8jK+qltsnlx79nyFA/JvOhAH42vOq1q5LCbE67dgjw4adI\nvh/f+FZhGgvOaX1Sd55PIKpvv2cZYU4vmGfP9+6hQlD7Pvn4LHU/FNANrucQ\nfCLuLlR3FrP5VRk4fpMgnplBGuAQy8hx5mtwTLthPBNL4t7IjrkRqB62xGPk\n5yZkIVxHyGteIJWcuZ7EWTZq0HZovE5LCVqiK7hDb5zZBrrUNHslQ6yw/+C7\nuq6fXGfrysrn31vg6bh/uDFc++8p0oK/LWIBroVRtpbzom4NtsipI/i3q8Ah\nJYT0xfvMTydpgTDUa4rCPVJTALmGuf8lxI/nMUn7NQnxpyLDAsTifIMDLg2f\nmTThuuCZv2MV0O7aMGU41XZIhyCmYj7Gf3pwFCC6KqYsHhzC97/47CmZTquY\nWohNpr0O/QMX3C02EKpGOKKnbQ48RXVVIb8LbdJWOWs4x4H8+ToKkW002otB\nI74T7QNS5A+hcxA9jfQJZbf1jJcP0J/MUeg2RoKnACGV2dscBHpQtAnyQwGi\nHZCB\r\n=Squa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYelRnsJxVkDRI2B0jXqqjTPO80+IeOZGjjBMId6uMYAiEA9Q3dlw8IDQUTkuPPWD68hrJAXDgU9dArJO5UZ8lc4yU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.41_1609860706354_0.060003377023445825"},"_hasShrinkwrap":false},"6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"06a1c86629fea8d6144a135077fa92c1c0590f8f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-WKdzy+DmZuHix4QViv5/LnRaoN5JMCI+6XHSHo0sRBskLhdEKppQi74CYMu5EvcX52KHBCMLQxjMFnS8coJf3w==","shasum":"d48311324e8de41aa910c67b59c8b1eb8110379a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IaMCRA9TVsSAnZWagAApS4P/RqNGMONty6jxEMMbT8b\ny1Z7EfTjXhdD3jJvWGlK9E5SdamaPoN58z7qzDZqEAbyclmlgAqDddQGJNRX\nPWjQu5Gp3+m0KRITuJi1qujMgUNlTXrv8PHB+IrRBoBuNRextmwg50oMNZrQ\no5qU/JcyPU02jcu2w9SpFUyBwl7V+jhvYJ3bS9QMMe74SP2nlBCnIcWEF9HM\nZe/JHpADnc/+2juoHit4YvA6Wldq+D09kwlGbJkKDl5SJNg0u/Mw28S1vhe9\nSlqO2yaIXwCluV4X+Ed0/J0CIKic3VjNghsiaSLuKgFXeST1Dn43lV0XkBYR\nAjSx//Yw0vDIpJwTQYhO+Rt6VtKwx1VqqtkF4fGqfQBsQ3Cq1W/araog1dCN\nakErSCOoas2SkGoXLMTgKwiBU3yf3IRTeOOflJayqE3oxbmUWjmXZuMsMv+c\ny692Su5qo3im7W55616KYzCXpB3JEAwv8fjQuguqzUVUCppiTOenyDC3jUTd\n3P0RrWBgIU4ely5Iy209PBWpkzMpyikqQSXVPxE6HP+BrJRXJC9WPNuqloHG\nf983zfhdeLRd1u6D4NUYbRowwMN8EuH8zRSP8kXgD4f7TnS0gMBRHD4PEciq\nxp1RZ+YeKSaFXWMLYmkdQVHJOwfG9aDL0d4VuPhfD2hbaJI0sgPzgcMYelft\nBgr1\r\n=KF97\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdvHZYke1BXzBpxp7oADtF4fWmmJSYN4G7VsN3nfKiRQIhAK7PyZwF3s7zjIekuWODPrZno1to+rQ1Ld1Ka0zTShO1"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0_1609860747723_0.2715232997602204"},"_hasShrinkwrap":false},"6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.19","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0","gitHead":"ef5045b4f871976ffec4aee8119884c982f40639","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-sMz4PmYxONComPla4Dc4pzfp88q4Z8x570AzJ9A+imM10ykt0Kh7kxrFga1zjndcZjdG1AGxUrBK5YW1VI3Hog==","shasum":"acad80de785052aa0459b2aaa96dd5eac1d6495e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IdDCRA9TVsSAnZWagAAsVYQAIAkGe8xFhy+Ms5zXJqy\nJGswi8H57bFw6vKPBqUj8gmLjTVr47gAfAEtkxOphZLMFX/2lMvDzW1hy9G4\nDcK6QfWMIKHzfvAvrsDzwm5dkGPRmnUOp1BJSVki/jGQ4QrB0cAg2MsQfVWp\nUF/k1XG9CRfqgsDeFb9brgIAawtQ+QHxdKHep8oEM3jf6wiKE35R4UO0aTOZ\nIwfAgybqQRi3hIMnjZZyUQT5/9TSmJv4PYQA4iXkJXy6pzIH2KxIuvP7Mgr0\n/drTHaYOIHUWxrhf1G3c+ZvapmeVIWEushx6MnUIXMFbECOlw5aamSx3uHfz\npMaqt3aVA4n2Kn7Rj0Pfud7O49eW8WEYWlIjCU7fGlzYDtiTbPpgXkOBooMW\nrm5j8oj8VofiUxTnFupJ7WOjKHxhMTdBkAAV25FheW3u7I8m+LdJN7Cobjxo\n0rdlelkDlF1mxwXgwRT0GyZ7t8AYE33yKnAQ4OOKaqbkeGRzJmdS+aqXShbN\nJG/oE2i/BXZ2QhSZrQkLgvIeMa+61iquN1+Mr3jj65icuGMVmjTg7fx9U1Zv\nA38EuRwcrmjhOBn74+f3dIT1fvm0oQzKtjAx1kINYuOHfXiYhXkV+qh/3N64\nHtzGMPhOdpSAjA3Zysxz46cbBnctp1CHvNk+MW/n/c6rnb/3hjZybcK7Ujj1\nOI2B\r\n=b7VP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCX+thp8FZkkR+yqt3dT5K/TBr4vtGolXfFUN1KDYgH1AIhAN4CQuHTBJgpe0tSYI/Bq9d4RJOsCObuVKJYxpCTQ5tA"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0_1609860930459_0.32918179176279816"},"_hasShrinkwrap":false},"6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0","gitHead":"b2cbcd6c9e9694a713ce13ad20dcf021532188da","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kLLtJOv9ROsynXIAuWeAgqvtE/MbOL/izC06OiuMO7ro48ogzdVRqNTHCk/sWMBJplMm9qVmieOSVMepjVkB7A==","shasum":"d710eedc4b9cad3f9cc05047989d169f814a24f5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9tdTCRA9TVsSAnZWagAAiY4P/3PUlAW7ZFL7+yJyRHRz\npQjy2ipepITpOVA98bo0ySC4zcLpg/y0iG32XlsU60Bgdifp5AGHlbj/Z/qH\nT8DkS4VfF0B2xIQuJIQHY2knsO+REsxu9Y2MPqeNPh10kmza/a0kUCfSnvbg\nxTpvYU4UNE/coifyM6/5TL0z9oLXf8wPB+loK3nhGC97H66G4p9AyXPUgvn3\nG084/9cANdov8EhS24AB6L1W+wxW+7lLUrxPGtvI6IezS2YJumsnutAhcDDU\npiRDSV4nBbOU/O8D5JTKUZ4rkvbbTfA1oR4k5IYYRkGo0Dnr9TpQPDnZ/1T0\n+HV9hHaWXdgI0kVHMblwlzE91TNDq9s5vmydsASHpiCpbOk3Bvj+4H30AcFX\n94HpTZcmL6V6K3zaRg4uzDGNiTu9GfwI+gjEGmxUQhWsmU0Izb242A+pbV64\ng5dIUwk+VRd10XfPMFLf/iOBWWN049MaopMMzbTdSHoFvaWdNh75geRT4xuX\ngTMyrM1b3yIF9JSFHufqqUU4AZtM+ZoyKobG9Uh16B9XjywmP5HQmD2saM9X\nc75tGCehrhcE2pXJQP7TGp3M8zojh2Rkl1fdhBzCaor6tzYBo4kjIbOEkR+m\nV8n+ueO7eZpyDyYw52UDKYRJnSWIdS4rtq95g1z4DAGsh1UXiIy2utGnam7j\n/DoZ\r\n=Dvzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICAthxdfVJJ9tGnBU4K6wN1r9GJnw6UJfC4PuBafZFt3AiBxFjr1lNas74HSOcc0XTOIJpxNA0dV5vkhYNeX3IO5Vw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0_1610012498846_0.2728621011904737"},"_hasShrinkwrap":false},"6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f80af497dd7ab6d407f249cd72a40349582fbeb2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-pyWWFY5GVfNCZDU4vjxf9w8sCranLwR/mMkOwPbGPGV/fcbnVj/nNSOq0wVOokVGby4jZQkXfUSi6pkmPai+ow==","shasum":"97afbab718ea741fc48f25cbbda9ba0d4a2ee0d1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9teyCRA9TVsSAnZWagAASvoP/3zFjFuC82nGqJ6flD6x\n+BVi1WEFmtoAiSsWQYaHoBFyM73afSVhwvVXlwvlaa1F2+OSkRd6yIhqCC4b\nQx4nky++zilUcVQN52lC/fCKrynuMVtiDW0kVqW4pVnoshFGDbrjV2ZDI9cU\nmKYKo3dFdLd/35aTaddSdjo2H3fPxeXWa/VWPlntRVlBFIbhlZpkJ3PBywvH\nl+QqxFY8feea50BtZT9FotThEQiUJiMoDStDmpJj/+XcfVFpl/ORsn2/Rxlj\nAroXZCbnOBDODMM+8e8AncibJE6T6jPZ966vSGXtpBJZNkuVWM3y7U2UeKqt\nM1FR6aWLfOFS5hAL5WdN0JD19O0EOyIW9j1QcOUC0WaXdqKsdWh5U/FragKh\nnJsTWvuITvSkzq+G5tCHlpBJgEVA2nmpl61JRuitXFiQdUdXFjdzVEU6Gr3K\n3NPmEhDDWGSaDWSidj3m9WJIfPG7ls94XLUwPR585041+w3K6KVnyhcA6D2r\neldSKqSKuAmz4MXMg/wJ9h6KymvU8b10rqkRHuDZwF8sR3HSgrDnnT+WtcqX\nsvBokaXRPi/mRO4jC+5HALsPOpgZwby8ZX60eru3toWTd4B0aBgQD2zLmGT0\neDcYEw9SOHthDZMPan8cOK9raIYusrVtjr0Iej9S2EGnBpljoF2tHn2oSYEb\nuzki\r\n=vvFF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4Cu+ygtMMxOYLi0vjjZlJKocn02Lwosj/cm3ETc/iuAiEAgsoJNHlPnHviVaCkbEMBkLAcjLjx/Whi6P3bBcDcBvw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0_1610012593373_0.09713683411534424"},"_hasShrinkwrap":false},"6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.10.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0","gitHead":"d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mTUGguhqcv64L4vx9Ha1GOoYB7SQCbsLl02getK/tkHdF/NuYiGgYL23AvAdM2sCcsYeHZPt8soNNHSlGeHtOg==","shasum":"73a028fa1585bede541591842bd4a9a1bab50c38","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9thKCRA9TVsSAnZWagAAwugP/inGCdfwfWjcK82KUiUF\nI6O+ZxoAp/hoqp2rZ69Dt7RpSszyrl3XphE0RrJOPkwx8y3MzK01Mk3J1PzZ\nlJdT0P5fR2w5Lc+UwZmU97o0+sbb0JeiKe+/yQEZf2ztK+sLtDAegufL3pNu\nWkeRQ8QUpAuxvoVhcyrio86+LAHD80RZSEzmfDv9MPP8iyuPbMwkpfKTHN7o\nlSyK5MaEvxohQaofAhikJZmgSECKTTXfacuroUQxW45hwDZjzki7+6k0nMCe\nAXSXtHlOGwdOT+P+ZCzRY1cD02Mw9EGYf188X7Y+mSX7d2wZ6Yk4/U9cPPBK\nKxmbOWFPzM773NlULa+HQKgM5A1s8JLU1moyMgmbeyxPF+7qW/iRaXbEvJwD\nOVZhmILPh92sDwwDoDTjbYwIlx/MN7nBWNFv+/BCgeWl7l0moqaHg3Ay+nDq\nngTbQAjBSgj6wJ5WWj4IznIZ+J6390ZrBxm9XZcUbfiji55vseBcfs1CBJwl\n3dYsvLYmWJcxGvkbgC2puAGxl/weCCbTuzoGyIT0YBxJb90Zy6mVXnXTrLQf\nyqLXOgUf7jQtCWH373xXKLrcVUyLjpS7AvVhxc1yMwdre96MFNwSqzLBYRgA\nUHPfWlJgPzXEF6QuVPvVXqzcIbg9Kd7UzasNr1c2VllSCNZFohDD+rek7tA3\nyXXy\r\n=GyPU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTfw+7emQ8MDwpiliFkyCKoYsqR915g7n1RwzIFZicKAIgO1iHiYv+N8Dea58BXbohqtZEETYRVQZGbYO8bXA9SmA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0_1610012746110_0.1934487012080337"},"_hasShrinkwrap":false},"6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0","gitHead":"8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/XzGMLz394Tw7cRS6DqK/X3haYd9PNK12wvEWC1/DSGTwyS7G866Z8FEkw9qbNbx6+njYleZ1WfhqSl0H7OsmQ==","shasum":"42949c5adf44642cd8d6082192651282d63dc18e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LUBCRA9TVsSAnZWagAAQkAP/jZZOmDlElPsjNQkkpZX\nNoY7tZUV7lp7uOa81QDhbL5fXVS6ul9tgZb9DJRhU8ZieXKrQT/pdUtiMWSd\neW+lTJfgJbXCEw55yY4ejG6rJ2W2FJH1RdK+OEreQH2OmCPWmpfQA6tKr7lj\nv84ZVBluvCdhqCF40PE08EvdgMbDbAeT45Ahp+1AfEyGymRviIZqpxsAeORX\nEUytzTBjlV15OV1m+5G2e/aQmUne3dgvSnWvymnTUHsMOSJBkUhrHKL63ug6\nevs2TZ05YnS4ULdu3fQMEDHx+tlqhzr/AZUlNLwfh/8ipvP10xe7FA/cj4Jj\ndFkfyDQEpQW84ObrE4q7kikhjXDnBREv/j21lxCI22phU+jA1DqA48GmKu4P\nUZSZccszufr4OVey4P1hWmtmfH7oM6WqYl/9bOcMsD6lFXC7B8k4wQjvWsNe\nBmWoiXu+rLTXBFUypKgIHq3LQeb7RN4KP8bMdFICIE7Ilb0pBX4RQyR3wrVF\nlEQOYD4bu/tLzegQoaaJjYiSujqA663CPgMp97w9OngzopO3J78qP41Vz3IT\nbe80TwcBNLxVuz81DDXmzxJK9+qN7+uzOlwNuDrfTwFU4EupuvKjwsBXED1B\nwbQQ2aA6FAlDi7FXduuKyu6XolYw89pD0aD20i/bBvNFBYDHexf+d56bK8ci\nSIW3\r\n=vOWj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAm6OZJ2Zia5hQYXNjcy6PyDTvmodldRu0uvAH6Y8IX+AiEA1CBm6uw/VP9svuBZKuV15SI065SLeo9BcNhqGvlQ8So="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0_1610134784841_0.08519000141773225"},"_hasShrinkwrap":false},"6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"26c704a2dd8feaa0009b2ed28257cdec8014f33a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MPqmgX0vbl13dwWStDHdzQiXqRQePKN+y+IMKlLG8lJxAEABCeKEZv9iibyI4p0Xh0EH/1qysxSWZtqU1FHiYg==","shasum":"ff85e17ee2dcd603344e761624ad9e37bbcb5ad2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0.tgz","fileCount":39,"unpackedSize":244297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LVRCRA9TVsSAnZWagAAENsP/itNnyM7ygBxrgyiLEkG\nhh/N5uIbFrnVIAyrCO2CTifBq655gFLI1DF4w5g76AL+5hdvs0bxq3+JzxG9\noNTzEpRLZjDABqsJBxTa3fSYx6YzVhYaG+VWjljF86s6NpkuCqM5AcS2fr3o\nVDqPxVP6dnrNZdLmXhsBmWHI8ZV50SuL+26SAnOwe81ZL/oGdxT/x9eZpoFw\nM1gNBsiaYFpo9yuRnf/jSwHQIcrYVFiQT1zdx1nycUxEUbRPxyf75yD1RV4u\nZ/ITEPTySVFOIRDZ8TpuynnaLAiTfnWsv1tC+1rdm71kqoM8RZN5Es31ICZG\nPNkJ9zOsWToYjw1WeTgE+lbZc53T0m+Wwuhu+EjA/UH/y/pVi5IQAmvOMiqq\n77YORzMrf0UZC9L7fA2Xhv/bjQf2/HkYnVwp89jxninpwzaubbZtu921wkkx\ngW1E7ZMpowfPBB0bjhnlO9dOPwsxSKA1CN7H5NE71/wAQ9AZyqJK1oK8Ongc\n/fqL4vE2VShH1ZiVjGG2O9eUQEgfwCyfftOQSV46kTIMylZVGxlX0MSZ8oa2\nbraM4xmf5+LWYeDVCB34hcqr9A9eM1a4O92yAWyYWn7fbE4L2M9Dqg8zY+Gg\nbM4SV2socoQNQeMLek2IsxrYITdM0QPDmiFSqZ6IJVhV64+XiGtIYoj7FzTz\nrxRU\r\n=1rhX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDalAToCJlLy8YgokrzKxoJQyxX/8gmdbxY9eNHccWsbwIgAOT2xbILHtQ/9aFnwEgaQlHpZqo2QHO5M4zEZ9xOQSg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0_1610134864550_0.1834124805455455"},"_hasShrinkwrap":false},"6.4.42":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.42","gitHead":"561b6160cad16726139153feaf89e1923785d2bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.42","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5eFy9u9M5LgN9PATVymPwFRGb3fQOr1jfq5otxqAru3v4eMf4amy+GKnimdIKyaD/S/qUGM8FcTpBo/uCQ2heA==","shasum":"53b4e33fe83ab297ac3c2495304ed0f836feb340","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.42.tgz","fileCount":39,"unpackedSize":244704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LVpCRA9TVsSAnZWagAA3u8P/16bART6A58AuiTz1nUS\n18kjFhIHAWCDJMFExAP5I+fUYB1zwYgjxL3AcpSq3RP527aIfKGv+yMCBCpZ\nLa7yBV5b+G6SvDuzunQ/j5NZu7xKVGoE+8yGYCjqQVSUoh/XpMgUvta4gsKd\nI4398K2BVtRNqbUM2P1pd6mVPEYkxwz3QahJE0VaX/mOJyy0zOIzrMOKZt4X\nVTm3pupftz9lmfiRZkxdb1IDaTH3l2NA3vBfOsxjvvxyaQ1iE58HP2sYKOUL\nRTOtfWwgDC3nh/a9Azw/wZOo0TZnoYlXhW2ZY1kAVwhqU12ZrY9AmyI59sDG\nAFhcEWCNB4uky4J4zUbdxa3455ArMeOBELXNCRfaqSwP9iYarYhQd3N1VXsx\n3PNye8JsmYk+OzGV9Cg0is0I2yFFS1v21dEYyZJRszlXMoZmARCsJC2QNkJy\nX8j7NoqdlHouUkoY4GSdfN7iY/guQSNkvz3F1xo+UtRs7tJO0Koa91w5Cb8t\ntRrGTD3n7J/Onj6M4lDpNeCiqB0tXtM5NA8Ben1kMnjb73rxX07cDfuCRluV\nnCHoMANaVz5Gy8XVfY/ht+yS1e/VOVy4u8om9I+6weK+Sy2PwMYHAAbf5EW7\ng6NWmoHt8N42724EUyQ0RdnpYoLHGuLgnWFDl+lvdjvYfL/Q2AnhSNlhc+ke\nUpVp\r\n=K4DF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEgwfV9Tu8NDTcOezxH+y8b/qkBSmjO06RIRNl7pKKZAIhAJiNeoboUtS4k9zuUPIwA32XpHsXd/edHY1DVMyycd3f"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.42_1610134888248_0.3281432835163456"},"_hasShrinkwrap":false},"6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"561b6160cad16726139153feaf89e1923785d2bf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kGQkDLIVaEuN7vhtdd/SAJ/ErSC4pM/DEy7QZWeoh68f9tja9ZSzq8NCrKyobVkqK1uAB0sfv+lgaRCZMnoGlw==","shasum":"803e96eaddaa160df0df9a77502dbc8dad5b3db7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0.tgz","fileCount":39,"unpackedSize":244747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LV/CRA9TVsSAnZWagAAj/gQAJo/VJW+UWgI9og/Ap5N\nDzlIlH1XLrxiF5XSZJVH65Pul1HIyD6oi82IqmD+jb5nG0cmJLg1bUZUqHLH\nYCfdBglmRV4N5vETZMzq6ZVj29NeUZP8oYsRIYNiZiDqc9s0CYCo/5wtMcsb\nLRbDlgpIOFfpdk2mX4pN252YDAoxn2rTuWsk0oujjOihwwrTJMpQj/YShC5p\nfuZtW4csCoJ8LmAMkzfOAY3dMkDNSyHeHXFkcIzGc5CPpOOI1IrOmGD8fM7p\nWtEQrqT32IJajAAtn4JOgjXNqpk3VVFigB3jnWeCerZhe1UcqOBGqucYsBpH\nKv2mbKojDgT34ZDPcoDEb2f8qgFXS8gJ/Yy75d8aot2fu2ryR8LxL/Vw28OK\nsGOG5Pg2ORXD9wYWRPLxudvnC10xQfKpHwL2tNBo+Ch/1coUSn4JCs/su9Zh\nEo7o/28Cl56kUVFS/Jliwn8M3J2A5jI5oUjQX/5NLqPr1K+y7Be1XexudXnJ\nrIMvHmgxxpzNJN2YBMcc/qQisUB0KMSTDxwisMdVE5agd/q29yRSaXJEYLpo\nw0N65V4taV+XUMk0Szr+a5lFQ6/wqzl3QYkHHB0dhUn8T71VLib0xabDfczU\nVdW8vCTYtRY/bi0zmXGqNK53sKBfk6oCgvhd5jARXsPaDrDH2LwSorfUcOo+\nMZlb\r\n=F1ZX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhK6oRlp5V026Z1vG70X74u0xHdNOMdOTk3HwfD/guygIgaKAeSFi4I9M6FBlpXKRxnk/9HHfmiaOfsh9vfNjg//E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0_1610134911363_0.7311722197614186"},"_hasShrinkwrap":false},"6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0","gitHead":"0ee159c076e08de2e7bc4d63edd377bf9fbe71b6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TqxJoJOK+sfYPPAAe4NrXC14ePxuEXznTjrbzZ2jRFskcG95Kyr3WuwoiDiztEvFiRiitEwTSFtsu4MzKRpRpA==","shasum":"49491198470ff156daadc94a9cccdaa49729f335","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0.tgz","fileCount":39,"unpackedSize":244747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LXmCRA9TVsSAnZWagAAMN4P/23SVUJWiM6mT8u7NJzi\nt37vg/hbufT4OKJjOC5/cZX1Jd/5TXwn21JXpie4jbmnMjLGnQplZJx+Y1cn\nizPpomhWsslrnkCx0DAqCALqhkmGLj9WkpcWt400712qTCP2zcQv3qHvIR8X\n89BfF2ZhRo4pr+3d318jQWeHFtRnEfOEwH1kDixaRTEuuuXFS5lEw3tqS666\nHcmUTdK8qJh3+9KS3ud6Qk6XLNRoOiQMinsiywLiI14AFA/oFS+0idUDpsft\n5LR38VcyxG5jrg/mwNbMBXWD9LaJeOk+UeWKBRvbFmtWpglmQreJ8Ns3Tj5B\nMRNCwvD1ZKXH/ECq5EoUFdcMboBQBGVycyLhoIeSXo7cXh6aNYiInHpz17eY\n9es5yTOgDZNwHtD1F00JCPPRPsgF6Vjvvf2ynKIdplhIMRkF4O6ru2AkyWdF\nUDrGyqpP+BZge1CiG/+FJJwu2PFJZf0zlFLGvjrbHuHsDEJvMfvgfJVOIZ3X\nnKuNH9WLjcw888CAC/RRMCooc7jP7+8USpR9Lz9JcBtPGuGas00P8VXVVZxX\nUGEOqEgPB2LKlkaLJpf2RjsIeMhNsdRh1qqk3UX903jxEC/qF+8xmnv4bUwJ\nzwelPfBy0WgSXLsOpQyh9ZH/kqtOjTBnPRCUlyitfEf3751qDxs4MjW1pOuT\n6Oc+\r\n=UnU6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyYY+4Q2m7BpC0nwW8gGWm323eMpG/IewTU3YCQzf0MAIgZf94zTKRuCs3FKBlkDteqpZGond2ytVT4FiEfF/GeRg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0_1610135014086_0.9539966596223817"},"_hasShrinkwrap":false},"6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.20","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0","gitHead":"1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-S8/IG4O3j9cMbveWR4b6dCDAgzGdZrGUYgZoL2zXn6Fg8IwYTub76hsXBy0bgDandQfadoqGv68jN+GQxoqBtA==","shasum":"177e5e8b29205148fdbc41a56c11017eac709390","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0.tgz","fileCount":39,"unpackedSize":245287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAGilCRA9TVsSAnZWagAAXLMP/jYB0J1HQE/DkDkbf/Co\nPzAlzkExS/JsgS+vttQggwirBEm0Id0GDdk2JZ1qSU3QMtncCfkg5PohPYlQ\nOMSVNHHZIGWzCau7PYbrLjiAWcnzdVYPbkfZUc11lYWsJPbGlCZ7NX3yI6Bf\npsfBTUKgNmI6jT/eyPNlccXnQYCYia8kLatit7yYLQ4dPO6FVNZ9TPuI/OeB\nO7ZVb0dZtLikadLR5iv/47eSyh7aubDv4DqHPwI7fUTAiVkGNnGGY6lYx/L4\nneTU+Rw/ZNNvUqI1HpQyWjOL239Licfcd7v6+5JudtxBMfX+nFjDN425RRRr\ntbvU0pyGcMJ78EPDiVjlcGJr75AVGVjy9ceRAsX5Iqefo4vxnPTxzjYf64iE\nK/GYVVB8N9cr4Vo98uw62AKOflCeM1Sb3qHjFJUR4nZaFnJixz+9n+CRnDbW\nyNm/lAEVtEKK93JrfPiWJezzVChcXbagZCjPfIhL7KznMjOEEONIxnzTAOO/\n4NhlG+ANpHU26CFWjSxzg6bjZVks3bNwkJpuVCv2e7EejY67URL9EsAVnY2U\nrVlGJnpNZFJriHh8tKqK6O35q6rAckbdenWNuPS2KAAFXN8U/MpkUJ54CjpQ\nXOj3uV5JFk6VWSr0YyZa0I8mJibVEcioEPmsf3cEhHP2b8ItVsdtVQvIfYfk\n447c\r\n=ng1y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpOp0OjsZcMvIzlH+lMdbYlTX4kCThf6k2OYrcgnXqjAIgWKW9HDQEJT7Q7hZs842DPZcmL27+n72yBWbsgn8+cOc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0_1610639524827_0.37937856899944844"},"_hasShrinkwrap":false},"6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0","gitHead":"6d44bbc09dcc91d625256e3f102a9893792edd78","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-VbypaIBWEYJ/Z1N1YujeVeDtRXJ4KV+WrDMpXrKN94t0iBWMKKW8+l7V/h4KyDvd240djxdoYVYxyeTTzGO6dA==","shasum":"a7a0bea85f666d8ee92ed27f40777c8d038efa60","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0.tgz","fileCount":39,"unpackedSize":244747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgALsWCRA9TVsSAnZWagAAFvIP/03Zgn4v51jBLG8bIFl4\nSyHyIyUYv6wljAM7wMfK5hyUzlMYt7EKQxMnvpC++jXJ6U7fUKvNf5LD//UI\netsgpAzL28llGXVfOwYWWwpiYYJ6eVniwLEaxH/jD6EnWgZI+7EmvjBvAXJS\nbCxcHHoTgrKh4eb68OBaNlwgAMERaGADpNfU5TC+ULoIhR28+msjUaqKa+2y\nJLaiUqbffgo+voEqVZ8ZzCriAdS03w1+6+0G0xlwORTQEhYTvi8KpdZFGlDK\n9w/Jqedn1dvw6t0AKjlMxLJJw1Y0BUNO6nvDnMxNpn8sOYQ3rr5FjzmbbEpm\n/a4BtOqQ7gPwzkNCfys1oFC2fKRbD06fg/A9NKqjSArj5kefVN16j4Gp8JjM\nOMNuG76W5dQpJg4u6uYbFUE7ohILw2Fk7Wj14CunWSHtakm6H7CaKNSRd55T\nWQNCysVsuVPsNhTN2OGXIvwCbkkRQ8fq52cs2IgRzOiD+pW+LRcqLamIaYZe\nlL8tsoBgFeQLCXFQvAc5Aw00eJ72z+RAR+xtYvUuVi6VE8p1soX3JUBTX8eH\n70lwVsPzM2+h3YnNWMVgZNv12phDzs7nBD9fMfr128BcBXc6/MhYgH7N686g\ne4+xhnscGA5RvGKqVBgoBbH0PWQ1kosi9fuUMmu6GytfAbfVEpdu10+F4ma7\n7z2F\r\n=ZCCO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICxmnpv2jwHogj0ekBnXuH36nBlJuH+KiFcpB/iSlTIRAiAuQKcJ1/W4LPGd4G0Ctq7QXnnITLAW93VtfEON8Mq20w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0_1610660630061_0.9422759617616334"},"_hasShrinkwrap":false},"6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fcgBCsvCS11wz8JxQGH0rVU6XvBJoBruMyZ9qBzpEGROkCmBHpDkO4iSUMgsbYgK+HvGgNcFhsgaWftQ+hfuKg==","shasum":"daed2f039a82a8b55b10296ab47c0e2f20b05559","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0.tgz","fileCount":39,"unpackedSize":244747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgALtxCRA9TVsSAnZWagAACSsP/RsDU/Yy4rdEhZ6SNjsW\n8bBccQru048fsJop6AcKQE79qLPSlXU1bJv0VUerofnABfC4YPK9KiCeuwj1\n+Khnp0qaHY9ggspGkKKi+Ki0DfUsJKLmtx+fpSwDBSopagLg12a6PzpGyUuJ\ng/nDGNvuXcZdeYa3D0a3A7IXG1i2SjJw1zr13ev+jhZEmK9n1Gksfr6q/6Dy\ncTlhVj/LMZ4cs/UcOS2A8ncFQ6mALNYhVPdGXZM1ohywfPEHaK3jlqVijdX+\niM6g5Dlm/0hcH68YXnd82mwvudlR+c4hsWz3PvKr2EN56k7WrdUpHfAZ7TJC\nrA8aBH8ya/wV0+n5Zcy/UO37cMUgOORxHo3qln0gDURiDd8hsSU1bcRRd4Wd\nu1gQcs/yBBfUCbNTn8TK56/PkJS6gOgFGRa/akpquuUskGW1EJ8dImjdXxtT\nBkPJJXS7LA2LKT9dAt/Awgw/urejFtTnbTZM6yhTkoKbZMjhWWgLCOiaAb39\nmNbhsA/G2qdmtvi/mOeAoiamjZLg0CvAVhvaPrU+Rg/FiQRXbJ+OyLCulRts\nPcSdQIjTl0VEq1C21Jrr14Lzoalp6JHtD83+oDR7jLcqfDD9uevroqY+rOVb\n8+JQXq5Hs222PMsCib0DC8sPg29Yr/M2mJRNpy49ujIQK5JGBtq90jrLYCDg\nyjUZ\r\n=kGpg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCW5nrTbRC9kjcwdeuzUoUGcdKzu/Fz0DBntge9hrKd0AIhAIt55jNqofwlyWXphLFv0Vx3jxb+Yllze789/m2k9+x5"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0_1610660720791_0.5811704737712022"},"_hasShrinkwrap":false},"6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"657845f6838b8a7bdcb686954678dd1daae2c089","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Hhq4TLKyB5f1w4JQF8AoFPypl5DZkYQYQ9XgR1+a50Qm5o3OoZ7RHexi+mU03h9ubTGUTEFlQcLgjRhCI8cHiw==","shasum":"f4b1c9b84bd32a0b326dcb407a41aad480eaa966","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0.tgz","fileCount":39,"unpackedSize":245033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgALuQCRA9TVsSAnZWagAAwpUP/0up93kwhAgzsiItc4Fx\nSlRBl4pEnFEokXzN6+4Msp52CH/zVOQ5PFeHs1kKI0xdkFB9y2oYqptYovp2\nemrVyjh6eg6evOjnXQ5EgpsMTJyjN/U8Z+v9tkd/YElOHxWgykW6ROoX4kLI\nDT8YVTh0v54ElQ7SjVeHm3xPB9FsZ6oh+Ljizzm1WHa1/yp+n5hcEU0eHpLL\nnc8QB3fS8dUr0Ere0/jS8sTI0H2DWsA1GW19MwqCupEnhyTGpfZsVQQejdRk\nE67bJd0d0sVz/FEcRwUl9iYfRFUqpugaaX7haOh9gX1QxQ4BP40EH0tmW0Fq\n4Cl5UL/tufd9vNjN9EOcj7ZeD/NTgu7MuziWY34f6UBPzt+yIJ+79/dJ6XBZ\n/tnuNdxKD1QM07FNyidSgWcK6M/gs96YHCxjuzlWkMoA54Mjs+hcHFDoBeC7\nJoDlXKz3k+bAvwu1WGca+A9DZeN/id9QdNYCPT6Jh+JwNAv7EFqg+5F1qJly\nzDyIk9rkrXLsqb4UV7JpHc4KpT1DOgCuMPQzV8qR0h2VrH6uhZkZ02hLMevn\nuzG9Im2Kjh2QCw1Ud/a5Y30UxMSFu7V9o5FZ17+InAShRWj8/HOyR1+r/NU4\nBHxMF5CjCfyfRNBlW8uAq0ukI8WiuS5QOcx5YsrLeF1stpOVWj5HP7x4lPbB\nHq0C\r\n=6e5C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0VuuLFhqTC12PPyS9BqlP56DVKe8SxYVYuhqcGmCHeAiBPplixxSZpAg5W8I1QtlV9S/AADIXnVh1GJi7zeK7H+A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0_1610660752166_0.6561619137723784"},"_hasShrinkwrap":false},"6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.2","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0","gitHead":"04e806d6044f0ad27b78184fe7986a80cf070f6a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-eR8/EdzynAaKk8rMl7snXMk8pXPW6yarkPL5WnMtGsj2dfuHvkM7MKDjDGLkpNht5RE3w4uYr/ZHo2QtrGYAsg==","shasum":"65600a6103c84629616e8793e88d63136ea0c9a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0.tgz","fileCount":39,"unpackedSize":245033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgALwFCRA9TVsSAnZWagAAOuAP/RGTSV3sqBNHgCTCTJgY\nAMFDrLZ3TeVSjDf7KkqTDzzk3cdmYDSobfr8SNnMt93Jjv1HIlqjKyP09Xzd\nV6+99bJeUYbiux4sG2ZXf2Kfvsz9+ZDqYDvkf4KkhrvJ0jg8QGIYGhooxO2D\nmxt+eO9CRHaZzpRKUbRyIF9PPmS/w2Tl8+eUq09Wc+p3JZ9A7pLKweRmFC4k\nq39+1UT+5vNRPEMEPIZvSoV+JwBbxgfGOkl3DmgfnzqxorCsnhbDP+1dB7nQ\nAhXLeFi3hV+bzPWnUcGF5Us2Mzwi0F/arTWdPZTYho7BrZaitD21Yob4mtsS\n3mCcWN8YJR5vZwpBrGoNOEu+D8rSPZi1Hml/5XuJNgKdsOIJyjtEMOmad/SV\nzfDdbFClLHYpeRh3fyXb9FfVaQNSeVMOzojhF3hBThbeJXapeMC25TrhnOwo\nUe7ksgrsw4/wosHGGHhwuknOOIRc5pH1pHHnJXrvmlRZT3bqajiVNAM6nO72\ncmn0m41vbOZiSWbo8WQY0wE2oBgCDc8UJJ4yPO4/it7Flir2XJb5Jp6fMPTR\nkxPbJ2QqOJqvXPehj2eDSjoVXS/8RCjcXbW9vyIG/BcstYKbwqEVYyjfjQ4v\nNrsGYTH+PT1ojGCeCtOGWAXXgo5MqjzfbDUrxkDlJ8HwPzOKo+xAv+Vy/yVQ\nJJFr\r\n=asjU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkwEd2Zg42cta/f3XCIeWVK39EY3A6q6u3SPmM/NgZCgIgO8jywNbA83FBAqG92sZjnmTZCOYvShxjgkgfqUOUfpo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0_1610660868712_0.11655714450720844"},"_hasShrinkwrap":false},"6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0","gitHead":"02bfa62acd1cca03accd3974a3ee0b27b14c623d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Yxo5dIsl6ODOYf0OBqG3JF0XSaiLnrVoPQfX+WPFTyECcdURLuTuWwpOdkgkkF4KKFLahq8/H7hHgMjkAEThqg==","shasum":"11fcfc28b17ae47eaf7aba56cea2fa007bf360a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0.tgz","fileCount":39,"unpackedSize":245033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAha7CRA9TVsSAnZWagAA3xEP/RsNGP7vvcVpuq7VyrDy\nJP0mqTLogV/6LKJruk57bVv9SfaT1TlrSWIdTWylhkhPfsrpY1mSFg41tAJu\nZ7KDi5hOTyxapMU13LsdcMWtJLstIIx61eaOEhnzzHgPkc/36saFQwGjYyaj\nDLG3epFIrrVfCpxCwuF5tvD+JAWGgK0QnLG6Cs/Q98tkeBhjch2Mx1FC/WpA\nfWqe4UWXWuflQm7j4HYY0Snu92scN8KTFCv+5L9WWQkLpLWXYzTkbwCjKcDx\nzDiiej2CNucxPuxszEoXQZCMs8QiSKcnVAo9FFoQtI1xCxaPc4yIPjP+z3vo\nrqm3hk0pzKWTo7wBpZjT3qpKZgm2SF7ya81l4RhCSH/o7s4BG4dyVxZSEMjC\ndAVkBJSoa+Kif3tkG5efWCvYk5UdqQnIxM0VUvNBxOhmHw5jQIoJBQRDvZWc\nZhWZ19LLn2tpsH9leMMxE0QiuPS7BNww7i2Momr/ZcdifnDKrsvfM95dvqhc\nN5i0duwSwqw48ihY5Xvb3FUMGjMf6U0VrUNldYKSb7BU3bg09fuCibHecdT2\nPFKSDnWJCSuwFt8zDELvXBFcmAIfIZ88xhrGyL2ZO47AJtydWlDgMy1/hEqb\nYqu9i0t1LGHoUImKSoaFSZhZwCgTGnQnaNUTV92vrFgz0X72EIZIwL+BZTuF\nfzu2\r\n=tUKl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBfapVX9gYfhIIGehMH64g9fraH6jlFEVf1CpmcmH3hgIgZMGnpEkmT1BkC6FoVP8FSn6UuVPv/uJPcQzNlzt/YqY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0_1610749626971_0.5551716260410491"},"_hasShrinkwrap":false},"6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2047caead4eb981f2916673469f6fcbcbf30f980","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RObdegbrcZTZP4IuZ8pvoMqcBDAt7zikvvfANvb1SPG8HahfggMaQFoSo2oy5nxZUomFfoqr0nBWVwivIJacKg==","shasum":"2fcce176eb9acca72f30abfee918513af536c816","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0.tgz","fileCount":39,"unpackedSize":245033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAhcuCRA9TVsSAnZWagAAT8EP/2Y4hU7+9fwJYcwsn8/r\nr/tPZco6jy9PZ14VS6euZzs9b50pCh8R2XfUCxNrWEv7BXj+916/oxf0byC5\nCagAC88w8STncg/p5Ooa8890Irw9bTr8ztuYVZg0yNBw41Higu05vBlPau4n\n3BTUIvoPOcp0SXb/5iDZ/BjobRBJnSQCjvFRv6TbLB09uZ/12THLAZzAIzgx\noM+wYqR15zsDwHlP3uY4vIhJozZ8hFcnoplF3JqpT/1vrqB0NT66HlVyb6Aa\nY/mfPPnj0Vf+ModFx8KuYxp2VHX77+NuJ3lmBTVHc6M/5wOAezfZEtwdeeLp\nhR91XPbXEkP4Nm4N6XVydnaOZC6bQ9a6XMaRf2QzprcPJy5rFjbuDg1hBGu4\nKU0xYC0rSywvtu3jWPjSoSby0Iq/0Emr74z2B7ykG6FZWkuDn8jde0xs5by7\nK5rTlf9MvllBMtPkNy0lR4nH2cFQbKmSd2EdT7cbgfK+WXMfZx0qif2H7eIQ\nuF3F9R703qQb5TLKKDugouGIOll/ipjWQMlnjsDFQap68Ln0los7IeucL3wC\nEH0uCJvR+DidBlHCYwH7XW9Kc7W600uvt5a+ZIheLcsHhwVwyS19qqbL/5AM\n3R02fqtJt89RPfAFndMx8AaRHuAfH6tJreh5RBYDW5nQg2Q/ELmkrGc5IjTX\nGXRD\r\n=11nU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbTRpYFkgtXKlyF6VQNr/Ja4L+8V0XE3F63mWWeyhIJwIgRcdcwwADjQzzolkVzpzmY/xw5+7PoH/WflqrhNcubXs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0_1610749741461_0.36584238408434766"},"_hasShrinkwrap":false},"6.4.44":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.44","gitHead":"6b1294382146b342d37532cc636f2437b9e7a928","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.44","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/3An31SYdIYVe7aSJkqlGoIrtGdpQyvtOlrrmFtVMOsilYoZH/ck5dWqGJnoa1+wCXAHXBHIWTJUS4iRVQfQIg==","shasum":"cb25b8c43d2447d4d5ebd40529cbf695ac955f25","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.44.tgz","fileCount":39,"unpackedSize":245269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAhdsCRA9TVsSAnZWagAArZAP/As/u/gTuDCJMai0vRtL\nxlN0Wo0gax8GcPw09k0KvE1zta5tZZmlu3chNiO1TRpTl7N6fcWep1UjIqOo\ncxBreyxHSb3yXQAtAIZoX/TVbZ66DLP75Q8sThT6LCQlEhU8VfNCugeZspxV\nTOLZ51DZkb6Ol0MTUbM4tYN+qDfX7nR7mjJTHou98RPv1vbj++Jv4b3Eu7Nh\nMbJKI2hxYJzvcqOlM38X7xUZntdy0zaNvQZ2qBDka9/QdEQx11/LkF9eabnr\nUpJXOjxYQdJI2wH3Lc4uEUMfkSHRbk/QgT6S8Eyp9E08ecdyvfeYtbmnVHNa\nIahn2hLrgYaKHtulW9slu4ACrlnWzIhHs+pY/RSxKbpWUUyXt3n9Gb4245f1\nKhRAkZKYoFliXrVMnC0McmVBbc3sBbwRvg+EbpdzYipHYmWb9m/n7FQ7V8ek\nPKLnZqID9/6GOHTWjKo6yog2bofT9w/LtOgomjyAkO6keCIaa8dlA6zOkPHi\nlkIOUBN/cdn7lrAHdMX+7valdIPGisgngznu9JtN5Lq7Zxoub6aXKDrjM8IZ\nuRCMTiS1hk3oc9910bEAWfNinn1vKInlef2v/YNRvWFWEIAP49CZO++2Fxqq\nA7iD7xOM+s9smnCfF8Z+BxI5fB5Qn1ERluaae+v/ImY3ZZkpZRzslgQJKZpx\nR2AF\r\n=E4nm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmUloGcmhBm+VcYyqBUYVjV50m393qiO3lPH2GHKbf8gIhANoKOwT1uthNcp7AEMkh/PsAGpCewOkrFhYUvOs1gK7b"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.44_1610749804333_0.5643901330303631"},"_hasShrinkwrap":false},"6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6b1294382146b342d37532cc636f2437b9e7a928","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-xqb9lipK6w49R2Tm2CFj2pv4nPwcAYXDRbwoaGyA8i4DW+iRpGPD9UpSiPZKXWFg5MxMbv6O9iY9IXnDEPsYbA==","shasum":"0c84210c68642d994fd0806a418a56b3eda78262","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0.tgz","fileCount":39,"unpackedSize":245312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAhelCRA9TVsSAnZWagAAhXsP/101jKo9ClnyJY6weD/g\n6tMNOFw2K6WyJhh9QS5NpQMVLj6SEqnrK0e53iB9h1uyvdFQl09ItvQbw1Bm\n06sLAKdK4cnhfcQVhEpXdkQE3I5NYCZvHr6OgU79qK4Cuy8Po7jpp4BYQaYq\n7fkpaz1B+7oX2LzfTAuwT4xb7dHyMu/++yE5O89cadonB4jXzRITbUDUWvvc\n93Qq4p0k5iUnC5XiE0OwZ3KQJDd1kj1H+2qQRwvOWrb7/MTLDj/KlRbb90dv\nfjQy5NY4T6tjlFX1CIAmdVizI5UvxVFglH22qS83ENNB78maMLPG1AkvLWXK\nwz3882EGZhbo4N+RVWTiwNn65akq1/mfiuW3NQic8xLc1e+1BhzqM+NW8rhE\n3LJTuPRQb7t5iasfnDeNNMw2C3Lf2zOKgfpDlSMbxf/i7WZRl1BQhEbn/+NO\n821rZWYPNCH5x3ZRocEr9JsvTvqkfKkBSpmfxCm2jl7dvIHXYqjzV3sPtMCE\nxNNwrsbct1LZKUvzCY0cPl7CaamLwX+YOtwdQUI81KUQba0SzhZbMcii+cv8\njLXQDB1eD/4kwZMG/G4h+X6dSWc/ahRnqZH9XbyZZ90xvXdBb9XoiRgv0wZz\nIxui3jz/iyfhRdr/5LP7PVi11Og32iaUm/P0tsVXJi0jqv3+aGJhPGISY5Dw\nyPWQ\r\n=3905\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHABCv3v8Lr+x0QH6SsGFmIszW/iR7b4U4je/hQsH+uYAiEAw3Zm8lKPLOBphg0PyGX/5cUP/p5eVT3nIy8670uzJlM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0_1610749861372_0.7497556211710841"},"_hasShrinkwrap":false},"6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.17.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0","gitHead":"adc9298a6ff78f54265e523bb3dec639637a00c9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0uW+GFXzmi9CTvU2/Qa9Eb9Ydil13gZ1hzycSg6C+YYLzpbnFb3xYqo+dbk3PzUQ+ui8vJdbc+4035sJIxGpaA==","shasum":"927b7146816a615415d032b7ca8afc9140207100","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0.tgz","fileCount":39,"unpackedSize":245312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAhg3CRA9TVsSAnZWagAAKnkQAJnggxETzzUmMtk99rVB\nOncaj2u1RrfLaz1fdPwgGdKS2nXs1bu1m860KqFyVgvm+zfovoWihdKTMu0/\ncCFzPdNwsz3AVwOaVL/03c3BQgdKwSpEf5DosWQNvGilumMlO8bCOrGG+vDd\ndUPRANAoXC0JKvKsJgJYV1kofVbpTwP6SWojRoXYtLcPEy+BzTK2KGoXY/Xy\nRNOlcWZWYjDGDqMTBe5Us+dJKDmTh3d/HvyLw7JoBmI7LXUAR4AQKUMZRxTM\nz+DhiQ9RHAIGinAlBzNWexFM/jCq1Y16G0L6RtdJiCP+SDijj2FPOG+/R1pB\nXEPMYlloH7BDNehRgKiAmITgQ1DmkPZ4R00wA0h6VBDdYNe1mNVeWsQukQvK\n5+HDWJSfgLX6Spg5pCz0X5IZVnEXngQITp+faobL7XB/XODHmh0znbD1jb5g\nDMpeOzPVgR8LVC9ANrpJ3ZSH5meoLgb3FrVqtuVDtY3BPnE8IBLeP2XOkzM+\nCErZP4zaYnIDObopeLf5iMkyzQXw6o++BM/1vjnFWwmPOUoCMl0jzlXLncvh\nq4gfY0dTbnDUFUsD436JEUCjFmGKF3AdJYNfzzTqDM8g0MYMzDXA7WomxEbI\nQpMXZWUmTOeTWsTJPlFXJAmo2U5koo7BCQcIBl3NxPsQ5eiZdSNbLQn4aTIl\nAtmo\r\n=9ozf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPb2Bj8BGj5pbb17068itwyhSGHUJe8AgLnSCo5OxgQAiEAin5Du8JIUJ0p0oUFLuRRES8PH/1X24qJXIRUeJPfl9k="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0_1610750006881_0.02896602490569533"},"_hasShrinkwrap":false},"6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0","gitHead":"e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-uj2uD8P2lD7hK6z7uCJDHHxo/MkecQaHATX9GsqljXrd6NUIJjHTTwdosl0rRVEJPCp++d0yEk7I7wNNHCfKuQ==","shasum":"0620a48ca39505c7043402049c5943f32f6758d0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0.tgz","fileCount":39,"unpackedSize":245312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiXoCRA9TVsSAnZWagAAEcQP/jl9GHDEs/5Au7aLZ13G\nX0bLF9eA5JBzs/m1sKAkbVBLf72twptfs5dmniFDjOU0bA0AB+3tf1Ci3udX\nALvTzClsekrx4nU8mLUe9+77tIdcz7f9H0VgB+piwuSIyy2msa2dnKd733I7\n9ouA3uxwtyAzknJ0lTILAkivdMTMIUGz5jhQYSbHYUUTlDdmsIC4i20IwbTl\n72oslxZc3dNW/ridoLk9OML1INrujfDRQHXg7+InHjqkUhhT+IPTuv6rEI7h\noSQnyUK7cZNhkHOGSKL/sSdbDrd0sXwqRQyYsa8Btotk/p6eeLpOwPS08YUU\n1WDQagVzR6lvySMy+j1Mg2XXdqgwEcApZY+liexbam4YhjjkCsQUKwtxvRvx\n8tFVH8L4k3mBUN5zQmeHoI2V8z5uFrnIcMd2tjBC9HbZQKIIL3QuUJtsFLax\noFnUvAzNq8sKsa0CHE2SBIEJbhOUfWrabBQjOno0IHijdSCZqlnOh2w+JJs5\n2LzbR8PzbDJE9Ct+0d0gk2NqEgq5G9R4tLhTpkw4ExpQ0YKTQMnQcUXtBwBk\n54ApVK6aaYJpa4BESp1WPJzsBDoMZYcVCmS6eR7fs4xNzQwELybWAuLs2ob+\nnarZq/DU+qiWpNnCVzJfcMl9hrq79gvNWhA+1BMUJoHRGdR56uUCe2G6yBSc\nv1H/\r\n=Wj6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqK7uP03mOmOVmcK5nKfQwdOoUc9h084aNnd71PN8eZQIhAMWq3dGG92gDVklRG1V7kEshaxUQ1QRuJl6fBJ6bZMnM"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0_1610753511876_0.7613059316725557"},"_hasShrinkwrap":false},"6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8477f858b3fe0442765e4ccc03856a10ee090525","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-tk/d8j4TAfE2C7uLv9w1g0K7uWGyGJgPVrMOABWavpKzs0AUq0scUN68wQLS7LfROBgCypHx6pPiT2GnuilMXA==","shasum":"3780acd404731879fcdade8780d2682823714da9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0.tgz","fileCount":39,"unpackedSize":245312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiZLCRA9TVsSAnZWagAAXmkP/jpwdbQuSqNBehtE9myD\nyREc75GwNsXpft2Qad3CjuA4b9pdGz/a0iaSk8aG5jvBTN/HXoNHvd1kaqML\nPJoP6p1+7lIWadV8o3E3C3zyZMCk7S/TIPNN2HKN6ZSGU4491P2UJLqPGUi7\n2cFYeNedh8GCncCUqEZsd839xg37euPl7uA6Oe2VSr/rqVtYV4J/vzOZ44hc\nXVRUWkiW5YxxRVPFEAps5YNBsBi5JPDtvw2lJ1+Yq5vEYQ1uXXPOL/7texfA\nWA1YFOSiAyOgAGGT4OQoo9xaCoQPJ5x4cxuET92en75AwAUPHIkoHejQ+Mp1\ncyvw/0/gJRLntkDWzfQ1UGt5zzWzav0VSEEZcrcosK3pqTFp1U8ka58cG64u\n8IU1euLdpLCogl0N8nutFobPDrTVi7IyKfqye4Ly0subWA4O3IRhNsYsuBgE\ntVUD7axX0sVC4SKYvI6n9T10HSyq2vjsOPtujL4ETGoUGOo4NagrRRx1S0x4\nE75mnicYW0EO9OYz++/1Xs+RTbEqtI4VzXLbdBnF8EaO+dXQfWC4v8i/ATQl\nGIDMq0YdSqf/esDpJuHW/o24CTY3b/E2qTXYMKPn83xwP64xoIz6ot0SVaXL\nb9QHaHoIbp6tSoDnLgfelvps2VekSFPUj6x4LEC+DOuPCdsxyzBS0s9HQLLL\nbWi3\r\n=53Ws\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvm54ZimPplXSFcvGMGo6aBW/RRm7vuIV7fThGxNGDQAiEA3OV8nlRbt5wRZVP9S+zA/vRgn3J79pkBFcKO7X0lYOM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0_1610753610367_0.41508603426186896"},"_hasShrinkwrap":false},"6.4.45":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.45","gitHead":"4ca54d438da551e1b2b6e7058bf8103be8b32979","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.45","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-tFUQ3lHIY3nQHXrrYNdAT/6DC8UYB+69+7hncif7K/MZio00cfyYKxnEz/5Rb30aoivMOiEvVEwpNpuzYhmaew==","shasum":"54ba72c13698d87e558235df8dfcf15dfc290c68","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.45.tgz","fileCount":39,"unpackedSize":245546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiaOCRA9TVsSAnZWagAAglUP/1186RODbBTlS5ZaBHKV\nXdAL96yxPDNP0u2tAGSOTzAE152fndYhPQrjmWwl3ZN9PmId8VwT3na07YAV\nVNZuJqBpiydk+3LrlNsFopAh9yqSMMQ6H9bQ7pWkObACBlVnSDAatG58cr6b\nWVK6ZdyS6dddl9nNC8CdGqEgaganMePCgk+KcXxFk4B1szxmp2II+GSDB9jg\n4UO1Jw/NeuvRr9jaxvcgC2hHJuXxXTtJ+yk9+8p78RsiBeI401jdcIVDGyi6\nByxbsVNHvFsqoomppIh6mnaBYNg9LS21uBE2oENDW30gXu4GVHPlVENAHldJ\nlLoePJxp1s4qJtCWb1yBrNxJjQk0XSCqIYxS8Te+eZ8Bh9GvS+7wf0lHGtDI\no2fvJr9EBFcIAR+HcHRgJuEFRmtQgXYJ50iV8ShidOuC74zwfSd9XwhUzQvR\n4epKDcbEJUrSGbKVUQz6LgYxB92qQGCIl20AxSwDPrFiwbMQ0EJTyK0bR4pH\nu+KdmKBu7UH3G+mvKtr7mBusH0rYS2hcwHl4pmpRmJb89eCdWHP+ClOlWUMu\n2pjo4pp4ytwBcnX1K/CCqOe2R/8J1DlxNid8k64WDSW/wRPsQ+x1GLTwqqjh\nw21fYQ1gm8ECZxEsziqb46ILW0czXFkEt1OcsIzAf+Btnpo1JRbOnba+Z+XH\nE+VG\r\n=yw+g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKt+JnTyE1JA4JzCjTqoRXGuh/BiTXpfUe9RwaesrJBAiBsZExoSa4Sti3c39Q54Hy5QeKCTckFG/mB+bOVPTHhKg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.45_1610753678152_0.2608514184179118"},"_hasShrinkwrap":false},"6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4ca54d438da551e1b2b6e7058bf8103be8b32979","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-7KfDIVzt5POfpzjI4bjuzGdHsrEuiowbtEkhU1vfsh6jJu8Ux+9a0eI6JJ9SVhUYzBzuEe8XBnXfebRKZjLXbA==","shasum":"17419987342ff394be092ecbdd5df01e37a59165","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiaoCRA9TVsSAnZWagAAg/QP/3MpDpaLeDtotfOzFBMZ\nGY/1X3SN2KOSPuCX1fNn3I3OmoPlI3dZX3SAjIWtG2I94xwF1AvLSgvoACdT\nRoumZiVNWi7NnAQnz4GIRVd4X4DmB6M3dD56ge5iAXIptMlhhx9bKZKgScKR\nsMdH7NJEoPnVRhj3Qa/dpiKBvPeO3J7r46eR7IlZOozGCtYaqtqKQFR5W6dk\nPIfFWW5W885CohF+Zr2BrKpe/Z/Af76ViO2vhrKlKhdNq0mSGHqaWrGztQJ5\nCCw++h6Pg9YGpU/CNillaeY0pxnd9FjFE1mmT7KeFrwHn29TjR1DgoTMc/sj\nnigKAdpTtOzsxBPUBg8aHfSch8OMtFX+eU05aucXBnKEhp7Pi1J5paCurutl\nYoFWeFksI7bMKRZ5j9G/QTlQszQ0sA9kZI0UGzNOAyUEjYvkeIDT3MtJgawO\n/+OP+P6t3rzL2E/SarOuRyxRTXeDWZX0rtlnggramfopea6+WFzvDng1JHKp\nrhmulgfiy8xjbaYMBIt78JClQl8Gm8YAEng9Remh72M12OX3ADVpnxmXJwjg\nHblInGhD0rxlAPQzRMLLUGSLND+ewBB1H8RMyuT89liB9z8WyG+glqP4v1Gt\n6hPYps/xSQltKX6OyzMUkgph5EGnDm+taiaydVl6hZyNvuaEUC2ig+qwDmOG\nfsDO\r\n=+0jD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2AteTs6Kmag2GF/Xf0doObUMjscAarGIHntmGGkgvGAiAPlYi9nYFSzCp0b+EBWVjy+0RzshTuoHcteLi6N+fDWw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0_1610753703765_0.03357991919922987"},"_hasShrinkwrap":false},"6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0","gitHead":"0328586162dd818088104976fa3853d70c6d9e4e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ohAINIc01UbjZS8cgmIX02GqDcuD6nC7kKjskBExec2MqOi+CkSN+zpqn5MLHFwqJYX6mzLgdbMCrk1Q8oCRvQ==","shasum":"0fb97620452d5bc67f0c55e134d3e4d4131d5c0a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAibpCRA9TVsSAnZWagAAHn8QAJ37GihiNqDpQluexKLb\nzlkqa+wyXtGoMzYx3mYQKs0386Qfsfy2fiGvfdwPM+wgL81NJtHaOJflI8HG\nKp68EIgwNVCH5spoUTdy4cOlYVehH5+iVtqaNeRu/s+AKfSNrOTZVwz5Qa7m\nHNY9vdBzHUyag5q3Rm8fXWhYSq2FF6F0QkMZy9fa3PEZ5kzvhq8ltDGx6znB\n7xxiay/m9OZimg7mAxSn+bM4bEgdAN1bzKQoHhOWSzhd8wwTr1wqj13l9Tma\nU77rPJtM5XpvmIolEzHPkUlUZjEL23n3fXpH0uVv8hO04w+PvcrH+azwQi2y\nWLAV+raSdX+a6JNghBh78/QcY7weLxTsB3Gi1+E+UP4neum0nT/TjzICP5fE\n/EXSUMWIbYd3lLTF159t8R/RctdjmlMTftZ3hK88zXomLVrVLtEWmjTxN7sm\n3paNwa0lpafiJTn3RSnXKyHlzNEVQGu2VEWUm+pIGpdZZpUYvKVkMtKeUew2\nauHc6w3Ax58c3qN5WEjyRf3VAT3ccqym/Qvjcugc8HJvonZ6MlVAx6n2TsJI\nG9tWpeHTKszGEmyZXsV+btSQmJVEdGT6VrMniQqMjwO6/H20TM/JvF6E+xsI\naJZLtUlqkhnSl15whnIOzIPFSvzYNhKA/0JgPgVn5Cy7/bcf88GrPO3XrIBw\nX765\r\n=2Pqt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlRbbZh9g6EEJTdOzcXqHKkVTjNPzKtMWlc7DM70daAQIhAJ3+gLXDkd4ZDho5RolKGZCdOyMcB6kYAZiYG9CMEB4P"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0_1610753768475_0.7465635470949283"},"_hasShrinkwrap":false},"6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.56","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0","gitHead":"60a91c81bcd6b4fbae462d4850bbfdb72151eee6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Br+j2TkVYpxH+MOsY+3goT4rwMMK6VcELEXZ2RPrYAxlqNLteopCnbKIglX/b4+mVg6QU8D0e8wrqPrZAdoCRw==","shasum":"95ebf4a460fa4c81b084305550226c02bcdeef49","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAidjCRA9TVsSAnZWagAAi/AQAI95071H7z4ffmFxn0UB\nDH7CutX9Z50QgySz6mh3RSXz5MOaHIy7G4S9IDrEomTK3n1koiciAl0hes0P\nLPAOWCabR9B+jWDZHdcLMm7yBtZRa2D17eZebEkjmR6hJNn6uyEwNE9UhAsj\nhW/gAOBa0K0MRA1rx+ITYrsUdZ1FMjufEAwNxcax1aXEG9enOyDowamzcrmd\nNVnehX93KCq64xXkJnLHR3bl0RoJ1XbE0S+zRDkStKZUz51+yDl3zO1fwmty\nodp7I41GUWphBEqWK7JpEVvAN1XIX0EB8/rUHMpE66YSHyG4Xq/IzIaxbXbI\nGA+LU+R+TTPk8Q7flhID+obAmn7FtoYz8Gn+eAud+6axIcalbB8boFMTynP7\nbPax65DK3q73+WFQ3IZgf7LUYXwCBuneAkoUUJTeW+EYhioNrAfijAMq498C\nquVpBKOCPuQS6Os+83v2sMtbXiDdKH1fjIFfWeop0yY4+rr7KIqQBiAqR+Fk\nJTngqzKCztx/EbWPnPhss57V4wGFD5S4SuiIVOk4O1ryEsDjI3k5fo9VHDbN\nETYI5DRnn2IMlSGsonm5jBXUVh5gPp0zJabaM1Gwe4nIMXfdbB9wo2WpJOTF\nxHOq3zj34qaygzAYTczT5em6LvWxAp2K8hXkAvSm86qs1C+1RSIiBUw5KcSQ\neAF/\r\n=34e+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID01cpBMYhJt3cL7ET4WdBwVKnB4U+JQzDwGYgk7vzaPAiBoDKkZ+2Cutvsrhcns1JsceNJ0cJ/JAr9Dug8FX1T31Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0_1610753891098_0.8076441724606029"},"_hasShrinkwrap":false},"6.4.46-85e247536e34049289aca80f83efee8561537f9a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-85e247536e34049289aca80f83efee8561537f9a.0","gitHead":"85e247536e34049289aca80f83efee8561537f9a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-85e247536e34049289aca80f83efee8561537f9a.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jdPzoNNzoJsMofUVfMEtswXTk31Jlj1/mJtALZJvotDo3sR/d30vGJBs7T6/VEjrHvBt4GbR1fAW30QY3I70kA==","shasum":"0b9d1b174c46d4c5d30637fb23e1d9e143cce787","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-85e247536e34049289aca80f83efee8561537f9a.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB2w8CRA9TVsSAnZWagAAub4P/2ptqQ0/KlC3tLROenri\nZhQjAucOqE+EjQSbXXIKXItykTyUgwVNwqTb6rsFJwiq/HkggHPLX9hOvrW2\noEPfrxGk0Eye6RgTIkKMCzmEChcm86T4h4Ly+3WYF5ThnJtMRc976ZCtvyq4\nJ++ve5lSGoogH407UjPRW0WbF+PxodbvERw8p7abFxJIsAXRrsHgq/1Qxe9L\n15tNody3wx7Dj0ymM3JSqoursMrRF0FNCmX0LRUMpYr7Sh+p66jam7llO22s\nPAXcp6t4C6Nedq0MlGj0ZvZVeX0e4PUG/sEY2HDx3qy3IFuLZ5osSBK2xe4o\nViOxaXxuf1i//nGa9XPWjREb2VSdTiihnf/Fri93VeqUCOgY7NsNz5kShR0/\nVVIi0aFy0Jc7Zr8J+pYaZJIxKq2f4ZYC0r3W9cDcWmopFcbGvIoQOG1Bbfw+\nq2Y+S5mzb9eNCV/d++t8fLjZRCKpl2o6aR6LzxYKOZzhzoqrvNHT1wvcUDsH\n7tby/MeRxpp/Qvwyq9cDHVmFTpGCkBlri1LV/pIsAq7Wdd784K6UM67ziXe6\nWnF7p7x15Dx/TLYOEJCl+wgNhakzTAW+w04OIXc3jiPL7AuPLSVJe/KyCVEY\n+kQweX2YYS971eBRgXjgHE78IwGYbxMXswfWJR9duXKx+Yp/Tt72710Gte/v\nu/Gr\r\n=Se8G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2zy6ka8GHXfXngp29+aWPFsWVatAd3TlOP8G538nyyAiBp9QkfpiF/F59tovoVyXDj33CJcoQw5cfVqR8JBz7H/A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-85e247536e34049289aca80f83efee8561537f9a.0_1611099195338_0.28907730842151946"},"_hasShrinkwrap":false},"6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.35","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0","gitHead":"9b18e2d7becbddef2a7a45370639bc33727df6e2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fwAlbOqD5EQ6GPTr5PI/JT2orv5vtXEYhS5FgAHqXcIUHLzkRa3AXFsOD++MALL7VsKQ6zLOuLx2A7yt5B940Q==","shasum":"ce0963e8c3aef8809892abcd4720c631576d6849","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB3/NCRA9TVsSAnZWagAAiyMP/2NsgYa5YPKm7RYwiMq/\nAzzpPPvS6wNt2ouOJ4nNXQN1dQ5KbR2Ju6Gf3qLcN99b7EbhW3P8S2/C9sA5\nSPSuyXWJGZ22BfCB7Bc29xThyY2I69B/Jlvu7CglTcDNMxT8vI/YUyOoZieR\nHumOPTt2mEwWq0c0kGMzNbonWmcXqyoi+3+vNiLELHDRFoyIlSyn1c1gWRFc\n763FBYJsJ6QaYKl8kl0vfCpYGImd6E+uRdMQGqzXccQS3Io4bgQiTXe5RHK+\n7p+xdEfODtW5AgJGVH88JQt9YV4aorsgW2UyYnvIW6rB6p8qih4kSZSmUeM6\nVUaQr/VqgqHV2hnHspoIhXfBECSzG+/3IoG4gv8c+FozXFdR8Ggq31JQy6xw\n5uTNzMRjiBhkan5a3oSQxsTONfAzvFxHwUO+mr4AfrKpzoFOZG9kFqNBhF9r\nvtHF5iODsdqzLzoXr4SoJMdfDX4dvhcVZytGD+X4K1sG6LpmFk1ZkolvKycm\nb0KByeitUI9QargcOL8XLTnwSovgWqWL9Scll/RB9hXjuFMgOk4aulvWv63s\n365JTkJRyEBxNhkTin8fWzsc1yuQNlgYjIEPkANWIs40Sx+jMHOJLNqcD3UU\nrQRCyHXuAITRUatDqN9KKHY50uqIOHr+xxmvUK9+iKR2UJN/9WEarzQ0ttSj\nPcQH\r\n=P5zq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKseKHYaOYBXQAlm8x0cn2j6iM//g5jjpgOE7Un3G9gQIhAMSI/b7WEsANQjJ/Owa3PiCpBkZGmzkInfFErVilG9tv"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0_1611104204937_0.038894107364629615"},"_hasShrinkwrap":false},"6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.35","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0","gitHead":"8d5b7e41e2fbf0b64784ae100c0b3c22bd283249","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-rrVv+wUveNk9djp7+ycmgPYu/XczDK0jUiLkWbffN4T/pog6nWLwjtg8v4Ng/PvdKcfN0E+znNvNn/G6REJK1g==","shasum":"48ea5f994dd61282edd950fbf327ae6fedc44f51","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB3/dCRA9TVsSAnZWagAAvWUP/itp2mwQPLp86HjiyCJv\nA0oazoz2cmJCu4rmIYpUBWcKAklznZKTiphekdB1dQh0do3dRyPsPAQpd/sH\nwRBYlfGXGWAqVcco3Zqmmgqe2eRDNe9+im6MsR3nqNhhYH3CcJtgQlyQE96O\nYLYPvJuBlRaCReqgimBuwVZrnfUyU8TLRPJYgdnfbdaxvDpTyHZqr/jiE5zx\nNpNdQTHvfE4z0ZGBlQbjVUi92HM0omcOaWYPn+qCU6NAHX1u9ZengO0XAzM2\nFg+udlQUph+ro0ujow7x7yVekairvzEt9ueuIAHNTYhvdLjmMi2sGrnsFsbR\nq0iDSvpvoYbMMVEAifBxj4XtZ84teDn528fGtZjO2VyS6lNI37GnnTD2mCDM\nZ2S0TtewVS41A5st8CFc7D6VJmQrur5DU26N1n3uWYGW8Km5HH6P9nzKlWHh\ng4XNTfhJPNF1N+zEZ8O4VOQ1LUBLgK2LgZ7MLI29BLuqypkZJRPs3PhXE/p3\nEHUIDLvDF6uHUfrBXmKG957LWaT4uM/Tbj/+IH4RFNNduQqZWRGmiMErUw6Y\nEvX1dxg/kgu8/Gpq/uATxPPzTCW8e/4thHxggNsz9CdJ6BOxyU1UO3HWtRTn\nisiZhvtDKsMfXszPFS/zLntunTCCCbd4xGgaots1frE+7UOBTuXcql08Lyno\n7bt3\r\n=5iXK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDBr2pmJzOzncYX2hbqsPugbQSBqpiPc6oEPhtVrjndQIgEsOjURPS3WiPt2dSLsAOG2QvYNHlzDxW1hnb8uTH5HE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0_1611104221394_0.6905022353057786"},"_hasShrinkwrap":false},"6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.6.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0","gitHead":"862d9917bc05138864a851e705ba1273548a69ec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Cj/FTSz1v389a3gFeFoFQ4DMsNtJM3IGSjCkiNSaA9AcKdkvbETAtMs7J4ROiPXPRjX95pGPPzrAczeUUgZn+w==","shasum":"3180699ad392be7cda05ef10740f65d66d8ace42","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCA2QCRA9TVsSAnZWagAARR4P/RyL+gg1GunGTyR51DdW\nVJmIMp7M40vpmZBlMVmA72GEZ4lMh7DV6pRhPwwZQxejAhbUBg2/J5R2XOpI\nKbij1lPJd1rQSlanrMQv4kzLBNSxDhYAcXmJQJAceQdxnjMHGM0zGgMvQNbU\nctXZWzdWzSk7L+R6Yk4nMyFVY3VEmO2C7sGyg41y9Jn/d46Man7sRV2UUOMB\nkTAKciljAd3bzX5LytmM1/ZvCZywsuchKbmLtUwYoe5BdsQ+Ni6nd2wYSfuA\nkMBKyzKDhJRqKnVA/01YqCfa9T+9taItVKlRpxDuzh+R5Ftaq+QBAU8vYTp+\nT/c96y8EYJJRyHG+SwwFEcqDi1LzR60d8kRGMXedQ43S5h04GuPOD6WGIzHE\nfpizYz/wBEE+8ivqjLX2D9P6003fVGT8Ah7+Sc9dvfv4ZPARlMZq1QVJbQ+X\nupHWQvfyaM5AkCI0IKDSUNgXNwcIqC4rCPQdBwQPG3Kl7BrnJCYUnEnnA4DK\n2I66EIT8WqbiJF3++0NQQPPlyl1T8k5f0hz0THOu6ew5bXER1X6wJd26EUAY\nbqSt+ew+gpfXlFskV50Umn7CFTiNdxIS9pIK3e3tlL87OVYS2OmYYGRXoaFY\nt32QacKKtS43PFWHsdKwudglTudr4X7Di3zbbWLIOoNWMOa3ILrLzPJDj9mZ\nw8JX\r\n=RC84\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZrMM06j/TPBNiHZ2E9JXSbF4zYqZM1qq+f4Iqw7fN8QIgM5XLZ5967m3ADwZ3v8e/WHcvxfCFTwfRt+nvx4qwC2w="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0_1611140495884_0.7816922728888851"},"_hasShrinkwrap":false},"6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.6.3","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0","gitHead":"10656ecca7b545ce29feb66bd9f704ea012cec48","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-BYDJmY7+pq9Pa9dO5Vs56KJzpv8EvCFgwcKC86bBxnclFZTRFaD+ITXepcw1BURC/Cu47Dz4w7bSYnHIf9z6KQ==","shasum":"75999ac4967811e3f1ef43b63cbe20fb5b76bb02","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCA6cCRA9TVsSAnZWagAAKo4P/jYnP1aQHRIXKN8qrdNu\nmZED2OJRaOWViWFraOAMSJJiND0oqLcsBmgLCU+/Ph3duLbsLJMl6UbAThY9\nvioylLsDsLtITjRtGBXS5sgnvU1JaqS+OqIQPunebsmwab9BjrAmiM0TIgug\nKNAiBrPj/UkMstxOuAAvUM8yX8GKuSQ14QEuB2T82ac9xR+T1bjBcfir0Q5b\nTV6WfurklMyFA4eymbvI7efVtIfUCJwiBAwkOlUX9RFOvtq6fFyuy8OYlKyS\nVruo8PylWTKGVNOTq4uqMYxYHyzNYDVaiQuBo2x3RdlI31GYT6G6vfZfnkpU\n7vMvdJdjuxYxD7CH6t2qF0thRXu149kT3Gg0bDKkreeyknWMoaXY3KcI96oP\nSQVrNh9F91lh2lOaYIIPj+bdlD0FTKgj1o5hDIpaZxA5w4HPc8JXONT6cruS\nmRK7/iV+qSZs+wPN7fO+d8ydebh+BpcU2045/yKbn0KfO9WDUxOnCyI5mBjW\n5jjohPM3a8i9XXcQhd0YJBvWfW8vbD0GopmPeQlN2o5uUvaFadatlj6z1jRn\non0YMkq73Ou9fxUttI+qZEYHSoU6OK/MZEviqN9c53vNcrD5nOPUvZTCBdo9\n+XNrgVeEYfEu5rWzcmRrgL4xauP0GeGPdHTPIXJ6BXTr5VH9NBWVv70ddclO\nYt6q\r\n=CsbG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxc3AH/GfImEHLS14O9qS9ZXynBVr8DXzUVVZRCa5r5AiB1dz66Sko++qv1fcXAN0qDadXMobnAbAyAliz+iVqHIg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0_1611140764086_0.39083353202887317"},"_hasShrinkwrap":false},"6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.6.4","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0","gitHead":"76205f750fc7d90ad8677120467655c577eb412c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-oQYn1iDJ15x4EypyEmrK1d93p1m4xYkpIxIH/1q6GOmhO5fomJmxOQ2vPEGZ3ICSYFCylLIFFgpZsY28NiPWIg==","shasum":"06a64a1110385c435201f20615d883be6570bbbc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCCBrCRA9TVsSAnZWagAAKF0P/0H1AnLYbXq1zf3t+bPs\navw5h499ZYuOV/2iZ9BnyGxOIeXv8NxUqGf0s9cTk7U2F3HRw4RPahy5qWTa\npv7qQU8kyyxoT++AXvAHUbYlISj0hf3cldo9CntE7Atx27dY/cavHWtQjRrX\nJyK+jZR1tgQe/cPlyHU4KP4XahHJ2vtTmDhd5ZYS8SBo9HURKgR3nV+iV3Kw\nGWa/OS/BP2+Qas4PBFFGtqcGBuJaf+6vDGBwz6pAL/SSwgqXd8AMFPL+9AB3\n24EvRBN3HewNTZeiwOkuQHOazLTJ41xb7vn0sDxJwihT9EhLXnIGZ5ym0LXs\nK1LMbjRK857SdMoZey7GTl5hkuxWPwf2gilDIyOdq+CI+5lhigP2DGqzxYVG\nNFViOdBd7wQrRij+zvZ35vTclT/wELKKX2g0L85QwOd+tROYx+9Zrd+/FTDV\nMJLlry7D2mCWeCpwWuF93DUF49O+veR4gWaRjQVsp7Tz3yBxhbARFl+CsSAc\nAO0DVyxzNfRaCy+i2D7a4FnG3l1re92AhNkHrL1He1QGQ2I3OWQLXdNjy2WB\nLXEbgK43pOFNyl+Q3qXKdCc3HEjAj8mlLbw3O5s5v/g6Z/8PuRrN9uYmUiWN\nEkOIDMrPCKcJVhASgR65OQw/2LvWSS94aTOnZuspvsM02wKdLOYk6jAmxPJP\nK4fB\r\n=LXTA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhL4pPRcrSNebee8LhDBK4sA8zXdZOJ5lqd9TENP2/QAiEA0EIWF6REYQHpF5qPJH5eZE/K6AyYeTX05dSUptr3trk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0_1611145322767_0.24686249109266245"},"_hasShrinkwrap":false},"6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.6","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0","gitHead":"190e14da78a48d76741b28a8e7e8cdc19f878850","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PxmQ79qiKKqmv5ulkklKuVg9LnbEy9VtWdFmvrfHaxZV710b+YJumKaFAz9RyQ9f+jdp2GM8U4RNFLkU1RQN3Q==","shasum":"2b52e9f52343f3d329ebb31a516ef433a28a56b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCI5KCRA9TVsSAnZWagAAFHYP+wQRDVo0G6LI8XFOWJtq\nJQ2r9Iw3unY09o+7iz61aiy0QheTuGTPFnOiELrI9fszQhexpjbzlcY5Ins5\nqDn2uxE+mW3Vg+TySDokeCF4MMMzIZVNgyX8cm6ZTnO65Aw2r1HgQ0WjaruJ\nbX6oy7FQKoj4E6NQxSGrTrw+t3JzDnPFuQmLIXNd+Pr9vzSrTikKxOId+I5z\n/+hsb2tTi/01HpA2i+j/jkbWEGoNFdQSbIoYMPfixvsjlHCk1uHlM2aohycC\n/2EqglVuhDlpjeeSfuR2dMVHLbruQ7wFV6NtEYkeVU7f0oaV5cTkFGPf0M5g\nx1TYIXxbUFniSgGQaI+BAsivuRxa7fzy/s1C6sII8GDTIxZY5wV/Sw5wYKWy\nLA7zwfe9gFPs1hM0tVefdmza3ZuB0oMpCiKUsCqQY1uCBcXIGhaRmljnva4W\nOtcFoQE7b6+LA/t0gvgtflLDYrybtKzVdoOPCkJA5Fb6Q6bvELQGbiUEl5aJ\nzBICcIKTetEzovE7md2eU/X0rmXKLszOy0TrtwLslosFPPXHpA8gJoISfWpM\nHSacm+KxD3J9c13hE1qdMmAEpPpyMt7EszAbvyXcShyf0gBzHvoM1IG0PISr\n8jgbvdY0BK3OmF4N+N17vM0IzO7Rvdlaf4rQT61f0xg0LihoKTgnjLZFoVSm\n4Xw5\r\n=oZXa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4e7ek+2oVwDHCig1bL2t7Z6sYirXsERv5UUUif5X6PQIgIHSrrrYRU7dqeGYAPK+flAkvs3HXMDZH9GWmmNIeyhM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0_1611173449637_0.38367284892788533"},"_hasShrinkwrap":false},"6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.6.5","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0","gitHead":"e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZpkMN6+Fqf1rpEGVcBZZuj7A3gLtWUU0l2SquM3MDl69nUq/raKKSH0YxgKGnl+hkbOalYlBdd5XVYJ3M/mM9Q==","shasum":"d083d27c729455d393683f984f6adb9b901eb8a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCREtCRA9TVsSAnZWagAAd2wP/03D9FGKQz2BGJJjKaHw\nUpA1tqCKUe4MLa11A4OjB3OByDvFsRH0q1dWmmA/Izxu99+Rm9Zv6Ezqya+1\nT9/5wyxp3o8pqYS7UlgJOJvenVRDgnDCqM1/BfyCr/4up+k9uWK09aSKu5AW\n/gcATwSZmo9qrrKfMYz6LTNL+1smU+RiByZLrVGshXpRXQitklrcmyrfVcKw\nsCtLP9veHq+ky1Z1uOPhhHlxUm+dKcC2QmTm0kYsqniO/LKQlxv/IaPIPwkq\nRRMsHqS6Aj+iPuqcqQJQb4e/3wUi61wt3jLbvjRo/jhluZtXtrNeT9T12OTP\nx4RbbLY3LY/JePVO7mYNf8Dblw23m6y5OcXLiHsEEfOzE1EHv1AH5epFDQpg\n6CtpD+u2sACSmTlab8/LAYBffOfjOV0AOQy9un4hT4afgVNegEu2o/tBc+Bw\nwlAip9VvCiJnTAODSqcntP/ChOQBK7RP7X+rk5nvPq17D1p3HBmsYp71WhPm\ncVqhisaKSapBR+JL+IgLbCOa6l15e0gmyh9EkbiHGl3EnAyvi1ORf7DdopMK\nVpV0LbEg9jjwLf0uczoKiw6XHLD3smmZwDaGaBF7zV5PYk02EYs6rrA6Pigb\nVdGv6mx53iVtocacNO7c8yYOsDkzAeKwT0wEuIrrOC5FLdMC0Qxl3hIkPYq8\np79L\r\n=Brwa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7yV4+lUQIXWJTBSTEp1KNQwaP0ypcmaAqDwYLfFo92wIgIDvYcE/idnnskkgppOanwradPb912S2wq5g9oC/+0nQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0_1611206957158_0.2955774078140492"},"_hasShrinkwrap":false},"6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0","gitHead":"4c017c2189069556cebd1bbb5d03c7cae5b93a43","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-44g/ojVxVNfwa6qy88tscdISceCYElLchq5OVZwyOyLmaMt0oJdcihTskYQXXJWhxZuIzmn3RY7rF+2/ahlwFA==","shasum":"5539445f5b0cb4adbdfe28ed447eef8067ed9c1e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0.tgz","fileCount":39,"unpackedSize":246129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCXYMCRA9TVsSAnZWagAAewAP/R2DQk2pL9yUGTgOWzzU\nP6K9915AM9Hi2Zg3J9HUPk3THCyMP4/Wf9QZ0nOFBtYhC+TBTURy4v85WPau\nBqqTJL3kux6ZIbfoYc+VEeMYuExSGSNXg9UR5M3bMxZdhtcTUtWCWy+dYy66\nIWiXvnaHEF1FbKLzEXVTxtcWx8abi35znZM+i3CODozqQ/liR4seVQ31XdaU\nM7lKdKgd2UNvln+3omSOByNfNfgZn4tCIzd/I2OAnSy4MvjwfIAXnR35wrPS\ndg/Pb7SWhGIkt71oM7GVit0VmYXEvEXTDUhPUHA1c8ls/KRmWvhat++tbSBx\n7nv6A8bha1HqswRH3PI5N/cYq/tjKIEqMrE97sDFu5PeU+xTRSHk171VTbnb\neH0LQ0HxUgjCaIHl8CD5O970Y/Z31jSOsr2qNxabmSHn0p14NqmXmj1C+2B0\ndRMmR5AIPnXcfsYiGPfJ0vBNuiydY0svD0royKfQhno82RLl5KzzBlT//lAa\nZlgpM9t3uZ1cd/SGrpaEqZ/d+xpj3aaVwRXU2rRmqAZ5fd0gSm/QX0SMkqhB\nT2yBtdiB2J626+tzqFEtUk8OAPTtbxSPN3IkKyoz6n7Z+TaXtCOkVOPKoQEz\nonUUftEv/fqB7z5E2zNgOM4PBqWaRkAT7U3BaeCoqJkgAnAuzSFf5n1PdaDy\nftyy\r\n=ZLev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6KVrK+/6UsMpWkPYgP7Tgh5TwAQdiL+nDjDDCsLf19gIgC+uA1RJH5wv6ENS93V8M+9LUtLGPfzYk173tCfd9gPE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0_1611232779927_0.20644736489995164"},"_hasShrinkwrap":false},"6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.12.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0","gitHead":"352c4f9ccf05e3faa51688dc6100d46a3660a84d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zCSetBm37bEGJzMfcqcAeHThY0bCkycT/WHnPyE3tv9BJBBd0vJHj4UR5JJx42PfA8Ga90sVF8tTr8Lq7YbyXg==","shasum":"974c80293d29156f03c6f556aff0b59c72181d36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCyCZCRA9TVsSAnZWagAAtZEQAJBld7newhnR6MJVoTq5\nBB1ig9lHIFPIWHH0rTTbAFePu9kkrvTZLj+KRVtaHbA7h/d5bukVai2xYqT+\nrA7qx1uFJwrVLtSaMEPxRiyeC2QI4ZwJDRoZxmgHUqZpcIIwAaE3b6PP7tOB\n9fC/mxTZZFq+Rbbt+81+Ck+wMVGlrvmJrwprqtF3XXUB/72ahlLVRYPXTUVA\nlHarCc8T4tzKc4ijKm2ya99EHy9rDMXmu6PC2VO7fvsY503n6H+4aoL7TFjs\nX5AA5gWxjq0CeW7HoG8gmrjj6FHy/BR/+/1bobouZ0sCoDqRyVFOrO+SkrCx\nnnP6C9keqSsB2rmAnv77zok0RpNnuU3ZE1Q2VovyqeE3KvADCr8ErzQNwwy8\nnNUF1eN94NqW48AoE4YNOKt0djwP2LcJSuaWIlAp9+ZnTwWAoy8khOa752O9\nc+PsKMPqMB4m87RNyfynzj/rgPN7tvwukBm76AiiLfvnvd2PN7cl+LcDjMvt\nQS3jbYZyPcfprbG9rrI6E7j4Nrfm+B8+m6uJdjPkyYcfGr+s9JrJjVxhuALP\nT8sYvZgJN8AqnyPNhrSb3TnTGZsBYz6NgwVIJSua/dcFsQ61kuFJEhfk7upE\notALQU35vTzE8gaWp1KSG/5A3/Mor2qGgFJsHlUukB1vQ/9sZrgi8ZfRH/0k\nlwgX\r\n=9b3Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD8NWDj0f22LFtRH7q3kya+wFor2C9jerQdqNRzUYNYAIhANcb90aKznkee2/TYYWg8RCTBOJ43xVIsWIZ+3Rj25RI"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0_1611341976752_0.04666384899662046"},"_hasShrinkwrap":false},"6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.0","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0","gitHead":"e927f64c34e948c6ddf9923bc050058d6558be84","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Nf5stG5NdvTf6VxD+mAbbsv6N/QvgDBf8BhgLMA0yY7lOu6Gjh6PBoZk5o+EI+3wOmBNxuR4AHaDvvLAjkqhTw==","shasum":"5aea8bf52d2dfa8e0bfb1b743c1905a8fdd7c302","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC92rCRA9TVsSAnZWagAALUcP/0GhtN5GHRgydaLMJAHQ\nQqiZf1xp4METQ4AWtKW07F44xvCdI//h000AUVT7A68TESsZByCzp3Tm6cZd\n2MfSLnCvXTXZNTJAr2Pc/EIfRZd7tJfFJiAQBwOYF8TUUV1+DZKKDXFSb6NG\nTrAmGIRlbzB96j7F0+EPHWRBLxCBPrx9S7lGy95v5dvnh4jNQbleEUeDaauu\n9eqElmf2dyxYoVNPLSa+Ay8EvJSzP9vUwvZlHRI+2x83el3ITmvn4TQDNK/8\ny910/lZyJNB3RK4g/edalhHKws+F4MqwGkU/WO1L5bPnPfIZm+qx4nB0nu1D\n7MthYJc1Ba/TicFi2hHpO82jUzBaQd8PpAG37VdaHJpMZ3V8uzYRKhifDpqW\nDmuvmfqxMajuRFQUkJiQ4j8sb5wkb84ItIz5aGCduXMtiYPoIJKsQyFD536y\nrCISG7pGw2L80DaCBAoU4/9M42ShoCrQZE3n1YbFReoqwK6yHXmqqlBEy4zK\nzXCbeEyBWKCgx3UOv8uADMHgpkma3YCUuaKVZsmuYl6UTocwoi67/SAFJMOO\n2xVESNAZhqNPGTdQrarEdlqkAeCz6/5b7XR7orb2wBHwaqYEaF0KzQ0fzwzD\nFWybJ/z5u1x+YdrC0hDIoE1SUNPVaeB+s2SYUxzwKtcfn8g2ASyXE8G6KSKl\n+BrS\r\n=ie4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVI348IwNP4kaqkdE3roJZLD1zCiqFQhS5WrwyFkU9QAiBSGJZNwbbkPeTDQ60eVsOuoT32RxULEeiivznjK0M34g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0_1611390379067_0.9608773608293779"},"_hasShrinkwrap":false},"6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.1","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0","gitHead":"9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+lf+u67pe4cGsa4S/LAqdUjBODVG76GnbmJl5mzaqczv0MEoG7e+q5bvABwQk8O9a6jNBzXshBQ2DEkXWIezcQ==","shasum":"ae3d6608670e93e9ffd1cec0828f5f6567838689","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDDd8CRA9TVsSAnZWagAAe+QQAKD/1yKiezuybpAou121\naCEvfvVOiFswfY6xnGNU2tzqrom00VEXcI5TWKta/nX3vgUbkH296njzA+Db\nrQyia67LhgC/bG4eFaox6sOA+5z3eEGwl/AlUyliYWJbznUI/+2YlB4wIxyn\nz1CE3nxZnqKqWEf1GNKgwFw9HgnMyxHdVLoT9A34CbCc1v1ZlNfV98/JjQpk\nruQmY7nwiMSRUaXLAemSdWWe9Bmkqh2LMVaXAb9gIx9cLZbHvnzP0dAGFSqS\n+OUMZ6R3xK7a36VFtJoChh+RtqluI6lxJpvizlY9vGoQMq0vDX9DrKoY/1xG\nVekNz5nRxONtIHfp/ElcROONnI0XEZ+QEXmwknuHPFdgUS1+HBX91Tbl/Ydo\nyj3Std21Z0Wd9URWcH+ricBQCON+DVst6w89V430VpJp/TZUcQcnjZ+WNgCs\nTxdTfdPwRbsCbNnZ48PLs7JjvjVT1DwClf7zlRbT3cgM6HccDOAOtcm8rOhg\nnQjKE9i3PQVFLoO+0L8ANBxrnvzIcRosnHrJ5RDyN5KdG98bE79d/DJdyVXz\npSuqmMXDgf2NTftpVi46ZzfEphqanWWmhqWGyZsBCk6Am7OZgc68unguPzzk\nFueUhDoZhyuSN2tLlz0/nY70jZTNYC/FJZ0jeVgs/DYBzz08yjtLro7mbNmV\nqgJc\r\n=c3vt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWpSDnMpEsjMI4hKdq+8Wq1bPmmclU6252mecO39uESAiADZGUios9N4rsfD1aA7z5o6nNK2kN66NA06JEWRT08vg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0_1611413371131_0.7146648738549872"},"_hasShrinkwrap":false},"6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.6.6","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0","gitHead":"125c2208ba10458d80896dc96cfc7f04b477c8b3","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jswHIYfSm0OuIdI82pui0aBaIOLC8PGzx3fdbkD9wfq7KXaDn8TNrRLBV3yaDVUc94EaLCAFuAGjjGTU6iQO7A==","shasum":"de9fbc4b6120808f68926bdc89ac58d8816363a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD6ahCRA9TVsSAnZWagAAgEAQAJIPgj+QzyOsYFw9woua\nws1i0SwTOwAH0Wt9ml7TRgnPT3oeYDZEkEzFveCzRkosfsJLLb/b6r6z6DAz\nvFVgKke5yvepmlsJPOwrfJybSsa9p+wHUqyOge5mEDnGLTVGPHtcAjiW50dt\nuSGTwEe40QJ0L9B01eMSBD9ylVhk2TowNJS8AEan+sD39hmzMkJvlC5sBOIM\nja5QWPWy4n/ESLgwDYUbOhlJyQK4ORqi7urwy6CK4mkhu1FNICmo26OB6v+i\n7OVoMX5c18pRlCTQ7jb7yb8SxTmJd2aqNbiTbq1A4vG7X/A6FFqOEvqPWqdN\naT/MtSw891VJSx+dcW/Xr4BkqWjq1S1gJvIM5mLIXZDv3bqIzFxjBLQWdDKs\nr89mF/fLoLV0da3g9pPIBWq4Zu5P8O+XItldXe2PG7kStrhXwU++PD5UZJra\nsQAbk7/RjOpEawgKY8X/zVlIPcM6PPVta2Ms7Ab+nZkeFH02W1eNxldSUUQh\n72ltFCGZfl8foH2rMAPDblWxZegYmDbZWrlWQA7r54zOFUv1zuJZDLgbnGuZ\njGZ8XoBEu4G75F4JKWm2zDAf5B4LvFq/Tu2ykoui+0+iEaK+y7seb8A1jbE4\nDQwI1yA/b/P3IYHZmPL1skWdIfGbLnD3ZPniOaiShlQ8zV9ksGsmISkw3bOV\n7dBU\r\n=t/Wi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZPZ1xHJJlgXJMJMk5peeSXaCANHYweiW9kfSiAC2w2gIhAPcNsAeEyXOWrbOfRK8XVY5HCo1b6jSF8lGNAifKpBv8"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0_1611638432863_0.012434818453298302"},"_hasShrinkwrap":false},"6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.2","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0","gitHead":"b218b7aba80d274125e8f721d34249ac5b27fb4d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Dcl1NKM1xjn+dfDWAbbjjLixo+KZiPT4SRcNKQe9G082+CNHdJoO1RJAaLK91dTsE2GeJSHXwJfHp3AO2i8xFw==","shasum":"24bb3f5bdd0417b698a589d217c7f9edfdc580c9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD+K+CRA9TVsSAnZWagAAXOsP/2RTYewgtDpqYWtGPQ9q\nqcpRXbunxuVVQUJovJ1OuP4J0P04I09KZc2XasLWnkeI6o2ofsiX0zAjlqXp\nAND89uwoy6uWBLWVDcfeKtQ0rBFi6CTqJ8RY7FehMI2gnoV8StwEQ285jhB0\ndA68cf5hFXFHq63HS2oG0aqdflp+vsNkPGalyTZXtVAF+sFSsqFkNKc2NB4Y\n3jCh+EDZb/ZawMecOJsCHopbpr72N64e9bURVpcAVspvQN0jNZI5TXowOcEj\nry2XHs50xTtM2AkrhBfLm81YbGPpmxwg801fd3X/hNF8TvqMablvLjAGk8YL\ntUx+vyaUUVi63SPMEwb0XueQIRnMwPQICmxbdYGdWldnlTmEz/xoETqNud0O\nXn3YmC9gUXZ2IUdn1qIb2IkpXas9wyynTTtfBgmxffUqlRCP0owjjDfRALn0\nsudFNdFu5VuJ0HE2lmiGS7gQUepX0iorMAMzbsqmIBmIQ2HWrx1AAqcB3OVX\nNV7kzPPNUoI+FjpcDgg/D2R8G3FCcrmpVSp5HgsjHQHS9bC+L+V+ou2MwUW9\nPgSAS0iEbzKX4nyj0BKRJRpUGnt1p27CMkCN1Gu/xc+aUu7YUTXM/Nity6yS\nfJxVRDgNtQV7l6+0ssxi44+/WwVBnXo3NLtvuNWxSpkatsC+0x4AlyVn5Ivz\nf/Xs\r\n=kni2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHD87UBqnJfJRLOBVGB6YEv1Mz/8zD989TbXTu0e7mAMAiEAxX14S6DCQdNgpH5duzByoRCdtA+uAkewXOJ//5XGsO4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0_1611653815418_0.9175346596497702"},"_hasShrinkwrap":false},"6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.7","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0","gitHead":"ce946774ca78f12f5a49fdd681fa3b48e5551ebf","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1ka1ND02J5Ycy9IBxSlU6Ib/Kp8/8JwUEwEIlpJxJ2FX+MOYsLHVFhpGNdzrqjhgqBWD32VGskzDqqnigdRqmg==","shasum":"f45700fb7c9029d6be4e5edef5d5de8864f796b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEOj0CRA9TVsSAnZWagAAk6gP/1P/lBMZvm3IeUzxXhsg\n1q03z780g6V4ZQFWOTfIZcCunTQ3JkmU186Dxt7yJ/UrBw5qccxi2Mu5Mpr5\nsQo1NWn4OKf8wSK45Fi3YkcjNxZfUZzaTNQcEGnxQZGD5ntXrnvS1VopoiOR\nTjWlZGlpXjn4n49lND6pdyUDFxT99cu2rZUsgV3hEs6WJOS1ePF18xkZijnw\niFFyCYCuJRuykMB1dPt5DRnnWVA6uKiWIqALW15UvvvJ/CHZtyISVNqwIrwY\nO2VB656S6VrjZdZZRm6zADCjPww08p0YN0Sh0ZT23ztXW0mvsdY3Mj4NuRbk\njIMU81VPdAUJi8JVoo95C5o93+qLRKLTEPpifczpYToSdDbF1tX4Kad/MdFi\nYY8BBv0Wx7isBfFQIU06S2HfesFYyJ0Jc8a/OvJRYmT1qFkxj0wBSHcEW2Ko\n6wyPWfMObseNLiXAq7yUP8pe5H0s3KiAu30mQr1r/ba2vqKjfS9JPkXSjXDR\nwlmL37hzLHsW67A9mrJ6O50BsnsnMzjO0DUH1KG9Iux4tDLc8pPBR+ErCABE\nGuoyNAFG0pvdCaq6IOkRPXkJbbgJ/KIjm1sLkT3C1fA3PovHItmXGE7LEwaa\nPhwjk165E72D1IU2/gQkPdRJyUArbbGFbAWuGwsvqlCWqIo8I43AFPF0Pqmh\nj3D6\r\n=aQRM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSfuCgA9eKYYjlzINPBcjWEsu2pbhVGbWaiuOY1Po4twIgAeD4bRlq3H4NRFw9/Fv9Kx7jODGzx8JUF98rYtThGbY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0_1611720947832_0.07691784021534609"},"_hasShrinkwrap":false},"6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0","gitHead":"f1b99d61a73c0efc5d66f1f51da9c3ab2b939815","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-oamjC9Hdok6tsZXgHFDnQE10bNqvlI829p0e1J6Kgj5f6xjNr32oHZgI7Ny3jC7yPeF1jes+HmzUXrl4U7wrFw==","shasum":"8d3bfb5255ff41ab1240fe368b97ae70ca054195","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgETZiCRA9TVsSAnZWagAAIRAP/RTVaLJBGTdzrhnry1YV\nSplZdTFYl+lsbZiRC5PyjXVy/A3fKIgBdCw40X4UJ3liUMjNFjt4fIG28jyY\nOWd6scCuCqnzGO1D2tH9W/ixZGBrG+Tf7+oZUnn5Q16Zm3tabFlw8FqnNu/B\nrxjAoJgVLKtu3kBKgW9y/C0mc7KXy+3mG2KInnSIoR32Y0D5bsVazdorqPM6\n8vHlYmFukP0yJRb1DF/CxI7N6B12UHnUgbnncssmTNZSdNMD4P1Agrh0DxGn\nKEq8JmTPN9ube4AGujBOnfiTbTnoBYkAoI6zQ7/JIC/NDxO0d2n5pPdU+4S8\nJs+Hy3zEgGjRYQ3ZfMhQt400w3ymjNJOhitFvAjU0GZ/MdS1IURFdm7AepNg\n3XZFDeje8OJpEOW4Z5dAZTi1dnVm9gDjIK8O/OW/AbjhLVR5sroBxPvU+lz3\nlcpiq0hQQaZs6yLUJlfX3bQMlEP2272TKDPGZS5pLgUAgLmheNBT8P+0qZF8\nGk/bQXOKsvVOYyw205ZEvRrG8bo0Whn1+Ed8Eo/ehenEa0Vin0/R+IHvxfLJ\nNsyX2+GxeneBozQf1oOIW1uMYIKbreiFQOMsSI/rB+oEUecyMqmEc739a2wv\nOKRN3jLDD6U6z5bb8VKEJHevAne0iwjX2w2VqvyGrd/ypuR89KiUp43K26Sa\npP3U\r\n=sn/L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB6irSCmZ7xtpqDUiSrXum0VEKz7JBxWNSmAATMm3NbeAiEAu4+ZOIJjweh12rMIdn9eK1WePnwr3v+iJ8KR5SRaG0c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0_1611740769958_0.7509023483959898"},"_hasShrinkwrap":false},"6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0","gitHead":"0503eceb104784e4112d1406a88f24677b0d108f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5Je5kbPyHMRU3u9wdh19zyW8JZ9aDuraAkd0sL2WeGi6ZqG9LfCPjH4pVvb9GJac6qXBraznyiEGpO8TePvMew==","shasum":"26e62bcf18e3a71ff5299a073efd9661627d1bad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEWUbCRA9TVsSAnZWagAAOV4P/0beOLwEvVaz2THywANr\ndQ2jyBA+po+y7R/NmIipMHxMIYsxMdwS9eRXXyoomziNdLerTX6tc1vW70tK\nvlSfe9rhNOc0powkP0Tw1ZpdIZzduKq5wQ16YJ2RN51NEEVhToj3hrL+6Ky/\nIdLOa/87JGfP3hjKcAhFlR/MmQCumzMJaac7mDWzoTLmx9j9ouqxc9klS81A\ni4jjf8MdZtLBrSsXaIwKzri3Yf/tnXDE2jm5egTVMPD+a30NTK2YsnfZIUOa\n8YrYzeIuxrD0RUvQr6pbJvAc2VIOcsToNQiS3SEGNRS56vst4UaMzDTAv/+B\nrk0HYil/dZwt20TBohkmcS3wAqXQ4cNOsbCwgBeZJA6hOMft8H2vYwjIUMvi\nPJ6ggKpII13vFFZH5oQufW4j75deyVZ8WBKHWDNAlgUfJAESEXOmY0IZcAQV\nGyAYh5XwUbuNLp7MMR5ROsSL62NtLtHmh1sR+EoVKti1/EJVrpRhhOZQAqFv\ncNU/OxdKMkhuqC5m69/DxI2i4doB2t+KZ1Lfp+G1zZzVqPzaEXp+41gAU778\nJdDxmwutfDEKz9QD7KU30K56Y05VZ05paKRCqorrqSj8qIOZB28Xv9q1qJHm\nrBx+doYBaFABDkLO3/SoTTERugsdRVs/OmEka66tUOZarbrrmllMaM9AANgD\nBv+f\r\n=nuPz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW0vY+lcoSTV3atcykqs+u9jQ3KyHm5C3mMz2NXofyFgIgZzNjOk9HJl9MJH3+xNq+MIs1Z/+ncWPYHfFlMFNrw6E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0_1611752730347_0.238437957134231"},"_hasShrinkwrap":false},"6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0","gitHead":"8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-20EP8CLV3wAhczV3fYG5k37RRaL9Q8qYobvEHq7PsJrD0yGNZ4ZDedEifDBynWNc4JW6CI99rAzzC2YRHoq89A==","shasum":"abbd4edc9ccc6c7f23439719380a5cd0558b81c0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEgh2CRA9TVsSAnZWagAA0q4P/A0F+yV94kWL4BBeOBQw\nZ+GCVwYcIRFsiN4oXfHssIv9dHkx1Ni243pPEP57HVGpFBCRyALBDWa8vfnC\ndiBMQhTWZfNQG/02Mhu7sMhFE148YtlgkknFPG53YRwsQ4ZdIs1dJR/MmBDK\n+wxEmDOH2NftGHn5EIcv7sSuhYp+FCNtmvOcVTTTzFpRG5trnZhM0AoIX23t\nA9IdLtUlLAvAhx0J+efUGLLgdw7d8QuKhCvh0BomH4WELOEVrQ7Od1DJkkXw\nQdFiAqAjsLCFYOdRXXzzFTFu/VLJVERnITIFdQe/Z9sHaDHNuxfL5qbHuIuQ\nRYmJn2kRrA0YiiYv2PW7kYsqO3i0AykLXMSwx2LAsUwrfEsdj6aw6Wgq5NKn\n8VhUMisK6zuLtLF/iqYbVwKuiI66V2gD7TVhnpwOaeBTbVYF7rEyi1AxW1kX\nAIVSalNTz4p2fNPetZM+gEaY/KaSPeWNgR1ToeH/rLtNLSwKnk85pmEu5rGH\naEDbEFoWhQMhxHQjR89gT1ePOGw7mgvfINmb8imUvJJx5xgw7jLbV6rRJ104\nB4kxClRw8ueL4NjC1GyzCx7ryr2s431WUEsCkc72pYlICwCLiLI6lQEK1jV3\nm2a1naC4VabIAIysyeBJ8dmcrnHkDTZ0WFu/iwMPP9d8I76l0L49wnPotrly\nFJqp\r\n=0N2C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd28rYanFrvvPBOIelrNI7N9hCOVExl2M26xcjQiH3vQIhAJf+torVMAfCOntilqgYrwtj1y/zho9bcTyZNB17uP3B"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0_1611794549886_0.21187800022795766"},"_hasShrinkwrap":false},"6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0","gitHead":"6801f07a1d10e3cf633cf33d76401f08fde3fa85","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Qrg0iwOnnC/3kjBpeuiVYleheZDeo/2pIFBBYW3eM8g9y/H6c8AWBTmK9zSjL4vIPDPaneeihpiQ5Hcw8Yy7GA==","shasum":"0091d05fafb03f16f5c87e17f9e00125351df2c5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgExiyCRA9TVsSAnZWagAAUKwP/3ip81PmLN/2kvooYQhe\nG7HZ9S8/GL79SA2mouGq/tYmIvI6Hahj3O8lQDWYdla7S6boAPO5C5p1sWDf\nmmIc4Bep3/qCBKRu01m6nw1NbJq1rv1Euc0yyd4X3WAQa/rzRR8p6+h2XzVw\nTRAewuEidPEK/iqCdarefdZEkTc9SBgs8wwoElOAV0/8JjtK9GqN6aaDMIj5\n0nhTFJTFcHIsVdR3K3Tb1G5pYuOrWVGXveKTByCq9yAmIUihCKlBUq6o8Q7j\nTtdEdQW6OSRmysPe89tZeWq26ZogwU8NojQnQiRPQtATUgGd24JfV+VTaUaV\n70fCSEnb6HeCbyYujiogn/988Ui7BrDG0A0LPnmQ5wLs10It45YW1okL5XAL\nLFNsC5QwET7EUqN4tgfrrGnL5IBd/FgwOdgKIn/Ps8l95Ehw0V7XcI0iPzir\nLrbQU56wkEHYW4P3NIUpiu9jwXuYdMrzGsPCRoXVN7+uig9wGcXiVnw1yT0H\nvYtENSDOib2EH6d7j2470TSkC7tIKqmf+EM/+Fo1GBNEIJfntDfD9qlKfDZd\ndrUc9AUocLlFlaijCgljt57EuGJPGQqMU3UqX+SnZyXt7wyHXSlemBrgKpaU\nuME1iudYBmVzcibmf3dhwq3tfoqRYZzTQPMTni9vUisKO/fIh5H5LwY2nn9k\nHceU\r\n=MQWK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENgfmTJ4TDI15sMJlz/3zYh1a9T4XJkDv1ODQaQTEhYAiEAuf/jjX9thAwgrpmN11JUl8a8VF6xfZJOaKPNjURn2GA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0_1611864242265_0.624106088374011"},"_hasShrinkwrap":false},"6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0","gitHead":"ae9d9a4c2355dec458bb624365531e4af3ae587d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0dFFs5qiM4Ko+U45mQ8NWT4CLdpCLaebsHDrDY2yPMiEx9E3mydVRV4sN6ckO6awMU2ZzgS6cLqPTMPtDGFpsA==","shasum":"1625a02ef9d7d5a668009f901f9b7998dfea85f7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFBPdCRA9TVsSAnZWagAAkxMQAJA5g/c3NecVI75SM+Ov\nrlXeWkiWlEGpWilZONwXip3YbT4n0xIdIKv5voYK2QtzdbnLfpoXoaBkA9+3\n2zRuHeTlVZQY0HomkNZXQTWskYeF714yiJfo9v99be/IW/NA7iYNh6pqTOMd\ndMcSRODxlnr1UVs+SsiJ911TueBl3UOhpaFQ4/yX/b/AYLrPuTQDdFZUXdl5\n9TmPxVrGlhywaO16nDEtbzLZV9DGkfJRYalQ04w7k6ScdX51a3R3rI8mka+t\nDmGXiNqSSHTOiZRDmm2TD1tHUrwGwaxcnUHCjrOUcrELWNRVe2IVeatAAWR1\nA9W4SFi/ETGH7P9Gqh8rw3SBEyYuzzUdBZHP6Zxj4iGWwwvySY78nyZMFbya\nICIl/ZuQDyeQhBB3172U5QgXienT1PdneYaIhPioCLm7oeetBx7Nec32vLdt\nSIsCzs9GzvSfY7A/NmmVuGgOB8EU6gItLJ7kPS3JtwzybbxjRBwsSZEmZntu\nvp4jIEB2RbVThic0gmGLateKnftTiSQBrsKnBAExyFBVLflGNIkDeJlj4DvW\na3wW5+Ow/haD7C7L1l+eJZ6Llm/POahpfY+QxFJUG47d8kO9FTouswjKE8Hg\nFK5rmTVUgj/CKlHyypIDA55ERFv6PlLSuk2c2xjGp5nCsdzXNHz+GECuGKEc\nnocL\r\n=Ewk6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwkVxPMysElf0DERNDos7A2KTgtRWRWRom+PY9rLJ+5QIhAJDuf+3vGKrApPk3oqieNU8rrA8oH3B5GRby7m6pZOPM"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0_1611928540633_0.7786884866811987"},"_hasShrinkwrap":false},"6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0","gitHead":"f79138b31cd0800ce4b1658a683c93a01f008993","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-OL6IyJxDVFwACUSRlz+yM1nqEAMIKZ69W5dwMEllDxZHIU54wf7oUtbcwnFXkNqnaTVC34XLdS3AvmUvSHHEGA==","shasum":"210ae492e99ac8b6804b89411a89d5e9a520cb5c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFNPNCRA9TVsSAnZWagAAHN4P/jHehQIVEGyMBUYDc3Fw\nYNXcPc+Ntkp5AohIe0cG0SfGnmruvhxqeaYX4gvGuvnWaP6A9anw+slDiSuH\nJeb3Dqz4mlC52FO6Fmmq5PpxmWYbeT9YC52St060gMOXK2lZE15aSm0QvuNj\nvScQzNH1DelOJ8Y5mcytHB+05zMCOGeOaRiGlfZMTJ8BF/j8BSgtsh8v099g\nMLYPmiD66PfMZv+Qx0pZxLK91lR8Auro6U4yR25zIHyUB5lu4vqfb+tKOZC8\n7y1XF1FXvm81Xeqn4Hx7rtyccg7uRoSba6dOg0ws/3U3W4ZmDsSG8V/EH8FQ\nvswpy71hei48oP+xvbxtICPhBS65mm1aNrYoNvAp2smgXFeFVCDfkhQWK6Gv\nMYZo32PqAsQjfXZvvq5HB8GmsdTBk3/qoauyVkGHfwBWUTKRzfakh1rkKReO\nPQqe/7T1g0oJtvQiTcCspaeJFVaQzS7u9d5NyUv2rVmilctGTgtqUt0frAZN\n+4wCMvdSWHnRa0cf7cIrf3go+req351aZ0b5Pjr3lWXOH8nK4B2qbGE8OamO\nEbc/1uFlUeHc99kV9j5a6i/q8nUTx+2AcAPS/1qLdliZijfJtQeIrQk33VgO\nYlFHudcdAXjG7EPAVQNX5fEsxJUGHLYZ6y3GlRfh/hqwWZaYC3/6sscWN2mu\n/IyG\r\n=wuAq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0TFCSaEFU5kYus1DuebzHBZdkxbhkWBUv8ubWspHAdAiA0ACA7LRUQFo8i+deY7qSRea59Z5gIJDFcarMWb77bMQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0_1611977676970_0.7608170149185096"},"_hasShrinkwrap":false},"6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.2","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0","gitHead":"7e3801c1f25f0204378bc0845cb72e7ebebf681e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0yoUOL5pnaLQqC7WWLiDnXcLQbcE1wqNYlh0pirA9czujX/pAJn/C4e6BgYu6e/odeBZEWyoDwkOEn6qKlU32w==","shasum":"02d681abcac4c7a2346c3edd8f383e351ce74899","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFaTRCRA9TVsSAnZWagAAGckP+wY/75XRo7E23K9mJhum\nN6X7+Nj36aLR/vEHl+ZVUbJJAYwMjK23iv+RmDadwlKz7l4MpMhzCr5skrdM\nw0J69KPtl9Gd1KLmzVe4Sc5SYeUkdC9Ku7UvDbtSRCEdjk+1u6F0tJsp0Ea+\nMKaiXPGhN/M9cgIJfz/IrjeeGeO56L1JOUbyvxYdYK211co58hdGj7ERznvz\nVDH3dUoxNDaOmODe66CWnwALyY9wsbWWCr8Mw8HdpS5jQEYSrvJz22rRWKSp\nXYIuTk+FyE9HxtjebcNwH4yRfEYv7XLJeCtXew2PQCAkr/ioIWueZG3QMKo6\nTXqOfpLtfYMmHt6G47Y5G/X/LyOovPVibIrJ0+lBJigpYMGrnE3gUZV53hNu\nObaHjqLA0+x/+i6q8wM3r+4Hctt1CeukiLNW5VPRNUUWyn4tE2BYfTFvr/38\n/UAe12EFYgXv5rjTIJBcxzOow1vIXSrtWfUVw6qGmXmi7VWKUP5749KYymao\nWCdk9lvd0hzFlqOxYOQvO/4+OqP8TCt62DlBavGA/GrzZkA5DFykzXn+5utm\nli1vqhQuGo+aHtyPSykKp8EgIkGalDgpV9IlbA7wDqQskyfKWeDtiZmi9LI6\nPq4wYKCkRlwstt/szKiZDDVt3k0cxYoCXel6XJ9gRgU+kF3+GlvDTrU9mEFW\nDmuk\r\n=nQPc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEgeCFty2LRsI2r6Bzubl9r9udHYCSh3EvEeCaJXr+AAIhAL3J1AnFSk0OA8qauhaBnM2KaURF53lJAdf3/KQueKGz"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0_1612031184732_0.21052178750270767"},"_hasShrinkwrap":false},"6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.3","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0","gitHead":"2a8aa85e79d996f2f9496bc4819ebf2e2dd37675","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-HrmcR+A3qB4O9yYFwYYL4wY/MWuqPy9Ta+sdUn/nEkVuVglfy2QS4dqek6DfX7fZCR0T2xcr7HCDLaHOU2Mu8Q==","shasum":"ccd7a90d5f408dc751699ec233514d6911a20a2e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFaqqCRA9TVsSAnZWagAAbikQAIVQOiIiqId7j9jYMtqT\nXmSFxVXx8ujMiEUt140Dm4ZitxNfgQZF3W9xqIob6oKdZYs0IHhEWUL2XjN7\nQ5dxTYmkWJDdwrLpR2GSqxTGV4XIBC50hMRWUGOcKwm32SwlGq6IAxNZzhgT\nOpebU0YwNtV2auY1BSKJUYqcPn5XxOUYgk3A4Zoe+AU9SPcDEGwuYEoC0B0u\nSNTmlWA3/l8oe5pnQyTlesNUX8AhcSWBA1vfk0h6QDBFx0vRTErQik64LcR3\nSztywHDSX6P17uGVE2nnkZmajXhotgrATrSUpJNfiih74wDSYxgz9IJqwMDC\nLrn8g0TWPmXIvQhXPC0e6KendiV9bcc8Bpe9KbJOjDGyweeKLf4/Vh+1IzsU\nb49tq8p/piayPbg/0AQVSIF+c/zAeeV/kQInvMGsusac1XIGPMjMi0PFylGv\nrBvbXQd2psXoyrMuVlvQZOwQPMU2ZckKE3i2Q/dvXjMKi1mJOB9c8+SdT8Oc\nkEE/uHdsEt/7Q5OsjAQXhwsUUpJB/KOh1uEnIn8Ef/ex7ZwIlrrx536sp+Ny\n4xskimKnt4HMzx/cjiCuWV30s2pxPFZ2oQsUfnr4aOH9lT+5LhKvobiRF6Em\nBOpw3wp9DF6oterxBSkRDqYnD3FiDU0bTShwSjV+zsAXUgMs9OrDNgt0M9rV\nrurS\r\n=PmOW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUmLiThbOJdrJUlWW+PC189gdE4CFpz7TR3hT5SB/PTQIgKn9MwLKOMVWxya4epLyEDggmgPLlzu7TPq3YcxRZO3Y="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0_1612032682258_0.8845078204234296"},"_hasShrinkwrap":false},"6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.19.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0","gitHead":"6e6ac3d2f1459a5e6b6167de2846fbb81385d92e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-YrRPWP6MXlvzZVA81fKRABAZyDkxDwd9B0jFePv1dLOge9IieNahbwUW6EdJLyVwBebkO9Rf6LN8sXpsBdOM2g==","shasum":"28d8066ac81080bfe47296dfa7291ca0cb039beb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFjprCRA9TVsSAnZWagAAniIP/A+18ZHCzCvJQfR85rmZ\nL2G865SpNrV+hMe4dmHa7CojmchpFnGEBRH6/2vFMGnSqCwhQI3scL3VH/Hn\nVNRKyK1dSFi6yTTtjnwqqVlqUaVgjfImFoy41gHEqWbfLuyDi2XA2MmyUB69\nA7sVNPS2aYLpKaca8lz9fdqp/ExbsWLKxzq0Qima+trivxBaztuuRr2SJuYp\nTNH39XWXSGj0LqSSGpSxWme90Ytj6m6g1hqcnRRjPpnxz1UjkWIc2BkB/D2n\nM9WUt0C+09ufsfAuox8ucgCbE2A/vBtjET7xK4J/HPZdgeTRGrsuy65e7NGo\nLuKUCA8Go7oHZ2YNPPqnsDUyedbIlyiPRay/f+MryFawJS3ZKxqxmG14zMJr\n8KjHFZcZFdktDbFLXehQOfFnHFtt4an3VVIez04Gi/kD5cdC0enPSMSL2lFa\nI3QgygX8+covax79VRPv2C94U3txuwB6LSgcsZqSs36iKQchX1ofwsn0j59t\n2L/wdhgc6i+gtl9PRenVHkpIWfrZId/2dL1i3SSgH4mZPpcQUeqP0pLk4TQ1\nXL+XPkCKnQ9JDOIARB86fEuWst5Y/IvGxDqcZkpr83ApeZnHGre47Ff2fv+T\nvlaKF9e/A9alpGMYCFhGkRSw3YOeV5NCKbZ7LUAIouAf6Rtrn4reMFfBli0Z\n0ykZ\r\n=0WJ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcYL5VsjMz+32I5xQsz4TVJFcg62o3HCQlMeOrU1khqAIhAPoQs0gO0LpTfFzBNs1i4TfeAlnqZX+E9Gknt5BQvGWO"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0_1612069483109_0.29313105928828453"},"_hasShrinkwrap":false},"6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0","gitHead":"37697ef04fcd3de39d6361174d43080a27239ae4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-SFSwZmgQurZaZy/hDLeeB+gqKhUKAZbic0gEi2/azYDGPDt23OjrVnqC5+0RryFDP6G1AMSfvleo4wESS3tDjA==","shasum":"f0d9c6081cd13dd1ffce2b571150591061798082","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0.tgz","fileCount":39,"unpackedSize":262383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF9K5CRA9TVsSAnZWagAAuN0P/2fkEQbs/QQV4+PG+cS5\n10zy1KdswgDuwBKsUj+uS11P8eC9UuPlRc3koj77JBCB+/XcxFhpEnMGOg+1\nd1kC3tsqNMzr4whpLPDckQ23suW5Vq7zUWpc/GPqaYgmUOKN0pGMvrD3K48/\nToEK/YzC3ThPP9SxQdKsVnRgs9LbO0X7OlUfxBHsscMfNRjtYsE6Pg3jNSCL\n299wGmFbKr0evh3tdTgHz4MPQzIMqiwF6D8rG/5aIwKSb+GppKRvoFIrjX0Q\nvEEWHcVz656SPJKJ2M3SZXsAvG74yBVB9fNIxLbAmD11QnUO4HAcJ6zRB9JO\nnUCKWeNPqsAaDoFC33eco5dK1AiwDHk2WsU78uJMELTINNYwbY9za6mFM69U\ny9BIsiZjJMbY/F+jq+jTVt6u3lEOZAKZcrhE1ZZ8v7vAamol0oPJ8UNZm5nO\nN1MJ5sJcf0F/vOueH/hhuKxN5Y1+7T67Ni1DP0hNfKNTu7WMUzH9ArZtAdQu\nzKiW/o2XY+aqecHh72oJ9IN2eFMxld7YBPo4xVyOlP3dBEn+CRCwhhHvQJqq\nybv8dIhpZ08+j8STwT6rlqeBLAGHF6OWvBfotgnzQLZO+yyVSHVWqHh+who8\ndd6OwJp2xHKhNB/LPTTkBx2rqsIxfDUep1ghEcapXRF0fFQIEdHd5zPSAHSW\nzVVa\r\n=oN5v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBexj2N6P2YmHe5TBXMsa2WQr9VdNXn7bDQNhG7U4/r2AiEAh8V6GMIi1DdjpvFJMZFJsdsCRZW5e1w9T3wIrokyU/s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0_1612174008683_0.9787072686869567"},"_hasShrinkwrap":false},"6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0","gitHead":"109a444e8c06509087b29e93d76e588c11d50583","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Y3XanHr5hwrsSS6XinhQERPvH8YdavZJ+O8tVwU+g/2KYoiZzOAp2QT3q2ZuGdiXXBIAOBtYFpXj8SeCO3EB5Q==","shasum":"0ce458c77150129c4cf63a36d59773cdf40bab1d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0.tgz","fileCount":39,"unpackedSize":262059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF9OQCRA9TVsSAnZWagAA4FgP/R/w02xr58Zp+3tPwOM8\nJ/7LH/eJAUupcjWqTkZFS52hn7cVehC1WdUvitfnrIjAdLu4RdzBkhGoc0tt\nwelrDbKpUeu0ctqqz3sHBb49wrZMkN56TTR0uzg8hf5rYw80tjclI6LIOVHn\n4RMR3xnyGkjJ4R+eS5qNy0UL4JvKziS6kfNnBe2d5KPexX67YFclevZxBT4V\ni/8gMdAElFIhGvPJFskr7UP7i4AfhmGYw+RAZHUcwxeMim1ltC4JrXfZB0em\nOunawIelRY27ThxiKM36dQBDXuNfuZTHm2rfQzv9H6Ka6E2jGewG7AkTbm1n\nlDkuD680qWzfXewXINsPFBbOJZ374DQ4fEbYbAGR4CMJAN/Cq0Ydvb5qP2B3\nT9K+06usqSQcWshyASt5LFctDUIqMuIENdVVCjl3GLNA+BSbrtVuObogygCo\nSGbxeqwBoLBUTQeDrt9fXLmmgq6Rukiz+3xt6cE+iHicm86K+NF+QPEeAfJa\nrMLu6+uZ4n7kx+Svq44uUdZrtxI06Pg0nzGPUcTaWd2uUHxN70+OsbHi3dFl\nA3xO1BkyflWEiLVhBmK2QBFezGayzKLH3ZVPPsXCrolCAxsG7XikoKSmXE69\ncg6xrsQ09vWa+hteCTBYN2qPkckjgIZK37T5LopgyZEq5JuYT/5YQGC4bSdW\nNKKA\r\n=AUp5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqQ7UKiheTHwziptUYnl3UeYo7xW2HlC/s6f49OH3dKwIgGe33uDYOKlrh++HoY5y6/ehfKHj4ZnG03ovslpE1JYU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0_1612174223631_0.7632852475773779"},"_hasShrinkwrap":false},"6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0","gitHead":"e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-CKVbIjj8xRpw+5WDM9UDmOZZ4chXSZru4BUD4Z7jn/l9wpF2yqwMEpFWjGqwlM5iWrISxvclnaN9YFco4Sfo2g==","shasum":"56320d7c92d2028fb00d7390330be592267c5c88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0.tgz","fileCount":39,"unpackedSize":262059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF9QJCRA9TVsSAnZWagAAdd8QAIcDopzaS50ZMiwuFhxT\nMTG8Okt8xEKKX4OCg+ACvSg42KGWfhrA9ntJxPlifhSppncEM3S80vc60SHg\nFV9iY8Bwx/KtXETQn5AxwnHEmY1ytD5U9oPqrAoFrRjEZBZEpliRdgx1rdpT\nerlJKGe2nMn2i73w7WUA5W54tktxtkMzv9wT5zFVxFtt5JLXK+Aw6mVrAkfl\nf9NpLJOvjQCD8cCf/FjMOW07F6O4qwbOElXpiJ89FmlU5/jazLRBfObtA/mR\nML1LOz/GQYJMmzhCtLlwWHl6+wCl/EBV7VGXU0UwvA4wfgZMH6gnRmO7njq2\nMg2WGJxhsrhC//wclJkNsQpVbLAkLRK8rxfBqEg/mzqysPglGTatp3ZPAp/M\nZH3kEdw5JSi7Rb+JLjbaEjb3Zsby8qr7gKXBNdzXkNWYiELP6PNVetxNA35G\nwRg+8Baq885lwjHAjPwWRdcR8O1noTO4zwEnpwjnbBtY/JUGByKQ4rpNf7n4\npB4PVuiP9T/fIkrvWqdRThP/ino9PwTvnO1cWV1HRaSeq5dQxzR9c8dTZQqR\ngtiYrApy+NRH8wG26N1pCfy/dHQDKyFFu8wEYSuIaLchEzuYwMukEjWteJz+\nXuK3+mmnOjt0RlEoibwyXjGZdxWKhutwV52cQrdG0Ynb5CUx+Ml1iQWCuSY+\nU+/q\r\n=nz5N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm7gexc4kkx76WbKPbELcA7i93h5wJXvZ72HQs5TULYwIhANWrHtWTLbqI/a4y9TrvPDbeDJPzkvDrVs+JkH/FlCzO"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0_1612174345050_0.05370820785046271"},"_hasShrinkwrap":false},"6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0","gitHead":"b8826911cc63f5a934c4f577ecbc8199135caf55","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-NHkkm1wPY/hjU9SNAbOZUSiRExZ7gk0GZnBMQu0TViDD0YD0XAhl0rSaFQrZv6qwkpGHn0eIxk0Ow8foP+X2LA==","shasum":"50e225381b47362f72770f6b83d6898a14c255a6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0.tgz","fileCount":44,"unpackedSize":263332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF9wxCRA9TVsSAnZWagAAz8EP/R/psYn05I4LP4GmncEH\n/VC4abXC7XfcWur3vTh03owB2imWOU1l07u3mH3WummZo9YUfT9sbwgutnEs\nCeCq72t/PysiAQTSx4K5fbfA6YavmP5KE2OYmhwUnwP8/0gw4TNroTjEobpo\nJUM2x4+xNvD3HyUmWHEKE/9/WHL9II5vXhN+Zd31avFAm48irF1ASduuUd/Q\nACeb6RqJ6ushFLogP4bMRcE3H+Td9Tb4ttg9Wpm9ZfzcTH7IY80aJg9/hl1L\n4sxnzurfX2euh8BcjeChx057o/AmMkzhzKvauNn3W+f7bVJnhv5wOuIyiNBt\nhgpxHToZC3fim9TRG4STGBec4XJQKNoK7QEfG9H58cYCWNjBiFpekvROeVG+\nziKdyqdaVcVv7bINGpfHvREryRZxzQwyn5/7kYHs6FImDxisCzmPQ68YpIEL\n3808f/+z+vsFt8UqzJJ1lUC8fdVlfC8LeUUqEcIDJdc37QBuZ9AZ+0qAv95p\n04zqe7wTwqTgvZVNmQp+LOwIwtD2BAP4xdUO/a3ZNZLxZEXoL2SIian7eU05\nxa6hNWHf50Mj96U14dQl4LmEoST3HpcqY8flXo8Jh1UGBKds+Po/cADFahb1\nOLw3GKhyQ0iwS3cuXS4CdGcBZGSSFLMkXxWE91c510qZAJSiSRnmRALgMXTc\nZaId\r\n=LMHa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5UdfekfAPLs07/QXh2k21GAwMye2RtBAp4YkneIujZAIgYbPt3fJFINTtgHHihRhGOZTWa6TvzL+whIpEfDwiYCU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0_1612176433190_0.00041047835736685023"},"_hasShrinkwrap":false},"6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.12.1","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0","gitHead":"0fa2cc5db13749f089e9ac6b99cf86c220be9f8b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-R6KGitFWnx6C6VYt6uI0nD3EQAB+NCeIHA8xTSgE5Xu8aVCpJXl2LyMo84VtnJcZD1Uv2m/6mQOM+2BD6sKwqw==","shasum":"fa4e1dfa80d45aee7c8b0c05449de99f45aa76b0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0.tgz","fileCount":39,"unpackedSize":245589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGFYuCRA9TVsSAnZWagAAfwcP/1HzlQbIjdCfGusdq03h\nqBAFLjk91hBSUPpEfEGczXVY350qaaYSqnWnnZKEEvbfK4LN8ASqZiQJb+/A\ndLK0K3OPhCSFNQen2kzAdBl+IG4qU0RftUsBp+u8xKCAEwnBNhnBcUJCRB0H\namah0M06qCTFxG81Xwsq5bDiZHTyTuxk8aU+qDbqCIn5n0jv6lyX1hQh4IWw\ncbSsaDbYbqfix218VHx+NlBAL3EN6hXTeQSnC3BtS1nQNQWCfuMSQO7a1ytI\nLfXPRz2UogqhZiaFn7wE+Z7uIYcTNYPTGpIvXSXyBD4G83X8Oz4ZZVJfkLH7\nmAN9J6bQtA8SeiAyIZdqliK4Ul1ZtB7AOzaZdDagcXYLMe6Hr2Lc1cEfZtv/\n9fXWODw5aq6vbOQlgrxTpDbLYEWJZHszdLqVudK9QHn9FUfdaWqqfnWQC6fh\nnMMzX//h4n9ngjWXDNtCzRfs9oI3wyJHELz5JiBrbKGrmcD3osmU+haS4W9U\nffmZZULq8UIPCHBpMejhXf2p+vBS4rX1Q0iwu6p2+FHyS4f9aoromrYmB8Ec\nHZaWEVEsC+JQ4jpmsxmGOz3SidlCmlnBbBie70/JuSPxkRok28bfjr39Ar82\nUnvWT34Bp1pfe+9I3fuQguqVBaFxaIQDXHHNvDr1wpz1O/ThzQcXHztwmo0Q\nR/im\r\n=XdYs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNly+cVBRrx8Iu8k1/a0CG4aXWrRJAqFff1d/tuQ/EbQIhAOfNuBl3yqwfpIx0UzklLWHyFqxHHnnAbQIHDZ7nO6li"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0_1612207662152_0.7719930645635666"},"_hasShrinkwrap":false},"6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0","gitHead":"3a449b66a41bf0439437aff0a327d38fd026450d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-QZ6NUl/XQGMmAikWciIDPtpiH787iz4vPahHM2CqCroiuwtdCXfh76qfj/eQDUK3Kcaj0R2cOX0sBPHSiwO6QQ==","shasum":"bd79b45459959a10edd62e4e507a299180097c85","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0.tgz","fileCount":39,"unpackedSize":245588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGOBjCRA9TVsSAnZWagAAWYYP/AgagAdWxn3tZl07IGrc\nm1riMR9jdjRXcUI4xT9AWTXYv07xKv0P6ze3VuwgkNOrqL2WaJT8A7/MBjwe\nUSwmm48u0MMnZHPrSfCFPt+hwrh9CJe1Pi5S24EsmmBVn8BhtG5734XBOcFe\ndz8+xvnapmWxUJnoOs3YEcFRo7re5jcAeZ7KtkqJ8lsVhjZhH5GcO1P0kadC\n/bgIaskKDnjgdhAPIPET1CLx11U4+ICvA79XK/hKx0i6EJzQTNIFrgRzIwTJ\n+IGS/nS2phBEh9SAAyB4beBLCvSnfaEVpYFgy9LS/mXssiUu1jm6X3kpR9sY\nJhZmvKIqLTGP0wgWO0Glr6ZSfxag9E9EGg5ClSUn+UkXFCizTK37Yff1LE0d\n7p3/FtWnIHjBXF2aQ12dq355xHuSsM/e5no7pW9hdFKZ2oFD7Tq/azG8qf0I\noRoraD3orXdHq/r2m2sfj3nP1UWU/+gM58Dr9WCBNDk844M+gkTi1AP3aI8F\n+sTllTIstgidCOcTnVb/1LRjWP55X+BNyAVS9JFnBrgfaN7XqQd4zjsm2oMN\nGIeKdEbVVcvloXrc4tahjhFe8YBdGDlu6Typht5555cSKfwaX6X9h2wd51Nb\nUGe68ZWMe5uDgJuqpQ0STg4MGjbn+VOrC7YEjgPVOvMTD54K5l3EIEaoYa85\n2CSV\r\n=6PFZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhKbVjdGkjzi7c/c6qxyTnKVZUY/DVM17UCF/SnQ94aAiEApTfHLSz+QBgdbtiplMMweBDgJK/LMNpiqMxtJ8j7Pc8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0_1612243042542_0.24263882903408907"},"_hasShrinkwrap":false},"6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0","gitHead":"83c9ff404098fa44119c6fd4fa576b106680d040","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jZoMCEmabkEN1OtdW93rqXwv7pxpsnFu/kZiRLt/iHGo2G3qL7uzBipPDg7wWmbf7QTFDJUkJRF6oy4UG6IOsA==","shasum":"dd9c11fa46bf7f37e4590a509bd6eef59adcb039","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0.tgz","fileCount":44,"unpackedSize":263332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSSRCRA9TVsSAnZWagAA+V0P/1sfvJbwutl9aFF8Uk41\nOJwWwdoPocu3D6ILYUKTy0gxmTnNBQB9swhqMlRam0TSeodKxWIBeAoV2UHI\nhlEwXX2wKHM9/T6ZV1oNBuMvOoxwmR0GDY1SxS/Eju5cdlyCfyuqSqDn34IS\nSzfnA60v8d2P7oOf7fHDDxmutRjRiZCxxMohgUEqCmI1nwnCqwtWUaLYgWcH\n+F+2BlnSEsaiPIbbKeo6mqSQIw36X94XlznyvQhZQHOiU4hmEAX/Bo8rPs8E\nIWx5i8eIbMWZWMuu9dw8R5kcn+e4xhfCumqGqxgY3uhSOESzp4onVe9yo4C2\nW857B6JY/So4cpJtU4marOKjFeSfz/3m4EyYd00wJ5FnIrIxb48z7VrumZvb\nzsO7bgD4qjlz5kR5bGVim0wL40iri7WGuNMzh+0479MMKSH6et8omqoJSzHT\nF9i/maHyorzTdpFU9OulcD1x168aSTvehT1sMAzuVOuVdmGqnFf74KTXhwWV\nspbhlGzSkyvLFGr9grG3y3yiHBHFEKUwVChe9G1B0oHOMGJ5uVIdqCn9SWTC\nBVaxdR7oZOoquqZU7TleJCt1M71UEVbVL5fv3OIrMR8oNiS1BcGCUsieAyEJ\nzKoZ62SfR0W/TyypoMEpoPsNs5Sy+t+C+QhT+WL0HgJi9kLcAQRDYkTyFF7e\n6amd\r\n=BhfJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2MVCRGp/fFB+FIFWVfm/q6O+M8dKEOPVRkOWfROrsrwIhAKf6LOfT6qCiYaIAqtGkHpgo+JdBQBeB3eIxS7XZT9Ho"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0_1612260497223_0.3668383297090303"},"_hasShrinkwrap":false},"6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-z9s3hDqM7+xxwZaUXL95wLl3gNdmxtsq1GHWcu3HUO+FeB67rkpYpyy+daFeXshCm9JaQLCfpjtRUNl8N2N4KA==","shasum":"974ef307b89ef774f4664dbf5c027d7c1c3c5bcb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0.tgz","fileCount":44,"unpackedSize":263332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSeHCRA9TVsSAnZWagAATG8P/3BisSDh7gYUo6WuFQIe\nuYTDpF69MicbJ4ZCK5rTcVi3YHoIjQpDLqQsP/QD/O33yusMHLnyi3Z2xzih\nP9pPN4KtKs3qcxZbJicLprNh4Pd+92I5Oyngc6wvzr8VIyHNl9QjOhTuXT+s\ngrlDsMyk3pPRYuybf1T2tEfDtUUIF/3NhCHsoFaP1t+3o7P9WwTsQzNct0vO\npfeevEs9CTdRDoMqEhY00oPppLKwt0Z80Xa82zXQfdM5gZEg+kOumzfCzIJ7\n2RmBkYYM5rtZDVKtsoArU9kWbgcVOvU+O+Bge4NMvcSscT1ICHV2oQzrJvNK\nV527zL1g3fzIDW12csGAq1XqpbZgKAIJI1j7rmwJsJXBSMa3JQ05DDkCxCyt\nReoYXE3Qqfe3T2Lh52NJO8EqItaHR7nkFOfD/BaDbMLibd6fnSi/tFOGQxA8\nCEeVjS0SeEwzNKKAh7mHGpvQm8KpBgtqocliXn3YSabQ/ukCvstCdNXUEr4n\nNSjLSm6ze+2G3sn4wIEi215ZMp5sARqVrgJ/YTLttwbYh3AVJuyrYiQRFXiu\nEHkC245Gzs21/k3OKJdLvdq7TsZbhe7hu7eeyzOTZAMiM1uLSqarRBmUReCR\n1Mn5RmoaiBMUKEerYewJrmDWefVLcA9+DZ1tnIsUdH0ImFrPbNU0f5AOaJhv\nOPhv\r\n=uyuL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDr66NI3O+9opySTN5RWybKgJQ34vn+mzCdzXZRObX6rAiAuDlbLB4v4DuOzPKxY5WOl+t3tVs/xPV38pGs2TgvThA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0_1612261255036_0.9334495988386076"},"_hasShrinkwrap":false},"6.5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.0","gitHead":"b86809cb12e65b5f58f6cf75bfe4f29589fc2d08","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jUbepCboQJinY0324bOb5JK7o03xSNCgA6GV3wcp6Fh90dNbUg0z5RYPd2MkK656UAak+R4BlOwu5Im74intyQ==","shasum":"4fdec89124d4c34d2bd14d2e996b6122f64c4357","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.0.tgz","fileCount":44,"unpackedSize":263539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSe6CRA9TVsSAnZWagAA28QP/0P0IL7hBwGxDAwba2WC\ns4UeWEn2MIA8A/J8hZgxrMGl+lcKXzntGhOTbf0eIjEGOQlRCdZtaJca3Reo\n6cEUlV3P0/yQ+ZP29Lb1mRuy2H72b4cEPp+5jzygyqiWJy8kkAosza9bNq4x\npFrUNDSu6FnpCPw4dbch/9OcIzf6fwLyfkaKUbNiu+WeH89NQBEFG1+WDJUx\nJgSt01Fn+/YMbUTwMJbZ2nToQBa+VP7Af+9I9XxWJE5Ylikw8TBCorcG0cO/\nHqQ+NQBLA1lMQphT4ez3IU6dBAaAYjdHXCKexJpZjc0C8GZV76Gqc/6HlWfL\nBjRspOr3THxuFXx8LTVdBICbeDuz01FcpuH12Mjorae7SxgXz4joQoSUPOFu\nTAa/2G2hdxgI/0tdFm9DRWPt+p5Dis/3lLIj4sZIyM+r/l46fAHIjVYUtqUq\nWtOb21JzYC4f6jHCUe2U4M6bZxCp6GXxgqmXaABdhFXqd8l1967Fq6P+7CxW\nrhTPjFDnDaIW2VtD4NZci19ZI3OepIpj6vLUn8KUbycVUJFmnf2XZ05qr+mv\n/0EdDQ5MIRSjnDBL1RS9UlkDjuyprQ09V3Urk2HgPABM7UZS/98ED6te4x/w\nMnmK88CIm23JvBo14xYdNHEnyaVYhgMWFCgdKcPa1SVdhNTT6gldsseRIDHQ\nyszC\r\n=7YvH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu70B/RdlVfgDhvfKCJujCCqOHvgOmv6FHZO6gFR0uXgIgdYuZJpArT7GC7QV6VhcX0Etopt4wUhmXfcTYPK6mjIs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.0_1612261306089_0.07613925543514455"},"_hasShrinkwrap":false},"6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b86809cb12e65b5f58f6cf75bfe4f29589fc2d08","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/gGtGYKtSn6n6UE90hDJxUnNFxVzLIJ8646gqScKnDK8hKwYOz9g7fLRT8tZV/8OOOELHEcQcoaf+cIKa4rcBA==","shasum":"0a0e9dc502a7fed485d25be68d4f1a5c37f6b117","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0.tgz","fileCount":44,"unpackedSize":263582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSgOCRA9TVsSAnZWagAACA8P/RZ8eiaagwb3uWaV51uD\nwBPRMcUihsUzUowb1xNUql1xC8FbfbiTE9TiKoFjUGVtNRkSZmBrafhzK5oO\n5dByz0BNhAytTq43b//38oDvYK8NyNR54XUhrFkmRjb6IefTSqGYLcOp6MrY\nISEqkE8ESU2m4O1GWWmWLV5a0RhFJYjrQYzPe16wOsKkBdz41o+mxgvqvFpY\nIJiKGPCW7v+E/DmvIEtmJhQH6dHRzU0A7g3M9aBNB9waMvsXx4Pwi3RwblKa\n+T6Mnl/fYeKv+NOxxRPw2YBcTOJ+cy+E4COkw1Htm+SENYqhfYv8BV4bJnC4\nGNTRK9kYlChdnGCLIfQypIqQTHxzwXJxMwDTV35lTF3ftaFlGGqF2cWPAT4L\nICpDY5SgHOGCLGDHxr70i8NRiVirRlJxLg+4tWBvP33cOaztdwF2yqTbj4HH\n1lO/caIkZ/XJv+uu2A3ukjJCRRzUUpsh7C/lgzvGPh6I+pK7I0vQIwjVIxMe\n9bqpxb0dTCHvVNA+mi2MrMlYd5w+ppS5Qq3NyCh6Y3U/lWZAeBF61eszUbkD\nI1YzvrcJJ6arfFaGxL7saBKWKT+b8jL3Y/D26G6YRFCmF+bf4TUJiSzSGBjQ\nvV3PVNro6qLlS3ce4yO9uwT7eR9Yx4v19Bqg8NFOd3rpnMaNsJxiRLWDcIls\n+TIR\r\n=CmCa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzKifQXNXHzr8EQatSmGq7sePuDQPdBlM/+z/k5N3fWAiEA03NNX2hvEjMuwU31m92nwtWSNwjbwb1FD+kubwx27zc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0_1612261389716_0.7817205226805775"},"_hasShrinkwrap":false},"6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0","gitHead":"06bba2b0dae226257116568cab947ac47aa625a2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ZzCneQQS01yt2yiXFKEHMM+5IuAGuIoqnJyCd8khnCo3i7OpYTGExe3XdJ7W2XUiD9XVlqW4lN4i8rc6Pi6Dvg==","shasum":"e9f8425a9046d685333c0c7bfbbf7daf53694ce6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0.tgz","fileCount":44,"unpackedSize":263582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSgjCRA9TVsSAnZWagAAUSYP/1n1/GwH4ZA7NNiejOyX\nL+Pg1jbuwDiQVoI9jhtfp61JqXOBI4nevnXnrzTsmaRMkjVAL30r0y8uLiO9\nCyOk/KqBomQL8TtrwNhYo1J7vN8ycShMmgWZB7u6RaayTDdJXEsQF6Y1Wy0z\nfb/eetBR0FxPjkR2XTiCV+tv3Z622bRGu+nEGAkgOsQAY5XmGJMBv2qii9nj\n6IgLS5IzYyuxD4d+uo7TEDxgyAlLEFWQMR4GxkzetlUEERGX/U9jzeoC0S8G\nf7ZwiQzL3H8BtKPvHbarc4J5p31EdBtS2MIIPROH+Yk8HPRhAJ3LaSA/y3je\n7xYxOtL3vJP99BWS8Cm921JDrqhPwc1OzIHnxy7nQPVhsjRsVf1oao7YFqkK\n1gOZ/trPG2fqjeQ7Oblxeo4x7Idq6ExJmyX9gU+1aIX6msSHNjHYoH45VwxS\nD9Qu4IKXFHcGQHm9nJt4X8+oZ3jyO0Te1+Hp3RhSh2yEqCDgUOBAmrKkElwA\nNTYuDM5pqpQFH0N+5XV/AuKdcVx9BcYu+z5+xmeER0EbxxlDR7STtd/WeLlL\np/FdJHZhZkJYeDb76f+oeG2swAPFXd9rGPdlJs+COmocG8FocCoSW1vhSY7G\nb2NSaJaFUOsguzbxtrVQo5vId2iQ2fMWd3bnVkOtWnrQdBPeiIHCgr9+r37z\nylPL\r\n=1K5J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV1h/tEvJ0sESKQzNoO1KJ8Af5+O3mno26KG2i+rRSDwIgLMrUtSgXM6Jy7LRwt+sTE+4BoudBghEPwLOUcfVUe1o="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0_1612261410440_0.39395887776685723"},"_hasShrinkwrap":false},"6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0","gitHead":"0c89bf2e892716785e32898fe3091128f2751a16","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wFjPbMqaOvzyuiU0ei+Nc1HkDEjfRYVmFqWmqc7mGODmkKfM9hB8a1saCRvoXOA2svxFUFUkEJ8ylBVydz1UVQ==","shasum":"d6d09d5fb532bfb766fcf6c51f2b36a32964014b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0.tgz","fileCount":44,"unpackedSize":263582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSgzCRA9TVsSAnZWagAA+JAQAIu797TjjeITCO+6+DgL\n96IqpFLLTOiRpMri20tQNH+dZ83wHjDx95j8FmEq2kFitkkcST2pbu+yKAkH\n5x+884ar/8BHjKF5fyyq+X7kmoPYKLWi8kvWJhygs4dj9PE//FLmIupv/6G/\n5BiIxCcvfpTJtaKnGpm3ByktKgajrxXGhY/Yr4Mwnc8VWgi2K/9f8SYpn4sc\nr+yzGwX7iGYoWbaiN7Z544mJi5+8R7xibdNb0ZhMrSyyoTjhBFqyWBo9cx33\nI7ZXjxqSQTpLFrT51u/Fmw0b84AJTcFN5pjKx6W9DLZ/v2uOtDRZ05Z41JpQ\nW76pgyqbK72fe79spfSXCnxPH3H9Fi61A2jxaNZe5g4nwgbhczyFKIRq/PyY\nCkmI+bOHpBMJPJWwNsDaWruuZgotZOXRlhO6EVE9JGiE9tBQcLqbyFdx1Oen\nUCy6ishslngpkmG6jBd3PSxXrjon1NSbjR27MoHW8IE5XkurclX1Wlafg07P\nYvHSeK/hUxPdHbz6+YSRZERVNebIm4YCp50610fVFi62VVtDePHtASWLQ4Y8\n31KsJBwAmNT/SRDIF+x0wVfAU00eUki8fHBrMnbZmqk7bQde9Fk/WTEn3ihl\n8Ecg+ajF1ca/AXL5FY19heUTRQLajVQQUsN9D38wx8gHKkJUAQC1Ouw8e5Gk\nJIeS\r\n=htsL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgijjyV7ob1AgGYHSyQ8vCKzXvpOaIU2BEqvtIXJeVwQIgT0OOj8SBkFVBuC6kRNXWJmljo5ejv/A8a8HmWidKxoU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0_1612261427291_0.4527140697938423"},"_hasShrinkwrap":false},"6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0","gitHead":"b6d8010c887493d6fc3a0532b62bcfb32475d615","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-h6GggoN5bI9u33nQ6QS0Hieo5vnppVGjkM+8o0X7GM89HF6RHcFwFHIYQTjtolg+dxG0TSfDEC2VQo3+DACF0A==","shasum":"640d6dedb1747a7135f50d038f055c83d5908231","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0.tgz","fileCount":44,"unpackedSize":263581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGShMCRA9TVsSAnZWagAAzdEQAKMx5BiX/aGfBXA1Y6i/\nrYjj+dn12T8vkI2kMY/21I6y8lgkuc85rXAk/EgmLTBdX1rtnsWB78U5532u\n4ck4Jgz1j1OZFUlcAuyekpaUHEtAzfysT9R/F7X3pY4UAlJtxl7Wy9aPpi4W\nAOg0hdt5pOalbDMjNDf2tZ1JJNSszyxsWKlT/xVNUyhE43ohMWxKe/orAIpU\nZGbL5WXt2w69dYTNH4DXzEz5nqj0Oo6Ps64BUEVSrRH9/nQi4yVyGlFI0rOu\n39toZWw/ZwTP4X1+on6mNYc49kOVcCP3gGJI3zZ8ndXvp+yEV+Kmhl8VWoNK\nrQoOrNTv0U8frIp4vPLoeRibqFyh4eZcBtvJl8/bzchEe0OsIfLdv7L/3si6\nArad7+vmd4kGARsy4ZZktIpSAVEyf3MbolKlslwJzDpVqiXLia0vBqPpJSJq\nEeie9z5BH/L/cb7SFe1BqbHBThdpCsE9bG2XwEqXer+QZ7dEOxP7oPuS0rzC\n2msuNDlqbd679/oB/JiuNufZBW8r2b0D1Ba5Birv3SoGzaRRjml7dlYNn+30\nXuARKifKGzaDvwsN4r4TaS/IaSdsqyP5trLEqorSDh7h4PcdPrRw2xYhzOOA\nLGyRERjah6QMdboUUqoNwmpwcGiD3UkhtK+evfSn7E32lCbCtj8ayB7tenHJ\nFNCB\r\n=PmD3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAC8/F4axf6GqFc34Hu5hAzXRZtkTUX9P/8HhfhrAtzOAiEAty/LORWxcqXPe/6zRGPLd2+gTHzN9rsh1EFS8IEW9ps="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0_1612261452111_0.35359416740008376"},"_hasShrinkwrap":false},"6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0","gitHead":"c851d6a7d1b56fe52caad4b2c1910ca213b848c2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fLdieem5RSKnY2ypy+5h3E2SrDdothWh07tXGNWW9Chffwyud+gcfJzpla65vPxVMkOZH08ePIb7RNrjWp+CVA==","shasum":"3e83ead71e875de6ceceddbccb8d6d2ddbf4a80b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0.tgz","fileCount":48,"unpackedSize":285876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGShmCRA9TVsSAnZWagAAQccP/0DAclxlS82hKCsij25l\n9heJOLIGA2Hcu9hT/UNQIdUZQPpUQQx+jk03RJm1CTPml7P3HVnyBvlFFGP7\nVyDusa9JvJkoIeBiV2CUPYG+BDO/gEwdkRnF9rc0bc8wahoLJ9PSK+LEREGX\nPr7L7DdYKhX4q9YKSIhwnRqO4BIUH2eu9JM+nA8Ak5HQwO7PhwNvQES4eGsS\nW7it9AHGpH6F7VkVb3C4bdBBL+4fvyZRc3ldRRTId2P6+yY+Nm+TF5t8G0Th\nOHXFFgFMuGov3qLTvs+ni0MNshwy71qPhnQzVR8hOADffXlYcNMgR3aJc5G5\n5XQ16Yo4jN5o9kJq1dI01yLCL6oRH2q4zBl+jTGZOr+SSCL6cRa2HHlKUbz4\n0O/6EEDaP6W4//vfNhRE2XxtZb1fqPT4s30wk0bTdikoNYPlkhy7jVLaE47a\njbloYcHKeyID9Ij/W2/RvVOF4CPnJklrjUkw3fcZBb6pAiOl//wio/uX01RO\nw3dysqHv2JNkynOpOcqySxqwtZ2KSAx1KY/x5IWZqGz04/1Ba4+TP5HCjCEB\nLAGt8hDEBne8Zc4zKThJhwjHDf5nrlWiZlzJ3XiaoZCwTAD22IuHOsncZ2IM\n/2nZSGyjgaYiL1j54kcwGUWM7vvow0B86tmeIussVozierGFkFg3mkXnKvEx\nkIZP\r\n=ENLg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZMqlCPMwpuReTVwOujri7bhfM1xk4Jto6Lj+DPvOWHQIhAIhBmSzHNdt2wgmQpixmgB4fzqXk+TY8Mvpc8EsWycr2"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0_1612261477906_0.7640077148879207"},"_hasShrinkwrap":false},"6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.1.3","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.6","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.5","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"0a4ced4a06be1b8606d5d2880ff39893fb26f8b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wziecRzxztM28FZmxZwYKtju6kdAFDrOVfpicVjuNLhQolDh5iEHCvZVZlCi39bIG9UCaL8/82g3+q7RtRw+Jw==","shasum":"1371e8f302e623d0ff3c591f96a0320dc8c7db8f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0.tgz","fileCount":44,"unpackedSize":263582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSiLCRA9TVsSAnZWagAAQxQP/1XSqJ4ZGS2AmjG8yU4Z\nDNmmMY2/9ECFcGc/v8wMX4kHD0M8mJWGWZVVuMdo5fDP3VfoNc4xXRBarqcX\nT+t92VxdCX9sZiicgpq0D/V2WO46p9j/WDA/3DA45qyXO53ODlhv9jqsH3NK\nKEKrYdelMUW9LQ4K4QB+PgbRaFr7c0wMZ55CNhMkvSZPYUPxkQaNtLVoN+fa\n1UzaNx42qSlvRrCpTCniKvm5mCLTFVvjiyccviT88UlbR5xjJKmUlWIgR0ED\nkQRWv9K9DClTRajnWW6ZLQ70/n+TkAZi98i8pvodZZBajQWtuzzkHH3NdfYU\n/dhob2XLD8LTnK90RmGH73jq7L+L44371SSU67J8FHUXqR/1QT2UJPC0cTWd\nG+P6S3UpEHaBwv0UY9Z6gCYkbIYh7aMe1PxVvQ6eP/u8+Lo8X4Uounmxe6Vf\nwdvjs3F3gip2vc8BlemiyxvyYuSBH/uepLurLIoL3Qneo3inRM4lsl3RYoV2\nc7Ti3xPJ0jNkZwXm8ZHaYkuHpzPcWjVJgNG0HNYASzaq5k4C1AflKaP9wJb0\nat/rUb22EqMsImWuLgHWPrbWWRCA+q6uRchCFllq4uWH4xUzZrZh4TFr9EdM\nqAeGV77wmOSdsAGJJ+WiLerieMiqx8L/ItNAF2ZrCSRWLtt4z/PsA2XyOM7x\nF4CM\r\n=7iFB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMMY547J61jtkes5PmZFg+Jy6ktdt4zsPxLxURXHlMpAiEA59kSDejLqJWEOMUHULYVrsIO516ErrvR+tetllCBW0Q="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0_1612261514456_0.19432058309893896"},"_hasShrinkwrap":false},"6.5.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.1","gitHead":"43f6efe1ce85abebb8ccf05e6724e052cd556bf4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.1","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-QIl6hYWA+mv851G6nAorpr/IrWNinRmnVflPBtPrOcRzBApv3PreV3VDtm9PWGT/mITWxUkDZPwGfO+sybWkFQ==","shasum":"14f36efd92ccd2f865b3c280841539cfe9042ddc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.1.tgz","fileCount":44,"unpackedSize":264464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSi8CRA9TVsSAnZWagAAAU4P/1Q76d+NrYAVTszAt9h2\nap6iMm3TaUiuVBEJxM3jABMl5fdwQWNmlXgNfE6+jAW2tw5b3BDWeLIcEa6X\nHj4driq9ehPX7MaW0tyG796UQ0rZxYR5NNHYXZB1yjN8l+xuIU+TlUResELW\nKsO4bCxzKz053GqsDSOeGTzJwmojscpzbLgg1kWoCyaB93s9NdDzrvHblFpu\nCM3g8qzUUqbJ9DGXpicTJr7cbiMG0sfQa1m0B/KpfqBtNFe/IbHx4RGbnluO\nul/Y08pbN3epa/rVgrbOYN/4z7m/qkjhRXNTJWF5pUHn2hdrOTOKhwclhMXQ\nvars7be2tIJJeGlOlQsvo9Lq+paqTTJEW4yQGSgHzUUG+IXtjCjuQ/mVO8F3\nUxiNQukJRgx73U4nlPzhJWjjSrdBlr4qgw2rh6FGFK+nUM8ll6tpitipHoQo\nfsWeM2Sl8QkQlHj/W1Y97JkRyWegkL3yr2VCcEumRdy79ys9aEksQ5kFmAWT\n7gjfkVHI2IzbJDrPFJQNclTixy28ZJKGkFz0JdFScyc4HGwdbHD/NzsxEHf1\nMMi9TgFIOhvpimSLXyz9+wQtDImKbSPWk3A+6rAL14f84ZL3CVkUPoj3BwVM\nP87TntEKdPO62U5ARxeQKbsMzSqiIUCyt4BzkKzGsshzBOgvQ6lwcyqfqTB/\n1KyM\r\n=7bCA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXGCSEM0i1UtoHQsxh5RDCKqDI8Wp4OmrTETWp3Uy9HAiEApIAutNLUAERSNU3IIwiEeZAuvcJBrac6zevr6qtjUa0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.1_1612261563402_0.14821817254066172"},"_hasShrinkwrap":false},"6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0","gitHead":"2b571d5f28b1ff395e3ecca4fd649ae86f6043b6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-LS984kbHs9Fqi2O1nN30REsSH9ESxtyagf+p5beHT+IS+Visa3H6JBYt8+hv523cqToLb+ovsXlPnZznxRZOwg==","shasum":"4693e9e7847fc87d160cde0d429334344a5ff23c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0.tgz","fileCount":44,"unpackedSize":264506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSjXCRA9TVsSAnZWagAA5TwQAIKw6LvStz+5n65g1uZ/\nTG+gdaLawWnscqkPOtnzPdD23ORc/Wkzv9/X0mul0V7AQtv/uLrYBM9JtLg4\n/YG20KNu+7ek+hSJEwANj044j/FWqZdwPa7dqr+CSbQIeG6v+a1FGS3l/Ms7\nWJH4VpihCxG5I/ldM4YFGkVsMptr7TiugLx6pAEpMYxjcyl581CPzCRNTBnQ\ngyglpOU8tXmfMjox2tc0XxWH/7YaAIwRmCSOt7dggAen+PvrJu+wdeVwhJun\n7y04FrJwjm4EfL8R/slEfn52+NoINv2VWBlNVbCG3O0hJpaQZPhcnFtccLfn\nIuw/JKKnwX5/lRXaqXSBWd8le5Wz2GVgar4x6KIudqodq6d/SbR6BT4ebh/Q\nD94PZmegNdlqdE+WKfw+t3prVgrRpszdpYMP5+/frrgclXE/K0cKg5gkFwbv\nYds4VmuYu9RvvKpkze6LN3VtOqDXolW0P7DLd1KBxlhBkY66o/1UxmVSM6pA\nW80m8YqtJHHgBdpNeut3MyAnVWbwuxVUsGc2C2IUEB/eqPPwB0rcagZ1qqzQ\nmtuXFLR/+x93oqR/S2i1DK7SXsBDKvpd46a4bwHUg6h3u0jHyuCWC6ARce9R\n5ro65te2IEU61BpvrhwqO+Dwxy50WmWiGZcq5Dj2oLZxflgHyyc548r5g5Tk\n1Zjc\r\n=cQIK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBklZdQCVt05wpQxVrROHnDB5YNcUNUI6Okef0bX/JSoAiEAnHm19kJ37cV9Xa9zcIKtRR7y5Bth2UOGY8tioneZQsA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0_1612261590920_0.0888951496350383"},"_hasShrinkwrap":false},"6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0","gitHead":"e6d3324f3252edae344565f110f19f5e08e6ddb8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-rORDMgDerVncuZJEkz1NunkEaMauhGdyAsJ4Um7zC/xS59nExs1hY3842YMSEuzGHSvo4sZdeTmJVZ67O2Y+eQ==","shasum":"bb6f53446d70869869341ffdac5a80ac9bca8696","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0.tgz","fileCount":56,"unpackedSize":300320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSkdCRA9TVsSAnZWagAACi4P/3TLYQtM0t6Mn7aQ5qqj\ny1borkjHCK3ybyIMAwrvpQtQg+EnfL9xq0jRx4BFP4/vhKDG63h5gu7QQNKx\nQqwgRbQL56g6dh8LCNq/aBaBGDifdtDNph5XcyVcod08DPVm7UWkQR3bH6pv\n7NiqHAGqr/s0ppcbA7g2iCfl/2N/LHQ1bSbLpZ/Y/OIX4wTm3GpXfpNHvuo0\n1NlRGtUedVetCi+fEs5+7Y/Le0rsHhbaACbkuFJzTk8axA8I9ampeORAzEdY\na/qmMvOb9NXBHcyGOXDeAglTSKW/DmUd/0OyI7M+s7fOgocoV95V+9rMqEkL\nco/73H/dWuCkv245TxpLOB+oKeoyHAMpis8IiPVRanlMmfkoU8vs7PvJ1WbO\nCV+8Nf4UfL/jeCEkl2O0Zeo/JfCnqdjyEuAXwh/g5p0cYdycV/UWWMWyHbIm\nhZtAag3v1xWxkq2UJw/VCxkkufAF9yrwvtSsQ34fQwwHeekascwhT4CZINhR\nNBnPpYFnxTJwr44z1TvJMyp65XhqRfDWkH4+4J8FQaOGEDnMQ/lcoxXlQoCW\nxb2fLnMynS1udL9PxDBK3JgCWUn4QOr0/cEr3cfFaKFy4Uhj2LtekRvjmsxQ\ng0KBoO1gkSPAM90GvFFcFlJ2xRjgz8SFgEIlSWcW8UiY6Pb4uGjr26r6fna4\n1mhP\r\n=5QvB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH0DjwrtiEltYufMTJg5D3Mpsew2BoCYWAma4LKEqZIQIgbU2AdHbYayD9HJ5pvhSZ3iJrWgoohbl7p8OAZdAIutg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0_1612261660973_0.890752042714553"},"_hasShrinkwrap":false},"6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.18.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0","gitHead":"4743464d5cb0b1da0e47dba40729239c32d7286c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fFR6ra1HDEdrxcDXkDijRLmtNPb4uklu4P+j7rgZB1tlFpHFCoewhBBPTul4IO6EWqBoz6ZXFBFMldmMVxTEMQ==","shasum":"d78b502d3e91580a5c832983eca5cf702de0a18e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0.tgz","fileCount":44,"unpackedSize":264506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSl5CRA9TVsSAnZWagAANX0P+gM+Hsi7NBGBEze9W81S\n9ZTZ8VasNZvDFD6hVixnM457Lmdp4QxiTnrcbBM8EI7VgNm0fUUYyUqFbIV+\nX6yenaRIis+M+IkY7G0C0mA3tXlwr1iSD8IiQWT0Siru9QVaMMnXnqs6nSWX\nyb6djUVbz2i26dnEfnerlhjuQqT0paAbVnDjRrLqUWBtPD2BQb6KfMz3bA2y\n+pSTbiXc8eHmP56UbzTYeMXh1zQMDPr+oSIzTbAQFfHFnuyy9fb+dZjP034B\nrf0gv2nsHMO2PuGK6g5wR7s9OHRnDc6QQNrVbHzt1aaqoFJjq3kTEXXcNV4z\nQw0n9CxSfvRhQssExOv/ZLR4+RaTPujKtwIWMcJoaCH49Tn9dkT1pw5gE6gO\nzwhVskAX2EKSw9WfDAeiRdrHZUs73UQQCWkPXw5YInJQXFGIKjfHF+HUXyIN\nmv1sNhyP2yK77yycmLjdMgfEg34IyGOfXryErbylSYDSnBf6NBixjTsVcQel\n95/dPz0+12I4DZhHawNfOGalG4rD+cIPTr4FWwfITRSW2p/R5s0jsdTU0Nr+\n3oY/FJ/KAeAOqkGX8vE7JmBSXZrWaMNRaczjRJmL00OSjzMqrQ+BlZ0aMF8P\nh15y5fcUOWhXK/YsHOuUBkgVCdKdKSrmxtwtX558wmjGBKCgVRPOcLaKbsL7\n/Z2I\r\n=ojb2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfeo+gFFxHeNbA7s0duG3oWN5i1insDsKWPatyZYDs1AiEA8bhKa/b7xc564UcZ8a5TABomizC/9PhfwHDzJSzaAcs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0_1612261752828_0.10790004155548871"},"_hasShrinkwrap":false},"6.5.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.2","gitHead":"8edc76d721522376eb67f103327c73173e68276f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.2","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wLt3PXfCS6rAyktWmJEtOKsz/GKoXyF9bAoVZy1mDoXB/A1Ks+2R4ztXNrrz4wA+WMXJakibPglK+DJQIWdrSA==","shasum":"1901f18f3eba3d65116363f0041fbf35e2d6a318","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.2.tgz","fileCount":44,"unpackedSize":264738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSmXCRA9TVsSAnZWagAAGPIP/RGFBHPVGKzi2IzwXJLm\nuqPzca35JsDoTv6IY6btNGOgmNES+mzCQG6lrE+NJX0GH7LcozqZGPsV/sqx\n0U2HxQ7jzke0cjqsZIm0or2WraHDr4gsB3zhE6BAwBpCfEbHzoaungdK6aDc\nptNwNCrF6q4Gel365GLAT3kDjqSQ9cE7JpgkBG2jenVYsjdUZqwjveFLRIAR\nNi0rugvLaqEt/n/NS4yfbp79Fdiel+rUFtX5nKJwxLSXRnIh6GO5Hr7wqTrX\nXaPrL3tS0fSjNt0p0GcZ1QPAX+rxnlhrZksSDTcfpQb4yYxVqjyoGcRkpuWH\ncNgrzr2kWeJPOx35hzbuMzM/9spmcucVXzeg3b67f2YY0qxW6oPcQykvsDQ2\nrIoz3Ysp1+f2w33ldfwrT3ar0xTbqF7hgpoi8Ns/W0mMV9Q8dZhfw+uzdTRg\nfKBYrFQTILaIK1G7MwnpXiLNkfSMuSXieL+Mpqom2ueGU+/Y9EdHwA0TqgHa\nZGd5g3kq4sAZSH5wSUFfQri+jMKtCAy5ja/bOFkbKb7Grh3hgS6vWWOqqAwQ\n+ZLk1QnQlq/WcTiRcpwK96gTbEPjjjYZVQORzCFOVdrQ2Pt9Ela5Tl3HX+nm\nLiSo4NsCaxMzpkSsH6YHDSQnMFkdzjbT5OL3Gd/KqH2zVpLSe1arAWNIk+5g\nAPgL\r\n=7dFt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAfg5oIGqZwe2vf/lXTDipZteR1U2UvpxfesdWwKIlPwIhALV4ftvL9jlFXYE7bPerlEKd8LNEUbsHslJVgGG/8VkQ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.2_1612261782501_0.27753599762481573"},"_hasShrinkwrap":false},"6.5.3-8edc76d721522376eb67f103327c73173e68276f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-8edc76d721522376eb67f103327c73173e68276f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8edc76d721522376eb67f103327c73173e68276f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-8edc76d721522376eb67f103327c73173e68276f.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fAYZd2R+DA+4SozmXmG0kwMEaAnXGIem08npl/BlUm/KmATaxptobi1Ol4KNEHPTAhJQt/1uRevJXlKxeD01HA==","shasum":"827c111bfb69a50255042a641ae2c2e3ec6a6a49","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-8edc76d721522376eb67f103327c73173e68276f.0.tgz","fileCount":44,"unpackedSize":264781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSm1CRA9TVsSAnZWagAAqC8QAJNQhYP5essHjwIFyNqg\nv0csaN8K3b4Kj9al0Bv5jiXGBGLOBy/RVRJn2MBEHYpvBtu4sgi9gnhKwYpH\n18M211qUKc4Gpo+qlBckGhbhMS4wnrIPpGHSWsH5FnwtxwsW0rJ676fuIzMw\nO5i7aAAuJO+i5vipjG374tfUbk8gyWVv65gI+zr+I29q35NevM1ZGcuQGj4h\nlKrdLZOA2YHPW6/cmjO86EhN0K798iBxMWMUilqt51Ob9OsKDvoUllC+rsEl\nv+fa2oa95e6U59CtlWBunuhnUkW2ZdK9dS+f40bxZGJyf5s5jwmVmu1dAT5V\nw4/OmYkIztf0b2R6JMkIeo1xUIZ+VAZu+gchUJDZ8OOUsGwr3uJsPmsSB2+U\nPFIZcKx7Wz4u1JndpV1Mv/qgsouQItb5xnooyMWJ9iyHI6GPAv8NYfC9Hv6k\n6zj0O1LTBrjkhdW64bCRGNbvNaXSBAmUzTM68RvTVozYIXJzVUyduuzBa/sw\nh9W1IzNfms7MM6SG2NTq+Zh1hAgOMlqi7e1LUzBFYZIm3MoS2kBxGEx1AOlW\n7XiaKstcJTJDt9R20f5rHvCFD8bYGwzJ2F2+hSb/fq1oGrGgHTpbum3uZ1kw\nfbVUOf/9bx4p9VIOiRblWJ8asLmjAHvK24S0l0s/Ut6Pxh7nngqTYx4WhlhI\nPU2a\r\n=DLmQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBd0a+XJWvxe5rVM58mHfdKoC/PeW8Np4ykKNlJdJV69AiA/avZd7cP0EZaDTYXW6CGyHmeXrTX/MX61l5eX8y+E6A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-8edc76d721522376eb67f103327c73173e68276f.0_1612261813257_0.929270620895081"},"_hasShrinkwrap":false},"6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0","gitHead":"7ec7b23ac9347ed347416c9900a18aa69890590f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Os3+Cgs3E8X4D141TOa8vLUTFTjVYbRe9JnRCwGF1SVNEmw+EnOaUjGu6byCEyU9u6FP6uu3tvXqFIdYnvSVsQ==","shasum":"e75e14c3d085f14bf77333219ae292ff0adebf1d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0.tgz","fileCount":56,"unpackedSize":300594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSnDCRA9TVsSAnZWagAAFtwQAKJraI7qV81mJ6TNDLbx\nxuV9SSvuqCVaVyaO/8yIWtcbRRB6IZAR8nRQ5VI94NwYgFUjsKc34hM+6jCb\n4FaWnrCSpbPrXT9TYKwfuXBmEz4dOfydBhf6HWYKrh7q8UwGFjhL7GkMlpdW\nVXM/e1W8ROauJGC2XQzIcWdyLPSLOba808PwiWCobqH5o60hut4VP7zz/Iai\nGldAh+zXQfeIr0rtWAyCf/lsoRhfiN0V6ivV20NS+DU4h9HxwOC2qGHP466E\n2KILv6g3AmCPgTJPaoRPdI90okDeRV+inszJenuFxnoYDHVnx7C1W6dDJrbT\nrNXL8vw+7boY4EdhRoLwHiJvssgACIaq503Fb+yKYEcpzhOGVZrNX2bRv1Fx\nyOkb3mgrPl5RfcoiOCynjNker5cKE9CdB2qJSW1/QNjOi7aYLJeo3JYmFxcQ\nU7x5Ouu2WDzG/FXEhT+haNvXspoe+J4xJsgHP2oy4+2h70RXrPi/9IOl/tfq\nt/912opeohaCElmRsYnjZdnW4ioUeBChA0hKU5nvwG0Sw1s6+xNLgH3Cu5cI\nH+9XeeFOFLnFypUtTBnVv0A37eRooPk0V2olqs7q3ew7/f8LURALnvT0/+FO\nUZO+BSblY62cMikPWtvme1Gm/gNKhojvD41ObQnyGrMduKEX7am3WOXpeV7J\nupRF\r\n=EzQc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKbZXxajGZGK98ACAPUaleyL7nMZZwQxYUuhJzPSy3+wIgBp6NM6HnZbVQ70iLBzHW+pK2ahxP9RD/cHxZKTvKL9I="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0_1612261826281_0.4816640966522041"},"_hasShrinkwrap":false},"6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0","gitHead":"7f0a2ca27cade620d026238e9d59be401fbdb629","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-T+rThZNtTM6Y3ivQC0UUXXNzZzm60m7hEpEXIUAUjHlaqHXr8zUsfRT5mnD1JWpWZAgE7z79moPxn0EBGf7lhQ==","shasum":"a85923d9e7a33f7e80839cc03449ce3adb538615","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0.tgz","fileCount":44,"unpackedSize":264781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSoKCRA9TVsSAnZWagAAbEEP/RheKGx/WBAu+lFqx6KS\nw7BGcgVb3F+YotlYUu9ktxnneIvn/TgMUB3A+EciGan+VYUj/mjvQjCZXc3A\nVaFCluJzPfnirBuDGNDh+H4S+tVUXLzlyZn0n4YsnILuMDYxOQkF7WuZhP4L\nbBGh8E8bPTFAkjh1cBmagSMiQEEIYCHXCsKHdSBOGBUSPvRJ3I9E3Z3ZYOom\n0TgWtXhmypwTzrK7VN6D/dHNbBzgGwxIupHGXYiZ2L8RLACYyox8YSMDMIqt\n/Y3HaCeyc6W3cVLUWsoTUg5cvkjwIGYzt9e3CxzFtpIttq2u0k63GICR6yp0\noJH98nKUBQz+2kazXEQx2AqwopVr4Im2eFTkPSIvcokgyhl5/tAyQxkB/K7c\nVbjU25bNZqmutTFQne8fVbEV/AySEjYpJ7B43NDRX272d1hYXHOo/7EJNtjk\ntLaQ4YzeEzIJaRjElhbtu6fpzzxN3zzq7VwytZgNdGfatGFF0gq7k3dIsIbm\nLD0yBYlh9uoG5vIPicuOSl189aepJUvP8nY94+ZOtT4SZZLqNxl5E5/vxGoG\nJfW/YwAzzEEng94Hfx4Rm1M6aARJG8QKh3Q/GNogFVbDQGSVDjsh87JBPBcr\nFgeweTAcxLm6q3cTB+s6JcTHGn7I+29oZbS85psxL0vHvfk81YTFKLp+Ov4w\nvJ2S\r\n=jNDW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwGXehgUF0N1y+/FQoq2OPTjcGOeY3mSp/6enEuw0S9AiEAy/eyjSugroKlXBJt9hCxqjlzKYD5OJmRU4pa8dmkfG4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0_1612261897435_0.7022464365783838"},"_hasShrinkwrap":false},"6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.11.0","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0","gitHead":"e79fdc909468430603f2ab86f5dca331213997ba","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-bG4Fweq+yehwDqpvEgH5Tc9GgqsVmjWrVG+Dby1g4BIjmGORZ18Ox/AfzJSJdG46rzBmki+WGfO7n+JlfsjoJg==","shasum":"227b66f04c8e2342f8b30114a0cdbbc2d7dfc722","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0.tgz","fileCount":44,"unpackedSize":264780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSoaCRA9TVsSAnZWagAATW0QAJ/zCcUISwXH0juyUg1u\nSwpQJXlUtvl4ERe9q/JrQYioYDZgjBFU+nHNVxI6gf0JswGzSeSjB0Gf5mbq\nD0qU72x6u9I3z9aATqp20piSWDt46PkRwi2v7Z+zaB3OLmhXowJmifLe9Wls\nwlQVrFe7/i+5a55qhLRtDZPrYLJPECQXzocCNx79YEbyNOBdfCEvTdwosJXL\n9ar4uoOV7SYCtQPqmjNfTKPw9fAP4lhK7JEddH4Pj9UxU1dE/vnPdAqmtDP7\nodSzKpZN7HwLu9YNkx6TUstD/nB+WILfKkIEHm5+6LYc4OhfbzUIN/DNRfQV\n5wTlEiK20192koViSw+lflaKAfZF0S6J4SulkLwuiQcRZ+xr5zN2FcQpOjRV\nyqPwGC01qDeiduHmVyGCzFD96Cbdl4n14vFjrtGX/7Sr0oDbKFiLUjyDd3qg\n4326GXVaOphYwR9SpKQ7VmbhgITyFr0IQVJeNKO3KkzslegYjjJO+ypjxgv+\nW9Ew1NXJXTaWolckfrrRxs8OxxIgrM7XkdWmf5IOa8LyiDQgINjhrj7pvt5M\n8ciMqD/3sNFuk/nTwuxeBUBvPHA/dvm4SP3WJ+ZHYr4QCKPad7faxVNKIl7B\n/6FOUR8Qy+Z+Z+jDM2KPUGpN4/T0CUJiY/xvD4r6Ksn3i0OICXg5wVMctt3v\n0ICU\r\n=FK15\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMYnJdiBbFYEDE6M0NMvFtA+7sNklz+b4YTJ4ipGr7FAiAgA01RP+vB8gksb6VxYlK1rpVhwLpHlUkwDEYLcaf3tw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0_1612261914124_0.14071540185694875"},"_hasShrinkwrap":false},"6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d33c4ab6c59a0908a2417d6b6aa0421184edd622","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-TCfSERRm7+6FTKlZrk8ojyG5dneotRV+KbjNYBTMC/Zdvlh4cCJSSQV4i/0WtU8VZB00XrS6mxnbjiHuZ0+eXg==","shasum":"c2e156fa9012842c451e1e054da1a18dd44290dc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0.tgz","fileCount":44,"unpackedSize":264781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSpzCRA9TVsSAnZWagAAp/wP/1qeb3EsOgibYwO0tTv3\nCHTj6uCCTwZOhIBJ9mDaaxiKnuNrtiBBEyjW7GwuWFDAT/JQpd/4RMPMzkfd\nobcwPYJy7qL9Tw3J9MIohqNu3pIXwOuglqAtvlPFWN9wYA4fx74XBaKMXjXs\n/rxUoj+8WoLqr4cBoF2Wnbtg3mN8fyM6X4c7HXoWvAB/6MnG3mxJsS5jouVA\nTK+cSr7y4VtsHtxgqw+Y+MqCgea0Sdj164bRuH7vezgWAFqgXOGdHvB5g/O6\nVZbB+PfcCmzh360Ic3kyFxV1P6+MjMPf62cxwatJKayE4E8vRhQ8bkNidvtR\nPd1Ci1UF5XL6XZbsiPR2pJbKVAs8aKqGgFAG9jUD4ypOgR+Wi9C15U6/5fQz\nEspNt/qZZY+wBxs1NDTIRjQ34VGdzKzFu7c2MMqcYLCjCIrCZTrkvDhh6b0O\nKbFIQX5vvFY+PIQETVDQoY6DeKd+yAkIE2wLUYMvhTT/pT4MIEcgVf48bJV9\nBb/R8ZgM6xIfEznA/T1Jm6f4Ggl7D/Npx+uI2EquouVPkt2rt1lbrVgQ5qU8\nJ2hR7r9HfoL43aHh8s15ZgOqRo+KzIvOGSnBwakKD81h8D3VCfvFdT05NOk4\naEzA21XqrIwT1NvgMGYGby2ha4uLpmOCrqXVYEfq7MThyNLoSI38pgKhL8mT\n3kwT\r\n=m1B9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmhcjA0ByTtayA8LvXvref8yJPyf42sICoOewBkMRdcAiEAq7W/xD/B8y1cBQhG9rPTPf9C0oNJl1WE11kK7j5EbE8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0_1612262003306_0.5766434757463057"},"_hasShrinkwrap":false},"6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0","gitHead":"2a139675cb12c0c62730038c9dfa71d91ba9241b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-pC0s0LCQi1XiONTD9JzIHGHnKtPOCsubSmO6uRUO6z8oWLcYJpX85pQ0xkAvdchMhsFkrXY+suJGsLjjjn0hfg==","shasum":"99eceeaed7fc34a0530dc942abaee05f3bc35b99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0.tgz","fileCount":56,"unpackedSize":300482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSqFCRA9TVsSAnZWagAAXRoQAIOv/GfAOrL7qhfQ+jWY\nh4Fb6X/uprTAlb6B2wRkhf56OhZIZOOysTpkwuH7ClZEYAFCMKBV2dmwwn3Z\nXHEKsCB1hyjDDVyhIxSanSICi0yp3eI1cLBOgkEr6uLYeeGEmVlQKoYtltbW\n3RrBrGVCUlS3JeP3ZdIddgrNTJDTTRvPbx+j5bmXK25QkxvzToaR8mSby0u6\nm/wbpEv0ExsWew72mxYF+Huuzsqfkx6o6D58BTXqMbSicJe7bZgdXptgIc9b\n8Xgy9Bsqh4t1iCC6v10cNqGCIxCB77zj9LWhJcLhi7U8pRekuh5Vz7oyb+7d\nhqdh5+luq10XPs1ReT0Ohj5tWh8px+e5b/ap1XEWexcneHA92Cb3Vk3/Q4dk\np4GTK6M9hqnMDFPPnzcsvnl7WXQzX48LaE7NOQz121Xb1FVfICVT5dmtnwD1\nSfN46fNz2Ca4+1+2pf1TvqCWUQj7wpD2M+O+bdZ5wOH5FLAUGenl5lSWdxnR\nYtRzLTBtulbvEl1EQWbMJ93O0E3wXPFWXyzpirCkK9T93TTP2PXKDwMAnTzy\nYy+YHpaWlvqi3glmD5Df7khNcUHqQbcOGzZ5KZ7AZRTiZP2kmtWz2CMuOtrE\nh+H8tIGAnDe07Rnn2qHmVsqCzbPl9KdEiCRkzdTHp87hS4HAZ+WtXUV1p02w\nPdxL\r\n=cSoQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnAWNyJuCVpvWp+fHiZy5mOxpONF2XpejcMXkVUjff7QIgFE7a8fk1Y3wQKoOR3GaYIeh+uy5eOW+IhFgpl7cRxGc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0_1612262020787_0.33016019190591916"},"_hasShrinkwrap":false},"6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cf8ae5c578e72978252563b10f07e31057489b19","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-QTI37nz+GtgCeGN4Ya66x23reE2WQC/ErKcI8acap0lIyKGusUyglgGO7Ynrlf8X80UtkjzYkleDyWRhvPRjvw==","shasum":"c49e1ae94d60cb59a33a888fa730d152e90252c8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0.tgz","fileCount":44,"unpackedSize":265059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSqdCRA9TVsSAnZWagAArX0P/0XXU3QWUzpYVmnAqwcb\nZLE/3JUn7e1A+vXtv4jYus/+CFsC0TG7uC06EkADCkTrgQR4GJLZE9yI0uAP\nA/7+LJZbzsVe0DNwYTdfA4fOyOX83mfqGtMDdR+yY2VSABPQsXh+AxfivTic\nE2eVFh64YrVmPUPMJ7dRNlV/rTONxWsAo13Bv3kAuYCvSbHnPvJrdmPSlikY\nwJ/ttRKr3pVqLelycemY7OwBXyYjtrrt3AaDdawI5HO2PD22Gx20rm4qXDAi\nRTlY+gvbW6jW7XHdjFGXmeA+ZdKNzz+f2fmY2fiX64cU6V4GHKuVzllCGh8r\nW7mOEfPQEYM/J5ZIxZN0ha5vwcwkJXmp1TwWNXFc5RA1mXdkhaZMs0QSJmo7\ncDZJauyT08NFf3q2qYgeqdY2oNXqBkzU2OcLUzHKGriNhg0GZEfTASAHGde/\n1JpbuECFrqXED5YZ1DAxDmhvWXL8lwoTRZ/LAUtxJboPfEjLM2pKzBUrpzyW\nRNtyHbhSYZx8M53troGR98blVk8EDiGrWDVqBFMNGPCTXD1ssedewWLESCd5\n8oGhb9L++kwwnBFpr4xnIt7sASu7ck4Gj8IEgSr8ummpcZTgnrPqYUE+Rwrs\n/lGPGKuFCE8U5wHpkvPxucc+6M2hbnisVzdOQnV38a9QO5v+mr95PRNFaopi\nJs3S\r\n=MhXJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0QxM1rOnE+uGj6ttli3TV1U3nA1iFRObIV6Ceh+Vn0QIhALlws0gILzJS6nbOsDP91mvWXpkndp/jWgGa0z9KSd1C"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0_1612262044777_0.4037634335081517"},"_hasShrinkwrap":false},"6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0","gitHead":"abe83613b26c8e7ad9ea326abae5fa0920391752","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ydnlqD1Z2w64vr94UZx3IbY/dC7YA02N+mJxtgh5w7EZF2nPVCTbdvQFJmbOXVrx16FzCR35xiT8zmr5ptx32A==","shasum":"bf04ba34cf1c79e68022843592c05ff5d40f0bfc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0.tgz","fileCount":44,"unpackedSize":265058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSsICRA9TVsSAnZWagAAgBUP/0EQ03mga6Z2emGWHnsQ\n6NEncevnwokvq8Oso+4tcKNhI5cf8MuGEYSEQwfCuY+Wr+eBM9Pz1YL21hmG\nvNJziIdhU2HzWGQdeD4hOV6+DTGkaEX77BbxwCVehmtP/ybTPzakT3Y7fSTk\nXSsKhnlasuxSBZxGzG81ReTsnAJIGPZ3Zo0JwK3k3CIUmwYJlZytjl7BhQ8U\nz57AHXg95EMowX7nnv56/pUHV8VqYnbXkY172TN5eIgEURe+m1uMaynaANVa\n9olZExHEGpI6ThpN/C23mp/kQrDlC8slEf5hPi7mgWn2DMtDn2MBTLJ6MZcm\np8Hb/TVVZYo2y8fCvMHJ3yqD0nUFqV/ilGy/3slf9RWcDeQoBqpKwDJYCLog\n7fZH1VLqektFkppx/OeFcAmufsxQIosN53AQOwte1NF3Jmvth4wtHGQfgfEd\nCimq6gHaI67FEDHekP2hcoJ9BcG0CAilGxvghec9xoxLzdfx5fOGL4URSoPO\nsv5df7hOpZGRBX+QbYVFE0XIV3k+DLeWwOhjQIkvHsohD++RSHamOPHOaxMM\nA8peVOaPPkZ7UqNjt9K96O7ZoHoKfOYbfb5Lhcfzzitbo2Am6GAKC1aZ6aAt\n6HttsIjaag+AFjEXtpZe1GHteWcIv5wtKSrHVHV4+uSefxdWTj4TGvDiGLWq\niysf\r\n=W+BF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFpYSKPsw0N5N4OvpcFzXic5aqI0ujqY18og0OIKOE6AIhAKqN5WIUh8QrG0enCu18rvo65PLCsoKqNhfsIz66TlCc"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0_1612262151389_0.764381400484548"},"_hasShrinkwrap":false},"6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0","gitHead":"23048b1cc5211657f573970d282de88a0e554d42","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ZySem2KKlqxIVD9m4ocuHfnK+EEZw3CAqZHUwJ1lsQjUgTryE3ORqyhobLjNjY59teEh6QB7v3qr4aPDQVXA8w==","shasum":"6307e64a79f22c13127e46cffee705178c39d851","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0.tgz","fileCount":56,"unpackedSize":300760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSz5CRA9TVsSAnZWagAA7eoQAICyJYbnp1nbAA9wr4jU\nz6HpJM40gofPbhqroABQSj9LnFWpg26LYIocKAMh/lrdLS9z2gtnglCWFVOL\nZcvcF6sQ3IF3VlgMYTm3lUDb7YYoy8hJ+eikvtRIO78xR85/7P2g1t6wK6sm\nqR0JxXRJe8hBTml4cyB7PfyOtOHFsV9/7eCvMBC4ghdxzg7lNt8ejzQJcQMR\nyDGWkGM8Po4/y4m5WrjWOr5w2uwGn/SxYxMfdtNq6FCi16Degf8123JzgANX\nwcbtZ6ovQgigIKN0VkrAH8qhyxBkZFgrzLYE68B/9HoRb9nE+hmoHiS+Py8n\n2arxwzbQ7RZGOMAoDuR9pZhNvr96RuFHOdHmVTZq3kAC/6X5U1gnNg8Uk6bO\noIPOP0yOkzhlMsGp8AI0jkb4y8ISIeO5L8imMcWrX3hAULZ9c1lfl5BVtoCL\nelwTp1QqYdvi4hgtjEGYrriutBa/v2C0JBArqe1jMcEakTJ1+pP5lFYhu9TL\n+YjvIF+TizfJ/NwPBF3k+VNMs/4nYcxVOvRY0qgAmOJgi/lzMUl0/3lu0Fvx\n/LXCKJyOOUesJgy7JyeuT+uhnhZKq4oWZAwn6fk7HQGCN/vx7g9gMs8DJxet\nTWFIan3E0HmdAUnKrVlV0oCdCdxHgguad5GNPqmbOynwd7dwulWskdXxBLhe\nJ531\r\n=HKX8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF0gDVzT8uy6q0E42ZYt8WLGovgs1mLJFamq7f3B/8/gIgYVn802iesXrPbyugB7zakVR3GzEaWAO1XcTJStmHGag="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0_1612262648698_0.019974081399333654"},"_hasShrinkwrap":false},"6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"40623d1541e3b3ec0b2005a0db822a75b5533f01","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-uBg8tXEuEgRb0NMxwlAlSnxLHEmOLY77SStqgP5G2DYseGpYd03qKMLddpa+sqFaNBSRE8A7iWgZ7vVrRevzXw==","shasum":"85a2d62d932b4e8d13f213d32815be116b87b72f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0.tgz","fileCount":56,"unpackedSize":300760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGS1fCRA9TVsSAnZWagAAz9cP/i/8vd4UvmzsZhOR4P3X\nw8/PrWTC0RYUXHg7Cqmo4IJXnrZXVmP4zbEOmwAkyREG7GfRA0RAx+wfu3y1\nlTola8zWlhi71WgZwb3pXIvHdYG9JTUotKBd1KyVNHZkPtslbNC7Phk5elY0\ngCd3tyOX+Y1NsnAYmudcMrBBFPPvq51SSgJPgmQUG93hxOCYQJ4mthuZ/Ikv\nORLmWAym2ElBgspwcC1FCF3xeCEKD8P59WD/B1c5E0pQqtmKy91kRl8XP1BT\n6bCktMWV27iH10X+nhUBNrFv2RiNuKh1hQWZfdfLHi/z62/8jd2HObLl03ig\nnjBy04pmoQoCrnq6F4xP3/CH+xaXt+eZQatNfOnjVL+LWAZDiWCF58cBHoMX\nvimWBgPnt1YM3hi9QjclbLo5tkiD2s+fNTcTKB/DLE/4DO6RfuXz0VeTrADD\nzOAtMT4iZ2+rEVeH7x2eCjQEMOl38w9Qz3DVxgGO1ZvLNJbcwDaES5dL1Fv8\nV6GrMdQ/roLGFzHjfEw9mSFWFdXuh9EXIFc/ZMbQS032lYRxOYCglHwqNTZ/\ndYKU9wWgeI86riyeyz0qGJ6vVTfCCrqJaxREyBNuI51CT33+Bv4SI7nSkzWh\nkEoUyMBDiy3VE5boPpfFxASt04f0FbqFj0mDJFfX4E6mm+s9872e3TALI8xA\njNI4\r\n=HnVE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQRaiWq0sCEHuwyU4RD/yG5EmFe+ktp5JIB0r2gMIwRwIhALtgS3Whalvy8Xw/NjLCi+Aey6dXvLWUCd5dY0teeUFp"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0_1612262750835_0.14531335833464465"},"_hasShrinkwrap":false},"6.6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.0","gitHead":"8c710f64cff3d8a9097215c916ab11e10ce1e3ab","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-mzHqoznvJTIb/z64RKk8NtKav+fJHxyLqkvVr6YjKRs2E2pVwVM7ZqQDmvQdXjh81LUBSAguJN/daEgwBWxf2A==","shasum":"aa66a351a95de07d26c9c6ff69b80f6c69f58197","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.0.tgz","fileCount":56,"unpackedSize":300988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGS1+CRA9TVsSAnZWagAAoUMP/RShbMh2mEA7Ein6mejP\nVMZaS6k2Zy96F/cG1pIVZznutZ6/Ur2obLULhYLXGKX40niH1rOzi6b+mqyt\nQVQJwiZfddPGbU0XJHm8QOo+ZcZPOF/oNZQYpujEqxgh3V9CZGviq0fxB9ox\n4DHpR2mf/EvTRDt1xjDsFVPeYMztY/ZoREumI389jcnfI2O0ByZDBuCtaB6/\nOM9d6ee1uiFZlE80TF/xvDiuChbOHI8Md6PsHlZPdQz8sYJt9sVl0ZKeodIb\nIgs1Z5I37qMkHpR17nCsi+FQJsoM+Bns6qlKmnEwU9hzCWcOmy2QWmCV+5Z8\nLA576LUmiKha+6yxqJmRNd39yBOb5Gby2tGKpa1PUzQjav+prkssu/PV4c84\neZeUl+j1oE6+BpnWGI/3RZDBbMup3QKFYCeQoVOt63nqfOlblpVf6OG4HizJ\nySmyH+FWriCogwd5WPKxUSQvlOSwVu1wgndBph71pMQ8UFFxR4Mk4Uzg8nBQ\njeMryW46BEu2Qkv+AS0lExHH5eRYda1KLTeA5zBhU/DqrGgyzXP3G6YKHloM\nZxXGBAlRNeFWCR1FgbWfKfnKaKKB2qVeihpu9iwvtLwhtP9i+HzYj1WCopME\nDhrCbNe8pGu0QDnOw68DjcyGYeanxBifhcA4bEyyFcZLbtM0gIQ5bFgifQhB\nlQeV\r\n=CXMa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHunD8Y3+og2J18gZpRAwEh52/Yacnc392aPBnLZuKy0AiBlNRBWTjoVUZ5ggHkUiGZXmFQRaU812iTPkwSqGoDopA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.0_1612262781970_0.15917892132287248"},"_hasShrinkwrap":false},"6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8c710f64cff3d8a9097215c916ab11e10ce1e3ab","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qSre9s25Sy/84xAJvvJJ+eiXWMSgp9dPgtVfpc2mjumqlTQEpIPiB8Ph0tSQ7xR0UftJrppac3vM6MnQJVBo1Q==","shasum":"110ba752387eae32d2bd63f4adb2089067334f9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0.tgz","fileCount":56,"unpackedSize":301031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGS2XCRA9TVsSAnZWagAA3cQQAJ6TEDXFsNJfa4ixjH05\n6dgmD0duXUrl6TRb8dzOIIk/4/4xyMeCCGy/ZhOHrQe3G/xUVNSrUJ5IOmFS\n3UcFl6SYRpCg/fSt/nBuw7K3WxJP0rVPHRz6GnYpJz4nT2ZxL6PtHEjvmOlb\n6nN9pIsNQ6XepyyYUj+El9GhAATswf4A7RNfRc3CKh+qbgG24CsJatcYfKKj\nwo6mNim7ZiNpRC+XqkuDDJUJa9ImZh5jxDdWRSP6TvetFqjeY5uD9IRgdEgo\nL9P98QeIGWHigqyAKgNcXiJGdHr/IoyRClGB99CsflHSxjxzJaWq2ZapIV++\nKmphNk/icUFn3rQG062FoPKG9Y+1VS1rKw22QVrB5eW+iAQR+nm3IKvim8Nn\nCVHO8pqqetbqbLp7BT167FsEU2G9xLl51rp08zSu6wSPUrD5BMK9PjTZs2+v\niOPrfCmR0/vI316EVHpCRHqMptVIyloWy3eyZo3sLpeRHkagaXZSBb/rAdve\nrVo5ETO7x7lY4CAdvPMWI5I2QH9oBIhS/jI2Zt4bhCqOFOII/J03WcBAT9be\n4/FabR08TQ08wQ4I3+Iq6Al+xlhMGY/+uRQyJ2Tgr8QFCesmzcHzy3xL5m04\nL8SMpOCzl7upGsEkDNi0hy368J8grfaDVtRwdyZ4nodI+ImS8u5EZnaEjYq5\ntCB/\r\n=PQMJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBavpbsyEWyvi4Wgt51bkEfdgqLueOA+Ywp773tN3o57AiBiBwxor4Ev9KNxosQ7cCxb09YHq+CZBHWpmRH3u2PaAA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0_1612262806825_0.10039359771472056"},"_hasShrinkwrap":false},"6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.22","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0","gitHead":"91bced852a1f48d55d78ec794933178a719252a7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-F5USpaUk34+k4hoHdwej1Pb5KNjfDnASNR8t7umtYdp2fxlSei0iX1qGMuZKcNUZn3WMZrt684CmaUg8XJFwUg==","shasum":"2a93b7b5fca85fda2aa5e47ac6680aa0a2d3baac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0.tgz","fileCount":56,"unpackedSize":301030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGS5BCRA9TVsSAnZWagAAtGwP/1UGddxPb2ZKcJPGAHkS\nyOoXNwgZHNxLx87obq+W6/7Ccv+gj/lOy1XMyeWxfYEy3vP9bxWYQQTkKY36\nW7V7Ow3ZFakMX7GAgZUdPMEzzq1K85y2a2E1bL8dWtflFaZgOKCQVvVmi0oc\nCo3uw2vebhTYB5MPbEgBQ80R4ylyNWEsPFZ0Et1hWUNJnxJHCVaH+zeZHhIg\nut27+YME3dgJ70Zu8ub8PWo3AU3r4KFYyKvN9EprWDIW7tS6Z5oXUUTSICJz\nqGD7g9ms7BviwYsn338Mqlar8DZDdTw/SOnkP7FIt4IInf/EAAlJjWC5CFCT\nCvx93dPYG+IL+E3+2MEQBEt4cusbQMB7nHapvwxyKcJMHvR8RFHof1fuaoZh\njbfCe4f/+iODgS05uQFgy0ZoAn01O6OlGBMTUqT+zEf8UCe7icgUbigjp9/9\nRNgBiSK/tnnD76yFVEpnKexwReq6HuH9x1bI/KUX+KDU1MILfPzDMr1/VsWP\nKc16BkdM0R53Nm0tq9dUwJqBijRoU+srNBUdNBHV15HR8X8w3m5RhoJjGuUo\nSPUwG+PiKgsoaNU1ss0y8sVC74+WdSzIVquY5vEn9tgUj5R7NuR4vZGLNmd4\neX+MOPV/3H4jeh/1D+cytPqNWND+hIaQCKKBZnhkcNIi3OKe+GZcfIxVeBXh\nGjee\r\n=T+5I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkt9TAA66ddP6acWw96Vk3yCSheOaP4R7RAMNVmJZJ4AiBNv+W8/aRSKCLqIf2njRCgX0G/f013rFbF4nJu76nY3A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0_1612262977375_0.862119257008624"},"_hasShrinkwrap":false},"6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.23","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0","gitHead":"98cef84c40419f930cee0ccb7deca19723596158","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-TMeJyncGnP/uDGCoK97B7Jw6M+rMkOnB2nojgXPFJeAg/2+3mXqhyD52z4y7tRSwaVbs5scB/grlky0j5fWhOw==","shasum":"00ece4406f113bf97dbbe67a7dbd417035156ce8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0.tgz","fileCount":56,"unpackedSize":301031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGyozCRA9TVsSAnZWagAAgTIP/0zD0zB7g/rXUpmuXXpt\ndqAZmjD2FaJ2FSCw605oMv6tLBDsNZZddG+z38gUNk5wUwxu5PWGr+HITLHW\nSQYd5t3E6Xert0QfCnc5ow/i/uHb1DUCqVHSw31PWMo5tpVd33TzzptZZHpf\n9itlI3GS/TTE7Vs05lKfmyM/isItWkL4u7rx/215rDx/1m7GDSTy3TcqAANP\nMljbte7ErBSJQs6+nl8OaQWBjYBSXKrfhu7xAmPRNRof0qFCZrMXCKZEqqu1\nGsrvpSz0wMn/5uifbBUMOSJEYc9Xai6rxl7RoE9+OkV4KDapaEuywmSOs4pQ\nzeJYEpueTrLsXQahNn8Vqv3JmtEdBs0z+zQVyVnRpXJ0PBKY0tgPLq4Z0NHg\nPgloqw9a0+ZP/P7gXolPsbx9EIKSUuPA+/TukbywmPIG8VF6WU1JIprG6MGj\n3ueF26YNVzrxqRxRlvFKnsB62QG+X/vtL3tYHgxUkbCmixrCOz7bm4cpWTYB\n5cfJkSdC4JvlHi1Bbta0dgwIDU4VIPPbWC4ghyrAaBIhPoPeH54hwt7blwvU\neV1+H9j7ZU5pG2zT2t2tWRYwZhDWdPN+SOQRwHYjQQ0MPWMtRV6osXHTwxIz\ndABscWplLpqCxFS7Tm0pp4gWGVXq2utPvy75PqZpIeYi4t+cdEk6xO5tc9eS\n8bqc\r\n=j8Wp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJP7nfeZ61nFEvTaZFVfE+LjwBNExeFh/cI15tjcwetAIgcER5zUpb/fFvDhRFsEorEREKQdGtdTHsX0f/DrNVOJI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0_1612393011226_0.6768380750949841"},"_hasShrinkwrap":false},"6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.23","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-BgSliHINRzI4DMOCL6oJf65SrvYyfu71D7nUOorH1f/MWuZwZzRy6n6hCjfRPXGtF+NGBL+CllBNCblnnmOhDw==","shasum":"96f022bf8e32b5f6d163d8a38fb8d02f51587aac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0.tgz","fileCount":56,"unpackedSize":301031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGyqHCRA9TVsSAnZWagAAGTgP/3O59IqAWBGPu62oscBu\nXqGFUXCSwKcClH+rejO1QsWppVRshtLd4fyudapyWDC/YJ2s2/Wo3EKZ6QZK\nxERTgUEovUWH5McyO3b7nk7t6yZHD2J9s9EmfucANk9BAfP8N/Or5+c56Kuk\n0eaUti2I50JSGNUFzaqwLrAsy1dLMq7OaqN3qP7XGM1eZOhQkHfuR3sRnQhs\nY+SdD52hVYq05H9QGP25EXOhX29/15T8GWupQpD2vRFBwbRtG/Ff0B80VaX9\nyxkJ+LZ0sfMkUupCZLAtjwmOXuAfDLZnG+DtYwNvsUQfj0CB71C2EFdGEKon\ntRvqoXmI/jlP9IywyWDzHq6fm9Uw+fr99zrYvWF3vZIRLMbxkDYJ2hoS7uT5\nn4tfIZDumA/MroPaWrnOYBlgjNnQv0xOF/aTK2Sax6qSxY069NqEZkijhcbF\n5D7k3agNTVPftX4isLCkudcRBsEzxx7CIsaxxUp8mLgfSCjikFktBoOZaSkb\ny8/JjkQ7LzK9mxc6uEY5D8LCFQqBLIN0gEK5AKgXXOqUsFPGSfmGZOg2q7Hv\nQlT80QWI3noQNEkFi5O+KjC7dHHP6wFBiN8m9RhQYu1Wdd6tIu2SeNVYiX2p\nbJgzP94DTYavpZwmQ95s9Y9yOPrp/6N6n3VCYbSM+8dBwuHX7ENgXhXID4yS\nmF5J\r\n=9uVj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFs4Pny/Gq2xrWC/rqF4VGIonExuX0xUngCvfTMk93EnAiBt/GdIU/r4M7xcB7ywrjg728gIruuuZQRvH2VbFKR6TQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0_1612393095187_0.9478744402450252"},"_hasShrinkwrap":false},"6.6.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.23","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.1","gitHead":"26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.1","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-znJwYdCGPzeH3DT0jTJI++ilM0b4huram6F98IB9LpCP5i0sgCDE1HZc1vL0Ai1T8xKMZ72tHnDmZtrqX4wttw==","shasum":"c307f53057eea05c196dcfd3d73679110cd6a34f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.1.tgz","fileCount":56,"unpackedSize":301271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGyqaCRA9TVsSAnZWagAAXqAP/1B8KYMu9UC/bDn0Xuar\nhBzcEmBkN+itbFespDWTjD7l5678IKfQ+xQevXHueBqYAmnFI5mExDWM7274\nqGSlP+R8ZLMkkLqCl8bjENWgeHtvdk5FI3/m5FSBP+5S1Qs/pC3/JuSh27el\nUgoRumYholNnKNpe3SFA4Cl+ymBiP5yJMkkmYKcs8oRwb/GPX1tPBQN5ccoh\nIYr8XmP1YNpHWjO00eK3YbIuGRzL1dVa0Gklv8xHkDWAJovG5U1feah3SxDN\nnf7P8AaEvo8wC16SId60LC4yu9HofXhFyxldLq1dGAoWaUgXkeF1H0+z+8PF\nBvXuVvgRfcamU+Y719aPf9dh1wmfWi5NZ/cmDRI8ynnF/4gTrkJigBmylzjW\neYUieSwgC910ePs2RlelPeqoUXsa8YCidC9lNmUT+Jf6718nF5WLiv/7nqf9\naWFSHujBudiIeLtaw3E2kSSgk3KfIjWcYte3h/bTabh274KVNPallYfYHwXT\ncWFUaH6GKwM40XugYuMTChCiZTP+QBx9DWgRDjU/G8S0rJDt9wok8CFfvZkO\nkD5k/m5BsJeQ93h/c2Y4hdH4wFH6H6/dpzJ7R8oyp5vniJAiSLJr3AYEnWtT\n9XT+K/TNz7vIb6kikjJltURiIKXZA8ImtmuIcJNGBjouRSafLkyR1GlEaBVK\nGYtK\r\n=/Acc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnJGN+nPAoKmR8IS9HT2LW4OwVXqygg8YtvZ0GtkhnkQIhAMUpF6RsSKUqZ/nC1NqIQulubNrLlgXITxBtE9Po9M0N"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.1_1612393114239_0.09226326717854327"},"_hasShrinkwrap":false},"6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.23","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-kWbxNAg1dHJqgv7dyYxuhDy8cCbcBiA8tHyHQsybUYHZ+rdC+hrn7X11lmclXddemfOBH23DgTMA8mXylzYE2A==","shasum":"62632267720759f7ba84be7baf40d6b900cc2aaa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0.tgz","fileCount":56,"unpackedSize":301314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGyquCRA9TVsSAnZWagAAEXkP/AgT9pVa97U88j4UG4ch\nqMtk3Ztm8CjaAtoibwVcOA0g0hcKnSPSZiMqB1bZVsfTYV10ZFDaZDlR0f2Q\n2OerzCSTFO6VlwxGUrQBOBRkvvoGCmhkIBavAoACmROFJDSVdMMPBj/lcAt/\nfPvQnE/odFV7jJWxpDR5PdqFDTstKlUbjEWYgYPjWP4gbb6sJH5SzzV+a8+f\nxux/7yytR7ujqOmWd9UNh6r32yTMphCUuDg5HiDw4Wr38MeH7C7yqlVltNiX\neiu0iYW+/oH/qUuzJ6qTYq57Guf4lg8LBTQmiKzMmLoGuHL6wfrjJj4nbuqg\nuLgMPIytZBa5YJpFInMisfbdd9Nv5joWzJMWbvEYy+eNxQhW+RcjEhExQuFW\nvuUsf42ZOCVuUAVlx70ATGJpFXvfDXfjw0uNK5IipHahH+2C2YtJ2Ti6yiZc\nNDmkypr8Jh6/SYXwj6W7y6tUxZ0IQXKyZgTHOQKVewVuqygRDBFaxpgA3Bmj\nqDjhO8NjLw8aHexQnSYVXKlDJUCXntonBtUZBuy7HeBmbkmEgoJ/oRsMdU+k\nIlW7p+1EHHupj7Tvmu+LiAOtGR1akVjobAEevB0yNg2/JUiiXncUag8Y3pGb\nPMQURn/kL5xsBHcZ9cc2uGGwvy1i+1qIOWaCiqN2L3Q2Nsd0eq5cWMDJr8hn\nREY1\r\n=u5sf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjXn18//xu8NlOg9KhUwx2BL2DkIk8LhdxEcXN5K31vAiBLyyPTrhSV48uMvLC2smgT8uEDyIiXE5xz2ohU0cA7Ug=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0_1612393134403_0.45993142465990644"},"_hasShrinkwrap":false},"6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.23","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0","gitHead":"c054dfaa7facfff68d273108c05053c11e26522c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ZwRNqSXrk+GYM4MK4cuhclTsgBObhcPVEo2tt99ZFqdieGZR3AbZHkK28M3T18CPydgIXHb22AIvrWSVlkDtqA==","shasum":"fb52f875907bfeab58d6f4ad0003ddcb9335e50b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0.tgz","fileCount":56,"unpackedSize":301313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGysgCRA9TVsSAnZWagAARdcP/1lX6x7WI8K8JdHhH8QN\nN87F5NH4AhN+exYTZ3sA+g52qnB3rlGQ7gCATyFfxXjSmRxGDwOzeQrP+y4U\nOgXcfOZp285pQBaFBhDfQca9Zsi9cAyzcOn4QnPMKSQM6IN4VJc9kyjXcqyr\n++C5W16m94ukIR40q2op+X3XQEXi73kmJurnfxUgOnBruabf2J+dheP53nPE\nPjPZrW8TLau0dAs1P1NXAB1I7LZCOZDYtx6GpUl45JQ5m7HvDnotVCXtxo25\nHFOyRZtfXunET8q5HnsYy4l2mxTQqNV5n+0wOZbu2uMhJjg4GogUrdPNR119\nYyX0wLcCdmCe3g5IYsN8U7qsg8jeTpAKDcvy/uZLSQ3iSBY4/wrCXtcZI/9k\n3U2VpyxdmrJK9xNf7tK0mn+lYQBtvoK9zonXuci+/C0LuXLSM/8JdCqr5zMn\nKkveUf/ZDSVVeBxvKRXUH1Mvo/MpGJ6Kl28Vz9+gsbv9iV4tZE767TFzuhde\nhZW4wRkmXHs6jtr8U0tj6XqmQL9p+k12Y5fuWeaCemaiJjTbnHNrL3FDE2i0\n0BDJCClTxxH2HQ/NDgsSzRMFRjhD0xRJFsQMpKo9Ipafv4Y2SbnLQsncmkGT\nJ++pvmuUwLr/naPQhGMkcljwqWew9Ndd7M70U1gd0nfAVR5LRfh90wWFfWij\nh+9c\r\n=tv6c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpLhoKLxZDuN6wkO387V/FCSSkJ0NJu2GVicPj7vKp4wIgTEhnWds6hBkGXSB2t/WuMbdHSU0WKsaZFaceJXSQR58="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0_1612393247718_0.9247119238503274"},"_hasShrinkwrap":false},"6.6.2-02eb848215677f99817c7775173e157ee347e974.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.2-02eb848215677f99817c7775173e157ee347e974.0","gitHead":"02eb848215677f99817c7775173e157ee347e974","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.2-02eb848215677f99817c7775173e157ee347e974.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-4MDGzB4SgbN2s4i24i/PFWOMF34QxWToMrWyMX+3Krgwormg/IzG9FpX0NVw7Fd4T1+8QNDfCImfE6ljnFZr2w==","shasum":"0f24b7c0659461afdb22cecf18c42683be23bfa6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.2-02eb848215677f99817c7775173e157ee347e974.0.tgz","fileCount":56,"unpackedSize":301314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGzeqCRA9TVsSAnZWagAA4ZwP/itFvtxqUUocAsvVMmvF\njSPd3CHgDoJPGbjHyaE8o1Kvd8mKueXIGu6Qot5m/1Hgos6v1awO3744gXTH\nt8hW9GRpHySfDFrb5x/Y+6+7C1tfkssxlY4zmaicTlEbIBbM0Ux8PNrbfeah\n4II5mr4EdFzYICvq9GipAnSf1Endfmf/QyMjEWcWwyfF5EJhMSAK9pl2o2l6\nBzhI5LwKMqq35BkwDgQehA5gI55jcbaTfvvabTxxcw6dZ3S1+4nbqSifrw5T\n5e+7Kc3RnsL++fgF7STxVewKH64sf8leZgG93UXoXwocAsAE5SEJGKh+ErmT\nL0bkUW7EKBBMcWM5LDbbhHTyUjA8U8dvt0bYQbyROOFlvm9D6jLsbrwZBA15\nDfmztJ2dc6jWT0e+ikwbWNrRTlWWQ4vmHzR+EFbXzEjqEHLJIDCzvUP0XbK+\nZ2n6v1nQuLVmeSxIcuhd1uADEfP8UwlGMyQypGGDTY4RNfXI2YOXEOQqYXPp\nwmmZCE6AiQfENqxeJpPOBw9CWBV6wFyLZXZa63ipfTbpcAGGxDVsxiAbMl4m\nHGF+2NjmaCZ1M0rP7CqGPQuA4fa1yQlO1k/YBCOPU7Ec2pk+/VU3JW76Zae1\nuS1IfbVqP45DI1A8gK9m5snw/P52X/kRZNB2TkRxOfqbups3qWU3PHAMDeV0\n277V\r\n=P8rX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBlyPv0YnfcoSSB3FrsGN9ZhL3d8bCmosbftQ5IYVKB7AiAIQEAtVFeAEOM3ssKNBlUfjI/BCN+lL/mbLNfOGaTwhw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.2-02eb848215677f99817c7775173e157ee347e974.0_1612396457778_0.16020959402223856"},"_hasShrinkwrap":false},"6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3a8006eb13eadd53c6571953a29db151a06d316d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-5ePmXMi9+DS//A9V5xYDpKRIjScfzUQt2k9QO5j9HMM+thsJsdhHB+2rVwrn/OWq6chnZ7vxYqzv0jT/34tvaQ==","shasum":"4b2cd84c2f7c7fd595a42dc15e2e4fc59066b150","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0.tgz","fileCount":56,"unpackedSize":301314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGzf2CRA9TVsSAnZWagAAMB8P/R59S50YygqkFBOtvhDG\nbTDUxx0EULRi4sEx9jEil8KMGDI0GzZbxa11m8VSCOa8FgNeJMHcG515gPdI\nASucc7LsgOv0++RAELeUrkz/OQlIfJaCgMEph+y8m9OfgIqW8pKjOcCiblwE\nVWxV/UfoNEKD/YazwH3qFqvkcxvmieOC72aULJJ5Tsqb9+OuxMOsf6XztTrk\naCNAWReM5mE/IhWOLo4DHa1XaPNSSGqfY1Egltu4qNyCtCyYCN1VC1Ac9ty5\nT/Rxhg6p85N0y1mrj6E4Ew/KeCnsy6NeCQ08xQU04o/nZS0pbyxFxrTyJisV\nc8E2D1htmnFOh4vuWwZvxQb6ZomBPpigtiPOCPFvX4wDhmlIrA+r0edRAJz4\nZ68svuVBdF4RyzMPSnApTotK2kyS/se/OT6lpBxpizICwabCA3TWGwnrY2jQ\nGQMMxFpxrI8gvU388RPKzhlFYTNaFehJBymBjROEbpQST3IdHQdloZv0clZo\niBTUjT5IykEqvEjSpSTzzHAZTp94v5ZsPRX7WFxSOhz3iu78Y85k1VPrsm1r\n8f7my/f+OK/NMcONdCHS/AZQaJ+M37h4KlF+40dob90gya33w6E2jNMfaIin\n0HvEXjQVNk05Gp60DPFj49baIv0CB2aE5Nk2UZrSTBWEh4Pi9yp4KCHAZU8U\nnsgx\r\n=CSmi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoj/kgx9YhJmEPIIvT4ArwuX9eoyn0KV4ByBfno8jz7QIgA/bGKTm9Sgg17XeW4NyCXAopvIxAH/bnywOvo3IoHKw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0_1612396534064_0.8108324120299959"},"_hasShrinkwrap":false},"6.6.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.2","gitHead":"624bf4980659f68a2b8af0aa3dd1ef50c2cb3071","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.2","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-PDsbsmtP4j1oyIE3aqjOW9neCeHG6moBB3wQzEzDVSmNIwVCRXnZzampQZbtZxbDZGyElwt04aomIGSij/qcUQ==","shasum":"42bf887192a69bfcf4f2fba04806857b8bdc3afd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.2.tgz","fileCount":56,"unpackedSize":301554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGzgVCRA9TVsSAnZWagAAwaQP/j1vlNJJlgXiwLQzEyHj\nA/uTpMjMNYtQWZHbKkndWbOi5xUUqa2vqZJLv35GjYd+ZSp6mDPSkYs0m1TU\nddzCC1G9kN0mE92Chpm8LMHGw1FxKss06aBASmKdJln0F4/Nibt8V3iPkm+z\n7Tu3QW+hO+QILciP71/FmILGNkE9h7yF6CTJQwu9X9Z1pb8tdarA+sLvIoAp\n4nodVl8A3GW1eaHabrPWjv0myEFyhGXxpXQvbt0MG7iPFOPXx0YTf7QuU/hI\nnttuFrxOlePme2kOSQhn1IYBWEYN86qDkueWqIgAtMFY2pJasbmIiGWqOffc\ned4t0H3Sta8q3cT+9VTVuBBI1PBGESKiuwu9e/iPnTBp/ElJUp/qoSNB+gxA\ny9EENvcz8ITkOOcoaNdnRhy1KYoTlh/hMz9LmOdnYJeSTUcSZkVtbqCa6xtS\nQMn9fFE8R42C03/n9olNL91QQAQ5o4MbA+odAW/sgAZQ5wPUAt9RHETJ+dpJ\nCrTDBIGhj0jrLFZvepZxsKpf2/rUIhsN7nMxKHbCFQHeAFwETC/fVL2a46S0\n9T364CgFi56zldqt95z/9ZuRRtc2C1jS4wjmgDmMf7rcyN7fUznvpSbA4z8J\n4wqWpMAW0g9hZV96vHEkqGddlj9RR88B0n7ap6CGO/3AOksiS8mtLzlNT7mV\nvfYj\r\n=8FSW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtD8mm+8c1va3KugF9Y/4lSPGuHmTxpYVsjNgmzfx/EAiEAxozYy8DnPYn+71YS2k6UQmZdtJw+4b9VSdlCPML+oB8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.2_1612396564808_0.9718131429172998"},"_hasShrinkwrap":false},"6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"624bf4980659f68a2b8af0aa3dd1ef50c2cb3071","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Bkf2re2pkLnZ/pQqJTSMb36ugSxH9FvdNd7H6/ktQxlgV7m9UPr03VuAA3sKaNym0vSu+GPCHOXVPuzXassPSw==","shasum":"80b689c474b16f3599511b0a5e03be1862ed5d9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0.tgz","fileCount":56,"unpackedSize":301597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGzhICRA9TVsSAnZWagAALc8P/2Jgre1b/4TjnV5G9GIy\nAKkEGheyd009jQaRFyi4ci9vNMhAPsV0r5d+ZVZ6dddgu65z5J04bI9a+DFa\nI5zMhR6om+MHyBH8V7k0ji+VDOdI3OpCsF2qwGpgVeMwWJGvjiQ4qcoG7/Ue\nDuQIwkkkzHYRKtvuwX0Tk3lFFJWx0AsgCn37KL2VESKxfUdqTYk66Q3hWBqT\nfyR496U5L/BS1nEzzUctvEYeNnCOxoInUSXFQS4X5JumMDSFOEAZGvBSVtNn\nI5fHZz8JuJCTCkT4syd8AWeClfm6GVxgX4wY1qUYo9KOWLv3sAScLf7OD9Ec\nLkB3tp1Fj54+b9KSxf7sB78ON2wPWh+CsrfoFFpYBMfBPMQxEjqVJ+UZx5WT\nlp5ekozFoFUcYlufEooumbPBfcbSYMCKUCUWwMiODMbogaRvqsVBo7xZ58u8\nMSMqApkr6McGhBBUa6epy1Jx3D7tadyHOSjH9euoBJQsTtGWQzoTxbd+APc5\neQb+H3K0iiUt2zOBabUTrlogM9pmjyXWheK43UBdt/wnCAOzXGptb2f1dsaP\n2QbE3KD4la5RId3sKoMoN+xo2OO7joVrC5e+hyF/WFCesvoOSLDtVJWsNnng\nRqSrHbrE9xq9uaUGkHlkX52AJwx51oAfM2nsJCUFgCkKP0yqjvngkAA2Hioj\n0gmH\r\n=IUJL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEyOGKkXm3KmbWqDxkujqXTEQN3VvWw/psO5Ht19UwWuAiAfPTNkD2+z1cO5M2rGnoHIoJVfMGdJFpavGnXTZlPqJw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0_1612396615702_0.6264469836050361"},"_hasShrinkwrap":false},"6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0","gitHead":"c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-bnf1KVMhmKkRo/199Tu0ZAaxqwu54SmZ7LKKvHUyzo4Zb39iCtfDHE0iXWr9ZxK1/4x1NjzANh51/byAN+0v5g==","shasum":"82a8bdbd9395704d794b79aee03c5e00486ef012","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0.tgz","fileCount":56,"unpackedSize":301596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGzjGCRA9TVsSAnZWagAAJK8P/jBRSg5/LRTpT3+kNomG\nC0Zy2q+Dq0asinb8GwfKOsXQu5t4kQclBNZ3Ged1Xek0eMGxonPMSWF6CjzR\nl+dwcUEx+Qj228UBNyOeQPj+Sro9WgAw3Bs27g1r7Yap+ysH9xT686fS1/6s\n6HzcCzbs7EJVacAV0ko4RYSQ+IyrWj1vv20k20KJMKCzpqX/VDWM7oBA6tA+\n4siFPjdMO4/HsAEeq6vCFiIwzkKG70lQr702pTmMLW6lGqANzbuWGWEUNPIU\nzoKwlB9lhuvV9vmwtpEzyUXWuTYhxfUlHFtLONJTyD14Pr8Rd89rX4HBbqRg\nkE5ZuZ5filBrI0DhLXMI+LECNlUeWSAsIIcnQDBseCSo7QRJQRhoFOAR0uQ9\neUDtfZ8PWNYanD+k/8xHj6rob7si/ZhuJy4sNuNljcc9GMOxZ+D/wpfROf7k\nu/TDLWme9AJnKakS2n/IviJ1hgNqyMxcT65Bb01SafHIlitKvb5v+GK5fr97\n2f9fHPOEu7IGj4HvEyc/Vyv8XtG5LcoIy2A4Ahb7mWEsL3JfVtN+hCjYmDb8\neMKM0HXeBMCysCsT0z3+YXHtc2SE6hPBybWrfTwUAEsk904iVFuXMxeMuso9\new7/R+B6jlzc3KB7VwrF2nlYBeQh5emqSwTpF8805MUOm6V0i8cislUTD9G6\ncslG\r\n=+RXA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPWColMDyoH8QnOYMfpfOdWJab8QBu2cq2yTCVxfqn+AiA38wjp4wrBt7Ly+hXU8qgf/USk2ZM1LAyh8oVoJ8JmfQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0_1612396741263_0.2521567271067029"},"_hasShrinkwrap":false},"6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.24","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0","gitHead":"d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-LBGlJdWRQsyUCt8W4wEc34V//HDYQUUFBY3r1yiNIHy2uJFg55F5X+ob7J6PNfAz9QHT8uvqjzoQGIRnrzLXfw==","shasum":"d66b4915d283290e1340ee8c4e7e497dd6564a0b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0.tgz","fileCount":56,"unpackedSize":301597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8keCRA9TVsSAnZWagAACo8QAI0DCz4pdlIfJAZH6PpF\naejFLQBAJyUSHhfQ7oHeQTjcxLX2h++eW4ngenlOn0UyfkQcqr5VoLi7Z3Pg\nC30/zah1aDFzY3PXyjFlddwKF2564ex9aDPXnz0IqNBY+ncJ1dhJFY0E8npL\nj62+2SChti/7X27QDlR9XAe5Ix8mflQzW7phaGUwcwam/Q9Z+103+gdKQD3A\nPkRpjmxHCiM6Fr1b09/iBNkLI+MjMYpDrQWPqBQmgwqU9l10ZL8AuiAqHk1F\nC6MPtAZWXcxaNIKEvyb6x/aEICQHRqLEU1YB4DWpukIEXsvEIydedSLZyAXj\nZJpRyeW4bhUZpc3tT4Q1QP1KmLv18qLtlo6x3r7coYy3QHznngpzSEQkhepT\nR4uEU+S3lq/kQciPTnI41EVXDI1qjCI2dgLNbW0Vlqdj+68nrMIowhrlLxzJ\np5z/MvDb/bD12uhN+xxfB6mlGvFQHCCGr65m25FKkWkkX96n9ANDRbdAPk1L\nFOpIQi63EbKBzyT4Z7jlWwRelLfVBVMhCcCzE25fcdpwE4NUMWqRHy+WzKxq\nN1rDNFJMDGBMgTDwPhOGvkIwTDW69Af11uYRingC4zfmGTeJgyZuzBhHFSaW\nJxjdHWo+2g/fmfVG4VaW5GPihwJuYmAszNmDeLu/9QuS35lpnLSrii+fl1EK\nsRVr\r\n=auHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmHZ+VUZLeO/6xZXpXCc0BxldSesxciRdSebrdnPGMpQIgX4uvU8K8izPLjg0PMu5SNDQEcafJSjFXW7ETDljoFS0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0_1612433694041_0.2115827156802803"},"_hasShrinkwrap":false},"6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0","gitHead":"f4d7268be1a38827d9d9539dfaf2ca37229ac9e8","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qX5lmHS3ySCzFUiDxHABbaAlaUW8FmyscUJkC5HG+W6w52w7/MLU9qzbtgYlzCEfupb0ZZf4gPQStffjC5GIFA==","shasum":"2b36a76e4355ecdf4a402f585d1bbd47d5865286","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0.tgz","fileCount":56,"unpackedSize":301597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8vDCRA9TVsSAnZWagAABOIP/1eURUXRjqWyhFwfSeAW\nkE6smtYoz3sxhgPW7vc0CjOH0KDahSeKv+EP8fUXtm22wXR3Ek9/jNnNNHgQ\nJbQWXSoGCpf9qYooL9vGeqaikKBtEB265Q5Qx88NqYq1C9kZ4++0VQaovXky\n0Qj9aXl9q0F2/P7SZTqP6ScsXMJFLAOVXrCNY2HDTjwhaJj0trQ6hdWd39r+\nRsjWU5QtdjPB+iPw4nHeRmhyXkT16lutKYzf9pomYjSbAnDmiW24rCC9g7AN\nSdUHgKficQiHi31LLC2ay55SxEltRtE7Uiszdd6gvBgfEnkiQBf9WhtwDF3U\nzrF4OAJT0yXACHVjkaGFkllYQahAlQ5z/X5jKnKvFsJ7bW6nReikd2FDsF+i\n8L39yyYCFLB/N7Nq5Lj+gE3BrycyPu6K+7kT+tAU+AMZBm9XjnnSSmlAWwd7\nsVAL+uL76C1dkGPOI7kDHpfgsT6THRdt2gNo+6Yx4UG3vUnovN8mwnI1N3mq\niPrkuLNigh8N5jJbEwEg638kkBT6xff7ni+n1EB1XYITIxpVL6T4J4Ydxd3B\nDtPABEYN/B/9pO7js5cgKVjf4B1wrtOLihq+0zu4TyvuWSfTXGMH3EE0E5h+\nL6T6LzxPx2nWbghmzN/w1qwcuPL3VdACebAiXXpv0E7V7mi4oJBQl1oblbww\nc/uV\r\n=W5V2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzbXQAh0rvSthtye+oyoNgZwFxupyAd77QD5hxNZas4QIgbUYgNFQiG6C4F6uyLbqzGaTal43i93oJTH+DkUJdx24="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0_1612434370809_0.5527567068643005"},"_hasShrinkwrap":false},"6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8447b573ce204a789f8370c96789c6ca15553a3f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-4IsA0Bx9gRG1Ml3JVGoqCbTjOKkADe+SKoefvdTnRUjDFQdcnh/MmTnCuenhiOmBnt0TeokS1GEkZZYEvFWDwg==","shasum":"fe63c67f12111ddb444007562984205abbf10567","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0.tgz","fileCount":56,"unpackedSize":301597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8wSCRA9TVsSAnZWagAAuMkP/RHoBkBYGlTn0Tj8/hZY\ncLovhkXc5itJjhD2psVtejL6ydmgzHi+gWXb90oT03BzfrioyR5d2H5rI+1n\ntiPg30XCbBNqq6pu0A3EJT487ev23GDcB2LpHqfoPOWNnee/d/SDtsxySIET\nmIiYIb/I7V3rqC82C9d00pK2Qp04q6NhpPQrJAqMVgcQL+IcLIaiVy+yms2z\n/aRwX0dCJKLeWh1VAIjRuCVFllQfoZzUNwg16A90YHZRGO5+04pKljxZ6gAR\nF4s+YxudvRk8wdBwqS8pKfSSIBx/eLQ0VP7rDzrw6tOiIbx6PHuQLzYBUHV3\n6+824vFqCz2/I/+pNSEpap2N9yS6v76/agoXLTXkxM//YfqScNWHTGQvlPy3\n9B+nAURI1PQyzIvlqjZu7b9ndoUOalldjASCJPaVm5JfrwbQWXru4XYkfCZd\nLRG2M7RIZsXJf4jWy3ibYIBHqcfgo0bLaruvdPNnaEt2V9Ow5NI8l0pcRtDx\nKkjXhWQwcFeVu5cfvKFO2a1qtlYLH8RMQT9YrtcNx6IXKru7DPS+WonX7NeI\nXr1+7xJyVudH1aH+WL5YTernrBJrsvtJ/q6y0Pj0/266DdZ0XnnPhcMdyy1g\nY4cmnCX5pFKZEeJmrPgM5vTWWkBmVUe9H1p3m86xKtzKWax372XJcnjx01l9\nYmpS\r\n=XMM9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9zy836wLjI47c3EQ7nbitjQ471fg8L8EwOCMAIxiByAiEAtUmfkFzCj/VSH23mJ4rosqoSy0eoX6QSL9p1OIZg/oo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0_1612434449609_0.9468133809524837"},"_hasShrinkwrap":false},"6.6.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.3","gitHead":"ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.3","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-zw/1bY2nCUws52QKoV2J+P2w7/dnPu9Ta7nw6Jvugax2zwiX99Zn/UXoigZAYizFMi8Ob0bni+Nr4HYJ5Fbijg==","shasum":"b7af041754d35c642bc54897e900439d30fddacd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.3.tgz","fileCount":56,"unpackedSize":301837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8w3CRA9TVsSAnZWagAAlWIQAIDlXH5inILWacVpwDdh\nnAJx1Stay+UuJMWO2Lap9n9GRHSN8W5hUuVfeDJR9FGogYIaqpr7v0m7htlR\nIlbXlojnsqGfk0K/u3dwmlE+YublXTxyN2UVeyWj85XOw4mwRFEsXOx+huNC\ndepLd5Aa0jT999jFBYzQNcd46pSZp4ROzz/xw3Egk5c/3YB2eJqCZ1F60S5z\nYnG/TP/NFmSl4g2h1a5LcQ9XRyn4cibEol9prZBDsDRt1LXghPBKJ27HhDj9\nt9XxO6ijb/xgRKeqKAtQPjCkjENgyVZCfhapxx7AA1lNa2tcsIhL4DwSaI36\nyDoitgXi0ySAiWr+ERk7qqUINe1KpPsNi3c6Ar/47vYyWNNKpY3OQwUZrwj3\nGZoslP+F1yUwYJhp5OQhLOMkos4TCYdx37MOTIGTrDwlbppCHgcZSaVV8DQN\nSIn1eaytWN8VZQojiXmxX8ngeq5iODLxjIHBVMbmTrUaJgrcRLAulidQORO2\nH2rTopLFOtkNzbctLmFvnP54Ml6DA/PWS6OKaWWNt/6PSYviC0lz4sE710kL\nEEwKz6/JwkBhEzTUWLLYD2ME/+7npZGT6aFpWlCAeswak9ehRIqC1DqKDZU6\n5crVrbvp6HAKMCRTCfjz26i400PcPS4zSuXT9E8Y8VRG6Z77l4H7NSCWAE8+\n33Px\r\n=L9rV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtRU7pGXH7lOzOk1+kHcrDHian4yclnoPbz8Bry6SeyAIhAKgCJL34gl2XdKwtfkxmkXkgRLqc3luhHzZwBDsrw9ox"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.3_1612434486971_0.10340088464223274"},"_hasShrinkwrap":false},"6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-WI+LKzsqPKgwiSDqf/j76ZIG2K6YMbGvaw4GWv7BoqHVO2zWDCM2bkSoTeEJJRtsnhk6tU3dm0NHCTt2MxemDA==","shasum":"a6b0c5d067af6d365e558fb9b2c8f1e7669edd7c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0.tgz","fileCount":56,"unpackedSize":301880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8xRCRA9TVsSAnZWagAAz3gP/05zZM7JVExjWL65QL0g\nqmGwid+hvtN31OdMNA+MBiV2WJ9HAlRiGRq69AoFVmt6JLbmKvun6y9qL87j\n/ZuYTh2g16Gdozyp1GMky5VgnFGfpr+QjwXESyfQNAVOnYuz1kMk4CyABxQo\nKf12rNdJyfEb/jCWs8gC+HWXG59+uKqwI9C8nBSzTSxEbaaYUJh+37KNeQaL\nh9ZoSTc64lbSi+FALN97BTB8xO3k6W8OHnRwCR7HFru8bqR3nt5SbqEZD/gS\n4BlcIEgRoCemqWBoa7KA5vrJJ5VL1R/ZqMQatim9/5AmKSsTAwJW6QsJZuyq\neQ5kKjeBaEBt39YeLSBd9a3J2EsGq0OK8oU8Y75BUcagNgIcG9Ml3W7WgHBL\nOpUsX7q6JyDeo0TDnTw7gXWGSV/gUSpIxN6olMEie73AXmux0woF13BPZSjW\nQYORzHVT7eu97MCzUb+xiFXyjFlEQhbTlrIwgi/5f6nPFAiLogvWv7ucEaru\nBGxB4GHayb6EB1gOrY0OY9LYopTaf5wOHJk+XGmFxKlj01mn7j5iQSUa4qpo\nk0LhnLMszRqEP3AVHpGDeb9EoJ1a/T8gDgEtirTtndfGxu4J7JMp5CwY54y9\nc4WD9sXIIERtpp+3HnriGKwgiYQA9VNu1fMy6/3brwGNIU7M7V3nSIPplgNw\n4vSW\r\n=AlJ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGB/C8vm2iY+yJdSeOI0gUppACgX9mhDGCX1PBYZ1nh4AiEA3ekSEAH3fhxo+zZqCf+ni7q4ikB0FX0tD32Izgbf8eM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0_1612434513037_0.7281295341537242"},"_hasShrinkwrap":false},"6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.4","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0","gitHead":"41638ed2ba7df2d7417cd847aa7fa066e5193148","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-EAUi7dYRAei7/P2HaoNdwae/TYu1BmhTRPFZ1ziHfO9zA8YQeMHgIc4rL8Hmit52alVGERXNDlIfnKVie1uFNQ==","shasum":"9c7dd6be984e803fb5f8b8bcebfea2c990b2f3b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0.tgz","fileCount":56,"unpackedSize":301879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG8ydCRA9TVsSAnZWagAAFvcP/jYhbXbQX+yxumAe2Jb0\nUDWN6/Mw0d5L1mrwwi4yqw1tRX7G5Ac1iPHDIxVgSr1Ez6+74HPIyzA90Rn+\nZO4/BQGbKsRtsiK/YfVuyh/l29I9/qo7L+xiyO8/E3ZQGND+dP3snlEex58h\no65KsC3x0I0R5F6HKytvogNh3+DM+q/hLvjt0XUwlClvuIJv5m+Sa+fE/Bo1\np7+nIkwGhHJRyAj98Z/8FLRLLn29J9FpYKf9DqCgw64U+RwfiQEcu4BbDjuW\nW02j54XkcJHmMnAjkm3pzDUr0fKaYjr4cmUAd3+k6rm8OYzmxcQFntBq7AUp\nqWG3iIegD+jWKv7X2e8hczbwStWIE7BHkaMetTZeikPcxE1X9vN6o43Cfm9e\n/PoV+CDx/MBUD3CbhFV0zMBevb/JLCqhkd5B4w6kkdQe80VbfwY3qbhGepd+\nroV0+HIvpy5PEPt1pnz8XZO045rrMWBcSDBGurT+payBo0+k7qkE66RdhgBE\nnhc4wyOb7IQMZFuIrxJ3iFukxiNXU2TIUvFlhh6Frfr3n5JMrAGG0PJ1ybhg\nPnRY5Z81/LWZWeu4UnWaWZj03msuO+g7CJF9RVbT95G0o3inMpkGM9NoccUb\nUG0ebHhmRRY324TLHcQ5/kwNKAH6i1jhsF72BvTMt7IHsAqKVXLr+Huvp7+u\n4Dcw\r\n=n9Ud\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn1tT+ai6C69moC6VQQeCStHrBTYBhzZBW8BUOpCGChgIhAIizDphqufdd1d171GlrZ64xhcRhy5rhRafAVBdmCsYE"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0_1612434589315_0.6058642302215944"},"_hasShrinkwrap":false},"6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.7","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0","gitHead":"e157177d7d9511d89a829e37f053a7f202822a7d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0","_nodeVersion":"10.23.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-gaUmmBpSOonYc8jIbMhi2fvQ9qj4I6h5iKldGe2n04xx0d6GvNSvAtL1HKkjrVit696iP5xvDEbOKfDQMrec2A==","shasum":"8494af1bd9e701a57acb2becdee6085ae8e444d1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0.tgz","fileCount":56,"unpackedSize":301879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+IoCRA9TVsSAnZWagAA25wQAI8o2bxdB2scyeJvlkBi\nk64/h6Q7zhg64A7gkTnCI+xkTGO0d/kXnXmp08pH4abM7UiciDj+wPJOOWn3\nTOu8SaW8rAoFBpmdraxDV2KqZ3GUhcslJZSc7DnkrlQg1F6rkcZ7npwjv7ck\nHB9/xJe+vkKj4xdBbylwGPG65TUrnWkK1E/QSClzUjR5y17hx8MIbbUx8dFZ\nz4pnoNvT27clnXDG59GskZpqtCliD9DwholNi4yGeC+kxSB0U2fyTSocj2TC\n3p2zaRTt5c8DSvHTRtcXZt/ZTw4y9FbkaQTsUJ767Umk4UgdpsV7VI0qVz60\nylNLON73CDvrfbOPpJ8Kv6XAiYUdJXSa6EsQajahkztCrlZg+Xolvsg0NlDb\nA933Jeqj2ju3725UdBUVjLW52LS8XQAOov4DhMq6udetspV7EZWRMJ6nDzzW\ncIvt7rLJAE4nug1LvDlbJYOnZC7qZa6CwZU4dvphxsXjQ5wyyqehWPQNaZiW\nTlzvTJyHHdwmgfjEls5doG/4NgQVXiqzfa/qojdqIYfQ4SNKgcSccYp4gDs4\nr5xpSEjlEdGuaFVA9EV3X+uDEMhuLIRDP26Jyr0Uz+Bdu9EVCHITCWZxifWq\nwZ/US5holXdOTM7wWL7DABFDRfc4AZbl6n4ZckBpD5BCmBChNRuNIAF/ZShN\nTRqD\r\n=7Un+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSCU9cE/JCGFRTYTZict3Y4cdb34EsPBrn2mWZIt1yeAiEA1xdgTeXEMosRc7GEyHCNQkuinuZzwSwhHQkz/SWUQG4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0_1612440103857_0.7247890471234297"},"_hasShrinkwrap":false},"6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0","gitHead":"e10ccb63232cfe8a0d3c789fa55d534b0d61b728","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-HAKIgfMmbo8LmMmwtXXQs++n/ik3z5lJxe9axVAmf+4Bvd16UsIkDGY3Bjxz+1dHRIk0QbO6z4dKr1j/HeP5Yg==","shasum":"da467ca340217bf140e305fd6802f3ffae101c05","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0.tgz","fileCount":56,"unpackedSize":301880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+fYCRA9TVsSAnZWagAAOYsP/jLVMBERuaKKMX1Zv6gw\nsUuW7sFwPW/p8hHW54XOToa5Pg7LIJWsdf7Z8P3dfc369Z78mKHVkl/fae3l\nWKWwEdBc+A2gIajjQ/vI2K+kyPmwz/TXqO1MWRGdga9YHC2Y22ja/vYYlIUJ\nSeBfOXRNSPhRQdLFtiK0pub2/IwXevo11D5EdgWMm/8F9bUun/pTL0hB7hei\nQEkh5WPaMPXZpzbqB1rrMZaJ6yNT3FpUAgExMM46AT/beBPTZx5c+J+XJDC2\nQcLAHkRYvMpOC4Ivm08esV7KOZxyXK4MtToE0ZcXhDIe2UeaSofWMoc7ds2s\nS9IuzRIhJoNAOScddNKVkiiDZ8JuiMuGHm200VoK415sbc/ZtqJ9LhzPespE\ncPwLH70xaDmwrckndlJ3sMvzNwmBnHdLd0wPsUE1HpPd4iF5zs33/zM2eu4P\nQXoew9cslx3eaITy9ufYRfk/v1lk/h+kQQjIgjE5sRHYpiPa5bHbwC/WVxd8\nYxV0z2CEjzxZMcPz5jZ+BDarEfr8sI7TahzuszztSpCnGjlh3OGKClzjUqfk\nWycBhJcZXVzF080ycIhdcuw2Tj6JhrXzy3b95pCkcFeyFRhTY3CmiFuYYhIS\nMPd8CtbxGHx6d1/GtSreQXoEt0DewqeLwc+laJ5Igkv6YhE4lSNYk6ecqQtv\nl3JQ\r\n=yWyl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVRki7F+ROlyfcAOG14w6zpQnNUXuLcFAPCNIwLledBAiBm1o+kO5rYrJEstpKcAybvVsirpVdYKIExYLo98D+Vxg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0_1612441559052_0.5063007476830466"},"_hasShrinkwrap":false},"6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"67aa3c1bb06e18cb71908c586aabdf7ed6d4210e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qlNOThA9z2k7hfX7zwf4UT3RYH9Rf0s+tyg4EagXXIzJFvsg+yDX9WmbNkNQ4k1NfFVWnQERgPFZlF1ZoOaFSA==","shasum":"7c20b01455963f7a1aa5fd92d4240cd7f79f44a9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0.tgz","fileCount":56,"unpackedSize":301880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+kaCRA9TVsSAnZWagAAhmQP/RZmEicUcTt9L+8XmMhm\n/s6b/EWpry8iDB+RRARVv7VZ/AcCR2TsiyX68ye/jba4oM3Vp4ysiONnSOyB\ntA54TwXdNAHQieyqQzrsMT2sM4ekwOXgyFHzbPMvB3ti20+wzcZegUqv+3Ph\nYrqjszcTRnAnRxHyGPHqx25cTw6x83GEtu3zipH+cY9PeXJMqUKwBua4DiAl\nKtzyE5GX8+SC7CwFE5K1bTuoEHt9GTNfYTcyTwYeLSQuO7QCTtzeoRNeFQG2\n60udKs3GYAJ7OnBNXYGib7r2xGypTwWkdY6lvbslX0vKz+HdjpWjH7A2T9rX\n+g1ued5DtUiFXuZvOh5rGMmGvZcw1GkYHgjSnfvrbP2aaVd8qRXv2tI5ulmT\nq4Us9FvwkbhE7GjB+u6TyIK4W7IiQsjnDVVzrlow0ANaos1OU6P1VGcTHX2Y\nAJikOBIGkNKveBKwqk+o4SrV4kJV+OfdAgRnz/9s+p9+JdwZhCb/XLwCZDF1\nmQyxsKYjlbFojcDOJd+a1BkH4Q0UBSm1wRT/iIyHUssMKi1k8pS/BK5mVX6u\n16o7rrfGcSt5sMSUKl9gwHVQboNtDBZ3j90ZkZAoWQKoOjwLx1fhFsTiLomF\nwvwSk8o0N94UoJlcl1MTx5IzLmylALpKHfp6e6EIf1yceNYYcq5k9K42hi71\npZOD\r\n=8mB1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH80TIcFUZdVI4vDO9sxg8DcOryJPbzLb/fnRaORsanWAiAzpWXBZd/2USIM+2GoEvlEZt06HZpqGnO3vKwO8G4HYw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0_1612441881711_0.8428610253701758"},"_hasShrinkwrap":false},"6.6.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4","gitHead":"52d510e55a54cbe2892f04b7b4a110a9e4ca5175","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-tpamv9uNRaGGh44o1esbCi0+X0+qODqhb7LfWIQtAqXBWPASK+z10E86p5PqfPjASTsCPzoDU9KI4vGZDzOK2w==","shasum":"d2e825e0bced6cb6b5bbb74e98ea6816d4aa85af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4.tgz","fileCount":56,"unpackedSize":302095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+mVCRA9TVsSAnZWagAAqYYQAIPvO5KS3FAeGJJHRoDh\nS89LLvkD3K3IMhYXIyauwFNAwZ+B5ZOXbnwb46wUVyH/twu8pALxUf5sJRIE\nBgRZF9/Bc0/DwVVUj4KkRRuEH5z61jJt3oKnqPROV0D7E7XfRKDWsEvDal6g\n26aoPlSgDMfeRO4xrPMzzD+vxeBiStoA0IYKK957r3gpkG3uhIPxuL3o44LK\n7fqg46G/tHHlmFAqb8W6dFRviODxGbjk7hmKfxYw+K4sLMS+PK43omXA6BcM\nwmxDffBphgMpaVe0kHLByCMDHMFhZ9DitKK8T6LHLJfemT5w9w0MuNsVgPr5\nGDGs33fmkP+Wi4mFCaaGbLgCSMrhTrT7xdT64A8yc7sYL/npO36l1l0pFIQf\nAe6lBPQjtXWjVmyDAh5Z87WYBN5cFgC7xnKWMB9Sj2ifsntCkANEwW5Yiohs\nYxA7V3J9OBHl/4VvvPyUQh0Ppx2GU1s3f92h+AwJ/vk/36+HTn/ZeE4TBo3R\n0iB2sXmltt0/B/3M7GUA0dtKY7zTfBz8qn13k5mcSMcP1YTjF+ZytRE8wm7h\nmnJYzvou3UikoEbmXxCr4phGV9seuDyGPhpcpZhrVONXFwsPlUJNuUpWCHgp\n/+I6CAOUdio9n3jQ9gSsYQN6QR1f00Tya+rjSebcWtsBd4jyiLtU6I2RMSyd\n5LEo\r\n=CSFb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8A7+nllGPhvFoyP1AFsrTSUn+3x1ld8Ry2SDw6b2YTwIhAM16pNLUP0uYPf0U5jmvHSbIqktrhWWPnSvWvujx+Qg0"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4_1612442005031_0.893576127956434"},"_hasShrinkwrap":false},"6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0","gitHead":"a1c46da32b082c1e5b6c54f63c8e2c5e49454a35","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jDeDcyPu6aq95nW4KoGu10YCcU+uKM5RuLwAZoBEeOFUQF58VZAX6BYLkDN2D43iGIV5yhncQIPbKPIX8o1UwA==","shasum":"da453307a38c1f1676d563cd46a20b0c6af8f58d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0.tgz","fileCount":56,"unpackedSize":301880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+onCRA9TVsSAnZWagAAu2MP/R9usFCs/V+g1KAcTzbk\nmHlXahmBra2En0aCKrhIi3/FmyL17qKNi0Eqww4Hv//2qvAU2BEnsOAjw3xx\nmwWmk3BXP9SvtE/Lsjg4nOqiBAFjlFdoHPe75v3eOyMxwAdx7SkQYmL2bUA+\nIPW25w0ex0fu5O5tl0rBC08WsLMqxne6JmJR3/aWxOg//JlHwEqyf4jvVB3V\nvFDRKk734G8PrUpned58sWes7B/0JdMRq6HBYIECVjGY7ET1Rik6kX6E5NNR\nRfun7ALWf0rE8eTKDppicj8drB8R1QGD8SYtAAZHIf9hqJbi8b2vvgzVjOn4\nTnpIxiU8YcVeTklzXVdgpGDebA4ttVZnAjgQO9lX+R4cH1a56hxiqeji0AiK\nsl4lLHBY34xsN95S2KDvYKQkQYzLp+plzoJVNZoBHZIlUfgYTRXAq+pbJoF2\naz7anNjF6zNAKVyOy6LWsmYn96sPYhg+Qd3c+WYHgwzKISbBdL6fX1gFsjfl\n5yxAM/ksasGe0apyOur915jTMDdf3LJmGqBCctvUUL8TzLJpo7P6L56+0Id8\n4kDIMtM7Qh2ecHb1+4rTnMB5yOl6gWywIdnKP/88KhE3gugmGgTCp53psqUz\nZM9Eyj27WIfKXQPmWTyo1/pgIsGNN9FjBEMpMK4x5H88ul5EtuzM2RItBEEO\nBj1S\r\n=DhZQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICP8Ml0PJ2UAQ6RJbwgeWfaN2Abrr3uTO1R9tyXA7jDiAiAYvHnXkiNiTW3K4MfwsjLDxh7SiRVxIuBKDOTzpFEvbA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0_1612442150489_0.503803361646554"},"_hasShrinkwrap":false},"6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.36","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0","gitHead":"fb0ae478b907d182022afb1c6d2f7a2fddb93ae5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-KpsOtvgrY9pu57xQ4DFFyw5pLuzHmFaw5nkWkPYnafoW0u56gd8ofsFdZ0j17pOZjKIoyaalJ/DgA43CFjunzQ==","shasum":"db528601da33b6806b89b14a4bfde6089ceeb352","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0.tgz","fileCount":56,"unpackedSize":301880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+rzCRA9TVsSAnZWagAAIs0P/0LRDqkIbwgjEVZweU4x\nZl7j/l0fA5/VErIbjHHc4QJirWIPQzOGt/ZCpcNhBxOouZl5jlHVpGUpbTP3\nkvmacAnxDJECK2xXhWXx0CIIkVWRBKsB2OsbP0BD7LBMQAkYnLjhLiSi2JU2\nBMf7FGXzSQ03PvQn4edikT6zRbgGQi88r8gRNrTtqCparkUCWRdPpJNctyf1\nr/aQVevGlfTx36bqvz9+bS4U3exj5ALhoyuCK/pfWhkPJF4bGmbnO8l/TtM4\nz6yi2NkhIIKBXaIVh3vNFRLnPa56/1CHTOS53zPSwIRPmpud9LVcFy1arJSG\nRP7np+XEwBc2UXLmP1ZR7VfMW+zzTS+CEd9NFMwQyFCowo2W+Jlz+jsU6G7J\n1hpaof9cGlGwXF5B+wKLKip6bS0eQXVVmAJTAd74ftMrB1WHUJOneADIvazk\nfPjGqsuCmIwb91VXLYFqFtkAdRUnd9MxLwoKYA/AcVVP0R32gun7Ia/GkPzs\n3OcE2hUJkiTipSBIFCaKjfGg21CpgKLzSIOF+oNWOd1RENEE7+rxjadYbzSh\nYwmwf4atvKFSBWWU/N2HEGPryLH+fZqbTiginzpg7pLbkwChyP7GtgylqSS5\nhPxTHajykdC7HEvYG9Cbza4BKdinINZ2JIqW7h16XyDTYuv+cq1FCbFu431h\nEoY5\r\n=7cvD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsXY+M03fiPZjF796j/QHm2tEag0TSjq0D9d5OHLLSSAiAkALN5ta+Zps1NHNUiEvtdXgsUZv3j+aRy92pkZ3HGNw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0_1612442354600_0.14219139368287093"},"_hasShrinkwrap":false},"6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"52d510e55a54cbe2892f04b7b4a110a9e4ca5175","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ofJ9Bcvx5jSznp+c8QEhqfLSnPyHx0dFalOGnyAsdtGqZd0SYLHCrKMFN9coh5ga9wMRtS4lniduhwTQnWYopA==","shasum":"e93e4feed66c300451dd8a78b900b318e3823ec9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+tqCRA9TVsSAnZWagAAY2oP/1fpTcBzEjIaZP5mgrmp\npK1zBh2tXVuYCdsEr6e1SwO3QAbmaFB7NzqrMsMKuS65fBeyZi3U2IIWdlbI\nDdqjyFuo4LQGGdI8ddJPuM+jNKj3iVC7Xci+uFiabV4zKulUWE/l519gdgr4\nShYxr+d1XH+XDzuIcLm7YxMtl5wwGEALejrwbBrx4SkmgufDuoCGzsTz+iiA\n7GvAMBk/HPv4l+KQVXc7/AceCTp3Rd7ydUQWgEXp0nwuCeNm3nO9lDzcmrQi\n6jRXWm2S53OryopzAvnA+bAvjkEVCyTxyBKxT/bYfrHZRt8lPzgAFpUtOMX4\n8PRRLE9AL6n6lSbAccDJMCK14ufrdsEvnA0h30g5ReYV0oasP1n7dsB2dprz\n+S3AuZb+DS4pQmWlpdjkXrEfzq9d8B9P8BM8Lp7B0WKWcRPt0IOw1ILjCiH7\nUPvsFxufpKdU/+JvGygrPMitVSVkwiXQKSGqmCrUadPdzxLNYqs+wq131N2J\nmEJN32qQUl+biovdKIId5v9B32ALzBshwGxMxS/GihkCavAAt3qGo9aAWajF\nwX+oPEnYwQyInsyAC9Ejy3LUNI3SNsb2QGqphigeUtj0+2bz+QB/O2tB0OBo\n9hR20/G5O42CPNm4MgknoXrX/44NNUOxKHvNLIu9S/wYR7y335B2q8OhOMCP\nGe/m\r\n=z7Tb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1F9c3uTcws/B0zBSKGs9X5KYkM3RMi5CfGKIqH4hLzAiAg9v2OH04rm4bkbENCTkBPkGWN/cw2O0+AMMDQRRnqgw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0_1612442474284_0.18789171960597506"},"_hasShrinkwrap":false},"6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0","gitHead":"390c19c45760ee8d0dd05c3855c5da384d8a13f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fTlLKTSQ9S7ZP+MAdq8WXwcTTtFLL/LhcWvwepuj/nnTMVznbkrfTaPSH+swFO5T9IPh0kfjSRYuK3I1YOluYg==","shasum":"dc66d09cdcc64353ea115401a78715d50c0c8e37","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+upCRA9TVsSAnZWagAANsMP+wZmJbEZSalJ9IeISc56\nO2uqjXytliJOpvakcm1Wy2sSJaFOm6w65zx/0P54qbCYCV9BFYpeU2rQ5bWI\ndMqM/J5pMwSixkIUsIhrupwGFV3UoLljjppmdNgCMcaPiBNLDCGlVkEqqMnh\nb+E8kpShGXqIQj2zycYh58uqMeUgufin9XcF9xxOiHs7SrtR3tU3ulRxIu6Z\no3RFkfQ0DJkv4J0tLazT+2pYgB9oqv3oXGHEDIpBfcSNREK7l9nzlHzgceU7\n2JhZWUqZKNIg8EPosfZRdn78KIi7GppnjVTZ/2Q0hWQchvUnNHTSsptPDJvM\nbK/KeOKHG+vphv/CMA/2EWqTiQ94iM/w0WbfO5AwzPtWwvIuRWeG1wojFMXd\nilgpjv5Al8DmLUGtO8bvQTNDFnO/poGRYxDDce2puSxceBmohkObYZjvauOY\nrtrSYqFZ+6+L9h5p6kRr5/GljekIedOZJ9hgHA1O7NbFGyo43BbROrl4XI5p\n6WSSb8wUOBsTNxepizEHn+ZYzYtIQZnO3uK7E2JSPJ+gvYS908x6AOcsdtgz\nXfItB3EC3cP42FAntint8D2UWQcGhHwH2wA4/gtqsZguFGgdtcqh3LAGlf5t\ns7cDt6ggrovXo9US57tMBrLB3twjcYRrX2gTba5f7EZpJQqcitQxUYqIju21\n0dId\r\n=pgG1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC71x5o7Fg41XsJ4BwTWrgzMIg3ZQpN8W35iMtHwU70YgIgf/8NIVUcIO27VatGgOu+NA9j7EVvPjRINX1beaSp9Ko="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0_1612442537193_0.3267860195658938"},"_hasShrinkwrap":false},"6.6.5-9e6067445cda872559e3ace8892d35053af29482.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.36","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-9e6067445cda872559e3ace8892d35053af29482.0","gitHead":"9e6067445cda872559e3ace8892d35053af29482","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-9e6067445cda872559e3ace8892d35053af29482.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-a6eNsuCWkARs+qwY+4mc12jRHZhk+y+ldwCcwDeb4d8vjEgJWKbb7sZRARen6gAkuP00yxFDtwd2a+VeHGNI7g==","shasum":"776cc217bc571e43ccf8fd1151bfb1b9a520997d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-9e6067445cda872559e3ace8892d35053af29482.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG+vQCRA9TVsSAnZWagAALIAP+QHAnwZu0goiPdzTg6Ax\n2Mme/iO0ue1xybZjfkddZlxqYq9b4U/x2lQDmcykulbxx3bMKtqDYwowpYv9\ng29Qo0RzsF/sJCGHeyTXqCjO72HzURaJMKA78I5GyPK5WNTDLPSW9wk6/672\nkanVAk14qsl+w6EER3A2WN3c+kcAddT8qobWRUpvPzzCLvDmVsbr9L+CDN78\nOqr7IG+6xIxsVTRcxhgBHmiVHN5W4OuzN/C7cCPIXDSH7jX6jZSqyPJXl4mZ\nig4msm0TPugLaMVsMXCtMNblm5H5vGdoySaTd3ru6MKV7Mxm8HG8Isd3ibOr\nYHmu+yhRP1XPhj8LGqZdKYdYYy9ZvuPnrbF3RvD56QwTU15v+x5U+ovPquyt\ngY6Te89qhlCOcZGrBFWiAuhhIhGsLjaVA8btwIwQgWDL0o5bTDba8a4PBvCT\n776pNvrp4avewwTT6OaPn5DpPduScDE7IBQ/dQyDQfGxpJh8Re8rbOu/Rh3X\nC6qW1qgEL7u1glqD0o58HywzT520fa5AgIoobETrCtk6V7Ofcxr0U5p+8OD9\nL1wJkEus7SsHEn7zHtJJQRu+DXEIRt7nBNGSXKpb9OULViRK7N83cfF94k+z\nm0lVWXoL0R1f8ezRvq8WElI6KFHsbSp4qxlSpL3TKPJAuLFgSx9vhwc1Od80\nTYBS\r\n=+aRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMUZfd0U0uMSrHX/UBzzj1Izn72ZtsESHuUSnvSARQ4AIhAJUgMJPnlaNCML/PvUb2jfoVLnmSVIf8IGXOpnj47mFB"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-9e6067445cda872559e3ace8892d35053af29482.0_1612442575791_0.5339777931367513"},"_hasShrinkwrap":false},"6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0","gitHead":"11f5805259a0893b48921fbdf10c12ed54fdffd0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-gM0oaFAwlFifqueLr3MPzPAuuHOaWknKXMixuK9cjrjKvpkIc+UgHUeJZev88HHnF8nWHhID5hv5iRJSVoj/Lw==","shasum":"f8e823736c75ae0d623be0e6ece91e1719de2619","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgINI+CRA9TVsSAnZWagAAAbIP/23Ht0JGrPjB6kZKPSAh\npU6mDrCoNmkWgqK7RfF7ASR2e+2fduxJah/yc2ObgfwRXbt7qgIq1MjV86cf\nxKLA89OSGAq4Ya9BdBg3nggMsCaS2kHbITKP7Uv9a9iNbUMRr1kuKmKRJPUZ\n8KuRK0UR6J/HajnWhET4hQOo5GTEabgDAhRJVamYzaxtsUz5Cu/0uWHuwWyq\nfTo83Il84Rs3QUq3ZpTw03U3Uht5xaS22wKxhaS7iPwnLvODiqlt+nEPcMet\njNSuBXtkLJmnIrpkqpcQAXgAPaVXZDihy42wRmVoNekaQS4joAOywGqCukCU\n7hrxJzi6dCB78QE+2MCSiTF/G9/tROm51bh7H/012xnXXbv7OoPke8+v0hA3\nyilyt2cQCesK1jj0XhCKIuIqBwFvQ9PNbTBNRTwWbX1bFaK81ZvY3EpH6USY\nYrPXn1uYOMSZcuJdNtmFsH+V+D9d6Prr1nCd9rSMPFGpIdFakK60xT/GSNS6\nfONVaaeP5eezyqsONgPiGPifcKQUtYac83N6ztazm+Qng7c5ixtE+8qMf1J6\ndIReLrwxtR6pSype6LhzM1LYSYTHyvoHZ28cSSmV8L+OQPWsCWynm5383ePt\nGjNYmHXL05mP4VllAKYOsm76GG4eH9bRef0KWvag3TI1Fb5GYxVAJSh8gCAI\nj1tb\r\n=JBUr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvcTFFpN1bUkGr35tGRFRPiR1qxkcGxr8HNIesizRrvAIgFYXy3O9lmkFCaRWqSQoE5VqCt7+7MRajOayJVjmWC4s="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0_1612763709814_0.9197513874388641"},"_hasShrinkwrap":false},"6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0","gitHead":"e45fa552455d38ba9903bbc38fe7b3af7194ff92","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-yHO3PSk2AVAvZwv4EUhZQFu56vpsdzpmbTnpw0J7/T74TmHVETBMWdmh5Kp8HtXuUq9fmYcj30yJGsdFhpD9eQ==","shasum":"0399472c6971d218c444860962e3ff8569cb105e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgINJaCRA9TVsSAnZWagAA82YP/3A/+em8L/C6GeyHI8g4\ndN5LZZwnJAxR5Dt4DzTBeCkAmrgTm4FWaWKB6vmqk8u1U49rbqu0gSX+O3Ew\n/wz+lJ9xnjQZS+h5p1AazLz/O+LZr8vPAo+pfhCNgXDOv7YJ82yd3Km+PzZq\nVsVLMRt5fh9YXEOOt2nLnCut9IcPB7T2vrllLZddg69rL4sPc3HO3BupH65E\nBXfNC9wmH/x/2N8sCOjI3aEXtQ6QcooBPwHHUCIzwmjjjPqdWnY57XvFzC/6\nPoCMwqmxPvKxixSosF1ldQT3X9Fl5aO55hQ2VCL8yIIvEk3W2KQ8j34IxyuT\nAgwH1QJjVF66zk+t17BTwulz4gxXh0k3dUdHDXhtD0zrlqEGOebmfC/MfMFP\nH2AHJwCfCRw7NkQ4WojZmLMBK1Szex7/ab6LelKrBgCmKXIspKIujnBAUVK0\nhibl1pPjw7mBbHqIj+Ry39weSD18jZABhcB0SFNeN4Fw3Sj21v6Wi/BmKGkj\nai6bTFhu0bP5xDD7ol/eRXDV8mBrCvTrBKT9C3C/YKjoAMqSILDJ8PHI96U5\nnG8uRZniv8LEhtTe7pBiNIxXSJ5zm7dn1k3bxeHunJPm/msCTdl7vqvx+/9C\nHvGrT8ge9MhvMBy70VZ5AcWc/LHSWSX+drHbwL3PyUmN9OlxY913csC3GJgv\nkhW7\r\n=bC3c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0yGt1UpcCwCKDvtAoZjyOu/xzKvcL5FAIIO6TpZxq7AiEAgo6wVSmEAAHC6sVRbQbeAU8N2kZDFLJ62+ZtyemXMmQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0_1612763738258_0.8675946231921272"},"_hasShrinkwrap":false},"6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.8","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0","gitHead":"8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-92bXdvcprGWaclo/42PUNB7LiD33L/YGps522CD3OqKG0ROCylszBAGZn1x7gr2s2smE5xJCTdKIl1W+UpPRZQ==","shasum":"33e1d504e8b6b393fced74781e0216f2fa97259a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0.tgz","fileCount":56,"unpackedSize":302137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgINL0CRA9TVsSAnZWagAAodgP/20jh7hcN7/K1kBUrR/d\nyT3T9a9+mX1rlhehtSLMsClSUEbosHBg26wPnizgPnPXX+2UP+sOoMByD8VT\nJRqGCUBvYs59eM7a5N//6yt4iNfilceKPh/uWKNelE2KHY77eqp5QF8vwE4H\nN65NU1TELcEOzlFhNthOjrGUWQXiF3ODaOnU+FRElX4vuRtDGS+YNO+I6KT5\ntIG7Gwytv7/rQOEc39yDjUd9BGRtMFl0Dm8zqJZ6/s2rWWtU1ZRld+o21r+D\n60ZfuJnMygb+0TDyerY6KOAQVM9htl8/AThJKCqKOjsZBf0xU6Ssob7piLAP\nAMmRlSPYWSFJZyabhh43+UKvyuzaaOiberMnaqG7P0cqZSo4vr7iXAKPCbOz\nZsuU9JQdnxjtOpmwdvIGNupUT4nr57ObN+iuYhsSEU2AMfEJY0Lgrm+Sd+x3\n8gAZcDspKNRuH5p8S6dsLrmKYmtzicp/H9sxfYlV9b/iIxInoxJZObXMXltx\nGQOJd2vp9MBB2F0NGVAGJ0WxbRh6GBJD9OGbpNyuxaalQoNOWGWQhbcTeLcE\nhl+t7NGjdFrr8F+X0d/n+paOMgsY2v4avajBKAYVyGeJ45n9umKEiRO4AIpZ\nKa+DkXaDgmBhs9JlD0fiD08VqK4HNU06iURZYpC8F/ASsRIlJgNqgBvTnZg4\nCgC6\r\n=QfJt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdJDiHf3tCfR/VMC03gEygtSFEk68F9Qu1VIS0qWLOmQIhAIM7aMTI+bwSqkYQE9O4lc3Q8YQD1hKqO6DjZTqOJvht"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0_1612763892310_0.7210264439974952"},"_hasShrinkwrap":false},"6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0","gitHead":"4f672ee6164ce316b57fb3484e625cc7326980f7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Mwt/zUNcHsdzy5CchgpgINFQkcQF33k9VwK5lmuY/ZUDhy/v/zvk7U+ZwzXpKLslGIV8MadQc0yjB7fl0i3MjA==","shasum":"8eb52e4821015b20bf059331e70ffb60ac2f0239","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIPGlCRA9TVsSAnZWagAAJz0P/iYjQevoK6n3pAa3AycT\nWNw9JiQ4drSH+1MjmmBEH2ABXAmPywx+c0Im2szjKIyS0pIc+Dcm+HWDS8Cb\nNFOPlHha+FhQhBKLhv3jUM7/fMn98+nE4TqrQzggUppTHb6jlWLJE7/r6qW1\n8DVnrLXfaMHzFfqDbUNC6xmoTHv/QxIITa1UCr09ttKil/v4moEv7OBTcNYM\nDg9O0zRFVJebj1TpxyBMk6voDqsJ77Sy0cQGcI/eXnxbw8b7GJXw65UpDnnD\nIWRmEcFoTUKkKLxL9UMbF9cByrdPxqZHiGneOq1m1mxlwkAf2QBXHsS1gfV2\nvKwigevWs09MkTBwquNXnewI+1zFax0cu76bhyIiFPVV8ALcu7tYcv7YNPzP\n8q32CzYTge6o9MVYO1pf77Go1vgwB9oUbdMTyvprnQsvF12cFIwcrzpIjLX7\nTdNLJXwmMoyCoxgq/NMYolSPijzLkdigEC+qv1EoykHsEZS6+zReYx+mR0i8\nzlnAZ8V6lGobN3G4+wMl2tfOIPRsckwjOF7HDP79OwrErTxwdyMWXr1OS2pe\nw3pWPpBfPdnuQeJcyoz0ZHCWxmwQLLDYW2Pw96ws8bu4fpC1bQJT7OG8gHTJ\nKEMiQnjDQ5IR70ohMAToQdSFaf7xbbQk7sjKX1OCi2dNdQ7mAMq4UR3dO15E\ncNHu\r\n=ldu+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdfUfqlqnUQTiz6o44kt7OxFQLS2bTA61KGsdqPmBEdAiEAjWE8JO0Uop56tdjmUEW/aEWMma4gPlvlSk+dKsNbmqY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0_1612771749148_0.011416400299936624"},"_hasShrinkwrap":false},"6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.10","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.8","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0","gitHead":"7642b167186541bec987ccf73250f85fddc1c31a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RydFppTWfszAYHKB+UAxZ5BxgbTGJxX/WosWdOKFGwcWfDfRAGgI3/OQKEgkgZ+nExAV6tBG6XAejMeZIG0/0w==","shasum":"bb6b7a05f9abbb5f40d8afd4abbdd86aac761c8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIh8bCRA9TVsSAnZWagAA9JIP/2Z42zWQGr+D9pCScTq1\nz6l/6lgU+O7DReaWtNTCtU0jPs2mHHqLT1RJWGR2OYkhC2ov8HTsYzLm2E/M\nB9fzX0Ujjk7vyGGtOHQl56lYTOeO/17OcexoCHY6SCamW1V9vc/ITWwFzTOy\n3msrEmrkEkTquNbHMz2kivayc2/ZLdVD5P4nU2ljbFAAjwbI/9HzjAqAyGLG\ndiino30KZ/x6XjC+Tt3mDOQGXQBj/pfPAEY6sNJvPGND2Jesxe5BjMj/U9Od\nv3KnxEmAb3CQoPIwUyTFhySXd5j4Jxym7qqrix5WnzpcsRXRknWDg5BbeeIU\n7w/Lc5ifP5DmvvcN7ygSsm7Aoz8H3mIQtR9vETvnO+I69pQfh4D1c4cuGfU4\nfMzoj/ulfRFqCkrjVNKceWiIRLchksUcTxV2hO+soE7eqGKZivrN1Vj66FLh\nWeVuuxzi3yP7m2YD+swmDxlS0CzUJNB8iY7foqAAFp5dzB/JHgNY7JFm69iY\nGyPzfPVdGC8R05z5KLIKtL2WnBxwSfp3XipnkYj1FIyRvp4kg8f3LBgDeLNu\nlIQRXNws8MR3LldXIRtVGPeHVEmaHoSKFmYc1a3HK6MPdpfukDeBmgzWHVod\ny5fi9flhoyx0sEqF3BCwspVHH/TsbLf+7M7JdiFfU0BD/u3jgLZLcyLqoX1H\ntBlg\r\n=Va1x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDepNKJzeaJ7wbI044ckg+x3tthUInQQQAZsDj/fkF6BAiB0UGwP9IAyDQXioiZmUN6UaNLW9LHAwtqF8n1nkmV9ow=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0_1612848922567_0.7969190317217854"},"_hasShrinkwrap":false},"6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0","gitHead":"15969d3e7759bff55cd16fec2f46f4fbb38872c5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-NmTJ/rO8dLOfosDjQ95NY204iyVz3+L7XGtO8Lt1le63T4CjgAH1zYAADdXDZS/r2v5rHo8auKcfKqF6g7MXNg==","shasum":"0a83177b6741131b9f941d1a19c2e1ec03296c99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIh9BCRA9TVsSAnZWagAA0XUQAIBlE3qnfWQAh3Os/bNu\nL+B2cscjgTCJd8tQtc6J/Hv7+VMbSZLnNtYk5W+rvCiKIrawmdRXofkCB1PV\n2k/fzpdtOIlRkBEzgpnlnzMD9CjzxdIxcxgiyprExKOIGdkAuYFKPNNBHBi+\n4gkazB06dI06QtFbQSzONBobKl/uNz/WtWP23aB3uibrHuvXuEOb0/qlTqaW\nqvhjh6pGu9yrEPeuhOPT/rWBO22VCPwiQyNVItuO2zYKn7YcMge/QhlVIHa6\nLJ+lAD3e/3DY3eYk8OY3w1Qxfpix9jeNry06iMeNfzEI8QTId6w4Uwx9BPux\nFlMVeFe0zaVJ/Veacrru0OS4ygkyWT0EaMTLHITO30tx1RAiDEjgcnhWHMcI\nEgISB0B81JyD8XrmHiPhFUF4qx6ASpKhouFeFuCMq6/fI3ovin31BafEWBQ3\ncD9q8RvKL/7LhxrisBGa0c8UsKUGCt+B5Za8vbtcmPjKJIo7wXZDEUZAE6L9\nhlCt3pY2WOjUztAJauhLf/DfwNsDQ242gP1E97svRQSOyMjXdDbFiJA+pJXT\n7sijM0JeQb7IEUFUcFZH2Ew14K/CFNexqGjoV9tV5nxh1bdIOXpwv6EyoyVr\nGzCPAVAbCIop9hdf0lS17Rp2NHmaLdWlGrXUxHn4YwFrk7qGPmJaN9jdzHLY\nDAbD\r\n=85h/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTDEM9xgwhZqebFszjbwRZoPW/1nIFYCGgUy+h/cdlrgIhAMHscdyZCMYQJADwhOmABswyWbLnvcq04JvI0yT4YoTA"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0_1612848960578_0.7944533856403635"},"_hasShrinkwrap":false},"6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"43d899159c8a7c42ab7f96de10711c76f68ce43c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-8PK6E62pT6hOSAZrjQlrc4BWlEOt/C+nfUc3NSSpsQobJNNS4li6zGevYKNnxC9z9hqF2Pol/VYom2oQBzVFOw==","shasum":"46b534f6b122162506bb84cf2284bdeffb69f43a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0.tgz","fileCount":56,"unpackedSize":302138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIh+cCRA9TVsSAnZWagAAXB8P/3v0AANTCUCFKFEQhedP\naAtZSsyhreQONBCOdXqe+/ihUylHWEXo56X8usCa3uJdLo4/kAMcL+I5ye+l\nb0Faf1hmD/WLprz8aSV95Hqt1QF544ya/AgHmp8OdBtQYgZ6zUyxk9Xr/uK7\nycDKnDWoOyW/ntMBtyFK1BJNnKR4SFgXWcYPpEfpiwMPPOT44S/eV4BADEmd\naTnkOtOS+sf8AMJ9yIVEoSfAmELyBql+hQ0BkGtmBWfsS6joABPZfTxCdny+\n82SF2zwACLS76bIwnjphxZ8t4DEKip5Dryz0g5DBVJcJxEL4tFDnvb3UzJ35\npvacEYh8PSJNnLk7tm31GASmhFN5cTAlyhmk4VLpdIShhILIBCBtHqhQmZNR\ng3ObbSNQQWTGR0MR0BypumeHE5rt6oygcQAQj5Xs2CwXvpN0ZpjdCRUG/NhE\nLLh3hdbVxUOMaC3+AxsH+TBIWyF2tlfIUcOpdXGFvktVjfNRmJflCCPBGS6K\nN0Pugwz+97cem4wx+1zUHKa1rp3ZqcCI5u+UxW1wEIE0qjPem8HZZT4zd/yk\ndDJDkiYEPin/um7l8iA4RbVWn/mLrYCsorH8R+xCJ7iHrHVqRROpIOI5e9NH\nGlcHWQmESjCUtxeLrh1upCHrmhHHCojMfr1TQQvfI7EJvjeTZw/vCccNuDkv\nq1Li\r\n=ta2A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAV26yA0t/xjEW+UYX6sbitjTmhVRT917+siTQjYon+zAiBfpG8JfW2wjN67/1a8hU2XCiMedIwq5VAlCLcw9lzZcg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0_1612849051083_0.6860109087656223"},"_hasShrinkwrap":false},"6.6.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.5","gitHead":"66a5b3afe18a704aedcb3fe92546e667f82d7767","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.5","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Rt9e+I/gvLYrOC+CTeo85w1ZtuCRm1435H85ji8ShFo6R8+QyKSM6qvCWLfQ6R1GV0lebLDCT03E4gcKv4y/QA==","shasum":"f35a54097cf405295f22f8de30ad658b564906af","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.5.tgz","fileCount":56,"unpackedSize":302366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIh+1CRA9TVsSAnZWagAAkn8QAJvs7mSU2v/Ha5WpUB0E\nh/w/4pJ/JF1lgkHQgKs8u42J+SOkvMHvgDFq7pR2zPvo+r7oGXEmDXwa6krC\nz5v0QChxAyo2sMmp/v0p8AkQPBuDmeYPlN1OGaA+NWfFDoiMeUU1XxfmJJ00\nLanI8LCZ/jjhDewZTHRWLBFh+PHE452dSj5ADGf/+i+/ZTSCvU0rYOEk9B2W\nkViNsuWWmsA966s7ep8NOtsvQVwTRisQbp3pVt4xdL6PQlStWtTNlviXbqbl\nvF0V+Pi/Wz1YR+7eHAlb7c1ZFccgYCbhR6lm4+saxypwmr9WdpexK8gfDtGo\nnBySLUoQ76AyFW8VwyPOomdH7XRrCmlnierQcU8h3f1nuz8M1C6W3Wq5GY7Z\nmZVWdPH0K/abJFYYsrl32Uz6et0XSN1Tkl6JVnzBamsxI6+kiMXfpI31WLTl\ngthWYjdaJBjR6JDDk7dZ1FYQ+X+3SitY5aP81T5kNprRkz2mENsv4epL/aLB\n7fEP85yMEZeOBzZmfpAO8Qw+pMW2DX/c58F6/biDYyKUzyeY+SBeHWaTAerl\nB1VNNYffKg4Zbh6dTahVN++bsuUsC9QRmUlAdvNf0KL2CDzNalXQ0yVUkcpK\nSsVbFeme7oiGNhG1uzbgFgxfiH9i2Mn8Fwh8Vkdt8gUJzMpiT+nqawb9xMt5\nUco5\r\n=xWS8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgMj8MMH98+xHY12hnCCHTSQ8zlWDsW9A1pNHnmH+MxAIhAI2llbDVLFbR193d5dL3PaLBqcmOx+XwzziQqpMSOfbW"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.5_1612849076989_0.6513014530230743"},"_hasShrinkwrap":false},"6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.3","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"66a5b3afe18a704aedcb3fe92546e667f82d7767","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-hk3V3Gihd0ZBPWzYHwgksl2Dkk2f5Z+BjiVAvp6UGaygxebAzlcbADc00W17lJ2rzg/2LKwdj59iwbM15RpfJg==","shasum":"ceb4a88b284974a6626d7d84521b217ee387dcd9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0.tgz","fileCount":56,"unpackedSize":302409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIh/aCRA9TVsSAnZWagAAGB4P/A5TuOMYYXj1HATUMNrW\nI2nv1Yf+wA+mAw45r2yihjMEvvYwRUSk0WAsg6Tv5rQAviqxjRsKv2wDcf0p\nMLbox0Bg6EE4Bz3M5h1LtLFX8aTfUxYmOjY+6Tu1m3o0HcFom5pbPLSw3IpC\nlahULpwNcjv7MIV4SEIKIV6Q6FBaD0xyQ5mpTH39X+Dnq9gD50yEurDt+smn\n1Y9FckmFNmERP/OI0ZVHqkGBzshgre7ocap+FwKchLH38cfFW5L4FsnIoQp0\nuYZvL1lf0CK6JZoRNii95Htn2QBz9JhKYdYKqKsnzzrTYBrL8shYLp6GYhPn\nVwZHnorDMkPlw5tKOSv+IYzCaZyr3j4utP3bwaoXvKFaA0taQT4Cf8KCxkPG\nbJKpDFNHpSr/LO50HfNl6BmsPF8UDaeo9GdirX7CPMDXFNXEFerA+jAusRAq\nUmMxo9TL0KEgvCz4Hxi/uy5w2kwx3UftrFYCJWMzPHW8Ofj1sY8Josozw2iy\nXFYDLdnx/DDiovnSwyqGJonA9hP33bMqKH5NBq8/n7JFEaGwVwrX873cFOXD\nVBMdVPEeqnCdWd+BnhERX3Z+lXZQXrE87WkeR2v7ZQp8gwm/ajgOCCSKWpcE\nrWNpEmMRGqVKx3BDCZVikZDipvwK7ef7GVEJOLtCGUGcJPKILod8e4iQdm5F\nzFCE\r\n=VNcm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRALpAYei9qPFb8b5Ymkdp5X0EaDm3OgaHRGF3DZcFsAiEA8IsHlCYPvH0AkVDYiDv7Cv8SqLBDDfpS2D2KH3SpOoI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0_1612849113466_0.2087515644833191"},"_hasShrinkwrap":false},"6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0","gitHead":"20f324fa008a23199ea086df506c4ee37066c5be","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-zIgKt7UNCWOJhqf40lUaTTZVbAhHXrf+topjGB+WbFdMdrWQOEeAqzMXQPAlhCAKcht6ltV3vsjXGcso5x0jqg==","shasum":"58e468e00850b5441763dc1a8afac407203d3fb9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0.tgz","fileCount":56,"unpackedSize":302409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjZvCRA9TVsSAnZWagAAZHIP/2RTXZ5m0HxcKuoePiKo\nL9v1l1R6Z4fqC9QK7+Av1xexqfHJjUuX4z2lNA5g1UYmcJeUw+nMLi0aNTal\nTeuAtVWyNETRKpBRpP4+RQntf4vk7x7vFNHTHcUWGp5fCJXA7DpvPF7utTpY\nczMn98Vd2/UxvW4jXytAqXXxrOSilHfOEneE+KjgAbVfdrpJkQxrJL726cro\nL0mINjDB4ElVAmwIiiTF2Igm6aimADSma7xPCakrc1GoJ7q6TXC/ac68iv2E\ngc5GIoZi3As1dL+rBt/GF50TQLs6sMzMNQwf8AWTH4UkBw+zOQjoTOiBbJl1\ne8PBPoO62dtjW+zglpPzDS6bguZhsjaXrz7bOn/BKVtzNOg3Tus1u+qoBCl9\nizDNvWn9Qwg0CJlyHc+x+F/skYqn4gcnfGuCz0cG403zIQGHgoljQxk/CJ4e\nRaf1IiNxlaR0/ergiaJ2GdOiOttdvaqRjuoUJg2KtqqXApNA4WZ2yN8/+TLT\nZ3aylYCP/UTxcepZcsUb0oe6Wlc2vtFlaGLPfl66d3jGCzsfw3LApNnmWpGT\nSey62rKCzI1e+my/VSkVa5+xTWIe16JHAONqTE6VzuBbMdEodJCfVhqn5Any\nsRBgU+CZaDJjioI8ChPQ/r56QqW0ENLx+V5ocSuJ/K8Z+r6gbpqrMxFQl4Jm\n4tZe\r\n=BGzc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2C9Zu/QXO3iAwPIZOUs5BLxdmfhKeapgf5j679drtJAiA8/I4X2vs62A51gfsoFxUI99+m0iDRShEnbU4ivNsJhg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0_1612854894340_0.4533414191979841"},"_hasShrinkwrap":false},"6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"400b44fc3060b5be3d7d21369599e7d226c546d2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-GqRXzkeIGrQoK57Jtv8AxYmU2AHREABvnDstrTZM0iePfLziQ7YAVHO6PQW0PryjJGUeV1IjSyW8G/d3Er4JSg==","shasum":"e3baf1da839b6b93081729d25b64935766228dbe","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0.tgz","fileCount":56,"unpackedSize":302409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjbcCRA9TVsSAnZWagAAG2cP/2bhCCsg1x5GwYL2uryF\nHr56TcOMFHy383gHiKxq18ggA0EZXbSYGMLftcaQgCuFB/nPosd4x0ja2yaS\nvHXwItPgS176ahFrb5L+vERYEiHjH+FrAR/kUK6xec3+KnsUXJcftNO7lQKs\npyzsyYU8mGcWSaVTKM6/lu7uoEIO/UReqerbVXJdpiVNfAEdDL9wI4VePpCW\nzc96jkEmwBu69I1nLRrlFdseZVzFrYtcZj8OyAU+SCyJwd/O1p69LEkXlnJR\n0V4j8HEPQwqLP8fRP7fXcEM70j/idUikWSSwP3uSTSQRjXeLNvn53TvhswC8\neiOzK8chO6yZrNeEIaJ6aPA5igW9tPC5D/7cmgCJlOvvFeoH05b28SP0Mism\nZsCDoNHLkFpY3IFvfW5Em+g7DzAX5/5ofy+mDRjq0AX2pVKV/BJ1zH69TEwg\n9UV6AECAltmmcHE0ULrb6mmXaws9TNhhBcRH1sCUkPkLaOdHfzqEtNF9McR5\nVZSYSvX06yrhyF1wb+tdZt/OKoyaLXHug545tVpmUFQQdb9aaW0ZpKyqt3V/\nPoNXZFl638V4qamPO5KF2iC7ycOxPHIpKk71EBmiwzPgv6kLFEH7AZwlnJ4I\nNrNEGfnvhY1jqUAwbbA7u4Da3bsKJW3V3olX6yXP+N5lbkZeOg1dVzXk7QC8\nwU6o\r\n=ngFM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiUqZgBA9x7OALqzBQhb114bFSbjHmXIKOZBLQT8NnJwIgE3cxrRXqMqR82VzThqFMUP8YlzbheiWrLH/TkZFWJxM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0_1612855004238_0.8724506773449199"},"_hasShrinkwrap":false},"6.6.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.6","gitHead":"efa0e1bf6f52dbc7ac3e4e6934042194fdec2923","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.6","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Q/DfuYibH9qwAONguCV/vi7pQTqdDA2yTDigqb5raUqnQ2eS0B7aQBncMH6ZbE4ISWFv3VWivoNxL19vtdG+Cw==","shasum":"f9986ef9912b577473534cf72292ab48693a5a4f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.6.tgz","fileCount":56,"unpackedSize":302645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjbyCRA9TVsSAnZWagAAKfoP/1ueuhKSez3TtJkbq4uu\n0PWQUJLSOzrZ/MFSM8wvCqh1on2WYAq2Hu8o9ysAgYU2qTF/Wkfkzmxa1hGa\nT5pw4MFbx/2EbWs6xtc5OegOrJIsTzt93o0qvlPgtMouzAZyZeXzBQtwubTv\nAZW/J874PPoSc/h8KDSnXmUqXYkIzNBbuM+F7HwgE/rAhyk+7Lqav6YNq8ou\n+uU+E++YDQe9eD2p7JSA8qhpOgt0W6BvDFYa9M1W9XrRjm7RcGq0IcWJbbRW\nJpgbMXZ77XtMtfKXRAyKEu/w5nYpK9PEFPpzveDWuWgWAINj3PSMww9lzbWL\nJAkY0xxqmOIYOawyfMulvpklqAr4KPXPsKpNZp5EqJiqzFdmIuLplHNQ1xac\njMcZtcgg6B+yGQpzfIaFEVcvlVqtPhg7H+Vm69r2D74H3FmBJykPuv6f4d4V\nm+R5AEZwTNerpCRyY5cSVEtxpkZfJ6oQePhjFLSyv1w486rZ00hlgiarVFX6\nOcRmhbTjbHN/AzOX5t9SPO6R2/NgI3eRrMDzDBW/VOFYHKzmHDRQIQd2La4b\nMtOl6DHtpjG6u7tRohpE3CevH6KK28E6N8J6sDFCbgaTc2+vl4b3i6QsQur3\n6cEOwMT5GMiz2UvyHOowq0oDvfnv+TEYp+pVX/qwEebK8SsfmoxZtmvZcW8w\nmgxQ\r\n=x4bs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCapJxFXAWLFQO1fJJVpbKjq5E97ZpnfYmLo8hGoZ+qyQIgVWrnxpNTaVq0K9tp2vl/YyjbzmC3p5UZDJgs5pjbwio="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.6_1612855026023_0.08391310503749305"},"_hasShrinkwrap":false},"6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0","gitHead":"6635a63ef5167c62a5e48758abc103d4de2cbd6a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Iz2rBwmpKQYXOqI+FIMV6aSuVGU2yFO5oqAW7W2yEkFQf3qATfiblpsyS266jIPH/jXluiy+XHEuoy5S9/Rxdg==","shasum":"5e72aefd3d4b14ec7321f4f329a63271c0fdd031","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0.tgz","fileCount":56,"unpackedSize":302409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjcFCRA9TVsSAnZWagAAgL8P/i/uv24sAobmX5QfR3Fl\nFo04u+LbNds01OPQ+Ngkrupche/DV4W71ThkrgCOIh8toxeTlJjGKqK455uJ\nbS6aiu/Uqjcs4PcH7iA6f6OBKcOIefl2Kdo9akKXbbrCVY2e30EznX0lXOSG\ntiqdSSnY+V+gtu28IUg+Noy1s7UhawfgplluqJl68OjPGI7oSW4o4nb0LYFE\nWduuNDTpq+OIEjfaHFpCO/pPJ9PrQfepqtkyX6nA7/paC7FD006ekORiT4ZO\nGVJav91ZUGvyKT2uyOv1vTBHyWHpvldykyzImd9VfB331OD/GXn04uvKtlVX\nlqvQqsyh+l/gViaALzKc/yZzJMdEYYf9+pbt9XFgAYKB01ljanwB39ptAUFr\n/yCnPe0wPu0AzS58V8LTcp4grJ/6sikyA0vMiw06Vfs2qQyCIGSrl1GzHMKg\nOFM0Xp8utB7btBed7atdDYP3BUZGJLywVB7+FINBezT1XEEzFJUJSorqoLRz\nt3vLEGyycOg904veq7GPFns1Z7WzhrTdRYY9YNkwaCo0dg7x5q7z8twKwJQD\npsmec92kTG9+Dy1A3+73DAj76iRhAJwfxxluuvQreW5wz6EvEbC6npltmq03\naC0JlnfDOzRJ7Pg9HwyhuMaYSLix85iyL6QRtahTdcsLSPWrmKXcWmrlmrqi\nEQrN\r\n=bn1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtCQgkBPcwEMQPLhbYQi5Cc+TwMNRRspRmUz+B+jIIagIgSp82MQer8xaJK3FzcodJkdmcj0RdAt8L5YLidaJjwvE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0_1612855044759_0.9750552683517923"},"_hasShrinkwrap":false},"6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0","gitHead":"5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0","_nodeVersion":"10.23.2","_npmVersion":"6.14.10","dist":{"integrity":"sha512-EPI/m0aOHJGd6camfF7C2/Ac+3Mpz9oG5Br7NXBzUvBF60MRqYe4LXIQhzQU+HciOaVwYplmAQloUpMjkhd7TQ==","shasum":"4e744dcbad63d66895c1d1c1d66b46c34d2db0d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0.tgz","fileCount":56,"unpackedSize":302688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjdYCRA9TVsSAnZWagAA7GAP/RCwGIwIqn3SuGdGj4uH\nQthkXIGHAwxM0WzyrUPCMJWSq11l/cO8xy1NXJJfbJY3ch1yJZXE48smEFSr\nn2duN3sUG2rhkjR3wgvMYGwdv5iQohFNzKz6hWZLb3rTE6YNNs1wycMVphI4\nE1SO32n+DwHvN0V3wwHF/DCsxV1ba3sjc6rxfNyy649mt+Z7cUqtD7w3Eig5\n+2keQLC4n4IDnWb07HMegru5sjb1yQgUPe/Y5raM83ux4pLybPH11hE7nb7g\n9uR7dScN1kp1ksfTpfDEGGhuhfJadq8JUpPM24ctcrKNJqxlKiO1AvVYkuDu\n9ExKcyqga8TqQVUzw70DvB3I2A+EiMIQ/Q/vMbjEo2f3r0NBPdah0aFn2hIw\nwWm1W94U3o5r2B6Adfo1R8lSxKAPEh+2ZxV+XIlNietf9lwrlTJ8cSzrhO6m\nTgpHBb/JjE1t9zWRcJN0YrdV8T7JCtiTqT/nvjtOyZ+x2bFqUpvVfsV2cLJt\n84uRkKsPeRKET+QyFs+REdWVxwfV5EhhQDKgvdsZ4aiS5+OVQVUKfHrDOJvV\nCkfOqcAQ470wJBRCIe6jb8j2Q0WkrKSvHriKmWz1KDivcE+AALJBa7Xp0Gs6\naERjqi7baoDYObAStjUFxuUWws4hs9DJyv9NXVhmyWAp8dA668PyRQA2kAHQ\ny5Lb\r\n=l9Rm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxSJz7fPLCQHQkFjtnAoYZGOlVk5NDX5cCgVHW8suG8QIgDTQ/DH3JfboP1o0XCbWBpVVwh5qd/vLY7NQU/0ICUJI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0_1612855127992_0.8064766031671065"},"_hasShrinkwrap":false},"6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dd9e9228fb5b857e284b4b26eea8667e6284dea2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0ECacipAk2HjXVjYY+O0fSqgFI+s3iTQ6S345x0WDJ3s9AEvkWTWM4KlCF8wqcAJ3qoOR78W25z/S6moFSwwjA==","shasum":"aa35a2c552d8113890823cd3989b71f1c3d5ab14","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0.tgz","fileCount":56,"unpackedSize":302688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjdrCRA9TVsSAnZWagAAdRsQAJ0y+PGkHIL4u9lD/7t7\nyI5XMDqZtCbb14jzKc88DJPOE2ABDnnMBOOb+tw27wk8M4BzgCsdruLdS8jC\nYyDmFgtkQqmUj0Ma6Y8WC88AbYUVAbJhbiJs3RmphMYoD11v4NutZzPRB2V6\nSn3ELV22GIl5GXa8bQL/vQer7tIdseGAImKoDRsiGjUVYd+rz83DUTTNQt+c\nxxNQdm/cNTbkFDK48CDblI5A9pThdAmlNKK9bcsAKNN9rd+qo2/LeePZ+5Uu\nx2Ke3D9o9OV7svOsiW48gmmjH7LIICtRuLwqhl8XIWXebOFUYrBxt/bJ1Nml\ncJFTOLhvRgQnUEKIpnVR32zRJQ+kEKk5lbGG7F873e/A1g154zZKnXKcFzim\nN3X461SAGmH708yKJsi+Ww5PyoX7LTDuHV07GUf6o+zepmr/55Ho4nUaRWKr\nfbuH1bZnKrgNCN9mX/ZXj3j92zot+WRl11x4LLexXZ2yoc9qchLJ8+qKqH1P\nM88baVNoy74MBDdcc9U5qzt4cI81+GZwzvr5uwJxpDewrxJOQI6joPpePqql\ne6wqTJqqXkSn2AuTPizBzScL318MOtrIsLEt+job7mvzJkjWk28bp0MKYYD0\nFavdTHm32ZfOX8pIymbpIpNWzLLTbzpFYfLJCGF8jRBhO4nkjuAefVUZA2bn\nONpL\r\n=hnQJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5Pa4HtIsiqkXnPt6aDB5ifDXv/WnOPqM/GTIFoM82FgIgPpmqqKNhKcnou2P6m/4N3HYboSQ6Ots6ZFflxbX2lu4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0_1612855147210_0.9325829278401669"},"_hasShrinkwrap":false},"6.6.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.7","gitHead":"3af6327522908453f0cecfc63225cc8f811b41c2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.7","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-MnWRjPNBYXoNlU2Qt6jsY3fNC62DGsqgCec+4b24a934Hfs0WULQQKtnq1By3hPmg4EhujNBvySD8EzGliG+Mg==","shasum":"34b2e7bea6b6192cbc9ecae0da35bdefcb3ad1d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.7.tgz","fileCount":56,"unpackedSize":302923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjeACRA9TVsSAnZWagAAQ0gP/3Xv5ICVbdadDxrhTYVm\ndPmnAiAYTHPlr/MjdFiiASKHtIun91t8zVSWxmug6Sv/PxDknI/k5UjncnfH\nRzVgi3vYbKr7ofwi6+ZMUekKJ9I+nrlsqaI/vTbrXuYOog6JT8tZPfkLNpBX\nTfk84UZ43WXl6KxTPOYp7t4JlpkK1wNCPv2EBrEzueCjY55iptwkiUB09OMm\ncmeG7zfByqiEQ7TIeF6L+yrbNBSkKN0kgD/49nRf+b5CEbV/ZDr63qWK/Wbc\ntUD2WBhMEyhm8sZgA6KWCpx44GhguWi/4HQiRmXk+3UcUNht/2nCiYwFaOS1\nQhqf7vq5220KpukW1+H2f12Pt2ouCuHWDvO51s1o9iLRciIQEsJzclhUMugo\nvmsdEPPOG/XEfe/ixODpGJFYzG8Fn5ecWc63oCI0bCa1s3aJDEwx/DMDZzR4\n5Yybn1qvO1U2rIAsKLpJy9QIfcDwfLRPU/bCGUPVWVr8c7Afi/FPOnp3ya43\n+T0fTncv104kRCGBAl4BKF7McwhsKzEbcb+yYodgQaWE0kqd5tUoX4EUhEyi\neSy76xFthdicoH0JQfNHGnB4omGoGa3QTcnAv2CPNfozoZKhK6sEcyXC9Lbd\n3FSfMF1DNeIAWnTwfS4bmeDKsjkiZouXx/HA4U3reuMYTcJEOZ0lEvHuGtZU\nQwZd\r\n=vR/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8U/qiQ4DEaOsPQqStVUZp0R+OfSyKub1kKmFMMdyKzAiBaZiki9t7VlT9Vt29unyqkwkDtCFPMaaKRJeOHrpz7/Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.7_1612855168238_0.45925978248824917"},"_hasShrinkwrap":false},"6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3af6327522908453f0cecfc63225cc8f811b41c2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-nDgAOi+BHOnARhkNQ/vvVEHq57RCdp5hRyh2+y0kTMd1B7oST2qW95S4FtTUkEL11XdR9eVM1V/GM/5PO5kGyg==","shasum":"147f563fae7a6a0eb6e988998870b3ec0727b2f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0.tgz","fileCount":56,"unpackedSize":302966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjezCRA9TVsSAnZWagAAVS8QAICshyCgPcFyWvhpbygl\nlT3l3Y2fksq9DmTfp59jpzlMPAtsafcC0ObZQ3UsOlS8+bGr3lsMUVcj+fuw\n4cqqa3V6Yb6HMnFlBdXvxkeEdJsWIrY1/f60aTQa4TkvipSu0JXdEJeUV6Ij\nzMMG9Q0BfyAaehybFw36YLAJs05nAS5R/s8E1TYCMCcps/9BVYXvzxCNmSKy\nVBNvOpcWZQXMEPD0ZxfN+7kgAIyIXwvIN9MSX5qYrkq0gITQ1ShscDJUnsUF\nwsBfBnGJUA/1wibsENA1nFTR1C6iUaTTZJgv5uYZbVCnU5+dD1RBK3bD04kR\n8RS+Ok//3Tjep/me1yLLEILvpsWtmf9Osh8/pQBNADscxptSSQmlRE0A4wUy\nwptniqtul86cndD/p1Wqy5w1hfsEtbfP0kmCZKAtKJbHPwAAYlQRebowQpJQ\n2+sr6Yz/lwwlP9wGgPX78M0q0LsdhVTJ7W4ugHc2yGTeobg6IGmTyzluqXHP\naRJ987go1LDpjpPvlrSDDB2hfwbBOR9hDqGMHEXEI1UAtQ1ZyBODtLlKYZu/\nXZdt+eOpXHrfKKfkptgf0yT43j6uY9ru/ysgnlq6YpQlRYolippKrjuuWnFj\n3gQBpczkUCVfxCMlexg09UL18Gwh66MjKcqSwqTE2tBjF6P98JrguNMWDT3X\n3S5+\r\n=OWMF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDegcTbhBuv5kKVUYL0fypQghvogkJ6Mo9j80msjokfsgIhAPV9MWUPpDA/5JB0a6lxcExxL4s0tfOO5O1cPgmtlPVh"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0_1612855218706_0.8030244213321251"},"_hasShrinkwrap":false},"6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0","gitHead":"adea9518d9e702b15a7778b4a17dde24fd92235f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-YM2FvPGpWAwHPVD1yrtJZLXl0HfTypX5ctPun0RWSAvKla99mNFm69CEXAR/pVEC4U3Wcc4FcEFN2VqhxrQDbA==","shasum":"ad6427b91e82a1cc025b08f43ff99a2b2c49aed0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0.tgz","fileCount":56,"unpackedSize":302966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjfkCRA9TVsSAnZWagAAtJkP/0MvAGKaG8u/ka3B/MMM\nGFmqTlmlxjPVNew6WF+Wspy8/tKH0+qTAKEP6DPH9K3+faB+WNIMYymQCqMm\nTTcU7MopzfltsFex2ZndI7xPJwewk2c+OH7wKPbJvawOS/ES8ArnKvH/YNk4\n6x3vabte90cwyAr7FZDzfV0YrQlz8uG3zijqaHIO3RhBSQGdp00UPe+1iMwJ\nvVYMlSc5goZuz+7rWXSU1yZq6+SNhAUBLCvEQSkW2AhKPccckqzYs0QSSFSv\nHbNpYvD9QVookJWC9hRRA15vGmloUAQYy+IBcOKZ6XSYrIe652ftIf+o9NE1\n0l7WqO3hAX15R4XymrtTquOouRWRKYtrw/UAU5I/YBoK12r7r+0ItMFs9V4c\nQPz5/iWdYMTmS2su6l5qeIok/+1B/oF4wAJ3pJquYa9y+OGeaGqLDOBmgZt+\npMBZiVuBblPK9oeIhtbUhPSAgLbe8ci8tknG2e1+GeERXuHE4xgLBtY2f1B6\nlQZEymYhA2JPAByl1WSFWuxnUYMCSwSJ2vfc9/avOpf11mJmRNQzncelw11f\nCBO54W6ezLX84XYn0F94Y1GJELY1pMNODYJSheR3FAFBEacG+79+7ttsK5YO\nzXq8OJPdnpl0eyURfzyQA+IvLuWmen/9m7/JuxHgIbqx14JRGMpR86tUI+cR\n8Sr2\r\n=nrwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvVMLE1mig1PMLFt4OBTJTskPwtXHN9Wm7Uhhbw/GSkQIhAJF6dkFwVD7su7vQ29UPqGWVW8AmcHwPSX2XfdCzG7cr"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0_1612855267489_0.8832202118851347"},"_hasShrinkwrap":false},"6.6.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.8","gitHead":"ce094d05101cd5853c916a07c33214eb49205934","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.8","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wN3HqLt+BO0S/FN9ih8lEDS97en423MDKQ9k4SAjyGIac4PTuq4aXcGjb4980f+H1IvkRcnurSRF2KxPx6nRwA==","shasum":"6d6e75e9cf843c0c8c47f2c128728eae51a1f9be","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.8.tgz","fileCount":56,"unpackedSize":303196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjgUCRA9TVsSAnZWagAAt8MP/1FMw1D5OVx8zMtoAbOM\nD1w8OKK36deW5L5CfM+i81ck2YABixwKZzKVKMnpbwESvhWpVa6b08GrTX0e\n0wG0HMKiHF69DvpkJyOW4EyiafWGtTx+EiCz3TPk6g5sW/qQpKhC+8I4IQdv\nSF/nx6kIr4xOQP2jPKR90RZpI0KkdEQ7+xdfXXvCJZ+N42Bab/FJHZPf7x1+\njyo0m1ofQ3MY7vzcH6NyzPbX1Dj57DbKrMM641CYhsvKUt+teIfup2SYHcmV\nZdr68H+OuB4j2SNctCCOpI8S0KLI4xpJIa72cMG2qq5IAjZLln4xq66Qa7VP\nsjPeIiO8tS+TvM+31LZPC+XvV43TU9U4AWr4fuXei+Nd6UA4nJGhZdAWeloS\nvoCTzAhIbSqz20OhnGmbjmiJo53wnmBy3Z+kTHo1HHWkm0sMpiEHuLTd3rbZ\nJCRVDPEeDaUzBHJ9sOz/sC9rf35zj5ftRxQJzH286vVYsRV9P/JdFaKBlsYJ\nICqpwdbS53IdboScqPilntXmAchxMnobNfiBNDSPafrpycpJ0zuCl+YmcxIj\nYpq/rfH069xT3N9towtlRnT3i5jJMNntOgeKbsATiy5Zz9ZQanoqdYAFOttc\nhQzR9FJIv3W0r1yJM97UkpETNQ5EZX9Dk13vwc/Fn27lZ9ibH4FbyYDE+FGw\nkv1d\r\n=i4I8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDg138tEfX0Ax1O1IHrPPZ4quKx2nK/0vor5msJfRYTYgIgTvMpCYZWMasEYXm8WsEJ09Eu39sP1hptAYQjGGmXf/A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.8_1612855316045_0.022640856077189797"},"_hasShrinkwrap":false},"6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.34","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ce094d05101cd5853c916a07c33214eb49205934","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-TQ03i/02xwH+//SHcOTNy/+ef9Kc9K2fQp9oDRjsdFJ2jsyZbStGx7dsH9WLwbZ1GCW9pjOsTlMZhEMGunsA7w==","shasum":"44d552212fc49a1ef1a5d07bc736428e57797b94","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0.tgz","fileCount":56,"unpackedSize":303239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjhSCRA9TVsSAnZWagAAh6QP+QHlMfCIQf+Ij8POWuoB\npfa9IJTQmN7xuQIYBJFqVliJZXmX+emJBhzOQxttsYGrATj/68oVllICAbS5\nyrfocEg7pKYB0Ga7nhOaZjZLjI2Y5FVdZlfFbpOhSVSLAwqRA0jz7q+4+62a\nVjTR9o46Q1prieNaL3LrKeoUf9SOm+H51++kf71Cfrbn5kuot39Hiy4PcD8P\nQKnohYG6O2hw+NENEWtRelwRM42wufbqEMhOD/+LO1TvfzeOdKjpG6Zdulp0\nrqT9F7d1HRC/XYiKA7BY2wR8IqqVqcVhoyYSGIhdosmTXtp/xnmN5u6xbtqX\norJI/9j9aDZkDvMmxqWTmJJtB1ez2GQqJ3eJ7WYL5kgPmanUxy9o2sa79m/S\nxR6nEwHFN9NsguRUGHBtAJJnOChIKVedvefXLSxZVNzHxOpb/UQY/HK/8qr1\nC7wyzVpDVOvr805qoYQYtfjEVawmzyGRZ5KNuUqjtWnduymfDsvWGdJHDegP\nXxULHy/mD3XuuYUUCVieJ9jpVm2TEXO5YXbvhxIVn0TCLHzi4kkF4h0AZ5WY\n+ZpZS9M0ocxIVcSJbsBGPUksa1GRcvDrC11f/LMEDJ3VjqLhLUp7GaZ0kj3G\n+pfXcO1lB3QhNFUE0JdzjTytLeGU4FSXgiogmDCA08/37ggLI9ErJjK7U3aW\nFmGe\r\n=0TqK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJpnLx/yBXl9ciVAMnvEVANtxfE1wfrjo2xgHsxUYcuAiAVZl8bP+UgB9JYsvJ7v940zUtRWUzM4yo8jX6O8+9OvQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0_1612855377905_0.1469628881217815"},"_hasShrinkwrap":false},"6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"64841b271e4cd3caa14794875e95930e1ee240f9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RH3atZZumNWnJAOG1gSV6m2KPdoExnxKQ8uUOBw9wzeLNdjY4ywi7wHGRW5FWtAZ5//ssGSyC3SYn4i/oiT6PA==","shasum":"88b8f851a7dea44b4b388376e0d1483993d82f12","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0.tgz","fileCount":56,"unpackedSize":303239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjhuCRA9TVsSAnZWagAAHysQAIL9AjyeWUhoB+2bmmeN\nkcrjKkYB3ygXEJjOlAapHR6tRM0ZQ8YlffYUZlB74LBI+aJATvl6vITj3JLr\nyJuUWzuxapEB6TFkaGJgqFVMZ2H3N+NhBbVMTQFuWqR4Mvaa7FoANzBUlp2O\nSpgDPcLHkWbR/zi52RTpNoohfp3FTPrQZFPjDJaWpxvnRXmnB+5SQBy02bYH\ngbWfgsEv/21dxc5Ije9Mj8iAq1aovE61R/6CjD4ZhvCtCtXcqvSB/W0G7E6z\nZgXFSdHutSbavZgWBbK4q64zfC2KWfXNlStHC44JzfJ5Hi/zLmN38aXgMEYh\nsUoLm71mnfK8r6p6451sGl96xqQponPp4NTo6qrM/UGUr4HwHEv3yvFYFyEc\nqK6EusjVljE0ZDzJk6mkkCdULUalzJ68NrptemArau4F0ha60Uy9Oc2SUSWc\nkYhT/NAPvIQ5pwNRtQ6xr2PANIFpkMB5Our92kLEcz05dp3OI09RVDl+9KNo\nhXPmgyo9spffyKTTdb86Xs0RiLVr85KfRiSiXvfpZSPNyvatko65+cAzKfN1\nmGlkscK+zWRSU0wv5x+5Yxqfp8fNAFrfE3d1EfOH634o72dRvPle27pBhfOm\nSi+tlQ5BSrRnouUJtnHCOPdQ2/y//0lo3XO14yqHeNOJdM1JUGS1CVHQ/FNr\niOcD\r\n=Reht\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCv7lLCc62mIB3VRX6ecnpRGW4itktKN8f4ZMHItnCfwIhAMxuAZCGFLCcKIE0Uh2DVPtdrZFud9Yzyty9/F/lZNns"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0_1612855406362_0.03043878181626658"},"_hasShrinkwrap":false},"6.6.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.9","gitHead":"abfac28000818cc2902168b9afc3c1809727749f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.9","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ur9Ow4q26oTnkrU16d4vLHnjQBLUHjSapbhV1iLF64tJZLZUPaGhVzZXevxHpYBHpvOb7OkgN0hw2KMoVW3L0Q==","shasum":"0951d7013281d98fbef4945180547665932d3e58","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.9.tgz","fileCount":56,"unpackedSize":303478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjh+CRA9TVsSAnZWagAAahwQAJk/I/lN7kOxg4rB1SXc\nmluMSFwO+zcrWB+Afl0jYyi9MeZUxEnUXe8KOKKxiAjiExv7VWBSDmxIDxJp\nWXbxMp4JHoI5+2rmB5Oe9tp7yjMZAqZPp/xgb8lCPcgqAhvCz+RGGjYRxNJK\ndWW1qVp/6vFZcA2//SzC7ckWLEmlrzIZQOX3HM0RQl8tV9rKglGflLqDHNnt\nfESeVGyqkQMVcNIy8ObCbtccIpuEhgc8WPeDObva0DCPwUBwcfuoSwv404Lw\nIcGk9HZZ+iQe8yvPQhdO8t1HT6/Rdp5T6SqEmRduT0As0De9DlHPWeOFgz9M\nE95q9sfk5anGvnXPimHZSTDPuV+kMZBaEQAY+CMhN1AfTBp81cumr1DOmVmj\nOJLAXNFBF2lzWj3UbigmooWnYJw9to/grmauCVe83VxBkE00FTWW+YyBVXNW\nLaSpkdf9jWKFWsQvOGbiGpl2/USZI/6+JjC1SeapbvOFMP5cVO5Y0plcnx6Q\n6joFJjD0rzuT9VohmVHKu7uWsQfBuqjk6rlB+2eRsy+EBuY5HYOFZtWvIXT7\naDi5GJZNoEFIagUseCWULuAHDo3ayTSLWzARvE9JmLsvTthfgg+C1JRSzNSB\nYXYllJqVdRhwhrQMQL8TiFDntjT8NzI5xKYvLa+o1Du7oYPH6b7JBD6sc0SF\nlmox\r\n=nrQs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnuBZClJFHvgP7FyXznI/MqaL9njqjrA+nLuO5Y50sUAiEApFrUu8X4yd3uVIFtAwoDyCcfQyyn4LGhf6+3Zcjqs3o="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.9_1612855421521_0.7877112685545686"},"_hasShrinkwrap":false},"6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.10","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0","gitHead":"9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-b1e9ryEOdaB5FXX6SGjZ9x9jwbbqApMvKVSkDXyVX8Jepz7A4vWgF3MEOZ3W2CvqSWuvl8WFPS9YnY6sQfVN7A==","shasum":"402768557bae2a95531217d61977ed0d8db3e0d2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0.tgz","fileCount":56,"unpackedSize":303239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIji7CRA9TVsSAnZWagAAXCIP/0NK+SsQoY7x/NyYSOQf\nl4PruSbSXxqDbq54U0Panu25LfKznKrR5g+du+knmtCbq8cpoB2n8QyyxF2k\nFnFf2gD0v53+l+6quakNDjBYWihA5TIRq/XT64CAK4byedOP86fXs70oFlIv\ntiK9pZVBk5qGo7R/TlVvqMEzZ9kwCKhbbpgoC6cZhrBBNtGLAGApvLWEe8jQ\nUJKKisqhNzhr/YtzkOSl4AFsUTo/6ThRdzGRBgORMXMhP7XYE2NZWPtgtOdk\n9vfFhIL4rrEA9oeHSGwDPvlNB63JnVy8ee4Mzzq4D0Hg7DnOb6hWCkKYy4cb\nm1epoUDMHNZ1m9e1R0dgRqBPjPdcFt3LBxqJppYqCkD/+SVyV6pg/fsiLmtY\n+qsWnJpD6+u9hpuhTza2vhFdEXAJja7su4sld8s9Lqd7oG9nEyocwwvJFbA5\nykhFbkg67FDdTcuOm1fkYGmqX/YDB8i4+k2QyGQUTUY4eFN8IWKIZ1bnyVdX\nhNGrep1LSlpXgj7a1fG9e/vowAdW5kDsmuSs5S33pPrlVs/RKl5DxQgYZAiG\nx/xxAwVHTqmQ5Sul/7BNwwhVt8jSgyIQK+S6kROkpUSJKFXWv5/WuYlE+FOw\ng3DxKvbswTASJasg1QmmThxd63rXKK55/Ad+w5iO2RBOPqwOa80RK07z9reN\n6+Jd\r\n=kMak\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGwVOJGQ1tioBFVdjlI730lU85FaDtPWMnpMRrNc6iLAIhAJSj58H2mkEkdO/GnoGjZm5gMJanptfcODf1R9otrE59"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0_1612855482481_0.04706039259435868"},"_hasShrinkwrap":false},"6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"abfac28000818cc2902168b9afc3c1809727749f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-EoDHwy9LIsobZKemnr9LBaAbVchNNWbhmyq2aKnBMjQOceF1ggXNwzF7EfZGH39t0kpGIIX9HXi1sgdvyRLozQ==","shasum":"46c2a15b936faadf09221237a218e73073f480d6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0.tgz","fileCount":56,"unpackedSize":303522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjjYCRA9TVsSAnZWagAAjT0P/0FUiFOHMCjOpkIMV4YK\n90lzhkDiyD9sd3yqimeRAP/shTjBPturoHWKH7XR7yePZQ2qVtMLTHiEbsOJ\nOsRPep/alkqmyEjOPywwAK7gPsLaX8vc+jjHufzUiTZKJonG7G0IDCCjYNEJ\neiKi6Bm0fxGxON45Mc01tosNJ2m4fq3MOdzciEjILqTghkj7KpGKE1SOX94N\nGQPpj9rnj8wXOO9iYoia0tcrjGRaSalBOZbj6UYGOlLIi8L2qjxznYjg16Ey\nmoTTNAokJCuWefktjmNPqfWy98EO1TdDR3owKQE5wu02nCz03N7GNzCFDekh\nMgTtM115XhNEre26ZN5aVKDc6ONtA7pG9oucdAaAsvTxEWVQym6yUjwcwu+P\nluIfviHek02Tj3JyMaKreR1H4oSgj/X+SN29WfQPIA2fBJonHHoBm/xo0YWS\nBd82gsyn0N5XveDjqbGl+0ir9fypTmykWhm9/IUdLWytFXMKyMcIhk4rK6v6\nL8uHM6qoaW7WIxZouTbsKbSiqSD7P12Ac5KXwwbfyoEwRD6ZOAaVu5yajMlW\ndwg0UHrh8r9V26arTV3yP/Dq1DT12VfUXvUQGNl1fdryiafEkEOSGxPKmjEv\nacl9kMJoW5YVJr1WyINUkb8Ez+EH3vj8TerNovMFcbE9r8G+QBmLMlKbwk9B\nv7Xl\r\n=ZYNE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzUf5fY6xirzzOU1w0fZOriVu9A9y8+RBISx/jYoEoMAiEA3sLIvx+3pAgJSbQG8//FfmykooP5swl/TCzU71dt8dk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0_1612855511791_0.29730614314615655"},"_hasShrinkwrap":false},"6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.10","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.37","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0","gitHead":"c55adc9ec630c5975262472ee6e682efa22d3413","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jaeFAP/CQKfXuJJcyyiBDHGgOoMWYztXQM+Qs7ppVxO5MOUPM0YHK8k55WmddM/dq/NTijn8UPSyveFDYa3ywg==","shasum":"cd1bd2296ff9c5a5fa5e8d8f62f89f66296f1d66","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0.tgz","fileCount":56,"unpackedSize":303522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIjmBCRA9TVsSAnZWagAAfs8QAJ8/Wf+R4XVra2Wdwf/p\nzUecPTKeCF8FwRX0XX51oNMl57MR/XBBy/G6yFnMREO3SlQZqloW4j0yRWV+\nny2rNWAtvWQHy4qnoL0IPlo/KnBxV2sWNF3ugblpAaE9E2mB1Gv5K1I+hokv\nAK155ijEL8Fm0YzOW05DOYbo+4RV0zFcJRLPQdVJkCAZ6qAzkIjPeon/VXfY\neu2/O3EPsG9crpZ1cQpmpyJwrYi1UnVcmoG/Z7PKXeyCGXnXbRPRK0IVrQeO\nRAN6uMcckJyb2gijIpEcKJLZab7QvmtMeAlRFFZ1YJiUQrqLvu2zUAcNpnnP\nuDzVtwTBsHukTAy6ORC36aGj2ET5p0xLBn6XmVPjQJi9/Y4RYi0HdtJdQloB\nLz5QztXNTJ6+HmOo2uz5TRLA0FtkPbQEhTh2ddcrTcJPE0WPDss6ub1Haijq\nDR9Z0wUm4faBJ0xmd4igRy2e2zGTT82UL3fxVwdNpmT0tfe2BC0rPvnMuR1D\nhHoE274VnVG9M1Tb/C+Oo9HvZVo+re1XvWwSNlkvfSu+JPRSFzHX2n2/NrL0\nDL3R+vHUiWL7frevD+D260yJnmpmEqTwoLc2SawFZ+rD/GFtPnWD3+Z7QkOJ\nQMrmdQb5g8a0No3mSE6jFwtqbZSTyfUMeJARtT872RYRW3GDVsH72OooieUo\nCTgH\r\n=PcBE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLBG+jg4RlhMbN25tAGBlUb49GBflycjTei3aINCYJiAIgVTKmnhljRQTd/Qs6g9TloX/FwEAqhcYvA6PWbeQCGsI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0_1612855680444_0.11365504333001297"},"_hasShrinkwrap":false},"6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0","gitHead":"e8a6f3fa4b1d842d56a47ee1f70b29045adc8502","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-IR0QLBoT7U7NVGDSRaWttIpZNgyqVdmxSEmvN9gW+9/MgRaWUu3iMbLMKOFwsxdPznFaW7MFTImCY7t3Qe/h9A==","shasum":"eea06bf0983cb4ae306f0b80eddca976d59487c1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0.tgz","fileCount":56,"unpackedSize":303522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3CGCRA9TVsSAnZWagAALEwP/2v0XIomZ29lXaZFjL7k\nhbpRG2VHL2C340FolyIDBgP0vVIOaiAVJeRK5R1M6MbxIO5J+kXU+dLdB3Dc\nXAWruVWySUCblZu1GYMHCdtgBDxpJ5IxkBI+T/5gmSFaBv8B7TywCU3i6A8s\n62E9mYvfgnYzyQSEAS4Zy0pbdxelk09W7SrxNjIvkPET2qwjCUoiGjpRSJPd\nk+HW+lF3/Ifit8MQAAgz6OStrqWyTBppsf0vUv15feaELVTVh12RC84bPLi1\nWDfQCVMlgOH6LOKwRuGrn/hOlQukAJxEkA+bZPHs+cNdKaF5PpDb7xvGWEoj\nRknzT1AYFlluE6aAtb0mqG1TmJtyAHv0vqL+aI7AAPh9+MVYzy4jOlDZbxis\n5QRARDh7X8xITybyT5bCKU7b/vv+KYTalGP8A/MNb7ql1FPdQknp5jhnfAH1\nyv7aHASQvMHjEvd14Esi9+EEHb6N71NS9DswaQ/dsvpPbtRxrMXDWVlVUT5k\nrMVK8yu72Z8RWYZm6ilBSklwtiqwSpJeHyIxqRuu2/aTbAgVsEZLgbV8RXpH\nMu0/YUhGOU9+EqX2pd66mURebTxNxuO88xkd6/82o/XcKmvIoSgxe36qwPqo\nmFMKyj+ELs4mlHm2WLglRZVCtiiQi0RtACA3aE2Yn8HqdERgA8LOumXM0fWb\n3+01\r\n=FXz/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChE5vTXltIIDpvA2ig5Y53i8zKkvKAFJfX571kGYDAbQIhAJ3MhcGMK9cYL+/mCU2jIH9B5Y52c2k+9AGvZ69gPfyU"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0_1612935301414_0.24336649647676079"},"_hasShrinkwrap":false},"6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7350ed9af19944af206cab55b5777f4db3309df7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-5m7FJSsPV62GLXenJroYhQBi3lr/b5FTGtNy0TfXjeGxB1gdaXgjxT8kF4xhp0J1/MHYQ5ZtNOHrO1L6YQZb/g==","shasum":"def017058f92d0db1b47dbb135752335cbc62679","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0.tgz","fileCount":56,"unpackedSize":303522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3DfCRA9TVsSAnZWagAA/U4P+wbS2i63KXuyFrrgFXQ/\ngadTJhEvHJdmXnYzshz5MbQOdcVmrPp+YVEKsFvFvWd/XSISzmSdNKIps9Ym\nhUTVsuf69vqWFjHY2O0V3pKvf+64BLbYAxHPI+mJ4CqzfcQ/pN7r55VPujgK\nxSWcwlUxH+2DkT+aSXZ0h/GceicxGk4dFlrZ4iQBlw0P+NoWN2YYM0WLfj9P\nwwdwmgxtw2e/ry7RikEBAsz/aa+n76/CmWm3bRyn78CZKtUScFSJnThiRPf/\nNxTz2+vdnr5MCjxs/JObc+TiNqcf8CkmCPMaWp2pCHSRLDBI7EXB1r3/kqO6\ne978wK0A0SV5oBPGuMTCDyQM0Ke8esTZWQ0pgrRF3GZzWDk+qR7605jN/7m+\n9cMs+KIv9QIF1/AddHQ6LLnm7/CWtCBFTzMh2tRXXxbXm2UZP3wG+3J+Jbwv\nLkRIujdAKQBKQT7eIEDJ+idUbnWMMwgiKWi0fW2JUGIJ3NLmwp1Iwyw5vOxv\ntGniKmqQrtFwqC8WkHtuNHyqZRj5nokBVUqGUmt8YDF7zJoCUbg9LrSiKGIT\nStJyHfrjIZU+lgjGiIdlvzDpsPjpE/vi1+lHWrN65ZjawY//rFsOlbFb9aCw\njvjT1yt8ElJU8LJ+GRP9Pb4XTXIkKD1II4a62YkXu/ZD176JT+GnB64qZzbc\npFX3\r\n=wu8X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/SHGbuU1oEXIFN5xDjoJQ5YXSjaVE+7OikqUS9f7WFAiBuGLPgzSwJt/4jQKA6sh7DIFG9Zlrmw/qdP2Bykfppig=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0_1612935390487_0.6314333278087125"},"_hasShrinkwrap":false},"6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0","gitHead":"e3d7754db1347d8bc017ee874c63f80b06639a9a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-9mHQa3uVSODqS67iM5JS1DO4+wK0/V4R6TVMsFclRFvh6icC8gswA/8LffDo8GJZ4zTlBHJsORxF+ERulH9PsQ==","shasum":"ac27a58d3f595784d9db717793c95ca46d8dad52","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0.tgz","fileCount":56,"unpackedSize":303522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3D2CRA9TVsSAnZWagAAoh0P/jH+w4UkTSwT/zPI+qle\nChmpIH6LnPc/nR5lHWsqFIder40kzAKDdgir5IKGJOVjaH7Q4N1+Kg0oqzsM\nKFmvBbuWW8Y+HkUx6WkSAhCJM0YchgsyeXhftMwRUTD4Csaoj/2SoZ0552Vd\nj/EcubJEDS6gwP2vAN9lkFNgyboi9T3Uv5Xw2qfOnGzAwHMd4XqKVfSiBbcu\nI3eO4NmWOlc4CDYvvazla1Xf+Bzk3PQZJyCBLK7NpACZJd7EGjiAOo/++3R7\nTkitotnGdjtFU4u0VuY3gTArq0yp8kkkqvmIVfKn5Vxj+dE6EnRgY3UQCnI2\nyFfEEqVN60zSnDicKovKUjW+0Y5mm+02ayDO6xrFWaVOaweaiWRBEws7iW0q\nPDItWDHZnFgYImIAWlae0GHdOWDFf4AAiQ88QxmT2M5fpT3sBi2OEkWoKu3G\nmcBkc1+8+U5PFv+YP+2SGcpLd6XJMMYTs0duSCUeKSOpKrew+bF9UWltC/sS\nJzNvP/E2nXMTcX4gQdhronKuEWRhjJzKe0ks0o7eGsrEGBfJhqGWx7C6S6QI\nbTLMQawh6NmxlcGGBKEcjk++nJDpxlzsYcSCRv9PRmF47QAs6R6OFPlBgsaQ\nubH6unjXAQtyPOu14296V7ka7CRIBqFlvXGu1szyxJT3hFj6uX3PvDCHJAhq\nZ82z\r\n=4ZbI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSvLuQtsbzewAWcy9Dn+BwJUphOy9VjtRAamnDxKq6jAiBlR806sylyR/xZ707O2vUP39oO7P3LlPFRpPry99i3eA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0_1612935414301_0.8469431145249042"},"_hasShrinkwrap":false},"6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"a6f64906c4853dff558385e30b8cb799606de84a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qsrYZhp335Tu6DI7X5jB+12Gs/cKD6T1JpXZ6XfB6JJLJx2WGqgYYLT7AmM7/Dym2+aVn7/BZur5ukdJRh4BhQ==","shasum":"c0731db2414c3ef57e0b55e51c51c873f0775467","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0.tgz","fileCount":56,"unpackedSize":303806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3ERCRA9TVsSAnZWagAAaGMP/2VUNrMLA0EDuPAWNvXn\nco/SILy9+gi1Qm1Yspo22/NYgDmrT7Ammxkaq3UvFuCdb7iu2Oa/lzuEIhBj\nQd5XGXmC+TdcituKIt2EfGpSlnFUxYjCgUAapwN3nKMWKB9cSaIDdnlUAg2H\nvGxgys3Te6aDmRHw+gsputnjDS+jYy5uCJbsNNaDK9eFJl6Y8tFnL6cuIA3N\ndHDx4/3qHphqQDsLyOd9Dy9fQ6roYpC1ecDolzgDOl1jBRrqzChET/qi3c3O\n1ySRNZNqrTjeyYTwf28WnIAKN0rkComCFboHJW3U3aUrv+TTqIRO+1QBr4rW\nPTHgZMlLrpmiooVqVvV0stiFt3UWlq9acKca7JtrKcDGw7bVOaDZ+/E0S1to\nSKutMf54osSoSwlx/2FXgnCfvCdyNRRSVA+zHOpN47m+/ZtZmBNgbkc8hDqv\ntRXlryb5oX+pfWyB1M7tjXBlNFiuivseLO27NdVXSxQimu/9zhcqXNv0WK+H\nrWovsQ2JYPYefcBxlgUgCkC2NJZ0+/pM0ThCMUTKbHWbiJ7QG6I5IiUR9OXi\n8wGPmw/CHplM+X+DE52WHJtFYMU/YY84d4gbrAh3Epd4ySTYshFJ6qXX/jzF\niALSgzAZUXIU7Xfi8cVtLAryMMPcR44pMxxXjaLJDqDKYh+y6DNPaU/99nbl\n/K7N\r\n=C9/V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMeAPN7TtxxJDtgd3tO8Er05HdGWx1Ov3axPgkbM+VdAiEAxd6XuvSwsAm8TjoajZwPXi76nwQrB6Dl7DACEByICBc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0_1612935440537_0.17148679339658934"},"_hasShrinkwrap":false},"6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.0","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0","gitHead":"dc8cdd4e1cea5643ea43130e677a1723c4fc423a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Apg/mQ8/t488Y2rwLjnde2MpZMW7wq0QmR1ZVHIn59ofiQUyohvWHeRFbew4ecjBHbc9ikRvATw4P49AEPD4Yw==","shasum":"9455716837dadd108bb441b7aa36f0fc07003c01","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0.tgz","fileCount":56,"unpackedSize":303806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3E2CRA9TVsSAnZWagAAm3sP/3Dgk2jQDiHHM5r+EdGV\nUP3UWg9SS0aZUTtRi0N+qKGfHpnv+caLZuxZ0Nk5ktRU0Y18UuyLa9ni3A1X\nrWpwz7VJKqlFkF7HJrrvz3HQZB36kNnSXQAG9YxN8bNFf2bb6xgxh2TbR3cs\n5izxZA+HgeXnDYXNOhbYqf7OjkUbylxwPpJ9GF+aMm1KEE9vGRa495ihIkNW\nD48gUlyNuxDtlha62VPYlWb/RepfDPD0EWaipxzovB6Kw/JDv/vSOaCFVZC6\nnjDqkdeGrrjLX9lRRupFd8xy5RvUS2oiPXe2yzhIq+lordwyEF/nLXxBYzg9\niFQtBEqCS44VT66dqU6iLdwGV1JA8IO6iH+/V3dCc2npEQP3dP3WJSspL4yA\no8a1amjIEtQ3MxQmJGo+dBZqDFwZWjyQ/SrWWgLt2+vHMalBPft7/sqpYdCA\n7h7YiZCLDcJp4uGcKRDxTgvqsTH0qv3hH4UzlFXir4PMUj5Vc66K+mVx9qFQ\nzQewzZZWeuNLo9bUR4IdELHQl0Uhb9BRmy+dilGkwV1jOODcCfi+Q07NfSom\nR4XmhXJ6x1kZbhfg5u/P11orIGZntQqB834HuH7v89XHluo5DtCKyJpzSMlx\nEvKG0kTMDj5y6qTcVcA85BvCyafkTUAKf7TuXciIgocLGSOyQHaxwdin5s6J\n/lnC\r\n=rgnH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsQ43cDWXiwM7TpXFrynKOp7xFN6OyqqAvf3BdY5uh5AiBbl4PRwdZh6/cbJ4P0+cFoizQlYkTj4IwjZhvNiyGoZw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0_1612935478037_0.376850444832286"},"_hasShrinkwrap":false},"6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3bfa9f4fab286611f1ea5eb62f8e2745d4800127","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-l1XZuXi+MS1M04iXeLpVVUqFtq4qyxVjhuZB1f7YgxrSp7HufFIZ0rv2QSZkPnjr/e2hLgNBnMvh2heJ2uh1hw==","shasum":"11de18b789201fa21574372eeec95fb9e0b60cfa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0.tgz","fileCount":56,"unpackedSize":303806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3FYCRA9TVsSAnZWagAA9tYP/A8j0UvXcvWbnSfo9EIa\nMfQbh5nbv2CcSRTddbAs6Q9dLh7+94+7veyozZa2EE27Qgr+upjbyjTgWvdG\nucQA/GL9coRAYAx+jVKF69vN8sk6z0MzsNnRvFAafGKNuVaKdXl/eX94vsm8\nxAzbQoBOw1exuMrBq+Ceh+KqXQYUK1iiOS9rtWNBgnCDUDrW8GI8RUfffdJz\nknOmHTotryLpSzNnA42erQlq7LQDYoXLUhTct+kC+g+UHG7fDzkLIfuULkZd\nAL6N2H0ZdXzgEMCOru/97IxaW26ZTr0nZKym1KfekgOPoWZyHFl3zy2rtwH2\nHBOJvRcB29TpNBZ+ZxBg6EWevBCRVNywkQZSlzfmDyzgQHXc/2mRV6ta802B\nuqmaiiDo946ocvy9JAU/R3d/8mOaehY/2bXWFlIhudM6TDI3HGIKV/44WQhr\njmwpGHVV7itdD82+plaiDqKP9n8in7epyoNza8fI6qXW1D/B+UiYrY31fKVi\nQNYpi9n4WhcqM+V2kG8l7PinxNMI7Gc3ZHt4BSx5vimnwLvlM4AYxDpOj79Y\nyxyMFuKqCKIewquZQKlU01kwdRjCeSQO67dl2rUrqFN2TumIjiimXfSxyBPr\nuBNHO57EUsfCOX8hSiaPFlYNVO01su2rx4iyAYHQ5uZhmDCVlgGC6bljuhyE\nXHrW\r\n=h7lE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO/FDqTKgtyfTYqrGnaT9J0pz0v0RBX/fXX48jFYML8QIhAPoI7J3xI9GKi5FE0HIhiuaIIzbypyI/HUdlxes8tfCz"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0_1612935511917_0.45204421965893404"},"_hasShrinkwrap":false},"6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.12","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0","gitHead":"ecbe517d142b344e8fa8ee48b4e656a49384cf22","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-LemJuUo6iaYLIcE400OdR25BzeV/LGlP8axkQ9rzRwx139LvXSYQl+ibJjOpGQgr14GTlRLaA3v3yyySGYA9ng==","shasum":"ff58673e8be55dd76b0e0abb511b728e665fff7f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0.tgz","fileCount":56,"unpackedSize":303806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3GGCRA9TVsSAnZWagAAEgcP/1lZxM+a9kq4aZl0R6nv\nhOzaQtj936KC7sTgbnsaFBD6+5RnQ0PHQr1LWq5u/5GR324s3o9vBy7j7ghq\nlRAmqJRY3wpfBWgSk0my82fUfVnN+eujoopBgKDOyhtr0jpQ5UKda57+FYoN\nHtsUtQa6ZfgGlR+erK0BEmJXaH64rmJHMMU7j5vgKntNhNf1gx6tW7+FUCwk\n8DAqPnXSR3Mu1Od8hXH6p3qJ7yOu/3CSLSLih2DwOvZt2HGWiaV5BkU/s9hO\n9JgVZTIKgJ8IsroQdpWaGZ1ALEUqhG/WqW9uj2RZI8y0690i7kWGV4vGoNRE\nFdqA5zqqX9xIe0N9vnwQ5oM4kkUIQTi5RByTML0Ud1MpSBEh0xip1jN3badU\niJHI/SG/an+HezPXzxROs/ad41oesBfu+88szaOTb1Mlz/M+aBYxFpSDr2Bm\n6REfD4KojybyHcvQmeV582LBZZIvu4bHMDP4Mwz9wMQnUnOORFgEaOtEmh/C\nwlDXBJknSeJKPHsAAXp4ntn5ASXiNwqzCn8f9HIvoiTa8UKsYn+x8QyLF5Sz\noBHb0HTi53rmfLI/e3p7t6wGyDO6QR59ixUtRhRnPRKnotNpornK9mQdM35y\nCGZdyw+WMr1O9Hb3/xox14mKoUyd+q8VujWMFORpYKCUW0t0GRg/upp41/Jb\nMSKc\r\n=9Fzt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKDINWIDN8iU/hLShLJ5N69Q/Q6RsISL9CmUerHCd2bAiBnrN8aAeZ7wmxylMEL9QANZiI6hh5DYw1gc7HJbY9tgg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0_1612935558031_0.07342411616273647"},"_hasShrinkwrap":false},"6.6.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.11","gitHead":"ea6e5a2d9edc9c999efe7588853d6340c3a817fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.11","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-8jlKUEYyeN0+ES/6glC14pPXcBpjV1qtaTBC/GVDLRalDljBga8hyfSqaivhLwwTGyqX2soC2GRixRnH4bFVPA==","shasum":"10d79ed3d7545504f5cc9e60642fb81fe7ec6c5b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.11.tgz","fileCount":56,"unpackedSize":304205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3GhCRA9TVsSAnZWagAALi4P/1vQp0loPoMXGJlCuPWd\n/SWhV7KqofuwuIsVaHF3DrLMHJAxED7ABXCL1kf+DI8tWMNVl42N6dBWDlHO\n8x4r4nzpKjnb7F7u3ezApsD9xW826DGNiGP4r1YV1fdCtryChcqUCrzf7s/C\njlbcAo+2PjHGlr7rM+h2TOfzTo1umkR+sbLquVUaaisaz1DkGALl3zp93/PC\n88XaFhD2RN3DbVRgZO6cHDgm7l/+iYd6TLs9t4wNDBhxEn61CBSmGMz21VFp\nZvuK2QZbfJn9/5XkreE8YxdaldA2xaV60Xy1xoEKdm42nN7GH2UKdk/qQ4Yc\nRBBbcSBETZ1oLHUOrGEFIMVUbuW3eZu+sIjlqyNq4eVMrEvYZmlnKOGPS9uH\n+803y3SZKnYdnVFbDAqahupyE1ZiwDghatenW5/OYZh8olWgD1d1oqiYgChL\ngxg7nn++rcsgBucDNm9gV6xHG6VsLN/20SvfEkbtq9SbtUhtyWLRxHdX0BmO\nizNPBnMPx5xHmV/n5zoJ2WOGr/J2O6RM2RM6fXd9/jizVRe8HqMImpakM+Wx\nMSbflJeA6f3FeSCYSmaXV5QHggdY/+S6sjOj3xk/6eIdtc9m1UtZmPME2hDw\nBnrUYeMhDCeubSyY4jw8mqT8pa4Gu3OIRvxOAP8Oxs7Z1GOzVyxWaWMmTFwi\nBGHm\r\n=TVLu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwMZVx5GYSetvnTtErvsgTEtXHqCuOjmjFLVr3/oUX4AiEAj1n4+EnnLlVrybo9Z0RxyQOegQ37pltKzeHoxvxXKmU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.11_1612935584857_0.044506437698115686"},"_hasShrinkwrap":false},"6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ea6e5a2d9edc9c999efe7588853d6340c3a817fc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-xWh/W9pzbgr5+DXL3v+4pjep5fZQ6yowDUUdi6o5k6rgKIQ/FODmjKCzE+LD957OitlBiyT+lPYV3C/eFIr7sg==","shasum":"6f372b60fad4291bca64e4dafe107e88c6d38055","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI3HCCRA9TVsSAnZWagAA9FMQAIEyfCzozgzEYRGcwj0K\ntM6cAYI0+hoFXYqvzWSQ1TibUDl/NN0IzY4gT9HhKMpzdWpphJ3G8OIa311O\nExUdvrSpY2VY28dC496I3hLarytXIpM2QL1Lw1N7ZRScXRLXfwKLJ+5Za6jZ\n/b1jWTZ3zguYaAwoBbo432euZjTEwJYQzDmlJ3DXsYGn11TEiWP3du1IcLb5\nql1feKwnEDTf/Ep5igosDqBF5bWF6qmfr/DSXtS+9NYC/jNYobLGQp3HQ9U2\nHAl1n+LUCS6JN8fIcj9POqdMverpPUaE6B+kp4yNkZ0k3jibjJvI+nddYIeW\nF4raPILLklu/4jSz/GxJ5bB/XMTpsfZE7Tok1YtFABTVlOx5/LmIztWh07iL\nsC4Fj4nFV1QOgufyGgvMTl2KO7y9WUObKw5q3Jd0YtqPHF5sSHR81HSBegTJ\no0Kcrk0TLscr3JW7jblHMnCM6k31uggtB84jbbHTsbmIi9RwIJBAZ/+fAhhw\nfSO+UodtnAlXLhKpwR8ATfukTU481u4YvjoaGenv2MSokJt98izN3Z6rtEJn\nSw5PszJJ7YsCfXmBZqJmoeMb4iO8+7lvFk4v0I+45t8bjP8r1hWLCpwBoiHc\nNs/UZMegRhi79ZM4WBGHDPPWA0eITw2rdIpstp9Asmo3CIQjmvZt8madHo55\nDaL/\r\n=jHuc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLVRhapBO51G129eDtgNQvw9Mu5xyuc9lq4PuoQhWgwAIgL/XpA1Sdjvw07XQNzOKLfVOS5AbOaiGJEHAz4gP8wZQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0_1612935618294_0.7720172877971065"},"_hasShrinkwrap":false},"6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.12","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0","gitHead":"27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-oymEXDCFNRfUxta/orhQuF+RV0DlSvWzjivUySeZsuTT4enMI3Ah09uQjzMo3qOA9Vr0VyOFEEeVtkyMqvQr1A==","shasum":"aa647a224d64855a509d334645d35d1cf2debd90","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI4h/CRA9TVsSAnZWagAAUR8QAI93/A46s2nXuuJKSdlT\n4TymrSsHVvyFV6RMZlAUZVJhRhjJrhuC692xiw4JtKA+aMwbmIsREcR6M6Fb\ny9rEWMdwNHug5VLTIohLUGzxYtcWK8jrnY/ISY1pgM+51J+AjlCNy2iOyOhr\nVSuh8GVJAvmR81FkGISI+BU0bWwFGZov4ILSFnGXqPPpPPldasWQq+f3eFlj\nYGomU6EXgi4dTpV6Kxn24m1aA97naf9lY9BJDQdoEb37H3E6LOXMyE6qmVOI\nPg8cxmQeaTpF6q7glZZ92WfdzYPKVhyaXYq1tCg3GoOTYPYGStdZ6r7krlmB\nRg5CgnexE8M2yf8dcs2tKtxNuDYfc8NSgO2b/3W6XBE53qE84VkhChKyyAuC\nddb02LcJPDNoar78bYicl3Z0hxB+8EN6yG3FohJGRK1hMMK/fZ5BPlGZK7Wm\nWs4rL4i0D8ibsPnyI4HzwTq5l8c54zDkSRf1GXFfIWIlroet+dUSgOR2zFPH\nJX1NVSqQArTUQ89i0A3afc/HrEvCkHbnUv+7od88WLmMjZ6d8KNAtCv2G03v\nKfdjPhxG6ncqPMc96oKXS6hr8029yGaHnKcKlCawjWzPADtJ9NgVZ6XYxDuP\nLdU3DhObC40KxHowHpqxn9wobbYArsmuRcGBhoaWhhzMzHqc6I3ECoxZl9no\nkf5s\r\n=EKOb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5rLNU7Ns1C55vTZ3PEvofldHWp70oBNB6kSS+ChKIVwIgNCHxEPFZWZEI5x+0xIfOZ/P3suJgt0iMSoHrntyaUmk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0_1612941438586_0.940219309037543"},"_hasShrinkwrap":false},"6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0","gitHead":"1ce69cc23384beb47170e58efaa5c8fafbd051de","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-w1xrGe1/xCUP/rbUkCd03UY+5rSopGwPaqKVn7ljAx4kC1WMol2VrHkqAPp8FxB4YpB78xUnh4z5RkZiTI9wlg==","shasum":"95c28a8c679885ea4cfc9a280f67aa220219b34c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0.tgz","fileCount":56,"unpackedSize":304788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJSWDCRA9TVsSAnZWagAAtyUQAJH05GtfrYwvqHrsfgrk\nsDMRkhKlO8cHSwbGfFwbIc5IzvTxu0cogdZdskc0GdKYEcQAMoUjAEhkdbl9\njSWcFZ0i7uyIzqCKYXiF8xxeGo/my3jaYLX1NQzIPGi4vZx9z8py9iOa82rP\n4g04TK3sCVPAGoPDxsREkieVKjFBv+L7BN9eGwBuGhJzbjj9w2EJD/xpbcs+\npQrrqkxQ3qp4LcUGiijF1wIGyuZMgBg3PgnsqL75rcpQZGwiSypkC2+NXn3Z\nx18PDrw4+mLu5RSzX+mlwtYcxIndst90tXZWNLsY1EU6ox3IvocbOzzUNvCx\nhUiERMThH6F7U35JYTXrT0mXFsdig6Fh2roE4yrkvy2Ep98eFjY4U3y67/WE\nbajSFtEJDwA5GbxxKTGXJciRZDR9SgnVhMlWODK6MBvymc8fI9At2ZM4/twS\nBRqQEXGlP750P5kIOlZKWbgkLY9F8oQ6YrO66p3DyGfRgICqN5Q9DJDjy7C7\nX2iCcoWek7t6ppLSoLZ1QNpL0eZFlp/ZQQbzamfcyM+jJyNgMi33ar2xJd+L\nFPsdCFnSiyDUG9RB0gjKGFw3sam88f9HzjqWdZ0wuGcZPHafj01uJq9BccSv\nlQRTd5/3iMZajwlBr/LzBddM3o/RvLABCq9AXRytG5O9CuvSyfcs2McMXKPS\neYOz\r\n=1ukA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCelJCQkf88Ru1e93vh/0c/t+pM8OKXhA4XGFQ24UAwEQIhAJvKL5rb3GFOP4P+9j3VHqeXqbp8HFiubtfXHn+UdRSN"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0_1613047170650_0.3973680610664696"},"_hasShrinkwrap":false},"6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0","gitHead":"08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-CyBPpAO0kI62QrOhqNkHeJMkozJfoBiDJJhSeGq464iQIwUzulSq79LLtElgqqYxdi3JLysaNVueDfgoXhSYcw==","shasum":"411d2476fd4f526ba62156e295deb77f25616f2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhUhCRA9TVsSAnZWagAAb2EP/0neEXaJ9dDdveJPJ0H8\nopd/zFdkacItH8eq1M1wxapxsFQTMfyB1L24ig1dj6QJa+/0Eg11gcrJHCH8\nHMKZTgpzNp60D5yOmoWi8jqu//HF5BxeREKWJy5gUyCY/3yBBWdGTSioIFY5\npZi0HLHRkkYIIt4bnF5d/Y1hAYzCnVeohgsZ4ylqcH/LVW3JgCkguFDwcxJb\nj4TG5oRro8OPMiSV1vVca/IPKHZFWE2MWbf4SqWLE1q/Iro0e+XPsOZHaqvV\ndpIzPPwnutMdb8zXqzbTzk7eKdOyClW1lfOeFeuk1hSoGdKnm7Zd2gvVNg8Y\n23rr5o05WSQAlBwZ7Pll7E+bBbxw7UOmSI4mPolAdaTpmcgpAcxZ0SucqxrW\nG+ec7rfOIXWKKc6iBfuHK9DS2LFzSmVSyP0CMeuvlgVp7Hi0BB6yEfQPD/SF\nz9iX0/IbW25f5UxQ7DT5qq6t82VHK2J+y87M3UFl++2b2XQXnn4X7gCwiR8U\nUdY6A3lPJUCobEB3fisM6YYj9aVbknSVyZ9PPYzJut/fRewIeI1FsRlsTRGk\nod20TGELh4/poqPgQCTDOWJmLMcmddCTm1oSAVQ46JFagNbxdGTE7rpEcCCU\npUzuHzNbBkheMFPIrDMG9f4/Mz07JjfkAGi7QIe3o4J8cg6hRal0y6h/UeEW\nbsqR\r\n=AJBE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEjOxMXibb1mm1StOU9xzEWTiWoJ14fBEr0X0Vt8vbRtAiEA9hMVp6fmgaiZsIY19xQWYcChxEg5J77ELasPVZIv19A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0_1613108512656_0.4067499996401869"},"_hasShrinkwrap":false},"6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0","gitHead":"9364e81fc6842365aba5c2236d2533ab8fc76528","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Z6a3MZQQV/+A7c3woD/AKBX6LrIbC04oozjDr6KrCgm1Jn3tCuW6rSPM1dhqoUemEi5dkA+s2i/Fa/RsC1Xd7g==","shasum":"ce9d4ae4746b6f022766545c52b0cb379015e46f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhU3CRA9TVsSAnZWagAAWsgQAJU3UA04CTFIU5rdLLG6\nksjdeQn8bEAmxN9gSGdT6VEiTYLvcjOiqIVX8yzfIrBjZYQotKbl/9i/jFHy\nZXIm8fQXklrkS8R3mr9hamuxlpBxxneyQdJP0Kn3WG4cDcmeh0Aa8RZjNMb8\nto5TiHfdxbLhiebjeiaRjmB7+QKXTvGi4nGEpTIBGhjRCaMYS1QSS/G9EVRl\n3BG8+vhMsE9vzAj9RO1a/k2op5kvSq1B+xYNUofsrslblYl87LtThtrUGVAV\nveXx6oUfCNhIfHDtxHccfns4508buFRgyVviMNcNAoUkfNfKDZbjYF0ZpdZ7\nXbg9qcrGwntiZPqEZDqWji53ss2iFWKGuy1UHI+1aBM2IR35+FnZQSfjjyad\nL+kKJ8xfDRXD4ByW8qfa7yZBFQB00LdIzYwvnOoQdnt3APz00z6eVp3WspRw\nrut9AxYzKAeZJmHjBd9grxoeV542Q7DE8ETTUIz9aTBohhbvupn9k1TRA9bN\n6IwwLaezHZhpZJWebNDt8dtf+oDGn9c+Fk3q/BiyYptP391QeqqQCCIRiCyR\nbxTk9VmFAWuN+xf1sIs9MFfXKwTC/0dtE1n2sSBnpyC92CasXQyHXl5bR2hv\n3s0ElyoscJM2cpLqVDZf//u/NJrxB4LbFLqEpb5ONUIV9frtTTSwxNdVcfuR\nq2Fu\r\n=1MZT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGlS/2YY9Y7zeFYe2roZW6mC8kqRmfk/sEjCfe6djSPAiEA5FLlLZ2MP46h2A8fW38pZREd8xwXRjtHYs3xnG4337c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0_1613108534800_0.9194183466037054"},"_hasShrinkwrap":false},"6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"382c044f6f527accd1220d388d5b99c3477d8eaf","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-9zz67uoD2zv+MhCqe85LpC2AesxpYq1cR42fjmJl3TJDMLQWrq02BnJR5Pqcw/JLZMwHx1rB9q3CsIe1sswBqw==","shasum":"c65c3d23ec7c182fc613902ab56ee3bae3a10095","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhVvCRA9TVsSAnZWagAALm4P/iM9JBXEHewqezSEr25K\nM42n2s+GgtcMwEVlGieVul4P00MCO2GkrDf8zAqxOLDX96afe9L/5I40ZpNp\nP/v+ozKwrotqQ/YonXT32pVkmoaBedQ0JvxPK1afhQ8qVwQjKToGWD5AfYkM\njty/tcawCDX4lRXhGbVK5+xLJOfoG3LQ90f4QcQMh91r2W7ekLP0FUC/veuw\n9ff6hQmb1dwkEB6RmHTYJBa5bNIAkHu6XfBV8rE5Qo/owAeZoscBKutaphpc\nAq97U3oPyFZvRbP1OqpmNAIGlvmMwidzq3jGn3DbRvn+rcS/HjwPSXUXwB15\nXH1ol0Kc391fwqMCfSlT6HreG8T42qSyM0W0/7LcllEQZE9OGTcIUdj2GVBb\nse9j2srrKRSLeFJ3ijPYvzLOREbu2EKr2c/NZdEa4/twHHeP6Sm2FjbljC44\nvgxOtUhRUlCTaidYNs2SNSbKft6KmiSIAHGo5/BOlNGqY727trZx0dLMlQXx\nbwKLxk3YF4tyePUcGPB7t81vOKDJy5g/iLUnbqpNLHnI9xXqlvin3HqTAFIA\n4brg/7Ted2zpr8I1DGVjTmnH/qDyMnRi3rxbXPBpkxBhoZYrJzMItsHnUMbd\n9k89Z2l7RK/G9tJuIiwzgxILlbDHCFhYuNOyCKbXek2WGqUruYbyEgBl1W5l\ncPr/\r\n=rQQ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwtU0zQjn9oq39f/+3sikqgHIn5cCmS9IfrmdcqUQK3QIhAO7h7mR1PH2IcV2rUuhYBQOkVAhqPQ0kKIl/OwJfzajG"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0_1613108590440_0.22803379796121637"},"_hasShrinkwrap":false},"6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.14","@types/jest":"^26.0.20","@types/node":"^14.14.25","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0","gitHead":"c572d8d2508e1d884db3a2c679974260ad1b9b6c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-bDcWpOeHlOO8g67jqaxVDEnPDWpPfJ/YD4Hpy10CBXzGdU/bcEroPYHERVqG9CQDVVTT+85s1mVy0kOoq5IpxA==","shasum":"e658247adbc153ee08c44c68ed847f6d99b7578c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0.tgz","fileCount":56,"unpackedSize":304248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhWOCRA9TVsSAnZWagAAz6IP/j/hs/Ze+Aa2mXVn8VY4\nj2tltpldpJxRdeNgfVL98mW3o2PYNlxZil0Zc8ybPLXJ9y5Mc2ESCvG7Uwg8\ns9YB4RaEDRhTsC6Ql1sn0lM5gesTS6miteJBEVab5jrf/f+2Mr1Hc1FM6myQ\n+ZwgbQ329coJwGv9Mj5vps4IwMCCmCFXR6IcK3FxbDPv7+k1y0QqsgFd4OJk\nsIgBeKqeP8YjIsfBQVoM2XZV8hN5A0cIJEYacBZe9OsSZJQ39fC9Aoczl9qd\nMXZsEKljXrJpV3PGkSGScCez+Lw9Qgt4yYNDdllPbs5feZ+rJm1EtGTMz/Mk\nuUWkcX0tdRz3CQC1PSWGAG3xB710p6dJ8rjhFMW9x3qAigDndmtBDeoY7jH+\nvvxEw3KBNFYhXWcS9kWPNU4YIzChlE8AwV4FbtqwSzLbpjqNJifVnrmsze62\nRGPOk4Xfwr47VeE0cf9Sysld/wKV2vxG/rbSfxXJUkasKEcc3Qma2K4ooS8X\ny8lFCWCCEPTJ5CLAzLdWyle1Q9ce7qgDJv4IocrHBGO2eUzfuLdhBlDeCXx4\n+l8hTMZupHp2TjWX5EUejHwKdc4A6tQ1Z6W2SwMjCt4RRqKoTeIvQbOyg48p\nnHhsY/N7/pUfbWHt84ch0qMQeWx7g0EJZWPqh+P2YLGrZR1GD7tETLmuwtGR\nvwJn\r\n=WANG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/dYQMlO1inapYp1m8Q4POsSXpw7/IE1HbAuXEiHSKQAIhAKR7iSNiqFZ3+CvbN6/wanltr6lFnN/PndQa7/VNsrF7"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0_1613108621776_0.13966955673881842"},"_hasShrinkwrap":false},"6.6.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.12","gitHead":"6ec51569de81668f22aa0e84ba62af1ba4300dce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.12","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-5HTa3myEj0QkGiWj18jAKTr83Qj/OdRY8GEcoWXPmqp1hFiXDgpAqy+Ioj5vR3PS5o6FmhLiv0Hvx0nCP6iRtA==","shasum":"ce7c41fa14bb82ab4405ecef267d4ee61b193bad","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.12.tgz","fileCount":56,"unpackedSize":304655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhWmCRA9TVsSAnZWagAABREP/R2PubNQVH4JxLUvvvRz\ngWJ4tHfcnNnvngvImEEMXvT5rifMXBDGFu/04MTbUMfpf3KfnTWlt+QL7ZMJ\nA6vK4WAIeLQW3iPEKqJIektQEpdLgU8yIcFEUINp7UretXUxGky83EO7sKsy\n0Hf5Op26jDK8dyZw5OcyuZog7+VzmJzlQdrkuBGZZTrDEkuAVNpPWGaBVhr1\nyYUE4B1zifXp9eNeXiUTItRkPt3LmgBQ8UBJ0cCEXj53UCxW2nxVIXzQRQpo\nx3YjAhs1b400R8yk6tgNU3kWfhqA0Tfka3e8rJTum3bVo6DYcn6+FxEZ0XWB\nDclx2EB5FyC4tWvYezynwMjlt4faioOZnKRjhDGLw+B3IiP1bmkoKekJrtkI\nNXWLTFLW+tuS2hSFCJOGP4vk2tfnIH7SJ1k1019045WVLKtX9/N1+H/isbES\n/yigcvyUldoP4Uo5DE5pbKzNSqc0/Bd0ZjTsZ+xl95iYZh9GlY/fZnRY6Slr\nbzVxS3RhjDTN718MJHcvvCC7OVWwznUBJ+0LNdoA7RFwjDNbetLtPdn/rXtE\nTJxfZ+i58XlRt516c01mvETZMBXRU357iIo3ZSRINmwKvVg0ePmh6it8Toc/\nsglaTtE3J1fjALzeJpuI1EM4sgxuQmLZiAIBVYxFfnXT5fKScahqwAoRAZs7\nOMu0\r\n=y/e0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHpND9MDxKVboD0FTLYs+IBkVcvTwNCiCsYazngxRVkVAiAxxuHcrUk0eznIjpIXCYTPocyBGMYP2OANqYpdIchepg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.12_1613108645868_0.6591628108387144"},"_hasShrinkwrap":false},"6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6ec51569de81668f22aa0e84ba62af1ba4300dce","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-uRQ1rdaKmfhgVM+fqeTOYuye0QqrdMe1NYG949Rj5Fkf2MH/Is9S2LuP57W5YW5EDvPzr/1P5sSgg2WqChhDXg==","shasum":"4f533c0ceb6327a2428d09fd117530c65bba4f50","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJhXOCRA9TVsSAnZWagAAEhkP/A1MzQLNT/896UJtUw0D\nAlp9MCJq1jv/9Kn7p0zT/jkwlYNoUdCTWKQf+BcAku38G1VsGinM2WEJHxEu\nC8gjGqQ/dTrkvLo6qr3q1YaBhPV35N+tPXf4HLIq/ZTKnzmW8VSmK6gxmlEB\nazqGGD0CPsv+JzoaI6vT/oGT6IdFCYoPxfhp01RqzfcERJYdyHTfToCwhkLg\net/xQW5xGiOzCYodOUcaK8PKpKQbl0rd4gyszoaiy1eJLvD2rWv1c6YjGpQk\nr+zITcz6uEIrREOdCgj2IeDLRav0/X7g8HCjMUpFs0ZaJDJTC6KgaUg2dxW4\nrY+NSgGjenN9jchI7+Bl7w9kXuahVGiGV0aeNmNkdiCbXjkxkAGevU4QvuCi\nNvu4MwUCEO1zIUcjx3KBsEHiHbpDyFb+ilO6Qy08VvyLCE7v5GIXlsItIgtb\nVrSL81wP9hK+gC5f3PPMVDFQoA2FXouyMIWMG56GBoNra0ruRkYawzUhfo06\nfdRLXEcy3SkloePXaVq1f2TrCd5D/1vs4ZdZlnyUOFEga+81hVum2SJhlKjk\nidAUhXpvrXRPIQv8ty7Id0JgGhHid/2Yg/+BEajCmatUY7+npIdqgCnZNyoM\nxQoGWcMXFxVbrU6qsxufE+kQSeqEKK7hsw7KkVwCpY3GVJnCTOTcqCMcbhaG\nEVvz\r\n=H9hN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBG52B0ywhfX5gE8Sw26K3ILht6Yme/gklxSOP5s4W6dAiARXPmqRQf+LfP6kB0FfqkekRpMCSipEaSOgJrABexlUQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0_1613108686039_0.34868016943791735"},"_hasShrinkwrap":false},"6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.14","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0","gitHead":"78b31b2264c8bc1e74fe98b430aba2890ed7d7e9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-pPObbnMLcMkNBufPD81jhOLkXWU/pUb579ZP/6lv97GQTz8ILmLQjw2chxmWIH+XvJzUmSAthM2H14//J4H49w==","shasum":"a3319a642c01251b817ba5959a5a8a4be08e4d21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJivDCRA9TVsSAnZWagAA8pMP/2BN4v8w3PasiebfW8hP\n67d6E6+WiMeC6PwVx3+QX7JW9F3AE6hmJuRnOPg3VHw1euWuJ1Jpt167dMn5\n2NNuLdmLKiirff/nfN7QYV3K7J+b9wqG59tWiy4msvpmmchv0/I2BXPH9+b2\nWLA4InzauC5QsgllKoYLhOFkEwFrFIzHg2BfGIfdDIcEV+KB1zAcoSaQytlX\nykiFPtPcxSeQT3SEhg+eWpTF4QG/gcKBp3uT5k7tL5K7CMUEaF/z+pHQkqRH\nVSwGbB23g197jsqDUgV70Gk5mwP2916BJxWQxqACpbpf78uCboVkSH43f71M\nP01KOFfVSIv7YlWs/UfqUzjJXXNfEuRrCleadLEvUGbI58hhVLszcRCFZm7C\nft2r8WsIlUKt8Su+lnnxUkZ06spst0nxerKzMLC4Y0p7FObP97lWBeEKGsj2\nlOJi48Hp8m3jNCYpioy1yv7yDsBnC8V1xcW3HTEjIZfGM1c7GhRaoqTTi0Va\nGmM1aAnL0SVEVyKZinncppwWxNXlZpWoGjHZDWU09yZQLlUGNB2BfR+z9F24\n+mAP0dK5WQ63NpFIs5l2e3/9+0m2/rky1C0WeAN8BD+tLpnUliA3TTTvCewM\ne0ndnWOqRq/qeeMXNr38SC9+rJgTAHjhBKE8HBRPE6JIzjjALT9b3C0CPlQP\nZ0QX\r\n=lJpY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRInwQAFeOucn0hHfG0ZSDSkEOGgY0ew1VCVeNE0UrDgIgdiUlKHkm/QiLg+fO+d8skxfbHqeNCrXPwt9dnhKKoQE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0_1613114306594_0.6340504101910793"},"_hasShrinkwrap":false},"6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0","gitHead":"9d361c57e10ef28d905988d6b3a5f96664bf0371","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RjE385jcUhT5BUnuYj+Ybm7/VMes6qI5XCtoT1SM+kY2tcttXR6LOV5KjvstVZQE4Kf1QlTYUxOAE2ItzgUV/w==","shasum":"3bd2eb74b030aea1d1705b5b9643b6d3b9150fd7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg57CRA9TVsSAnZWagAACa8P/RvyWE7IM2BuV7LuDaiP\nroGsOaHo84ZupY6rbDeoNmrJ6/kNApQ1V9cJo5y9d8DYT/XrqCuiW4Z44nnl\nL6TwlYJz6RiGm/NcSOQKrsNjJCfGaOBS7anjwLFFnT4zyGjZH01cQPxVIPvZ\n9FBu4otrCeltWjh1RyrZ3q4RG+hjgTboUAoYTMnVRZ4GXls1vGGliosG5Wj5\npxz3O91po6wwqDirXcx0louC+ivqM/4/kg+ZdVIghDhLj2rRG64L5ZT3uDnK\nXfv7+9d5Kw05I8hWnroOreIR5RZF8Z23vVdbKIPmZE6/UE1a4kyb3OEo/vtF\n8oi0o2dRlzKjFSG7QEYQoG5c00f2SOV/Eo8+VLB+BeH704B2xw7m4IRKTFeu\nJj93hTdfFNKXqinOdkRugKIkB2kzwmHPgeY08qfzUxlZ6giKrIqHT37ZlN5j\nl/Z8gFCO4syF4auVhTPEQa3zzSezkFgI1YJVI1uv5D8ozNCDpxD6qDdmlAQx\nY53+T7UL/0uOcO7Xk7Hzeq1vAqaIxx2lQf/LeRzbmlxO9I8qs3szG/5qoc7h\nRLNYxl0J+gMj1xGMnqRs9G7SLv+01Uxzt7FUu39ldTQt1jCJWcpUl4PoXo8m\n2u3NaoOFVThjGI3JefmU2k+uBX4elFnjQYMf/k22l2cw84QEtVTbWdTA6XD+\nCEia\r\n=rqXL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2lDQp2kb5mf0oimzbEwT6/qHjO5fyh/uRyxYfRpA0JwIgfElUhhx3clucu8qzAED/JESTtFhAO9yw7jTQo8WMwhM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0_1613368955276_0.35962381193250104"},"_hasShrinkwrap":false},"6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.12.1","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0","gitHead":"2ecced3717357cc30ab3215fe2023c1f73b8eb1d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-oTNhNfzdjGh9eJrG/Ek47tCHdm+sNBiQzZCiNgpRgQ3TzvdEzFkceZkiyae9cDvKUuSohlAO94XhLdkNzO0j0w==","shasum":"a56d1f30ee9feb4c59547a363213b0374d913065","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg6rCRA9TVsSAnZWagAASvYP/2w59a7cUlW6VTFeXgTn\nME74ifU3/JgfpksVZo3A+zaRv389nDjBpo9/m/VT6TeVndyoF6IoLs3ukAU9\nbSnwmS3wc845vihG+YV40d87LW/e4ksVPmBtAdBASHmsCusm0eejrVY+nvz4\nsIyZ8e+kfYFiAzrGxrFH60Cdoi14KRMO4Lu3fOCdGBM3jkCwBEGVY8KNcd3i\n6QGtdPrEZ48d1M97/5IcK3LEzCqftCSXaFmRijxUJytI5Pjb2mw8b1V8fsn1\nFF5DGyQ/ACspk+h8BsuUNNuIyW5XgcBBvDrB3WMnuyyp2t8FrV0/b+/KhY/s\njx92mBLBuMU6qcorHLlMNazVjD1MVj0uXtXFRyozoBCJKmFe/QHp/b1tnbcI\npB8Pm6m36bUdYSgxGthPcI5JHsNdqXQCPCT8QLb0xhjATVxiLC7ZjhNG1gKA\nh631M+SqWxiw418Q9gwW3Xll0YBUfsD4RBnEvCrInMcJpZ19E9qMj9bdLZam\n3hPI0wxPEf4Bz5pv5YG4ibHjrQaj+tDSiPrJFGLJcx2+7aXUFyBVKwRExZtQ\nFg0mK5SMiNvVZToSQN/QSJ+9YrfSjWy1BgksAgcuWqXcLmIrthQ8sgM495I7\nWA7y7Iuk4qUlkVmWjX6h6wqkICwKRiwybujkmZu3oNOsE0zt29G/uaw7JcOR\nMnWF\r\n=54iP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGj5wELwnJxdjkxuy8Q0M2UpMGirMhxzSJvySL4ZLxaQIhANaqcodPLPya/2/WReke+BwSUgqZRK4coyPrkAhoiRm3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0_1613369002426_0.4751270674757344"},"_hasShrinkwrap":false},"6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d332973f7108068400379cdfb3db475ad2f816e0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-PwINlbZgA6Itn5w+OJinIQDrXn0vLJDYR3mzMrW4iTn4nf10QuflbsXmwrv1Nb/NpylcaBH4s6ioEScztRQcqg==","shasum":"6722022a29e8ad13aae018dc94d44420840f017d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg7TCRA9TVsSAnZWagAAD0IP/jCY/HibgT7EKiFVupp9\nd4YIIKgrB/QX4m3U8Zqj1G/mZCIsnaNEqr4I6KI1rYze8hk8wa+rr8s/IlSf\noZfK6s5nOdYasYSMyI4MIITBygtyF2cFIfK0AVNezNKXiyFwsB9hNeSExai4\n2GNMa2vSobsa8S3VKgWTDkv+rem4jJ+fWvuYNrz0A2miBe2qtF6KBZI2Cx+G\nqwk0Ur/fDm5Jf9V5AGRpxaXtSb36G1Ljm1hB+Y+2gOoxKKJwE6Evh89jyP21\nIIPDhcXWPS9tTFaQDBIZ+ozAfcenm4yj26t0HIA1DhnkShWtsmuOKMU+VHJ0\neODz2m89EWd4fTMU1V+yR5t82N1TQ4ipzhxgezNTYzm4Rwv7USgwpZTdpYff\niwym8xdhvFaUat+qzI+g4h9CkZy5UhMj5uYFmKMmFWLQLYy756QNVBLw/Cld\ndIoxWAjTfdCo6H0j8eoD7uXiyyPZ3Ot7ElfAX3CKoNoNNduyicOBfBiWX4D1\nudXORaAWdhnGWv8tVqFCvWSHrnBftXOxwKn2dDZeqh2SDeYS0vmQhZ6pCvE0\nFNO3FmrRcihsXZGelpKYDfJbrcUcz24Yta9ClXQ0+62Z8J49EDtAeumZWmZg\ni8PAh9I4hOgZ3JbQfZW5Kc1WLYHRTTJ6QRK31KU5xSWEWqvZloGG08UevKBH\nJIh0\r\n=cl6k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu96Qtim3Oo166XVq3XHj6y4/9V7wIFipf+BvIprkupwIgEOXHyJiHxwWawdGgG4QIZHSNjpVJCLxno72sw5u1aM8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0_1613369042717_0.08457845249072826"},"_hasShrinkwrap":false},"6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"09652456e4767c4e8884fe32b46f262c05dfcb20","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-t8PpgELg5upzhpLljDAAeK5GGhI3twp00upYuIH2c+Do77YCEw5vOXYURB5eapnEGUhQy/endQ4i7ed5T5ohaw==","shasum":"5935d88f5178b9cefda94671beec8ffa6d66a406","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0.tgz","fileCount":56,"unpackedSize":304698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg77CRA9TVsSAnZWagAAJGEQAIP7GwOQJuICWzPlApP3\ne2qmBGiLIFnpEad4UTuiizxgZXegF5+6hi88jcJQ82jF9G+FBlGQ/3S5Ady5\nAo+aF2tB5muvbcpeMb5ZBdCJndEDgg43kVEO5snIPKHuh9BccTe0Uvefmu05\njjYGFvcM1wwsle4TG8qdCEYrdN134HoXp8ez+F0m/EBqHHkpNLR2har0d7G3\ny4uxSqJ05gtBkWvg00tpIDql52GPG/FSYqkKhBWAjthMpKUnUKrNHPvpmRE4\nYCJQ4LNiHfjKlgWlH8sLW0xhQp/gO/R4+aUMZpVuzC4AVD4WLhQyRiFcr4Iv\nzE0W4h6F16DwowfJELugz9ELnN2rAdHa175jOhTBTgJkcjNpIDG4vMkkCMIV\nLRWdGRuhQf1eNmemiU7tTec6Q6QF5932d9LPVTtfrn65TcHT0Fo7CJVQRd2l\ni8jDKHQHVBuNpcp4mhZ3texT9+tZS6z+zdkIq7peaalj4U1p6jOkIG8fYZJu\nb6Ogfdivxkb8OPmUk413qicyUI6bZP/v+G/O7zTei6Dci8AZhQ3f6ngPSJm/\nXSZ1XnssSV3Qhok+fMU+fUwVXZgK6al0aYyGqMZBLbOoEIXjEhrutYEXiMMh\nYyqKoS0C+nANxLklQBvSroZtTsq38FHO83NYOw+CnpgGOPhurazmgBgrA1sJ\nuDP1\r\n=ZDEd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvjN1a2YExPpe5faesHnxbPsHVz/TLvqzaqa4Slq+T3AiBn/3MaNUA8wE7sOVKq9jbY07CqyzqBBJL0tobWWDvYBQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0_1613369082793_0.13934450660399444"},"_hasShrinkwrap":false},"6.6.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.13","gitHead":"48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.13","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-F8ZcdGgcEMMeJ6B0b0U9x0+X2DOgNXYI70h0IT4ZhKglOAWmqYGglfAlPopRO77mwuVUAeeWxjnhHbmRM1+Jvw==","shasum":"11e124fffac30a2ef3dde007298c562f3ecc4d96","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.13.tgz","fileCount":56,"unpackedSize":305107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg8UCRA9TVsSAnZWagAAP18P/RF0Xgxt/dmmJGaaFkg7\n3Nzhv0Gq6wS5QYmI7jBb4QnwJuVNdADcpokldtD/lcoaIlen/mI9fLrh1pyi\n1y2LO8IjkkK1k7u/8Q8RI+D9VhBy7hk6gbTJnb4mzClCEUNl5H2gtMI0PYGm\nNeJaAw7FaZSkRV5XLZJh1X6WdTw7fBlya1yEi6VxjQCfnDFqsj+Ite+q4KdW\nDuxi0BA3IIGZimg5bVBJv3Ms14zpONvcIhWkM9zHBcrvKIrtRMmjYHpzfLS9\nj+BnmcG3upgsSSx+2iew/iSTBsrXS/dMvy3ohN3xFNJKzffySxb255Cjq91l\n3IPwZe0iuyJdzZfTZBIPCc4mDPrrK2ia3Vvfe5tMC8KvPCaRYSOK5wjRLftn\nIT4Tq/4kEIMlJql8/Rb3YmZelfacp6fI0FL7duljSHbDG82yBG1pWE3b0hvu\nskCfxPxf+4ztOtsCxS9EeUALlgV97ibX8QRlrl1FDp1uApuJxJLGX+Hq8edQ\nDgpSXhuPLGxb3H03m14lO9mL63D+nLjeha1y7XBA/WLYO9eq+cCXBn+ikiWI\nHK0odLbIP4GTK1KzhFeK+aoJir4tYJ6hBmmdnqm7OQtEzjnNIRfWLIA8V/VD\nGPZlJeC59v9jBQzkLdVwiktRGUOknLCzCOf1nAqjJp//K1cCpwf/GeWSZIWH\nsTRE\r\n=LJk7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBFgguCXEzLtI2n5ArsZaGiS60Oh/Iu4wnP8fNcH1ErwIgUn/5MtM1h5+KVWX5SttaEfz+TT6FkIb2NPo+1PONlqc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.13_1613369108135_0.9006455520910053"},"_hasShrinkwrap":false},"6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-7QtVMq+PyV98u1gn0wxM+xmIPG6h/QGCs3z9Rk+sq/vcv/FjHWK1D2AKjeXG/8Q1EmH1U8OY+Sx92+vNyVugxQ==","shasum":"8f1611c4661649cd210567659f2b22ac264b9b45","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0.tgz","fileCount":56,"unpackedSize":305150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKg8uCRA9TVsSAnZWagAAOb0P/3dTim1FJJ5HuqQoYoZF\nJqgBZOHganlC805CiRwFhrzyjJsN4iM0lHo6a4BrAvAuMdsIcQyTUuD8Oygi\nbkI2jyB755D1gaqEeKPzgIy5LJSuFNgRcvrpCqjrte5y3aYs7NoCVCr5J7nP\nSJxTL0+zy/D8smqoV+0B9eXXMC7mIITU22mtnahm1Qnfd2r7jBGQvdfVFLE4\nRGtowVSyu8tBav2NcRLNLfBNUJz1BtGsrMWWpP8v19MrxNPKvicZloIpj1O2\nr5ckshcUE8PX/fuzJqDoM48BXAzW3CAZSAQurKyvgCXGgvfiu2hwHWo6hPzp\nBNIGiqBNfLUCq5Uh0xl69UReQiRE/7t7AKM68WG8bPQJmaULnbsBfMwXrLR8\nENIeIbXQcag4cSTJL33rSTODrFdYolQeBd+LiTRmdQ8uJiExHxxGkt3To5T9\ngM6kJjnJJomIgi4oOIj9c14ixycl2bnkznnvruCmHWoVt7LVcS/8/DAMvrxw\nHlH7FiEka25CIDANiXW58ZNWnwo4nhfETTyBMC3crhJAZBJB8qdiM3HtWQo+\n8+Xj8xW5GT12IGqdAeFirDBa+09TNfRjGUknL1oqMNH7xRSICY+oBiq1dY6E\nBDDprlQQycv8My6PUqE+JhiBQs2HDH5qPC4B2ZZOee+uxHDz12UfHNbAnxvF\nwp38\r\n=MPPE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDs706Hf/qNzcB0vYfkGJbkIv0VdGdm25qQbMYPh36lOAiAstVxk0KWJwHQeIelXFr6IoD+A3Q4JwWAjYTllLfCGsA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0_1613369134179_0.552095560636525"},"_hasShrinkwrap":false},"6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.14","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.19.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0","gitHead":"31635df402ddccfc52c736031f00de8f397e6da4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-PxUZ20a1mj7+Yq3Pj3AV695VH1Kiu+JeW3ArUWpze4v9q1wF6UDSqvj8kiTH++IXB0qti59RDrWLxxnKjDfsZg==","shasum":"47bcf1044bd7f24e581689b604b3e9ce96b91333","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0.tgz","fileCount":56,"unpackedSize":305150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjB/CRA9TVsSAnZWagAAl4MP/2S3I8+hNdfY4jSNAOIG\ncfN5k/o4u98LwmW9wXnBFFAuX7N699WxBI/ykaKecfmsZbmAmsiUjh6QXOxY\n9wl4o3+2h4xgqPruKNd3KTaWqkQpkPAud+/rPiJc9/UXT9+BeoPs1T4lFngP\nL9qm6FcwTzdSe9xldg6DeF+wZWKQcgMpxr4yp/k/L6M7um7r3SH33Gm9Rc1+\n/3cOpY7uJK8zVk6cossOgOWt/cMCjm5r5lqre/jAuxSk7kMUonXkTWiJTESR\nNtmeGPiOWuKXBkEEb0R2hL19zEKgE9MyWOstcccDXjKAg9YGA5zPJ15Z00wO\nVEM2xT8z8eAGgXrwPfex9WNMOiQ0XtkCJYzt1TV1Rqkbv/WVLQjfriw07Drm\nnhduMVhD5HWJtR21eEN6t76A7DuXbBHWLFquNebmyB22zXQnBQuDY/cdgJgs\nX92rGa6SJ2Q8zWHiiq/Q3M9guHaLThFPDWMFAmKPsP9CvDEm1vpOdSIrQsJO\nwtTYDygVWUznxb7wxhQ3HDd6Th9PsyEhbJ4c/ll1ee6wtSXzIoRrURIXtuDQ\nVnXmac3oPcTfswBXGNdDpoiSSCOYCKSM75zDe2M5N/ByAZ4HsUnVl7h7GKyj\nhAScJtO6CfR5raKtzXAZyqiZZCmeLzbPAf2IAofZhDHIOPOIVLPdeVkYpmv1\n/Z7J\r\n=Wt3D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcUngdxCVNvbNmmxEk6W/zTUZQV3uwePwdV0934v+HfAiEA7pVuNG3PdPGeiLrSBUheIQnMYRZTH+Rw973xsl2RrKc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0_1613377663231_0.15842094544273966"},"_hasShrinkwrap":false},"6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0","gitHead":"5a6cb6ab0f685fd46c9f53eaef53f1262a518b80","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-w3p8wo4oOcHKiUhulxsAyWdpMsvn+kPZcWVQXkBvePJRvq6y7YM1ckudpV6N18v26ZmILZ67J5R72s3pPzLRvA==","shasum":"d9739a8088450cbe072bd0e02e70bfc67bbf9433","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0.tgz","fileCount":56,"unpackedSize":305150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjEeCRA9TVsSAnZWagAAz9IP/2P0AWUXtV50vNGKm9lH\nrt+HThBGduen8vzrMgznAGX6oW1N24ygXUZjPr3juug7kkFUXGaySHr338HY\nXtEcuh3W+c22uKWNoPfWYLly5tWxG5LuTvbRaRgbSBd1dThsbNvwcgbhnFv8\nwAV+vQNaOC9wIEiDDTBOEROAqBIOK8+xOHBBH3BwR4Fg3N+aRJ4xe8uc++08\nO7YsEDIjrfbtlVRSdmTCd+9xvSUuz7seSWqcU6IPQAxGTN/ifRy7hcsp9V4B\npmvBdC+3qfOlE5AnixwzT5DqikI3Ct7jl7dhTx9qnp5TF/gC365eEPjs6Den\npsazgcwb+IlYQT/bDl3BDfEkRQiHXzND7ho2OJ7o6tDifesfVl5cQwkD7ZFo\nxZ1jfWa0QAiQXj1uYGWBYkA1qKRtIVGIcuCav6mNEqEeC5zvUmmp8FfwW8cm\nNU5lvEMamE+7srNcxZwdwqCjKeUpj5+28Z3aC+GSBywofoOLGt61z28wVtEU\nFRZPiyGIkUASYMnTdMS79W7aGzxqtJmpIntfpzApax7J/YezZVJ0UKBhIuwa\nkT26E7fL9vSsitEAR5tt0+zQtL1h7W7rPsnkB8Buba2aFrgIXui0FILpOjkC\nGhwUUlUgiEmKIBoI01hxhkKgW5Ng/N5o7tLfRDylut2XtdUIKB4pVYZiwLIl\nFp+x\r\n=Av9r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsqj2LgU6aqY7LtFOK2LujfpCTC4KsZUkXR3itwkBqSgIhAOdOfF8ojzmNMQfh89IN0tlCZV10bMT7UZ2cZQqIsRDr"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0_1613377822365_0.6174287179221987"},"_hasShrinkwrap":false},"6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4d70407fc22c659796ffc6a8d4fca47d7cf38965","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-N9rInKHzxM1CJdmM1Vn1Ci/A6HwBn5pdRw7MEPtNTjhz2UKaII7S8BVHxegvp1yv4Qdzgt/UVVjcT4xqsh/KaA==","shasum":"53f4d2386814b01a8dada9e4917286e30cf52f55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0.tgz","fileCount":56,"unpackedSize":305150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjGBCRA9TVsSAnZWagAA0SMP/34TEF5/N8UifyWe9H7u\nQubyffWfMYXzwScxkRnjKA38lN2inNVwTXY1Gvg4osEsNxTZqODvXeh/0P0I\nPH2kOW85Iz1y6QynU8JYC+Cvgqm7iAjklMQIGol9IOlD9Hho4OMItk5w/A1d\nQlePi869Grwq3+Gxd23xF95Fv3JlWFZPMVzrXHeNmcmAWRfK29uArbeUhrSr\nAzMHsiPjmxfGRA9U4XVsii8EjGHhsRHkXpk7bGEK0FKJDpSuzuop19F24eDT\n/2HDRr4p/0Ue3a8zc1gfNlW5teJ+O6keprOpwMhxFO+Hbkd8Q0t/himvqFRj\nWPkwLGAsqTTVVS0B74MjMd43TmLnjqRm3MS05K9NL8+CtMAh0UTeoGLxnljq\n19tXWsign70zTe54/qk16oiFxO4srzMLYVOFCli++v9cZqOqXws3kmnRpgc3\nj6qUSz5uaY3FzYcSo4TJNP2Z8ld2UADT9GDGmr3C+s7FaRSkxRCPvoSLz4Hf\nvXbcRDtmICVKYVS+7JgGOai1os1N4zpdHHRIW3M1ScwwelrEVBJ03IVzjClP\nSqbzBlQZrvVdrOeZePwGJ8ZqcHR+MqtuUlF3VCAHYUw5xlovaKPs9Uub7/UO\n3xLdNcfQdXriD+dzmDZ45K4yol0M+re3yCNGCcwXbsgv5H+QPGdYZllp0GPn\nLlmw\r\n=RSTC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZJPjaueCaNee2htc4o1ohbFzWsM1dO7APESvXLwHhNwIhAI3SD4Ilpu07c7WDn19VWT9HzgZYZBRca0/h//31KRSl"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0_1613377920575_0.047778470132767925"},"_hasShrinkwrap":false},"6.6.14":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.14","gitHead":"4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.14","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-keoHvsDyhUkRRyUhnt13sJX7gn0zxxUXiuPoh+4ckOe90FB5wtY3F38A7EpDkaicOBk4/9ga34CbhtDEIzfc3w==","shasum":"d0e2438ac59ae10096020ebd321abd4776889e37","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.14.tgz","fileCount":56,"unpackedSize":305384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjGYCRA9TVsSAnZWagAAQcsQAIZI0DPDN7EhMje3Rwne\nb/rIIm7JsLhbPEykxgDoGVjGv8vCCAoybJBP83v+W9FNQvQfjvfOARAvwYa5\nTTO8Cs5mTuUhPpbIj3ibtlacqm7mhlnRCxBxNyhANqnpr+Fwg2BWPjb10Bb8\nca5fnvfQtdtHuH37oBr5czP65XnKUOF/gcOHoZX2y4+dpT3fn+Am9YdyI7At\nD+gZlaoEICo8i+QbrqCO+mMYirFJF1I1ajD2Pe24JldmHTZ2iDEar3vGJ1xD\nOvtkIi3/c/Hov+/RRz8TuX+yicjP8dgxZAdm7ix3Wpd2306eua9Ad64SAANx\n9G904Xt6Si9x+edQwcMs8/YlNQjNVl1946q4YwfImx9fwKXC8WRq/3LUhb3J\nfw7ECRRMie6DWPZVCt/eAFrdladNzJOKS7iOUxLj5aVUbGyliwVt4ocnI1EB\nJDGSc8pOVpTMFM6lyNaL5wcNaXQl/qfryeBIZGtrFp75Q9XXv9rOYqtWZM3P\nV32Tb+i0wJN6OKLH5+eCuzrvzDIlD7g++HO8K/os9EfJDfhEI3mCzPC5AQRS\nqkO1SsqrWIMTa57Zh6HYuMIwXlUtW1WkPbNyNyWNIaeAotJaDt5SsAgHq5cE\nB+BrM7hhGFzRQfVFlQIXhw9noFqrirBk/3zl4ItYRLvF7BuaWcZCQHlegGLr\nHrQd\r\n=rKoH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7dvVZKc5LXRR3Il8/RfMPy+yaj0wbgqLzW3SL8Q0VHAiEAxypqbbZsSO1WQzMiqHK49Dub6MgSKevYtgcVC34TDdY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.14_1613377943564_0.18994516313337617"},"_hasShrinkwrap":false},"6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-T/PGerYoF4N2noi4oDCUPECMgzAc55tfiairlPGzSfty07CM/eM+vnkOA15ieUq/sgJ65G4u7YlnzolzkpJKJg==","shasum":"15a3012f7a26467888d681dd7a57ca31aa65bc72","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0.tgz","fileCount":56,"unpackedSize":305427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjGvCRA9TVsSAnZWagAAqlEP/3xN7S2CUhgTRHov1Pip\n62BPPclhy/KI5OAenCrBdIV/CmBFSqi8gO7/oFSs0QJoVKyEjD5r0PfWU0eM\nSD7kKXtpmPzzmEXFRvE/auZmUNKDjnlOTrZZpwBq//BDw/VFW3NjOMNr5MfY\n4TMpN17Z2gl4SpiznsF5fpd6GtxSgmhRb+52DRn9B/pifk9o6I/bnXxSt+23\n9xLxbcVW/HiagFcMKOGCbumawbBxY3hF283DW14dt1yKGxRAX8qEpryvl3ba\nH347tdKPZchvwFuPZUQfY4PWFMyfCUA0YatA4uuyKXoUlNXrBBAxnzxKLCeK\n7T6u0EL27f7eD7ERECmuKwG65yQmLXdKUgLPx1LiT9bmO+nOYniTEF+9jOW4\nPGMRONkYbka1iMz556lJuB3H9mblEtXIVY6idr32yZ7JdvBCXWN6z7OF/cu9\neauiI7NNhM5oGndUljOVjhO2RD2Jw8DJnP3Qb9mRnZwX1pp42SI17PnoILrE\nE9c7K93LxBICyL5XEEmCYGgG7ByquyMZmyqTSyyXUTDqiKJcQcCRtNz10B3e\nOHz+tR/Q0tkjv3lYDmuALStnbkvMh5jrM4bg4DxMnW4c2y3DNFywmH8tRlxk\nd0qhA/zJTMHf7x41/iKsBKpIm+PVVvCu4TJf99wyikH/I6b2iXXdA2SeIykv\nTk8j\r\n=IGiR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe9+YSK/ZSaqmnzeRkjOWphUaFD7v55+IWa29/NEt06QIgMOavHTUvF30Dwt4DOwTJSk0ba6XKXOqQ3slehbW/qdc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0_1613377966722_0.33733033036831417"},"_hasShrinkwrap":false},"6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.14","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0","gitHead":"8c50e83542684a01edb779df01abc62d88804e85","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-LFX7/DryFemamvqxUYqDmQbLZx8HkkjdvhMX6f4LN3teRrKJVGrexwd6wHTC8GI3hVYbFkBpmqfLCob7mpE9Og==","shasum":"5b3416f619c71bd1e8f6c2b2865dc6e368f5cafb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0.tgz","fileCount":56,"unpackedSize":305427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKjSFCRA9TVsSAnZWagAABlUP/1LUAMvto8NNFqKeUWyS\nPrkSltvejxWE294xF+wbQq5BY/RKXs9N07exII0Are1UX7NKRXM029Fj+S5m\n87yKbtfYsPsvIR3uqk+hLEhUAKt0Vwjj4mrpoCuEIta1LF6eMIWcZeyBJHTq\necHsocLcyF9DReadWgOatSenW4xI/x5pHjiTeR/rXGDSrE/oryrPJAjEyPkU\n5eNQAQ0v9LseP9yhdhMClYY2x7NxLVkw+YjtoZpukYgXD8hnx/b+otTjfZlh\nQ54pOpkX7mhKALRW6Q9RtJUHcoi7J+wj8Jhh0H+6e+PkvZD1SBSXhehNkRkM\nGNlJAY2SfmqdggG1xJd3D1uo0YQlCE8WbjXwhipZbGr9OfOepPzTW89NhndA\n2F3QyJqAX5ll2wJwB6zH7AxbUCwRvKj0VRszhjI4RE5ZBtN6Mfk5XO4wiJAi\nsQSupb4eOOF89ukC0khoimyFwGMZ3gllhhEMY46gmrkA6UR/YFMmaUY3T6AK\nED5iqtJt1RCvGC5rVdzI5wagKVmPZfzPeNgDalveV8LT4r+FkzNoc+sBstgM\nUpFrGSLlQTh+hq6btC2oft1u5xMjFKM1kvvqVPzPcDvP/IQWLqElhQq4QZn3\nvzoueEyTJ86b6d9KHsZ6ZiJ1K3hdPPnT14zR8KTs487Vmi2Xyta37Vhul7Gx\nsPpG\r\n=xDSt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9+duPMvfZ03I3KpbZ8Dpx431udxx09TlPjy6mjvbisQIgSDNAdb3n/176lbs6oq79AbLHLDzL9lqDr4gv5NAr2Uw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0_1613378692684_0.6126870571763681"},"_hasShrinkwrap":false},"6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.0","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0","gitHead":"8f2d3e0bf09ec63836c81bc9a5092786db05eacb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/X4qOSJsfcBCV9dwv5p1RV//d4WDCUZZBtaEKXmp3dZDFleKdcl6MpztvpiPVWMvVKuuoZzy5eDKp0hXP3cxJQ==","shasum":"10a454a0120e1af0399d0e8fe002f490031fc797","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0.tgz","fileCount":56,"unpackedSize":305426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK1lpCRA9TVsSAnZWagAAnXYP/3gLS1+HkTtLk3vJ7+xk\n8TsO8y3tTthPYaEl0lB84yZ+IAF7+Wqjtyh/UTb/d9WTfGrgSs/laK/F0jNy\ndAEM5b91EkwKAYSdITpfebp5MLSNFHTjH4JiQgzyS4b1nhzUdkVT/QRiOJwT\n9lxK3OpdQeyOnfgopAAnEIxWbwmF7MPXD4hWY8tUoqGWYzzV58FA8ux8EW4B\netyZZ7/GKsmrrH4Zaqm/xMBHZAFVAX3FSCM6sD3RwZVO/jcnx1OxWS31Is4D\niGxJp8xHmOJHBz2tX88JE4xMTTL+7wO47a8qxid3DrbiJks/syedqVt6YA/G\nhkYhUFaclTN72xsMI200pmxT9VKkSyo0RyaQkUFhfc8UYPQfTuIGOvXmP8bS\n/+o82TThXFXMRZQfY3IUXnth1Wdzs2FHteWRhqsLGGz4Geoy2SbkTz7Wq6Pp\nOyGCGeq2moNaArybZ3eHN8VFawM/1UST2gkOo2Z5gsQPTuqAlyZnlMrv/5kf\nHVw8JqDEV0XXTd+IQ206mmof1amFywT7AzFd+J2T0TdKsBD/pLnt2/ggYwep\nFnDqfN+Px3H5Io7ngB1Gstz9QJLReFuqunsN5FjQ7hYBZmWAc6wJHadRbGxT\n1JjuCAp7y3/maX8T/tbQRdZpeMajKlL8+l7iMEXDFItltm6XuyTybiy+mGmL\nODFZ\r\n=bYkM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5gt/2pQuBuOP1afD+btYP3TKJ2LWeEe52YLTOrv1TwAiASZBaSwKyHxet4ggNNiwWbH+dSQjqr4mjBIbynfNSxsg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0_1613453672209_0.051882092253515255"},"_hasShrinkwrap":false},"6.6.15-1e161de9698b14a83319485d55797306993352b7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-1e161de9698b14a83319485d55797306993352b7.0","gitHead":"1e161de9698b14a83319485d55797306993352b7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-1e161de9698b14a83319485d55797306993352b7.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0Wkx4KoUfY1moPqmGBV1sQ4/njD/3nQPns/8p71tBYHG9H8udNR4bG76Qx8YuirpvHYiIOqY3lgeKjVLFx3e4Q==","shasum":"b482a5dd02a05bcee81cbd28fe8e16ebf3199da5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-1e161de9698b14a83319485d55797306993352b7.0.tgz","fileCount":56,"unpackedSize":272550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK9XBCRA9TVsSAnZWagAADcAP/jhnTs0JNBBgU/Pizd4D\nf5r0X6ImBNLOpPhBPa7BjuQq4Do/KRkuuRewNk0HxeZb80idUsJb0spNQM4L\navoCM0Lr8DP+tFuW9hKQrzmd5GlyU1rbM/N2UCpudOkUoP4QiebBaGHxLWah\ne+xf/M7KzKvI/mggXcFL5Oz8/+V+QhEubPgQ/Q5Kd8R6ul09pk3RS4xvIoG6\nl1f7I+gp5ZaXuWQ3I2CY4naqLt8kPy9TeFpyQj6mWGNhK5dAbgNjqpd+DXIk\ntN3kZZImSdA1q4Uxy/9pcsdINKRtiht/UqXjuRLc/xP7UqmDkElzKOtGirSj\ntiCbSzYbttVVnazXHRr5IkPW/CX5GHGejjXZDF+PCv65JlgfMyzBL2IhHeEH\n2heCj88rRLnCJO7Rhkpkbdgzlg/CUev4Vv8QjNwBPxEUj8yL+W02fOrNpOMw\n2ZcqQ1YOtbaZy53tJSteWqRUc/w0oc8zOB5xoLi00AxxfW9BERYlXtFz2G50\nOfqb0OyvX2LwsXLKCoV1U73NgFIJHqzkdyUQ36J76LuEijE063OoRya6ir8t\n0vVqqkwOPWSa51yf8K3rJuA8XhcoNZPoN/6i+vxcFG/uD8P7iNxxQc1MOsU3\nLZalR62HDhKOLIK9QQHl9Icb56bgIS3U4E2AsQjiHFy/NX7TpfQ6zXvHsiVQ\n8lnp\r\n=Nifw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1ntcTewHql5Cv7wKotrDMyrBmKWJYhs2eZZaRa3qs3AIgIRQQotY78G6hflOUXuZz6Iq+eEaaf19lkvTXp58jHoA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-1e161de9698b14a83319485d55797306993352b7.0_1613485505062_0.5557831847219639"},"_hasShrinkwrap":false},"6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.2","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0","gitHead":"cab0287db1a601a6fe6d0ec6372191684fe43695","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-77KVlnnclCGulDhp6F4Mz3mkFywYDh2kGYW05f4STIvdsj+FeqrhtqDC9s7tsrW7KpCPkdgD3mIyAkkVm7CE2g==","shasum":"7a34a21a43904504a97288c5d2d6fdd82f63ab07","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0.tgz","fileCount":56,"unpackedSize":305426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLfwWCRA9TVsSAnZWagAAla0P/0YDsS7kedPQpZY7R7GX\nt04Sr3+YEYa/5mUWi2haZiDsv/huypD1+juwombk0dkYIJJ47S/Poc1kJnVv\nnBLMrkPbGQfzji1APf75loi9cpUH0YntgLwpeZ2yy4SXxVmF3v44B8rL6Q/j\nPMGBgYhdU1hxV4nUUrIHzoWJitROF+bnQ+5HsWWlHV7U7eNHPQE44Y0DNSlL\nZBJg2wH+UOOtQpfbDvBNnentSte/1blE/KKUW8zl5JxFR2rsX7yTaLKnxoff\n0ST4Od1MwR2LkGDGf8Owh80YnNM3uQZd96NBX7kF0S1bqzyzwdDeq5GhATcJ\nzxzkXFLvD7nLfIKE1FuVGnoQWd6O9wnCGNGraDCSJuLHSJW+7ZtzFTL2FirJ\nYHDlIX0LSg/qjJDtsyYSsHEfI+oOAa/AUV1a6F6XvBvB44iEW/Lg2VGJAzK+\nA1+thqHD1vdQfvneKi/5wt3O9pOyrOFF9sQCVZF6z1KlNxcVHvUQc7AqmQjV\n89Okc14IzILXI4zPIRqyz4dfbJHHD2rAwpyXLkUU1AlOQ5HTLPqm1qn/hdKN\nSV3qNj4geRCTu8UgNesfWwDxPlmgt6oirahFjMegHU97qudT4yiyKmgBchO3\nN9WKKLJ9MNmJBsese+ZNPjPG0Q4CahRaviPYZuINxk3xSecPzG8eEsiEXFZF\n/Yj6\r\n=zvQp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeEwzu8BC/8YGbmNFpktLMEvSCEBXJRpAo/MRSmbupZAIhAPOoC303qmh0wPtWVWVm068dgNfG9t1oWjPnrZ1s0vUK"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0_1613626390075_0.9877737764410204"},"_hasShrinkwrap":false},"6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0","gitHead":"43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-oLU4j9zb5z0zd4h/YyKK4FkBVCL2P764ClbxVujW+8FrZTu95DQOw33Q/7ClRwh4JKzWhjEO4R8bf9aPNSDLvQ==","shasum":"066fda2c8370b8e1e80ac11cd40df14fc805754d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0.tgz","fileCount":56,"unpackedSize":305427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL02VCRA9TVsSAnZWagAAXIsP/ixDUuyTbz41XFn7fsis\n40+5fYFRuCABXjVQb18lIDC0EjWfo4KPhppHrwYZ7TcFfwYSj+ZH4nPtcsfo\nbPaVb8pD3wLCF35iBsA+HXWHCYdSOd8uwZcCSNJZ6X7Jp1f5cftXFKphnZAN\njT85WNZM6N2yNxfymIUexALvvq8g6f6z5REjG6eYFVvHqy7iQz6UBXq5lPJl\nDFBPc+OyyC8yCM8epdaOYJ+vcrZP0UoWvE3WT9AhtiWFXFijks1mGzqMQD0X\n88adAS+0r1LeNJcMX+U6fcBuuVZ4yZ2hGRDX4ztGx7NH9JfeQIDbC7ASssPf\ntDo43wh/iVMDVTDHe287xNFZgJDh8u8gqfn8zGr0Tyk4e9edTnNZK3ErPErW\nWzOvwkrbcgFDYpxE8ANnw7o4xM5rzXnKKCdPdUgXr/3jfb8QbR4SsLt1fIwL\nFCp/lU8y/T4oi2ZN1lEVU7b4js7hNgVK1BheahnlXQbfLXwZB3gDQOq8Xf06\nZrbQAdeq4o/xFV40JyilkoGMhBmn5TPIhE8yTQOZsWBM408f4s+s6g48Xi5e\n5AkZKI7gEKrgD/xM3ZUZBztBSYm0G+oN3Rznswt5BGt0zl6bLktFTJU3OCzd\nx4/FQks4uTwX8pZNJe69WQwiZD46W4lLI8key8ASvX3iLiDhbsHvw2CtUged\nS9oV\r\n=S/jJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHT9vDGHqJjdGJI10yrf2qVw56Grh5cej6D+z8uovwJwIgbT1/9TtwXFTGzJb9afPF4JVdf6hmni+KB+Gdq68pIfE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0_1613712789133_0.041265632678828545"},"_hasShrinkwrap":false},"6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.3","@types/jest":"^26.0.20","@types/node":"^14.14.28","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0","gitHead":"117e89243d3b016dc545fdedfe1fc345cc52003e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Gdad02A9NARrItNcap1b4EllJCpkP5n1bDInWyAVBgUQqmbZvHOe1M4XpmnEBf5dfgE3MI5ZcML5vM+OZfaQFQ==","shasum":"9f5bfbd69b86aa3a6497c5caa37f349a3287b7a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0.tgz","fileCount":56,"unpackedSize":305426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL03ECRA9TVsSAnZWagAAG6AP/A3wHyg220ns1yXPIRuz\no8Kq95mP6vrNbA1Djlo9l/Wa8ZhP0ZEAMdArlI8iXiyAvAZFhrxTr4g7m0NN\nKDNRJ5fXEO1SQcz1IKm6ob8wzCaUty2yi1FbdLMN/MatUhJyt0YxVnaZY0zf\n58vIyOPs9AckvhM0df9Y2IcsjDS0XKbhtbOVQ4x/d81+r3gbvr5Bb6zqXcSx\nCPWIJn/MZFnYpUz2wz1s7uW/2CeswHhYAfiu0wkRQb47XOedjJvaDDaWW4CA\nI6itnFCalPY+AvUxLMdRFfHHmXryGe+1ojsIBccsM3FsA0yLgxAMHyWjTnmN\nL+5Nrne9veiVAqanIPPYfUFlPsK9YAhdcC6vZmi8d+XIUJ2ptv2dxzJvdbwS\nyrPaRyn1NBxo+SoGbPgJSvhsd+60tqeAPdv0PnirQU0D1q3Ks72AFOBmKLOJ\nTsX/LjWYWOak95aBK/EcHP6nAyGSCu8TgP0/T5MgnDj9elH2dqdD4RYprQcP\nwvSlZ/3iw5jx6n+bi2r0KoU+NGTU4JIn0iqyH1kD96xAXMLbulzXld602p5V\n8qcdm9YSB3ggxSlxSkQ3s1n50IwXxN4YtEGhgNu1alTvizJAs72XI+7soRUu\nuVRO0N8mqfXulRawmEIanIUaWVzqFr+l63BxOO4GmK+16WgwlLDkHNZOxZfL\nDWyn\r\n=JQ6h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXJNiutB5Q0x0MuYyyO+aavCqCtpYQqT4UXXe8VgRC9AiEAm2ig+NZ7LVKuS6qu7Tp4YbR57nkDmhAYIAYrZlSjdd8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0_1613712835449_0.12905112606938962"},"_hasShrinkwrap":false},"6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"14b4a2b884a74dc7e9a62e4c5b810003cfd69416","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-gdU6IXeWm0tSP2/jBbYOf3acypuBtGct8iBTQ214yHuNBVYnCXmZ0mTz75GWnUhJtcebnw1+WWFIvpSTLbnEfQ==","shasum":"7f9bb09051dbfa65e0e00e02f2508b0be73db77c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0.tgz","fileCount":56,"unpackedSize":305427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL03qCRA9TVsSAnZWagAAujkQAKUTqjjSe+yoV6oMKim9\nGx/TBSeToSoDwiSJNyZZ3pGejOw8QDGFuCL8dPaRZX7gEMtlyHojNRAAFlNP\nIw4+R8aG2X5ouKQR6YfCDTt31PbL7+yTeeMJ9ZgzI9VNV6j0d49Kn5ov5zns\nBVnehbub6TvzwC8VUq9NzlP5OjhDuNorb/De4yEY7/QQw5OS4yOULfTMr3UK\n7Q5zICTBJY23N7kWHqrc/a16Ju1Lzgyr/JTznkd+lj0XKcouCUNAm+f6BMjV\norQBQi9NgQ2kpdpebsNxMJ+HejrklbKRjAxNdYSZh+XMi/E0T8nb9VVsqidi\ncPkgcdMbliuX6pVfCI9mLMey8yPVl1joSEbbG4c7j8e9vz/V6PmbUIN7pKp/\nMF0hQMvavfrSMU9+stU70YUcUF/J5t42+Vrnpu1Hmu6MarXFo64NhjoJRDZt\nB9D5LRG8Mhp67C0a7+IjbWxcL03aaAdgPIiGEPiKwBNeASeVtPE8Gkm0kXhq\nl9JPS3evo6YhsbmnThvBVxEOSPndX2dd4XEZxi/UhlqGteQTUQDfejyCNeh4\nif9/CeKLm7z9LFHqMeeSwCIq47lfpOponvZtbABsrYY58o8s93uZSlsj+Q7G\n0qtb2Ls4Nw/vnRyGauwjhLrSNsNWWZ0qBQcN/iDS2Rcht4WBZ2Z74WwmR98n\nB+hO\r\n=pJJ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBkl9iIUinuglOxBqOo+jkoX6UK7STbOPPAa2bOZOFGYAiEAtBsGo3m7Vex0BHhvrCKFSTzSovJgQrfZCPwtMR/Tmh8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0_1613712873486_0.15312959415687666"},"_hasShrinkwrap":false},"6.6.15":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.15","gitHead":"8669fda3d50c21f12753305610b78ccc2db45bb1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.15","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-omztFk5OEeU+SI6XTF3KPDtxleG7+sdP+T2emy5RtiBoG9Rk+BnH2sIHqYID6uYaSTxlcWyMDcJ8/WuLM0a6CA==","shasum":"eeacc713033d1a7e878f6d9633cde5017d352121","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.15.tgz","fileCount":56,"unpackedSize":305670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL04BCRA9TVsSAnZWagAAf1UQAJBgE62vjSbvO9uOx6Rs\nWM53xLT3Sl4b2ZDeE7Qp4ndzIvOPN9pA6efVRg1r2KnHe6UDiHIvROR4AUXa\n9Fm5IX6sMdl6FMagqCL+AkdfoEjFT3he2eHc8SxjIwchUAWww+7cOZhEz/aT\nEVbVrPBOfZK09FQr2GdKtEIOzmnXSkWDPrfNYyeqFy/Fi8DfxmGhLsTWQzou\nNK9oxtwFbz4RLPlh0PawiCsGxqGWTRisQU097fM5VG8/qCKZ/62eb3dDJ8CE\n8gL4WSzlGOlSn6RgxMvW27ifqHDvQC4H9qEyjF2qdm37YE08CAF0oMdNkUIM\nzCBEj1zsMQQ1qmggS3CpPZCf/R7XGoQEXWgesvDgLZg1TSHVy1nnIkVmG0zt\nddlfTzcYOQPYLSl8LabQsxF9mnJhwQpx8ruxw6x83HJXQTM5uid5AGdpSu6I\npv27GGJ+ZSnJEhMHW6ucgYF/oOIRkvLXKp8X5h/R6TRX8AW9jQuhl6Lf2xfg\nTwo+z2nsEA8lI0XkDGbKl2bg6To+fx+KSljwyZCtsNAISm6Osp0C3+ErdSIH\nuionCBkKqtskRS0NR57QeGDPrz+hWCAu1fFOI2HuE3fMVYqmcYfyvijbxtfe\nj8RxSVM+2mRRjYUOuhhQWfPlw2D2eDqYgzz6zIpi4Fv71Rz4zFm1pQN5ZU9q\nKTpW\r\n=e4+m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD68HIxZhRhxIxhizouqX7GDo63JU4BuJa6vPqwII7t4gIhAPDnEqDV34XtLh12RQttWkRAcvLvCpI+yvA9XcsmjdkW"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.15_1613712896236_0.3458605694218657"},"_hasShrinkwrap":false},"6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"8669fda3d50c21f12753305610b78ccc2db45bb1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-AL7uzAeya2K/b/6EzYEmOdnMJb4b72hovgR0/JnQMAh+qcq/xCdmboWzaXgDHwazvaYwZP0qlCkEEUJ0/Y1ndQ==","shasum":"860997d720dbed49be23b0719e7c47bbe62aa19d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0.tgz","fileCount":56,"unpackedSize":305713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL04cCRA9TVsSAnZWagAABFYP/0oy3MSPuq1E/ZUwwHHQ\nS+RbzG5FYQNRqTx1UDHReG6KR15imX7T3nejGoVyYyTiZnoUu4tEyd6CTjYj\nPhy+9K+pvAwatAr+FY/ws0Eaf2Dw8Eq7qDiSNTKHa8tM3SzOZcZCb2opel5v\njuSAP4r2ANa1WgU/OuYJgV3WdcEo1zeQ/NJhEuaRUFTUwNTp/+1pcJcK8wRG\nQq5iwKU8tUHyi6/dh8xOTpRivcoNaasquyJsz7lSVO6uIWMhWGpX5kPgjYU3\nYw7/VYLlbtBjclmEfWQVZfUvCO3O7PV6kd3i0WNff0zLiFlWcHXZXMjPAY0l\nc8qJBl6TgunU2VJbZQNMdjNlmyfvrVHMQfshnI/uAf929vJ7D05dRVrUhGxr\ncM9FP2nV7znttWOm/h2u1RrM+ogQFcwfnmpH1PmmGRdCo53PAkByBmhd758A\n8QqlIFVOk7wTLAGq/mjP2L8ivCoI2YdkZVXmnXb1x6nkOFCeNguvLx4vGb2s\nuDscN/FRNRMrKHG8TWRMy9tzMpNgNRxpn03TuzahnENyUR93Ohb1QKhw8iCW\nK8rgenl13Yv/XQehhS6mhyXzSGNnHZ2lDXGkvYfYGZrOjp6J7t5BLvbWN49+\nqHESEjb4M3VcQMzTbulQ0F3icRSM0mDHl3WuUu4a36yUqu2HRnaQmWdT6iBa\nJ4A6\r\n=UbIc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+9sdusNOi4HFfytIEfSmNf9vn8+RDABda9uk3eG9kkwIgN3qoaO3fC488NW2IleH9NghGrvoHXmsMNHngkxv8dqs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0_1613712923742_0.6369180974932878"},"_hasShrinkwrap":false},"6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.3","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0","gitHead":"2280d773792810c0b8db7d5294d13cefa96951ec","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Yl7a5bhX3Vc4afqiC/G52jxYG3r+kaMKTBGFCluO6SrkDw5uCUmjutmv5nKn3LSUZeWuRhxZysTCBHBwTDRzwg==","shasum":"aa593792ee5d44f7c30b469ced787add9a242a3e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0.tgz","fileCount":56,"unpackedSize":305712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL2aGCRA9TVsSAnZWagAAeJIQAJwRWVnVzmZS/r6zCYgd\nhATgM1ouWCOmPGxzXeDWTE6iA4h+SC05NMqQGp5VKAIwu43SR244EJkQdVul\n2F1OJFcZRh362mP3tpvN+mHVsTyuJbtSBwNsC/Z8pcbyWdrSXbpw3gNnxDik\n28gBnmZFNVvHkVG6ny43IPvbX/ygqcqza89R/DPEKAjeitzS2fO9RBYh/7gY\nc4jPci9mtcSfzz4KBqqlvgQ9IWuSKdSVNzKpOMP7TFjpUE5UOHnSTvJQ7Afv\nnaK5sqe6eZat0kOPLk6bult0egL3O1l+Hnc5HajHSGpFIQo810iN/sniHixD\n6IFo0aiZjhZ68q3htwFz9sPzwVySbvux47eFiVShrP438mCIS82EYOzkeROM\nzM/JwXWDb9zcDqA0+dQCmh6zrpuGhOEgCctknvpD6ZgD4VUYdfKsUMrApDJL\nWOC6q8J0jkOlOD/Fa5DYkGwbwBSO47NO1TkcVw3gMEgWVjU+g8WtV3dObQHg\nWXKSg3c54d18LSigaljN+FsgQtbVpGK5h8nG22yxRwJ44D7GEyBT0ZakmvNS\nb0No7KRFp64jybbVrUoR8ibxdwgyNjV2uKkoze1MolaPhjFNWLb7m/HyNyCU\n5xT5zI7cAc3FgpOR63nKSUDH3LjJKYhOdR8Mnqog6ofFygUj8WVwOCTFbrWO\n8qIK\r\n=65US\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD319kZ0kp2BRsoHuD/S3FPMK13u+qmUx/QIriEicuWHwIhAKoz/TwcL5/bSSWTL3jaIfVLAVHTxHBZfghuYXkerj1u"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0_1613719173990_0.113607794951464"},"_hasShrinkwrap":false},"6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.5","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.0.9","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0","gitHead":"3ffd7ca12c9c92596fde6977be0c131b1b1a82f7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0QgkitK4Iwid/WqRF1TYpuBTMYYlsvEjDto9HLYzElx2T5CHGkeVW/pRw/WZ0JOb43JbnSi66ev7OxPT50vI6A==","shasum":"c0c2d65db178854ba9b72dd70955f3164afec7ec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0.tgz","fileCount":56,"unpackedSize":305712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM0jNCRA9TVsSAnZWagAAikwP/ibb6TE1JnARqPquHIrD\n99BwGljiEPN8ILbz9Pcaarl69LSerMGkRCXrj/+8Icb/tWF72+Gpf3K91hLW\n6MhOUR0feJch5SOaQwBYbwAibId+j9LEKw3dT/Cbi+HNLt4PkkehjKa98YRL\nab6fac2FdOmGZ3dD/gl0T3A2f1k2FNilSLofu6kE4AeBOaXYzGWCyB9Zc/qZ\nQzB8dx9oFcFegGxd69pNa4jwI8vaxFGtE5wrHn0ylGNd7MimKSeXKQ88vCjS\nMDiOTk6Gqq9d4L3+hkbOyynOeRdL3llxD5mBiWBUwhOFh0xppUpEpy6RYoQu\n9jghFuNnPw0a1MPBViN0HJrRPpLzt3i7kzT6vRS8KUPzL2LueD1fdQ7ec/8x\nAEdATvc1PaCrfh9HA/NiCRtzQb2GuKMk5DFV0i0bytYTgQz+Qj7Xiioh4xm/\n3Qq/dwYSzXzJnxiO8mRvyZ8Y0+HLZAxM4vUuFzglfTstyuAnifcmVFP2ZMsr\nefhVLfHye9UDcl8K2tTrFL6DGg4ioI9GmXTWN2x5/vPh82chFh4/d7a0IPu3\nzdx0g5s162fGxH639NEDXV+Euh3vsSe2minWhbCtuc3rN0NJSjgWMc+EEe8a\nYt2yPDt6H65AzzHVNq6U0oqbu5GpPzMQDBxXHQk4PAPtAbtECr6zgxjjsXeY\nKigH\r\n=8ubV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFjvFSE0jXyI32oAqmnLQNnzlKaQIxCqsNuMd5YHQ4GAiEArcUhJT6zER9yrB+RmBW4vAu2Is+JKkGsYrF+66PKeSw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0_1613973708672_0.955227153383533"},"_hasShrinkwrap":false},"6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0","gitHead":"0925cc661eae5dcc5376c7b001ef3d3f8c30adc0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ZvQC8DBs6pPlFgCLk4/1mWZ6LeQDOUqXA8xJOjv+7IGdYIhUipxp2JPyY+XcXhbdawEoT0hIjjTYdbROCSkMAA==","shasum":"3bcee828fc3a063a9ca94338fd528814eb77072d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0.tgz","fileCount":56,"unpackedSize":305713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM0j3CRA9TVsSAnZWagAAwJoP/jtHlcn9jR586JBMzKde\n1RD5x9rUh/zSwfTx8VhltL8TBgtwcVo/lw4i/1nnH82+830e/0Ij813mYhVH\nBXxP+jfZiUvA80tzb4WrQniSRGgXSGTQo7r0COz3QfEQpsc06Gdq8oVfveYC\nu4rHn1Qiswr2BBC79RHlSTn9QJpxHqdwbahigQR/HeNT/Zacy+OmfGojfW8o\n0svqoO9TgLOW03w/rU1279j1oGu2yj6kCs34bV5zYnnsAQsVydvC5XLgWFwA\n4wqGv+XOKBx/pY8utSJ9TJs3GQKAuEyGM1KzxVogIuwzLfTMzUSyZ4uW7Jpz\no/aWrrowlvqUyWNxiN2r7T3tDHeoCWRLs5itmnzaj1gv2Nrcy+tDyeC6BBiX\n8+1zCcOX4zDJFUtRERTMm8lRFvgfpKHhDBvvCziStKE6/Fz7sm9iFib5zP72\n0wiy1CXTM97adZF4JzkdffZte0jZbzf9yJE57jtrD7jiU/AwoMBbesrjatIM\nAPC3ZxYZ+XE02l7QFf9ok6tmOV03WyPOrrRP5z+5dBurGVBDdCvtU/ItLK6/\nnnhKZtYTvacAGMiXZBYM3yvsYIRHRW4fiuM+FnLoes+wVMywx+kGrQr3nWMl\nzE8CnAkti8dga7IlF3phDpYehWwt2fxn5EZuZJzU0AGuexA8XLjS6JIaN3IY\n0i5k\r\n=+DgQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDG76gjA+Xe+c7ofFFXXZ3RnLUjbx4qa7Bs/DLELntIWwIhAJENtcnedXD7M8pPPnfYTWQeaP01MEoE+21XurGFk4bl"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0_1613973751061_0.2543673086801943"},"_hasShrinkwrap":false},"6.6.16-138ace719233007ea003f48679650f24091ed34d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16-138ace719233007ea003f48679650f24091ed34d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"138ace719233007ea003f48679650f24091ed34d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16-138ace719233007ea003f48679650f24091ed34d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/DApgjrDwzYlGYl9PtGlvVPEXZCNSLCDaDdISaJyKgvjPjScLfenn2k2kgsrkRdsnyQw1kggiRB21QVvBhXthQ==","shasum":"3ccb50b08e341168c87bb46a6d3bf5e3dee60646","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16-138ace719233007ea003f48679650f24091ed34d.0.tgz","fileCount":56,"unpackedSize":305713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM0lRCRA9TVsSAnZWagAAmaMP/jRR/L3mgkNLrZqqk22W\nkPR+SWf8L9nNUNC618a1/2X7ewEeeBPIVqb3OxhGnY12Y+lVpBcMzfExBdCF\nJbPCsSEqAJOUkMPBiIN0Xua5WWzUF8IYkSYqkYl0afMbLfRmp51lwi+0ywRM\nmk8oE8idcjpSNAcwC3AWRliugXAk95HkPwoFvrKUcbTMe8yxk+alY2/9r+Ic\n8OgxkXWkGoOdH3eezMlppZd3mVu59Sw8TUPxvsMWed+htseSAGorQ73ufe2z\nV40vGkZiAMV2qTech+Y645tXH9+xbxaiSOnfpy68tyt7/5cLE15jK6NYGsGD\nsCJ3b3XTm6IX0PaPtGQsw0cZjqC521CNtbN9ytS+EkOINF6KfJKqoT+n3M8T\nhZUw6vt8+fGfC8XwIWCuPKuCzle9OiyftZ4FS4ZKPv+XvKlFcTBRgCDh9HDD\nbvaYCl/bHsusjzqKwCjTIM5qjw5dfU0qj/rHVyBIopW5808bHkNhwwf/HWlG\nZgVSZeZUlaVKxQIxJ7IV7EpkFwCmM8CGDszLIQGycHPwUk542FEjg0iVCQn9\nhceGXxnnr3B7rD9MBAG1kA6/gsuKLa8PoSbBr4iGTEEOJA6RX3fad3GLLgdd\n9LGvRcKOr5xzrk9XpctQCar9IhlQBN7RDSvwnFauoowX4JgKvN8uHXPUx/HK\nR5ag\r\n=4ZaJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCB/7aAh2xHANue6TlvHabtDjCaQ1CMq6Cmw+SbUcv1kgIgRlwSxiLSn2pVQix3lLgqq0CPFzVFQSpUBu1UeAljBOs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16-138ace719233007ea003f48679650f24091ed34d.0_1613973841234_0.12102933189029019"},"_hasShrinkwrap":false},"6.6.16":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.16","gitHead":"2b08381dfa05651f0e9fae4e3747a793bee75b2a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.16","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-JMlg1PBqwJePtS9riP0BjTdrJuKZaEow6PCnbijh10fvuDlTQUewOa3TbhDMbyfebhxK2rWX7shJoIzHpwESyA==","shasum":"b8fe49af8c6d4a07fd0968ca6c4997a07bb468dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.16.tgz","fileCount":56,"unpackedSize":305944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM0loCRA9TVsSAnZWagAAwhoP+wYh1Hh6jz4sfaI1HA9t\nLKvBMbycVjE+9fE/W2IGtzDzF+xgY/zdcoTFhjhXwj3jjH3WL1mHxPqIQIgS\n8h9cXYaxdVMta3qJ8HgqPO5aSaEY8LyjTzHLtu31Et3+bHXLs4enspCXy7ts\n8a8MSHnZeHEgCmuBYuCdhrEp83O0uVWG5iKse/hHvmzyWt7OE6/9KAMsjzs6\nFt4dbPik8YfEgWKP1gQAMUNRoJEj1HS+f3HI08GByPprkeYyBe+C5p4Tefco\nv1bAeHenWqFFSSTgLSm14ep/wGs0a9YlDPRu7oi+Iqgo6XaCxqi6QTTHxhjn\nF9NpW6ccs3Br37X3n4EORH9QFXROT2PBNvq4n0F8MEKBgWLezr8xl824FE/O\nPw60vUtL9luPAm1nnk7hvt0POVIWeiKbFPBTc2ofjArFg0b/7mxWTMFt9L9p\nufht1lkjksau4qSOsm9oJXXS2SkcZZYa9NWAzWQV2FURE0yWsKUrBo2Wu4XO\nPO+Y+EZ3dIOxfhiNvWxR4rn32R5nRn6yWFmp8hTOCOXczbokxEjzHMbIjFim\nBp4U7sFlmiRk6JKATKdVqsuEAwp4kf3tl6WimRETULky6KRlYKHW9jf/1HXn\nqsoVE8dLvie9QL1LFCFFd+IepZ/sbRU/A8+EUQDxiKslG9D7Hy33NwWTnw5J\nFuTR\r\n=Eo2N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBZihX0t4Yb8MP9gRzCMPXSLZ3x9mIlK5SdBy0doprNWAiEAzPcKTDKvQoCFaF0Kfi7sImU1HuJuLF9oAVhWlMqfGMo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.16_1613973864168_0.4578207670112364"},"_hasShrinkwrap":false},"6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"2b08381dfa05651f0e9fae4e3747a793bee75b2a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-gLg+9F/yUh1nE9ftZKBqw703BkAAYnJjPqCMeCKrF45UC0R5pz3/rkv2xvnfJiG+d2A98d05ecKna/Connf/PQ==","shasum":"9e370c28076ba8d0dcdc9739cb19b36bfb4875a8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0.tgz","fileCount":56,"unpackedSize":305987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM0mECRA9TVsSAnZWagAAD8EP+wWi7ddRLSk63Iv8Jn6u\n0/pu2LowVPvYoZzBqgWzDJ11sajGsLc64iXLBT8nSWMyxFRmsDxrlLuOVmBr\n9ZY1/o17nwfJBePSsLEm447APM0O5UryEf9tMcta3ZE/6IFq7AHpvOI/AQRP\nleMed8vdtNYaj2eJ1DgvfEPuO+kHBqjVqI6bNCbyJbG7cdJpqjCgTSp4p4O9\nvdR2viidqRqBJCTf9P4dgI4pFDbL7IrDRxNoL0cjVzvEeAsujYjBkYtDVGhf\nRhkusNrKdTjAAFEQJXp70fmeRmTo7ZlxL7xdTscAT4I3JBl+ld3UsdYOEDwc\nBgkejcw4Y6vM/VWrVrsgqdr0YYCFvgOSxhWxIZzzRe7UspEuANR+QKfW7nzB\nJsFwLcZumZ317uBPDijd/Z6k+TnwOdG7vwHuTSZLrAxWHy2N/PvKmoWb/dw0\naGJ8m7EFT/sV0QIsBo1h+QMdulD6mN5OAupszpi1fkXM1iNNg8Rt2mUKhhqv\nS2U+aBv7ytZUig6LGf39biigk2ZISCoIIuB6ChK28MHbttYwBJM82HwuXndL\nOOxrYtu0oiW+34hYuE5Oveb05d56map3MZ6CBNJUSKqSuM5G81/+RCsPzS3K\njbIWLfRGN/+/bep9Uhzxo55tY/yb/BPytYdgEj5EE8eFchkPWYDNGHkHtKsC\nybDV\r\n=8xEy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD72ueXOu7EDn/cJC3ZoFVyQMEiOzPG6PeLbZRAQBVFRwIhAK/P+dC6kpeHFAdsw+Nh4YKw3lmveEj5zQrtSVSagUhM"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0_1613973891675_0.4865337369217666"},"_hasShrinkwrap":false},"6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.5","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0","gitHead":"1381188f9b94f67b53ba963af1a2344426187d0a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-m9UwrhacFiV0TBJcxCeR5ybz6gZOTLJ+RA+geX+kEgDI+7CO2LYrfDnYtWdLU1ASHW60rIN0OIQ9Oq1iJS3uGw==","shasum":"399e4f8bf7f4a4a4cfc3213ca75133322e4d7743","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0.tgz","fileCount":56,"unpackedSize":305986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM2umCRA9TVsSAnZWagAAZScP/1C8Y6aVa9tb4+tjv1el\naMv0m3IXnFu/VGD+TgJaeD9ASv/ImioynOSc/TfYJcZFPsft7xl6RpMwybLy\nVvbRp/CNnLsS/GNIjxnDvcRKERdj6YrC0gIcNsve0O0Q8VmfUrutbg9NodUq\nNCKHr4P6l6q32hr4bnDLSWfA9NBNJdhfQoHfBzES19CtrqmlXZdU71RwIg5s\np0iPCtQfOWQHJ1m8DIUl3ERBq9t5vZ8zNlctciyHtgeaPqNO8GEgX0cheZ+x\n3xnFenu+Hx66XuPpAtGJ5Gxj8+qeD692Q2SZXFhCRrC5GTMbMVrx/Gp9gUJP\n5it79YyiSf2z/blUcK1I3LXJ7wQYJyHjhwP+TpmNl7HVsx+IYFiZ8gkYyLlD\nNNBCFVjei063YQVvtmJ6AOLIfOKM3tKw+eVvBVUZvF7upivzoULtEcPQtjsj\nHOXEQGoLjWi9y3Cn6ZP3r2T0vjE0Dhb4tCH1IJn0tBJbrXDYzxEGjqq2MrVj\nOJQJNrBrLDBNy+LDRcmPNfpyu6pDfXxSrn4Z1uLGzsXYBCQzhhBXH/ysAHvr\ne53De0Ed6sqhdiql72xp1KEnC9EmU7D4/4jUIXLF90o/gs5tXdLC42NW1K+L\nDXoEi9zMFz5jAUNS/5wizmWRs5jLfuhcF3bdft/tSnqt5Co3VoRmQ+P+4hsP\nvaL1\r\n=mvpX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrupjyPUKeeAYot1w/CtZF7n1eqS1yHSs9Szx6e48UGgIhANAarlDBXe+qkdoSYwmHWYRGtGDZ29ahKCLzTk+89+a6"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0_1613982629755_0.8513577403525909"},"_hasShrinkwrap":false},"6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0","gitHead":"589654fa14feeb67f8f002610be1b2131d56b724","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-XKTjAJXq7Qj4otOp96EsR910mDNwmCTop3lRBJZ4EWye8k22372Z6EbXeyyQiGImvqPPwDzvvVwE1obhrMltrQ==","shasum":"029bf9743f9e7072fecc9fc3ccc348eac005ccb4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0.tgz","fileCount":56,"unpackedSize":305987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM2u8CRA9TVsSAnZWagAA2P0P/2o28UJV3gkgH4/g5Tdw\nbxUVDBAPDq6XaejW4IQFIoyT5IEmntGd4uU0uS2CAjAkaOAwbEqmgjIru4tc\n3OwrearXqzjsRM9A7UeKAUexkADLxdgvx1CdFCS9RgoFM5/cp4kvfXjmp6kQ\nGWkc3wB1fPEV7nBVPxuBj4K+s7wOpmo5GY6H5GOLc1xpWz2r2h9AsgBw2l2Z\nH9ufT7yUxzZFSyt1caP0n6HjcDGsRARafvZFjBHg4z9xAdbT2JrDlwN2Af5i\nyNwLW2G0GHSK+p1OsIAxRf5JnnfehLGCOhpqBSO+vWETY+k010xiIeLwAUob\ntKy7ulG7F1CAv8ZGAW/9mV28EUuTfFIxRXu6J3rZGE9yFdVkrYVLwxof74Y3\nh1A+0H8EGfILNsY/k0OPxwblKppoyPFP0LYQASI+CopvPh8cdHC3LDPDlUBu\ndr25f2qS8/KwN4oedISR88mljqXE5AimTp/y/CkMtPRIudDi+fgV6oKheaut\nNWYI1fx4QL2eC8K6TKz8ao10+KybhAt+TNTSmih881dazjX9ypaGgnO3fYnP\nbsEQl02Rq1tEhCDVfMJ3SVwZ6KlVZQEyC9JlmByw5/IX3yeievw9b2NsQgfT\nBpAoI0C6MvRgZIZcUoJe5IRV6Zh8zVR+rZc776LstnbFyJrGJxtpDrjH/fIY\nZJGz\r\n=btnL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX6eGXaWn2KA5s/4Bo9bG8UWNiPAkFePi0pxCV9IVo1AiBsFyOCfn58SYvQxdjKuBwbXhvYWqI7n/zl4Vj2ZTAGTA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0_1613982652223_0.8136230406262659"},"_hasShrinkwrap":false},"6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0","gitHead":"e213f91e686ab5d5d013d6eeb9dce09a2f6999b2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-R4lJnmt54Mw6+4Yuq4qzUO7lJcB9hKhwhxrIozhoEaEAzSr+MeHKrVd6hnslbyFRPbCP0/y6vOx7dt0XVEEZdQ==","shasum":"774e723b3cff1253367327546f92aa61aef0b986","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0.tgz","fileCount":56,"unpackedSize":305987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJNWCRA9TVsSAnZWagAAVqUP/RM4ADDXJ7tVA0qTs2FU\n8q/zM8yecfMDl/BHo2an1d5xoNJWze2nHxXI1Lft80QUrBVz2cavQSarf0ly\nHZ8jMILxZ9x8t220+GxqLNkuiMPitnQmb7XIvtFj+WYqvP8XPHudZZ79Dj/V\nRHlgOj7wIV7THzfzEe9fOd05xADeNHubb1Uvos/jWdFwHa4kKiuK4OpzK4YZ\noORfGcuXgV3gOtTl5jlako5C8kP0B97QkBa31CNKvwYeqX9/RBLp+28msAUk\nNjNgytVoRQ2wmm2RquHDDRla3jpONFESu0mxLrhZRSLvnhJNTYsh+1KzsqEe\ndeRqJ/QsWZd7JtohYOevz9s2b0esdXkApaESc/eTBtjyu2F81WzA3INS7jIz\nrvGI3gA8GjL3lDGAQ5jTUFefEpbPxrLNQbFclvRkzhIONnPToAt/SowOWCyw\nsr6cEBC23BcRCJ8q06vNFWBFsdmCOr10iH2MntfbEJ9Me5zwQVboWrBrh91O\nq1BUAGOh37HjggDWmcov1TofAUW0RkZc8WkXltJfuoADkwquOE1DEewIeE3M\nEznnUy2ItIeuvX9NMr5Ydc23S4la4/MOoBETX862NbgQ8JX2HZ2xBpCATqYN\nLI2uRyS/jKAsc8N04JT+esrArTFL78tKn0vXiImtP9ZoBYerYEtlt+HzsTPW\nHxn7\r\n=16gm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6lMqDlSw5GBExNepzdr/93qpF76cFYFsqA1w9eirCQQIhAJCYXuGZfouQbk8pZQzpTk81pAVDJbNWuhEfqlow3o36"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0_1614058326308_0.6246230556156014"},"_hasShrinkwrap":false},"6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.7","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0","gitHead":"5f637e48aa6425b83858a31aa52315c8927c02b5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-xvAbivB/XFI/l7HpFRIAcbY8X8qkxr24RVRAd0bIsz0RUKeepm0jKCqeiITfec++KhElKxryhCSL7ixtrO4kwg==","shasum":"0ced69e267cbb22e89ff902d6fe1cf667d2333d1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0.tgz","fileCount":56,"unpackedSize":305986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJOaCRA9TVsSAnZWagAARbwP/207GMCVA034i+rsf9eI\noseHtVSVeEbNu4pvH68Mvddw5lbYGcJAc2E2MogdpINwkSLokgNCRq/odi5f\nv/RYnSRtpnVaKvoh0pqgzQYOCQqXPgWLV8j9KB+/t0tRuCik4//Ci9BsBqdr\nDjYIL/v5o06CezYcVGSORH3dNRleawYDmgwDiEO4LI/iCdc47vyGgl4D9p/L\nFb5Xj7UCEVgajJNoGSLwIwcpgweAaCiIBJHdmZegZqJLCOesi+KqJDXeFzpC\nBPkMGFTEQ93T7rVq4gK+Ft2yJt4CgYcQFZT0wOB+VKNNCcUZt3ziMcleNfBF\n/dN2tqqBQL0u8RRiv1C9fMk325MlwMsUKGrkrnYct4NFSUDJzZXaB7XXHRM2\ntcSSZjqlQUTsSngYfCBKyjv9AgcMPwlzHJybllS2xhIDPEC8LcDSFIJqc172\nGeffltaIsmdXJC827p3uNc9ppZpFIlrhHvYL9fSpTFF71dL3soHZOrUZBeNg\nnVAs9JIVx/qw4IZqnyYuY8okE1KTBZB2GipJqx0ELJhrf3L0i4MXCsBYxbIS\n00bJibnqThVjzAUv8S0wy4++advNDfgd6q+e17ifMWasJJ9Sgriqip5R4Vsp\n/uUGbW21QYcYzP4fkMeDkXQEvqGwBJSqUxuKC+elI/Ci0ttlWyr4BZxO9poe\np5Dn\r\n=cAhz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAW5c+0uxOE/ZhzNykhlyXAnPNb6AqSfsG2IZ5vY2bf0AiEAtak44iK6rco8F8b4gG9jqao+6PxuOn/KtszxnSfhjfw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0_1614058393421_0.6804313404002755"},"_hasShrinkwrap":false},"6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e14301e7a680b5a737d45283bbaa3a984445ef0f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-n+u3jJWQXEzCUx7mNpgNKHXCyNVioDFGwMeiyI+4dhsYKZNfKNiskheVA6BNw/OKE/usFOJdEIg9BzEpdqLbQw==","shasum":"f75b4184939ba52a1a56a836cceab5c654a94781","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0.tgz","fileCount":56,"unpackedSize":305987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJOwCRA9TVsSAnZWagAAxvsQAJp6d6hOgxCyD/nfGq27\nSMN56vqvJwjN6fNTzG/I0UlA/REhCcLq819bO/3I4jieAWRkK1csanrC2+m0\nTga2uvPhEwIaOdJOW3vnwrRzjMHJ+eOdk5uhIVEgKuXcVhc+xQIf30DTG49H\nqTJ5BQOHMePxY1YQ+tja1v3UOjo7HCKFMyOpuYSgrJif5cwCpjNyxvg5Mrpb\nKEIvSx6lob06KnH2sEAvvXCwRMf2Es28kCTQ0naCY++SoNOHOJBRXDgK06jS\nuA3g95r4r7h4m9CVpe+DufEtm343objf+/rqFTvzC0iml5B1TvanHQWeuI2S\nfXSvNT/VQBPXuf+ZYzRzr6zwziUE6CeEgaShvr6S56xesKpsYVj6Nh/HPQgE\n8CP3eG74KBI+3Qi3dTgRKGt8s3Gu6+N5zUNlFnzujId3vCYJo1ZOUEZGw16R\nHIYsk3wLOe8OXadYu32Dk/hdhisxW0lE5CvL2KgM+AmL3/8SJ2eh3o4RunH1\nprJ3I9pK2jQQx2y9dRtJNzC8HOr0bWSrD/hIlbNPI0YQY9wElHUxpf88HDoD\nK4vE1N9xynT9LdeF5iia+5YGH45Wrj6SvxafrG5Ccr4p5IioDfJ4aBz1uoUG\nrZHiAAvQzjPrind4owEXOdI9VvKPe9gA9klbVgT48KYMFdqmQDPQ8VR+DAmB\n1Uvk\r\n=zzvs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/qvfPPZWxbwjQmgbFhBU+B61vqtuIQo3znDLjrk9EYAiAtq84L3/l674mYrH2IjIdLU4zNzGGHeHMc46lRJqADDw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0_1614058415904_0.39530034009232495"},"_hasShrinkwrap":false},"6.6.17":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17","gitHead":"7e0c06701cb12838ed16534bc571f1a3ffdc1e60","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-WOWxXbcsjn2eGqLdOa2Hd+Cv92JN3vdx2s0X2LIvJlo+5iQ8DqGERW5rOmIQWtz8/0JHw5QH/G30jsG3OA8MCw==","shasum":"d3ece861f747485f1854b898fa04d3ba6f05b748","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17.tgz","fileCount":56,"unpackedSize":306246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJPvCRA9TVsSAnZWagAA70IP/19ehKZn13tVM4UdDTYn\n1exsKimihvvX7MwQrjlfChDKsOCV8vLlgoH6+1kjLN0mSx3rOXxYHLvlcNjt\nkvZFHJ07EUoM/mx8IwDkX2o+6KoU0ZW6VclxBC8R2c5HHIpAZqrR7ueX1IT5\nbKwNhP1xQauTMYZIUBAmLNqLtTQalg0mrAL9ByuGDxT6R6om/JDu/X3OZiOr\nEay0tUZF2OSXA+ZElG79VZyU5hT+5FF2t/toGfTB3npYDh31tpXenPOFzmAa\nUjLlMNRfbgkEwRxTMd7DWq1Lg9jtlaceBwyHCU97XIk42IMAzRNZSc0zKOP4\nO2iIKEs9pG3ph+stFOolZTD6xURNZyBG2GRxRwU5MSAhopRfDCBY6ZRVdYJI\n2UiqQ9mhYJRM91qIw7xcTSoAgpyNm8F0pKzMbpam33bEfyPmNVoQsIeVDzum\nVVtjj50T2aPz4agtFZnDwYnTaVUEpcsKnXXSg7SaPk2R8XYUZ44cPuKd6ZIr\nAPI3OULyJaQ+J/vnoxB47A4nsr75w8qYRawa+wuAOomm8smna2WOckW7uZm1\nhHaqI/Ei1d/2b/DkVsHs3PUn2KysP1/LkMDTJiF58ezptQTDCnjAmfmpnyMK\nlbittGb7c5O08V2LTvM29M+RKUdfqCIWDK3Kh8Wl3PY6wUx+Ya3PEiLmr9kM\nc4PC\r\n=7IMS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD20IUw/JWXWptppC+Fg3kOEiI+WFO0Z0rue1iU/UC0PQIhAKGdje1bBINLIV/9/NuwMGrW0+KzoJFkt8DzmQyLdH4U"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17_1614058479214_0.026764318228136297"},"_hasShrinkwrap":false},"6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0","gitHead":"b145bad69fbc5b043a474fdb62a303a13e4d25f7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-K0tMjMDiRtErlpliRSjRwH8hHouO3SJR75Ds0D5TppuyFGI0wo/xfucrtXNA1hTXvjXVC2dxiHnkdyUBIkHccg==","shasum":"6d1257ca22baad2b234c9213c18e414691699bab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0.tgz","fileCount":56,"unpackedSize":305987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJP9CRA9TVsSAnZWagAAGN8QAJriSSXxJ5eftK7ezePw\nO0g1zK6PpiVFIk+OTjQdzygIADqFiBh41XZy/0yV0/LAQClT74WlSCY/s3wu\naAPELdi8LN7ud7Kw1vpzuNI1hhQbF4HkR2C5+EwOtSblDBLdmphTIrnv1EUv\naUBWDTdKjxZ0lQhX4YsnGvoZpSC12Dv4iKxEDyqYmhFQhVaL0Otb80LOH2o4\nsLJmxV4ymNzPO/IZ7BWERTv8y6bYzkAt8kKUwO4VPGqfOn3cN5Ped/MNHLdh\nx4523OkbuilBG3ydKnQPmk99eQ3Kpp5ddH0NdJ6S/kG0Ou5LBsS42WOhGKcf\njzN85KUfgYcfQXw6WTywWJMZB0jNx6YhCzPJvzDRuI8y15BzYNubzI3u2En+\nbT7b2wrWlvE3HjZsKMlBIvr8Zcgseax95Pb/TOLfUI/tafCKtZt4I8i1kTQB\n7vBUUAthKKlo8EJFA3QN3WM8yERoW1YwBjm6SgEfBUo0e8I83fRZNd7ig4z2\n+Nc1UUMJeP+2hIlTRhey9EL+bgdcy3Xf079iPu78l9KU3ucLvo1OglXhl42U\nz/99TYcYEFgaq/9tZKZ1tp9rCjCEG55nTi6YnkesKmcLH1FIY4kkwxU7mXJt\nXDkUq/33akxjAc9DwqbGExw317o5PEyFWRkTLO2LcmJC1HJPyV+Zl4iG8Qct\nbF0q\r\n=Sv25\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICIjo5lrFZQf0VVK2fC3e0NPKO/qzXYMqePVtJYRpULfAiEApP/MLn0Rhkw61YSTtyZBLDyAh/+Fuk1civVjcBHFOwY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0_1614058492476_0.25405410940749507"},"_hasShrinkwrap":false},"6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.0","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7e0c06701cb12838ed16534bc571f1a3ffdc1e60","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-zqnNw8wqu8Egb10kZMfUbY5tz7fe/fYYJsWz7IB0hOk5Dief7i3OvEiogSIxu+QGp4Cn4XjfVplZq4ogUB6L7Q==","shasum":"0d3740580a139cadc7c6a7a7d6e12189457523d5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0.tgz","fileCount":56,"unpackedSize":306289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJQiCRA9TVsSAnZWagAAFaMQAIMI9NMHM7w5OSm+Qeq3\nn7gRXUYbCONUMKnKUVMIrEozw6erHq4EW3CkfclHT1WsR2ZxtamsehBZfov0\nSaFJQdby/Pe71bcPgMpebp02XM2LqTxVRK7cfG6e/VeAY/mOV5W3UfBawwmM\n5dxbE5sOAxXjEsTAtLaIZoiPcDIz+mhrdVLNytGGfgW/P5p7b3k3LThgGb+L\nq8nGC/AmpuUCZmiai8KBV3AT51GkGxuFxC8vEmsehDnxRDdltAiURbRMLo1n\nRlsbNRAmzJSmj/kOLziVA6w7uOyB2VY6uGbm/U1uskf0toXKm3rNGowObGVF\ndnvqvIAJ3vocQ/qxEC0uvKmR8Y2w3M2PY0eb5SuNY+OpjJfuOmt8akQkvRZ2\naOlQYjvJfcgpEmVQ64JVWH6NdC1mWnHBQsSCzkHyzGzCvW7nf1zK+5gh+eDC\nD9Rgf5MGIOtDk6he7hNGpqKYkANYmuHcd52tLNfVkmkCrN/a3rZufE1ICpZW\njNbhf89B/6OcsBTIOgDeL4HlBQcLihNkvc3kyQOr55gWG1IIHZOVEMREEhgS\nsiQ8QnEwBPqHKkZlkvvbv6HhquAGWNHbTQa1HSuXKyIWgY0Hpv+b5xRdfPMh\naS66bq5eCKRrBOqOPnStdlXPP64a+BIrOxuNiu2UA5WtP4MrnEcZcCDbV6sn\nKhmo\r\n=6aql\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdIEOIw/OrJJPYIrwJDJmoo6VhSS+V2AnoG4D9irPL0AiAk0S3r04zLAo+PQzkNm+3mFsoBIRlAfabuiRIOk4b84A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0_1614058529832_0.8945711806354084"},"_hasShrinkwrap":false},"6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"63d432ebda1ed01446eba38268baa32294403be8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Tx6HHp6bBTFtisU/uyHxGiiuF2vSjfSHPfiYaAt6xbcnkEwgdjLR0oV+g4bC2HRErretfL7ydvURp28Vm2M+5g==","shasum":"f1c3eca314f66ebde35a5a42334d0cc176ebb918","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0.tgz","fileCount":56,"unpackedSize":306289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJRQCRA9TVsSAnZWagAAjzwQAIUrd6J/6JWevh2NtpqZ\nhRCenbWXbysNtWdDEyW18Esm1b3VogGpb81PavqJFNJcfSA6nw/xsT85fHdl\nbxzPLHtjBqvXaE6eMph2KVZLeh5nvX/7YaBy13Lg8d6+KLNt3KP5qtSIw5T8\n9XdvrXsJUj45rdPzoBvI73gXVFz1d7ZLkIKg3tfXBkpOyOuXKUOE/X2X1jUx\nyMd8X/wKQzyDIfo4nQhX4NDYP2BOjSCU8MVDbLagY5jMEshKmP7R0f7Shpfn\nXXxM/8QPk+dEsYju7BrtAssxo7lIBg9vgnREH/OhaX5azZZI2yk9MHV7wX99\naTLci147vFWlcPrbWNU7QTsgQm/DbFDFQAjfEUnTUgkV8hfi1GcCAnkW3XZL\nuwQixt7IX6/kH+XS9AVmECpxyXcatw7xCtm5LCbwCbkO0kAIRCFJoy0NTc56\nXVG1QrbO5ArKdOw5ByCm8+CzaX15x7IJTkPH5hp42WTeuw1HQQbKUoeGgjeO\n5DMTMw1D8j0XA+54oLIk39oV39+Cigf8rwvuYHBlFtAmpzopOr9K0+gDa0Nh\nq2bKDAM0UiFFJu31k0Iapr0Kl8Kz4AbsotuMbmIOEEPp1ybvAPbp3QxW1KlS\n53EEZPS8GrmcQLJNaQdywO+bHb4+rkM73WbGinp2DNCUu6RyzaL/cJQ1+mWX\n/8qc\r\n=j+iB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEosUeLLlPSCQexsNhw9wVET4lDFjMXnxDolz8hHB+rUAiA3bT8I4YdnZR8hfcHVh4DjX9aRqPMvd385pnsmSyTKNA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0_1614058575352_0.5768929594924963"},"_hasShrinkwrap":false},"6.6.18":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.18","gitHead":"e6f3cce6f91ba7ffab46b931771433872f41b3c4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.18","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-34Lw6t+NKY0XQ8XbeqvGmVajA8UaRPaRuCfdSgUJ12Ulwc6OixsQUlXl/qTfxogROKwarAFAAARuOLx4Qnoz6A==","shasum":"4175e88bd9688eaf789ab0bee7171918c479fdd5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.18.tgz","fileCount":56,"unpackedSize":306520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJRmCRA9TVsSAnZWagAA9WgP/RYoHHF50oEsUykf3RTb\nLEn7FuHhZZFoo0/1B6vimxCoPc3Wnfnd6dXDNEsd75C3noE1uMb9kUBytWMd\nZHRvYjyaQcOXqomf5d1JFa5nqOcciD8c0GP9Fi6hAnTZe045R/VgE27dAMzh\nkuriiJVDP3B7o02NteIMrxkUdy2O+i0BUPVqSHn7TlfzfXrGcmr6VZtPueQg\nsAv95ka6iAU+VeVHYK4oksNorTOQuLmGkwSotieNvj+O6g4sT5Xk4HGSRi99\nO2qHW9A1/TiOxpG3Wlc/6LoPFAqVs0zYwGZV7RX5HIapMLpNSTk8VNyICkhH\nyE/5aNacpnoF3X6NwpGJHP1kMLGsa+oC4ML1uKSnnnEfWVDoaMBtufCAhOUl\nvkJcFB4a/sgHdhOJ/R6tB3gvlTBqGOrug6fyrJWkiRYTCMRx0o391VfES5FF\nez47Hr0fspLHp2yFhp/uNqfRGlmgyASvYCWJf/nPPipfLw1hNVth5lwwtdvI\nBylq/dRNs72TEiJtBFL712GIHhS0TV2uWHYd5tqCnv6zVhXhdVc40PEsHeY6\nEuUZPzVaSp3OjnIDuwmliJyNS3qgRdur2kh1i8S1CjgxhrUP/nHonVKikdD3\nBzlMeavwHvag+F2UJqT5y1agqitCIW0WSL9rGc0uwM1zGIhjgPjOxWCiouBL\n0yoa\r\n=w/Ie\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQLkQQq8/WvnilAvu1B3qwTIHN+rkakeHo5EVTKuSReAiArvtQJjYEkBHZLq+xi+L1jAYS162RLATE7TI4eUcuvzQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.18_1614058598127_0.49296721556787926"},"_hasShrinkwrap":false},"6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e6f3cce6f91ba7ffab46b931771433872f41b3c4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-np1QfCH0egvScZDI/FBeJw5mzCJLaxAEOFVf1i5yItFwe4F/KtOBm9HcKI1zzH1lR+UfqMPuE+uiPglkxiqWJQ==","shasum":"e9a159fd4ab56181265e23745134442b42540dcf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0.tgz","fileCount":56,"unpackedSize":306563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNJSJCRA9TVsSAnZWagAAKrUP/iRlIGXQKfHWGU1K7GcE\niKMwvIKES5iqyyBvN5wcXBkXxmOdL10uRITbVwVEoNnsu7/2RyyGd92viDDY\nfjm1O5qdgYruirNaTc79QA4ZB7UE55EnSvvNRFrB5PLYt8Tluz8xXDxV+9uf\nVH3tcihYxLMV25itPsZq0fs2OFsdYV5UK5LpKaS0Wb3qcXT2R0IxGskYypna\nrs8SNwUk6R4Z918s5oRHxBFaGb/jZc+2OBPbreEZmNe0D+gygV+ugUyYCYjm\nYSSQkD9CZ2KXfilX10UfZreydO/Q1wXd5Xt2eNsSTaaQRWMUXzJ2Cbv/Bkpy\nfCP44YMcUXj14R3j4iqWue0G3L/sEMDcZ9Dohw6AjZkjw72wNnkNMXTrYAv3\netpCWzTc3we8ky/Gv49T9QKRUMt4YkXqFPnQXrjG+RuYh43vyzlhX2luuft2\nAIwoqkvVOgu/QTmfYzo/q3hRNlKrRQZEwEnlS5+2AdVHVyWaRhl48oZOwNFH\ndR0CP+l3Qe2v6VTH5IN4UIp4zi+nm5w6v16VtuufVTl4ZVgDJ8xjEQhD8o/V\nTsC5lGeXw+0jST36pC6Cx4Eewmt68dxCP9FQhZ1YTIPSAeTnaZ8Z/UBXdPDK\nJxsLU9TD5jKToEMRIQmQGUxVRsQ8Z1yjtcIg2DlACK4vYhyvYPVsQLDQL/FX\nbMmU\r\n=M0rA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUHgZOD3yI0XXvVzuNGSG+X0TSuBdb0bgCdsXoCakkyAiAKa795csXyzj41zWBIBFKdndDC+Y3cUTbHdjq4ridjOw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0_1614058632410_0.8534195553637631"},"_hasShrinkwrap":false},"6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0","gitHead":"9560ad9643d5d30fffaa7fab48e4ec2c71e819f0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qnvStvYw0eWThid9NfQ+RGipiidiTdkN+QULa54TTQUAkfLZ7hrJC8Oj83QSXdvYo+yXisc+Xtm7XLbZohARtA==","shasum":"484f1e75646f8d85b1faa9d91d9b73bed5f17699","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0.tgz","fileCount":56,"unpackedSize":306563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNKlCCRA9TVsSAnZWagAAVyMP/3kKiwS9Xl8Smdmum74S\nUNiLRWoN0nkuTZKf8W4anZPL1vPK/B+yzHm6TZTBWjUUCEKVU1Jr0qsffIDS\nG4p5N0iRNGQriZ1wKFZYepGOxGwd1xBSaRL0YKZPg0KA7IuDBWTV8uq6NkZz\nK2e3mp9F3dQp4nvy4Q1ng2d8A56aLo9GGDbZj3ExaiWD1UcrqORBpFyNnzYi\nLIUixbXWEGccbBGJUp6B3BqjJnIiV8Kbjyr/s3CY7yX6aV/nbKxK6h//EYoK\nz/CohhZ8UP++IkPvWqzoEU9W6x2mAHDso3KZqLJQ6SAbMfm9GWBrY6JYPhKu\nbFdUH/Xbt0Q8PX5JYepemb/ZetOCacwNJXJ2ewxQK3edpFANSEh4vjG8AW6I\nbxGGDRmNHWGuemAVKg2VokH4J6ftT+TtGJzzzPlC/CxQlR6ALYBxWGn7R2zz\nrx/S3kfe98Cc0WMjjTH+sQvUMsWUy3QJhq+QUlTeiqI7Zy7Gcwb2RYbNBowd\nnUdo2WS6BZTfLxdTjeYlgWge+OI/++eB9q9ArTvfMWuJC2z91nm4/YTDclz/\nAA/9YHABkWS9ixii621nc8WkaHqtlY1BYVBaGt0ELf+vXKpcqfSFYppaNepy\n8/NY0nv23j7e0AglEQ7saGdvTnW1tcZjWfIx2DQsQoc8aTyFvOQ5Ug9dkY24\nVcBm\r\n=ilbu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPFjAVZJksDyDWRguk6rShwCuMIs9d32rdm2eOeZQPfwIga99zrZay3iJqMpuDr05vQx7Q9o+kT7sKiA9OhtFQ8aQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0_1614063937900_0.9773029941573013"},"_hasShrinkwrap":false},"6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"309f29f2782e5c5be9e2e31d405d29187e3ec2e7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-hxBchrY39H6EORN1+eU371opkZWc5aEiJUhDVyl+ndQzRRbORwArUc14/U5S2Csn2mL423P4umwZtY6xjOz5iA==","shasum":"b60acf7db257f12849e28c625be0d83f7d2a2a4d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0.tgz","fileCount":56,"unpackedSize":306563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNKmRCRA9TVsSAnZWagAAZiQP/iMwV7Ae1Hr7ODOJo8+C\nSXZT51TiGqX4J/EPNanBjd4Vq56tIvD1yvl6iGuaPlPy0ukRv9+TYoVhtL1b\nBl6gFEjOWZK9ZwKvI3yjPPxEd08paJ9mMFGqzgVlrRjHrb6BTPMvLsnbwSEO\nu6Ky3h7vLoiXM7/sMOCWoxem/oV44DUZ/gHzmNLkEkpg5QhmO4XTql4+EaK0\nh3o8lSlz2/6NMqxwS+Z3K6BQJ7GT3Y1R05FyNKqa5yhyg0IoUYg6v0ofqWNz\nWttQaptBSKZ6NaKU6ZuukJqErAYpYrRRNgUYT/YpSOUec0X6xZ0JHCFxIBfl\niaLICCC0r+AL77Q5rVw0BA0YVBaAdNR2dh2lkcC4P9u1hwvJccPjCiZkCko2\nYhaLqK3MjUrRLXoKEK7FZRjDv95Rd4scGGbfnl5C8ynVMTzkfAaKIYIeg3yW\n+Cobp2UmCrDn4QvVsNbasy0wunI/PewHScJaSonKnwrYirWGslGu6BUIb7kS\nBQALD0wJfF1lVErN8ZHWGScqirYX1wRePuwRaF+solZD9qHq0RrrAxe7KEbi\nV+hnMo5lJaKjaxI92eUFgT+DINAn265BdgyMOnQKryVYFjsZtU7u3I0rzm2B\nnmj44lT1S3DkhvTYICwyTnENA0lxbz6UriQWYjCos/+x5Igx4pER70BxFrhN\nTJtZ\r\n=NOAC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBJ3xqstsM/HU8UXbJGqWmNRx19yYmFTe0daMIvqVpgAIgc6F6R6uxG1mnOaA6maP9xc7y3KnsYEzwhTyQmGMVtp0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0_1614064016546_0.9892380658599931"},"_hasShrinkwrap":false},"6.6.19":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.19","gitHead":"f482596cda490505b97ef61695bfac6b9c5266ca","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.19","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-awQQRnmsx3YpeYRQTgm8PDbdeakB3pH9DqzdpSpwrpejJlivJHlky0Wu+NX+fixFdjuDxcKF149bVJqaohN7jQ==","shasum":"4cbc3c97a0ba654ac348efa7743e07cd955c9438","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.19.tgz","fileCount":56,"unpackedSize":306805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNKmwCRA9TVsSAnZWagAAgvAP/RUUm90CuKTSuwHVfYjl\np23e0eN7ixMN0ykc2AErhJ9Pm52w9J8dhDVZ7WM1HrwhfQwvQdkrL+aFsS2j\n+5q0ZKhgEH89EY2QXLH/G1EJPFdfZktJuZMPKQXhaPG+Wu8HDyLX1reYNChq\nBgwSI+7RpFqrIVF0eeplgqjWHGKIhScUpvM/DUA77L7ef05vORHtC1+L+iMR\nSQz4XyHtJNqekRipGReszDXvn2+BA3piRKCpWSw3KmZ9XGj0bLhrKR0Med7M\nQ0BPPogaXJgZfKONFL46H8Ub/dUjlPbDh1un2sC+7T1AMw5Cd/vkSy3+UHUF\nkiCzcNXovQHc3suFuOiIpJ/ypwaufjaIu2H4NNyaD9LAVQ4ecDY94Rctw5gl\n+Vgv+jzF8eJwK1Rd65JhPTSbK/AfNwJoa5+D/EhcM5SrBoVVjhq2vfcDi/8+\nGo3bUsTIyyxUrVJXKu2LIFiL8xgOdUlmiKLdBePtBiten9hSrk80HHcg/R7K\n2l5lwVsTXSRjIY0aTDJtDWikkIZ7STXfuNx15/Y5aZ4BVeGUrowz3Ue1yjpL\nEMNr6hmWOxb78kNTuvKxuov1Zb0M+7B8N44iORAq3dcHiGBnQ0S4oj4b3YOj\nrlPl3WTkU4ArQxVX5ZpT3xTPxiNE8XYpSAwCB6ZJta3k8BaXmH9pcmUjsjEv\nU/DC\r\n=k6sq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESiHIevmf7rMm45boE5sKKh4SKZ8MfYCZMG0LeJdMXSAiEA8L9GccDR9e6PAFtHCEzIVoQfOGf7GvRK2TKN7VO7cSY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.19_1614064047525_0.8703979933924268"},"_hasShrinkwrap":false},"6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f482596cda490505b97ef61695bfac6b9c5266ca","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-THnlPcXP5NhRdQUBXy/voJg/ykJ6lZ+qczOrtuFFaKf0V95itmKZQqB7g5d3tq7bC2+YJRUVuEM8GlRORR9tFQ==","shasum":"4d369de62a914b93114b9ea02371175dc5468268","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0.tgz","fileCount":56,"unpackedSize":306848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNKnRCRA9TVsSAnZWagAAMYAP/j0ZKfUfRaXdPOpFEH0z\nzqv3KkzW0MG17idbLLR9ih4F8FP1KfqLc5mvUtw1PQ5YXxpPQe7CBDGU8AXK\n2F/M8am7tddXvxbZwBDnqeyCNB6xB2fUiOJcRhAKyK/QnAJSpf1d2ZaCqgpC\nXgasWMj2BxiCvkvYlI99cqFvFSoYkRExXIuL2v5VHdxaxHUNyBLHEpp2XxY/\nj+t1dpe6In55mjdb0t+vBq0i7hB2T6oeNKYhJGFAZ6hi+772jGelle87DoML\nZJWPQAc2AYJRZeZ9PCvzyHRwNZPWjH2585QvO44KmKtd9SxgXu6AvIs5/5WG\nx0WJdaNI/ARC79QHRHWMrLEAND26RgdxvLEDtN4Np1iagl6/xDylWZtpMC3g\nm/IgPg2KCc8sDYOKmdhoHA2UW1baUUzHwxqA6e0An1ti+dmbt9ZGeO2Lze93\n7sssyYeVnrorUoFE6ZfG44YRb84WvwAIygYPAum7RG0ZbfAbfFjIzSN3P0BF\nkbzNUXowUPRcYiK1r8y9OmP1qYVOCv95zxW25G5blIr0WwXif3364OuY8JiY\nO2CNf6QzINPQhDch33FJ6Tr2iowEclakvQNOaM8kXZbsY99ysRbmFc6qdSi5\ncMhRdCeimwk0E25QQeFbAvIOaBLkX57kb/fb0P5LEHsemTcjC2gTugsfnWw9\n8ZzP\r\n=55BY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLa6AVTLjxANU6R3ixY5/PQ8ytMeyzv+JpSVpM23v8VwIhAL/Vexy/b9B0eaUnCSoP0FzHRA+LN/aRcZ3VMV+PGg/O"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0_1614064081156_0.3244011800049518"},"_hasShrinkwrap":false},"6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0","gitHead":"6c982e9bbdf1c565b7eb005488a4db2e8223459c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-qq/8qzWbqsUvXg6UVp38BGaXOn0FxJuSas8Yd+9O0TVWdFXl6N/1TriXs0CKbuEwDuWftf3lCz8E3xSHrfOp5w==","shasum":"d35076c4eb54d705d67ed306b819c9cb07fd96c4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0.tgz","fileCount":56,"unpackedSize":306848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK30CRA9TVsSAnZWagAAwBkQAKSAUnW541S4Hb6lNuBG\nA2UjhuJpd1bbrRFSIIQ+bqTNE0QHPyvu/70VnTOCrWO2phJP1Vjb8P50pYXL\nQM9dcrEKZ0RxCecTZ69MHIYA2qLUq1tHmhWTGN/ghWKIKv9RoP8yqKb2VHjE\nxirCagNtGALhBtuj9KqX3I7U8/EzOFbrOex+osWOy99ekZ6M8ZLUvbV/jVp5\n7hKZQRBziaMGsS5iBdwGP0uqZJ7j1Pw7QBb2WG9jo0HUFk5O8BRBQgyN7Z5y\nq2SEKOOOSqnjlkQbAlK8UVbpAglk8xniFJeX/J/C0zfqgzzN2NPLTq7pnoAt\ngTMqKqa0aGOL/lGL1SXsRkEWhia2OAfHwDSQDpExM4wK9PsWOLARtZ00YbiK\nlacwA2rMIY8119oyBgkgCA4TXUozmsgcgnmEG9jOyz8yr4GrAyT5bf56vIoV\nDvBRPJBe20jHrSLUg5B2V06nWZ6qe32RG97I1f2paOJnji9fN5pXTFxDuJCu\nzv2LD0VJKjidGclFdR1mvcnZQ1XqJVmNildbShLyh++H2UsGIwrAR+WQ58Ne\noEeYO03bivsbstcD8HwNupxh0vlKMF6n9pMIFHrQsq7hAUoP3SJQipO0q6Q4\nWMVjTGXNbKxUZpY4dXkw0jh7ZNtZ/CY6uO/eKrGEG47YgMbWuq2bzg3iUQO6\njL82\r\n=svPt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMAjT/Vu4uKryI88v0DXN49XJuCrBH30bQnKF3XnzovQIgD8y65k/JB/JzxNOkddfX/tXtbiuR3sEbM+uiwczLpEg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0_1614065140214_0.3458121504845464"},"_hasShrinkwrap":false},"6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.9","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0","gitHead":"137f7f51d565ea5058907f806d3d2b930b72dbfa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-fG7zDsKBO7dg4RHuX3DncROazu71Aq3w+aaYLJErJ52E2yOfKWLpEPOU1M/JBHN/nOGj4w98WGTyWPsxE5yluA==","shasum":"65838a9fbcc970a8473b859c7f867a2f4df1b5ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0.tgz","fileCount":56,"unpackedSize":306847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK5nCRA9TVsSAnZWagAASxIP/i68mbQPEYu5eXLVndDO\n+1hpy1UksWxyBJXF/fQs04uDwjHVKCk2n3lJrXn2S7UanVjzFYSjAI57dNA7\n7TnJ9hYmPRhI/miM4s5iDjx7TNe3TcGSXWSUp2+VXeSEo/nNKAIMl8GnFGOi\nZfdMDNc7+0vv2F+U66t1lDdXYOHM4z5xosfawWEzngS2rYLG5xkGl70561w4\nrjTSiisEMN/wEP9HgoJm66Adp/rgyATGQ+lY/vn0nEhoTaRsQHIWObzBElAM\nHhA9CId5VzQMcarM4lVXs1UX+N1jG4e7y9Kg8kxzquHMx2ojuf0Oem3pnhzC\njvIledlbOTQgte4b8YGOoQFmri+s29ZOJggwVatli2wIiZhSQwHfw3Lp6KNa\na4hrWjRD1NnUm46g0VXbFkA2JcH/WaVlne7o2hMYQrLVPEu7LFtcEW6LdQKk\nsfTM6ytp7engIFqmFzrI3r6jSHN2UhVkXxcfXk/A0qALQSIT01dv+Q/9VkYQ\nmPukEu3l7hpN2tHwP/JKyZUTbi7vSsLr+hePXl97KnPcHEZg5BCDAEh6yPNc\n7adaYTavqT0UYftHTXfoeFWSlPJIcRVU1pZtwrgHIPC5OizA93Q6ijVYNIe8\n+BOAz5Mig2lyJLT4fT2UyCRlboi9qAlbEyCh1L4BuqUkCCDuHBdhLVWaxV/Y\nebHg\r\n=CibH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDgNS3u4Ktk6h8w0eO56A6qMGvkfpduT1C4vCYFHm74AiBkl/dRqTnkbi3MlUHoOxSj7pHrsXs6jKVGmpMM2orjBg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0_1614065255005_0.0790634294842052"},"_hasShrinkwrap":false},"6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0","gitHead":"cdfecdf8eb2866fbf9dee602360288f6ed88047a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-EpVbOQ9Hasqg0gVHT//QxTxLetcKk+uVRv/0kAx+NKeMVL78pFHOlH0dK1MgVgkv9N2E9RSjy6dVNianEx+WFQ==","shasum":"ceea9ec356006b7984704cf8866f8a8528d498d6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0.tgz","fileCount":56,"unpackedSize":306848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK6CCRA9TVsSAnZWagAApJgP/jiUPh1D75uLAwV+Bzn3\nUkBw1vk0MvyXfsAx0U0AF9ZDjj3SjZtF32fw7wB2fTYCB4D/mi6dUTePAFxP\nC8bH5dFbrxDKxTTs16n8UOrV1JTrTA2mWyIQGcuqY4kNQZstH6zhR1q9aQ4d\nNkhU0a5Pk7+KmlmzgBeF6oQsSDfm1Rcc9hiewA2RZFSAUWvQTevUj1qAVtdh\nk3PkvG1NLedbCayjayUDPH/s/s/CK2ZztOXIhRfONBDlfsV70dlphArF7zjg\n+7+BX85Os8tJ14EPGChrjEows0Swizfeh5rd0GBs/cZN6WKY7Cq1VL0w6ANz\nKzkzZpXHlsprfrUvcd0wfOAfMHWnNywUOXCkUsdkdd4ht2aqeCxXJ+B+zQmV\nHVdTJAO7PFNOR5mXLv+sAXZJ+rYXqHgTG7C9hcMeEyc0uZJMg+fuvDIevG2G\nq8bfSJox+5TeripFcWtTEmSDEmmBwAOlX9KxFVdWBDHFELCBcy66r+53v/Za\ntS1yrMVwqGKh2eyGa2oWIEgiwfvswM2huvaQL9e3bk3cJzaSLRXt+B9+t01E\nGtV2fsJpe6B6FsEyo54/FIc9emhRvPEBclnOrOpvvASlv7s+uU1QMu0N8lHs\n7zJvhpf/M6jEUm92SIXZQzqARXDNPUoK560f3HPhGJyMx8aG+PRAf4KiW3ZN\n4Ox4\r\n=d4Rt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEWyqi/0p/41C0yvz6Qgwwo8+wE2BEkBfS/QFy1X1IPgIhAJ87rZ4ShfQipFPslgN6tE3SF86iuweYwW06NltaaYMi"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0_1614065281876_0.6197186468449427"},"_hasShrinkwrap":false},"6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ecc979bd46994540c92d379c96b58b6e4a7a8a4f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-g7KwYBJPAYDixm9oDK1yAEz10ol/DE26fIHQ+BEn1dG3XXY4UAZDcy62+g6QLSDfGVOEYZftCUDFEIWyPrkj/g==","shasum":"ee102aa59166ebcbde3dd0e0c0874ecd749dfa6c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0.tgz","fileCount":56,"unpackedSize":306848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK7xCRA9TVsSAnZWagAAD6QP/3YPjxKplCLuX6CuK6j4\nA93WsLe0BmBaPpq47r6lE3WoBeZ1tAM5Nm8tNziTKD2Z93xZPb15oGh34Jqv\nXsyZ4tjVQ3ZxGqg5UhbjwXXih6tBASJYPadRj2lk6wZRSRcO/c2KLoaZrI5i\n0Ax6rQmF3LXKpsYR1W1aZQHqGpO7J14ABJevOBdT1ODjAFYZswf+Ed7sgTOO\nz5cv93N8xJyJTeNerLOXqYoHDnzt1ERrOdO9kepihCkJZbKBGm9Ft0JPaLxW\ncZ3MJtQ8GwhYlHyYJCdmqPRjIJxHKt7V3LVnWjlde9q0U00fQHp4SDBRSWNO\n28qPbsW1bvarCCfN9g84wHdlyOg0/50sj6SuKk6SZyfRIjvbpPNpHDQFu4E+\npnILsjP32bV0xEHljEDTN6+6Oyjc0nC/xiVzSqKGwTz9nmDLUg/+SxvvL0NO\nKzfm+Oy5GUNRs+YlzTbMkRxZtwyFASKttEWORVFKTkNOQirM6oF2W6VM/UPE\nVonIQFCQs33L02PGMkRG6Rn0ysLotW7ZN2rnQr6KmUPO+n5iyq9AuZyRjNPx\nAnD+5O4diA2bTEFcnyK5SqaHEzgIGoImcAsj/Oer/sKRBY1qS6Ke8sc7D1uR\nnIB5WeAW0d0k8icaIvlN4viSUdr85kvyQLYCH+5rQkq+GPZLrVky9IIpkShR\nHZEs\r\n=GoTq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEewvZFCtyiAkYqMTlyti9i9SW5+oBIDF/PWL2EOW6oAiEAwNckpV0N5VU+sAziAAuppZ0rY5rWg7rG3DXPJxNvXRE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0_1614065393100_0.8405043546457214"},"_hasShrinkwrap":false},"6.6.20":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.20","gitHead":"fb5646d5a66386c32eb8bd2a4e820484449a61f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.20","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-yQoMq/IB3iFXLgp6vKd/6HAIJbWnzC8w0DW0E003Et5Ai5aAbIoh8Ejak9ago1dE4fEiAkhxc2QehYspKKjt/A==","shasum":"79ba4f81375fb906b9d57b7357ae034b7f2a1de0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.20.tgz","fileCount":56,"unpackedSize":307091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK8PCRA9TVsSAnZWagAAvoEP/ArbjbG+Xbtr0O6JCYQq\noFhU24PFP93PabW0H+IeH60y5e+iODCFxi6sGF3fB43SoGrNOPSNjFG3OcHQ\npZNUhGqGe80h6AFrYrS8A/zjxjDA6lLRL0dLlGPIybViwZjWSDimDrVpxg0g\nchkr5ZDpY1c0KvJ4Nk1iUwCztzq3tKsIHz6pzpOAmMyHjuW099VbfDy/diYm\nE1f3fdcuOiIu092tcuBe4OWWfxEF/8rCRNrh5Hm7QTdd6wlxsMawDPl7dT8D\nvp7g0KBhTI9sMMerFbKpjhzZYP0zuIXBPwJ0J6jXP5oKKlmXal13AuoVFxWZ\np96qxsIymiSLZeEb7eD3O6+M80mcTC7XYyCSdnBNaSOz4OVz5bMKKwalqn2P\nyacmH2oX8b52a31je3KqIpeoJ1IXAhaIQAnyqAMdf9Ecp5cQ10Q7HiHDd7QS\n3uYJqqi64PAgXEy06wJL8ewPcwd34nlv9kEx7yZglwrldQetlB7LoVnWEtUP\ngpmCDOboVj3qquh3d1vjo+Ei0wZT8pgcoFuwcW6PGMSOr387r0JsHv9bshnz\nDOywMhYS3V/kdSw0zt2ir6hjjdCZYVgZTC15NlX8eayUu0YhPRBaQQLIVc0w\nLMbZWcMRd/724K1DwtWvvv08nARUpuoymKPUXCGoJ2i6Sq/lw7fgbXHHUklg\naoLp\r\n=HNb/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMptvrO51UX1F20kPvSY3hYdh5OJtQ00UZrpLoHwyxOAiEA+Z8GzJD5r8YAM99CT8QApNEoOMsOLQ+eaWuMc3NFBqo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.20_1614065422796_0.025286371696422005"},"_hasShrinkwrap":false},"6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"fb5646d5a66386c32eb8bd2a4e820484449a61f0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-FHltVU8wmMJsY5m29BFU/wQofFMYSpNyKGv3MCLTd1yJda1l+BF8qUBrJyf64dw4y8fiGK6+9TACvV1v+bSaog==","shasum":"8c9b9889534367462780944086260ecc3bb90820","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0.tgz","fileCount":56,"unpackedSize":307134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK9QCRA9TVsSAnZWagAArCgP/RtFrlLaPx3hOYxO5Pop\nh/11bbD2qMjUI4c03n7MQ5uLEnEJ1RRJ+hR4rLMg5+L485bulmFa9IWse7J9\njMGojwvvf3+MR3UdUWz9601/qjHGLjbrZcM97YdjZt29meW1FuMebiUmaIQx\nQSb9LILLbV/V03QNjRkIXaWpS9l/k75HtljNSznqZfLsGY/k+YUvWzVI1gax\njS1GeHUeVEXTPBMvV3FEdzCYHxvirVZceigTfS1ZMAYITRvu+bFufO69SURp\nsd7TeS3sFoJeP/97hFXCoUJIni1h4KkwaKNL6glO2dP7adaS5I6ZPevI5pgZ\ngoWOyB+sHct6g5p+CwIZtZoBJwaECf3hVbLsDdm4IipAI4BWvJMvUm5CVutT\na1t8qmpRpQfRyk37rucwtMwYecH29LtsqQCu7NYDxnEKRp++zJkspCirZZMy\nhaFhn757Lnl1k9Ys+38Ml9lYiSYfacXxb+muUGt8Hbi2/x622DV/A313A19+\nYgRE2O/UBIKg/HsTL21x3ve5bUrY6m415uYx3kIx+Gq9kpci3lMuDyrp0wcY\nBOpKQaRX7CGxP8WwmG45fGjx9CCPNXhvWsL/jSwzAh3LSk6FX36pzvdhYMmJ\na1/8kpvN1x6uwxHYqiV8U3jIjdGeEsK7G3VS9UbIB/cWalqZD/SwPa52FKex\nJFuR\r\n=idNr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBgJjTXxYwuVkudn2YqiaJLSC2bvI2/lD0oipKPtnTgAAiBIK1SCe7ePWObicej8iLQaVf6N4Y/boyrvwFpP7k9AIQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0_1614065487546_0.28566501415223566"},"_hasShrinkwrap":false},"6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0","gitHead":"3a1f00b59fd267f7c7174db1db10950817e11a37","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Yjah6xZ7z14b02vf3k9LdrCEF9hGTAzj26uQl6s17YV9hgK1nLboMdbIVu7yGGufLHUR5lXPvl/70PCXav0BpQ==","shasum":"9edfc31b19a510eaa35f74cfb0cc69273fcf3de8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0.tgz","fileCount":56,"unpackedSize":307134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNK+oCRA9TVsSAnZWagAAvvEP/2Dzw6mC+zLiPuw1lLCY\nQLRGDs6+DTLBkowjrYJzFJmiaGTW7/wLtr1Q1PNgqXCqjqx8DqLJnQJCfeVv\nujSc5yNK1XK+g1sVzzjFl/rRxoM8epVG7ZvlNf7L4/cfsS21HtVZmQUmOvHr\nv9HwfKNAoqEUCPUMHi2jnDHI01BneOzPSjPxMPpTV4DupRTrrjoK0/vwR+T6\nTvKv/hFwdQ3XuR6urtWImfrxWEQeYN+y1+phu/HbpMHFEdwKwX6rTSIbB0fa\n6CWvvfTn36t4qcVsFGdyCC7pf+Koo6cgBWpaCS+mRzzQNDZhh7MnMjX9PR49\nAA4BTkrxAGNj8F2Ki/UsmbOguznf8aenixPMCqMQamHa4QE+zc2wxW1TmqRe\nlwaXOWJMi2ZUvbe9EjoMsBA2BemQXmRwOFy3wmQu3q0cU4fSnuRBS/ds1NQ1\n6NeJ701GFoSTNgAx262zauDSwA1Stosj3GyNtn8sSPgOmGl1MqweBaoV55T8\n1oPYUWx82yZWI7bOJqtHAR5qErO0s2Xrb9OZszr5BmiDNg5H28CVD3/Zliih\nJa6U1Ef0W6lGViwrnY3p6U6BZ/IF18ph59Nnk97AtxmKTEGkWKMsHUlgzBnK\nCu8sf9mNVE7DMjXD0R/onWxNIId29K9c5zK2t9J1Rp8zltXG+6xN6ATEIJqS\nCTOv\r\n=Tp4h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJ87iGYs1QXf6aYpXLsuitfvmsPQ2ksGqPVEmFMgwNkAiAFnTMG4rGVydK8nKq3wvnH6rZR7LxSkAXPRywfLhkrwg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0_1614065576126_0.5999441616620114"},"_hasShrinkwrap":false},"6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.8.9","@types/jest":"^26.0.20","@types/node":"^14.14.30","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0","gitHead":"856e4b4b1fdd89030b03947c89077cf71948440d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-5dINqbE1wwJxduyb4cXAy9miZpklD3dznhqTAJeF3ebH3J2xDoHzWVoGMD48oivUIq2R/AJN3Uqv32EtnseGrA==","shasum":"da04bc1ad7ee39a82dbeb0b6c7f101246f47ddf3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0.tgz","fileCount":56,"unpackedSize":307133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNLDSCRA9TVsSAnZWagAAyXQP/RyCvoHXOSq3B/R+yL1l\nxH9itwc4i4rr1TqW0YAkURi+U2i60mTM6djqkdvbtqvScW8ZNcsOcG0iSd6u\nBXqqxLZ3a/TCDU0QL/OxVdD6kFeDVNHXPCdBCan3XrfyHJRYvemLLWzvbPi6\n6xoSyujQcOXp1k4FSlTtCqmy5abisNAtzcrUFS/ooxi2JXWrFVwRKf6Ao1by\n/q1nMtfI2FFQ+QM0heMMSlqhMWbCrfxB+cZFWfQ+86ARON5b/3dT1/L2y/Yg\nbSHNmqZuzPqMEsTb6encCZYvZJ6r+aeoQmskJpaxgkyU/TZZs4cnwcjLbbKQ\n1gmuRI619vitiCx9D5plmdAAukVG1rlCBlobFRLw0Au2DTE9qdbDtkIqf0D6\nWu5fgoiAtMvmQVpkk3YkfH2f7D2tuVX4GyXULwn4na00BqmqzArDEjppq1d7\n72/gFB9i88ZIbC/d+R8x7gTEeyYevQLqdLC1n2EI7UI9iOHzQzz9x4IidOz1\n3e5wcLKQ5cCZtZoSnNG5ZEDQBGEREhm8uu5enEpRHgCM86V9lGaAPvmOlNmd\nvsxW11RZXepofU05nbaXh8yPkky/d1NAOMNdbhSZCEwJdcl8ZZiy+D1LNhqy\nUMXKMIxznh2/rrfCjUAG8JsalEDRLI7YpQIJdUDiwdHzY/H0kFR4qPp3Rcix\nCfPW\r\n=1xKT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBEFSWNF3laM3/pyKb10PAjF0jhicInQ1BQlfHzKOfUAiEArc+Lb/usrK/a2DtXGFIDrlvwFkJBgCnXHhR5P++mBKo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0_1614065873507_0.16976385445395237"},"_hasShrinkwrap":false},"6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0","gitHead":"5fa8b8cac7f78a51edf3eda73b92d0e00037844c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-W78wrRk9sQhFWG5u5S0P3bQWKeTFWjFNnE46tqeFDdA6l4R39x0Kdk2dfGKT2orPmb4CzWLSnvsHfVi0Ubfwtw==","shasum":"7cd65a78ec6b45f85cb5b2bf38ea036e6d1a9016","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0.tgz","fileCount":56,"unpackedSize":307244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQWACRA9TVsSAnZWagAAi2AQAI+jUDUF5RqsCFpJMXlx\n6PGuU2CA5LyNlMtEXreSs1kYnWCcbLwNEZWAywfoMJWJtCBHpNkzmKJrkmqj\nES8R9kDcxhtjxGdnGJI+KWVlHwBzJc6qjiAEvt4/k4gDqQFBnd87lhuwiB7d\nCPU61egWlwey9gvUphED+hw2eU/kV6zz4PAu//sjw5RDyIDw14L51tUQqZT8\njisktfSQwWoeLslgHk0NJBxTEHshIRYCFEbyNQZByl2Tuam6nVb13OtAQn3e\nIzk5hwMvHzvJF5nGBaIS9lVadWSNyWf0jfgPc4Dj82X1w9n9FNlH0cOmrtmq\njkHCTFyQw0kM8YIeFQs8+z/bXyDx+2LRfBac6haEqRrnP6Umfp3cxGdIaUrM\nb2iFmSDAF1QJrevwiJybsAfqAD2RsXHc6qBOfO0larX/OSDGVIUDstTudvIn\n74880sOiVC855elcdH/99HIMW2C9Sd+8x2WBP0jkyVB/13CdImIsz4t92oO8\nYN1nB3jXGtCs+gkx+I1VlX0iYMK35HuYgZbM1EmGoW6i3Arz6w54j00MEOWl\nme1ouN4VGCQrHnhIA5vvl8bKC2xieBvkH38SzfAcY54QHSZEIEfSWIuDa5As\nfoJgQTTRFdwKtKWorytPrtCzlH5tpR0WL41RXf/MCfPWQWy2JLLOSueLk05A\n68n3\r\n=WUyW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5R4WzBVDsfX/lLmPXCyEGh7cZVSEXKzfo4pN/CSOSqQIhAIvT6Ofe7Y/iJPph44gxfciNLOrvmSB/WmQSIuALtFCQ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0_1614087552437_0.5509612559707311"},"_hasShrinkwrap":false},"6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"6754ba04dc918f93f8cbf6dc745d3966e91a05ed","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-X06D1s97w4GqzRF3xEq0eHVs5jY1DweGTELhP31JyISei20yvf5pFQQPs+OO5pWSA+JkkSHfhm6vFigoRT4Chw==","shasum":"c45f908ebfc87682311ee01078e547438c83d579","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0.tgz","fileCount":56,"unpackedSize":307244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQXeCRA9TVsSAnZWagAAzs4QAJpdYpQLY7/nl6NhcoXn\nl+pMC8uYC3BLlZkjaP4eD9eIOaMPAE1ZT+Z9C7WHOSX2ygUSv3LvKvSMrNyz\n1m/QzMyR82yNC5mUk0k3gyWvYNaK/HXKOncDEGP4VGFVeGI+T28JrIxNMS4X\nzHC324Z8lG6sMSJz55YokIwZj4+Tgn0y2DrVLWqXKWzO6vQ2HXXq+QiDtjJl\ndkCbImM0YI/bV58H82v53NLNT6skciqMEfpl1uClixF50G7JAS0FvElBXyK4\no7stLaJe+Jjsi9iRPZavUccsjcUpInQfSNkg/C2h5MCj1eW21AK2Q2cQdu/Y\n+hVIXClQzm/20L5a/6Zan7/6fagKZDYhDuE374P4PwIp2zzLTiYAOVVIH3hh\n7+/APUzS0Vo7NugG37L6WA1cW55j0X9g9XBVzE7BvpPjAFEqs8AoFt/PxuZO\nu+z21sS625po+c+PcNjF5GAzQIC/DFJcc5mNBI8BBeIlSlFKnClpDZQNhftN\n4ufvT8ziuqQMCA68EUfAwJ6eayI1qXGTS7LwwiRMz4oA+YzlGNV7cX1LudCS\ngfQgBsPl6+FIJRjTkqv0AnGQACH6Xh1q5TcVmP6Ry9qhjrn3Ng77jzXfyzXX\ntb17fmHuGtBwCB7FpqBOe8Q8/4ahs0I9tT0btBY2euWOGA1gaeEkTtBaAy+A\nPUlB\r\n=hpHO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGOy7atdLEXX7h6kLomFJdDPKvlQrHoTBtPcIF4o7TvmAiBtI8M18XMlrlI97WrWK5fNnGMheLynOAosxX/UzrdQwQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0_1614087646174_0.9227318014158006"},"_hasShrinkwrap":false},"6.6.21":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.21","gitHead":"3934f7052282bdcf13a30f0c508acf75e8b805f3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.21","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ncgY8XGlQQUJu4ChuEThrzrnsZ1bET+h28VX9ewjM/ZHHAk+Venylw23Af62S9wkeoe3SVkPfr1mra/WNUrbEA==","shasum":"3ab14a45e50707a3c7474234ca194b81de167d2b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.21.tgz","fileCount":56,"unpackedSize":307487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQX5CRA9TVsSAnZWagAAT9EP/ijN+QG4dFrvJ9Zpiccx\na+sroNJW8DsxWMg2R36zF2gE98Pp2U0YXwgquM5dDJj48ZobSwV/zQ04Volt\nwWFMIOvXMAj2dxlPHrb3ujGAaUlvPsDB2PAtiWIjMH+YR8FExWu7dBVT21t9\n5Hs8huFIGGTOauLoGVIcmlu2Gp7BzQObPYBEZOwC+Z7aGOlazpfCM5kuQ++t\nSSNakJo8bf/YvwIjEUtXkEekj2aiwX1TiyP6Aox7K2fj0b41KdFaDSHGfM5T\ngtUdqY1/jiUFrrYTIUP9Uckgb8aLEjbbXBRK89fCxkTbbFUunZJexILBuT76\n8FChpge/P/cMBHVkktgC/C8u8RXQKfdXr1jaGjw7cOncTlCANV1uhGe9BI/Y\nRBuJ9BqRp+HhDQj1xKjoUZeC9SDwUQQQp+uPjdUUPbAIpNdAJPQlGHgDHprQ\n67Bgw/cWfa0E6W93Lhn0LGkdCLRHdZNB8KHaiDIr0btaOfunxqxrZCXASlcu\ni9ysP+cVitpURkhXdUn55jhn38zWciDsYRBjnOftwla5xLFSMpYwfHZ32u60\nqxVAr/O6YyHHcsKrk63YwEQ6PmG3s2hYrtajDFn1+vZ1XJI/x5Z0HVu2s2lN\n85l/4u1sYda3eRpTShTw7iIlZgfricKdSl0ubg/R8CufFjF6/KPK8wMKsstv\nvs8X\r\n=bf+H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYzWezWiJm0vG094oZh0TUJNa/ZSR0iTIAQU13HwUtlAiEAqC+FLuf8MUAefHQfcvEyCGZwa5bPxi8DNBKLSQzypek="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.21_1614087672537_0.9601918816217403"},"_hasShrinkwrap":false},"6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3934f7052282bdcf13a30f0c508acf75e8b805f3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-rJvhBuWJxWkoknc3RjnwHpl7ceYW3bch3DixqEo4cASJKBLhJbqWneUkAOrBN1vHDmXQ5pZZtCz0pwZuQW9i8w==","shasum":"48056c6592377c2d98658c7fc742e20e1136cd88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0.tgz","fileCount":56,"unpackedSize":307530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQYUCRA9TVsSAnZWagAAGx0P/35IoP6YX4oN8icL4clD\nqzwKLWtBezh6zjTZPF/sUauPpQW0at9lbAeexMelOLOZsOPOgr5SdBL1JtlZ\nbWdZhoBe83HkBdAhvZolRI3gF7yFFa6zZo7QuIpoH9gtVse5LKjxEEVSDh7W\nyDHDeBLMCdRmwDneljx77jZd02fYkZygbFiLBdnGB2Xo5RIN8brYyModrFS9\nyrmcGOmCEN28ce9Jqrm2+8q7bN+Z6kvoUywRAVb06f1nKDqKvkVLH1WThy3J\nhAx128IVWT8IL8W8NLzANs4LwhsUeWtHfNM0KKKrBDUGnd88RanXkO3QQnx2\nCa1lr9X5BcghsCSlcvQ6nQreTVsi7/opWaweiyTdQBCK1B+T4iLXNtyztNY1\n2FZG+ivetsxOn16mC+OHbXOFOBjpknPthu6Isb9wyKAYIk/j4XD/ChvPp83W\nyV/bK/drryQVUZMtG7fx/jlUoF1qgNkpSc2HdiZ5TJI8F0oTP0wPGJOVeeL4\nzKUe877eRVFozTrIXlDWkjdFDRhKo5Z/pnrJUctctazu2ZvwRtNaNKvjvIQg\nwVVJEAFeoL40J4Tl+zFjaRGJgpOAknvtxjsMyh8RzLkCIjbspIwgCpl1H/iL\nTZTNJzGm4R865EaVnRCYrX+1Q+ijAJLoaha3ljBTdaWWVDUCurNinGFGzFZ5\n2oxI\r\n=pUZA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe/1+mhGIlj2F/2tGBkYZXOm7aJGs1ImEk11U8GjHeSQIhAPOmw3g3Jg3S8ETlsayGi+6oxFfIN0/8N4CPffChPBir"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0_1614087699697_0.8748424343910217"},"_hasShrinkwrap":false},"6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.0","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0","gitHead":"b74835344027fd673c5d3b43c5c5f937e10c45d5","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-MzlS85rgh6ofRG63wljqluT27Zh0JOtQHiRXXvC0VLXm5b+HZlrjRhB8A/pw5Gao72gsf66rMJOiQslG9lo5WA==","shasum":"572e7a715e0626af2f8f0dd8a2453013c528ecea","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0.tgz","fileCount":56,"unpackedSize":307530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNQZqCRA9TVsSAnZWagAAeK0P/3n0zBxEz5MMwkk0dVQm\nbkAY4ZMAiTx08GIZPOQiI4Pm4RD2nkVCuz8fm0/DzWKVClOP0wKchNRGdSid\nFOK6096785t7qYsF9bscWCZjKzoU5UTTM9bBV1+uHZKfVIBVpSU97p2wiNOO\n0fWnzftH4hT5/5fH8ieSI6VZPen8odZeqUoaQcL1fz/XKTnVqhVcB/iunmE3\njnh1jr0YI/tXvJazsyLD5DLTmB1ooNb30jdF3odhua686aFf4Pt++tLsmNBS\nPWHFX+YhW5rtuyWJea72MGGqFIINwtPXEbIYq04/5yX9q8P1yLJ7vJZit1mX\nx9IJ6H+QVbWcvNextePJpdq1FrrF1dbtmWvtu3ETTOzC2m8dc8lRVpQgke4U\nqOZTFdJbWXE58yaYgRaic4VnpjwuKuSqfHxIoVySE0GaptG+1GNnkG5nQ8N5\nJzsoLu7g2HlQ1cEZnRk/6TSpIlsKMbvng+hJ3hZdUBMTfbuFv/JUBHPX5e5C\nDnpCgrg8WPK/eadXMAiU+OzGt0nwbA/85Un5dJuX9DmDBuPs/wdV2K4266Yt\nOp422CF/M7Hr+LhK/vXqLXDC0BTng3vSEzE0YsTsa0BpYG476pHRp19ivJya\nUld86fygFc0ACdiEhSNUo75Mnmk7Cn7SJc1olIHU8YAeiUX/Kshh++d/uqXK\nKbx6\r\n=KJUH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpojMtoM7ptPjIpp+887WMeoeivTUrKH3DwLfmKw+VVAiAGFrwg29pfS8aGbPRyJHUxVqTkaW4ZHah9aVWSOLytUA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0_1614087785478_0.04908130205109873"},"_hasShrinkwrap":false},"6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0","gitHead":"f68bb9171effa7cceeda4e017d12a431ca536f2c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-tNoxysyCs6vPmLKzjSUaz+n5WaZoPMhNpXkz1JQ+YF4oYfr0o/Q28zO0djQu9wF1tVYiRaxLjtvwqItsNlehYw==","shasum":"856f983b52fc71d9cd911a1955bde355a9c895a4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0.tgz","fileCount":62,"unpackedSize":340218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNYfvCRA9TVsSAnZWagAA8h4P/i4RI95yWzZbO14ScEH0\nE3FEreSBroEdBvAfbdsgw+5eDS+Vuv6qzlHEismzPoadON4FqZD0mxtFABfG\nITRAU9UIJSt629bhizwQQWjZRSiTj9Vc9BYwCN2OVD/VSJm3hJZ1lDmiuToO\nsShCh3HSssMNax3hqJEoHuH5NBMwLAistrCWafdBPiCRw0w0nXtecutBy3hx\nXlUr77wlRfIFWGaJb1Mors2IBRGsKnkl97zXoigG4X04A8it4X1KGg8yZ91Q\nFcWmqHoYNeSless25oa/rpFZ0gBy8Bn10Bbs4Qee0QCvKpmi6fYpsBea/uQM\n6LPDEvmmCCGLeRY6VwJNOSXEF7TKtlW5VUwLXFKIDyZvOv67modMYk/cu3a9\nHkkjcNK7S/hU6GEtUJaugUBDHwmNStyWA/SM7s9uMMEMyB3r9HIlHQsOEslS\nD9tCOFFyPcJH4jZqo/rb72EG8VGe+BrOKkCcoCPtRDJQkUjDEUcu2J9b5lWc\n+4m5zusAYwGO0enNE1uhD9JmtnLcmOYaVT5PYpeOhcA/6s2T8FnQJNdxxWL+\nnqNL/0YuJ6l11Ey7gHMevevoxvMk07vCxqhMisWOBPjFcsvgvCp37Z7gq7qC\nCOhElvDRjy2yVhswMNe+rWiwb6uYU2fuledq0AHyh3W7CTqbppX1D4NGPXdv\nPT00\r\n=DmQE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7tWpk2CtEBETL8zdi/nislmpZk6JMWuHmqD/zVLOA6QIgeZvC0eHPOmCfb9B6Hy+UhQZTPmn3i2IPEbgTF2l7Zl8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0_1614120941458_0.7378501459409816"},"_hasShrinkwrap":false},"6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0","gitHead":"7c5efbaea145366a27985e3d90714ec05c7fc337","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-AYfvp2xTeGilxhS0H0ewb/9wx3t8cvsfXJFcKKRPo/sDUqqh5affGM3e4LzD1Nzo1h/yx8Q9yoPQjLzMk0HkLQ==","shasum":"c5389b66f75e98493aca997be6bd27d6fb4fbdee","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0.tgz","fileCount":56,"unpackedSize":307535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeX9CRA9TVsSAnZWagAA12cQAIBiNlH0+4Suaj2j8lq9\no1rpSemXRVYKdq6WtLyzi/cUknjXJDLlW1MHdJ5Pii7ufQvzlFM+BDdHGLex\nruMCRUVEXbK/RBYb7Vh+1ouGSKovZmnnaAjv/q458JKbopoIson4/VjI4XTE\nr4H8w89l/Q2XW5M4PsxQB2XuqgaPUfrJnaS8U7IoMYnBZ4XrBwQqRAkdDvK4\nGFUgbysdpN4ny8yLpSqlM6AG+gbh7yUeJMKCoyAmHZi5S3W/SpyJ0tMmt6eA\nL+l9aWTeJ1ppDyDcQk5xiWg3GpxTw9cn3IbPzQDBPp7sBA/YLU5CkuY1pQzP\n0LdWb2CPfIN0B21zX015dCQ1Xw2sTmRMHs7qypCPG6m/bO0arABhqxadphqx\npAVOvgFKUi9aDCAILR4fae6JXxIYk8LZ5pc0eue11w7fN9yu1Sdryg96PzaC\n0jiWvazuqtZpOSumqgivoVq8RPSQfO88Q1q4bRcq7n9d7S5wV9I2P74O4mRo\nv/EW4F0DmzROjwK1GO/Oj+3ciqxDLweRAC+/pTNm5O3pKaKvDXnZhL06y86Q\nAC8L+2wEaL9tFk+IkiDUvkufYSHUzvlLgJwtkdkHU2GPh1UlsQnw6PDUjmZu\nvrGGZNn483aoLiHuGYINhTFadn3zxmjYXFbH8C98/oe/MyVfJdFwDA8bGSKs\neJhz\r\n=brWS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKBvQQGE5Rf3rawNvU373BHE+2/VArHEA2ZHHFyJrPYAiEA1pb+N6Nm9tJeJwFF9Xp4wlLmFr0K9hJxDa6MY1/v/r4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0_1614145020657_0.8046997000625333"},"_hasShrinkwrap":false},"6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.1.5","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0","gitHead":"2963c705ac55bd2ffdad5dd0c1f37782983dada6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-I7MHTvd+TOL5ay0NtOVko2sMJV1ir39M6nYECgutkHp7Rr6SRPXrrM+wIQLIvmASSlCEwshLm4EQrY+QXAqcJA==","shasum":"357a9cb2b6f96f2c8fb1164b3c81225f1a9bf34e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0.tgz","fileCount":56,"unpackedSize":307530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeY0CRA9TVsSAnZWagAADP8P+wV6nvkKt3o3TbptGCLj\nWOepY8f1AtKDHUYzzzM6hALWsttH4ojCUAzyOz4p3dPGib0SRdsoGIWYpn7s\nJYz/61dr6pWAsqkrHeTLyaqVgiOzdXxaDp4H9moKC3eQMq7t350md4x+wh7c\nzSCQYbpnsBzRd5Q9KHZzs8p5lIeLVWqUeXJewVCGrf8FrFo8bX4gMBSxG3Yv\nLFlldEsW+f107xPDYwB3Yc5w0TgDZGEtbRdZt97pd0jsRmfY86nDVZkAeZ0n\n6Q+ZuDdrSiMlEShna3a29T8MIhn5FOioHZbz9AB2y+iEXr+4dQHrgblh//Ud\nHk9KQ5FRRKB3+7RsC4BaId7pSmcWtnt19aTkmt/RJHhTIutvNYwkEae0zE2g\nTfkovvct5Th58mDgn3ATOhxGL/UwBTaXRLCjvMJ1YiiDI5neOWph1Nhy/kcg\ndj/+yaaf5lxR/aJp7ECU9MbfaYkyEBVaMrmaNOxjQasQHi4spWIWX1aDnlK1\n4Q6WH6CEBejlS5kfmkormdWo2RsZ4Yov3GWUX0UAItkg2kOZRbPrnTLU60pt\ne5XRRvU0NBfMZu906u1dqgqM3j8Pf+40eQ01rXROxsAKhH4fax1CeZWF3Ayj\n0HLMxmCWZU8HhdKFGCXNUAMMRQqUSTRqCAFzeVyePcRrjc2nIPXJwLdTxSyM\nIpB3\r\n=8RmO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICrL7VVgPCbC3OtjM4GQQOv+8Gw0Yjzl7WT1Zb7pQlq0AiEAx09d0OKvcl63ajdBH2okJ1V999FKww2sNYxXOaPtO4k="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0_1614145075882_0.7812084777583326"},"_hasShrinkwrap":false},"6.6.22-c45919c45bf458831537e748438c94780fe991e5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-c45919c45bf458831537e748438c94780fe991e5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c45919c45bf458831537e748438c94780fe991e5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-c45919c45bf458831537e748438c94780fe991e5.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-4OWLCuvSI4iC4fsywvkgmOiQK4u3avDG2ks28RiOHjXPVLK7yJuFMagIuf6ON1WETZxHXH3guR2tMF6px3oSbw==","shasum":"00ef4992574c9e504e83c96b717b04158d38c601","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-c45919c45bf458831537e748438c94780fe991e5.0.tgz","fileCount":56,"unpackedSize":307535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeZpCRA9TVsSAnZWagAA/W4P/RETbEc7Zw9apo3w2TdX\nP1nBJWXRzb5/tDiK1+pc5se6BBxD4TG9oMnrif3qE8fQngGPFJnipJqH9ViT\nEuU3dVpitOX1tb0Bv+VFyxhDX4yKqmHBOwBRT4jupk7qeBlibe7pGVl2Rnle\nHZXX5ctXZftAwwFdqWX60UwWJ7UCVor4mg6lO768siXgQLvnrmu2jXfO/q/+\nh1uno0mbJx2s5utKL9hrA+xWgFMEBqKmzFTS+jJ4xeY4GbBrrThlQ8vShDR/\niO1p/OtnZhA0vhZ69kse7MGwneOElT+jyiDC2VCsYRHWDLDuOrODyVEqU7SU\n7OnEvSd2GJsncLymZZCVtc0g32Wy+5XXePL2Z1UFFfEBNgnTUIV5u9xVw4FX\nSVii92hcV5OBN2eaetG3GlhGss4WSnZvz9pt2YtFdUJEs75pF0JyovuZT1Y2\nTYy3wed1F5hQcWFI2aJCYBnUs1p7xE6xLaz6t1DNUQm8b1M7QhQ2xrxl/kKI\nb6uLo/ZZU5kSmcwvTOGCBO5pZNuO1aNIBO9f31OJQnaDueRtDbYn3YNi0X8l\n70X6mPpKIKNJwWmHeNgNpMDLdh6Ig8FjUwKgkg83f9l4VJCGCD9zyzet8a21\nuIX+tIdmlMMgN550kKRKIbSLO179x7octXmGMkGK2Vw+v4JrNLlDTDC32klC\n/8R3\r\n=Uqxy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH89Ntem+7WGHZSaDkji9xp/4TOEuv7MQeL8XXcXMquSAiBFIuZ45GTk+T4aSuaOCSGTtK1G3cGpYUdM92sw2XVf+A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-c45919c45bf458831537e748438c94780fe991e5.0_1614145127909_0.8427885685522734"},"_hasShrinkwrap":false},"6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.2","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0","gitHead":"11435d4f24be057977fc4d79afe1bbd9497f24fb","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RGUGDrh3k8V6+hBM73xB2yxFKL6r+EDLE1ep+NmtBtzs8afTv31YAuzyuZwRjnTGnMb8aukRn0rfYAOA+JJMbQ==","shasum":"a59697eb0aa62496491e7c3af0ac24615c4cba41","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0.tgz","fileCount":56,"unpackedSize":307535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeZ6CRA9TVsSAnZWagAAr5YQAJuhRMkOqqsoU83BB58B\nQPLEWnXQ1/48ahDuRfehpgAs71BE1wMc4ndKDzz3Gxde4n0383OTycD2Jb0+\n7uaHE3d1NcCJ5MpTz7hyp2IbJjlKsrP5QnGuUbR/6dIPgJ3PJTD7umv+gOrk\naFObwFGmUFCbINN1Gb8/BjnOcdoqRYfx8YzBgENOJ7GtczAz6vSEPD1vRZ4A\nyV5KQrcdTF3joVmNXjqD9FF9Xn3m0wnwJEpFN70k4v1QLUsNPte5n9X+XbB3\nSSjTp7epROru/3/2QPjumKnnuhL1H6zBUgh5dB+su0MEEltPSFQohlgnIZMT\na94yyRwfQUU/zvFMYIb0TbQzqPrG60aZ1tEEfj/xjj6NuHT+HOJKUsQ2eVcB\nI5S5R0R/aHNup3DIz7+hpwkGhWco1TYQRY0FJCnSLiojdzpuqtwCJUCOKbiE\nTh/NuvoWj1rgUykpx96uzlxB8hGwE9xSUkSBGLgn1wFDNPqLwo4p8rWH0Jv7\nSLD/ElXvJVEPz9VYrlVAK1rA58Zp4+Uhj4BtRN/OGrwJ4vWw+clYIkLwQz9X\n/scEmdbtfYB1XeQUloQub+3hPLx7zeFrby6PCTRM0SOomH/RECd0veF9f0ua\nc1YIQYtgNjDvFHRqEgYGxLjLxw4MWP3BqX14ZmmED68Z/spnSWquyvPTwG18\nbADB\r\n=vM2C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF//EwhN7RbkUPo4k74DrIyY1EkD0Ay/V8jQRCIh9abuAiA/N31ru21iasH+luD8E4BTzuEUqOFJCErOhkRkSp2bKw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0_1614145145350_0.8249693538868845"},"_hasShrinkwrap":false},"6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b039f1dc6a52126a38264a5d240f85556e6dd13d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-PyDlIRRTyF75SIEvzTKegQ9DWLKl5hVuT0X0kduV/uBJhbVL7TX6gDf6r9udTzocEcZmZpSOcAAdyz2ZYM8VqA==","shasum":"80903e668bf25e559f1ea0533631610e83f85f75","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0.tgz","fileCount":56,"unpackedSize":307535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeaGCRA9TVsSAnZWagAA6ycP/3I18u1O9prgDrk/5R1D\nJ6nL1tNqFXfwsUwqiTPNO7foGTM1CC6nGho8hASdLzLjuIjbHZuTfeeg/wlB\nRbkoKfCuK1S8CiJiHmB5NdUufPbOtG30uREdwZFjyaDCCdgN2W1USxugZYqE\nYhWoJZwlwV5c8JmaYaGlp+Igvy7uu4Jav7J9euMK+e7WDKyFG0gcsc32MHXp\nKwVMHfJtN22UaAAhghg82LjYqv+UOO1Ewy/6Vod/3uIP3vzS/vNoqr9sWVqG\nUa/XMx4CPSPOkqLVUmxcjAUtUzPEyCoqP4Ksm2l9R3a7OAXbxO7+SZskcssj\nGwQB9TvDOfnA4UiyMDOYZZO44oclOYl3BZwSfiL77174CatApPo/vKNXWIjN\nX2j62CP+n/hiF1GaXew5zaj6JdmB1NpvQc6BAX6K+MujHdv7s7PQiDYUR6lA\nSiyuu7zzzNWyJjLTZRZResaCxIrnWUdtn7a+Pg4dgYLBkGVxbPLaS/awxUOQ\nrqGptxfe8GbUjpIGYCLDOuUBjX8KCpms0h3ehn/pGYG+0yJ5M2XiwNYwjurp\neUlWVGClQvbrvy22PMYqUj9d76xOpVdL4mua2/JUlaWjr6NF/mZR5jNlgxE0\nxE4CZD7vGHLNwWv6GxT1IyLVkPE1TmNWNu6H4IOYCv4E3DeQ/dm+N8q2hS75\n2YGg\r\n=m6AE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGD/BZQVp3+Qq0zeRI5SjH1pFweN4xZeuivUHLuJnQyhAiEA2ms4OqqAbq9VJnr7X9vNv524Zz+IfnxGl1sMGSIp+So="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0_1614145157653_0.732153422824535"},"_hasShrinkwrap":false},"6.6.22":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.22","gitHead":"922601c670a203784f732c922bad3b903c35d7fd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.22","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-VgWccGXqfyTBS/VjUMqVrTldVQi8HmBU53XiM3lp70xrrIIxfAY6zgiRkm8eG6mdwItTkCiKY7LMcb8GJ1Kbjg==","shasum":"84c058395b88dafbd94ed3850655292658e5bb7c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.22.tgz","fileCount":56,"unpackedSize":307934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNeabCRA9TVsSAnZWagAAVpAP/juQK9EzIeX4MfaDFSIK\nElrwn5Gs4DJraP1PsCrbOFqQmnpLC2NejJtrUgU0xIofZGH3VQZgWqrgIR/W\nrp7D9UwcNSjCCPYEaT2Md2JeuNYUkxnbgz9dYVP+1fM++28T7LdsBRJiGwdl\nBYcfK5hSNz4YRupFIBgYz3K2ZE9HuUxQ2dGKH1BX81dJFxlu4vztrDhQaO6a\nb3mmiZbZ3hNV9lIoOfAU6IqRuhF8P4KYwZljZPkfJEKwIzPDRTxQp9yieYpS\nNwGEGcu/c5FkXCOjAtKAq6iq81e8fVZxUJ5+jHeh6fkGAmUbaIhV23PMU1mF\nWXQFOer/XV1pmKKFE3oTKaCte15LxaWb3XU4Tl/+2W3rHwdwF4Ecl61540H6\n/MAi5gqItmlbhWyd6+iHyRWew5+pXM0usIKupFalxLXyKYQuDnQPfgn1m6PS\nOnBX+jRIRU26ktWnY3NdJXFgb/iA7a0VdnXVxYMAd67dlRyxDjQ7vKeYuKky\nL9NB/LKkEJ4SMremERvqn6edE66jFnM8IEDa6skbHMANa3tvtG6YR5zBEKN8\nspK/LVfo/NR1PRo1dtWFV1unjGah595g0zScQlyIrwS+pdu/6zPYzyajEWpd\noG29371drZeEJCG6paBKef7FX9Fc0sXn9ZI9mOLOvnM0Pji5RB4RICNuMb8K\nHwb0\r\n=Qugv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9FiNktOA27vbfSjh0x1w3bb/0YXm64URDWHpWXV+3/AiA1j5h8uiy+3mY0z9ENYaUg7PFz4EYvB9Bb+3t24Gn3YA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.22_1614145178433_0.9992515376834767"},"_hasShrinkwrap":false},"6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"922601c670a203784f732c922bad3b903c35d7fd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-nscINIGCn6K48NhM5Nh9v+HJ1gC0o+gj0HiDBghHxHXXCer5ghTAFOn2d2mah7Sy5ir+JJyKbLb2j/vE8FjJDQ==","shasum":"a73366e80f42e07e7278f7d1a691b717f5b540b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0.tgz","fileCount":56,"unpackedSize":307977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNea/CRA9TVsSAnZWagAAo6kP/0bgjuZCI2/YSN5vTS6A\nGOPuwXWgQmaTP2B1eDlGMGG195J7r/gEaCoraiuGkqmZJNx+qsRcLD5TZyIJ\niRLLDKUrfXqhQxQqDxEwSl9SPqjihzvb/XJ12iMWtfyi2TejaeKk8kifw7Ng\n4Zjkwfk5unTUrMlpQXk3w925Bl8gd4UiEQhTC/cIrmYsRywjepGVP5ywNjw2\nt0vM/qPvV9/r9Cz39cvvLvqFQ7LzSiZ2hQ1ItU+CxMOY6MDOW8MGwTN8U2DC\n2s4TVu1UdyG3CeTDcuktiaNougKlflxFpA2RDLzsuNkOGLGAqvrjHPcnAXA0\nrazLMjzUXF7aUCwLWtrFKMomYM02ZnN2Z0TVjkKnSStENxWfwlbP9TpCnvx4\nw0pI+0zs50/Yc9g2aJJj0+1E/u9gX+84d7TAnx1ZUJLXLARagX4pDHcYkwSm\n3fyqvIeV8BuPr87t1dSqqagGBZwS38Vvu8u90x5aoKD/tjTTw13lPUPf9mFF\nIX/Nc5l4zgmGdO4k15hWoren8AE/prafQJtGJbmU+DFSI7qmij2rqeurFVDS\nsMBWq1n0j64Xq3ldsZ9Mm/aBBLtMVlyWlht7Ym79Dk8Vyz7ts9CfWy5men0y\n70p+UBWQc92jNG/NyuSVd7jv8pfp0ceuW824/H53Xcdu4cbsBSGk92CvOf/C\nsFet\r\n=K2g+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPJKr0WWg8jICjEIVwU60hDAKCpgOef0iaCnK7aUyXxAiEAlTGcSf/kp7PBbiT1S3CyAQIycBWDYhyFwNqp9dySWHk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0_1614145215201_0.5228894156797304"},"_hasShrinkwrap":false},"6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.3","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.7","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0","gitHead":"483fcce0e85329bd9ebe1eafeca7b692b8ca2342","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-F4dbaNhFT2B4lWp2qSddrTxRO2QZEZpHPfUnJaNB+amWJLUT2fIqRyKpkLReW/kP5jkzBLfLqwM5QLCvPSWw6Q==","shasum":"80e0b2ae4d56760fc6bb11153cdcf63de603de9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0.tgz","fileCount":56,"unpackedSize":307977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNgAICRA9TVsSAnZWagAAbngQAJuKG9WJU+JMkOof1ITK\n4c5JSHyaAVeFnr7eUceCTBvJObCr5ftFgRTaj2KCeld5AtdICNkE+aX4OdUK\nIjohN4+mcJo0adyrR6gw0oCLkSfgvHymrt51R5Coo225XoGBiXALfRX0E06H\n5JKWpkn5AqN7vhnD3Gd3I2Q2o2jsizQpgYRFyDg8js5S0uZUPca7N5EuRtMq\ndAeiI6eohtaBgBBnb5Wuffdp1KLzhYYI6L2eKnukpfjsml4FY7hyUs9YjJy1\nfgBeGuCpGeS7fzL0ZCQErENy/54QBtq0eBwV5NwgV/1Vwe104o34A3xOlFO/\n0qkatxVSEtQ+SbeOlYIdfOMzs1QqxKlau+EViIPBAhSzA1zGS3rqzJQtAUyA\n9svI8CHc0jh10XgbCGS8QTqSHKjOc44Bz6ModM370nJi7zJ2QeKWrPSZPDhK\nXmcLTnDJvO6rBM+rHQMBLzDpP45iUgdcp4tvWvZ8GGy1RGQIQQAfhaIfhVCX\nL5HZRqmd7q/ViVGt/MixYGQQaFAhXuvI3GNAt1JzzGDoqXfSrOxXpRdl8oiQ\nw2iRmLSTe5hkCIDx9Owx65gYlTa1dLs0ESn0GA+RJrdq/YEa74dh1lLNioqr\nL4hO9JX9krSKdiJg6zMy6cynmKPBB3bbadQdgvq8M5JhGzxD/9ZSDnpnrXkb\n1c1W\r\n=NGQg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCX0bkxI3yuGw9Z6SBC4V08zA2SVj1QDbaG0Ct0VIZmbwIgdV1mc1dX3Dw9tE9HKDrdncaANaNM5UtlMrihsWVGdcI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0_1614151687407_0.21283307095818849"},"_hasShrinkwrap":false},"6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0","gitHead":"78ef49750ab4faa04902fbe505e17b3abd1d7800","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-cJUNaNXn0VxzzzPukg7D6FLhSajoLaymONknp+A4i3847JGoBxxKHubMoSDK/dLDH5eFP5PCheQ2hwzjhMd3iw==","shasum":"25613180e36fd47a1e2cb2c8ea1a441a77a8f7ac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0.tgz","fileCount":56,"unpackedSize":307977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNzccCRA9TVsSAnZWagAAdaAQAJ3ACmgAfxkRc6qGtATw\nDLCFbKpXYtuGe2GLGZnkWgHccIABo027Ib52ERBLDHRysszOL+Jv/HPOLG7C\nRWEP5GmlR8DPwxxocaR0/HxaVscKfDep+VfrgrGQwBK2pS1y7qMDrHuFhHlP\nr7hGWS9uoYdXl6j8wgSamcV7tUEtlQa59rbEl899PiUP4LdCcVOjo0joJ+LK\nV9BjUKA0blDiBJkNlNYX6Y9LFhkLuVpdu7CzXfkDrYFozsmxuc8sb5FjAftc\nrwJLXB2wdbqj9VWyV/0Dy4V5Y62+coMOesCc4tN/NiUCfY8QQs80H4apT4dN\n/p6fTlKkjjkS+G/ptHasKNaVq3GxcEdWWzwDqSRRxem0OvTqXUD/fCiFTmPz\n8WijOmSObA6MGOrU2Moyds4AeLW1K2aWOrARPxUdhrt5S/SWSniX7iz/7c9X\nIzc9ukg1oV1RwLbYBuL8EwiY5OO6qRfeNSdEhQ8HZ0TnaJwZutGDgTYlfgz8\n0I0YVXtNWSgvkyL6uhkr0UJ06V/B3H0KNOZSnwAwYSAqoszt4JqR6g2rbowd\nPMQZleaNxhu7X4OwRoeVn7XOcKJOZfBHn6Jbz2oQWMh5aDd5ONaQSf0jBnv0\nmVy8z/fGgfSP6Skw03+IDAucEQzP/cOIcfwcRWcpdwfFg+3lZg2amBiMwUiE\nyvh4\r\n=/EWw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxwkh80LtMz3GpVJU3zlpAZqSblA7cIT5uBFaOnn67pAiBdpIT3Oep71oT7pI6HwAaKii2lH8a26x9DbbOxFjU52g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0_1614231324159_0.49167390360782215"},"_hasShrinkwrap":false},"6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f599f94e1ddd94ebae600f8a8362078ec2bb70f8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-zMx8EpMizxJVivxhon2lAMtoPD4WNJDcfDYQ+BICvxnNOqObTdzwmKIArfw2sLiphQe9yCUHzBX185jHpcc6qQ==","shasum":"46c9bcf56d900f6eb2aa8f47b540a3eb86edc82d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0.tgz","fileCount":56,"unpackedSize":307977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNzd1CRA9TVsSAnZWagAAzssP/A8qTIC9bptxboBKkeLf\nryVs14wzed4voAITcycTvvYKDAjn4jgKuUQNNrfXaUbBYbW2TPS+DXwxbMfb\noyMsIotAGIW6CqMuBTJY3JVNdMhm82T901wbT7tURnpp9pMMuiNuNYHEwrcY\nw+qD4LhyDA68BQFMqbCm89wGd+EvQ3tQUeTFDQoP6Josmvk1WInVJcGg8xk2\nMYMT36zgdl07zd1TpFTsNYkrHL8jFzf6SBeb6/2FcyG6Vp1SPZUC5hVpm3sQ\nv3bSdz4ApZx137wLwzbowO4lOV1NtnyiDB8q1b74nlKFE1Cin+nwKcZTaJep\ndca0iZiqjZF/6zWdRP1896m+i/aocQRjQ7D7ggLY9A5O0F+Skj2lV3WoOD6N\nxycojIbouhJR9GqTM4jOfsmhj0w6h7UXYANUSIsmArECGSAPACVdKq0s7l0G\nk6+lGMl7XbETfMZdrXZPHkEOzK8as54ZviAGcL1BCYLduDff/IhCw2MsnPze\n4eRRHS/DRoOUnusRA0vfW4sbjUBjIbUcA0kMquL2ZIkZ+5bnCTS4mPsoDx+E\nsd08vd926yIYk6bQkkUFh0CSFGxB38Y5siYOI0LfTzU5CWmBOBs5YdTCcEet\n/Ivko3n4Vmi1GAEwKFFVIhxZ6Ls083aceJsPtUZVJRWKk9dxgRPF/yaqkE+n\nu7r3\r\n=6KeS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEI5uZzSfwVCdsadEn7ULU9qqIn2mKcFvmYjy8ZQKZKtAiA/cxBTv59IhAbFHBSYljoKxMa5UMI2NoUe26VPKz+nDA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0_1614231412404_0.21549989806856895"},"_hasShrinkwrap":false},"6.6.23":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.23","gitHead":"c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.23","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1Jymk0RY5vXOEvExDD+RQp2pJYQvm9LWrinXIe1xHqI1IqUDVjD/uY9B8r85SCBrBpdl4kHJ9zXoVZSCcu43WA==","shasum":"d7dd5f5ba06bdb3066f0ad581a2e885bea8afe21","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.23.tgz","fileCount":56,"unpackedSize":308209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNzeLCRA9TVsSAnZWagAAAQAP/R+qAYW53cD9pKoqWwNi\nxUdF25PZxfS/4I8H452KCYh9XdK54sH9BglMLuZ+S3oTukvNIMk5cTUr5W5e\n6w6t8il8Z539b6qWIroB7lZ8mnIISKdt65u+gg8n1OWumjEQvwUQfB5H8KB0\nY/fRE4peP+/bZKpbd2ZoQYHQxjYF1eQn6DL74l2o28pXXLprxQlY1z46Wnni\nu247oI9Bo7jQ5WPJLuLAWUbJwYiUkOzf8iGg5Q2ll3gI4LhWsIkavcbIhJhk\nm9T/xL7e9vbzjWLrFv/3u+sUlpTM69ozeSd907RpyTNu2lrZ/HxVT4Kr0Wsf\nrTm1HNe24V9XUc5lbfUTx54BdOmjggsFZr3+GtDviRMpA3OKV6Iz5jHg87yS\ncJH1yMV+tBeQvcsURY1Hq+MA0zodtPKIiWIHE2aUUa50JQ6Ga6QSZA+fSHxK\nYF7xQLU/HNnyzxdm9veoPDYtLKbAI8jh8C4YNZuVBi68VWl+RlwNzyLdVPhO\nURP518seWeZl9S4FXn0UtNfVaQYjvt373mfNFDs24YrwDChvlJKfsGFYTcTy\ns4TO59R5FfYjp2SyAOliRm/vxzTeYADj49QitRfdnUQnXcN0j189qTHPvVJX\nS5sgRg4MOnPhzCUIL5pZzhya/rPjkuP4qbRnt2s/Zv1PdYDn8sO9GDcS2j/J\nJjHu\r\n=AiWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFM0+LYZV169iyr/FfqoGddAF4509400aoxpi3xp4uHwAiEA5cOWqDdW6mRn5LHvK4jxyYkHN6UstB2H2uq05pqcpRA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.23_1614231434827_0.17795348164568003"},"_hasShrinkwrap":false},"6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-afmga9sjwFOK9M2pDqDP9OMqX/WN/Vw3xJ0w6itbRW+ial7upHu3WqsixlsmNM6EqKZ2NVdvsYP1i/9J+fjrXA==","shasum":"4197f5b813bc4b4829e37fd4156de63583dabe27","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0.tgz","fileCount":56,"unpackedSize":308252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNzepCRA9TVsSAnZWagAAGlUP/A4uJC4/Ci7N33zlUjwb\n00m/BXzTU5Ib2y5icARXf5iN+Uv5N3bz0X8KUykubARQg+aebIuPDsHJtryq\noxy7KXrjCx2skMJoHxcWr4JHWfHKRtmovvntQ2HiaTvf+OBryOqBZ848Idt4\nLBYUNAPztYHbCyPQ3esz5xGu2lsNwiMxTPr+XlWxquxBmpA24AkVa02ICLHI\nPb1KSTV0o/1fkTBreaWfph3Dp98VVHJog1Vpguf4wnUZaOxjLmHLj8m3tjOP\nYZPxa5QUx+dG0M6NLAf5TNSqtXprV8HbBdFwhT1cV2GifRlVa7Ku/yXTTHZg\njPWqGeS+0/T0dPmH060CdUo/HrxsY2mMW2YzQBrBu6MmwEu55M1ImKjWXtr+\niBhjYX0He3h08Nw5V9du2AImA0ox7CDOBJlYLoHFjBmKHOUiu6ZNva/5mB5l\nNMrfds29MCKjqmfbifD8yRDWeXvAE8toimxWnF9qA22jYqQ4jKr6sfCju4mi\nR6TE3hnLcgFK3jMskpZNnSoKrHdBY1l5lDECC6HIPIB+j2c/altxulEA4Vg2\n/MqnCP6E6GTto79n4pjIAG5fQ3saeYf3gUvj7tm4pkQoY49hgN0we9snu8lp\nIfDl88yvg3n9sZUNLplfIf9yI8ffr/M6p+wrnpQaZ8/+n8kfVV+tO7P/hGQA\nyTyl\r\n=qB/R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnaG0jL+HXWgMTzypVZt69W712e/G4nnyXBDlJvmXKngIhAIPHFt1weoXcGwGhfSxXyOijPlBUalJ0OYhn3fQ51+FQ"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0_1614231465063_0.35127763453345207"},"_hasShrinkwrap":false},"6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.5","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0","gitHead":"9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-t4CTLxaJxPvyl4Rz/wyKOXjjHKFX+GEZXfIizsl+3J4mTtBi6hb7ktquMxjoiUxh2aZw1SxTlKowJAlbA2QKyw==","shasum":"7c95957c3f9286c3d8c170bbbae603bbb5b230a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0.tgz","fileCount":56,"unpackedSize":308252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN1ELCRA9TVsSAnZWagAAbx4P/29FxCAo33FyjHz4Vwld\n5bb1FY/S45gbAlOS+h9QdX269nqlIxmImZ1/QxKD/MdrqIW3kaqTViu5Ey+I\nphn+6teI6plL3LJJ1Cnq3WPa9VjO2TIbUEft24q4a+aVNIpDvJiHdNYRXIHP\nIBWu7TivtOh6dMLl1Dlyg/fW0njdgM2/VwGSwEUcl87KWXrcBjCViSxvY5MC\n/ZK1mHa/YvbUpxEOGYvT8HD3OeiDb7Yi77wFoNhVI7cokmxqOeToy0k4s0WO\n+UamuySUSMiiWnuLIgG0xu6Uih0XcLVrEGDnfvuc7lr0STKebidV8S0aTCOH\nHaId4OhablpjwHKwmxLOxkBO/mNDC2rDM1I4BAIgX+rGuZj3J0OMXndGiFau\nygXLRRj/iydxbVqa/sVitVxBkx2TYed1M1SwebpDoyZ/iaNwzENp3ScqSCYZ\nuOdQPJSMHSXTdH31bMMF4r2vDurNRSW6hBKudHu+FPijUfwn7t+Bup8xEb4O\nFxnQUKo53OZDUgNfe8ht0qustg56IN4dchdfg2vrYIAknLC4fzW1pLPyBRal\nZWaThOlnMGTT4YDCp02+9hv8s5hncAVPZfzsh2zC3D3CN6sS1d6QumVC7rGR\nmVoKWbef0c0Xa3oP8wt+GA295Wx34exFfkFxKv0d1J8Olpjw99Cbv0VM3MH3\nr62K\r\n=8r0d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYQG8sh2QIxfMCYs7zdDDibcWqqV7XgZQshd4sDpRvpAiBmez/KYboSiCnALFlnl6MPkmhhBPTsSdtfeA25N+5WTQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0_1614237962350_0.34609932285293565"},"_hasShrinkwrap":false},"6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0","gitHead":"2e2a8ca3d39bfc553ca51d1178652b6507b123d4","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1Jj+kiV7KKRA841WoZzn6RzAiDq0gyaI46vfftGdz4o9L/3BLDtyWmyMuoyzAmeEsu3I3Fe79D+WD99DKcUxDw==","shasum":"5e38c486258410fb705a3f07117d3b02e0ad7e5b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0.tgz","fileCount":62,"unpackedSize":340484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN4s9CRA9TVsSAnZWagAAFUUP/1OxUJI0JNtJA9jMnSOF\n6GJJOMRwoGG5ATiDDnTGlIFhpQzALjgQZ3V9na+YW11nniO8SA6JEMcF4V1X\nMdPPc5u3eoO0D0BDPBIV+7ILB2xd+Jc/CBcq625VG8xFSVnnijsn6SwFxwxu\n3EmoiO9XyyCtOuSXhfUd2JeOoU1WPmkRReIv2phMMicwP1usolftlyzhFvTz\n4RYcbPh1q/n4GUXMtiX2MwJFneaYKC3igWh+a5dqt9cjui3sBoVd4BGy7gas\nrfh+/bOlma+Ova/tAjhqw0gLEFEcaLy6JiPT70qoEzsQuvE72DQxf5IYzqRq\n3qaHQyB1LpTacCgxEabMGlTKDdkBDkV8U9TKRNq9rZycYD+A5LwdKtpdKUiS\nQ0ggVBJ14KGHB11MXGSEkksyLzvoXWZVaqeNeIEhghdRgkvmWFenC933gy4F\nmfMMnO4cWAvnsPFzETaTkUMh1Z3rZEshC9jBqd4e3+ZY/xmOYyyucwbsY2cT\nTso35xsDSMmdvOPPQnjRH83OpXnrcGOVm3PaY8JCVUoWsv3D1o69DT3lHVMo\n1ecEr5EtStzILu2fd7ENdQxYRk22H7TNIfPk0GZgsJI3G/fi5ga6YLHjsFya\nOG7phkeDXHP7NQv1lhRAYpEbh0jjwGO4by1HtQ/zliXSAAgMamtZ1Kasi+mP\nJ/VN\r\n=xFT8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDighPKLMDLGNUYopvBwlRt9bOR8NM4rvdjeZOzGU0qzAiACskrPkA01bA0bH+Jul8nrl/U7B0Yg8lphdit238aZGg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0_1614252860325_0.12241148833558779"},"_hasShrinkwrap":false},"6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0","gitHead":"2a5ae6e549743d7a57f1105db6aa47e0d423f1dd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UM4eFghvFy1RLCNZWZR1vTYRP7ozuVv2IAqQyxIKd4RLJwh8a7IBQTAmi3TGbpSzmGqYj7rAEoNSAnKsFMu2CQ==","shasum":"79b7ab662431c461a64b00a016b70000d8bd90b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0.tgz","fileCount":62,"unpackedSize":340484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN4toCRA9TVsSAnZWagAAgx8P/jzrymOt5opC0yXu+l4g\nxnKguFET7Y2BB2WZR/plifjOjC7Q+Yy0+DCWO6rAGnoyTM7vY7Wg31jWZMQ2\niZYQoqHUvSx/PSWlWxK5xKhbT+xJht2oaf6YqbXjPbvykjkvAVzJWQxVrbIA\nlg+IvwSTm5UQqQJ2s8qtjcQ/OQKEGG+08fr+K9UWQiKsX92XPCngt91j6APC\n13F6gXMFaRkfyYav1EOGubiqjXAevdGCTRcu1Xkh53vkv7pducz4T/l5HLDK\n7tEhUvcsXcTf6MUSJVU3jsg9H7geBSe9fFRv8ECBgFo6FS090qjgZTLOVk3P\nkncZK0DqqyUZrxMobnJHAbshI9ljVa1cR5JqUrwWPiHReFWwZ6mAJk+sM67H\nGB/2iAzh4Ixs9VixIkHv5w3R0Z1wn08mYsAobGeHCbnIJBsCaLkboa0Qvi/M\nR6BWVg4qlczvGN09XRchMeu7i3lASrSRDRSpn8riEiJ4Wh49mu6poDawyDSY\nJx1REMasyKb+yvtRYq8VscdkJjZ512HHAAp1DL65/4KTLiatB8au/22L6J0D\nF6qgIKxRgRrjrfruRV7Pp9wkakQmGnzqD9VkIONWYW7Am90HgGkMcCJc0gga\neajrjEFbcofFMJMX+QlJIjnXg9oq15buXUg5Cg2jnR+fx1ZZ6EO27N7vNJZI\nwRnN\r\n=BNOi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIArhGnAQAEkOdIgU/3elgzcRN87wr1za7BpwnauOorIQAiEA3F+DRSQ3Yi9+eZljLpcPT61tQeJU15XBYvuWJsrZWMw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0_1614252904137_0.3798304467415712"},"_hasShrinkwrap":false},"6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"37e73b5fc146e1e2d37a0dff7684f6e7190cda54","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-wpz0+H7oZFDec2KkarBOkhGeZnSHlslhURQJEmcpJ7fZifo6WMUzm0Uc7PSxf65n4OgpjCuWb/wk5BHTBdsPMA==","shasum":"de5719a738bf46020fce09fe2ac01644615e03c6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0.tgz","fileCount":62,"unpackedSize":340484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5H8CRA9TVsSAnZWagAAduEP/3cb44Yw+Q6NSVRpIn+M\nAiFXieSCmVH29EQWRS2nVpxAWBqcS7f/LpMNGcY30hw7LsrqXtT8QvUc+e4W\nt4VHo2QtRm1/LqtVjooX77+ZWAhWLvcY07OOp2bW1IWLTVSadHcTAqrO9k9N\na8GgrXgPJiNgo6Wa5zc4Yyvqb1GeCTFV+Vcub+WpR0kEmq/UoyLADr5Md2as\ntKvRa6fya/ocQbbI+mrqE67tV4zJXgBhxfhaiGLoig5+Y+7iffgxdVkQ7Y1c\nprYJ4BxXApqjVdM/Fwsg7yBvWWQZsddlC8nkcLZbmyR10lwt5YIHlphcKfe5\nl+B4lXqxxkdVdIEaTJ4aZ/shg4QjDBS9SMTC7rWl0CPA4Gz7dTivRQwAJMo7\n8FWk5XQd2PEXRexEenWIa1Y2F/dVWlAvEAF2PXipeb3qPL7fmRcaeeZotROf\n+HkI6IC7QMcExqQ9utfmFps7aEbCGWFxrfBh+QEBdljb3iCbrIsPpjDW52/e\nI0dPo+Uh6iDneKbSc4tGe6fwHKktSiFm9U+efMK8dRteZfZ9jhAEDYgc1mby\nift4QdtCtjLO6FH1n9sn9sNTZeZHr7w87/pCVelHQyqbfvYMFLyxc16tXF0O\ntRrFUiedyeBYOMUDvKehsaJ9BVNxTSvkPMi0ZhY+BHDOrJOLfNOvdLQqJRoH\n+klD\r\n=OMYb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD37ICZ2YSkiUaRiXyJdC2A6ylcOvPq4WixgEJI+BH6zwIhAMj8eRckYUuvZAwptVAkr55pNN35kx0/n5JrPifcjoSs"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0_1614254588055_0.3704303563134461"},"_hasShrinkwrap":false},"6.7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.0","gitHead":"b6a87fca37f4a87968dc5f5e06fa3ce509835a64","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ivwepbpM9Vm9mk+asUo3G+yRLhMPCpkx/G5aYgMYL+kbG60D/nmQezlOoEpU+Ro1uoKBi9QF3F79RoYyg0eouA==","shasum":"aade96888aa989139d6f9848975c30024f7c2a32","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.0.tgz","fileCount":62,"unpackedSize":340694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5INCRA9TVsSAnZWagAAG84P/i3JlmSr7tvmXrbRPbvI\n4C8umHxXf211u9X4L36eNxFdBHYrwjnEpaNR++dxLBLLGkjQQDvBhKt+kLBW\nPu98pca+oNj8Y+mqLlIAbltyZCcjUxFM5oAJGOcKe3/bzIUuWSzBueTjif3d\nFR7CVOxeaOWJnbhdc+2TjgcKg8zeYdtqe2iIQ3F7shSdk9fUVJLrLn0EemvY\nwBdVeu/475H8oT/PEX4eey+xVp8WGjXr/em6DgZVLlvKyQ6V0/0IAQakjti+\nxU3mVSEGB/NqlGbNBPjZtOfJDS1RNriLR8Iyt68NTspoJyvKiJZjx3zP0wTL\nPGqMFV5n8NsdEDN86wFZ5ULugOuoEQwEXqSEAsMQYC6eN19y5JGAZ5/4O8HV\nsV8q7606B+UQ0jm6RzNIDUaj93ND6/Oy1irhNYflY+NQDxPk0BxYSMkloOMx\nNgCo2UQ1pMNnxlnVkUEIfkaCj8v6XZ2ROPlyMyE7tZS6f4PbBBeGKi3l8afa\ns9jcA43jOoImcZUfi/wZ13qKYWfa21XNutKNaUEd9IvIrEftE7eWygihCB6f\nLdX9Lk1OqMD1EwRACnS2rU6RiiWjEEg9rSB7trjo4E5CyeYqWLfM8jUmHmrz\nHuXXpTF9HCXZk1ztbAIb66v0+Fyhvhy4NXGN5kCBwG6rqUFBDmKIIgsHcNjw\ncZtI\r\n=Otxr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAabqTFw22AHWSXzEXOfRqBNIcK4fgjIi4JSGzcxf3RlAiBK/ocUMYN/EVzGEv/+dhbjv6jwTjxbsQBMLXWKERjp5Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.0_1614254604984_0.9485736172777357"},"_hasShrinkwrap":false},"6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b6a87fca37f4a87968dc5f5e06fa3ce509835a64","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-nWHYuNPqofSYUDOBzwR1XEIp5crrl+++zXzM07AC87bvy7RRbal5ZUWpQfElVNfqW3/9mZ8gubkagEnkEZJCqQ==","shasum":"32b6a5f26225ce3260fd9ed164dce912d8ecb999","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0.tgz","fileCount":62,"unpackedSize":340737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5IsCRA9TVsSAnZWagAA3SwP/iz3lOMAJAcNx1+pNhDN\nW/izWfn64mdIrTFfUzsrb6Yw6B3DTsXIEcl7NU/Ud/IWSsmWeCvRyXU50J82\n33VFpkb/a8mi9NQ1tK68TlaZq+M3Bv1A0bXvFjAqS0nohsp9wRYoVKzdI29S\nXPS4mtt6S4UK7G24TMkBxTwVgRkC16lF/+r9BhGsML4lBWMEc+k7THkDaMdu\nnBQMG2ubsRdQUajIwQybnmKyce+AJTkfznUG+AY5Npeuv4sBdbD0hdPpxpEg\n5IUZIeZgSz2Qxszjyn/xrrlFVYf1KgRDh7Zo0gZhQZZaKMXAR4iDdZnt7khA\nrcyioYXJTG035BnleGlylVu/UHCeuPyiZCJDLyyInpzSkXGXlZZ8s/RWcwiH\nFu/5bqwign6BHk44HIkupAeucJ5+X8cydjbtdBpM3ZOqLiUFmY7eOXz5Ony+\nyhoZesCP8HKKMvGRz5MYlSIpKLPr3eLWnM+YTDQP+mjL0XKfjL2H25w17+dk\nLAU/L1eqGgyqj9rtbgDK5EYqSzxebte1E+ml6RUNCq6HmpsSMIY5/ZBqJJif\nRc0VCTYbTsd+dh1Eb0+3sZhpfUTxv3MUF/opSTrKNmktoxrsO9PISHqiLsdZ\n+BARp9QAqMz127WsEoui+UAmGtKaiEjcLS5gTiLNZtkOBuqcA3TwbJ8D+XQo\nJ+fF\r\n=6Dzw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3EQPPUugqQGJv1THx+53JKVAtHisrIkhpAdHqAMTk7AiEA8k5T12sXtBUUq8cNb//fJBrvqILC4zzM20FNCeDX7oc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0_1614254636441_0.08729708870414288"},"_hasShrinkwrap":false},"6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.5","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0","gitHead":"f8cbc6218f6698ded1c66c5a41574536c3afa144","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-pG1RsUHboT+p1LD8OlZBmikiszIJNGmuCN1AJ0tZmsk68+Pf/z893bai6KgkTWKZunX7Ne5eKDORGdAD0Qls1A==","shasum":"4a9652044529b19f450c0fcb2b8395417ddac0f9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0.tgz","fileCount":62,"unpackedSize":340737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN5K0CRA9TVsSAnZWagAAjF8P/0Tu7aQmzw64jNxnL3E2\nUGMil9dsUMueX0z1Qr1LIaOOfQG59q0xx6IZTej0M9Awl4LW+FXjjjIi7csX\n93TLabSL49hJjIX7D0qMkRLT3Tq6miRY7Xw873X5usdiUCCGWOnfkIXYHpUt\nGSY15wsc45DVAJ2dhmXQ0yhake6l8O6E9f7VXDTQch2C9eeZ8WOISm0q1bQO\nNL7EGcl9jvggMUYHsuu2nZqaL3Nls8ObvIgId2o2nwqS0hRbyUCDWbxD37Iz\nIOe5bLHKzqBJPTFEJlZlXXytXRh5gpCes0Ml6Qnq5XPYGZLXmL2oh5KqEzBd\nuuXsVqNerpmz8XvKGzSm9HAcAVCuEfKpoMsOws4inK+bkfLLOpBin7YnbcRW\nQI9D8NAZzwLAfXOMWMtI8vc1wiXB9u55e7DLQOtmqBME77qLiLNGPg+xccoW\nSahPoqEUFXmHMc6JWYQXfYc1RT7htbF5/9eurl6ld49xfov3FsfRJjqx/SGL\nly7cjIkziZ57zRa2A1vhDjjgg/eJ8DL5OgCuhlMt+D+rUjpehH0MRectdet1\nVlmD5s6FWdslZ+PPgRp3faZn6nSDdHLeNvMiD5bEhA3zuSRMxtNTDr7h1K3K\nN05N1QhamNyLodCK3e+9u3stFU3BNMVeOE97ly55GO7t333jSQ5W1AHKvi/w\n8PD6\r\n=7WMg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIhaHnKQlpixVw1NQX1Dkrk/nAZjqJp/5Di7bNl2tyEAiB1b+c8vYEbBo1iNSb3wwhe7nR7ac7A+lknTnTANAnlYg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0_1614254772009_0.3439252960071928"},"_hasShrinkwrap":false},"6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0","gitHead":"17bb36e39cfac300bc1c7b9b947028aa229eec9a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-W32PzzKkEoew5EXSia2ovXkIASPslEA7tStUI1tlBotJB48/CyyRTH5CrcQyiWI9/JlmH9XGO0RFqU8T+UtKjw==","shasum":"892e0c4d0633d23bddf7e9e595be5879671978fb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0.tgz","fileCount":62,"unpackedSize":340737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOIcjCRA9TVsSAnZWagAAy9kP/AkmMHnOZ4oQ3O6T2NPm\nJRIpFS05pSXaOQ6hCbXuTp7dYDM6yS4XSnsyvdgfco7qJHGnmdC8bwLgzSnT\nqOwMo1KWikBZfNY6tELn4lFEMuveI0GCiWGZHff14vUbqA/I0T094QirAgnL\n2ANro60px2KeKsbY+eh8sEUPsBiJlaKSnksqJS/sDqwqQGJqOrS/sUSFKSPD\nNMcDH0Pfpzji+k3ttnwmRobkva3O1GUX3zj+xrCFvgGQC0llg+FZRjBdWSFA\n1CPyOnr4+Hyos0ryBWSWM/bubf7Zt9S9CY4e0gCiWPvXKobPebOkCGvlyurP\nU4/4vlQSVpakH65gXrstgayu6OgKL5zpDNKbsMWmy+XNlwqJ7CyyfCE7VMgP\njbaL+MbGER21VRLKFXdSHMalRAcJEllYsFHbYk7D4QDITujeo6QcF89/3zii\nfrlpX/GkU4NoZk9Rnyf/HaSCU2jaZz0biuuMsGCtOGVHkZizN5W7lNWmuaS0\nYy49v4ygsfnsV0g5D9yPWzkKMAPTakfaymo+2aJXT50TPcBdA2D+EjG0L+lg\nsRXEpzAa496aDvsOCh1a+ee4524RDx5TUK9kwpDWDimMQNvlVsYDdOuqxcQy\nRq7ZuoxrZ1eziHBgNG4tBzrcsKF8B2bfUrwSweOfA8JUDtZy9rjfeNfx+w8L\njIh1\r\n=4Jky\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmCeqDQnKPdwt4En2tZagALr9E6q311cfZmgKY8SSzIQIgF+zb5m85djXKbn4LJ0aZC3W6fhjHRJ1YAznr1zA4ZiE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0_1614317346583_0.3535739142236365"},"_hasShrinkwrap":false},"6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.6","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.2.4","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0","gitHead":"60030c698e31133ad27e77335b338f4a7116906e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0q9yv0qEQvtcudubNFaiyygBAPFouSCSuAjUcuzmbDz2v8+5qNDKI8yII90aZVrMjyaNawI2n0kocvw4bfI4AA==","shasum":"fd961121ab4036c6f5035833779fd849dd296c29","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0.tgz","fileCount":62,"unpackedSize":340737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOIdsCRA9TVsSAnZWagAAoSkQAJevsAt+ElMcMrieY0JX\nqAaXReFYfg92/imlPwNlhWjwwkdzQXlv0Mej7Df5Ro2goQadzAFBXXkfEpOL\njMGlyoq0CWA6hnFf8bWs8CQuoyIf2i6Wr8HLRpaAiCloXLBQ/aalOKwip6KE\nQIoSPSnFXMGNm+t8EON2XNSAErJh/Ww7HcwXkP/h2Y0tcb1kzgdcEUGmabva\n8eccSVpsJlf8ECtfcLj2RU5jQzjbCNsZNMPk0dsCpBS0FbXKU4Y9cU6s558u\neuARs74PoWGZI1Wkw8L9a5vGtv60gjaBroVkd4k4vHmRXJP3JsEX0Zek7d2E\nQvnry2YMfrhe+IvdU0Cb41x8W++ZJXis2hdd/oFwAwCs3/EyIDOyI8Agw8JW\njQ8jMEwwf1/aT0Z/sfHB87YYz8901fYCeGOfc6o9NJwPmFliHAHmRg8jhR9g\n2r8+N4eANRxCGOnnq1zpK3HhY2hF3Ds4pA3NPl1rhQlAV0f5w2vov7yecSv0\nbZj076v9sHdsxxuWMrGgl2QeAiPo1mhNcOBZ0k6T5clpJdJ57bdZ5GbqUH24\nkyP8SeNg6FEzy3LEBk5+RlOCAgTa+x3UaTG1OdEqfgbGvxN9rjqMnVwqeyfd\ndPEIUGj2ZCdegFv8ctWnYw9DpDPZc/pS16clvBk9D4dTOlmWzBCcZfZVir/o\npiRu\r\n=A+gZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICtlnr9io6GfCbMvB9+kM1y1V6SSq1nnKrO0K8cUWtYjAiA/5kqSyt9XTe8NfkdKJLlJjXoDf1reiq7e+fbycWAufQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0_1614317419669_0.07481740389530489"},"_hasShrinkwrap":false},"6.7.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.1","gitHead":"494f7b86f21687edf2cf8c6628c95aad29132a19","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.1","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0Q1H5oAvn2ns20OTPSi/1rKwLWKCEKP4we1QxsDuyYwvcSZo4Vd8OpDEK583HgzyvA/XppsV3i5JHbR0FP37iw==","shasum":"45463a91540558de47d7524ca429609882d32ae4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.1.tgz","fileCount":62,"unpackedSize":340966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOIeLCRA9TVsSAnZWagAAldgP/1vebjEaeJnrOrHedluV\n0ZWDkJuszmyEKV8V7Weu8YC8VkMXYRQcTgO1KvIqI/eyWNXABidJr8BceS1a\nxHE9ejjN7x9M/K58eFRO+EMleL/YOv8c2BIMt6BN3yUPnoqziIreIPf5Zz/h\nu/OKA7v6790L+Vf11a9C7Gt4jzcGiqTeOyEbmSTGacBhFOOip0vErwFtGcau\nQUEivr4p9SwUYADyC+Qctw3QLJaWDEPsPSeeHaOBZsIXY9Gd3azsuYwBr1BG\nSoR6GzihCLYYYvAM5O8QoF1x6UZG0Ymoh+EhVCXulOe/ldWd2XtYCxYjvK+G\nvtkfmT5tsAglvIxlZYaQ5zaK7eioq7AbVc7/7QGdEjOjm/+SQ4d6jUdJjytP\nFekAiMfi+V7kq8v82wyKBXRGgrMJZPI7EEPSeUfr3Q3IVyZ/YBd06sEQpzPV\nGUbwhWAPdUUrzsBmDrjJ/FKRcPETxbK1zA+q/owbR30upI1sJZ/KkA8vji5g\nnqs4wlL5UjPwbwM2S7mvJdOR/Mn7vfEjhEzfo5S7fiiXW1XiJKs5fYY9V6oU\nViy22csjtFSEChfl3cVQLuMshOktMprVSEEleoys+8+JWkwWThLMQaDFWQuN\nBGbvISq9EzstsZon0bP2e0INWXI7/9Rr/qXpQRToTUM1fpmc6u7yEF+CyEE2\nP8xz\r\n=2dFM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHYaNgmU3AR6vK8vOYtIVZS9+uZJ8HQ6zPH2O4S3HLQEAiAcgZvm7Cb1nHSALDOU53dAwDm5DB6vnHpHjmzxZeo3XQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.1_1614317451021_0.16157355026543319"},"_hasShrinkwrap":false},"6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"494f7b86f21687edf2cf8c6628c95aad29132a19","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-3lF7T9VbvmGNcbwzpUuBNCXgVetUtUc808U6XXNIBn/CCgK3yu07klZF0YSTSqVot1H7F0XFtIq9ty36uLY+YA==","shasum":"9b7d4eec10813172d484e57ec6f223a946324fe9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0.tgz","fileCount":62,"unpackedSize":341009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOIemCRA9TVsSAnZWagAAP3sP/2eCfBNaWFb96/SScSiS\nYyg1vsE0EnAyJVjyeyFKEm3DPgGS2yqyPbQA9XBeKRhHiVWrI2IFs4yLebnD\nRAGAZv+eRe6IiaUNLrN0d0HtbpueqEGSKOKLUq0SszZeL9xQ9Xd6cxWBGudl\nHhhaMnczG2/XGH4RqsnNSDI29M5CbSVjh5VurFC2BzEOSGq1aYVVU+oQzFpq\nUS4PWYgRJ/6w7ueg1eVghOhCBYhJ+Eg+br9YgCCISmAiUBNAVR9U+ohx1beG\n00mF4jzJX6KG8BIN0CAZ9LYFIk+qgzctS6DDwvITfkbLUnXEUPSg1jmmervO\ne+I0IKqvb8I3FIVJeABAOAEMjOzcwwBb7FRTnS4BywXoiPC5uFgtoCNLC/xu\nSxRuqASXWtIyTReMxGuVAxkECMWT9ksZuA4EnvtklyfDSk1vs8Fqwyvl7SVI\noWRgNVeNKVlCyT74aPVoPnfT1FRqudJItmMsscclkqiZepsRsQhVQX1NfmYX\nynTjIREyDIRJ1DqRcJb/vIZ/g9XYWhJmh0epzWpUiEOmc45KZWo3FyDja3a7\nV8QlHka0sBKcS5K0yGKl2VbRQy+tWGwtyfOkyDARJ1OX2dymYOEWnUGztZvw\np1jXqrL1t63YE3xfakAYoOCLPIugbsvpXJxrvuykvrmFd7OD4ijUfcbtetWw\nzPr1\r\n=/96/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQg0HIIPtrQehxF11I5rl58fFKLubFPqYhINUG+nvOvAiEAwhpM3PTNORz6oJ6oVgUHDtSJcdjV+FdIsJtRbQG8i4c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0_1614317477845_0.5396331052506156"},"_hasShrinkwrap":false},"6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.6","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0","gitHead":"66bce3bbb27a66baa6382efd52d3480870decb9e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-9soRJYqWtrhyuYRwY3k/3S5U3tB2wpqLC+WbnKzf6Jkzo+Hwc2YOXVyA7inS/98Cn8SBRnIRPaYrZDSZPtrs9g==","shasum":"9d76e50ca3d66c74a26f7e7a6f83765cc9db1031","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0.tgz","fileCount":62,"unpackedSize":341009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOKF4CRA9TVsSAnZWagAAvToP/jDoWBKOlKuJ7n9bPg5y\n18+3u3EBTrc1fQVonAxWUIrqvZlysTdBXqUtcp+JMw57u9dCY2qLmE+9QQyp\n5NDC75sux5kr7yo7/aTBT+MvBlAc85dFTgaiw/fDd921vLY4hgZZ4P2VWXji\n74X+zpBOOMmGrmVXy4MMYLO3I0VPpFElEsXeDsmkODyYA00y70HJ6geWO3ka\n3e7qKzQsuR/XDtTVpLdoDVPIuZdbS40dtXNor1/rbAMqNU6DunpU4mpQfyKn\nIzBhMh0ZY5OxVbVlWfcaqNM5vdeEsrq4X/Frv2mJCdivAxkn9RdFJOADjQYu\nzo9mM8jZjiQ0LbXJHTV6Jwt+lqmdi/tX4LjWdkQV5BCR7UwAAFkefnqSk9Br\nx1Euc/MeMy6NpcQF+OVL4Pht7kB50ELwzlkFa1TaRPFek47lcRd6Y8Vqndnh\nsBIxTPuVxFvSSvWgjW+Z1X5TEjlb7IIgciOn5p9YPA99uoOSEXadnZ6a/cAp\nu/H71rdVN0JDbgzT/rGu1HK74Vl0GLi6Ob6ernXjFAA2YEDKBU7FsgrjvMGv\njRWzgx5KztBc+bBNEvkvKSJUaZ5HVf28VDoha3g/VIXj2WUXO2voeM1PNe6Y\nA5U1rW0rAMThnOYxvfz9fki88Dss1QRaJ440W6khtrIRoaGyiccrba/rTXf1\nZK95\r\n=ll/G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkOEu6Dg5FE9eHIOuHHFhdoC8ioSL8KqQCmXh2HkJLxgIgDuyRPpSczkGulZIcaGi4Dk3XgyadWILKSBHZBybH9mM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0_1614324088025_0.821477244150582"},"_hasShrinkwrap":false},"6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0","gitHead":"704ff4ac0f3908fcb7033367eec87fd76476c889","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ul3BLH/7vtbAG1wIQcuonmz7+dMC38Y8ELs+v75rcFLXCaeGN2yxJA0N1HqFtHXY+MqAIBXKTUpaKqYUI8RaHQ==","shasum":"6bf31eea6f21d62729ef75b23fbe9579dc558231","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0.tgz","fileCount":62,"unpackedSize":341009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIv8CRA9TVsSAnZWagAAWswP/0D8Qv/WgYEjlLW/1RZb\nFlBMdJeL1VDmSuIIwerO4w/o7eEQ/HJFMq0WhmE6MTEZa1TnW5F4gqWQNFr8\nwBShoQgF/leQa77EgE/v7nOPS1G4om57P05MFFBCk4g+8ObmakAedWTWGChN\nCsqmRk/OMmd3R+In3NuDaJe+ZKe6M3K2i5cW3XGOUH8kk8uIgsfTZ3RU53Dy\nJGuJPAI1cHSYw1a/Q2PidsZYvm6H5edxZJsXSHfo2vNDFigflo2VbXFHXUYN\n/LPBtzszHJh7pdwHQKIfccuMr85h7PhqmGVsReaqpBCoJOYYdaMZcluIhgYF\niyVmomNfG+0vcbLDyGQNr8sIbSG0uzkxgN3aAOxrTI3wcF9tXdKDTMqBO8aF\nKeblrvbWQGyVd6Co4U95TD4WZxP83DcFyA4CG7du/lsHUd6lr1sC4dF2qrd8\n2oLNGbg72HH+Q+A39h08kq0hVOMWKI4kBL8qL059kN76AiAY3d1hfb7eS8Bf\nearLzVwCXOoQidiFDfO6xE74JWb7V0qFF4Ck9p+7mbxrmWU/o5p0NRRbXjS8\nx67jFCljLyo40uRoflXRkyWzXhkGxdAqCHIIujmK/+Hw1piRXdgOS+xV8qFw\n5DQBFIBJjMwzi8cLgWtf4RAqKfw9ydZws5C+G7Ekzn3M7X+LYrlHo7Unkijd\nL4zy\r\n=AGiG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD128t+GHHH/zjX3Tu5YW6RuojwIA4wJ+FT0Fe1SnyhZgIhAI/vZQ43NPo91YOwdNY7CW9CQwRar7HJ9qGpHvAWIxu5"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0_1614580731831_0.7992371317848674"},"_hasShrinkwrap":false},"6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.20.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0","gitHead":"352e80f5fcf1cac527fa70c30b4bb794780f949a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vuZ4v5O4iggAO2/ygpkFomdqZP5WCvP0KRQYtLf1VIjLAyp8wHFl81LYDWdOWAD83sKRa6UlgTaynch2atB8nw==","shasum":"8add3b6bfbf6c97ebdbb81d90d39778e1a1850f4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0.tgz","fileCount":62,"unpackedSize":341009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIw9CRA9TVsSAnZWagAAlpIP/1yRJHCm4KrW6ohfcBkt\nfFj8Q3aDwnf5z/E/x2krbJz8UZdOGGjhN7bf6bf1RacmQoJOQgpHpjl/YVss\n6AXc07At+xHPPleQ/7ljfgFfafigAwa9vQr70bdpq1zFxhxZQNJoO6Fh16IQ\nitA+Dv01DkW+vZvBkaYvRqmzGgcqJqt0F7mq2uoB9rEpki8viIPJpg1tCCdz\nY22e7v9u3UjdSg19qPKtJYQfvBuKEj3qU6lX17qJk/WJIBGrdnWJnFwlRJgo\nLP2EvvwBV7UbosZ3nNSJw7aM7vF1Xdjd2BudyiJIrG2UxuOFt6NQXi57G9NF\nBetv2olRZBs02jaHpXrvX5O+IaCIyyYYqlCcrB0+bglRfHjm/NapJPzMjuEI\n0YlRJXhbNKSZEo7GWpibR9lZMU0MeJV61qSrcIgaicoo8JhJyensukYg96Zn\nydj94IdK3/2nwvt8vvLpNCvu1Bw13+ZVHUZfUj0rabNdh/GTnN7P/4e5YDt6\nJgGcRCOI3iWUFJfM8fl/4w54wTD3ty1bLHmz3AG53Zb/sURsMtSyjp7/qwrP\ne1zSj8xKQ9mcjLK3FthTbNszAUmmNjk/jImzmtCM+ZcoHWVzupyDvb7eXnjB\nQw6ADkhksAJYH0NM1SxjknZ5my5oz0Q4wQ13rxi5b92Ld3O02bmeT7ra4mpk\n7T8/\r\n=coLo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDiI4unDdyOQpoG8kUwCTlLyfv5O2mGc2rwQiVVL+/aUAiEAgbLpVUH4K0I16f5HiK2hdykgLO1Y29re/PYTJ71dC9g="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0_1614580797446_0.6156688175409393"},"_hasShrinkwrap":false},"6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f02723829d89c8891a0ecf1d3c3b5f5cebc4553e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-axiUsyajVX5ftGaWqmL4HG6kwX4H7/zhu08GXxz2Zh1HKijs89jTYDdvql8TO1WtBTCOWBI4TXFFyhDPbNi8Og==","shasum":"9b410d710d3829f327df3051cf69820ec8ffc67e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0.tgz","fileCount":62,"unpackedSize":341009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIxPCRA9TVsSAnZWagAAuaIP/3orQGqH5PfafdJEC6cw\nmp3918U4PK0UgwKZbF2QZengpCYJ1oaECVAN1rFqkJsQrDdhSzDdPHTnWdnr\nwk7bMwFZpS5tKa9vD+uhyZPDVZdlLZolV4YsVmylPt+Lw+83UyDxMApn2BFF\nBQ1EV8mIjmrzI0glskvoGr8XWD2gc7UUQ/tXvD4i52YL0l9U6KJJescvRZPZ\nz72+JY+Z+TMvEWKG9nkFHjvDmMrvHkJ8WLwyOJeu8tX2D5h7ueSBzJyi96sU\nMTzyjYv0CNtaouHtJ1XIlRlDtwp6ivaYrbTT9CkKuxT0wC9u6jNW7aRzL5vX\nnoikcmUTzuFiL7e8fqjfMS97PPqa0XABoq+zeabsBWbBMnfwmseqU/edVtuK\nDeJx+7Roluli6poNei9dI3f3TmqlwGRBLbQvp+GZa1PZGPUtyTT6tUCH9qiL\nyfET+R+5I9Q2Zq4J0IehMbNiPnOt5fKX/BgMFJXTH4t+13tjcjxa6rBFI/ib\nXBkaSxUuuM4gXPa72Tg0Hg+BJFpw1/0fjGmzaILOi7OXEmRzjEXHitLD+zSL\nndoQ3VOzLr0oA892pi9yzA8ADGT94ln7dpFcGpSjkqeVgHuJ9LHLjg3AxIta\nA3qTpAqikKptBvlJzJYHwUKsiVZMdBy440JWrnPJPBZuSSvHtbVCoSVKkOSo\n4N9E\r\n=1QHN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0xlrGGnO+4Scas63INZiR4Plk3nisJJ5Os8lRC5KoeAiAM8vioj+vcyok6aZMWOJtRLw85RYzUrYbeEptdosEG5g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0_1614580815164_0.2248776710517899"},"_hasShrinkwrap":false},"6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"4169bed34870ad8be46c20f51034b83d56bea636","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-fgvPR2hGPNHqmKsZVTbAvs9MmpEn0VTDM6Fb0yBqXsEiY+aBgV/F25hJPqxCEtClxIGQyLy7W7ustvmZO4c2hg==","shasum":"92ca2008a7882caff8a52ffe8b15016cc5035aac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0.tgz","fileCount":62,"unpackedSize":341283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIyJCRA9TVsSAnZWagAAlLIP/2eRwGkRlQUt83dSQYgX\nkOlYOcbPjrUDVuAQ/TWjrylNqlTW1Xa3u7X203y8EJRO5hgtJ+zwnSMptoOb\nz96HRcaelcZC2kFHB1aSLmmK+57Xwhfv5Grjyf5uOyp2Odmj10TxsdUo+ucn\ndiZcS5nqaLSSPEzpm7LeiMSETDeGb0Wju89XXf3O1jtmn8r4CR0rmJZb91IH\ncO4CjXPAPkA69iuQu+aBGPF9n5c+XYmaer6ezZtYaTSytNOP4v3edt4itfHY\nagPIAeBNt/lBaXrrXJKv10jdqn4RiSAh8gRvAaExbJGNELMPBoKOfXNBlFHH\nDwE3PUhIWivrEXLfbWNI8WfXPbEsKY5qiOoEMRkp2xhj/Tm/h48WfGUvnF+5\nnB1pF1fg3OaAG/TlygOeDf2omICrvVO2guJ6TbjnUjsWbj57duzPBSkqY5t8\ngIxzWW5mIUBmxoo2noevC8hg2kbwRbt8lAdhpq4zjspLcqam1SIyVxhF1hm0\nxycr/wVS/jDDywf0t9+j5hrtlkwiFFDnI1LsFUnx5fpTZnskeCk1jq2Fq7X9\nC3j6ZuJqlu27crx9efJaFcf/cFTWReVO+/W+QuFUvAGjgMLVlKRzzqksuAqR\nWz7eaNF5Ymak0MRaLbmzdsM7OVRQy0qzkv3p35Zy/RMpbs+aJ6e3HUKjpcZW\nQLBb\r\n=OZ4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhqoJr0m2B4cg7bkKKYr0LgTJzhhkYs4z+Xj/w2/EZNgIgNWqWdcS0ZkM24esoqchUDAXhguGYm8NVYxlZRLVg6T8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0_1614580873040_0.11455063057156689"},"_hasShrinkwrap":false},"6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.0","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0","gitHead":"5e4bd77f0bad511fac2bd0870106ac97b33fa9bd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-xfmAJKN846zre1dpICpm7pPol26b5SjWIFlXMX/MFmEsiLVri+olJ7sYRwYcbkfS/lBbxEYmFXy1c2OGAzWikw==","shasum":"fa7327b304d6b9ecf3af44030145a5d7f25f553b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0.tgz","fileCount":62,"unpackedSize":341283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIyhCRA9TVsSAnZWagAAGaEP/R4/CFYtK5xcr0g6uJgZ\nITqXEAbtJ2rU92w+QIPx5tGINrqM7HKhZaFqwExAzxiBDcJiHiEDdY+/3/nh\n2SW9S3tyAalfXxBO25yPUTSPCaMYYm2mSwr01/IY9Chjx1DSJIFAQ5k/w2jj\nihuN/pPget8iLgPcngmlE/3qUdqyg++NObcABX2TIqMyMP4mh1j/gMWQj1hb\nkLWtz8n+4CB1RGkjDGn0m5SEC5jPIkFS3YwK4N7mdgYjLUuX6yZAybiFxstV\nyokkCkTCT2Nhy8zbXwrE0pDOrmVXsUdwQ2A2EV5Kfms4c8rWN8RglWFmxEtW\nYAIXlX9GA7voojg9fV2s6Yu0tIOow63I+z4WEa4vaJNZr1f2ry9ewpzw5RgA\nMntPpfjxkreeSgVqkMr/MN5j+lmqbaoh44wgBL8i+IZ+y9tt0clNmpsCYE7M\nxVGp5Dey3BpceUnMjKFRvy4ktoen/D7qj8wgojUM92AxuJz7uMT6ibHDtNhu\n+kxn2woHFVC00t7b92WKst9/ZUZ5SAfrfxCQDIGf7PEo+MrBPvJi4a9tca9m\nMAsA2SUnk/Zvla7QIY9ZALF0ttmzM04cSBjnKbC8WHgHm3Y+vwDNFzTY6nwB\naKXnFzhaVINFfIjVzq37Tm+hMJ6l699FB3rimkEv+R/WyNHna4eDx0Achy6n\nQB5E\r\n=Hrf1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx4NfDyhWu7ruwqHITB2TydZ0XqRmRF/Gh+Q3qImRM1wIhAOCQIx5XaT8nZrwuORVeYv6E4xFFg5mU9UD0KaILhemz"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0_1614580896466_0.05502532737558563"},"_hasShrinkwrap":false},"6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.1","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0","gitHead":"77138c21287614b46ecccf3e970c49d47467eb94","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-PjtVqa8FwjG6/kso26uZFJ8b8uUA8wYIIeLhcsZ7ALanFu8O7pwPj3hJ2p5SyQpoNa88sn3Dfot7Q4QIVZks/g==","shasum":"7a960f2bf4548bb26fefa881d2ad01a2a2c65b32","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0.tgz","fileCount":62,"unpackedSize":341283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPIzNCRA9TVsSAnZWagAATFAP/iLdMcl735q5tv/sZ4TF\nzAK7fjHo0Ob3pewxxtxUjYiou9mIegXtYTnkqCpmhrub+Gm0W6LFz1kt7a50\ntRNeOkcHPyYlweG2FdB8h0Y+4U1OM0jeoxtQpT7wjBh2LoXm1otZWyIZII1t\nf4gqXF+4Y8fEdo8uNk+Jxw4MFWiFEhOQlfmTjnFORcfK0tjgRnpl2JWvyUc8\n3l+BSpY/T12ldlCus2DQAT5KUaU96iudxGc/SBFYbBglZFtLWjGg9AoSumPL\neoDlJaQ/AFx/TRcXt7CT5C3sLlR3onTlz6J2hEYPNTj/YYC2zqTOLDwnAnIl\nIaVejqsH3N56txnFZXRIcvHeLnMjHinR4o8P7gkm6XqorARyVsgdoffEya6T\n+CTPKdZy5rLLsokVU/ze0LhMjv2HceFK+Z36IGRRrl6islxpTrw/85bEwn5O\nZzxsbNvyvrT+sZ0vV3iM/lNA+gLHt1+j3D7mcTNIsP+lgG59LT3C0uEvZk9C\nO5lOtPc9XI6vCeKYwyrdGvcZ1r4S1iLkhkELKq+df5iMTqQskVaMWnp+CCLw\n78IHDQuZ9AATYM3fbQKEz81TcydLJSASUBL3B6oXM/DPfxOSVaCEvtVgYkIr\n5JtoHpnI9typJckW/mrAw54TUNwIltdDZbCg8sR0LlrPng65E413fbRleZZx\nSqlE\r\n=Hj36\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8kfxokj3saJ3eDgWkprQYyMqQC1B/eJ51ojeVSWxJfwIgKXY/ChUtk979kpPDOwgslh04cHc/R5evzZDwXjBVxGU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0_1614580940582_0.8623346119591535"},"_hasShrinkwrap":false},"6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d21f27d5a1df1a3ac7f9d65af1cf31c66147244e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-2z+r/LHBILvJJ42gV22fSUiVSfOsypECOp2SQ+frp5M3ljDV2l3pvAiI8Q87LzZncBu37WkMQtfYsLKoGNcafw==","shasum":"631bc258641070ad65db56191ba67c3e38181f88","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0.tgz","fileCount":62,"unpackedSize":341283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPI0UCRA9TVsSAnZWagAATLsP/iGV/ss8aEs21UivmO05\ns0Z8KwOwv0DNOxoyTOBG9njjAO3070Eu/v+ibfex/vqcyof5uMQbgnjVk+Wv\nDFlDqVg77VFzMtx2SgYLPaFVWY8YGOC29FIaj+E7RhU8wHquP1DJCrnfnoMc\nBEHDXqOiqxpFU2qG9+XnIglDH2qymMH02S0t6qT2vMTKbdmvYWwWdE0aofIo\nCGp8NfVURldP1hqCOhRbq2wVEXFOaAxDerhIE2Y2pnvPlNmaW06MvGkQwmEc\nGWKRzxFtgxuw+2L6mLVNcYwtp+kK9Zg4TBL8gYE8957yHuo6yzzBXyUQmmEm\n5pG2ZogMA0k5UakGqpGG25JFCzUnvSI6yRJ+Soi6O4dV9UwcUEaY8YD8cif1\nZ5Toso/439XXvRUkVc8oNJxiifXYP7dk+9gunfIbxClvhTXuk0v+t7z/vgwD\n+zzLKyEgGB5VElz9TPuLdlphPsoo1l6yVizFTbLDjkcoDRhpw2MYRlJnbz3I\n0sHXOf7DaFgnU2Bz1AxSTlBXtMu0cKMuKWo3F3kJhaiSG3berI1Xks0lX5+l\nNZAU2ct4NuP90yJZkNory6qZZqNYIA/2XCYHDsbAAxjD7hopH2bTw6+dcdKi\n7Y/e/w92mpTlOF5SDS6mJL3QuH99uJrxSemPBHkQkU/JH/1FZ791Ik3Iw7nC\n5Ril\r\n=E988\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEdnP5WBWWbqXouZ3/sfIrjFZdiBMg+RSGOmYhNI9Yx5AiBBypqkbB5z8gqZElmidWST2I1+OxpkPH3AAaFhDYUcMg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0_1614581011291_0.839863156251978"},"_hasShrinkwrap":false},"6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.9","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.8","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0","gitHead":"c05ab8f5d55280a8b2337465572b5ee3fc1da605","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-WvxHBES7pYB5Ab6To7n+epTXnymBbqWVgPAFJyPQ7RaeOJO1k7scjFOCOGDoAqkSyP9Ua3PS1tWNvBEXkDmChw==","shasum":"18191879a75dd10bac30d4fac13c94df2c920f0e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0.tgz","fileCount":62,"unpackedSize":341283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPI0iCRA9TVsSAnZWagAAbOYP/06Ics+JNQI2XkTnQMhJ\nQ1dwwm3hi3GnG5H2MB8E2OpYDBXJqrudCCrQToYMt6nMk1vItXcDXtYr5Z7o\nJJsXNuCF0o/5i/UiJAF5QzbpplfIF8NtVLcmusRnNKEtISoT/VgTOKpFi+B+\nfGK3TnGGVmqQp5CbTz3j5qseWK/taOK5xBS2v9OdU3C8vXIBnQsxfhgLfKUt\nENVk6icklFVIPXcPc3cIj9NhBWnDPnoMF2HdBPZ+ezNgoNchEQDcLHAT0GYN\n1zVt3j5Jh4SDFOJOts7rgoY+gaYEOKbrv05tVW/rhHIr8m6q57khtwQDxIJt\nxIQalkJ3DhsC6wXoq2WGYa9vaqQ4udqAvJvltdhWJIL1GlOKRiv43n/0IeVW\nGMSJi+4r6szeWiZFfSTUuCl2dOO0hctWBbOwu8SHRlvTnHwmawpIlmJfPQTr\nN0qhpsU0vadWzu5INBvG7GbuJeQhmhPy/AK4yFk7DegnXyr9HIljC0AwzIWF\nfpXe36Ql5uFzBB6pCxg0k5hvPk6WjKwsf6UkSL0cH+jKq4pj7au9oxEdwZpe\n3q40QbFAXeumDmzvEVxuNTQs4zjCMQS/dIuXZ+xKKQapQmTcvhyHQKCWSMRh\n3birEZhgGdWO2njEeaNwa/YXNAmHOrjmQeHd/srDwvCqLEzggPZd1DzPCPP7\nvuck\r\n=LCdL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCKdv/+wZja11vWrSuAuBXk40WJE8RO093FzWnmCaHegIhAMOfrsKqG3IZC1oGNhh8j02oD1z8ogOqu0oEv4rMJSSn"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0_1614581026411_0.35727411854916413"},"_hasShrinkwrap":false},"6.7.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.3","gitHead":"dd881e655d90d9cfbda3aa91261cbbe3ec2603ff","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.3","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-4k/Fg2zo9CTOpVIXfYAmY0uXbHjX6GCDpGESgoNK73KrhHeFR4LxE2wpyN4H/JG2R5OoNIwv+gT+RD6kRIDYeA==","shasum":"9b07265e992e99864cc1bd65de32e558178e1ff8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.3.tgz","fileCount":62,"unpackedSize":341842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPI0+CRA9TVsSAnZWagAA++sQAIxhDdagaM+BfV3EApIg\nMUF4fDjK1QJJv/UJgnhQoff8yADUb8I102K8rQjmpX0rWWVCNt/lz/RC5vVz\noot/WzxLTEeOnTkdDs4/wa5sIonNrqOzSM06ylWqn6fDpTl7SVtfZNa+aO66\nh97oVMmQVeykjAW9VnFlRg91iMnGpvyCZ3u9ujlo4wJ5LHUSCA52q2dX9mm8\nKYPYZNiWFfJgEqa1xCfVm8X2b4wXgokG4zumnWaTSWSZ6/pclOW5us35vmyD\nbjnFhxl+zNQtaCkCTE8vBmumUZFBjA5IcnhNIcQNOV9h93AK6kyEnuz/WUW6\nf684dGEz/bA/5HbfKGf971mxO4kAS/K0UCpF1+kiNLTgjGos6hZmN5ZFCxkn\nY7avoU0vSbyq50DVosf+jHQ9gISKcR8rmH7ykVtUBkc35QZxWW8bhYSd159k\n/43huKzuY6jaxzlAgDBs5UQNSWBZAfckMi1KCtyHgBTbCQOnsS3RCY3cc6gN\nglsctq+saqitkynUVlc5v4TYgWBuTzHgUQFgOeQnlFIzXyOLt+ZwnekDVxvT\n3uehWONAyAjnWnTyf2Luzm4rSfAWT6KFMVOvGEc4kbjnutelTjoNZMnuRht+\ns8a3ihX8dP6j07tFmaZfmR+5OSEFHA2C4Gna6WfiwfcKo/IK5wKtlyX4tKHC\ne5AY\r\n=DAJX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDblnxRCVJGheLuts+SPDzgISlwKkDXuZy4RXEf/IcIWQIgFwYYUNX0yQau402c60O8bITYcl8lod8y37IQINSrJzQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.3_1614581054166_0.49398466599983326"},"_hasShrinkwrap":false},"6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"dd881e655d90d9cfbda3aa91261cbbe3ec2603ff","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-WESpi28gYISQ4qNVN2iEDRG8bUZsz92y412ldzWn+wS9CNMM478zzEZ5ZzZlK/hIrbx6jOFaHZHdkQTGzq47sg==","shasum":"c54518fa2096934effc78e5b3de768ee6c403bd8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0.tgz","fileCount":62,"unpackedSize":341885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPI1aCRA9TVsSAnZWagAAIk0P/3VrnCbmI/cbAhcYDSsf\nzI3uRrc70GAxeKUY/4e8c5aT6Sz6wdxAyaTQOLliBZMGXXVlWdnIF0MXaU2a\nj/RJJnhGWzunwT67hufNyxWynBD5Mwo5uYTcDst06fEDgyEzSzi+IZvCLL9U\n4lkiSYSqZsNrNm5JbNn6Hr5iEK/sJ1nULLMd4sw6I3sy2x8yCZPFpyHHy0oO\nDIuhgtADuk9Ten5jnjEpzeAUrrFbKckMNuArDMRh+S/Kd/E3A7uYdXTn3xKW\nIVgK/DHRMHNi+Cnkzwlbdo/iVRlPI7FdR3lRD2v39dkjZLeMgNVHQVe515Xi\n3TIL9QFVisFdDdMu7LYa7KElc6i6UmADTomHY4urSgNblcB7SlUromkhl+Sw\nXCqUsU429Q/XSUasFOd2rEYv6Af2n9HdmNApvwrVwfmpEFZKn6N87jV31j6M\nLXnQJADCkwEKhVqA8PsgLx/TlJEvXfXHhqdauwcl1I1R3GwfflX1QkQRXGB4\nEIsubeGDViMfqS7K6Qz35Rv9nOVlpRXtkXPhZWOdUwTo5yrqZc39Knl2qb3c\nRkvPGWmuoXsAVfuS18Q1nVcFh9syAiPmMsm83og8jpb4RyfFedVsWxokj1Z1\nkw1maFAUkT6r1ezy1MiGiF4O3lz19UiACc3u1cxJaBb8avG3uKRpAdvFTILo\nLTru\r\n=mAO4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC+HlQ/r6Wgi94MjI6TKoaNDaCberJfOeJi5tUCMK3awIhAO8ejf/NMzEVRFUm5vP9pAd4OaF17llmg8MKMnOdPieA"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0_1614581081681_0.008877927780891026"},"_hasShrinkwrap":false},"6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.0","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.11","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0","gitHead":"4ad7272c8820c5ff5ff87189c0da78470a0de0cd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-SBPi6ReLHXqPAII0ZggHS307AR2lX72AezRdV9fdx7ggOxKrFPx2tfnVMiHjrojTKNlLLWGNqsuge8m1g46C7w==","shasum":"7f072d7887dd2e8574aa6b543d8c884635df78e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0.tgz","fileCount":62,"unpackedSize":341886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPK9mCRA9TVsSAnZWagAARIsP/jP9JaVEXvtIdPTn0c3b\nJv+/D7aotrVU5zHoPSpa8lgu3xbbyxSmHL2nT0dB1VR67vlBqXUsNvI0rK1F\nxMo0MK73FePT4bcVHvrEBhO+vXjs84GFhksLToV3gCi8f/WLu5PvifQ8J55B\n2kxmVL12oKkyCKGqSTHGiq+5Uxd+M4Y/ZSmUqUs/pijAYjy7C9254tHukjMA\nI1h5QpiOKX4i9W7XJYKwC2REY0bHdrqsV69vUuYHzj2LcGpPnsW8t/nvdtyt\ny08Tuy8C5FLYc6InoI0y4ah8i43AgqIDkQ00JbbrTnd943vIKCbiMu87NAR7\nxojhOWf1MwYduUNnJUdcsO2K9MNWUVGX52jGDgXZNsnYlh4ylQGQhWFq+Vm8\nxz7TdwpEEdzRSEmKUcziNCpeiCmOLU5MJ2IQVJcdbdpfm9zr2mFvWj4cTsRh\nSNUBcZ9Ri59tjcVrL7FgKNagHp/ayZB+FhGiPXRW0x5tKqJppI7W8xRr2XTX\njf9MAiAgFstoXvV4o78i/H8/t2u8fHFxNU+TXF5KnIaibNpaVvwnYF/g1/cY\nf+c4P4Q/aMMrFkvAdP3yfkk4BBkO3KT7Mtb4uPgUqfEVV1JdK3B43akRKWpL\nhF/+h7xKVtPctLrRV7kZ/uJzuQ7fnVVqHpexqgIpeLSOFZPlcWNXSWIjQZsk\n2M5V\r\n=kMvc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQyqLIk2CotaqCQ5qn/yIgTpPgywUbh9iWep2AtND8jwIhAKpfUMvVqeNe0I149uLadmsqILqLeHoTlJpjRI1R7tkq"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0_1614589798334_0.15948153454752645"},"_hasShrinkwrap":false},"6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0","gitHead":"269e507009a79221aef7a35d309c6b3177420c90","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-BHNf1j9Qe86Z4RtaPoFAM07Q2rxytjuFZpGhFU3r3jx51xV7k1m0KWFe1VsRHKUb1J216hWTsVj+vTaunVPGdA==","shasum":"a18462e6dee3ebcdc4383c4806743d632808b15c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0.tgz","fileCount":62,"unpackedSize":341885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPK+uCRA9TVsSAnZWagAAsnYP/A7WlXzHWPCOu/GhdLG6\nhrH1twPwQkO9UMat2bB28ZxKl5xoQbSnY2QWI6V8EBerxpf3f5lRvzPQx4V1\nOja4YZhLa12qktVYNM+OOIsuNFjwVgC7UUEgp7k0Ng4N112S3MNYp+2XdZmA\n3eezNbEsZupGjJ8RYPG5kygx4kzGXkQH2CO+dOJO1fFIixUpsL0TELU/1PSj\nyGMmNR6XT1wT5Oj67hHSnFO01v53y7CBUXHX+6Z9f4xqPQyRLczDcCsDsq0s\nfE0P8uJ6JtEORKHn4f/3LZT6VNyB4u9O7zQtG3CQ+OA6fCjH30NO2aQkP1N3\nJp8xfupe1JyKs90fSnWVo9kh5UDLseWk5GxXnNE0dl/MjZLq3ajvDvx0WQJ6\n86YBSlPuml/g2/XBO+ZfpKVEIs3efqKZGfBcquU0wGyOzEulMsReerDpK6/g\nzpwC0RacML1mRfveUnwSCs8f43a7SolUFPw0W+P70kvxYMO0eN/tPX/wWxLB\nD+FqgpHLTKWuG/998qa6xMz9AvjvoZj5F0zV+rgIrSU6J++0/EEIzxNj9bCa\nASdQTmsoafZexZwIANr+b+OjHQEAw8d2bvqqaeUaOZkxbM9m64oZnoidJH5S\nR+gr5eHY1uc3A2ky4gdQlzTlzAx60QHxwOpOjahQmgO2uGeBY0gD6kVluing\nW4AK\r\n=F7EJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoeCWfqYVICDqP3HZ2VceGL22lPcU9J+ThBnia4pjCYAIgalyqkRKplJuDh9YYErnua6cTPVFNLKnX/rypNq4h9ak="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0_1614589869920_0.6167982504058509"},"_hasShrinkwrap":false},"6.7.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.4","gitHead":"b5771860c2fd07e87251ce2db56e160b7d947470","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.4","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-r7Unxdz7LIJ5nlvl6mQLqYON+9/pIamoo6j2FdE8ygN26C21njXj5g6UoSTojlPwtFoxcUZJQNxNizHIatXrqQ==","shasum":"abb62ab8364abc95547c7141cc7786bafd3ab18c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.4.tgz","fileCount":62,"unpackedSize":342141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPLCtCRA9TVsSAnZWagAA1l0QAIPM6VOW5GIcqG3rVkrS\nOSX4T98vt1oBvaT7ufkTwmQrJIAjkYqi7juNXIQRgxcXOcMLJKgT7t6H78BF\nAuLMwELrND4XdGcsL6HlXULOvSKPYVJDk5qQ3jdgFvUaYniikIlkCXFbJg5b\neFZfdllEiZOd5nXqLM29tN0834ajSXLIsKoyy2F5Ztwijfd3QSYk27ow30cW\nqz+8LewSTeD2YgMTSxq32TFpr+UKq1yY8XE4OSl7KZHkhmx9beWO5wvyvpRl\nN9nPhPUyTGdgz18GJe5isR7rwNCG/DiF/9wUP6BKrIMITlaS1HjraY/ejFU5\nGi1cSxEWz4EEkaXgza3Ir/Gx4X/nfspxDBfzHJtVpDb2lWMrAMsu2VaWzdd0\nN+21atsnsQBMHFAOY+YTlB2uS/yOaHy1ov8UynISNuZs7IdSbWeuGNxlix52\ntvAEs0r5a4zWk5X62W4xrvHSAr9y6cvbQCAK4eOFMkMGrGrL8WyGTjaMKAhN\n7/DifIElCAkFTXFJ391W680caCCnVNYm44RNcdl1HjjQCiXAPsCy8tejVUJB\nMT8BcsQ1VCJkzJnZQYMadk7ITtfMUCJV8hLGNaag0mKRZz/bk1GuiPvdnkil\nkg1YOHeHp6iSBVrBZ19G/g8dkaOi4JGuCxQhJTAKMb1V2OX5C2PvTmsnOXy0\nNsl7\r\n=57Pg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1sNk1wU9vSZTzyQHUjP3N8gbqIccBqAY+HzNGTwgzfAiB7LDbbJqHabBP9FO+qnOBnwZdlxHMMEPgItK1RnHit4g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.4_1614590124819_0.34455320154462"},"_hasShrinkwrap":false},"6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0","gitHead":"60f4e7841161befbcfb8c253224dfd729d147f20","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-sTmicobwzaEeAnVffEUZ15rd14kjwyHwj6UkUoVngzxmep055LBvVIyrBLlChUL9GA+kCxFIxP2CxPB8w+1BWw==","shasum":"060a1447dc41cef32087bcddc39ea55df004db0e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0.tgz","fileCount":62,"unpackedSize":342724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPOK8CRA9TVsSAnZWagAAm8EP/0/BdYssF8twA82h6gVc\nCHliQZo2YLAgq9esmsFqkwYc9OHjrbxEuyekNee0ZuQFh1XjUK5Bp9aEvwXM\nz0Hqyv20C+Czi7RZoml9HmFS8++PEHTNCbSFYByGzD8MJcZOSc5Ox4IGMgb0\nQUMSvMspYbTX3MHADUfl+36FeBSJbub7sziVEGdu1MNx+bKOXAnqZGjiZtOb\nIGfS/nJs1Xmr7KmSAnyJpcmdPsOgNUNKX98PZJVyp8zMvQmkRsAo6ObLzf2y\nP6reowTi9L+SSgAgN6qeW18nJrrzmIUJMIrmiLHmB3OYZb21BbkpO0empoTb\na7gHcf2E2yEn8WNy2h4ltOySNKUjwaNJPTt5fU3TNN6IGAghYvLe+Pne7Aqe\nn1/LU0IQk2cBrYC26UJJM6nn53XfL7Xjjydow7Klq2klSTXTM30F/m7sGTnO\ncfGcgp/WMaY+rZvu1yBQbrcl1TvV4VkVZ9+JLaXYXsvHD+mRvvXh8cwLcv51\neC+BoO4mWnAi0M5M+LfEBz+zJnXSvDrdLYAr/58ELKaJIhN8o26iXXXLoAqt\nagWEK6i7uZDg9xQqsHfJNyMv4R2e/dmTnkiUezztIv36XcwgMlytPV84JckX\nzGlUwyBP7rtN8B/c+g/c4gorPq5VOb95Jsl7Cqiav4S/xgTI8i6nk0pUC8hn\nxhd4\r\n=rrXH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaaOG2nB0M8GECOelbQAZ4+9UWqIQ0IZIh26C1dGv0yAIgWhhBGASkFUjfMXpovssCaRSmdPoI0L74/ypd1+nPHwY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0_1614602940324_0.7231520121793653"},"_hasShrinkwrap":false},"6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0","gitHead":"efa1e1a8079d6ebfd64f56dbc14347e981f37749","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-j+msucV1dS3S/hWa05YR73FWOLzHrLokfkyDvZhxqCFWUVzftl59BHvEenRml8kSBdMvujcVZZ+NckMVJ6sdJg==","shasum":"399bd8caf4ac65def640f7cc0f5b8b5c784686dd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0.tgz","fileCount":62,"unpackedSize":342184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcnoCRA9TVsSAnZWagAA+tAP/jYh7uyyXVbBVlJpN/Vm\nK3pzG19GHeLdKya56/63rGXARJtXaK9lwWTk2NT/cYB7Yac4xxykiGjN70CZ\nXojSDtSxrJNnxzW2C5twucuzbIVqakHGP+dpIIpKxvz381eDBQoIB1unaqrT\nHJiiAL+4uzt/LC3Nl0P10nm/5d8BwkSPLeJNrKDkJeHh8JfIQcc3qAurvdLs\nW5dAugVwWkFKhkWF3h8eoC2T68UTT4R2ElR5i9RD+utONqKOx6QvXfg/SbDf\nboCg4KLdoS/4vp63fTrUfszGsCBfJiju1jTGIp++kbGeguk9fu/IT5V04BtE\nr50vVxfzS8qPt2UutqdkspoUEB0bfotdCuulD5L9p15G/OpMdzx9o+Yaf/uZ\nrXx78M0i54eBa53k8wx5Ik0ye7N21kybDZQ7Zm7zWS2VlFxysCL56Heinmdg\n3xvTrihif1KEgxVeBVc26QKZICKTHBF5OUUFpC62EFta3osfuerJd4fT9StO\nfU9igB9mNafNAuAvM3S85LrYwn9IHHLPcUp4WkAVhgDjnz4epFlPY1OfGvVU\nY1pYaDRk/HH+vKYlSo5sXhskTMrK8cPa/L6l224Y3cbdRwwSkaEnSLiKGszB\nMz7rZpubyqfbYr+jkvvss4SSx+IpzTnypeXWNrqneATHFnMwWn1D5mcAwAtP\nK8ew\r\n=kLEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHTx1b1b7Yc2E2bdJI7Xq/6QORzKfArdLv/8DOn454T6AiBorfG+rHExfKNEVdNV9hQhdV7WpvOafVuvh4ma99hU+g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0_1614662119510_0.8497986160556583"},"_hasShrinkwrap":false},"6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.2","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0","gitHead":"cafabbf49ef1947aa6d4bd81d81f55fa7aae1343","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MH2lGkhg48dgk6VuOGE2IS5FehQa4Vj1WRxvcKL0IqdBkcFHx4OLc+1nrf2dXYzse8W+/CpEaZJD9qgfWZlvaA==","shasum":"25ebc8b5e8166c4e2bbe8e53c547832043bc643b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0.tgz","fileCount":62,"unpackedSize":342184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcokCRA9TVsSAnZWagAAaUMQAKAnKsIu5Y57FAQO3ZFY\nGli6Im4e1T+JnmHCrMOR4vG6m3um55JHjBqA6QAE4d1XrtjZZ/kDxv2msdE5\nfdowv7bqW7aYe7jB8e1Rd86+bnUSphT+hex2t9Vu9RO2hgYJHnwKwC/190Vi\nMI8DFe9t/BrhjfkZC1UgTeEFwWP4z1Ni/Q1F+vRblu10DhrS4sMX0eL6w3Xl\nP99iN1FnJ/4sPSDZXloW/yduUErY78QWNCU9/WPOa6o6sD0cmestYDaSEecM\nZKlQPh4p+AsHyt6mlI/DHG1ML6VRVdRtzIIuIJ3thYhyqJP3BpgNiaZrJW3F\n0tKjl6fH+ezsSU7eRduxdfVcsqC0vo5OvMjc3yY9xwzR5Sygd58RAdVvsUFe\nKCAXWRXnZETsTEUQKNHN2CIAkdzJ4/S+MGdYotofE52MqIbOA4tuRkFjTUGi\ncsFQgfwBHmF2hj7Dck2PqIe8mNrr87Z4MNCLLaja3Jb2eCOrybCG+uIEnahY\ntndsmDuNX1n1DPQZrezJR8JkfHU+fKCi8DZTdJS09LX9bFY/H0Cd8I+KL8YK\n0xl9HQOc2P1eAUlDAE1LcTTh8+7UNfhmaoQOfCr485dQucPZjSVSaVdDTetv\nETI8Qkr7W+prXFm6JkPgdxQj7o/TqAuoY4S/Fwsdb5fjiK+1ABhgrwNMXvuP\n/MNz\r\n=oqyD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJvEv0OWThkRZj9AxXpSVcQwDWCrLlaHLqTSgJKAbOdAiEAo0Eu+3YVVxE4AYXpaQxwuK/sQh5KQTvGnnPYHZ9bnFA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0_1614662179797_0.7902564066782254"},"_hasShrinkwrap":false},"6.7.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.5","gitHead":"ad6537e89d292a05396b413fb90b01bb652aa183","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.5","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-NboYCt7SkIfxWEUXNoRI741lXXIs2l5cXl2R+U6+Nhfm5YbcibzEriXb2ANXOEh8Nm1vu7gxY1zgLgBNBgpvLA==","shasum":"be384e1053a58e75de5ba935daa681d9be0f531b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.5.tgz","fileCount":62,"unpackedSize":342412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcpdCRA9TVsSAnZWagAAgBoQAJ5EkUr2EKZO2u+LuuaW\nKnKEHRA9FeQU4ci4JiUS9FSUEK4SaeQTXJA85+7fQOG944RT2dJZVZG8tVkw\nxMkrCrO1rkfe814NhVT9aNelmg4fPSNcnRvNkcirlz1qlnGM4l8lfAzbC2d3\nbq7zb3vJ9F/j2xR3dBs6k+YTR4fRyZj+4rwMYsGCeGURNqEaLBOekOW8jmMI\nub9FQLDm1gXyY1D6KP2b/VR9M+YWySrT0jETcc5X0CwpFG0hs2Jw8WGY+b86\nNS+iiJJMwlnQ2wWaYvyK5dv/nmxo3Nk1qxrEiydi340OkF881z1obBoJLEg+\nhcwMAc3AECv+YZawjj9aWx8Ax2bQ/xXpgNfnlLMgnBhwV6itckr2Se3DeUcr\nBykK0aIki1vJUb4kDZ6hPGz3rXHJgD9TJcEq2nUpU1Vpp7lczf/6rR8tNWOT\nJoqOPn1qtz+IiV3MOO7dXO+Q2cYhQANpcIauHa7Nr715QyDtPn+V9dKJ0TJ+\no8WIJrrhV8lbRBR5e2+knez5Rpmhn5c4kerdwifJKrboBhhPN9Lbo8twwEoE\n9oi3Wbp1V4d44t2JPK3HgHi+Eqrp3EWgkEeJdZn0pdzYXPiJay+HB6s+iMTK\nwdf0FXHDTLCog0bytwBRcKOHGw/uY1l3NTsSanuBdD9Bg4sIEyIZjKAYNiRC\ntm+J\r\n=TyI/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/of6k4GDLvm4F2omv82gegMyA4ZVMSDK/vvXglRoxUAIhALiEnj8GWa3PqgYqH63ys/9bUg/D7ciqluSm6gQsj9cr"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.5_1614662236037_0.3281138699144135"},"_hasShrinkwrap":false},"6.7.5-654125e6cca28daeaf614924f19721b86f982161.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.14","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.5-654125e6cca28daeaf614924f19721b86f982161.0","gitHead":"654125e6cca28daeaf614924f19721b86f982161","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.5-654125e6cca28daeaf614924f19721b86f982161.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-bjjQVmKAn9fKp4BUnxHrmLg/9T17a1kh+zJveFuzEPGV9+V+t74Ty/UL5+9YbWwTxJ8/+PSZdCblGlHuwQPn2Q==","shasum":"78f3024ff71e280678b421d401e646166bc77140","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.5-654125e6cca28daeaf614924f19721b86f982161.0.tgz","fileCount":62,"unpackedSize":342185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcpsCRA9TVsSAnZWagAAb8YP/1KBdbtLCgQd1/1TTN3Z\nOmzvDDM4aq2admylCSjDqHvzQIeHOT0W/uBw15yGAH4uoFK8u6WxMOngQWa4\n1cSVK8zVQOBkQd2d5m4U0ZqscMdxzUz4j7CZ0fS1ezTb36Emn+JdO0WIEipI\nRT2yHgVfWIcwOQ5tSGa9FV6vDMA+GSisB+Rkxjnat+ke+2/WR3dAzaERT1ng\nT0n9LakkJ6klDMk7kAVeHvLqAi0WJ97QtENpuUY97VrjnB4MHP/hgwfY3jLW\n0kyPihx5pzc/m73mL96EMTbZMgjjrlmaoqapGpPe730DwACulbdqCLI1oBzq\nPXRWRjI6/7nGlwQY3v9IsYYNfXIvR47CaiQerPILXQ0uFqcUKCqsrPp2G3yj\n1LBI1U5k5+ds2mEJWYlH7CuMBVGDQeAjbTdj2iqVgOlRKrcZ98aoHfK98yIA\n0PlOPkVZH49aHEH5fflkLX8gJ0tljP3QXyjQ+cqhP8Ivnn6E81zpUNMIcX7t\nOr/NzQRE/GeCYb6Pw/hSb0mYdcl1Of8W7Kz/3kHB3Lqgj6pNd8J+8pVzxiiU\nDWy+gPFnwm0hB7irCao7boB8KoRnKz1Cc5sVUEfLfe0FRhFOO1E7A3Uh3bnJ\nlJ+Ch28KxMi7+6xqTZkS0tmZoJCgrPKi9RV5atCNAQMDlD3jZtQn53QbZ9Qf\nbUJ1\r\n=WZ42\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSH2qGVSWonUSgR3h31Uv4vf69N0wenHozf5A1BfUZDwIgLL5XiOnKDB0MLo/MkZba8zqELcYBA3vKeCkdP9hPKZI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.5-654125e6cca28daeaf614924f19721b86f982161.0_1614662251673_0.21476237511837937"},"_hasShrinkwrap":false},"6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"ad6537e89d292a05396b413fb90b01bb652aa183","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vURTxFy+SypPqdJvhR0J7CDpHEp9JSZN/6M2WpAEklT1NUFJ7Ji1xpZNmf9Hu/Pz/ozdt2pTgVuGKw2QDwpglA==","shasum":"b89701f88588063d36e32b9c58c1a57305a51bda","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0.tgz","fileCount":62,"unpackedSize":342455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcqPCRA9TVsSAnZWagAA6IwP/0q3KxlNs1NAugNAgSpU\nZxpE38RBxsvvrG7FMFeflwAYNjOkUtlYOqYG7mLhI2VpWvQ9tlAD6rIaTL8N\nWQ47wOoQ64gnjnwyGskGjGihbuWk9foNhgGsP35GrgQfkyd6lJcFiypvQqMH\n4A3sxlr32kxxYyLg847K0QtvbMcDd5KI+1Yeab0Wu1FklvH1XOh79p/eYvku\n1AyE3UgrrvQmdMIJFznC4O4JA5QFpFh/9oy34ocSFEjJ/644YSEatg4w+MyI\nEbjHUpdrQdVWhSuMDSz0YUjdJpmqqDbrABRqdzUVs54pyAZSXKzfx+uk72QN\nxvSv8hzi+r7qmZW4RJAr4cJEO61n7XpRqvJ6Aa8ZgcVbFq0J6AZD9O313RfB\nu71RQKme4K9jP7lEBw7+yl/QCOw+Jb1l7yLX8wvAf32CJGjsRha305bsfNzs\nYnSteMLCmnbMRKSqapaQ5BWm83IS2lD9sEbZXe4xhTqTQs7RS0FVY3PS3Zlt\nrJbqx4JnBq5HsgtDaBxT+mkLX46lLaDmHeaWqC+e2T64Jh1+oxE3uUeRIOOI\nlQnJTiJ8NTg4p9oYZ2S3QxvkDBZVGZE7aUIrzVprat+2QngaQFN7HMxzbBs1\nZdw9RNVMF+ET64qILVs64Yk0S7nX3nsOLJcJfuEtDVIq6qptBmQ/h7ebnGIE\npH+O\r\n=FQKf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDn1wYC/bDv+rG+N1keDJ72Of8VvfZwLJNTlIs1xhcHnAiB0VoGa9QVsb8o3Zz2iQ4xU6JLbzNnEEm17D+VVQw4RdQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0_1614662286838_0.08508843513059805"},"_hasShrinkwrap":false},"6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0","gitHead":"b4b356d84aa32580232569a13bf96f924c8f360d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-RoJ3ocPA6LbrurbZW1YgNSOZQFBUK6m2kZwL/ek3WH4X64kPFFZe64IYp+aC1HggO6Y+0JOoTAsCi7EKsxtUGQ==","shasum":"92046e16e11266d5697fcb4ad79ddedfe86a7b13","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0.tgz","fileCount":62,"unpackedSize":342455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPeSgCRA9TVsSAnZWagAAeg0P/0ZWTWSbNHuwSzaIPWsg\n8+acK/l84m03QYCgxJHsniBALuCfjusfKeWwShDI22Gnth8uth1CLgkI4g29\nRfwvDTikUam2But+B16ZVHs5JwYYmxacCiWPgzuMzGr3LCDnZa47pne2O3e5\nmTV06yUz7lwnJPTIxb6/XM4NyP6DIDGRUHzrhbh68U9iqxGqlQX/7decJP51\nfZ6SBc91iU3n6n8KcM7Ed4fwO+xy3vBilckDdMFfxzJe05wwdyrD7w6+01Fq\nkEjE1iZV1uvrYu+maOb3PdMYaRpYr+vM0y26GsP6HElbIE4skKw2Fqs7SnyJ\n+iqRA3PrxvIlI86y68XzEWU9kUKR9W4shAFLVnNxg0x551g030YzyQxHX6uN\nWhGHI+rpzoXfrsbXjhfoj47lzaYEWQOgr/GHdoQptkLT+2Z9eZV9JF2XAMJ8\nah/oTVWdxZBRtsHEhm2bT9A+fhMgb23X0V3BOSHfLb6e2FyUg2ZjY6EBjd1z\neiUUtDGb+fLPZngkN9YCpr5+Ek8JKHrBY+Mcp1n0Uit0SzT8VK80yTxJaUw6\nENhFkVy8XftEseXEvIbone/9y2pq9asxaHbxyr9/B2ZCX4+GHUU+7SH83TL2\nmfKhFuPGsGUhKnhRexAAMz0SLPgl7EniGdfTw+j3Qk906FmLAla/j4BqzpsB\niNce\r\n=y3Xd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyr5XZkzUiwlcSxt+dtxLoJrXz978WjWXu4/MfG+rIaQIgEtrkbYgT35xh33Gw6uaaVMA6AMSPHFECU5n1eGyHI6k="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0_1614668959446_0.7638615841213947"},"_hasShrinkwrap":false},"6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.14","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.1","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0","gitHead":"c20012a2630150d65a1a2ba028695698900b328e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-OOCVPnFf7T86dHu7KfvyFKxIUAzCem7yIeBE1uPbgFVpMS4iJkoF+JtlSVxCHjx0MEvGl9uylO0u2QHwQJUrjA==","shasum":"3d9d43bed52a0059770e71b019cececc7485551b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0.tgz","fileCount":62,"unpackedSize":342456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPeTFCRA9TVsSAnZWagAABo0P/2YhjnWSxlk+HsQvKEeu\nMJ5UIAMQ5ouXKss9vRHf3iBwUWa71j+6/yvNLJSypBTEyOqcR/HR4qumRYFD\nmlmAvtqvLvRCGk+ySzJnDj2xVf/xKl7iOmqkQNeqlOcRqmDbrKTVXKVccU4U\n48KhcvzN9igrlYsgISyRa1r9UXjjeoQp79+tdvuYXQtSxLswvKUOWQfZCuPs\nG5Cq9jwTrZ46KOT4xf2XBf3DqxHVzuN3bobEnc4Q+FBvdVzKcGHxUKMUQvTm\nrd48IF5UVTjZY4EnZvnzBAfNJ10bppqBPVbw3OLAZDxyWmw2wql+d4S2nnEB\nLsACDXvhmiOA3E8pNLnkE49Vq+nF6mHEivpFSUJiyqYCYcrm1NrQWsEm2har\nHZYPEm2Mu85MEQ1zoDG4L6BLWD91pamrmLdBw0WbUfGIigIkw/p3NeZOIZrP\n48BHbvCiRxZQNyaIiVpZVJBgk2M/+8TEZLJk+kFQuiU7MEx18s+dgqdBOi/h\nIPMVf7me7IYh9M3sELgCNyzhBw2e4xL/ul5WV2fvlxJnVggD30afzberPu0C\n3Iz5T7qfhDbsxlO1FOHZTqcz/eixysMRwS3i1BOpfPfRR9LZan49FmmnQ6An\nvcxQylgcam2f/li+LwZClktl1a0mHUnHYK90JSz10fiwczU4Ek6Ze5qGdQFI\ntTBv\r\n=obk+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARrEG/R9A/8+rVUifPLhfmVAKM+VSZzOvdphmDb9aPSAiB8000FXRwsIiO64UNOnrkbItEmScXPSjAlkpQN4DZIJg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0_1614668996930_0.7137654908187812"},"_hasShrinkwrap":false},"6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MmptXjmAX6veE+4OAwc/mMZlUqROd9RTbjBSpLywN6Qho2PcQPMJqzQWd6vYzsw4VBlRz4zRehKyXHNv+7WNMA==","shasum":"9dd880f73a63a241c2abd694fc4f34ecfd21b4c8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0.tgz","fileCount":62,"unpackedSize":342455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPeUACRA9TVsSAnZWagAAQRkP/iE+LcPX09kstuKNa+Fx\n4RyMcV8mq83JpEX1LSXQS8OlEZ4HlHKO+Pdz77IMqBLE0xazyWPgaFbyUSkI\neYylgKRGLh2R/0I1VCB7So+ha7fAqIaVjI5PyhRhqQlGJdcyghM/uV1ixa4m\nJF82FbPiy3ecXeoBE3RYxvrPQEkMiiHezBhDDA/qlOOmnCJTDlvqD/pJOxQo\nbSF3gaBdfMHt5teSdTOgIFCvXxs2DiybbjC4ho86Oc/vDexnnMQbjlYPnmBJ\nGtRgP9RPOdKVDp1u73odW0wRUlOIyTTdtZPf3PDJhZS+vEpjBFb9wRmW5Nh6\nfLKnmdwEFEABDI3MZIDKfiU7js/Nqx0yb3xp4qAgBDY8UulEhqwnOLzkWg+O\n0Qe+vU3L4X95HMb1gBGOIBnYZbwBzW/jaQ3JGYkF/JOIrBU0UA1AFMt+bmEH\nVSLlnxalxd4BHQ7peo7aiwmeS8nEXzP62RhrvFMXzGmdBvEF+8pM8pUZrOZ+\nVP1W0wHAgrU5/RXMljfzRCVhzDJx/UG2gghewrVpjxrztZEubpkv9v7tKH2x\nlY+ebqY0uKw+kbqXTBogKUbL9LO9VlI7gMmnF78rEtYigckH07FGoGB0LuT7\neKbeBllUE7i6E57PlfiBKyJamG7y9u4FkeePqokY5kwkz2pyjyJS8QoLKBHN\n/ZGu\r\n=qpAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoiQOZU5jO1vdnUqMjrHFCrsTINlXj77yC4LsFGofCUgIhAJ68Yph5LWeKDiMXa5laM6FMHCRWRIxJUZGODhGlmnxP"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0_1614669055471_0.45381707918117775"},"_hasShrinkwrap":false},"6.7.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.6","gitHead":"9c1e5d816477652d52213d3049ff0abd689915e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.6","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-s/T3YSxbnETCKSnOfDstWDFmmW7x5gDxf+Yc7f3xAKdg5LjfCn4fA5bwPjDK/weTzE4r0UuMUoaw8cy/nwbYMA==","shasum":"9544d0f79d0753bad8858960f79cbcce920bfa56","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.6.tgz","fileCount":62,"unpackedSize":342684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPeUYCRA9TVsSAnZWagAAN/EQAIIJsJlaTyRb0l/OVjAY\netfI32rXNH47CIdZmF4LoRAIs4Sy5bQOuFcWewHi/1z80YRcOr8qDvGJo6Rh\nSQlLJFDn9zyGRxU5AhI1QrvpiVx5SU4CbefuV9wicKD4G2YDV/NxnGPe/oa/\npIdpWDGEQLJO6y4suT4F86HOcisAWkS5qYS0V0yRB57g7SleL56WxPkk+6Xy\nScQEZ1qPXUPf5AhlqF95CcPWgkhtIYI0FQhkNuBR6f9/441u1LmLoDKzBWQN\n7EIm8MHdGWP93coYHJGraSwZAKPTOl1H/QQG6MZQvswLy3c7BVEZhLx3eraH\nmxeOGQ5Rn/vrLuwVgOpuAkO3oqH2+9oQIyBKTGCoQPmEKMQJaa4/42iJHiXj\nggZjsLQIaJdafOpP3n5fW/xEx4lBhEQ0A79TOi8Dzl76ZQ7TFRBt0Kl18+rx\ntYkqV5eKfLClbuksZAXAQyOhMV7y8gyTQbK82UkIbjtE/fiZQAL6G47SEuAw\n4qUf7POERZpLJLvLQnl/oKs4ZHZYyEm268F4K29ScXb3/NkBG+XdPtn4xGua\nT40xj7Pz3CnrRUoKGwFoW/VF3z5PrOpRS53i3O6sC3mI2WiqoYCwadI9KA7X\noCtw/JhOUppfKESEOH6AoTcyW6g/S+bZ53FTiV2DLW2xp5aWDCqg4dbAFDAt\n1NnF\r\n=yk3H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcooZNYODoZ4UBpQbOXkufxLBg8Rm8UjWv6umu7vPTWAIhANtij/HG4N2YuNs75Wz/20y2KBYvEZQS08Bc9ehiJk6E"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.6_1614669079842_0.5333853613825768"},"_hasShrinkwrap":false},"6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9c1e5d816477652d52213d3049ff0abd689915e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-CPyoGsEH3bbuJYrrov7PDc4RwYoO+0LBCs1v5aHgNnMVUNHOuXeZKvFTkNQP+l2QJebFa5/RwEdAoGhmDq1q4Q==","shasum":"4542f26383dca2c5360f1316e65058457f19b61f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0.tgz","fileCount":62,"unpackedSize":342727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPeVjCRA9TVsSAnZWagAAkSkQAJdlyvKJ/D00ho6snEDA\nmyA1MBwV2usOnxM+P+n3zhqKFYn2GQxWriuZj1bpKpgJ9LgtqPw9hO1RqS7p\n39+WTVCG8H7YJhWuaoUiJFI0VXorSiGefOQil2t/whKmCQjLOlxlea72GqVh\ndUTZ/x1cIcEwLpZxmB3/DKSjEIE++KkI/VgyLWg5Zh+1IQkHvtIG3Q+wDC1P\nrqIrjT4k6o0qNIsfO2miGzbU0W3uzbVFZPb/LWs+1v2Fvjel90NVAxOXCjsX\nZfrPi4mmYuQM9FMptm2HajdOhzyxsD7QQT3LPvnQbOzjAmUPBsV2/m4CB7va\nOTzOaqthk83kZyJyCZgHSbuCD9Vam/DMx5v9xtsSiTUfYAE3lx9zvFtonOFP\ndY5OgO5ii8rYlvFqYYCbHFQrDGo73ZHzbDe0Mmx2QyaKAx6p2ham0jrcrD4H\nl6t/D1Y3pOXa7VFNAwWaQzZUWm2AtZT86sntOrUe/Bj1kfdkFhVuXUiAgsl9\nbiJrl9HnGfbObxQhubg/hkz1bTW77CMtnNq9xQQ+TXaYiFRzCjNY2S47BcVE\nj3K8yt9rSgjVlBSENAAMkLsye73JLvqL79vY+x9zmoCDufLaEzJ/tN/ByXmz\nep/qceUDnLUVYW3QGChdXGwNt7Bk7OYPXrmGkgVrkK37dqJ1pDfo3AVivh71\nOlbs\r\n=v0U8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTwPcyirK5hwsX1aRJIOIw+o814gRMILGno+B3tupSgAiA5PdfSzLDo28t1+Bn+Z5cfv3+qGTq3HhLjtV2jFVx/hQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0_1614669154734_0.5827616391966892"},"_hasShrinkwrap":false},"6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.14","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0","gitHead":"5f1f1d2ec46e200d6fb2244480461fcad741d541","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-DG+7uv7zDVQQjT6hwJxXiSTyV6S0AgI5F8/EPl069mvq7cv1IO7z0SJhGqrYzUcS8dD2B7S6c43MqJDs4eBjiw==","shasum":"d3389e8e70e9179cfaa3e88584cd050c5d543832","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0.tgz","fileCount":62,"unpackedSize":342728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPejwCRA9TVsSAnZWagAAQh8P/jP0VZ4cbXMh9vWn3FHY\nJUZl8tzNupoI7hsqaxgs9u/95w3SRVZRlnpz6Ru27suGPszC6F9uhEsqWfMa\nn/tokKqHmr2baduLV/1wfN+9FzHzSWXt3qkGSoGOs40s88apJsxMLZHW0HKb\nr78jFMnkOSWXE1gAuLmvBf1MddGO/04tkYlFiQXyeCMN7OF09o7BAf/CadaK\n+00ZannkDewukftcye+opUrgiXScpMa7NeLO9LltCp6DYHJqPjPHeTsFChhJ\n3orOJBw7RFrJ2WMc+RXl2VF0Cq7YvjOIFfM0xlv/ZVWG+loo6s7z6Lp/CKWU\noDeNx9nKQXd7ki7YJNAZwO3Kz0+hwSRLjIsGo5DIBqWaxs1Bb3J+YJzNNN1s\naFsc5PrNqNWiWe1o95zbzMaDV913FBPAfhTfXQmFCo9o4UX4+ICCxrv7dhDm\ntQDCg4SUsI0GcQ3zDMvfLhay2eAXNHfuqbDoupFXp5oyrx0lXcI9iCbi0djA\nphX88ULEqMqw/JgjMhIvoxTOJuNiZ3ftM9OAUAlSYLedErpAKB/naRFAKWyy\n+2BfoFqw/mGCjYeDg9NtRsE2jaFuzFhd9y+KMrngzcLMIoX85CRBsM4+NF/y\nOphZ6LbE2l5/vdPLjOs5nimqNsVi6pZwQoerEktGw5MQyIqqNFZkKLpphsJY\n14jf\r\n=G6Dr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNRIdmXWgja1h2LE7UrafUE+/swhLhqSkOJ7TFqRzQ5AiEA7Grt8gnxS9QHOC184b7jCWRQ7X/j+zEvyEqwECiLkUM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0_1614670063443_0.8214483606577434"},"_hasShrinkwrap":false},"6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.15","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.9","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0","gitHead":"40b4ca98f68025144a576094e224b02c916ac213","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-/QcxuCx/8Lc+ePlw+OPwgajwhvXRw7rXzX2RITghOJwYFWuQ/cxwCqgqqKjJvwdaCld/GnsydkQvKZF+W91StA==","shasum":"99365af83d3b98e3f00bc0e0430bcfe6a14ead43","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0.tgz","fileCount":62,"unpackedSize":342728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPxzZCRA9TVsSAnZWagAAIAEP/R2U5BKdCorXx0oMZ/D2\nqgLD9RrqXFYr/urj/byywog1u4PY9D1Xjfn8Rcv7LNICGUgF9GIqigesGxUq\nj70bjeSwdr2F/NjxJZs22h/W5cgHIKkpfYEWItBsJ+kp7itdX988REBBhj0I\nLxxfcyHwgvoUNgDCl5ZmVBCuXSPaQQbhCdAoHaqNdG4qjWu1YVWmAH425pKM\nNgQUeigVwIi7yVTmii2o+diGAfEUJq0pgoJ3Im0MHOSSq3GBHiyOt0oBTqX4\nKep/bGiB3AtE1M4WN6Q2NDKKsyk0gzWZM/Sor1oL0BqrLH3mlwvunT6na/Y/\nx1j2SfPsNNmwd/kYUIAjpDQxOMMoL9Q/GsxH40PGW1IK0T+GLN3Y4nlj/FjI\nNrzOVUlAvAZ7okMu0zwohpo5OlF8mUKvnJ1VO69L3HtUGw01mjxHDzcQlgWD\nD3f4qSpbqLje8eRywEKFtijhplq8rBe4XlFx/CHH8vAUSvUuCpgI97BwmGmF\nHmN989A0MBrKoyBoXDhNpc356SfFpESN4jtK4Z8lrfCLiSOYoZ5+z5q7gWfB\nX0lLvTCwzrCPRzJJWW3AyUo6kbDr/eJ8JegjBtbMS0a2cQzkAxZeQsV8hBj9\nc6TYhRtKDNDTznuRMoUpu5/Qm28J12V4BycF60KVcxgsleuXTzKbjukyStSE\n2Dp6\r\n=yjFt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2SQqlO/qMzyJdqQANmtcYr9pdHTS2F717mqjghigN4AiAbpB20+Nwxz4aaouYQLiZRy4XjbN6R/OSCX7cZPfbxFg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0_1614748888838_0.5389540047914403"},"_hasShrinkwrap":false},"6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0","gitHead":"19671fb1862d54b99acbbf1a1c84f91c80d0e9ea","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-YeolAf3NWbV2HcQw0OYB68iA1XuytmV3vtYgePflhQfmcW0S+LZsBv42SfKamsvYIavOnMy5Bv+ON8/vfonuag==","shasum":"3e8b1b4b960f10e7e375c4e5f9787f2451dba5de","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0.tgz","fileCount":62,"unpackedSize":342728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPx0pCRA9TVsSAnZWagAAPMsQAKClIDAtQyt0zMod1+6O\nqeZZQ6VhWIvpqytHvRuLhkEPO9Ivhes0SIV62kPgHQlUMEiA+NNY1v0C7yGm\nRIRF7GaiKMQj5IkNnMJ6pKnrvp5K28wO5Do2M5eWEmy1u3Al+kY2VhLl1kJV\nPg9W9yF8pPxGhjltIer6YAAcU1G2rz/Cy1rNzmqJ+Q6syPLDTVISWraCYelK\njKMRSwSnpZFZ+wjtRCv1eM3DRdCOR2fb1PKe8JbW9BnkfQcxXjP/KEo9xZ9X\n6otWWueq1s2VsO7Qe596/V+p9WB9nES8XCraOAq7WS9hpdhUTPWgH850lV0x\npTwOZkEmIhjAOuVv15srFzhxFoi4vzEAXt1sUTonm/t4EejUzx3lOM0eGOOG\nvfOrmm8CymhhSONnbF5T1yFXnnw7gEITemC55EgNerftksoalHcP2MAsORTe\n1b6IFhrZ5X/nBPttwItncI1wzMbyYsYcAJLrO6R4hcs4Ml6edDuOao1ThMPY\nJ2yHAdUTy7gl6IbF6mMVl60zC9Hg0xW6OeCtNCdmrowushymKGUOEERRqH95\nE2SFNPG3iJt2DVkadzppxP/S5H7PXHZohksRz1A7f8AhGKMoJBWdHuI0dY/s\npFLf4AZoL8g9TudNFIyVj0kztuEM9gqe5WHZFGTZJPvoa8lD9DHh5dfWMKB1\n9yDk\r\n=dkgN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpziwp/yABGJx4XPvyUbjKYjim4W0zoXZDV/f/+3fFTAiEAyuFv72i8YWu2ctjXCMtHORcPItvvlzBZ5WHx9NlZrJE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0_1614748968913_0.8390525518311236"},"_hasShrinkwrap":false},"6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7c65119c090032d98b71b0fbaa5b0245bdd8ad58","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UGrMErMdH4tTZqEP8FQI4GVVNuzaANZAMv980J68RlLMbymaI36vrKe9Ed7ipzYiJ6HKTIiW+pfpVjgl8W/iAQ==","shasum":"4f0e5a90daba61203b5705214b6cf2ec6b67c5b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0.tgz","fileCount":62,"unpackedSize":342728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPx19CRA9TVsSAnZWagAAEAkQAKUoAcooscKKGWEeWPnh\nTAqdCynlTh5vbfbtZrzPzJp6K/vhwY0eJb7wjUZ6Wa3ja2t2tSuLR8mhNQy+\nXrgQiSXvejbl5uWtA7WBkjzqDTZpZgMGzG8FXR9JewR9i9wlhAKCRz/4c2EQ\no0lwisZvfSpUd5CqI0//4/tdSw7aow3+ov6gmub+8tonJZ5Cremc3/+wCz6s\nQCl9Zq6UiAl47SYUw5ax15rDbsoJS4D7Wrm6WmoVl4/6mWmvIgrLee3F2ACb\npnIvdOTMWnqCtIh4uy97HFMOAl+IqsbxD8y1hItD61gMrb9JcEra3HmrQnoo\npKT5NEja7ii3k+TPKuqG9QTf1Xu+gqZ7nPLdpb1h13B469XZKOHtXxUU0kko\nyedib4TGcmtCcqD3QVlCqc3Pset11/ncDvETLaiaw68sCvxxVc44YayoNFta\n58RRpsIC3NVDjLkzibbmk1HQywmiQdrG57XBhx64LOrZ9oVlpYi2VMbzyD8c\nyxEUAncoiLyc1l2viabFlUy0g1XH80jIe08YhYiQysrdZUtZZJ7M7nfm6Ozj\nnkRFmTqxdE0VoWKIEy1YObvscAMrPtwCli8S//jvID4UO5aTy5Zlql0qhrcA\nKH5tkZn0GvpwzXT5kEgOmEptkn9ziRk34rZI+gwTvSD5DK5CXz886CE2UgrQ\n7nNC\r\n=ZydB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrNDD+anlZNLNCiml9SuZp99As4QFwlLx6jztE4QMaxQIgfpn36et6r0kJbTaMYsMtMU8NTPcENLHZzxJx9J768ys="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0_1614749052619_0.18673511240499185"},"_hasShrinkwrap":false},"6.7.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.7","gitHead":"29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.7","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-tC8+9EwdJ/K3FQmfYHIKTZAVtozDcD284DDYJgtagn9T3KRXvw2muFUEMPwS7tv6AdX89q2j5AvukL7B0WPGxw==","shasum":"0db0ee981742b3f83b2ca9e7db4a1f9ac5b69277","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.7.tgz","fileCount":62,"unpackedSize":342958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPx2TCRA9TVsSAnZWagAAXEMP+QHeAyI7TgaqXtcykzGZ\nOvALn6JAmNRZWMNXen0M6dBTmZsgcpR7VhryigpJVsNryaGH3sZE6DCj9Dcu\n6nbXrEbbETfGWwTOy1BjgX+Ld6BVjaU5UHPOyfWTqJROWpLe+0Wrioj9K1Gh\n9iWNrIBBi3RwMfmdf8qefm2w+KIZRzAHFkBF6gEcN5aLYddMKuW2KoAFX7OE\nfDpo0NhwXZEK0Wyh59ecTFd7t/jvDMBMsYUufwNEt3VkCt4sL7wzGaTuotQV\nRbfJg6MEguilcP/uKAwcTg+H5bz3rYb48T94bh4GIwuHNqkgXf7KyiVW4iC3\nkGp/eLksfD95tBIh4Hnuraw5eTmOTjVyE6BMHOg/9fyDMlMEG3tzYp2EGoun\nipY9UEFvRJzD4FL9NjqvbzjqVL6JPcGmD9yCamrJZE1E7NaPkMfXovYWEf+0\n+oA2jbsuEQpAASmOspDn1I+IzOhsDXCTh9I+BaSbuNzbzl7HQaDymB/Ek0aH\nJJ5LwArEPzvqq4qcFF1E7cPYrj4nSldP/LYAQUfHHLe9REq0Q/qO60ulpuQ2\nZ3mdBb26ipOh9tTaeN8wkjgKbNVONf3oCiihj7jlQ9OxhyGjf5fu/NWVmpOw\np+kdx5JV3FEMdJ0rIJBaAk/J44iUqP/t7P+ikzA5l1DOEguK89iXjmSheUwg\nJFDd\r\n=kYU/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEw5LKFmhiuoNovYJh2YgSFSgj3zAx1VFq1H09Y8uqu9AiEAw3HqglsseNWKKYGePXahLpaNwPzbY3RpsABB5BbAuJk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.7_1614749074954_0.8355536313186291"},"_hasShrinkwrap":false},"6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-lN4qPINvf8SFAOQd3mQTxFkJ0/gHpLw1fzWd0sg9W+O2jvETC8rnlRHzfDAN7W2uVxaxwo4wG1WbNm8Zq/5hnw==","shasum":"27786c40be3a813da8070902e25bed91125a9bcd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0.tgz","fileCount":62,"unpackedSize":343001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPx2pCRA9TVsSAnZWagAA6yUP/R9Ye9Aj8yRY2Us1Ui6F\nrMoyFO39jEpAlr7h8tvFl1JI+PWXhGlfXvLOPa5x/Ej0dqDwsjPrEaYjMwAj\nDiGTXVf131ZqSi4I//UPFZrLzsGdSLavdRMKF+gMOT74wb8qyGePLaGxXb8L\nqzvAXY2yb9N8rFdy9JmgvuPksUwEzMfdkmue6kP3itGdR3/EcEnAj9kddYFE\n5sU5U3A1dcn7iA2mgNiYbX1fmxHza1Agc1DJFG/DOHoHUQ/EIVmvQTMBJuPc\nLwjXlWLUpF9dvzq56U6zdM0CmDB8ORi/wSmGCCffzyJfQm9j4JMs7H8rU2+y\nwlfYdidPlDK79I9HQECUZz7h34KSJzechrfYECXDGiNxyxj/Rec3/llaEzQV\nFhVRWqS0iw0QxBWwyzZPe9abNGHfxZ9T5mlOL5MsUy/Ci5xWA8w/BnvX12OL\n8QQY1vASnxedis5g/kWE57mGFukXFSNz0oMEJ1gDuyoDddmBHVuwM7r0GxYv\nofSKZkMTxkdMDmr3zlviJs0Hm5j+Y0fL5jegrDt2fNh2nc9gW2bkN2V4zU3l\n2FkezEztHfPdRZUWywCjpqahC4fchApOHZxZZsmF58Iu/gh3UJcYcAYajaLC\n0PbnAhwtNlmuyIfjXgyqda+LiHPTUb+aZ/kA2YQFEgtXjoxcYPGH5VG5Iyrg\ncac/\r\n=GWX/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTLn51I0HrZM5YMVTw8I1yZFk4dqWYgWD+HTUGY1x32AiEAsl5FcdSejyTWyGoEZvrRyatvfSIUUE8m4Nqop+BlYHA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0_1614749096825_0.6273807990369868"},"_hasShrinkwrap":false},"6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.15","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0","gitHead":"1fea954755bd286d77d5743b79f9ea87e8e609e0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-q4NTrS7fSOxxDXGZbZSfkDMXe9/FUIYdRpUpiOkPfiX2RlzW+YeauW4NFgMqUUleArdVz/vYGmoFLy4eWGGG8A==","shasum":"ad3a93843c1a2dc2428cc21c74b452e534f52872","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0.tgz","fileCount":62,"unpackedSize":343002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPzhxCRA9TVsSAnZWagAAkosP/020WShU+oAET5WftKDF\nv+i8c/fIcEwrUkRM328wANm5cP12Zqx3ElDPNFmhrNNH3s4i0uEHqbrxihIt\nisarQGIoYWF35xAlGYjHYTIw7jXzgz9I9EmghsaIG8bPPhHtX64eS9a0SpO2\nJyU1PIoo6rtwRp5WeliHSCO/nrrWoMZebNAzGMZ39D9z+79UmwqmVHGT2xMC\n7PkTLJUXWeAll4tZ05Pjd3Ryz5lApmC9o/rFAzb/40/SQdmcccnKVinWk8p+\nvs/FFlU8pLnZ8j62NVLqDst4NmG3at+t8DcoMoDR6LNKWVjsVhfr2v+IadPO\n7D4CNch6agKLi6flNgomj63T5naHmtfNXMsxnKjwLJD+ALZmw9CTTv31Gnba\n0WdksP0R1c8qlZVkXWZMFlRDEpAFz2qaeJJ5+i8LQdNtajIOEBsjYedDHi4U\niBLhyhTMKEPvFu9OF4RHXFsLxbCATE+6EE9IhwpXRJkgnZ59ZjkpO31PptFe\nXj1GuuF04QfZJip8i8uciUeFX+2SNFTYA7OvF5CG58QrDxZBKenZ6i2U10dw\nJANkTDgBoUatwA5rCjvBjFa7E+Hs64/kF5eDG0xtrfmDo2gHKuFkCs+gZ0eO\n7bdWOoErUDgm6I9uPNh41F9XRsESxA0rARo1AcIFj3q/eA4mLSMJJLo2tLsT\nXOCG\r\n=/t1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS82HiD/EP5wZ09rH+vlASSBjDGR4AnQYGeQRw1meLYAiB8w/WQeoptSR1gzl78hCEZME441QuFwH3fIy49IgjVhw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0_1614755953157_0.188151019170113"},"_hasShrinkwrap":false},"6.7.8-d665020ee198643e3e0690000388532943d144d0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.17","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-d665020ee198643e3e0690000388532943d144d0.0","gitHead":"d665020ee198643e3e0690000388532943d144d0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-d665020ee198643e3e0690000388532943d144d0.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-buUuQjilo46SsekNx4HkUwiWcsUJle1gGrQpN5BpH4yXmU+vJFFkEM9EEwLcPbqNO07MK8thdykdwf3bIkmTNg==","shasum":"e991462428663d6b793208f671faf250e32901e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-d665020ee198643e3e0690000388532943d144d0.0.tgz","fileCount":62,"unpackedSize":343002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQHEHCRA9TVsSAnZWagAAP4MP/jq1oJ7He+CLg/trt5WW\nsvIf5TEPnmAV/FjUBko4H/PG39ya6ZevKqPLMCvEVmvfbQmPmaxuQ2Vx6A4v\nW23Y+Jaw1kTjQll/NlGuMdJFifD4kDwkepPsNw/6F9qSm8ENo3AaN6gXj3+T\nOidNFRl2e0grwg9ScdpizO9KwmGJABfX/lZwUKaZphtzjkXhi+27NInGIFr0\n6yzS2SdLF4NTVNNZrWvRdiZ1OXEsMJ63JfL4QXwhO8EYfCKJo+vEoe7/kvBG\nIkEKelj8ueM4v9+6XF8D9LBoE3LJikxK97pzW33PpEDOsSHaWClp7R2vkQg3\nrqLVWVBQKPdUUA3QNjwi/0PqDVNNVghg5IWFyHsfOwWhJabuRe1JLNcychFw\nCgtPrDsiHxxxm5t1sao+rQpL8gTAYqyCDtw+vu+qaERwKOjTi9B2bFbZtY1W\nmmLRKmD3Dkv8LVDKxF+E4En8j8zowLcTxUWB2D31tAu+GKk220IbssJ5xHb9\nFudMgiIWbDDuErTFiyu75k1IsYljXxmgY2ivfQolNVomAwf/GP02Gg9WOZDy\npK2yD+Xyvj0utW408R2A+p9rLBmYjTM4M0Wdy5gx+jNt9kfTymwwHG1bmTRR\nEBnb09XRSBIDaqopNf171908n9riFjx1jLBQvcLyoBUfpcGWnP75grmnqYMw\nd2mB\r\n=2qQ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4aragmRnvc+XAg2F6KzdztTqhxNrBTyF85aVUC3ql/AIhAMBLV5o2Wj+S4a4+zL081klw77zg0EZuCQtL+/xsBDsk"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-d665020ee198643e3e0690000388532943d144d0.0_1614835974908_0.13159628018417946"},"_hasShrinkwrap":false},"6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0","gitHead":"4ae3b9784a532d8bb03c52a7702c00da374443f9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-3spOuzBHxntTI9kXzuVKZkTk0VJCgxzpxaRv0f8Kzk5dqt+SQMAHJdojEJyKG7rw2u/bGc2TiSuDM/gqgOGJww==","shasum":"74d8d5e4437cc65cc9f5b338e6d722d2c3881fb2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0.tgz","fileCount":62,"unpackedSize":343001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcLPCRA9TVsSAnZWagAA67oP/2XKpT7Wddb6tu4yejBW\nmDSZL82mibLMYkpPJNS2L88suhIhHxABNFEfEA/l3HOL5dvpJhwM8a5djyPW\nvD4PYKGrqiTwW4mL0hOZ02p/9jNccyznlTf6w2vOPCovBC6Pk/xdgswh+aTM\nzQFlmAIoB1uGr6CrJYe6BDBfF7R8qHsqTfPC0KwNFZpFVIpZ7i+Ymxnm89w2\nCLMWUWN2tZ4Qb1Uvh7uqGrcjafstL+NYGjMxeuElk3yGTspZLGC8pW914btt\nMVgiAkHixTaBu3WSWuU0TDckc9V6SNe9y1+iiJkvvM6ur7n4ONXpfZwJ1Xam\njKV/05O8s5QkSQ4/KKOmwwCmydFawCQRSgohdrQ3pIFsO3Xgn3AzdVY1r1bF\nSMMty6CyiA++OYQHM+y7zWzwFZWXIIVJEs/rckl/p0GX6jLPpB9MpyNBHF1L\nhNkVzpGrPo3TH+kI6xB95yYnpC+uJ65eKy6JfYGeELTm/VeFn7zla/83Gqe4\nFhx4UvXq10fvsDb4ohRXf4bxJCQAf7QeDSM3K1ntS3af+dRNlCvxAa7ovlzf\n7d6I7vQUoPwp7075GW5WtWQiXkfUx8GVVnlvMkh7L1s5EZ2kQE6ITML8QwGF\nvE0NiV2GPyefo7HgBl8Aa/5bvWRGC2SFcfL4RW4SQaUYs+0q1pYjpd+Iodi5\nVjiz\r\n=MgmL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYgAMoYHslJT0SsHAldL+FP9+IZqAB8eBx4HzB9NW5cAiAxLrUGNk6jIt2p36N6466aoGrkflaM3A24mlkBIIYdFA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0_1614922447309_0.8410853160238874"},"_hasShrinkwrap":false},"6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.2","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0","gitHead":"1ea9d29281a31211f2f1c0179200d2187f8a68a2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-oXV8fB0s54mCZWIO60KK9jTu6jxVqTUo82opBxzq15UAFldSFcgItlAZlFokqAQF0yuuppp6FEPfuQCBZ9nNKg==","shasum":"741938c7b3dee9a053a2993fb7b44cf31957b6ca","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0.tgz","fileCount":62,"unpackedSize":343001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcMACRA9TVsSAnZWagAAxz8QAIknuurmKiqI0nRydB1/\n3rnsuLoP4qqc0TZS3BeH55QbTiLOtug9cVOcsNaeG/vv3EUneUzJMcLDbKOG\nktXqIxfw6B//ZftadzrQvi+DbUziq6aUPjJOf2wq2wTf3mF9O8PdaUibBcpB\nsslz0wVQfkhvh9dHEO3Lf5tNEuMo/e7NwYnNX+8tcXcjFDINTrtnuRCFclnj\nyNAvr/fLMD21rNKbntCJffHpFYrotn5Oul85Jl4ht9rIjpP2tEtdlRitO3ZV\ncP3x44FNNojmB/7vDKBw7yIGXaZd+0u3QcZ8YVizlzuSM/og4HmEmF22gbHK\nlibMK1qRzs8mhVvZzF0hdmQ1WvmytzYCkoQNVeUSfOcyQW1ra+4ggdphNrsX\nXoCgyJPWb4miBksLzNBrvNosjm3VVpfvM8sJtGILRRA4T/m0CXdrG8P45hXx\ndm4j3+ge25UdAk7nqQnpv3ZkCxyvflaiO+M1zbddL3ZIQjV5fEsIbEwcRFwo\nPRI6YrkTyps/7eC1CcDzF3vIMxDChQ19Z9bRL+DhFa+SAa7nr3pzdxtJZpmL\nB3HLjx/4M22LrWj9zrRqo8IKKKcYpXNomRgyoGRzM1/FPLx2oSEWS5OPUpgM\nlr0sK3u/ybGSoblkCxlXY6Xp0LJ+TdiRNyiATq1IZTatcg6kANFl2nLI920o\n+v7m\r\n=4h1J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLLZyUVPTuVXW1Q1sJP6S+J46qm+dQTUf0zpiMNXFu3AiBB9wJSzGiE/QxdGGU3Gf+qb7IpX30N8WM5Q4edn6w4iw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0_1614922495885_0.5328164135240938"},"_hasShrinkwrap":false},"6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.2","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"54cb72c02d97fcb9c18538de7af4ec1734d46e05","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-hE6ffj/7721A7K2eWfOhIR+NNsGObZV8cqwKq0vimscQ13bw3LXfs9OGTsnPth+NXHQA+3V8nbtV+gtAuj968Q==","shasum":"4af07f0b38e0de69fafc24443e5427657c436e99","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0.tgz","fileCount":62,"unpackedSize":343001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcNECRA9TVsSAnZWagAAl5oQAJMXlyB7AV6fW5KTZ3mZ\nZ+xDrEs1KnAz9Ddh2u6LF/g4s14rw0HzPuY4qrVENGNE/XY95jErTyWEeJVd\nA+GDV2GFlJsSNjaVHuAzdLicD9DoReGSEpE6dMC+aGPXwsYXS7oBZa1eUiCR\nga8AdqDDFvkFYcyKhHxYJUabOSPhn4J8bxnGPZKQRnDqOLX9deuGZd2bNGD5\ng6HpUJaNDY0FbQKjMtmJTMav3tkl/gC+Fbu3yAa/xRS7woEIm1CVzq0BIXRp\nrFjGz+CiPnSFBKJMSoBOt8EFQRu9V9cGSXRuOWR1i4L4Q3i6qCvi2jp94twe\n+Tk0cmhEmANvGrfFBMCcPZm6ly+VQ+oo0KpYJuribA4LFTy8kF6cMLZOwl3I\nuP5ZBKiAFp3LdjO3hqjmwSyTLf3U9sz9MP6v4vFsmgdLcF337LVCmW0RMFo7\nzhX0ukf5gF4noTxn6peFQiZMweEuCrstN3dZ+7TTEDup6qZphDx8fmuik2VI\nORF7HXlUKmn+6hvDHlAOCe9GIfvLVK7rkEjM+2Rf60W4EKNlrAYXipjJrpiL\n7FqNUGAmGXox8HMJFC22iTnRwCti8ZugxoxaaJ6I63o6Swh0vN/oCB7WzdnJ\nfgKnpfveoixwVGUeYIxtXXR6hOINvHEo3hPthfNWN3Ou24umprDZsLIoFme/\nGBUa\r\n=yaGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJNnl4iVW1HDsl0GGsFbtVxIU+qCtKVV97Vvbz7JqzDAiBDIv/X8lSVprnL06BL10FGLLWhTTQsUhvqvKPaaMBwMw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0_1614922563257_0.49675592964744286"},"_hasShrinkwrap":false},"6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"810f88f80f96e926da323fd5867842c6b6036317","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-yfgxqwfxSqqSjFB0xGkx75yL+tLsmX97jh+deZXEBeYq8jzXekHYKhjX6Wwzt6z6rAQyhGEPAi5rzyjoCe/SnQ==","shasum":"e82e3bebb69121404aad8e9eb2113add937dfa95","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0.tgz","fileCount":62,"unpackedSize":343001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcNkCRA9TVsSAnZWagAA3rgQAItGLABrvu3Dv/wZEFLk\nymNkPCVeCeihaK8JAeI3kt2HfKKW2P8n3NYjH2/60xM63zCCEJvMKkEC52Tr\nbbZfEn0l4C8n/5kmkEN5xDmcA345pprIyTSy7uPXh+HcBp/Pd1b2hbzJ4K8n\nKBvsRTFriGa4ROtANTa/JtDrHS3WB8fkyq7RqrizLfglvuy6TXMY/kqKGOmo\nbc7HtE3oPKth/GbIHc5Z4Ljv9AzSaAhjBzmEe1/VJaYgwJD7i0+F7ToxQ8hA\nYObYSa0WKDC1M0oC/LYPBTbjGUJhhUsWRXg+/Vvpz8s5osqUychLkslgdqal\n7WfNVfBeYlmanYWId8KBYmLZea0DBCenraaf/dGifhaEm/WagMMM9mNc2OuG\nlS8yVlfCQDfZIJKDSf+wgXzvH7kcSNC7a9HfxTU6yiZ5Cj3YWiQcJVjtlx+q\nTFVOEkzC21rmNyCNCIJl4Y0w2u7oi4lpeIipiFjR+NYkpWKQAfE8anTRWH2Y\nt6y1FUyGwsTiG+sFlURB470JdE4TkC/Nc7hj2sww5k2Fk9EnQKSvY396G2zx\naYEM2q6M/uK6kqVWc90KB4XRtZKUvBCM2wk1Sg6yplm2Vdnhy7hUfYwG/MUa\n7d5At+3/jJUsq6eEUDPawJPDSqKwSwSk5jXi3MoJnDLDbjL3cLo9XHarPOj1\nzHP2\r\n=gZCz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzkMX9ikQs4+SXPgTGSJgNglUGLobC5lboTqo0fwGtVAiEAq+ccsFcjFy3rn62XgD/6p1JFE158MRt8vZ2HXf1cPyk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0_1614922595320_0.8889339548316975"},"_hasShrinkwrap":false},"6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.18","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.4","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0","gitHead":"bf5f04fa358fbb4031408d6bb82c8821e810050d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-GFAAlNrGvwMJR78ym9MDNot20o3fmJgFruhzSoWLdvniBLymp+grN71+YQNJjHVO3iLapzxfdWX9zj+5GFyx6g==","shasum":"b5e6093aee1f5460206192885debde63c76eb2d4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0.tgz","fileCount":62,"unpackedSize":343441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcObCRA9TVsSAnZWagAAPJ8P/1/4iQEfNIweiVpZYfM/\n86lBvIeSOJSIpgI5boU8A9B5WZEOv0l779fUgP/nW+iRfCTq1sRnNdPRKFcJ\nqBobGjIPnymiN2GXW5QtIIOdWZlMYSHFSo/ttLPJ1SRBIziAAwzjNtvEOKAQ\nAF1Yjysg952MQxfubd2sJMA/U1FdNG4QtYAoQdCe1tM7PJ8fcOauXBbbe6Oq\nSZCOQVfmXtqs3a+6qXSvkqEWnDnPMBOoLquvcJfVmt0Vi6E3wxKwV5awH6p8\nKpX1pbulnnruL9Gb49CWLabaFuUHsFGR0kh8Zswz5s3c6PAGwm2nUyHRqv0V\nLRii6RydGjIXXwei3I/24DG+bD93o17ITjFzZOnOr4g++bVSGdgoS/okTlKQ\nlg5BjtASRnLfSmptF5bSxyRUAcnKsluRARwtvsLRbYt97ewts3kpy1epkDZ0\nzo4p/12sC2Dx8LDGA86OBsQ/+lGx572L1EVg5GKDPtc2X5MRJK2uWmetIps2\nUm4R+hWWJgcLx4d8RRr7M7bgwduklzOnUoZA+P40S/4BugmXJgjOwCmzcYCv\nhdRzV7/TGxzg0YSMSozLQX5kHZFB82k7V3dfzNN+AOmGT1Rk4beYS9Z1PJuy\nUaqH4PzWpwwL6STu3oir/FRgnOrZNQZ8eP0OlJYfgEf5CBNPSvPpnk0bpw15\nX3rE\r\n=IX3N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIB+iH38RjJMOv+2F5E75yT9wrlJPAbnidBV4pD6HPJgIhAJp8eZ+Vstv5NA3Zi/+f3zry2tvwIY/bVuYTrdqtsupd"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0_1614922650829_0.06248382131087027"},"_hasShrinkwrap":false},"6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e8ea682197e0cd6f3d487ba5c049a7cb32464803","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-dkA2+PYcAAbGe7UFGTTuYpzaqxJ2ltlpuy2ahNJumV99zRZ2Vmd3LmuEg2YLsgrdpE0KjPLCrYbxvb883dKTRw==","shasum":"9d9cd2548ef7a7da81c34d88d78ca6b697f3e6b1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0.tgz","fileCount":62,"unpackedSize":343440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcOxCRA9TVsSAnZWagAAvQwQAI5v5JSHYG/iJ+W2IYeV\nnqgx/8cfDX7IevEXjyTLIEZDJFGl5yKbjVzIbOWab8IsM+TBPH9VfYd6e0IM\nalBZg6jK3Qt7p5kLULoP6+5c1kpAdpLnnEqcxpDLh90w0FJkk66pB2OPy5JY\n24hamE55L3hpDp/Wh8u+qdNX8ydqPqBSC9S8oDPaWfV/GWsCGQqo97PvjRfM\nQrsq4oUtwDtBsbBId/gvHcxrYk9iFIrX6/oQdxQ9mS+Ywh4WbhgiQk1SdRrq\nMTqhHvMthBVgT3vXLpvgwwb9O860KwvCxELFnjiGPDorhgmPFGZU3RrBHlQH\n6zOfLXWo4U3vE6hB7BR1H7TkRcyKGCB8s43TGSpTVqJu8ZCg+Rflh73jZp1W\n4MIipVW647YG0FhK9ryY3mgenffeH+cyqh3J9ku7dSAdXqsl07F9B3AK/MLM\nDAT94T2JW+nJtanrPrsQkinnflrpo/cA0/KU21bjAB65tLIdWX4r5w2Xy3o1\ni4oO7Fh3eNz66BQHRdkLIpVaUe3FPEUYkXX4BzIXcpy4NCKckZvJY/By1vD1\n+nopddPW+/eHwCPaBpKYD8T4dFn/hXK03XHaQnFQ1YljU1eifIhUwWAgCFmc\nb9LvXucrPAcLCi4OfNqw6pIud2YfngwfU2bKF2qztiYmhYfC3NsgQrFflYu7\ndlWk\r\n=gzdk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpGE7RtbikiqaF7u9/I3meUf7JvqrNghETDtFHBiiwhQIgJ0ABojrm9IWwjzpKXNtm6qgdI5yW7TQrGc+nwfKQYQM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0_1614922672688_0.6354423555189861"},"_hasShrinkwrap":false},"6.7.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.9","gitHead":"119c33db2e816123b2bbb1f9c24c146e844234c0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.9","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-pV/lfjzd6JYTmsPMSaTnfj/N7ivP0SQ2epOyGr8ndpkGCkTudfyaRvV7s7yp1Zjera+q+XjCmeWBssYjlfWFRQ==","shasum":"4781988ab4d4349cac246f4137788967c5e6a487","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.9.tgz","fileCount":62,"unpackedSize":343669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcQGCRA9TVsSAnZWagAATiEP/0a2aC4db3ZwB8iNO5TC\nHBb3D120KuhMBtDRb1MrxwEnB2q4g6Aq7KM6HIkABgQ/LL5HYPbI4JAvcALb\nB3zqTKYy9G7k8i9Eo9KC3yEaiA0zcmzy72hCnsevGZt8gcc16SuaEk7Ez7JE\nEvGeaHCGzpLS+lhIqgOG/MEoJX+qmImXo3Kg2yTRUQNTF2v71LAP+g/5IxaV\nL6nqWSSIBtWH5P22MzVgMObSQ6c5yMSFkaij1ehJCK2I9oMS2w4809pRi9MY\nd24ggJ+krLDYdZNmc90bQyTgNfuabjer2GRJ5mWkFveb7Bj+pBzzj2QO96Cq\n84lzArwf76R200iCBZRZeOq1OkCDmOw8AovdCAivqJsyOoc/Lo3SB/NNGdlt\n1Af91S3P9ZpE3/UYmF+iHd7ZlzTIlBdm3p1E4SXq5EYQPbPFl0wNq1BRgbf8\nMOpJg0gK8bwc8cVqHP57NcTOPtQ7PD0qzpl3lACMWcIrbTFjA8F2UNgvlb+W\ny9ccMKbFNOgN01lwAtglD3LpZqFnujyrMoAt8h1kgEcKw4GquA+eG0/eZ7lb\nWc3qoV/N9aIJSJPRvUvO7UhNvZHAuSjy+VYavi6TjWarePLxQImMo/sP4KUp\nn5A6Vc2klT/ZGOY3G2MMciIMvcFP2MVZFFaKjIlghSq8SY9Mf9cfD0TyIGr1\ns2WN\r\n=f8Rf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiBp8aFoyQOWZZmZLeEZsJs7q2a7miLUlzk70CkWMFIgIgSUE71ELmvof/6wy10ZyT9Mu6m6/1rsSlaRoS2pJFnfg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.9_1614922757781_0.41934129154055566"},"_hasShrinkwrap":false},"6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"119c33db2e816123b2bbb1f9c24c146e844234c0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Fj39j2wjGdRmyVpuGHUym6F7gpME28ePKy7rEL9BzbXkSwPC29pOtX0u5tSOA5WZ83mH9Uqwb9nuuXu+mwzsIw==","shasum":"9660ab06164d483108a94c7d7e0089bafd76d436","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQcQmCRA9TVsSAnZWagAAqlQP+wSd+DECHvBFxSK3D5ob\n3WSP8uaTNgEJ7xAutB3LVxlGVWCzdlgam4qsL7dmIE8AbOx4W+U7P4afOLZe\nmkQNNAGQkqkklVxm4clm1EDEbgTe5n8aM+A+p38HAy2xrkq8I5NmZmuYFazX\nD+SO2VHsIvXVxxQ8mq6ZGulCuwp2vorsm2P1B0VyIZNhlLfV/MKPve4sxiTD\nBIRJ8kwcWW/hYqstRFisULPOQQ/1bY1esEneVYagMPjF0HSPgnh/CocuGT+O\npbswhU2w9jhogAcairFzfZvouRk5rRhbW9NI9uPHOPAGVjRSAy63kD68X6g1\ndBtYj/RegxwNUhVcpOYeaxOGfLzt1p8eK06/qjFrfvS5txkITbCi8TYgIuxA\nTYjlFp/Vs+QlqN77v/zcgJfhAC0puz2jOnef18R1uqRO6YFa0/eegEgQdlnV\n+DVPgnStEgw6JGBMVwahEXcQrIh3ZSESvhEy7972H+uWKrgi/a5Hr1yClXBW\nGQVkFncNUWXHJnv837ebn55HfQhn0RxeTG51HwHP9qUkP4srK7iOupyT84xM\nG509+YbBaf+MtaWoutIJ2K7j2iheNk/beuStDDPOgH8bC7VqzQ8SsgdnDt0e\nEUvOl1UFBBA3YShIjxVdtUWpR39A9jA/1AGbhJ20MVzcwxEiExA7bWib8a9C\n0lRW\r\n=W2vv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNxHAYDRcdixsc6hBLoQ/vj4I1sW7t9SJ0S+ox5hI9AQIhANWFuXXF3gmrKA+7oRtloVMu0p9y44dwTu2hXlHWDnZt"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0_1614922790072_0.12919467493344983"},"_hasShrinkwrap":false},"6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.18","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0","gitHead":"be1768acff12e745b3c466492d190a1e2407fe4a","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-DEFIhXfpcyt5jD1sK0JVhjgNcfw6G4brfJ5GwXRZJsJ6/Zhbpvt+THuDApQpOreuNGhnGMvw6JVh6WtKdzGFTg==","shasum":"5786425311eb25b488f2575773058d73837bd21b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0.tgz","fileCount":62,"unpackedSize":343714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQeCcCRA9TVsSAnZWagAAbJUQAIGp9tB4+pS9UTYBJ9RJ\n9J6hlT1/efTZ28FRXgqN0zCUFxH1kf3nMrryH/wpBqyjxw0PKNRi+Zy6JA1J\n6eLzCswuuAYKtFO1cbomRnym7/XlrIPsvxrdg6p485wguHzzdGnkaBAbT445\nFx+L5pjUxdZreN73QHFKujkNcQmYv5TJdul+ihWVB1vOAgPRUZVcBt1oz44E\npQ7oPc7+nNhraC6rglPI2WdOI+IMf6/EwrEFXhlkww6adFE5BplE/IP46YDD\n8p0aXx8ncmyYBFs/sPYpWKpQ2mx8Hml0h6L3kB3m0WfdI2x2MZvzFTH4xRZR\nyvI69k1yZQMhYzcRh5NQqJSqx6EK3yQe9xDwjEx9hxzpHzxmkkLG+ILJRerX\nj8OR99O3QMpVqypMCbYcJrJ/KAY0Fx9ap3uUyYmerCAo3eAjr71BnTnnczqg\nmv0TU1l87bX9SgK6XTD8UEsgLKlZ9nkC6O7d91If4j3cqNdiq71TxvK1z9aH\njxyyF4vx31Seau25wFkCyBFDkeAbnOzfG/jFPTBI8RNkIq2XQn9m2l6R0RjK\nLw2e4eX1t7McPFNwxtZE2Ioj4mF3gQBVKFS1ZWPFL694VUxkjcZi2LtOmoaP\nwC/6vt7GZV0A3U7/TOpAbAO9vaWbv4sYZK2FXEVDFRPbmC7ziapBK7r8IyxD\neMMX\r\n=YTJ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWJHmVvYk3OgmX9zqi+wJ02uHU+VFwNH4U41q5rMZG2wIgAMTVRCyQ19EycDvBGJqd7tmqS063uRqJMQRg4eW2vaU="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0_1614930075499_0.7324662949476943"},"_hasShrinkwrap":false},"6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.19","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0","gitHead":"eb66255bba92703159257f3c736b7fca9ae3f6ac","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-CRcWxsmzbuZdgbE29YHMqSTxNnt+1DUrH3d7kQUbQHPGRPy0lAUd2C/fM4AC8aT70g1ujOo1G/rncXSH9EBiZw==","shasum":"d2077a475958859573fb9c3db32a9738e5689b30","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0.tgz","fileCount":62,"unpackedSize":343714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb3jCRA9TVsSAnZWagAAZoAQAJDqv6l/+ZGpcAYJXgR8\np+qRLIg6Yljo7am3r7K6mVH6gXwCagDj/rsmhAJRq+DVELFO7bCxoLZZMURg\nI7BaY23HCXOnjQOI0VQhaMC4pHdmbWrRiZhfuosj1uWOMuPZTbd5glt+UgPh\nGx3Fr0FcV5zOWDiw3iK5JRzKXqHkTbXYByduTBkZz1W7cHtm6SFlIdpuUigD\nv1ESZqraLS/F6dBnzypi68mrCzNEJa3ChBcudD+hE8b9Dk5TckJHakjyPc/I\nW59/jNxyjQqJ1iXmxKZtpua4Ggr0UntkYrI4nrled6lvvRM8uMVebnkAtXNw\nlhj9fPYo0nCyHYaT92QKprc1TCU3I2f1oKdKKbVbZY2cANsC5N/skCVK0vn7\nXz0yGSLtDUaZkpLoU1gHyw+1gsF6JXCv63z2z82CIVb+gBfO8c/lPlv5rjZw\nxpk9vL/+PhRLwn1nk2Lw0cNAnU5sZW5KBJY/hORFp4PDm/STTwOOsE7bKUI/\nwT3SjK/ApboZtiLaTbVbKja+EK4sMX5lIMHSQe7AukesVQBCZYL6Kg1oIsyS\n/k7sBj1Q8obhH3qp966xTD+2RRGG1DDyx+QDPSZi+vKekXoRHuAvlqe4whkT\n5h8rYY2Yt60bisipoOxwcb9K1n+lJMHGi56FzNQ+8DbBDtQPo1ZpXIX9FBa7\ngRTU\r\n=sXNk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG77RGrZ2aGav8l94/Q/rxnDYEI2UJdzMdHmVt7PbPHiAiBy4a6jJsFxs+hQd6SjNMeI0USyJX90wf6+YTIKjXC+LA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0_1615183330920_0.28962545099756953"},"_hasShrinkwrap":false},"6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0","gitHead":"3aeb12b01d2338b7e39222a412ff5a49a2a6b281","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-NnU5ddggzf5vLKGeMcY7Hxci8KJ8lm5EtA48l16beNrdE0cpjD9fCsVzkbZuQ6KpjJMSyd5bhC5gVJ/FQdiuQQ==","shasum":"9c29cee3f50e8b0bee55407ea905321fd3f06309","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb4FCRA9TVsSAnZWagAAHEQQAJUhfbDeT/4iEIvmryyy\nrJJMJTlzbbjxHYytgHcj/woPtOXfz4/AMh4uVCUwLLW1NRfxfRxd5aeFX1J9\n82MMmKWF4p9iuxAFFKU42WiU8/Ujhfr1mzzNJ7npe6+Yxb7myRV8rtLQ4lfd\nNRevA8rajTogL78Okfmwm6Q8Yh1kz25ZWWy/Ibl/ij8WxRF79x3NHbtDRtr8\njsohX2XGHGmIJvbO36Khqdvck0wiyGZdwX7InhvtTsNTwObKGDuR8R9BJjh9\nafAF5uuc04K90tM+reSU6pOrFfiDhgpsjnABEF0VD0UaxvufiNGpsX4xU2pC\n1R1jNHK6KzCyAH0drf6riPQHsVmbJKiowSTSqGH63I2hXk5gLwH8SN9Rvenn\nK1a9LJE5xc7JGDL2rYA4WyyhYCZfDKCeVP9M5+cS2JCUP3/mBapijEBvjmmS\n0rDNl2M+2V20mS890nfWRVF2J0q7PJ1eENFby1jmXxIXbSUoE56z8lDum/dC\n3F3gzSgiDHJSTmfqQ/Ou/NAOORjpxwVHHA0H3adxqxwZONFubMLuGSseXXt6\nfkNYRGJ0X1DHbEFrUfJQVJvDbbPvPNTTi/GKZIVzQEubchBd7ZnDmNHUY5aa\ncceGIipO1DSUleu+TzwAyy9hmd+oxIqmmPwfGpSPmlDgo/A5ATtOSjKhK1cp\n+aWh\r\n=ENix\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+dBEI7w16c8ubGK9HfpwgMOyz4AE/vFSj/zsRz7QYTAiEAkNRqwsK1uujDmmzLMY1JnfdXbGhMmdmBuGUzwriSvTk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0_1615183364911_0.08569338668517967"},"_hasShrinkwrap":false},"6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.31","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0","gitHead":"c664cfe294013597489edb2357a9dcac14634b54","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Sa19dm6/2Sg/r8Yw48J+AzNloTnv3WfTGbSoNAWx0/Trfo1TTHAsFPd9T5w7kdS9xZ9xDQd+duQLf7hChIho9Q==","shasum":"8e01fdfa52bd0aee0cca4b0fd2d7645e22ffe4b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb45CRA9TVsSAnZWagAALSAP/0SHp39HB8cxqK0EdVFd\nmqvBZ5aELixD0NS4RdYQhLrAnccsxFwgO+GlP22F1kjTVPq0iqtZbgwTkqf9\numEzGB2Lldr+gbLtGuEEbWM5fknulg5xvh9c1VzfEvNVAyJqBuYaGGWHYDnF\nnWmg0pbci9RPxKDIB2DHLEWJGKNS4L8KrQp3Si5zpeWLMT1BQVuGZSsxyWf2\n0xAnzqaR204BvkVcP63JT3RT2uILAH4Y4FRJzAaowrs3g4cvE/47MY5vdmZM\nfz/bfG5qQFbH774lGBu5OzK/Hk8s7jUdJeQ/Sx5d/qMii+/gcod7uBD3SU8L\n7Qn0VafkpuYcq/XHkcSzTiHVAvye2TsCDgngdZLw/ME6UAbhwrtG7vzUojmI\ntdpLQ/6IMNkgcwl3A/QtB2qK3EyZ7kJK2ZQ3RX585N5aZ8mAglomzhPrRw4n\nZ09Of4cnmHfNQ5v3XrlYiBZ1nP6Tx/N0FPcEPCvRH/r+ohgOVfZlO5Dl00l0\n6HOVDYa0Fakpeezoc08R7k+25iB02j6U+wzYq+ihIbQaucPMkyERyulMT9rx\nSTag2yJGcYUiJDWVgLjHenlBTdgQ+TL6waNXdKmFIFK8NoQCpdmcUM/+vU9X\nFer30oJY6fdec6bA45vchjpywTQnflqM0NZHAqagldvayBOXPxsWUVQTrZPc\nsM7X\r\n=uqum\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBV1oV+lQ8cNlMP6W+2YMIFkW8OjcuhBey3Nbh6AN/umAiEAjC+wAG7edDVf6R8+J5dIUFjhQm1SLHQjczmfa7RW2XI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0_1615183416796_0.42239347207435807"},"_hasShrinkwrap":false},"6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.5","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"71b1c2392f205a29b72d17d4d757be21adea49f2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-M4zhn4VWntE+Yh1NaBdvCu8HhOB1sdSUHfnGuI0To+8FhlxhSOTtPLJVqF9UrqVYLndHshzwB04vfOSL2Akc1g==","shasum":"a6d629b84959acce7fadd358dfaf9258d730149a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb5rCRA9TVsSAnZWagAAvF8P/RQix1uveJVlWaLS8Eul\n9Ek9ch4fdrPNh9kWwYpTLk9XUYK2z4WALPGwuro9/ZvVp9lVqXWKiYhtDyUw\n4tHsCllq/+8VONaj9WRW/YrCKYanFbp+0wxXIasXN1s9tkv3tf12mIYAcCR0\nnB+Wyl5hZkbK2DNmt12hYW8n2+t/IcFEG/31QcG+JJCyXv0Y9roGOjsAHsA2\nJQDn9w/2L/ZMwcfI+a6RgiL9oO5aIfGMcQxqVJRsk17ik4K8UIODVM6fvicj\nXJnwKukT2qu8FWDzdUDA6eVRnp6GJJYyMnwlhqW+02azVcdEj4ulcWUoumms\nL+ZFFHNtRi85lbsZZ7Ht37PgIFnEupRVACQmtBLcqAZT4F+ywJqwC4TNUVyS\nbDd3cH2Za8KQ/LIC6TlvFI7z1xjS4bpb8/4deNLW8ThuseLMDjRlS4ovdLRb\nR/DJVUHm4jlkHTAxTfMXc09cUDEwLv+CbCnilR/oMCTLOShrJEI4SR2t2v14\ndndahRP+cd972o947qHnHCF6Bm6aRIcJFpBdn6QJZAgUU+t9ixW2N0LtjxiV\nu4Hf2rbu1QsZmGkZB5bf5IT3GrvcR2YP7EggzPNu6wjp56tOh5rGu4xsFE00\nxb1xdWXRH9Ygq8c7HMJbLuGluyt7i7AZ9cNqeM37Wd0+ODh6dF/aUIxaRDRi\njsZ6\r\n=ccee\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk3gyJJQXqL65iVZOvN/s1sMIhbETP0k/xUnYmd+WOvQIgUOwWFbBd43jaYhIg/3OHbnULUeA44+Ah43sGC7pAdtM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0_1615183466765_0.741608750692736"},"_hasShrinkwrap":false},"6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.10","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"819885d7715be249f4e74356def725d4ad60dbfd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-LEE69lQOI6bP7Wp3iELdL8XWut5i3EgCUFbYenonwNl4+8Twjv+nkVKbxbYYGrXSfJCjM404fAufI7AfbdOwEQ==","shasum":"a1d76453ee49f96bce56a249bcd0e123d4a02017","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb6gCRA9TVsSAnZWagAAXmcQAINmUM2FkdCX9UPh/HyB\nUmyfkVAF0Jja9i7sVNT68yjMsXZenW0mQlfKknxjzKTuR30tiI7s9vr1Kk+U\n35L0H619wccz7hfLvTY0EroAh2UrFOXN1HSABh4s8KNHrix+gCzT5nKyftwJ\nxnf0obFnDfIrs2leDj4N2fpn5UTetX3a2evv4TFV9M68OPS4m0++E9Tu0/y2\n1qFaWGMabXL9og94tNj68b+yoYHvpwMaZyoQzSkZ2tzX6b1rU8akfyFyoO1E\ncJcbfZX55HTsnITTu0TpLgzh1xziv8YVOt4zsJ63mop+VGmq0y00by322nA8\nAfz3vgI1NJB36piAbZ1/J3HYAUDgbvoY8se+XbBXLXfpWmeP+Oyomgck8xzI\nkur7JyRiTwpfOLEZRTbS3Mu06JYIzECCOfebtgbpJGpKjjnMoIjKMjV99pl1\n+GUaGgM/YTG+/C8N0xNpyeQUtOztUbAfSuC6AA1IFU0WT9A+ChrehvaHrPnC\nuX8KVIu6KlNnN5/vuK3GLD76SeEXteeABPqzu3sTkZQveXKVSZIan3z9qLv7\nk4EgO7jhnj2DGu5IzcWLF058o9lcz/+04CkOLFRZa1KsZlpjIbKuPDKzzukM\nmb/w8le4eSngo9y1C5XRDg1uNqRR2wUFldRqi4lKBIMiUyQ02vpdeFY2VVbK\neqvQ\r\n=dMFJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmlFDbABYKntOFqK6Uue6Bd6Nat30PT4iRxpqLj4qzXAiEAyHInyw4UbX4/IY7txCmxckEEox8Z8aFRVl38gXJlDC4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0_1615183519926_0.1274250364259073"},"_hasShrinkwrap":false},"6.7.10-625f007650308a1d97fb921251b777f7d487051c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-625f007650308a1d97fb921251b777f7d487051c.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"625f007650308a1d97fb921251b777f7d487051c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-625f007650308a1d97fb921251b777f7d487051c.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ypKoiWK+y4Eyn108HDsLxu+v7hBROHqwr9oeKJvytL4AWlpJYfFHesXuOJPwPEuS6zFPqu0Lh/yS6Smj3e1jlA==","shasum":"11490fe565938a116b69691b4570e25a55ce5ff7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-625f007650308a1d97fb921251b777f7d487051c.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRb7XCRA9TVsSAnZWagAAQCcP/1c1RgEPVaH8UNnLDoVD\nCSX2xZWQDTlO66fi9S3DwEw+NT2A6pN+bpmqZqkG3vEfpglZfjolWU4xrbSp\n86NYyNwXX9XTru3vPIagF45+/UkqjmFt3hdg/kpHMSYU5dp/sliwEGB+PSC1\nwtdvvdx/wuHEIYcILSRO887I9MWVqKoRi51g0UTum2MONQBXsSpMy/fXvU7K\nNhjYUhOtfXqGR8GDXhPXXxKZVvj2bdUAbq/4XYFGkemHQI1fS4M4QXs0Mri9\nnXUlBwodxEqaT6fv7IM+kXrpC/n6erQLOLrDTnggUl5P0O3RCWrTNaxpkVCO\nGa1aeJprhHjzoZ2RFYV5Z4gjSh2sKUBdqxoPiCGthS/17D3j81IFlOWvdDF9\nWFCLxD4sOWkBYLfbe5gTkFYtRSFDz25F+EGznqQJbc3/OLy86TZLrLPh6KhP\nCdQZ8DbguDnYm7tGAnuV3lH32UyrksxIlcWFKLWkEpQew80IMC4z3jnSIAuN\nnTrCxrYA9YcTlx9CWmP5eguP2yYU69x8tczFE/ur7cC7L18SzLllplmCdjE6\n8mNAsC9ZJvHOhbOqT3/V0NIh9uS5CKi1rdAIRrmkv6AOltPL3J45I/I2a8XL\nCvxTwHMJ2nqBK1fv/KNRxG3RdUcLXlbwiyTjuHSE4qEVCcKNzk2HaNaGtf1h\nePSI\r\n=mIoD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZrH0uDsoxaYKb/hM5V1V/7yu+WLlOIWd8RrvqVF3JNwIhAN5R4QPJLSFgeSltXF2+5IXjIuY2ZyfiYA1FLlvZwpPE"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-625f007650308a1d97fb921251b777f7d487051c.0_1615183575228_0.07779761182924538"},"_hasShrinkwrap":false},"6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.10.19","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0","gitHead":"5505deb98dea096c4835fadde8d544abd6393c90","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MqmAlB31oFfUgLinNFlURT3QA8Nle5PO6yaYXAzjkwb40VUDWgoVpCF9nxncRBsizYWz2Xmxru3Kju4Qz6lBWg==","shasum":"4868ff4191c3baa03e904a8307f3aba5159c5dc9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0.tgz","fileCount":62,"unpackedSize":343714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRegECRA9TVsSAnZWagAAuxYQAImKa4W8wvqGHtn8DG8W\nmftANerefVn//WVLWs2XcihErjG5YTTWHIRYmAa0dBNyq804Yx2w7o9qaop1\nTrZIlgof35Mn5WNyxRrze/BOpIKjtO+iVE/JgxI3rW31LCyFh/tHDnckOBAD\nHyltfO1ckH+LXiuJn29LcZzmtQvPaGNPHTRO+cVu50rS76bvOnCWO59ZkBad\nYtBth6HD8qX+yO/DoEGeYiV+VRiIbZ8wMUYlPrM5hMKAdTld7tHdUgQCVrfY\nX5+6z3LvC4jnebea5XciPLoaAXcEpoa8SmupE4wgHeGu74RmCe3f66pzTMam\nVtc8uDO0Navb2U6AEEdegnoZr1KyXbxvlmspsEKkBsfPmpzvnD6jX1ncFLp1\n0Pqsdx5K2pOsK35BZTGiOR6c0CI6jadV05+4qDHTmTDANQ/m+y8LvsXxwgJO\nzH6+6fqFZbH80LsSYkBO8MilH9ijyPgmwBPa0tQI3KUR5UE00dVcFGjFz6yW\nvi1WYxgw+ELW1b7ghYT2VUyirC/Ey+DRdniWZbEK5ZtqNNfwb/5QiXepPCxd\nZrrFRTCLxc8P1Y/uJX8fbbZZ/hnGQQV8Jbx8SfZzg1XxCY7Jk+GldvJOqQ+z\nYFUA+KmeGjjZoG+fJgKhAgNvUWk8FBKRoTxq9ERwUMAT+O/FcwwASiXSkLhF\nMqco\r\n=Obnl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX+6Si7izbqLuiwzhi3wz5WetL3Sv+EnI/rlN2fKRsrAiEA0RnFZ1KxhbzlGwT7tTxdje1XyKbikvn708/qzA6wEfg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0_1615194115445_0.38179697506637145"},"_hasShrinkwrap":false},"6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.7","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0","gitHead":"7c5f824de8cad3df91ef5f68df9b33054e529218","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-AjvFyzWvIjJmiYV5MIPn9cP0aq1d3b0eGXfFJ1Z+nsMNlT++3mX8D8Ie3h7mYzITVvLc6AOWcYqyKch3TaIzzg==","shasum":"8b938ef17e8f513a08df86855220178050b41ef9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0.tgz","fileCount":62,"unpackedSize":343712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUIrqCRA9TVsSAnZWagAARf8QAIn7/fGqMLEi9+d3hMzh\nM/Qj3QyEDhngezh/pxVz4SZCctYq6BDDrRU6fvW+6eqp9RUAI5Kk5bBfa0QE\nVOOxHVmgfBf6zZr6iaw+gRaO5j2cNAkEStVBTjoBWZbuT3xJTO5HyWr3BPQp\nUqW2VB8F8QHrGliDAjCf2QlEzOImXvUUpH13oZdBVtOr5028QcwG4xr4GZh8\n+ZyPNAQ4qkqeknUPumSwZcNTEO69VQrAX1eVWvRmMvZ7QgvekYvaDcJz2IIb\nipqcN+j6cDFi9aJuoOjB3fYpP0OZMH/47CAUExCHONeEYSBajkFodEmjzlIF\noFkjz1bISjSSgB7aL/VPgLvNkWOZ+cDdpnx9rGVDiO2xGUv/HszCDrxCPAGK\n58xJy1eT976z6wma8MGkRCSse6FKk+diIY7NV42EhDwWpUVczD1TsoS0KwjL\n5lv3O/KTd/R5fcDWLpDbgjS+J4GBJVHPbPahvFFNd6gyuhWIN1i5puXN/bah\nH3lmdy8cRtKSRo+Vf7AboTaAx4nC3goN/0LYVbhErRePGGoyPYwid+m2+goJ\nXC4ot+JjCTea9AbBeCYu6z9U5YCOvLEVtRQpmnQqdQXes1XyFQCvN0NXBOUU\niq9KPwkWw33VIXcOcGaNOA115GhlVj64nKBWlHlw9w/Fp1DllKevuPA4nJ9D\nXZ2W\r\n=WnM5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDP4Dh+01IkiUlQkWWEa9UmVL6QGXBY/8DdsdWkA6L9KAiEAt1xLpZTxxnob14tAt4QDQuTxuLXAk049reFji0yR5uk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0_1615891177293_0.5116259567381765"},"_hasShrinkwrap":false},"6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.7","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' --max-warnings=23 `# <- DO NOT INCREASE` '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0","gitHead":"51cb942db5c5877cf1baefd36ba24bc52eac7125","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-JH5CCnLRATROCiCTEFr0BYUVGKZZ5cNV+TzoqSxpXw1jCZkYpArvElbnVvdb9G6kPWRJnJVnpUkLQd1vz3B96g==","shasum":"9fc885cebbf1622facbd88ca199a5961bf0b0ad3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0.tgz","fileCount":62,"unpackedSize":343621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWgf8CRA9TVsSAnZWagAAe3IP/3SOBhMOSwJxS41Hb0DU\nh7dLFccXcJhqZCMYP/j+lybVumP2vxqkTYNAsZbjzmnVAoYGFmtO2zooPO1A\nYHfpDeE8+4QYOS3MTPGZhs5HZSyQYeJlXSfiGPQuS/AvLXxPg7MQkqIzwJlq\ndk5YfGq3rXNhiP36SiSgY4xjw1HcjrVqi8obXHq2WD577nGmfF27A7bZZq5M\n3wEMyTNpI/rjZBX/bz1JsIvGOpFnjJku8zy7GIZapdBhx0MACb4YQGzxgv81\nnGk57VCI+R5WeHTA6CPrIzmDGxLT8Q0tkjxn25NUp7GljL1ugKDWMgCdM4cy\nJ9GR3SnzcFtYitz/fVmgqoBK8kz26coCWIqpwPtRrlQFg7qF+sUa3Pv0OMqf\nzeWbk8vgPNKSkuTTO6jxmU/fRZSj8JrqnNEqGeeOqFRJrA/X+BOlwX8Cn129\nSjIkVCvRr79QTlAvfm73NeNM+zih2YUcohkSKrmD/Yq4CmyuetdJixj2qQ/7\n0u+mthrPrdwseG6AaeEPeYKltFhOsphPEvt52KByd9XeIxLQHbRH/eAETmsE\n8iM6hxVETomunjlh+ToxNuNs8fli5eVA7jh+R+M+hUzfiS34jd3p9oDCd2qR\nyO4kou8TMde9D/zwDndH6zvsEvRqpq8VxvSKYn3V4GIGl+1k8EFqMLgxhXim\ngGXU\r\n=33I2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrR4Kj6jxjliDj3TeLUKYsAd6XSlHHte1URovqhk/PwAiBxn4D6s+lUPGZ7wg3Ip8Wtu+X1LL+46vfLF6qlYeOmsQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0_1616513019802_0.45769330748450376"},"_hasShrinkwrap":false},"6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0","gitHead":"a5962490e89cd5b6f25e49ffc51d021a0ee39d83","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-rj1C/83cP8cqmbExMq+WC2RQcFHmMUl4Qq+4RM7ApZspdncpt1DOMPQTsHyqvJUSsJstSktjQKtwG6QHSHNiRA==","shasum":"0ec49d4ae0e29a2f647737d1735b5c0cda36b671","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0.tgz","fileCount":77,"unpackedSize":375444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWgwrCRA9TVsSAnZWagAAD38P/jdsQCru7Eks4egXpa80\n1zhmiDfOXba4uj87ihLVSi5CWBcvGrM1klwvfNrNr01PA7gVo0jXEu4w660y\n+jrDIMBgUM2cqeFU6IMwQ6SRIM+mUpRg2Hul1/enWlvCtijZ8pAjq6c1/og6\ncDVcjh2MiD8dDnDhNS4TmLIuA23tdUK2+456LIJyPfkGdY/AdVY3a659e5UB\nFr2XQOYppdq9ax7yJTLxjck/v71FpfLaan0QolR+ujdrEwZqKHCpsmX+taGc\n3lHdfLkdmskjAUfMgBmJCyuEKY9Cv+CAPyH27UmeiWlmB22j+eWbi6qDIsr8\ndvoiQskG0D+V6ZyiU11jHNin4x0A/o53HK5kkFxPe209k8ddeDfnzO8eC8A2\nzXb5PNML/z8b+bmszaZXWIpQNvHL18tDHToAcW0bK//fe3w4lK0hWMFUSYpr\nhfvUtEos8zCAScUDpNSwhNW3lrB+yZWV5oEpQhoxxzn6Zr5QQyrF0nle3GYs\nLDWRtpISHHwFvozCi1jDPPN5AwP3jsmZsHZBkx2e0lIlTzeTTj5RZViAg53+\nSYxhTKmEttd6pF6bCW2xm3bdo0NiTD+w12RmO5+gaBbOzgsde6+nUERpTrSN\nFE7iiB1XMRH/isqZivj23CSi/cVZrI6/CC8us9QXGa8J6b933jWZnQm+temX\nPoYf\r\n=DRhQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHn96wLQOHRsB1ZqCiZ5kVvY4PXwUIezev2x28Qsw10RAiEAxyaf4GgQbzZYmUHknbYuC9Ufr2dv+1Tg32opUc5HzA0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0_1616514091424_0.12765990019969542"},"_hasShrinkwrap":false},"6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0","gitHead":"e26e90a2f148f8a063147dde7c00194b6321d8f9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ieONzUN8x0oAWG8ZZ+nIVF+km/VdUowgvmPqQEOX5QpouZxe05IbQwC+SCyma0QiYP5jBxG4zfhFG20fRyOkEQ==","shasum":"b4177c130d86b3127e333614961f70d8612dd410","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0.tgz","fileCount":77,"unpackedSize":375394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWg2nCRA9TVsSAnZWagAA9C8P/jWcOgpsVf5bbiEbvoBV\noabD1yN3JVtW0c4L1JpZ7NqTRvmTcEmPzFPxs8lSmq+FvzeF+6Pb2GLegB8x\nmHXdPkg5y0qiOiclzzVju7MXnTExWIkJE+5L34gzxjkxbDl/LEMNluZcLZmH\ndWywWvMObTBf3xACJ4rbfy+lhZk6pnyjRlCoCmPpNQBUTO0kSEY0iKKGRbsq\nRHOOXUhiNfVA9FjaNZEpeDOFM7aImyDZTzmHQyGqaZUacEFELRSYOXS6Pm6H\nJVUPdCqzA8IYmCEtli7osiKCX3w3PWyV/VbLVtECpeFf1fZ8kw7fNrutJ8dL\nXMD2PsYgN/BaWrbT6YC1wrFb44ezuFVzAlqchw5fPdJFDIFsNR7QpGDlJyZl\nr19Sjsz9W7pxfIO0ofSaYo5qTSEcIDezAOEYINaykHsKncQmNEfl434UBijm\ndcb//Y98e4ihmMjI/Z0WpO13rDwIGSj0HagdpRnYKDih8vTYHZlRzy+s5kRj\nyaerxn/XBwHzdPOgZNEC2XwXh+1zOl9Dpp0t5r0QYNroBG5BMN8YDYdYtXxR\nVyOCJy8YvfOze1OiP9UO1YDN1JMUC/y3bCswJQ0rURYknN914upnin0y18q/\n8SlgUQibUEmI/M9mMo4iBkchsYXnrn76clD77VnL3QkAQoN4OXHruRU6Kltp\nHMAI\r\n=5vV7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBq6gTvUQ3Hcxk4HPovPqgFvGelEKJxVWPeC4qj0+ycxAiEAw2ojnxBmSoTIeqcYti1i7LMuS52CJYx3Qm0r0vHAJXI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0_1616514470769_0.9912282437677444"},"_hasShrinkwrap":false},"6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.7.7","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' --max-warnings=23 `# <- DO NOT INCREASE` '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0","gitHead":"3814a3343fed159ec4ae329be1a62881e64d62c6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UOmqeHpXaICMunWZCd/kOYxKEhPENSihnP7LmmeBmk6h79oihfWUw6JfRlaIKJhU9Ij/cnhH9bm05D3+nKCVGQ==","shasum":"a4c114a603592a50d8fe0ae9364b54f95b72c0e0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0.tgz","fileCount":62,"unpackedSize":343633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWg5NCRA9TVsSAnZWagAAZ40QAI3B7KuyfUm9Nra/jATY\nOQeCpenfqc0sfYunIvkuQmkDOXO+WOOyfIL0pY2flm4Gdq9CewIEPTz6N/CU\nW7/WqrZvGcVpzpxcImMspCWKw7szwBqEz6cVQ1KtdWyB3ohMuBxsGn3pa7cF\noPWanADm5YBBzIOOZBcgW6fZoESCeADekhGpXbx7UIoHU1fiWcAplIFpP9hc\n/2R8q/9EpVzxQSkemEKx/ZaQdhx00aI8kxg4AXzaWWlkKViEr1r3L70vytJm\nWBW0WZPEPcjXnQgLtEdpmU1mjWa9wEDyxDy/jrXss9jGComox/L3vvlCliyp\ntDKvkJ4y3k+4ZLmy6G7ieNYD13N3/SrlqR2tXModfFPElCYl+u3Rv0B3uw1f\nM5mPIHbxZhDz9cFyFHLoByG7Lkpinz53+AlnSXGLtRdWZNckJs4QN8sjPx7Y\neZTQx0gmKfSDZofEFyuggHRYUGqM6gF4e8XHr0/dl1v18pHu0yfIFlJJZh78\nfRAmlZGbWk1qdLBhMQeEM5O+fHdAIdc/8zJiG6XoUz4iSCAN6nIPKae+CDCc\neObfcphRHKkOPnPV1GhyWrOfvr6cBilsP68D2WyQHaJqeb0o/jkFynG5PQZ8\nc0rh+2xYRQJY35qE1FaEKU2c6QjHbKVYLw5bVD3/X71v0sBAg6isKHuIUNW3\nVA93\r\n=slDb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCzYhuu7uN/9yWv3dHaJkrKldzWVxRMwRKWuFMbKJqvAiBGc+QNn4DDRNO0D/p0FOnHZsKZxkNgHwIhz9zUx3edKQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0_1616514637075_0.8801946570167722"},"_hasShrinkwrap":false},"6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0","gitHead":"8a301d7321dc873ae28bd634733042b934fd9d78","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MXzEqezj7gpGGXItQMEBgI0oJz/m+qw19eRw7mXwPQnNKqM0Mq/7c6KyYHVps7xCk7wUs3n9pF9aG1pgP8CDHA==","shasum":"c8c2b1c57207641860c5fb22b167e35e0b6fc967","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0.tgz","fileCount":82,"unpackedSize":382664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWiWzCRA9TVsSAnZWagAAOtMQAI4nRfSw/K74EBgW4OqF\nDHQch9Rn8cLR2lp/1PI9UescUoQJWpjIQueB/Gb8y4JAp43HffrBcmXGvmte\nY2cdm99C/SiWJ9XO0MTdpUZU0vIa5D2fFEVumiGzDkRD1Tvwey7EtQvOyYh7\ncplPQv5mgQ4ehGrR5EOeVfgT7UQmNKWsBthntsF1rz9PU2tLw3TeAi+5K9dy\nw05MBmUogtuN0+Nidfhdk2h36gdO7DZHA6eIFphcgvGypmrYBTAjf2oZS4X1\n9ev4K1SALp3QPPJp8Ue6XtK4fPPc5+Qq5Mk7EbhUoeZexMEfgx8zhblK/pAQ\nWLk5TyQMhxJ/Afa7E0/r9j5dX2fcLyBEmYCH/8r6raZVKddK09WioqVgT5pc\nqd3LQj81eq4FqxnxNunZAzpJexupAmsa+C4WxKW9DMLLYbZ4SLB27WP//9Z+\n/tMfvi0EtMXMjQ8+/c2cBvmfrz75nb7kpHFtK0wuOr/7jm5VJztX2k3Htst6\nh3r/gvAx/ap/VQvJmeyg3BhQ8/vYeMbMa7yy8U+XPWM4Uw8d7/i+iK5+kZk7\nKkuQ5lA7Ul8AUGD0ilpWfUmks+iDFjKxG1vEr35Z84rhBDF29s0mLKgZRjG4\ncnCMhvkIoHpji+112LN0+gX4na+Z7zQRaFj+ySur1IrEkUTI/UQBxFLpV8VA\nwcu7\r\n=GMmg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6/XPtyPslN3vMmj5kQgrXb73tkPQVrdocdcimEKcU1gIhAPqirMc7nuZjEnEZqUrWuNg9zPOaKoDpDwdQXJ5pH9b4"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0_1616520627229_0.1596194054242268"},"_hasShrinkwrap":false},"6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0","gitHead":"cddc39b083b03be70ba2573de194834812ded34d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-yKmY8q1W5/g//dUclTljt3qG7b/jmkEWZggHtdAqTa7zd0Rofx0xFqUp33fath718Whloc+sXjyPb4O1wa7/Hg==","shasum":"05fe002ec5800931c8ac08f128b03cef26267109","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0.tgz","fileCount":87,"unpackedSize":384839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWin9CRA9TVsSAnZWagAATMoP/jc2Vz07nf4/qzSGCT7C\nOgt/lKAeBQUA8Sb9sYYDWttr63t4Wq7hlcKrlsOErCeUPbzLWVqc93+oemfr\nretWOe3TwiEjtXLoaPje6rpPYwPsiLH5OmbKyyrAuZ4fBo08sqFNhbRQNnND\nQPmB3ENm1UNlJT0piSrWHsFqt8qBHRTHHc41Z+sBfdiTeKtgqTVC6GnEJN4i\nGKcrsCU7hN+OOcfRDF6hpzIiirD4HEAvOXSEaN2Nbne3WxauLbMGp0o6pxls\n1YiwjHGXkqb6TJffHz3sxjbK3M6MShn/fe5gMSmsK4p4ig8+AnnrhxRH4AaF\nOF+oXIthz5W8yqYY36wbDV4OM0UHq2KGT8ycGQ+YwcQNpjmYiA4ozfFuCkQI\nU/wPsEmFyNWAEU+wNvjl9c6FQSrVBDVA2YCiaZqlc4g2mmYd62BUUlUMPJ0H\noUE+P9M1maFichUi9Myd7NE81iLog72xady59GB+rXtISzb228WZUvwNXMU0\nJo93N6T9dsh41AWMQ3JvA9v1WBcSfMpBgByzPCfrEVRSwl4Dcfy/aUm6xD3c\nHsM80HASD/RfHPjHnZT7tpuaMGH7dc3IngQgCk3wYVImQesCV2hEWVWgHWzU\nMGe9YlbCP7dNDH8mQXdVsSPlaQ8eZUknCLxd8tKe0CtVK5EsUgJ2Dc1kdKFr\n4Sig\r\n=fCcr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXGp7tIzUNMjtOou9dfttwD2hKB8IYy5SqFnx3ArbcMAIhAPd/m/Xq5KK9aXyZ0a6WstG4nWdHYIxt7zfwP6cX0gB4"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0_1616521725373_0.7003203603988706"},"_hasShrinkwrap":false},"6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0","gitHead":"7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-YnV1DyK3lvHDpxHdPp5Ou7P8VzzofaPecggeoSRovYgXAZysZhwlO8JGpLMn9a9RXXeGsm2WDuTk09l9QRbNNA==","shasum":"28a3bd3270ab73fd19730f9dc787eed7280db0ef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0.tgz","fileCount":87,"unpackedSize":384922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWiqFCRA9TVsSAnZWagAA9FEP/Av7mUzwOOhtL1wRlCrH\nCwl6+hJ+9c7nyk2sC9aKfyLkV0blsM6tcOnA7ckFaGM9/BqiHaG5bBPQnIqZ\nWuPmYEhfmL0XnuGvVif7mpx1bGGYEH/eur+CZ3YnfVSNApEls+5D5v+GrerP\nJSwD3iRARU9oXsu9aMDF76QfkAD+KQvI4nRgpXos7x+JMGfGqQc5Bh2cgsGO\nr3r/PI2iDw8SOtTZ6U3+ZaUKde+FJbnekoZNseSMyx9HSCmYtbDpvet5kyp4\n3F0M9/tLdgOVbv/T4U98NHQfyKMRBFMLE6dFTVK3UH/gX19+a40WGaNgb10p\n55pYMlliWPjkUfUBJ1hyJUjKrjYnh3sMBzIABK1R26/zQwMCNO2NgE5nP//z\nzfUnLdIWDjFAS/FmzE2G3/vbm9ReLOzkNsEkjSp2R8cmhU1HkZdJbJLYabGp\nOSgOknAE13WLtM360QAQBai64uHyz7SKJ8lTBfx3uPthRJhdgMrVuOWwka5j\nSZNXnqG/abGsRfWE59haYXfeqB14/xOFsMeWEyMG/Gk3DbO349MQJm+pkzjk\n0GNaWa0X9r2PWAMdHF0qZ/cHhXFSDIVWV90Yp/Kij+XCyYYYhSVw22Z/nr2x\n+WdG1c94WdnrgQEOS2MtHgoj85DjOKkTdJBRkaG1iDbYg9fcsgB3dqzoMD9T\nY1QH\r\n=zvEi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA4veVrtJ08JhGu9u0ly9cPAPJ0Skzsb57tRtUcFph9XAiEA389eg0P9HvYr4zCq987U2ZNPYwRFogDHNyZ9p3J9R9Y="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0_1616521860849_0.5359734743488398"},"_hasShrinkwrap":false},"6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0","gitHead":"93cdff9df3fa7dd3cc05522ce2d663c287a5952e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-b4yU862H7e8qvMXF9/dBfZ8ZXwOP6jBG2o84qTssocxXC68dItvsLHY5WlZ/yzrx9wApenXUgdlCQyq2zooaNQ==","shasum":"13915540128344e7cbe712c9fba0351ea648c131","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0.tgz","fileCount":87,"unpackedSize":385262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWixfCRA9TVsSAnZWagAADRQQAInZXGVfbDAvyvAGCCTD\nOqdr+CzSH/ZCbptB4dc+CkbqyBSQPAtCKaTBvu3m25pNdn/TZ6daCMqrYSt4\nd9lZ94mRYjysQwBtfdB5zU56YW9IKN5CoXz7P5L9NrIQwrlaFjXbSVk5oaG8\nbFpGU83a1DldZ4zh661R7PyOVsbJo78m2P0DTALqzh7Z3U01JbQUTNYylUxZ\nTjOtqSdXthIG3cjdU/J2ykHVdn/wiNh1w3DwoqeH2HpH+p+ttnge1Ob4QjRT\nRBk0qaClzerOVVIuwI4YDKIlJlHov1TXztEPp19c+ZuvIWwMQjKMQSX9ddD0\n5gbgIjqmb68KKrA1QKubaFyRuM+UezBYLQo8rwBmo+BeWxF3E/mkUkwZp6FW\ntdhOtiJGKmBRgvd4br28SuBMYwJaRspJsF07rb4RRfvJFTve2J9ADerE6M82\n+teZmX4KXbp8BaUDiN+4+0dbhgPyLI/u8McXItfIxXRGRSYYphZ5oHg4VeYa\nvK5zxFnbf62kfpq+PR2ObZdA171z5M792hn/u0iBDUBKoKkZPKrLjeRcX+UA\n5edf0s7B/5lIoQM2s+62YBKVZQXLrPGxVrP9a8uQxFuH72owUgCRzkNeBSSF\nW1na9Hpk3/QhT7nI/5fTNr76diGEe3nqzaaYHPXN73tM0uqfIbJczQwhZgiA\nRADu\r\n=TxAQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESi0gM3+uWE2wHdF+fpsnD2Fo1p4awDt1ym3z61OMhFAiAvlRonVDy8ngiFdhWaMQiAUXIQKc19hONwZld4+a2yfg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0_1616522335148_0.9003848975822386"},"_hasShrinkwrap":false},"6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0","gitHead":"566329b5cd891534a7fcbf495bc2c1ea1613bfac","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-iAGEOf9rJIZe45AcmSjg6rcOT+vkqoPLZ/DldcRCNSVWTnOEyP+YZHYVTaQ+/gP3olEzAEBkRDafBXHUuaNCYQ==","shasum":"b72ef1fe0230c687eb7583b34526ce7d0927d22f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0.tgz","fileCount":87,"unpackedSize":386095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWiz3CRA9TVsSAnZWagAAJJgP/iK8DXk/kgd5vnanJqcX\n4UkGNVhI2Zwtvt7eZFlBrzGuc8cK7UkeAFt0347FqMH0c6x9h7O1EFgYcv8l\ntu0wlNW+OwgbnqJrqLjK4IdM1tZHI44CSmZ18xVEojm5vbFlpcjWa9B04BQp\nc1EysAz/29GOh6WqAE8aFoJadpixUzbZFWblDykYMPWlgZmYmBmDnSBDWaDS\n9Eg6sQCiG9syGYGRbx6bQO4LLWc2ichZjte6vcUrigVk2jFyxYAhrcYyim5I\nI4cavZ51xGAGeFboD7x4C+EzoCHL3jWZW7Kk4ESecSTDSQ9fkTSTgxRhI6YD\nJG4+6eo0twi6YOZseYefhNz9LHSxgmutdIAg56qcSKj/03zvDcVD11wX1kuv\n3KiQVWg3Cb492nL/DUtKluwPVWxeg9zMbSBWej+KHBywAZGWPm2/DcP4A45/\nOHLQwzw7exvC+BIIuTKwlL5VBLwWvwtZGijDW+g+zwsT8jlqSWiHWyj9cjq5\n8HoT7rtdGlxUNlmF/FcYRY2I2GXqjPHFxarUYfENwFcOinW5Ls6fEseEY7xx\no/nsPaK4Cil24ZsjTom3bK/axtXY5/CyZiRJjMo+p/AGena7dKKrn0SE1EAb\n40dgl/Z5vr2BxF0TSXNdh2S7RN9k0vQ/dZxpwX6mAHC7CdSPrONMEtseANy/\nnMI0\r\n=nEDm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8FdvkhrNEyjNkLLUN3dhChM0CmyYKfV9HxvbBlz7v1AiEA9BO+7O0TE8odXhy0L8xI2jAWADtTVep+7JFRl4u/4Ck="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0_1616522486361_0.8507511799620058"},"_hasShrinkwrap":false},"6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0","gitHead":"35cf37231ae150d3c030a3eec25dc171695d7e4d","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vpqExJPKzfw4bjp1zwZSNHnpJ7+egWnSp86eTBr6mumZFye1riR5q05TDbcZ9WY2pL/RMISuHwlXixalIfejkw==","shasum":"7091971574bdecf738a624a3a89f18e8e483580b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0.tgz","fileCount":88,"unpackedSize":402975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXGFxCRA9TVsSAnZWagAAwN4QAIJYIkNWQjAvI+qme/XN\nTcKIa6eoMu+4MVWasa1oL0mRijQ1SQO7PFST4oXBRXJ+U9Ny7wAgViyVpIYh\nUgpkKC5bd6w47tgPjIookUpvKvkxLSAUrzanq9731kst+QTOxpemRgcYpySm\n43C53XeuhtTTfQDw5k+U5mBBgPZ20Y/cH0KIIHvsVUOniN14qaxVNzCKp0XK\nELCQ7t3dwt82osSwXh3XoG5vrfjHIWKe15LYWK4ITW+/rhSOhCU58st+aCqw\nKxM3kQNAoIQVUmgDUbpivH9e91pGe/klSv2vUGwddBSiFwqwfzrj8LauiGhk\n7vEV9Z5+QX1uoyGEOdgIjO1FLvDAonzRf/kyLsMTxNcKjMomthuPFhNF4rmu\nhUWBhm1Xq65IeBZ9tmLf14Z4vrdO+LftXseEZLTF0DJsVGg2lYAgE8SXEZ7h\nVav4ys12h/IJVwWx2hGhMDcSMEYTBKdo+oCH7dx62UGA0smhDc4mqaCUhis6\nHrjKMbpC7Z5I1RNs8GUfxFB9nBYi+HJ38B91qhkuXq4eAAYizkvGE+ATBWyB\nyw+R4pLk5ld2T2PmAIqvryhhOK/AOdurHgRx99Ss8U13tmEMF2LnbD22fAsz\nFUs7OlpY+9ZxlNjamv7Lsy+FP/FZv1LcUT/1pL6C21BDZvQPggqnymioLy9+\nsRcS\r\n=qrgk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpNztsS391dDp5LG32caeyb03kubtELaMqYGkAKaXASwIhAM7ky53BWHWy67Oqa5Mg99cSMBGTNXrjj3w5zcrKz/UG"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0_1616666992721_0.2620562455025972"},"_hasShrinkwrap":false},"6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0","gitHead":"dc19f3de0797392d600de62e1dc2ca73f775be4e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-/l/bPq+vW22GHmzY3oL5v/I+lXbLM++KLg6r4ecsbTf2x3jeZg1LmYPDaYaJ1fzlmXkiGVTz+yJ0naOp7/7u0A==","shasum":"71adcae48c32f8a26a51b390451f4c3b52c6cf44","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0.tgz","fileCount":88,"unpackedSize":403292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXGJsCRA9TVsSAnZWagAAEwkP/0EdS9N7w8jickLK917+\n8j4SjvUBlAppcHKGwlXl4INHgRU6pdaDBHZYlhIaJ1FZmBXcwgqf3Q8Joljq\n9vCWM/g1jjfnIM6qS+NVFgJSBUmNcgOam0ItLEJMYIGV8mbkCK6meMNY39T/\nI4zJVE/3SVqQ8sTKV/ngSCb/hbjIsSbFtOJjFne1+jQmMghaTE1UN+dK0uoF\n0rEiyxwe5h3T65VuQVpbhc4AwdVI1WyNNFX97Do5/7VkR+lpX9Z619V9UI+k\nxaTMDjFxMsGjjYyWV+z5fcVdeQfrwi57wNCVU1w3oa+JJF7RXgFBIzpNr/SL\nh55p4D3Nw++1H9cqeKe19t+jskmWcOISP8AQ9MzIgV6wdZB15kjPLmLkC2zZ\n1U+Cov9qIEViEYjqo7M4orih+akckiRV+aoqPr+/Esu3r6mJFMF75bBYXmc1\noOhsSl5KxSjoZSvg/qgdQ3yCCNzIG7ZC76rak09qKKZF58xi4f4x2pEohV/U\ngrOof87KdPVeLoNmWFRbuu7ti04VcpJVFgr4QvaX1NJKqcSDH6blJ9zeXGNF\nF1YvV+sOi+5TwOcPZXc2DL0i0PFtevMphzyKHz6IDKBR3itIxzR3aMjprA+8\nxmOTpnL2vHnkQ55UHq2mk5J3UTD0ir10gcZD/TuQewouKgIyoI40xqDmwKD+\nze+Y\r\n=9cN6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc8mtFIRUOQYTlu/SvnwvGNeP3ru3VKTWFokxHBxYOhAIhAPUUxZPD8qwfQIWjMl8gtFOOTG0EWRFm2QAOsrxCJkTz"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0_1616667244078_0.8969479323266474"},"_hasShrinkwrap":false},"6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0","gitHead":"6ff9b89afccff44847fb412719b2b7ae3f78ffc1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ZSSXyzdLiCa+DnR4fbLCq3TafIMJWFzzfL7zrP80uzPCKVMKr464l+Q5+SvhhEshJxXpyxZX42/sK4v6IUjVEA==","shasum":"bca4569c4f699ae545e13d81fab73194e18538b5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0.tgz","fileCount":88,"unpackedSize":403982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXGKwCRA9TVsSAnZWagAApcUQAJCCsiyW08JvYZhSCPWW\nW/L1QCLRiHWicntBwYyH7uFs/AMhBV/FB+C0Z9lZHi9xz3FeHrPCPtUfh8V/\n9G98vpKP/p8Fi0TCDlEUdtswXQ5Ug0CuuYIHaFh4Zf2sHnijgvMoVusCxob+\nF8xzpWAGHR07DO4kYjvAgSAlkHYRtvYFg/y899cmzbMR+Xaizjmzw+nRNAu/\nca2f6R6pQTQZiEK8pqz4yU6rec4XU8W5azq2g5GX860A1YZnpcNO+eBkNC5L\noVlNgshDgftOIyVFS7dx21IVBfSIWMDcAc7JVqYy4FoSHkDsjo51HQ4FCwaX\niCfqiB44CeIOweT+hXy+DYmu6gJbMvKbp85lQRWKwdpmv5d0ociMitiOCCLG\nGV1bqPTUdrADqWmyznHDNhY1Y+O9Bwcg+9yh3m6/Cd4rOkGjg2UqmkE3flWj\nWvqaXAT8KaS0n9hAgvP5rWuQFRGp81wm5Y6UIFaHuNcJb1Rio/4dnrC+Lxvz\nWrUfZHt2dKlRg4Z/ts/jP+aHumuGaogAb1LGDZbshpUmtOsOMrTEw4HmZkL5\nNQIQAaJVSerTRyjFejfBipiuecm4R8Owi279UTN30B8S1rW8RgA8cHH28ccn\nvmxVGKY/1SSE/4BrKN5d+xrP5uzpiAvVcnR+7v37WuTYhMQny+g1+9JAFmKI\nP7uq\r\n=Qm2V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHujcvKcgaxaKH+EW+URldGi4vmp5RjNUycaDzPad5JgIgf5I4a3JFR379FRHQorAwWu1ht47MBVsIOlPlDlPvSws="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0_1616667312007_0.6147843430660056"},"_hasShrinkwrap":false},"6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0","gitHead":"351f15fbe3eadb76da876b6ce1f80c00ce199b08","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-TUlyOjOwlXb2TWF0HSD818Cpcfpw4D8t6LcVHqTJau74HZNiL/pn+b5ywTP9K8o1NN2SpqXiwaTPt/65/QLL6A==","shasum":"8c2f5a56a951e21db926e869179852d0c20606b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0.tgz","fileCount":88,"unpackedSize":403982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXHBhCRA9TVsSAnZWagAAlhoQAIlo1qCdCF+ziONzCvsL\n3KJh+G6E3Ztbsr7wjNWBJp6Gi5AEcZ1gFLAkbpQjowi1Ti+I+Z3LY4FqNqos\ntbPwk7HdOYEfHDh62Y5mCmRMiOq9Zz+a0NSvWU5Pizstzo7MoEpchmFVGYaP\npCN/yhfIfeRL3zL6ZGOu35EcJ4VgkniPZdRllRh6VvegpWrOW4nYTYjaFXrE\nsVjsgOTSNMrwsvsLZ3CpBxvzpFEmdfyWpUIfhAloxnVWR7h79aWgomPsdAGF\nfEjkgbKdT1x8PjgACJe1pw1Ddfp8OABDRZLpCDzmmhumofULe8JD23hO8Dch\neGLOJf4DGpSmihTx9Nb34iXUZhCzloxWiTPTNGxxezT9Kdp1KBNgWwfQr/XX\nuKhHWRamavVxKJxwEstUZGq+3Sl6FhBJN1RH/+X3cTj1kON1xtFYlUr8DRTJ\nTw2NyR4YJrl4Ys/TQBfYXApRjO9YJErO3OU47nJzKif+oE8vNz1RW29P+hEw\nDBcIQIYzw/fZgDSyx8KKUeEprIv5o7gGFNvXbr8Jd1MgAZ8prNoaM64zrDwz\n2z9OLXWa++rAhJh8CnzcSolS5WB9tq9VqIw4MkA+w0rHeAT1CnTWx+H6qQC1\nPov47pXgGSlsCKlxOxxBhjhAGV7aqsw2DWfZg3TG6fmEZtMR44Fr56dfJIks\nIzl1\r\n=oQg/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEOSZJATKhxCQkp76VBDwKcqY5PTtVM1UrSHtcc9hBolAiEAu7EkBWUSlaPzVKp9cHF+nP4NC2zpARDhK3eIL3G3/Pw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0_1616670817309_0.6232503178392308"},"_hasShrinkwrap":false},"6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0","gitHead":"03bfc4c732bba8d2ca70b8f18442c696f50d7931","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-pZpfBK3MbGcNq11tYivcd1jADDoO6UiPovdC8JxmwUM1rAh7iPyv80S6X+jsd1w60L96cNZI01f1mo7/bo3Mqw==","shasum":"b539b616f48f8b546d5f1ce804f154a48ecf66b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0.tgz","fileCount":88,"unpackedSize":408971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXJw4CRA9TVsSAnZWagAAJsEP/RVBa0jpbHcVuPlSCIPj\nyn0ue6fHzk2bdf6bxDZZSoHIC+iNVyj8eD33D7fAbPjOqAK8KSil9YNU4fL0\nV0pwj5mPoAYLmvSW4gByy5eFhKZVvVYXpgCN47QaP2TpLea0//hac/CODVAB\npbjfGktCYiMw0Yq7uFN5IeOxYkVDt0Z9cFRwSkyuaTdtlY+eKLx920fcqitR\nQlerXApBO6bPC19emtx5PcGUtOItMY21h/fIbH3jxzfeppntH/lSw5jlPtMV\nD4lIY4S6g3km0GJJ24LAK5e7LcCKxhTqb59Pm8JA+amNtXlKrZGkG8GBKgCu\nSYhbdq+J5GjDm3E7TFLdnsr2GCPp6ZzDmcrroRqfBgVig/hbmoBbdkHfwLWO\n3IWaiXpk9adYG2ASXXQaJTSvQ4GO3spRR6mglzjbB+il9OzpR6DVMBQbd1No\nrFCvRDVDnRIof7TZw64UK0vlWUHswqLmb/lsF4ES9om3BAXl2E8p/zYLcHP7\nVffGAxaJYhxN98rqAclXFk/WB1AwEUmnPRiKc//4rsrWif2kUbtNbcb3M96C\nO2AYP6WePnnoW/AnbQA1FN61UPvTBV+veHwFpTxiKqxTOzLc+sTWKYI1vBt0\nfl9fi6NNO7zvfBlTTiMCPEc2ebpZfnr3spzm0QtqDcldNMozg9Lu1uUqlWB+\nZQ3+\r\n=66uk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8/FAY4GTgzAwK8IDCMc2+DxMrUCyeL+YWAQtjJxz3MAiBOl+HW0B5QlFZMcTTpwlr+UmqvZJJ7pKeWNQXa46qxsQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0_1616682039886_0.6422986202543279"},"_hasShrinkwrap":false},"6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0","gitHead":"20f34bd82103556b49949db24b4f1480ca56415c","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-T29EWC9V/czOXURzuF4ATM+yF07i/Zs4uDGYehytKsnIQfOJAJJqSYGxKsEwEmB7PnmkejTx8ZAyReUf5+L7Pw==","shasum":"3669b4e04aa58ae10ccac7970ce328b733e281b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0.tgz","fileCount":88,"unpackedSize":409505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXL6JCRA9TVsSAnZWagAAt9AP/AsfzhnhGG5y4JDb1EF9\nMKmuonB3NP4AARCm4x3kCeNdM0YKW7dXWIIsZEElvScfav+Z0cIYsFxEtE1f\nZUd6+GbXvkQHaAssdaoEQAme08KVV63eGsfLBbWDfFZmaXCuIp5Dhs8OHNph\nFIkwiFnGtzvqdvIfzlu+H0fjnwGI9gyM1MrlYNG+O9wqqqDrSr59DAYSMSSt\n+hGp0gDCAkuPX50co/u5i2MDfiXBNWHTSlIzZNBNyvru/3jXh9O8dTUn7j/5\n6ppsP0uSxkc8G2g29H6PMHpuNzplO3qqEFv1X2LScmgNNX2VpmiZs1mOvTkz\nm6CRpxpzepezO22MB4NaG+SLgeSMqdEuetcwDsGfVYr9psooD2QZFKV8nQqy\nfeUD4B4DmV6+ygSp9P5Q91b+Ss/nS5tnS/z7sFYNrPtspx9yR+EfJmCO3HwN\nUMQiw0GzciFzGpmdPFkoyxViAYB06VxhPC9QlTOWFgnnzoxVCkysUYMx+Cmi\nNQR6SdZGGB6OeFrJPBXzUNSuqsN8MigL5j2kEWgP/SpmB8F0zVoaZAV5Zg1G\nxGbQfgP7XQ8D9XHKsVveVpSiR0/c5JW0K+iTUGSMCjx1s86OGOuFFE7if2To\niReWSZ/cQph6gBbuPE+qO2iVF8AQSF1hH4ugInd5eBTT68gblw5RyJpWUuJu\n8b3C\r\n=vKOk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcMleB99przESJ8FTtnDOQM9esNPB64PRhvNKhbfAlkAiA3mh0wlES3NEcEiD1cIHG1MRx86LjXTrP6NtVPWkx89g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0_1616690824677_0.045481818733663415"},"_hasShrinkwrap":false},"6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0","gitHead":"76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ocBa93PCVTt6xCn9qKO0pBJTR6Y9Xosh3bDh2G+mFBY+vW5xrflD2hUwb7tItFVEMkGJ7AfRRfXmH/Oap6yXHA==","shasum":"4c02bd496fd67a771271c090cca044988f5c8b36","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0.tgz","fileCount":88,"unpackedSize":409385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMM0CRA9TVsSAnZWagAAna8P+weg795xOIBG/l98J0Kd\njztRj348TlIu90L2zXT7f6Hq/2kPT7Emy+M90E2mQJWKWwXUkjGgY7YjhEF6\nNVbYftC0Wnq3piNLiOGi02M1S/EC6543OCUOpS6+HlUpF2aNk0WP9hZWSuyD\npNxeodkd8pH8ecaqfNWMfY+iWGpenW/e8iwVn8QDi/5RXN7qOgEUYqK7Jq0o\nZ7IR+O40HaEdZmmSUPa8z8mWhu7JDCDkC8FITaSSrWOmBEuzladS2hNi5XgY\nVyG5iS9BheNFBvNuBWgLYLnAJuaQNf130ewDb5GHZAWr60YxMlMzKM4FDArD\nBetPooI+dv4xpNTfjj+Qwce7qBx3B+JYOkQa0dsogb65KGl/iaT3PUdoOgiy\nkyiFoOx3k77KsEaN4mr9v2BthcHMjqumbzZf2/MhscBRaCdtpcGi6mTiUgS4\nEUJsj6fVfxXWNvw+k0Ii+YCNXqp7FGrsftHcYoP/jwskayEcI4ilsaOxUE+5\n4SIVNMNU0rlDRF2U5wXzSuk8eRKZn7SL2MvCG1+MTRHJxMZnYd2H2A/OT0bq\nh40dAr4h52Db95b5VmpYLBOUndNEBEP5LxQB7RnDifP4t0FXVjeTMXQVZlhU\ndgKOwe7iislKMY3tXi1KQNoj25y6QBNmwFhDzu17pKpoD3Ov7KiAVnNtNPe1\nvL5D\r\n=FjHX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrWJ+XlvaTe9vRy9n5EjlE8dK4/eAf1mD4HB1LZZAdvAiBukn52ZVQpzImBvnQt9/F+Y+AfzDO0sif0LtoXN3MavQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0_1616692020056_0.7680136581667945"},"_hasShrinkwrap":false},"6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0","gitHead":"e3c83bf9e52df6282eb0b3804d73f27397bfecf2","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-JkNRkgeqRXevOEbANNcT/oUwybh7KafbWGZc+bgHDwjlSB58Fsk9vN9giJhehuqmK6HDbR1G5ueVyKkIt+dESA==","shasum":"ab14070ef351e71551aa0fe64511b586da8b848f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0.tgz","fileCount":88,"unpackedSize":409522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXZVgCRA9TVsSAnZWagAAvRQP/iDnfijseclzt3VcEMax\nmzpVNpwwOQ8ZFzBYPqxF0GRQKp1Yqbias1ooeF2L0tv32f0CNgF/dJJlsVVj\nogsyXFUSYLxAYB5pK0i7G2DbUIpXwsZMdEjX+cviOmdUBPcUEE+BAlDDbOYa\nlhEOZtt/xwBKEWAHdDg/6wUMPrWGxzleKk0cDg2pz95cQHrKW/fuUlB8wYAr\nVhMKK+DOcsfQxNxB7JdeyYDdGbf9zVc1BC/lmLKT0/RUYV/QFRxEoQTvUwHE\n6YGYUHIXMngOyo2N7LnMTNU+CBujT6eEySAjc+g7/3X8pJFnSFjme4w3o7X2\nzMJ9ZkRu7w2z+FQ25oHeV0/okfNBiN67DdpGJsEt8VQVRqRTKh1NM1awErWi\nC4TeGZOLu3Ll5VZvl7D3aTCl+NXZtUnCH3nmwT8T4mL9E+fJbzZyloEiNuPv\n9vIv4dpbkiKy/3UmMwBxK5GXfeRPMnK7V5RtKVqMjG6gQnY3edWhn3nLo54Y\n7sD5cw3tm8GpGPOe1ryFVqni4w2p/FGjuNl8ScWuxSZxTDd1XUyBpSc15Fr7\nXMgruL3j5Mx6UhKyHx7MnnELsb86BJCjX3kfYLowsWlK1kHouwDM6yGiCVgK\nJTfCWuBVyLzzSc/HslJNeI5rCQ2OGXJuhuTxHURqgxCmoxpVvtp41LSwP3ON\noLjj\r\n=MN1a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDv3pvx/dKRSfglP8a/86S9L9/yzTRkyXDqZDkvz1JBvAiAmxtFG/zZ8VUQlvvEIuo+ndPeY8pLuVBd9RKG2WKNvzw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0_1616745823321_0.7297745391078239"},"_hasShrinkwrap":false},"6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0","gitHead":"88a03d9686e2d5ad321890b2ef842961d87ead00","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0Y0N+UxwMPCu7G2Y3TNnMECMVxzaN2NaSNco2NGLU6/TK4+hWjHHzIb+0XPQKskUPapJ2B2y2vbeqpC5VfPPDA==","shasum":"acd32657ee6eaf532410957b25428853f8fa4f87","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0.tgz","fileCount":88,"unpackedSize":411010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXgxhCRA9TVsSAnZWagAA7coP/2xPXHXFiRkr7KflOW88\nzeYJdn2ZgI/43jG+Tbre1kNXsQFWBrVTXQUbHU3O19yaNmnzMdQ+LCfHGdp4\nO0fMM242ZVSfnFR4Q1VUEOQzq1cdFD3OaV7Y33HFNKNPgwBSj5uu9Sc8Z9Uq\nANBf9823wzfuK91hr05obRIB+R1QspkdEcp+ODRPNinlRzXcVGAdgDSYg3Jd\nIJ8ykvFs1qhdA6CcO0xqjt1wXCYt5PaM1BIYloYVS9W1dBbd6rp9O+lnBCpV\nXLFhVLWM98ZPUnXKi1gO69FD3Vm0yOZr6RRgAV1WKY+Q9PtVsrpVryOvAUO3\nzYRgY3ebnEBPP/oRqlZizD/ikKYz6gZoMH9hR8zeHWlXA0AzrkGtQMTXTclo\nDM0YiQvqe6L/0396lP03JAR/Z686Sbr0+HnaP+qEi6kCR04qSfnO5koGE3Wh\nI7DqjOotpr2RUjV4Dgg6v+6LgROVoYaAMpzLDI0EapTzVzCVkgpAeXreKmyX\nAyFoEoEC+TKU8qG8tFMRLg6sGMVQgtFJ7rtVyF+tCi5hzsT8t+6T+BrJqq1Y\nYJvMckD+DWKc6WlyGL5YD9FBQjUKY3dwkHtcE9+GoDOnfI7v7imPOlMPCi5C\nnPabBCoiSAPVUEgjblaeWD8AKg+h7OLaYfV6Q3qO2iLy79wUjAt/bInloBDB\n6JQP\r\n=/Wnt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCErr59Erbl3OqBiA1scnkAc2pV9FbDJAlQ8XCPgUZBjgIgDExbb32rJnyqz1D4ETV1i3oiZ9zbTuMvqoCImXrR0FE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0_1616776288706_0.6481269062423591"},"_hasShrinkwrap":false},"6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0","gitHead":"3b08140e3c12d9603fc2089e4791ab25d0cb08f9","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-gxt6kLTce7W/aa9rud6Px2r2hheLk7dKgUwYjDM3C3TEFzd5byRppWHoCdmndIKKO8H05OafKwMncI2QGekEzg==","shasum":"0451f8d6257c1071c0f44866d48789041a4654e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0.tgz","fileCount":88,"unpackedSize":417729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXwRTCRA9TVsSAnZWagAAqfUP/iGe4qYA2qhsZg4dXzsw\ns/vUb5JEDTDfrvswTG+2Hq4mnKcpI5jPS51BC57JoeIKXfcav6N6KtCYQ78q\nDPbm+7dXbPYPLcQ5rulgVu+E0ATt2sFtC+dNv78yJFBTBuWZToZPoktToBVD\nW+WX3mstja2qsM61ABNjVmnxgQhLTvppbI86MyXuVGU3qawWYs6gbEZ2ajkn\nndNlDr+XNkshRahFjv2ztc23FKgL92oi+P8NQfYZPvW14BAzY31bqxZ3WXZN\n2XvfsUQtyl0cQT57Y1YTn9YtTSxjHaw39W+irLABlb9pqMsdWglmh5JqeSGT\nisY9UQ/JYjImivKm/CYQ4eSrtHsUK1NX6cH0xvu7fulVii3zraVhp0NcQtVj\n+FTa4jVuHhnptPE/sdi/t+XfSw4s+nXFCS8W3NRWtOYKH7a++pqcHNdzwphw\nehTmRrMjUTxchrBw3rPkZLi0PakrR/M9zMQOU7hg2SQ/FDU9uRNx3ph5DpI7\n4jk4TZayZi6ZbGEdW3yd7FYZpckfYFJS9Z5nj9zUYRXJSV3FQxmEhr1FJ7mn\nntYecwRmG6PmIBVhTJt2LgIOIAuSJK0kTRAhk5H2luFx1VMMAaktKSgt0aJ7\nHiJ2HKVEQE+wjHDjS3W8KeC4xde8WMaseQLvL2M+EMEmI0NWuNxhteetpdDW\naSbV\r\n=ZdEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKym5Xzo1uC4AGhwxh0XfpElTdqM2m8r1zUqeb5se1MQIgQLZbC8Mv689kGhVFEtfAuBqvmhVQImbDMnxDzMvaNKQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0_1616839762752_0.3154572236505979"},"_hasShrinkwrap":false},"6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0","gitHead":"ad93cad4f39db39bb23a666b37cae346f1abdefa","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-s92y7RmyCVdJSXWMWFSEOIfOrIqYGQgugs3ZD7B6Eu9+e2nMd9RDp/nynrnSf6w5TEam6Sm22QS1VoKWQhzVzg==","shasum":"a5d58de3e21ae5ce894225e9b69fb77de4189920","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0.tgz","fileCount":88,"unpackedSize":417447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYvvICRA9TVsSAnZWagAABXUP/1l/2ISN9Nz4gmrZXguQ\nrcKrl8J8BVwhtGKR00QeUvvfkxD7QBjY/XzrMRgrtyoi8RABMfZyJdx9nK57\nSWqLPjxqGtKIZJr5J7AwGXJ/pMZ131o8wIPIAP256VB/F0Ac1J4/hQTG2jHL\nN6QyxE2x2ge2brHmYLiA8F9elvVN4SSNF2+zs+XnJJdxE1PgjXFbBP+kQxHx\n0RR01dcTgazMeeR3KjoRnAoSWTC1x+Ot4iTDrOqV0oIeNCIE9F3sxCrrfqKu\nX/Zhdl5GkAuqax4vFI81PjcxYdMn6KitherTyDhDWfzCIl00HP4hRmdccOad\nukHEhTEnWvup2jeUVhMTWVg9nyGGA4pttUhpFa/mGFKQtkdZ14TSxpH/SkYj\nO/ebWebIC2MMaFIb4+AnFSDorwEfbft1y+He8HGhL2qP2QSdfG2ZlMplibpQ\nEyaeUrc+1t3njHK2FKge9evMrxnDKz+fDvhS8Q7VYOFGGsZAs0kqaMNpEWQs\nHL3XcaYlm3vpJfyPjKuCK3gxJuK0hYdSkT0bIUBy1IQ/ygh9lOucyy4gwvMG\n/frsNnXH3RvdDMwDk1J58+k/kiAh5y0Oe9XepC+oz0yLLF45l6/Rdp22ndXF\ntMw7/a7zCNLVIQ0iSMlmRfIV8SjV//M/1eqeGVKax2WxfFLiwlAfcls/bg2J\n3JbC\r\n=nr7o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE3CES1HptQ55mQjnoEQRkNh2pFua+y7eo+owS702dZkAiBsLupkYc7WrMt7eF0Z+N3IAMh1AfgSJhgYAikXxXg1QQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0_1617099720016_0.397247738804573"},"_hasShrinkwrap":false},"6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0","gitHead":"3363256f3ae427c766a78347bfa52f03ef63ebe0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-8lhCo6gOWg6rnIRp6SRZEyp0Tyc4LAH607Uvy286Bs/Q1Bl1soNB9l+1ZmrxzeAlKGaMBshrvvzfWzkiHoU+6Q==","shasum":"e2e7f0892f71f1ea3787ac97d20c419a29192530","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0.tgz","fileCount":88,"unpackedSize":428294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZaoACRA9TVsSAnZWagAATq4QAJ90LGCbiDAGGwGuWbWA\nX8VXUFfl/5t9RY0L4ztjZENF0nPRA63oE6igjdTF5botkMdSAJ6sYM/04s2D\n4Wp6HaFQST9Q0QLZ3mDOyXg+qNrj2zu0oimyQzaH+lMJprmXqWiiSE8Nn3EJ\nq2eyUyCzhSj2hmlm99lzFJ6wojEIFMpwssBhU73gTefHYU5HB5RRdlOzrlBz\nPUYa3+NW4BUid/ppM2xLA6v4sYdy5lx3yXvazGGTdKZOuv6kIvl9EqJXmolW\nF/1xi640kI8F3G4I44T4fWg7x6GSCASoXC7XA41FhGiUGQ43jR40rYKWSSD8\nAZ4UHOjEQmxeJE6CJXr35+X6nL5HSxVqjqzmqoDPSdiHmDVk42CvEhLl1FzF\nMHgju3dyJK4UhOFJW78mLVnhHz4dbS6Klj7N0Tb2haOS7SENYWEtnuEoLH6+\nDwBlGZjgsNDGveUBuBaNs2QnfXsMCsy+Dgts6s/ZVhg4vI91YtJiVcCHsatn\nJWw0oD+Q36Tme7EvkEdhuXS2GRqn42Q/5gC61YFqdFOoexN1qvlfJm2/G0Gj\nt8yFsfz7Vtz+goiiaQsMEaNxnuqwTDvsE7YtOJzqAi5uYgspMde+eBjOeWLI\nEuljPPPsJC+IiFgTWj9fjuOTibUqnGQbI16jaeDWWX/tssd6ZBlNcVnA3OO/\nZZ3o\r\n=5zlr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIATWDQ4oZM9tUxMnVxwfEWyjHsvaM0BRLl1PafF2SOKcAiEAq9FFJF2EiNd56eJzncOfnaLHno5irnwJ1aEOkTXZ3DY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0_1617275391971_0.042614355566308104"},"_hasShrinkwrap":false},"6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0","gitHead":"8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subsriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-AVgkAvyhSVEkUPRu/KPGvOZbqKCNMWs7VmNvMZShlRgpLkwLNBdb5kww0XZVN8h1u8Mqd8ErneF5jei8PVQDnQ==","shasum":"02373cfa7492b81fe86fed0ff3bc11ba61f0e550","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0.tgz","fileCount":88,"unpackedSize":429871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZavVCRA9TVsSAnZWagAAf1sP/39P5C6OQEwq6hLHqs4B\nw939Ldz+hDDCx3gwIoxZqS+mXOT02kPi9hAhvCsZOaPSxT39sg9/R3GjOwDF\nbUhxKsZwKT/M/EBACe1BHHWb7AMEW4QAXgVWLnvX45eWxphAJlnDEDihbO8m\nKA1bIYtuSvQBNjd4pT6RCHYvWkd/4Fm9Oi8jybIB1mNiirBpdk3djk6bxmmd\n8iOR0GS852/hrCLUt+ep5H/UGeaEMVC0vZAlQyU/z2hTYeH+9OMS2A4ASA1H\nObFgYQu771imYPvlsu9lZ++0foMR2d3cdiTwFDXhlfh+zdJDZ/kH2hO985Gt\niGlfiQXilQ84yTPx4a3Brd8cr6ChT3DxrVcaRD1aZ8POko3dwCJoC/lt5GUX\n8GhYyex+G4W912QGZo9pJypn0ZjUMZ4d45choD8OfMQT+ludOOaNYNr0SHXe\ne6cgq/DvMsqYYKtFtn14t+5rtHip917bIpm9iZtpOjE9AT2gkutRy5/BC/bU\nQSzmql3uXM1f0Zjp/Hmr9ojBMdCExlTLbt2p0WmnsmNWoR1y+sr8MK5cKouZ\nunx4zFRHZJbLpKEYIOnsMDElAzJfZaV0sZiuYf2wSMnaUzIgJscPXVd4O5i+\n8AyNChKsGNwX8QGti8uYJrv7eqV8x2hFLG42vrYKrnviXadhg+IE/x1y2aGG\nZ1Z/\r\n=eZu1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPCn3vJyXtmk8axNPfrR5xohd9kdbn8hm8i6+jY3WzyAiBJ1nQVS3VB42D7VoI7NL3jhVhOvJ9gTzNFrM3WVWmTDg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0_1617275861170_0.35586087129797717"},"_hasShrinkwrap":false},"6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0","gitHead":"853d124c89b0c5924e91fadce80150284610ba74","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ZpaGyhCKIk6b1d4xHmFk6kehmJCSN7BlJxHPAfOkmkV5Z4hkdQwGb0N8CRCkik6umokx1OpZ26oBqGAgTXmEaw==","shasum":"aab689667f6feefdad01f3397a8035a4f64025e2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0.tgz","fileCount":88,"unpackedSize":429872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZa1KCRA9TVsSAnZWagAAf34P/jTmxh2nh1oAli9VySVU\nPqZf0L69PRc65QHE5rg48PTRcCFWAh4sSmJS1ybWkMx6/DD5y/uww40lMIqc\n2pJh8hCdUGT2ibpdE8AZD72siGwHZrdMOrRjkj/vyfp2HliMKjtVg20wvPGQ\nAp3dLtoYCDwQUlN6YbeRrKL+NvYN4VZrK4o7eUawm35OC340NyOl/F9x4jVm\ng7t7lAYvyEEKAppuBwNXN8nj4Wt4yIDu76J4u6qw+W08anR7o0gMmnDYkPzc\nAJxlQz70mvO+USx75sICDZN3aYP1MNVoz5YEsaPNanHdEnjsTprRVmcMHvtV\nsMuduizw8aTUvkFhLU60/PHK/dzjEKvjU6CRUirVwNJkXn2lqGFcTdFYN+7l\nYKUFOWb9aWYN37B46xMv1V/rhPri8MudBBXqJVWLE11zNBPmPDW/e/7/zos/\nvbFshKszRqWFLb2LVv5QswvS3ZCQcAyVQ4yLVIqY65F7NmRGd56NLpBVx/pe\nwbrqMKHKQ4H2PODe5GRYowHfF2meJ9mzn3pQkWjF1EOODjuHB/YhIz2kp5pa\nUpi7UEUzL3YcSsjM9V/u7M6pcnIyVF8wjx/n4vOI76vYJt3KtrQrpznK4NUp\nvpuweWowMOSIcCM1iNJU4Ha0OBPTdQ7bRMa7qbrU9tMr5DhiZ6In6bdwPDJj\nLdpt\r\n=dqp8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5F8Q4czWAqp6rr7U3QF2Bh4Rx9UFSeNgLnoXtIWzRWAIgX94RxBmKRxs6BgXA2sSHZwVquy8fAEaa+pZ5WdhZoWk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0_1617276234006_0.16519704879049413"},"_hasShrinkwrap":false},"6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0","gitHead":"d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0UtZRh3gDe5hu6vmPWqFd9jCBctd9pP7KpgzWK/eab7Gp2Tk3c419Slna76GXPAQ+KUWWGQVqg0Y2h4/Z3Wu1Q==","shasum":"6ea2adb38ab4111fbed73860078fbc8ac80f9dd3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0.tgz","fileCount":88,"unpackedSize":429912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZa2JCRA9TVsSAnZWagAAf0AP/0a7LQmVF5Xz5lHNgc2O\n62APWA3koUU8Yb2VyfuVxpeiA2vxSaBQoLTWn8P6Umz+8vilSCGvIDGmd2pG\nIqqPaOmybeTz7AHEJkV+sOC3BAF6MSW7FZ8JLypjew+CAEXbV//1dNcBQ5h3\nyQXTGDm2OeZLrmID9BRcFidrysME/D7XOVJTpfRCDMHdGHgtQKExiyoN4YxC\n5R/qEHwKuxik7m9BgpaLUMcUIDfEtLK4+9G/UTwyUolzQQXtcCjbikdq0pYy\nD3bGEBU21nX1Go+OCgTvmhSuIAzUcQ9KE0HXvJPfSeDuPhr065oMafvcSfju\n7pE0m+7PEz81XdMod9y7aJctb/Dhk3DF5jHdIYVQdV+deFD1fmJb95UrwvNZ\nBleKs4eahh0hA7ZqqOgQpWLAIuhxoSVuFmaLRaIw2fKRQnbeoiKrcmQwYgGg\nKxKArjEXHRdfAvTR0nIb2DKT3APK+vcNb5kwt2ycjv/TnwYywhi3FQFhVg1z\n/Xz+X0fXUn1CnaoqhuWKyg5hwQE8NdVWjpXA2XxD5qrQ9hdTF3CQVc++1lMe\nNpGe/msDAxPSX2gukYrD+Zw2BGp4yujNwB/p6U+BHguU8Cx1AaMl0swhSSa3\nDFHWfmkINGJSlvrSiZr67C51x+6goLy/8MtZN3L7htQackY9hMYMrCTVSYd/\nL3jj\r\n=cgR6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTutZariGcpq1xiNsFxVjcFjvj/93Eq2baQSz3AqADYAiBY4krOuvVm0WRh3Os9VeNpvLHy0NSQ+lgRacyncuL9IA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0_1617276296685_0.741675120588843"},"_hasShrinkwrap":false},"6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0","gitHead":"400994d0000ca68a3d9552a2d35a1f14ced6f092","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-lrDoc/laHI5lfWFx3W6mO+5mOYv0kuD1EpTH02py8u0DGDh5sgxxj+E4vY5tkYnWZ0C92LfndEtcjdyOxwoNKQ==","shasum":"7e4d399c541bd0bb54dfb02702d22db0c75fb5d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0.tgz","fileCount":88,"unpackedSize":429990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZcQMCRA9TVsSAnZWagAAFr4P/3jgFSaaVZ5TrkQKlnZg\neYI0HtOUDqA1rBQ4zEDQrTLVcgPYud6sseXw+mduxojstDRpN9kc+i6WK5/b\n6WA0CQ3FBWm9P0vyIeCIJehJtFJnvK/QpPugbgaTHax6bsSgSfQHIecRZQK0\nvQ0sMd7MNA1+ZxUEBjKQaObeZGl7OxBUx58Afbpl4iTDlHlRGxsYUATFI8ZR\nXmFrsMC1VUuHkkUf3eMIgqc882xVT+/26HZG3kbJiDinXmRzG7tSdGFoOLy9\n0TN3wc4xdvZWYUPb4Q4r3B5vOmLYMGprsECOoWwsXB1QFtNPP/7+ThJrn93b\nZ9QuaJJTKXB0+px9tROlop1fy74W656dpn4n1rq79Slvd7MBSIblX0ANJJeg\nrWDrF2fltoVp0XlWanXhx3nT1tGDwSaloMXgNNaMeOn2acVgjXq7lqrx93oa\nrvRgvHrorLT7G8WgfAaeD/zrl0S5Rf1iWrr7dntTF5BlB1SVHDbSMozxGuCe\ng+us7fkuJpiu468UF0wDbqKik0jiH5cYI2eTrAEj4uFOfKGkMnOvRZC/ii9Q\nE9b3SSdY9KDXLVFEPITAR5UUwQGOQHrYa5DqR/6oe/I7mKFV59h49z+36PRR\nRUECE6NK2lqXzsdPeMJV38l7LVpKp2jIJHPZN0we3OHRsTo316Wj7UtZyHXO\nYeLf\r\n=EfDe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVHh9/W1CJ8qTJnuf/JHPT2vkcvik35kw1XaGhgDfREAiEA5zY9WZqFKC8tWVk9sOYO/2cxl/xe7ha0A5LMw6fGgvI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0_1617282060196_0.9311374642127752"},"_hasShrinkwrap":false},"6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0","gitHead":"12d09b85ebd92303cef322f9b9a17977e661ff40","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-VS8iFc6OMQUCNThhdGmaKv+Yi2M3GzbplRslV1P/0YTZ72/lMecwkwfdHOwyBthhtkXHcn33AXTiNopZtrKOfw==","shasum":"ae8d32080b331d9b0595638e2ede01386d498569","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0.tgz","fileCount":88,"unpackedSize":429990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZsWgCRA9TVsSAnZWagAAkyUP+wT5duVYxMP5DW5Vrxvy\nYkLOC2Y1GBvGsFVNL9V0pkyFgFANv/67u5C7RoOqRWc8wG/LstOY5qJuZzQ3\nirEbmmAhHDZ6+1YWzzOGQz7Acs91tNM/0Sf7/3IpS2GzGUG+DCwOsAffH3jX\n5wf3uD0rXqdQehsmS3orbookW3/59D8Ailmlci8Z4xvvj5oCk26tjqNcu567\n5ZLPhwn8hJcuXCrv4Hz4t09mAB8Y1xmJLJB7zPysY90NU7Qef6BH4lDol3Vh\nw3YsEcGB0h6MsrFR51NohQ2X5kvXOM7q/081yzo1IkO4yyORuJ0RLsq9Po60\n8lU6ZeClhkX+0c/GrRROr8D66tGph/KOngQy9aVybqoJF4BPXPr0PsQK/KMa\nhHpBhwcISH1j85yNqkIJjiPknOVzaRpNtcD0ym2rE7+tnNcEyraEXAX5LUNB\nYVKOqf0iF94VmWKUoT4qeYdxbgQUrO16UIVqCOnK77+cpHkNNoKWgcK30U1n\nMoDh+ZzST6P8LMgcPQ+wcW7y7IYETbV6seREzUoRjVavYyO91xz15egP6je7\n2gmSseIbRn4wJ4WqGBCG9U5f3Ps00TsmuOK4vV2lHtq4W7hTkaZlzfEgXXbb\nLg/Kf7Htrf7x8eN8bZlnsEf8sjHhddfY+1KM3u5Rele+4vFbTLmdxLpWcTu2\nDfCR\r\n=ML75\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLjD7mlsWE/urH6ioG8OKIlcBmeQktGHgX+zlkCHnw6AIhAIFm1XW+b6J7rQ0BQXSvaARvvfCQODcAnnXgzklqPqFM"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0_1617347999750_0.02074352122836709"},"_hasShrinkwrap":false},"6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0","gitHead":"963e7b70c191638f33c9925c7b5966152381cdb7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use projections\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.FromCanonicalDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vOuRwpt2imM67+yKM5rLfnIbUzlTVR6EfJH5ePGRzqm0/QS/tEpg62TJdlitGBtSE99wxPjGTbJJkFHjsVknqQ==","shasum":"845e1d3fa2d4ec200aa53407c8079fbc89a71856","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0.tgz","fileCount":88,"unpackedSize":429990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZsZLCRA9TVsSAnZWagAAlBgQAIXSnLhLDAoURGOcsWSM\n4EbnHLVeh7bUbI5Ztb1DzFarVmnUWaST2CeHqCUeZEH6eFTnQIlq9Vz0YeZo\ngPHiupD4tR0G7KCEfdvpyPFrCggss5CkwBq7F2o14peOd9E9x1Hqxsciahiv\n58/GKypgHFVs72FIPsC4ssvhcgs5V4Eh4LQPPLjxm6Hhvbit8VE4GdPylqS3\njppku7N1R536vInMMHdsjXjscGy8EXpR3O5Glf8dJ59RXjKcb7ajhRg88jcS\nyG2DHFx4VxMt25u798dnfgjFDLPK58LWqaLXXRzNj9Xf10tvx4qO8cpnQIyq\nbmDFz2UzEOHYmEkNz524a+Bnz9wZENbJ+Zz2YqU7nMTDI/E7VE8JoLWM1RZt\nR7CeCYd4lC4yavpUU2cYIK/9fuTCkA23SCRDc8Ta+2b2XMVlRgjVkXGgiF5m\nVmUIQW/yDafRBUt7Kv/j56njlOTgP6QnXLvlVOPdPy5boNHfeL5Hq13bvBh8\nyncFteLCQCJTTm+2gbvVY8gGEfJUw0muFVSC6hwCNQd8JdwN8KcyTX+Wh6H2\nEA8NmH5p73V49x40OSp2Hj/Mf+WGEktuI+9MrbZOtp3mIyo4CMW0L/VO4DnS\nI/jd/GbU4OnJYyqyw96cHrdWEy8fRQ6L4yycOPN3fMV7qCKOhu4uPwVcETvA\nuhnQ\r\n=zl8H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjo20D0XAsCIwG7ch8mbZUBpCp/rEYvuBCD8qz03mN8AiBV4/KffqRnF+h4c3vAbFBKWN308wUt8MvjnsTGwYfG4A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0_1617348170593_0.32464872333901984"},"_hasShrinkwrap":false},"6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0","gitHead":"a6bc3265829c6357a10b1be9cc56cf4d95826543","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-m0NKBlBJSBiA4iR+wtgDj6MmkYoaIFeJgQ5KGF6WDXg11SZtstUhFQBpfQoI/VkDDNjxlmckIL4kpELDsf9iEQ==","shasum":"c7b24166d3a89609302dd1d0a82ab6ac09a82cab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0.tgz","fileCount":88,"unpackedSize":430990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga/p8CRA9TVsSAnZWagAAs+IP/RaAlWpRdERUcnHJmZEH\ngedmYCj56wuyRUMahCWgNudn5985uN9xYZHMkVwabMfDFXT0yDgaYWawWAIZ\nXiXpEX800BLmTH6uctpbX8usvJxSYimYdQyYZf6UrSeyH+gGNe1tWLuas6Y9\nLifO2/ilTeHG+5t96Qu4ON/tESP+53YBOtgAV+kIr08zJHG1W9xk+wvw6mij\nuaMM+w4r+dNJHDq8v3BNQLkPfkCpMs7zhnJ9r2OxA4fcKNK4hh7DDgtl6MJI\njJ2crBcq0spySsAXbvT8eTcx5t302clFf12Xtp/S3F0nRGaazghocX+Iw662\nK+cbHyBnQ3o62QYkAuOOLBqFdvUOMTAD22erztDuNaKDpR2y5qS2Q45Jzz5C\ned0ix2mqcTYEWXEz87F2QKpRhLgrzMVx3B126nW52jlDFYOIZCq33pkKNBqE\nUeeIEYvS9VzsPv5F0bvgPLMD/u2vNMGyg+R5r3wh7Nci4wcdNMkT0SW7krnZ\n+YrIz7R0YIjaJv2k/Ac52Vj2dNrQOoqG/LuAq23SfT0CPtmnxzhDpwhxNhHs\nUUABoZc2QprOja2UpHCuiuCtF/jsybYAXzBElaYS650D1Fj6pIOmPR+/Me8P\n1VE7FiE+tjPmURhY+POBMdO5ELtsi1wJxJ0tnX/A0g280w3DZ462XD+10AWC\nVbsA\r\n=k/4l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGuIVPkUSIHkb06JdPNr4XCuBJUG4lKdGPT2050QLhRqAiAk0n1X/awqHVhw/q4L2DDkjz4XxYx/Mt6rP3StJYfywg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0_1617689211476_0.15530297091071898"},"_hasShrinkwrap":false},"6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0","gitHead":"deca34fa965a4b7bba264a0d50cc21511fe3d0bd","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-yZMkxXcv5k2FLO3D8I3fyr/pGaEF6zISu7s2hamHf0Cb34IlrfMFZnv4XpaCr8aNwINewg6FqFduGsRgBsXYbw==","shasum":"db609e105453249d15b110f7b80dab2566a9c508","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0.tgz","fileCount":88,"unpackedSize":431915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga/2bCRA9TVsSAnZWagAAEjwP+gNF4Qopud+yGi7JJd37\nF91KbqtJEiia8vK2ha7iSK7MxpixeJ9POeo2n0dmLcYK0cuJKaDIgh3+4Gfz\nw2EVUU27gdrKPnWhZvk4jV6Wl5PE9zW03Zi+SvnIgjkE8Q7SK0igGKk25m1n\ncB8kqrixaJg0ELQ02AU1DqrPLQ4jRyh6uYvCq1yaDOUAXvzUF1S6ftDlIiR+\nJixHAIKxBx6ZEl9xAScyVn37SvdVINu+dc9tyFrM0QBptV5gK6460M0CId7d\nHLoI1UHapSYoXjSfiHFZ5SEFzocZxlIsjizeSuilftm/+DFZffw8bzBuft4V\nNPA6bkJ7ySDsLEww1BK3RvdjioytSG+OKF0C2Ha7Aw04h2N3vyxwjGVQOtvw\nzq5rMVPt4JmXQbYtYoCRMRVAysldvebhY8r6mitzU0eTdQH3sUke1/R84eik\nBSC4T9XS7OW3S1/c3vshjIvLTwBgnVfhKIYhsclEJRGLVOXm56DkhNIeZTAX\n2Sa8NR13W0lOnECc89fpnmjVulh+p5Vlqz0AU0VjAG29s4Uu2WiQiFSr3v1n\nZlN80+VvlHQnt1ECWmYJAOyziSjT/ihmPZZXYoE2DodfOMQej+xHPy+u933j\nyGD2m8qGxCraTu9JSF/HDw4JXsq/BE/dr8nBpaSr8dA1khBugXhcq6Zl/CC4\nvFK0\r\n=KKnc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlL/t97A8ykfoTYq9eZgj6uugEdXrul4ZK1lDw3suvFAiB9uJNSaohLVRWDLsE43nPMN0rxdFptq/TdcBKIVfsHNA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0_1617690010661_0.4080678431202909"},"_hasShrinkwrap":false},"6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0","gitHead":"849cbc49671a3a75799888f09ab619d8d9d5394e","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-FnNf+DrI4sEg8Dr31ef2OweN3eneIK3d5+GHL1YgJz2f0++4F6S95dYbyvKcwyczM5G+UEMUlqZMafo7ScjvQw==","shasum":"a9bf80b594f089f6348d32b760ce7dc21427c140","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0.tgz","fileCount":88,"unpackedSize":432345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbBEyCRA9TVsSAnZWagAAbxoQAIFzZOvXbPEcM3cUagac\nMJtZjcVui4bV6I30vLMho4vOO8bQyJ+5bqV8ckoSlggTdwJ94hzoslLS8zhR\nrrYi2wgPh1/4XfapPEQwnEPbn6rlq8SFu9vlLHJM9jird6cAFYWJpovAHouC\nPqAezt+Vp5a4wQNxih+xtpIk879VGBxp5e1vC60RVGO4j2SsiuU2f6BPLnWW\n6a4Qiyb/2Cxk7mfw3d1HWdFJGPlxDSlVP/2M9uBPAo93/ymYH3Y1u0S7MocP\nZg8/wZ5RQLmjDtD5rOvPvBjKII2GbPQBpcpVZZcx9N7cMaqPYapUhEAHJxrN\nuRfeYVFnDl/pDnMseDXNFdnGnJeGZqjbJkUypVdC4uDv3RSpTEUeFk1G5QSR\nvWPP+0xqX/vbOiwQutJ+G7LISpw2emPKKx3YW/sjXvi7kKbev/2MK37/fCkz\nQef6qumV9Ys+CtuJyy4dnRXPo3pfbR2TkuUHqoZj2t56r0kfSTLJ63ZucwYG\nR4FFvpcy/V+CDQdWDLqCICK/xkXheorKrNfWcR1gOTgAZS/49HOR4Lwd3QUd\nd7kfR7k493bwYsuaRuh2WtUBjuCXQCh5LFbjnwhy3TjpP2vlpfyTsdvPXtIf\ndN5t14xaZqBjX5bPdqRhxjZuiVUhqCS44tMkVqRNN9+VU+6Vamu2cG2ylVz3\nDTIa\r\n=lrzO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpuZJ1vCkrU6XUcpjTsApICtVRX/hVBb+YD92FeD0roAiEA6TfQ/jX9IXuopaorzE5gEktkYmlH2T8+9cv8Muxavto="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0_1617695025939_0.2152038931888287"},"_hasShrinkwrap":false},"6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0","gitHead":"6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-LG+BitICHUocHZK8K9VwP2VxsPgnL3BTtFPDc1fcerdTgAA9Rh6TxakNt6BQ2EYdoNSJS02SKY75+y5lHviX0w==","shasum":"030d9d66b469d856efe6d1b48d2cfc05865ab7fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0.tgz","fileCount":88,"unpackedSize":432364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbW+PCRA9TVsSAnZWagAAXx4P/0wdUNDs49qqLeydkhuM\nFwbm2Cvy4/ZRh4wwj52lL3cpppJK6pZghr+6nbhspyu+mcISIpPY4l7UWm05\nc7xekDxQu9IrjMTutuVaL9YmHm0wzI5JlpRn7k3gyoqxPm3j+6NrnvygSQxI\n1QQ0G75beBnq+cRRNs+9RYLfgNrP9drMFwC24qceyD9cNeCdcK6kt+Fv90j1\nQgyuA09RgMyEfCJxkbCXCpuNzb48hJ9ga+He2sC7YqmTr5TjuVNS1jeMJUbA\nz9tT2erdwVk6ouSDILpc4TKKzmWzrJGDvp7L31zuB/AHN7paA71bJ2rOwTcB\nEyWq1dyJ0ZAk3YJXlucoGuYNNkmvt6ZtAZhjXVwbyg3T/6NUOpiguP5ZWxpK\n5Uy+/sWhtnAGjtecqicozFBd+fvlulFIToi8cb36I0JYMTS/EjBa+wuZtSu7\nHbj3G4qiLsJsmmorKWyJztiKe1tViVwQrTGedR2nMtxb0+boDVNDa7V8+aKY\nYvTvDU58lZCovnmchnmL6gA3Nr5nIKsJjk21znLBBvFSPYGNwf93i7ZetJf7\nXVe7QesxeYY5chV/e4jxkcYgSq4InBjlUPrcRCcJG9HiH2bGORSSFVJjTQOI\nXf8zW0V2R90e4jmhLDUuK3NApVhyAS1rg6pkX9q5HhbSsiVuwagIv9SLTAqf\nctve\r\n=7hyy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbPn8Ifb2CA5Nw5GW7E+jZQzNG/NQXWixHFaQo1ejFjQIhALtJKKoVb7hFYgMidkdQYIEMRkzYjmzAjvoQyQ2rLqEM"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0_1617784719007_0.8683095029040739"},"_hasShrinkwrap":false},"6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0","gitHead":"df93c9454f49a0ef5151d96464379017b78472df","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-5cwsDxs5XAv2NLtuF9IGT07PIdCxCfW/CJRA6fVPulvqGllgDLAaYOLctipIrbi96tmJwrBLeJjt/LUYyr924g==","shasum":"2696e6a940bc21af26262378b579ce24c7a7290b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0.tgz","fileCount":88,"unpackedSize":433809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbsDhCRA9TVsSAnZWagAAh24QAJcKH2PTQjvDRKC2BGRG\nbnEP+MAm4TFWuJbUct+KllpteyqeqFjR/nYQJk/Ndg0xiGT1jyC4WpSVAegr\nVR0PbKaWojHU1kGqReqaP5cmW8g2CMyiW3dPqfmV/Frb5Hwa3P/AJ2tvgGtJ\npApgz68hJKPKeojs24I678kLY/qirahdQb8L+8tLgfuzkoM08DfE3lFY5ABO\niOU9e1qIEuwUfvViuh+5TKYx6oEF8kTmzfa/0pIPYwbewV1Bjr8fiejX4kk6\neJCN002jkYHGAiafbyz8PQqURgSWJ6nLLOoW48XKobNMPgclAU47m/KU01x6\nbGJblNV7dsXdWbkzFaTgwe4zaUHlgEjeJgtKo5j6Hnno65dzHm2VHWUNGCqF\n3eOeeyr8/D9ga3xCEMiqlYw0BDcwDOiPNHjUiPIbTglwb7+opltc7Gu+PVl5\nTEuW6/zmTWUqbr+bSD8tyW/D3u3lP2RsQIUcOMqqPcbu6IwGfHQiQGtOhVMP\n3bXMT0vljgkZbA+NvXab7rfGSjq/9DbfQ+9XyrXewIns8zvQtitJLB77Ef7J\noZs3KpoNis1wAwEfzhhRWCav/6NuJ9z1Nc2kuooXN9UxU2N6823gKqwFVTfP\n7vkfUzJB10r6kqu95jY+ZDlAYgY1KxkGGHZEFI+ZICaSMJOC9wzJRg8EwF66\nI26L\r\n=oDXF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGG0X1lWGN3uMvLpzP38lrrEdQ+T7pXGbyJt6JugL9DuAiEA5tUJNTSYmimcrMjDlMgR4zsWs1EHBoH7EF7GAh/QQFw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0_1617871072634_0.484936267043814"},"_hasShrinkwrap":false},"6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0","gitHead":"77ba7503795868fa46f97254b08053f2ab0286a1","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-TWtGKu+7ASf3jpwnV11eTzRZC8kxq0rSTdy21s1kgQTlQTQIX43+55euP2MU/3g+B6PjGvlau4FtDmMiRtz6XQ==","shasum":"7ad319ae29777da69402983694bdec518de6747e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0.tgz","fileCount":88,"unpackedSize":433843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbsNMCRA9TVsSAnZWagAA+cEP/3tbSXbfzk025Ls1vq6h\nCM3V2ekTBvqHu3EW17cmSW34zh9C6B7a7nsxGT/ssYLxJevIOx1w1nzrC1PY\nvb/itStJFbzI4H9ktFOicR/Wq18M/8qL6Y+Tgf8s2hbSEsVXvQRuS74Qptyg\n26kHOoo0L1klVYSXRjbDiMLpXY/YHtgrvbnJCJKDZZZAnSr1/RiiD+JIwKxR\nzBODhzQY+N4mlKM19ncejdAP3A+ziyzInCR766+9W+0IcsdHFKqfj/jY9frX\nGeDX8HwlzkyK7X2MYZ0BYzYJtsAWitm+avDbzPYKMsgFjMNaofZp0y648AXC\npxAlK2Cv5brlv3tkcM4qUdmoQ4x8gJ0W6YA9aZVT8DDyKWprNmlR4q8Mn5yI\neidUAu2J9mH8b3+AszgS3YjhiwgUDByYysJhZfSKXVhk0GbUuURlhgvJu+eG\n0jwfEzTfAz0u38CCwA5XqVDSKDyW/xWxTzjjRhNXztVKR/Z5n60DMTS8Vz0c\nlzQ2UWw65NrJ6hy7TH0O0DxdMEBZ9u2zGUOzimHJBYeigw2bV7W+ZG8LhDcW\n4NYminutg3lYIR+d3vv3wuW8dLhfXYgzuEUtiFTykmert1OWhP19vN9xaY8J\naVXu+5CmO0NXhtAh42zRFd4VOFSGK5wJpNx267BIxbEoJAACOYznh3v05Vf9\nVgqA\r\n=PodM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoR6fcRIHx8zNqM5DcdX6SS0qb5vOVNvYlE6C6POFmFAiBmmQSSdJxB517cJq1y5WrrbQRBkD/YzCdq5lHrxHbxrQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0_1617871692128_0.170730477877157"},"_hasShrinkwrap":false},"6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0","gitHead":"3f1c013a6ce51eb851a0967bced85eb4d7bdadd7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-hTAyHavddP1koXtaPOQTrSVotviEl5pGR2RGhS8LWXnoNxHYUgVPxHqYxr8iLU/I5825MzIs/AKEvtTMK/ng6w==","shasum":"4d0bfbef58fdfbe37b92b5d8c1acd339b2ed2d55","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbtzZCRA9TVsSAnZWagAAzawP/10QQ9X+DTw4xHb+nrmB\nrBJUjCv5CXZ3AGNsuX7Dp4EO/wAM06DAFsjWokV5Qq/M8WxeFZeXIvuRk9qT\nQHcZWOs5N4b+Xy1WNMUOhw3MnFCCTAPyVPEo8e5hd+ezGeXs4t3qYfAWmupt\n43dNhbhWvemivGbukQ6x7gz9nMTaXPNFe+ld/1gi3a7tCLGzIGkXA151DKlr\nevW6blGAjlo2Ek7clfUBsjkzf/Y4+FVkq9fpu6vzzwVtM3nNcVj4Z0a74meR\ngtiQUWy/YY7y1XjGwuXKIeoshAYrjgGoPdf0KApIc5TF94FyB01S9ba22Wt1\n20sze9tRTwMTgg89pKV/Etm7DUsRWtmnF//J9GytW/esEJ5cAattLCZ12I2Y\nDRGhHTn0ZJ6WC2Qc8Y4ZDbhuGP2jZnLtjZGWQAFPnHlJtK7V4qcFXPOodcU/\naG4KnXy98/nEZlWSOSUEwuG3OfDYK+l/8fq7kGg7aWDthFVVP/42uyqREmtk\n/bjfWzXgMlTd7QHBxFDV7+pZW8HVtO56Dyrn8xtYborsZBkvHByL0KGI/Lej\nRdBCsvKsuViszQ07L49IeAldttzXUnA9FWBXDCwGnTQLe6qBle+o/0850AOp\nD3uyRO4vS+2PubMzefYg9Q3Y4LOODnZNhZHPLBt5fCJF9iMjoOgyz4Fvz7/n\nydNy\r\n=yXMY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTkFrn23JqDW1MFhPFd6lxxpap8eZi/9pv+6sxpmscYAiA/kYV7VOkWX0d3lQYj1k8IPmOpySZ0sNasrv0nAviLZQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0_1617878232678_0.964670745708128"},"_hasShrinkwrap":false},"6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"360bab9fb7cd0941475a23f8edffe9bd04606237","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Yx547sVF8Df+1htqAvQiTt3etJxhJOstFXtxLxb5nwYMBJVh4OcPjXWsHxg2oJWayoOzIA5KdRM/ub1AokmyXg==","shasum":"a1182b8241b39a02e7e9d770b7885f188e214989","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0.tgz","fileCount":62,"unpackedSize":343713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbwJrCRA9TVsSAnZWagAAw4oP/02hFs+BQYdJuuK1PhI8\njxtWedx87qZpGgaOute/oeUHbO2yykVd1AeH8rqkTtoQTaPAqtxkqU2El2WE\nhcxzgCYkm6mJSy4JkGN3jeiKxTpDVozPMUamUPuyladhFaEPk0Lhtu6ZsXUP\nIkM6Nkr1tPqkFeBtJwGi45Jld/wPxm/hUCl+AgLQIRrk4tWefN3LRE7MoHOp\np9URUbAJ3pTZDvgN0/MWdTaVFJhO4DQEw16gdAXL5MzFY6y/J1nYZ51D/skA\nfMBw8yuPQHSK2EhDaED2SlyAiyMjCXA85K/FmIC5MlJG2UnO8gpAtmegSI/F\niG2FZddTUOa1I/gJ2Z86J99VFGyOVUIaekpHltkj//Hgpgxce9npHfs1u6DE\nQDqfIluajAEnFza5e+lJvW1Bg2MR49rWirjYG574KRzzir8FYvVkJIbDi+pk\nc4JIAUsD51CP9AWJ1qR/sr8eFqKs+xtQSR5qP1Qkc1QTEO6JuNLZsXkUT8Ow\nATvSZYR802LJqPq66984h8AlrTtz9bPlvfqBiGJE+S/NCt8F5065a5fWEuHp\noqO1IfXkkUl6lyATd+slzEHFlXYXhuHLA8p2IFJvy2Rfw9d/JRtIvePevHbf\nI89eNj/2aXQN8RtGcecAyq3C3KP6bepWGz2tyevWrIKnXblRlW+LWfYPbX/v\nRFMN\r\n=A/po\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTziziQdNwVU8pyzeNBd7Xr2uhosqdmrlN296DUQ5iZwIhAJ2viKFFb9oiD9xYHQIHG0O+bR3FMSzTafAMGSbIIP3G"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0_1617887850909_0.1401678555933039"},"_hasShrinkwrap":false},"6.7.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.10","gitHead":"24549db8df232e417f5bb19c1b4caf6d6c5f208b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.10","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-P+xoO9BITHNHrjWu+suF3xy4CqBKvVGtP9RL7e64g4FXobF1poyC0sIAQkYapYHFST/3MLd+46woYG/84cKKrw==","shasum":"14130ae31ebfde7cf948aad163cb1c3e28b26f71","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.10.tgz","fileCount":62,"unpackedSize":344416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbwJ8CRA9TVsSAnZWagAAKV4P/2hdTFTtJteFdEst22nW\nIrza3uVLUNW/Vt98MkMpfN64fB91Ci3YYHZw8rTg12/BQTOhbdLIpgi2gI+q\nqqYkGes7V2HoXd8nfz988BvlPABFPr9szs/MB9zUbINKj8V4UOy4iSCWSwH0\ngd9onBTxaH0bsGtxLdZ/1+dOC9PIXjB5KupgjwRGZNQzsx7c/8ODab3yrBAJ\nQJPw7JHbJvDxzx+ovF6OzofLeIzRBy6UaCVIJ4mTRpZSP8n22iIBwGMN7+yq\nruY2nsvDN1udVhbpFDYBgCPbWAvgsDqRqUZAsyO7bqahgtMH9X02elspO15P\nAKIyfq1cWk5YbMXFHU6ZkQKFSwojqe10cg50T8/5PB1hb8mQgDyAT9Zysbry\nUU56ly7htEUfc2xrEE1EFedfstmF11bOIAl8jpjMmA5nf4U8dwnD9k6X+ZEY\nTLwjde7KdGbnc8CpgxW8btLTtBn5RawEOCKMnPQr0MQGl67pLV0faIKIJFcR\n6mNaRY556v1xUNShk6dTXfm9UYxoHGAbyCwBgQvgEyQ3wbc6y95UharK3RwA\nA08JdOskxbSJjTuez6v4VgepxLSTSgUzwvRDj+2m/aLsOhadXDzlA46ADxJk\nmjfEp8FXesHs19Vt9OOIiRyQaUBWHYWspmvhi3JklMB/k0IltyIoyzEZNm4e\n5/xd\r\n=wpWV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXohljDFMnpF4pVK/5F36Tuj8ArqX10TWyM9niv6eVEAIgXCgqoC4SIkVkj97EmsT5k0RzFz7BvSDNlcN3MoU7VrI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.10_1617887868408_0.918321029924988"},"_hasShrinkwrap":false},"6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"24549db8df232e417f5bb19c1b4caf6d6c5f208b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-DhyhEUXOktRVHhcaNZesqJRDUEY6Rj83URziDf7CK18PAw/Hk4Wx78oZFz2irqV5cHYRDCOxVtK1LyDUA0pkbA==","shasum":"e37eb3e6915fa4292981e758fd1c848189ed024e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0.tgz","fileCount":62,"unpackedSize":344459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbwKnCRA9TVsSAnZWagAAbNAP/R817GgpASyxbwqgAEth\ntU7zxpcDtd9F6IDMus6idNQcaBUtQq/pGNKxlyrufSOLfTlWbOP/phxqgRt/\n7x/ir4aSIbpuNB76M6tHnNFpw9PtuGB5h1ePKvObVsWPtA2qJxmJE1OeAlPA\n5o67AJ9/C9hsdj9Ks3mJiJK82xyVpbhBl05ymNp7TDRoiBe0HOyvc/MdTm3D\nvppA6iXehXLBcKvEBsDbnRMp5ancaPJC/nG+PAJpkpQhODvOIp8bLsHKn+Kl\nYRJE1DnPW1C5RIPLgBy+A2hxX46NX2TNPsfj/rhXnY9Yx/aJhAoMqABUH8rI\nyML1W29iCEp2CP06CJ0iSoaJhWgRxfF0TZz8SXqAMibz2olNoOiALagbiFyN\nYdGimREou/Tml7L1CDtLsCrrUHRLEUpnsyYaeSwEG2q7dmnFLRkisnGm8bVq\n3IVtjQZKvlnJAytlDznwQT2QIdkkFPpA3xxeFxj7kFwgJyPI9BVb3AzNQIVx\nNykfrYw+5y4fhmF5fPHmW+quyTnQ2HrYSbwNUShLd6cpLZGVBn9WQkUfNHBE\n0uTmStPO0lADW9wYj88V95mFpYSo8z/FwVNU/aYj4UIZwiODzCEW44CiJLDq\nBqdMGR/h7nHEO11phai9BVBiWbc4F8RjqRuAizmPBuCNBRbUKpdIGQnZ7blG\nMhxG\r\n=4eLi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPCcx5fIGf/gEI3E9N6VHr7/wPfoSwbb1gfge6+A5bLAIhAJWCQBBbVON0LOUlc4iwgn1qzlTdKTzkQkRAMXyv9S30"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0_1617887911402_0.6674564349024348"},"_hasShrinkwrap":false},"6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0","gitHead":"2685c57730446da93804e0bce3bea2c6f297665e","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-cJ1u27cQWKMTm8PYdD44TwJ2kPABGUI/wZHMpVM9kCdQcWkvzl5Dz7YXHitFLS0yzi3fftPwC5mwY+WPhU8+KQ==","shasum":"a3900753f02a6a371a2e41ba7855a0acbd602458","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0.tgz","fileCount":88,"unpackedSize":434589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcDjkCRA9TVsSAnZWagAAAbkP/R5ZFxVnNwkvsgO3KsfA\nvd5qNxaJiQMjfhKAu9Qj3teZzdSARCJY5BB91ayIPXYcZ7BwLQuZ+jyJZ9mS\nt8iC+oEkaESzVGimJLxKpf+DbOc0ynTFCAj8HPsy1iGi8adr9S3Dkx0gvocK\nHPVk9c7gLVcuwPOV9WhJgRLNN78ReweeWSCFv/XLwGDaMLFIu+Azj2o/1QAt\nQOr6Xa7EvFoBn8QbsM7hkSYwMpGYE8SFdZeu0VT0PYnwQOdvxnKAoh/SeVVf\n9zc+3tMJ7zZYUN6LF+OYCed7ltBmcutMKkyoKCPWnxUMXfeJ7tWz96SxZLvc\nc/vZMup12Sa0DkD32BRNLkLpSJimI2JofNbGtHMMOAotZ3NnYDpu4AtJVpxH\nYFleCTGsHVcW5C8mnsOea5ZbTs9GWd5MdXwFO0n+MXG7qfo3a5l7qKSLBrbd\nEje4xFseOJdB4RnYgmpva0ZdKbv7ovfDnLDm9ZSNZ+8vkjvHeJ31wcXpZiXl\naUp/lMEHCChUD2UE8mA6rNmynnZ2O5AI2I8PELPutHjbWpJRGWJ9CnzUDSy7\n1GWLoT+z8W3//5qgO9fAMwf8xX6Dkd7sOQY9YUMUtbZ2JShhItgbzJyF5wJQ\nnP5s+GUcJ+N16+tzjN146VZm7wOfiEixGDXqbg0zbNa+Fu/pcM4WFXA1QRQY\nzTy2\r\n=oq6V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfnwwVbS1hZmajHdlzxlupud+GobcBZYOfoSTm0DSZ5AiBi2As5Rhguvhzoi1tJXJAJd6r0EVEW9V7Fbti7nWt71A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0_1617967331804_0.773951717253708"},"_hasShrinkwrap":false},"6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0","gitHead":"e5b468081a890fc4864a5cdc01213894702f20bd","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-KS6Pbfwg8ExqOWlS8Pjau/TmdxNAAYNleOgl3O0ib7xOphHnljQw6vYbNNh9Tit8YTBRrdHbLImsYrDTp41CWA==","shasum":"77326e106a51d709b6394a42fe83f7d3bd390683","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0.tgz","fileCount":88,"unpackedSize":434589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcDlxCRA9TVsSAnZWagAAZsIP/0xHDXMr2vCAaWUuluJa\nWd0LjvfwtZNYns2t5i2NbaM9lnrrEcdOlWLAm46KEKb7lHMkgc6jTEBiLX/B\nrOuTHb70hb5ZHEIb8P/oZNBNKRKh3YEtcG2rjhiHLFeMJqJ1ZPmhgRHi8HtJ\nX5TKepPlOdt6tsokYUZve1Uyrz9L8R6rQsHpQH/it0eqwW81aL51cBfNsvKK\nUzjgU5FIcK5SHB7vXuI06Vslm5XfGH0e3ZsQHWyJZEuv3j0wLkT5fpCn8pQd\nSsITJBRhmBll1lue44WdEk/1Zmt10KDZYi+470lC4tf2Zs0PAgXXBV0kP2Yt\njaNuDGpKhheZhlSC/kPgUDsR7PuD0TDnQyaAVhQ8wiNjijj65NuX/FehIHAi\nA+q5o6EQ8I5zK7YjnI6SoeaDMWWrjaDRq+vDlxhzLUKh5vpLBcQCYF7uy94l\nMDetFDO3ESvGCJEH8FY/u++8v2NRd8TfO8Dtg83yyP9Pt50er3YOUd8O/xtT\n0ec98YWH+sbKo7dsOrj75VwggTgVF3zCfx/H9iVsW3d9l4urSFMKlo76IWla\nq7WkevKNYQo8eoHxuddWltpjorZgKjBV0QS/iG47NimPA8ZOBLfJJN1g5ppr\nRG6ZYndnL2c/0LN8xZyZ6RLbpcn7hxqMHcU5a5XWKpF/NoZRkGmY2/Ex9s+a\nJFu4\r\n=RN2I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwirSwQGKM9Jk1EqnR0rz39+mt982Zjhouhng5Wx6/5AIhAI3p6h5DnHi7NOYhj9pJdjEnzq2RvhbWfg+SLjT7EyuI"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0_1617967473317_0.6369383915049112"},"_hasShrinkwrap":false},"6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0","gitHead":"62ac5f17383bbb981f4899d43889c51c7ade04fc","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1YJF2VQmJndbRCHhbiNMcIXXncU3NKprSLtyP5ZD7INUhs9zkrHsEjUsL5ABIuW5wtI6Dy/RBglOGqrBU/Sohg==","shasum":"ae8c0570059ff4207eaf4df1a1c470269fc52f20","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0.tgz","fileCount":88,"unpackedSize":434683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdBXZCRA9TVsSAnZWagAA/SoP/02eIv6FtT2t+qtIXXXc\n8DYsIwUbiKmCfOHVLOdMNCBQge59ut0ky7IZVy3CuSsxQe9UG+xHXWPn5Pgm\nn5I7szjukkAG1ZKMigmsuLhZo3Wu+oqiG7TTntrVc0gugNZfHQYeTmxl0lsv\nq7DwCOQJUne32+1dOThkvMHFb2nRFSx51Q9N0RZ6Lyg3z74aGtQ7oHICYnjP\njkw1Utu0HwSdQRxOIOuZ8m2UEJO+LHsanf5gxR267Ukq5G62LWT9LeH+6ryN\nJK67qxPgTIusqmjOryF3b2RNWQyuxohuDq6q+EgSQNDCWAk+sqUY/BBZfCBe\n4QB9uWtjsmg6wS16yX/s2K9NEFHUj32wcQ85g9FSppXBVzUh43LqACb6zplE\nCHJCnXKDr9ISbHZ8R/CRg4Ydw4LkI6erYV2+ANkOxJp1+pEWZk5vY+IrL9qM\nvwnhEmw6jajOvH4sw0BCX1gL8ZWoEgnLkcpQ7vnvZYoq6MO4yKV6E2/sr+Vf\nsGL7Gs96bb2J6IfBrgeT2o0G5fdCMPI+vYkJnc8P8YkdpiF/tAzek2zawHfy\nJ2TJGAuEybUw1tTbndMR5kh0H3Fkq/Qxn8U85tf8z6rO5+e6CpKICJwJmm1a\nMNtV6sziWR6xReZj9yvFmQklDzUjI5xPsM/sCvrOLgSHecheV8ZvXCuP4o5x\nLyLU\r\n=5aJh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuLPWmJA13//DMpGFPRUMM/jKNxbeSrR4jhi+6uVHCNwIhAOoYqWfmCZfAZpOyo/Cmz7qXX/JHM9Dmul0pTRmvY4kV"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0_1618220505020_0.2061731924655521"},"_hasShrinkwrap":false},"6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0","gitHead":"4fd14d4207d686836f8d51bd6273647ed7c2ca4a","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-yA/Y9h9wiO1rlEgoL04oZrogxjOHmsb22z9mnpvzWW3/2jSBt5Mr3r21+azNbN9j00CeECyID9Mz4yVKa0RvQw==","shasum":"12eac0a7c11575707715a5b44a8672f7207d375d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0.tgz","fileCount":88,"unpackedSize":434822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdBj9CRA9TVsSAnZWagAAZ7QP/i08ymZTht5r4t1Rhjw5\nv6zhBWP8jaib101JTZi/YBVrBbfj2RSuYbQpziKU4XrDFH6MJHChIJz45WqR\npQE0Yg4JfZTuyqyNqU9e6sXT/95Epqa3GDqV70lQWdg1tX7wKjQ/Hc/Etvk1\nSmg1M3wOYYjwb92SJTYlDsQj1Uv3/sNYO+rMIkMZ+45x3of/sx6eKLDhdj8u\n3s2mLJYPD8+Wh41L3Gab5j2NWaaVTCdnmr1AuNFS1P2keNGvFJ+7wrbxV1no\nQ4WveHXQF1MQEvsrno7khn25Yw1AHUaUfg7IhtEih6pw5R4cj0CEJ+yPEmVA\n3D3PHO+RuISoxfsq+2eK4Z9G2XUp/2oZgCpr8BSVYtA1u1iKzO6nKKcjJAjv\nyNosqiFpsXGtGjAkBbz81gLWQnCYs7serdlTxbyqw26y78tI9agzUjo14IZ5\nw51yTVK1OlO9IecKrKufwfXSHPTsCKW2O0f/zd5SYqVifZzXaKYl6wCSPnSe\nzU0CRtsKuVWqYS6SwVsUTEIc4hMUt2s+P9QWKqb/jx9AQxxchMXSd09PXHZM\nFR+YTQsQkSnI/14kPJqwOuknQkEeBKSgcYrnLTXK9S+DU4ku/ZFKedY43bri\nm12inEEv+Z4sHERPH2GdkcwUjmeKducoVIJmN9YohwTzrnkJqPCMIzmt0/cM\n+usU\r\n=fUO0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpEvvjaFMcWrUqrGnAyqSLqFBdKA2qziXEnqP6PZcgtAIgI/apEkCUEuo4fjT01K/f+QZquJlM5oe6hB7sdNfXjxk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0_1618221309273_0.8892637568714008"},"_hasShrinkwrap":false},"6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0","gitHead":"f849936889b25896984eea59fc46b1f4532b5f40","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-PRvf5/co7pWoNkPSrIKWFzAEkKq/OKG3rWQm5MxVauUJqrX66Xsd4eb1J2aYZyhuxs9OKYRhHo1qJ6GyqRFKAg==","shasum":"c2c8c1f42cfcb4d62013dc6c0995c5c1df3532d7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0.tgz","fileCount":88,"unpackedSize":434841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdCQPCRA9TVsSAnZWagAAnMcP+waxWkW5tC8j1HeUa1HY\nABr+kJJDqiv+5FcOjWRbJ1sK3TfS0CqGl9nJplJQFT4zBFvZ9FzJckCWOYwS\nb3rrKbV6UXolN1mBaPB2HxdihLm9J/12teThjs5QN3lRkQc3yhfi87BBxenY\n9gyj8HNLPoVlT+oK4Bs4yeivqthdO2Zy0XUHzAu7BILa5IzajCuew4JNUBAE\nJfmGOhkkfr4xIiL4raJxmXWS8mffdzzV+5wjFzYnd5Zvf81mJwI/J+CuZYfI\nsI/rFtlyAVLAqZki+HkQXkaIqMhiUWvXnsBtNKAn4oH5KRIw7pOWqlTQEFxI\nw7f+rAjGOt8SaM36s0Gt46JHsiwUaHMELH1OhgVSh0PQyLjvm9pcfIrPnwLu\nq8kvpQeZSUmarCqkut1n8+A2Zz/ySvcmWNdPMvaRnoXtrSRyaLp4jtM+Jnfx\nFME7nUZS0Ef9IJy0TY4QBPYWR9ZzQ+8pYS3DuN8Lj6F+dD6rkBINRZuzYuqL\n+oCSCjexdcQCzHGVOhvDdtoop+BZ2dMYIGIvjbGoWU1YUqVdbEXQRed2OUY7\nj8UpSXHpfs2KnySIz9V1RWxwNwXuHCkgVTiki2I3qc/TW0X4Gix9E/tRIxkz\nFO9HziXJX6NpBJi8KV7B0AuDY6SYuUqdlMyvJcZs1wpsz/rgsAerBe0eD+oP\nuFHN\r\n=K6iG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKzEWAppHzrbFvEuokyXBCggT/7xqlMl/qby2QDadxngIhAPbUPhOAMCBubzdnaBISMpXVeEgIBg94Ge/gbbQOgSJd"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0_1618224142705_0.9450268547476355"},"_hasShrinkwrap":false},"6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0","gitHead":"a9d3243e066513660113520f774570a689ccb3fc","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-jcl1QLWHh/n5X/cBM3V3RawoGUaNrlMo0nkEo0oQA4HZWENCPto6x9RynKCspdCjAqbB7rigj1jIM/T0JU0PIw==","shasum":"17292745ea30be09dd78344709fc18c771ad7c59","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0.tgz","fileCount":88,"unpackedSize":434807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdqncCRA9TVsSAnZWagAAcssP/RVhuhJ9Tfh4oDs28H77\nZ9xc/goZTdRII2GTGWN5vOlBEzuYSRUi0ce5ygEaKN2HuLE1QG5ULODtOl9P\nZhLkiefE2JA9Gtw3RWtOgqEjnWAI+k7kSZPGT9arX0F7iTRnwIwJOqR6u3RE\nSX2oiW/8ObFpZjiOjFqAq3q8OnOvXl24HpvL8KjIBuFjX4LAf+QcZziLruoX\nO2aHStcoGFQrbmAQM4Nda1icOX2phM+QDC+LVN7hwLX0cMlVcsWRgCUqO3qJ\nvJa62QTOI5Ul+uxvoNpa9y1/F388FVoKYJnVh63WlvtA+ie8bqm4xalCNrNr\nAB9ZlHCvnr1IY6pgqF9o1h27BbDnyAb0EGRkZfsNj5jF5wZq2dNsv612kwVV\nLZ+HZMlOsZLl1K2uf2JglbRy7k1/6UCjCFeg+L4AANBJ7uCMtIEJuL7oUSnV\nOEnW76KsVfM9jwbKHyhoNyFnXAt91VAUjlTXem6opUzGCF3UiTczaFa+SaSJ\nhP4ori4mENooWiX9zAmlKEzYx68KRDRk3JqJLaf336j0QEBCcy9t7haJs+AA\nV4Scu4ZmsmZLElqe6xZT0WpN64cVuylUHUs/WI78SkbKCHJ6q/jcvkUNGUGI\n9XH3z+u7dZJCq0rSylsgaa1azBwIMkN0V8WRkkVRBb3nR6WLz9yxhFK+jogb\no+N5\r\n=BLCU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEJtuYAC8J5KUeXu5EHOImZGehMaS0baon/BWvQyK4RAiBeX4ZMcED37Gz+FIFG59lVwTjRQMrfUhVULvdExZy4Hw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0_1618389467525_0.5360167330687526"},"_hasShrinkwrap":false},"6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0","gitHead":"f4187381921f79be2c4150b2d2c5feb58059f29b","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-3ha87SUjMxTx6yFQipTK3H/gvSwVyn0yf/sY1erHp6NrXCC5qPLvoKR3k1zXhfADK5/yYnj1dG/JmOA/pg1SDg==","shasum":"ecd4fe4bd2f9fef15a888002d707e5dbbab569ba","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0.tgz","fileCount":88,"unpackedSize":436545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeFUYCRA9TVsSAnZWagAAxVUP/jBmnXkEKVQqLBbv2Mtb\nnW6+eqLnbKS3qnCKBFjvVyC5kWQBFui+VIprVIPjiVMy2SYlz8NOzLq+2TIv\nJ2mb3DosPZUHgnJnAXFt4Pu5kudNwQeCK+LjJP9OH8nxKdD+QG0xbe5DvCwU\nF4+JBNnaBADq4ndrsOiz0+5vsTYjgtt3k+8Fs39gztrFr2Gg96Xj7l8P87yv\niynXACPySGQi/7OJQLHB4wXnVsmV+IU6gEmeZ578qJGgvB73dNruKi8SqJwH\naAbAPqYwTm/KzWRoPUyJpLbIgs9EoGNMS+9u3AWLP3+SaH6CZ4tE3iOV8ryI\nz9U4yZ/kpfY/R5d8UBcrOPt1RCEblR2MyDWiWg7+Td+Dqrm/5C8fH1+y2DmC\nfNdtlhVkJcVPQoZWcOyzWHjSXKaY7OPkO8bX7RxbW/yO8nRQucGSoyQd9Sh6\neJLYZ20RsC0BTwzf3H6g/Xdu071kSJQbUn54i1jgOxdwN0DsrDt0rjYDXhH9\n3v2Ug4/q7ANiOYW1yTANFg2+7ASUmzV8ultf9RCaR6t5Fy3BEjEPk26kXmPp\nI+J49M/gY4MZMUkp6iIvKmgzkBVK/EbZxcsqbTL7lWBKgAiUb3se/G78k3+i\noLD9OZU1ThbHXmq7/RRwZnxP/kVDW+17Ddm+Q0XJMGRItd6gyXJXw7zPSt2F\nFaJP\r\n=J6It\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCT1/cPkw6hkPuqCNNkS2IutC9gS5WPqWdTsH6LvW2fcAIgYM52YWjIiWXVv07qPLaI/FV6N6sAWTfJae2StiPGUhA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0_1618498839965_0.8960359608915194"},"_hasShrinkwrap":false},"6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0","gitHead":"8ecd381c8d1dbe7a51745398bfb0c3610bc003a0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-r34RfetARNRT+8YzWieygLyWtWmi3oUIBGr+11MgRjfjXKqYvJU9M03yqT2khRextjCINgkfdJD2c8IDv6FPDw==","shasum":"fd833f8095596664d55c18de5c0f9b90a8654672","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0.tgz","fileCount":88,"unpackedSize":435591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfUs9CRA9TVsSAnZWagAAk/UQAJMqljuanR7KfJoYs50I\nDJMGC5LRJ/3yuKgIOHaCcqsqnLinnU/2DizGQvrNHxy0vQg7JACNfGsLNayN\nCr3gb+u2jZtlGUKRc/vbOjV8wGcVMh4OBcbu0HeYL6WA5st9oX1iJ6QVStSR\neJdfPdLykGtBBrE5XsU50W1Gn8xwLbtj2ET8B/McdvXJaprTqSbqNqMlGLlM\n43Yfs7aLv7GLOjZdBvGy42xDK96BzThKdwUDgqQUiKbePD3f4WutuabMEhst\nzs+2WHDTfanVSQLlwzXrDEghmKbwfonE0EEBzsOV2YOUIPSy9L40gRNRJv3u\nMakLlckhoITBdpMfo3Fl77Uj/rIfxOUj4QzkLArHW2wGH4Pz/x/kpdpzImLt\n7ZL24rB8atgkpbh240darXCC5XDBN0RqJHwokhgQvOvwUNsLxJPCUTZ3fU0Y\n3FbsOl4I2kyd3BbiJ99Q2DsUEc0LOOQz6cGwsx8LpX94aop07+xUyV8jy56A\nr36V4iAUEySwrIv03NB0aRxv440snB9hfOkgpqyRRxjnbX+rtoeoyF/ZCIyq\nlJMsPou1iNmS8QSLrYW11Ik6YAspSExV7Yh/H/3XcETIJVIpOHVR9oq6LpQg\ni7U3//tyyncy74LvWOoeW6B5NrImF87bNXd0F5hiOLGRWSmnDUe14R6voJnN\n+8pq\r\n=Wx5W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCC8wMjqcwKXBXj7IwEGOyxZbkwhZCXH605ldQVjQ0qAiA01hhswIFMtJCjzEiSfMqKLmyn+W4dzbNFrZ3WFfhe/w=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0_1618823997231_0.7391323248967685"},"_hasShrinkwrap":false},"6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0","gitHead":"adcfb368d425274189e366ffc732d8efffa05fa5","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-ktA976rTBftdEcB12tjcHoyrSYyWfgEkf4Ge3BBOQbw2QD4DVQbv4FsWOLAbc85e5Pfhyc4s/C/AwKjUywCruA==","shasum":"12d93c18a244e9f926f6593499d67c151d50cf74","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0.tgz","fileCount":88,"unpackedSize":435591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfU6fCRA9TVsSAnZWagAASd4P/jmOXWWsFBgNr33p2WjQ\nqh1dw7OyxHsNF77pZ+DAik/D5Ofy/6fPi5xTfQ9atEnN8ThK9DyxmtPByuqF\nCkzw2TFEQCaKDx+blMA1gCMykrXwkBFAJMIoR3REKFC5CjfnK79tkClqIcDl\nDkLRb6LHx/T0FFFSTtx5brodm/4dThd3t17jmrZLun1MLwXYQ1/4zSQMcQDN\nWuEDQbE9ml4tKqnbcXnZfoR6qau7oGU9y3l3MiLTYH4ZEqJocbYx3vaKJ5xY\n6kulfJP2jwctU94N7SP3XbvcLgqbb5KIhdv59wWse3NPLShJhTFg9N0O5qqu\njeaeRRWRTBcFG37YgfpsX6PGd+McnY+WeVAkINxLtyJCDh68625cceSddtHr\naUv+G4VRMQw+YcVTD8AwL/vdaPwVCYZMmH2wvtkAgNQ7Gs0H3GOc3/MNmsDY\nExdT1dcVC6lXE4JKHWHVbIqsW0CSU1s49Txj/auRUD5zZ55IlFyLeoHhxj2n\nZuJ9F/Nt1rUqC/x9Yiny8UMqi8NCWwOSI6YnoxMQt/ld7gsn/Gyzf/Tg85GZ\n+ffl7aYAYceqMWS1NsEQi+zzuJ4xhFv2gVNKwHYf3CfUoHuQLkZIC+rQpNol\nUH2caJhP3dWEE/8x0jN987eNnuy2JkXAl7M71krRCdewB6mXPk3R6UTSFFBJ\nDK5f\r\n=H1Sm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtrkEk38OPkZcTuCmBnU4lZ0rTkS5cDEWgT3TmGNkorAiEAlB+aSCQ5SrB7Q7ItL2Ezbft7/gervtFwpPoBRvko+Mo="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0_1618824863191_0.6681995589921097"},"_hasShrinkwrap":false},"6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":"14","npm":"6 || 7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0","gitHead":"39e844c36e9295efa32c60ba22685e650d7eb9c7","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-GicPM0bKv1zflk4id/b4tuSCmJ7gNcvlUADo3QdH77mjtTfns4gtt+rnJVR+sz3MW14nR6DJWS/7zo7QMgssfQ==","shasum":"4fda8db7bf910d3ce6989e5ebb54bfb840106216","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0.tgz","fileCount":62,"unpackedSize":344477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfW1sCRA9TVsSAnZWagAALm0P/2vO+vp2MagVmRmVTMOP\n52y6Hhvrp+Cx1pzMRc7yp+x71pMkHxYpU34Mb9BtR/y2tiDhVKCiQ+SUqFHT\ngyqPe9y4+U8xQ9czjHYLt5j4AJt1cEuuErlfSOZkFIDV5jBFeMFLqnECR0xl\nKdWaDOwweKXIoAPl7Aeu9M9vZbxOHKhfFbHhnJlp2OXhC4Z7kvnYwlLHmUnv\nEOptFt+L/YKa3xii/2U0MDxY2+HbQjZZM1nH2d4HoAqp2sTgzStKJgHnC52l\n7um3mwehJozpokwO6BQg2BEovhPqIew9L0n7TPIr2NXS+ZJxOkDFkNNAcjrh\nQG98vPLeuHgSvS+PkNpfRt/SHNf00yRcvkRyjZKMcbOM71u4WUR51TEjJGS2\naoev0iFTkUsfopFTgraOaKMAAqCGmUqkD3d8WfEes3tdSAqbM770+ChdNeaI\nTd/5B4NuJkcdHDyuyKNYnXEPOeZ9NSChS1q1EpgtN3K+KfWV7Gn68WoJ6p8x\nEbZg/O1ZTCDrafmlL7EYGgmYsEkDQ/94wEDTW08QcHTPtok0L5FswS52G0zq\n1zXAZne1VPmFLHMxnWSkdv/8dcxqxUWZcuGXeuIA99dMh5kEBkmaEfJ1RpJ3\nqrHvftPcwzbYprUbowbIL7xdiehVGNOd7AaTblBzi6wCLBYNufFFujtoeHuV\nRbvD\r\n=mdRr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGENwAsoxdzwztEgsIX9OxC3Ak8CLgjpOFAsK2hTiqLKAiEAg9IDTpU/+YTokSEqTpzr5vUgsTZfhcr+0cnwn+fuQbE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0_1618832747654_0.6455367991011518"},"_hasShrinkwrap":false},"6.7.11-31c6327f5f616f790c217150fb247749b6170674.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":"14","npm":"6 || 7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-31c6327f5f616f790c217150fb247749b6170674.0","gitHead":"31c6327f5f616f790c217150fb247749b6170674","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-31c6327f5f616f790c217150fb247749b6170674.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-179oWKV1NmjBwt42ZQ7GSnkjkAWn+nVioy5iasEFJOe7kzpouNOA/NmgAS5SqMxiZc7OV9yRoxdWHkcwSm+2bQ==","shasum":"6cc3dedce9a70183e091af7e8af79ce562a0bfe6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-31c6327f5f616f790c217150fb247749b6170674.0.tgz","fileCount":62,"unpackedSize":344477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfYQfCRA9TVsSAnZWagAA+Y0P/R+EVJUz8SMzXpYusFmt\nMk9nMG6F8gvTzOAwbiOPiS0MVYflkOMCAFkcWWN02w3M8LHPhIZnqM+Ox4rF\nAox84Os03DjKKwYtVjbbq53wNMPanHg5lkEFWWzYpyHUKniMYu5ZRhf6moo3\n3PpsTk9C1XpCmjcIxTw+hpjKNUYvgfAF5IBwUPPmZ0CeWHMcGdAQ41y5XUnK\nfRr1nL7ffyKtzxl4fEh3WMfJUc0aUu6RG5SLc6m/lj9xgSXWF260syrk4fVu\n/7B9MZ91axF82e6ESuqiSsEfiSkhNIKe9gV56jpC0HANqAP1zE+R7Q1JZKQo\nU+RT67rgsjyNUDI20V6fqNJVeM+fKRD4iC1PkSZKpN19mwKDh2eekOgi0eTD\n14vb830os/DefZLzh77z/dP9pq106aokoJv4JJ/71DlsnciEN84lmK9jhaKv\n7Kw4HA7uOZEZ+d5L2KbBrD6Miu7brxMnA93SEUn7qEvDMsS85RMM8kNiwD88\nETmjCu5iqrIh7nJJl8Qs6h8J5blv0lrklircUDVv84FuJOaTsMsD7YkaFRnj\nbkbxDeXeDvy5Uu1fBObUJ27udzSYZXX9LY7PMd6W5obYU6aulgvHG7VpDSpC\n8g7v+ikUVdhrx4KR2KT8NTZYwq+rtXN1U0hjTuvvPDs3eyIwwoMXcapbuR4M\nBhkj\r\n=FZ4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3CsfaiNMZPPbbVGUsavB+opm55dzSRMmq7sZ/g4cRzAIgdwlsLgL5pu0Lctftxj0dMLArHpWbOuPQV2itBrsAVVY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-31c6327f5f616f790c217150fb247749b6170674.0_1618838559341_0.4198025444638491"},"_hasShrinkwrap":false},"6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.2.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","commitizen":"^4.2.3","cspell":"^5.3.7","eslint":"^7.21.0","fast-check":"^2.13.0","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.2.0"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0","gitHead":"2505715fe4920113ca11991ac9ce3d310c7e3509","readme":"# firestore-extensions\n\n[![Coveralls](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?t=C42Z8E)](https://coveralls.io/github/ridedott/firestore-extensions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### CollectionSubscriptionRepository\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\n```typescript\nimport type { DocumentData } from '@google-cloud/firestore';\nimport { createCollectionSubscriptionRepository } from '@ridedott/firestore-extensions';\n\ninterface MyInterface {\n  customFiled: string;\n}\n\n/**\n * Optionally, a Firestore instance can be passed to the\n * createCollectionSubscriptionRepository method.\n */\nconst collectionSubscriptionRepository = createCollectionSubscriptionRepository();\n\nconst collectionPath = 'my-collection';\nconst fromFirestore = (data: DocumentData): SubscriptionDataType => {\n  return { customFiled: data.notSoCustom };\n};\nconst queryFilters = [];\nconst maximumRetries = 5;\n\nconst collectionSubscription = collectionSubscriptionRepository.subscribe<SubscriptionDataType>(\n  collectionPath,\n  {\n    converter: { fromFirestore },\n    filters: queryFilters,\n    maximumRetries,\n  },\n);\n\n// Subscribe to document added events in the collection.\ncollectionSubscription.eventEmitter.once(\n  'documentAdded',\n  ({ data, id }: { data: SubscriptionDataType; id: string }): void => {\n    // Added document data is available here.\n  },\n);\n\n// Wait for the collection to initialize and get all the data.\ncollectionSubscription.stateEmitter.once('initialized', (): void => {\n  const documentsDataMap = collectionSubscription.data();\n\n  console.log(documentsDataMap);\n\n  collectionSubscription.unsubscribe();\n});\n```\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-lH2KhnxsrhZyF6fp+1Xp86wBWze7EbL0yVI5jE1fDG6M0xoW7M9oGwuIDZteyKkQx7130OrT7fGJbOfMoERquw==","shasum":"eba904546a49a2618ed88f972f6de599aac85ce1","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0.tgz","fileCount":62,"unpackedSize":344476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfvxfCRA9TVsSAnZWagAAJQgP/jXwdYjnnjqlFXwWWW8Z\nrIxhmTBosbWDAUd0ZX9JX5h2FBCpcySKP5yGkIjSn1RQNwFqo7uURdPSwBp7\n+iNQWJOtqd6DvsSZQobZFYn1WR0iE3E34kYil/M6gmpl93KGvYgYeZfalNIR\nLE/i0npr+m5xK+dhDX8oSYsXbekQ6ToIcfpVYpvUuwd9odG5NDhNYlH1wPvV\nDv1B+PX2JqRkeWzbAh1IKSSc/QpWhsf3Ych/Zp0lJAyBwxExo3kJLl49DICD\npHmIF+1rTiituB7lD4kQv23jIsVYJiKqVc5//bPSMJUoYrGH8kAJ1DAwDyPc\nIyP7BJAnOGt17H62eHvwlR8Oyj7aCaFLNm54wsjLmg+5OU4JFNoxXIUoAk3x\nRFWc2E3kdzNXP8yFHdupJhGO3ZVpbMhvvxyrzX36t3k/AazhEFxpzpEft7Wp\nAcvhqWynBjd2X38gTJyjjfR+Ry9IsEBJIM+HYbmCOQkFJFpJTMA18g44ZMKo\nslrL8e9Bk0afmLnV5KFWUfymDg/5EwV6AsXvl/NdgLvsreyAyJjGTS87+loi\n0Jvp47Qt4gxOeCk+br4SqaDmrLf5p3p+vWP3q+a4B+P19h1JD96hSujrfHog\nfIzWDo1g+AvIFPBlUUKW/sagMPqjTmepPornb6Cx9XjqmyBbH/b8jBiMev3I\nO661\r\n=+qRw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/ud9OpeRpQz0IvUMzanrENqwQiJpJmcTkjvUWzl98fAiEA6NpVQa2H7HlnLqDVHzDd6o/xO+Z0GN2/NxNM/ngzm2A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0_1618934878574_0.8815389521387524"},"_hasShrinkwrap":false},"6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c70e238a2a6f20f70b00d75e6a4cacbc594f0b03","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-AbiM4bMnJWgME0zqPeMsZMefgJzV8k50nkMxI0oB4CO/cyEc4IbIBvMsDTGcPcis7FzqhRBUIFBXnDwMtTzD6w==","shasum":"290c54749cab69904e54123de7f51e5e7c5bcc62","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0.tgz","fileCount":88,"unpackedSize":435591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggoQ3CRA9TVsSAnZWagAAo50P/Av8az3/U1EZJqGWa+ys\nY7x7/jSNU2P5Z9LQJ/hrIXhCVhvYqMX393cD15l0TCDPDG2Uxr1FBl1TMkzO\n/VMGRSq5ILNkErzrN6fnoNIC8EkK0y7KajkRKmck/j9Hn+RCxTcbnnrijLTO\nbrHFnX3ltcEZjNLGAf8JgsneyLC1HX4SFFn5m89/XUC6WT6cvtFwkCke59cH\nkEoEsnZL1s1/1+2NmUxiSkD4FnkFlgnJKSRysR51h6bc4JPVa/rFmurGOhit\nPiVwKdh9yPsiY1GxF4/ol+emPj9KXbhdf3vHP4Vx515R5FAejY4Tv+UGIxD2\njERPAGs/2nYP8jv0Jsi9nqkAYsiMsXlz5JTvY3JJgC1z15eK0lBedGD1ip/m\nL4ALJ8JBX1HQ4hL8rxgu/60pRoBguhOT3Bf2K7jVJVCIwA7pZKRvWUt19y0h\nr32NKg94q8IjkUV2qiquPvpAF8F4+ui+g2QKlxExVPP0YYMqSDITvzu+T3iQ\n2+W3AORNXNaKPEutzVy0Px+833l7ayxNNfr4lHpql5TGCn0BNcMaf7j/yXN+\ntp2w2NnQO+6m6P8XSLi3Kr6QXIlUSE2NY+BlKIizDKJ2HldiWj65ACO0JOn1\nWiAgN6Df0r7fXpCFyc74CPPua3jmZG2F9UjrWNuTpAO5JsmdufY0/Q8AZ1UF\nE0sS\r\n=5R0M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMEJkDx70qJV66dKwzEiYg1VmfDmH6gYHIkwTKw7EeewIgZpkCZHVjq/yu0Pf88Atmv5Gz+JbQCRJ363o1QJtjZdY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0_1619166263191_0.47408495586517696"},"_hasShrinkwrap":false},"6.8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.0","gitHead":"254128f4ae96c638fa436c8c8c47b98587c2b5ea","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-wuoGBUUVh1tzQd6q9oALJTCnneAvIxWqS3LFWvIMtKsqM1ryZy+TqpDGqkESCfcs9hNeceJ70Tu55mj/5+Y1Gg==","shasum":"327405046651bdba209a31e4208e1f710e03a7bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.0.tgz","fileCount":88,"unpackedSize":435841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggoRiCRA9TVsSAnZWagAA4mwQAKS0AMzSFJFLYqyHsseG\nQpt4OT87REiEyF7mJ2k2z/omU5j161PmblDCKkRULHKuBJVoPAJSN6Wz2z7x\nRH2JzkVeRs/i6DQ+Gl6JjhbCs2pq/u9m/SVT9N8CSQ9JKAAA5e7qxXAGSm3g\n/ZDu1wV7AzOuxxs7JGrx6po6dC1d1GcM9gWsHjS77clDUtZ7NTctE6mtL1fX\n2TxIUiZ+XzA39XgtKyxmwG8+6JjeHq+bvRvPN5A5nPm8CoYJsQCnFQKcNC5Y\nQ0WvYIo2RXipoZjHt49baPzEV+YlOWcCNA5N5NnKFKpOZhFJPK2hKYDqMBfh\ncvTbIkyEhVtg3iUqhr2d6f4LDyfCKRxt3PSGZHcm97i9K+kmvIJU6gtiBg7G\nmLvO48TYe3VWA4OLRNL0snc6bqeoPZ2A/1sK2tBOn/A+CtUUHc++K39ze2Gg\nCWJfYz1y4Ap3ImocY/Y0dOlDkST0KwEdDTdNZUz/hHdEZ8R1mcaMHZ2MToKR\nMCdNzu4fishhRGf2pYdlpYt1xk5k6FBDHIfU0UPVaUS9A1WmTPo5cqv1Ay0Z\nVdWh1IXpDkhopKYzHE3oJeSMFMtCJQLqxewgPz6y+Y9y0xyyC3surEFeVijQ\nosTkcekMAzOcX/MYme7ggn3f81x4MCrrZVEqxyC0MJi3z7vKDRL94H6IqJ9J\nN6l9\r\n=JeVY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoIphBs2eSmJAA6f6AWwonTXv62pPWmJSVt28BMJ98yAIhANtHZ/eWwd7BnUVoES4t592ivOuhzD48UIk6RTHbfG8c"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.0_1619166306242_0.08549451045297762"},"_hasShrinkwrap":false},"6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"254128f4ae96c638fa436c8c8c47b98587c2b5ea","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-OogUPp9gP0ZyiwF0JgehN1sTQ+cZdt7uyXjbgWQrtxrjDBRk13OWpfvO7AlbEYmCcwMrFUcD/733ugKlLsxOfg==","shasum":"4fe270eb77c53cb9a8803645cc2fb544dd4934a3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0.tgz","fileCount":88,"unpackedSize":435884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggoSGCRA9TVsSAnZWagAARtsQAJhB1cODzuTP5TxZr3qx\ne2tMFR3GCd4XQemDeaanBI7ZQjgh76e8TSE8BGswyRfSA3sO4Vs2UEwMNVVz\nJo2RbO/KzTK4FI9cgljKx70/+aQWYSQmjRFpeU5OK6M07HKmBGX+OwQTJB74\nClnQWl5nUTPx8J1XyNOGgtJ17Y9pXiCYDPKUp9SV6cWE8PCGwLE6Y7aU2VLa\nM0pYZSyP+3OAc/JtBXzeK7n1Pm/KPEUfJqRKlCb+d4078lj1BcTKm37nrG5M\nFQ9R3n3pk5QDUr9GsFHCPZkY0dStgEoYCuBy3xIqphnKZ1eQ6arfFZ9vZcx5\n+E9j3vVBqER4SuvQHYHOVvYxc+lIUc/GJuX8gIKvYPq7Asr0H38cNqgB5QrR\n34P9doJagmjZ/SpWo2VpW/YmuevM2xO1SJ6aE/rR5z+eLjrVS1REFpyGBKL6\n0ZWTXKat1LgwMIo6cTjtIoiFwwpweWNnBfRn0afWDrLF/5MPwUUKjQZDPu0Z\nyBMAUyqHGDFKHYycijOMao2A39HAX+Ffc5kChLZPgQXt15iVr5ggEle28+8b\n70p/Hhc4DGAYB2oF2ExeJKekhvVLqA9gBb+Nj6D9XoXjHTqZcveQz7SqJ7RE\n7VNcVOa4sk1kF/w6eP3EuRu5XcImGnO/rmo6WD8+VBoCLDYQw9IHqZsD9ywu\nsOY/\r\n=CI+T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0FJ+fawZiDECKT+qeBe1r6vdCQg1oi7SI1X4bSQKlmAiB69VLQMJmEH42yJS1vz3T+L0ZAVjlJonA4h+88CwcRPw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0_1619166341872_0.4406947254231133"},"_hasShrinkwrap":false},"6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0","gitHead":"63bde5281fc39bf092035716c4da7a22680d87e8","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-l1s/r70UQWrIyY7z2Qu772F1ttUCsqnVLkGCcFyckbUf3KbP6zVl4Kc1OdT+N46TdzKjZgnaMWXMsqpaJ3dD2w==","shasum":"2db0d27ecd89f512c9b98cfd2b469634412fb796","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0.tgz","fileCount":88,"unpackedSize":435774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggoleCRA9TVsSAnZWagAAE+8QAIqtQL1vFg2kYoKqMvLK\ntYc95JNPflVX3Lmm12AE2I3dLvflSfqa+gVHEJ00N/A8nQE3tPgvXFESizw5\n5h2m56ue07PYKqIhJ+NFXEumrUTYI1Wyg21QlHzTTOHps9hQFVDHaTfWTrTL\nrYFiWFEXQDYSHOfQtt+53xKQHQ3qTE5BjWpI1FMFQNU7x/aD8W9TZfXaLubr\nKzdfqwSqL/y4vM15Rktm3kdJVgWakVz4YOm8QHCE1929RIWcTwJdcdCRjMnl\n68ZU4UkeLk8lDSwCd9qbPEJCwZ5nBPppeDcPaqiuvrnF6sds45HVCHUf3HtF\n1Wvt7+yZ+7Eams/o3jcQVNKNl4obshstL4VC45sdbZLs9SslSrNQk8bS3raU\n3Lv2DN/frDTXy6+KonClhheXsIWr/x5t8zvBff+MSGmTtdJrODdcs9gYtOQZ\n15DqQPFNiSE7FlZbnRdlHELuSMtga7EWj70AzJiY9o281itLiPAJXhqoICd6\nKIMcb/xy7y+tXu483mxd3SzR6i+32YZ0pVW45TmiBVaSwHTqqFjfd5Ls/hkn\n5kouMk7LVarQ6fUhuehVdzkrV3eMGdNi2/GdeUi+vFZqqDcMQOI5AYZRFFl8\npKjZu8K7lEtelxMGpG08lyp8jgrjpCnwsEG0prrT5fVL0GkKrGks/C9oDKEU\ndkym\r\n=7vbd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6+jepEPunSHMTQWj+KjfzUdj1g57E/z0H4QmNbjx6EAiB8kuoBpjqJSiNjxMxKSXO2oCFebrkh5a0FzvJIzaHPDw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0_1619167582412_0.5930915484876291"},"_hasShrinkwrap":false},"6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"98903aa5f751adb04e1441bb595ed359b43e2d5f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-RrU01sA3kCgr97VyLVszFLGCNOEH1ybU2Zw4GhQO/xUNtK3ZoL8mtAe8cAv6k5Ok1IjsTTLdBGI7c0GZD/zn4Q==","shasum":"72aa7e4d4d4b14091f2c267e23c4b4bb53cb56fa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0.tgz","fileCount":88,"unpackedSize":435774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggooPCRA9TVsSAnZWagAA5hQP/1i6YL39UKkB80TtETH9\n1+NuXnQpWPeMJHz0xWCCUEJDPO1Xgsg2A3tJkZ+y9sHdspu84zoClRlkuU9P\nNbmUCBC27bLV6HdoerqNPFJP1vE6Bc4jesDnlZP95KAmsGUqnHJB/IFSS1gV\nU28pkPW5rs2nKGNBDg0YXAuNWpxGQreP98kCOSXOqX3UJIrh2Xol3n8nRAdX\nwYlRaD5KCgi1RIznjDS64k8Y8wFKOb9NWq0i8Q1UHrDqIA17+RbCfhmW3Lg9\nBRnMZuNnI8jIW110JF96Yf9AzlWCtQoa99qufySzaLOiHC///jdfq7wU04Q8\nr8Sg8jM3bldfSIhA3htoaamWE5rILOyTSii7mB3GuyRnyP5J/uRryhIApwlH\n5/GWNeZrtvdSMp3jshMbThk9J/F5nmlB1fZ0y8EjCTUwWftIuBO7pdOWhRyK\noJtQMMlIImSc7zJ9ICWCT1S0c5D7yRPyV98ABi/UdbO60oQwRph/qjbalJz7\nV+KY3zG9DOHmK6Of5E1Hegvx0eT0KgaB6iZhnWPnXxlmbmTg1c/RGFWoNUHM\niJRgZ70RzzwUhhNYOdqP6v6XHfUoiTr88UMWanH6hAkDhLoRatRK5JJ6wcMZ\nuJ13D0J4r2FMCb0oIFf+p9389ArM/JEs5nXSXXdZUKi0JiGO52B4GhTDClTC\nxJEH\r\n=XcwX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBNWs5hM2XXjewMRRBGJAXxzWXFsfuM16b+Do+AN2t5AIhALjOvPnuW5z3Q5LiS4Mdu7MFTYj8o8EpYKwvK8sgrEV5"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0_1619167759063_0.49676532989489997"},"_hasShrinkwrap":false},"6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0","gitHead":"49c830df9f6835d568b229c9eceb0fd711970d3f","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-cBB9cMwo89Wlj2bll3xbcGIPO7lHvDNAUql/pZQQM8uFYk++sPZUqQNdHWQAVuByI/wrUD5BwImL06CGvrGrxw==","shasum":"99d7758c84c8878df83fa3de2ceda6f2844825d3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0.tgz","fileCount":88,"unpackedSize":435882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggorvCRA9TVsSAnZWagAA8uUP/0wCARtM+s0XXC2xMo7k\nynMCInJG7BySY3Tx7IOswH6uQRkl3p67WRYLmo4XpHFJ2eqH+NhK2hoFaher\nZShV/hMV7nbknrdooY9eQxlwtzsmnxOoDfduljJViCyXYzI48swJyI8XvGFC\nzUl1YXZrN+JRGbKF8wUF4eZBxmjciiVcRI6iSeMwImepP3DubNuDOIihYNcD\nlnaIW4I7xqQqM18ep6uOSKCS+q0bCowc54y5W9qYTWblRha2PjPUhRp05hi5\nQtMDQMEvy1f7pyUe/Xuz3YQeK/MRCBy+gPI3SiTjEZPvTXPy22IurdNsbC45\nEJ4EBmr3Bm5ttkD1PncFSfRrsZcauRbDTHSEvVMZnJDmNOJuhdNBkOUMBR9R\nkVLHkPuefVEDh5HFle6TujoOgU4voKJSINt56xtrT1AxMXmvfpEgyUFosmdv\nAyLqSnfro/P/y98RkvdYnu3/CdCXmXg80Hpu+KodiML8UwH7sn4AgTyOvdFi\n96RrHic+xjlo+H/DvclCtogTbvc7N2zaTftJJAXXW+iSWQw3Wufr4mckOhxx\nw6Y2yEO0qD/xpvT/TGyPs4GIiL2IrUHDTSeBSw8i3DPm8D5G4vY8eCQMm2Wg\noX0EMvuIDgofyLeFWtq3eQlkUAteM4ZzloDK7n2ArvWW4X/0Xg0HgnkL5/6I\n1TEb\r\n=7vsC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjbfZxEpEYbYriDJdUu213/+LWqo/quHOG+rTCsAneQQIgcGNoaXB6LUuXgSWzZKKPkHCHN9BogJnn+oJUq3JDIIs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0_1619167983485_0.3925108653538054"},"_hasShrinkwrap":false},"6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0","gitHead":"8478b6242af378a53e5db80d2a8a1a3695eb612e","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-UlTqN5vHs4T5b0jmWjhluNV2Kj0BC8WuzMMvWJC/FTJIOKj/nJ82vxW3BuQLii16Js8OVD1QZuIIKU2x1KzN7g==","shasum":"d584eb4fc7f9e6a2e37a6d677f5c82c1f1145a25","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0.tgz","fileCount":88,"unpackedSize":435882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggos0CRA9TVsSAnZWagAAvmQP/0hMUVunU0AFxForcj0O\nOR2T6tIGE7JoS98Ym2MnoGWMOnEe5AWB3TEDShNXJWAgiU0h8GlL1AAvTnHW\nJ434g+pVIqoA7ud5qepxnScs8p8yePwZUA9oQB6vm3aFmAkSJiRK+K88XqiD\nJ/PwZ2xU7um38T1euaPx+DIkHLIFZwx8Zt8vrCek4ZTIvjZuwWOLyMaXVDBC\nKxnKOESOeYB7nglUAc6VFULRFxVSZahuu+uc00uuUKGK9pe6xAiccqLgOUN1\nFoKbpqxAsuXqGTb5niBY6bGILeb+qborFM890NL7d39UTVshs5t+4mcrbv5b\nrM2UqZXDKVMU3Or4d6FTVu213mw15GvOFOCsPqXCgNkvu30OxQtqbTLsAEqH\nQVZ8SVPcs49IBTlAcK65vzNTGA9ZU33X8Zp+8FyWdPDSkgw3dL9uBc36ERIy\naTAtsL55d9ePGy1XRSH7svi+p+aVlaS9uKiOkDqrCf2L1zHJYcbVoqF2ecu6\nwRs/tyrPzc6ZRxUKmSKyOpfhRof3VGn+FRU6JXGunjQYUSuVwsJJyY8VDVAX\nR9lO9riImdELkHl0ndFY/gMVkz5JjuemHtpGahCVRXrB5w3QAZzsl1oWQr7A\nP/2c/8Oo/j87GUMpNKUssOuOBsulHY8C9gX4ePVxaiOCe+LaxTeuBo1gvXlC\ndpBi\r\n=5vET\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRLXIw4k45oL3oW5DQGi5rDA/claOPlPFb8FxByyo3hAiEAqrB4nyMax4R6CizKpQkgFauyfiR795I758ZFNDkKmao="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0_1619168051979_0.233730878498698"},"_hasShrinkwrap":false},"6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0","gitHead":"68b460bb568c2658bc9f2e459d30ccdbdddd97d2","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-UkxTnHf2fFxDMIkAFxyI/IJjMOrMuTUO66LVOwzSKrZTi+Y7p1LHilIiIn580CzMY7Vbg6URXNm1v/RNoHJUDg==","shasum":"14ff8cee24b425f19e7d6a7179c518f0d2727007","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0.tgz","fileCount":88,"unpackedSize":435882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggoukCRA9TVsSAnZWagAAwFAP+wUsgwFwPoxRwZ+k4F1U\n+fA3/Fp/J6qbJj+nyuicgX04RlRIvG34WSDVyF69Tv92JMWhtPMGKtISdsiW\nlKJPH4mWZsaJ7DdTWDXNTjTVd3O0gQZd4ZuXv2wTE706M1VFVeXiAjzBp3QO\nHfoJLhz0PIsTDdCul7YOMQE78Q8NFk6wpH2/+aGuJrC0j8VVNVc2p/m0bJsR\nk5irOhwUhGWBOwNeigimTcqiH/J1RKuiQ+GITnWGRxfOnO4+oarcfEDwpdZ6\nkcsu4RBDnky42VxUIE/9PnRuD22j+MCi+7TU2hhX3kQdFpnYZL0MD77s20wu\n2vA7rQBIRlzC50d8SjUri8d3EfRI9Fa+35/DtVwHUX+bVv25Nu7uLDshIuOc\nAunfbileDMjNLiVLVN+B00SItaEHg+5xACt3wuiZcFuBMwYU16kEo1cgtIa0\nS3cQnJgGLoZRjgWG1+rF8TjkeoCU3qgpPM39Cf003rZ0sgNxLQTSpmdtp8Nd\nGRmBfAXsUp/2rJQ9bL2IEzgOlpqb8tI6zXSRUyxJtb48qL5HgayOvjlN9+lP\no1W3j/kFRkn924QMRsZo4Id1rd+if3bxIJRqgYQdoT4bNK8fav4ktA9qjLOp\nCgSapGVErFcWDcARDSAG3YX/T9B+D/sBWb/K9QZ651hkAO7oXQ1GNbSA1/3r\n7/gk\r\n=Xz8B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7kJyUSY1X3cSapccjT+/+O+mHBIIXmRICMdDORDjlTAiApHnyLC76AnOLGwxvd/Tq0wcNHA3FJ/QXaFX/XQas9NA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0_1619168163648_0.7147739778121187"},"_hasShrinkwrap":false},"6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.9.8","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.9.8","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"d06481cae2bb6551ae222e9d7a61e0b8b623d4dd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-aQG7uLVxHW2yHjH49KGWW17AvE+D0nGDen/qCbGdxdrXJwdGU0zDWahY7XX3GCNkd4U4eAIidMu/27uAUcVyEg==","shasum":"093fc650579e6cc8fe3ae7f3bb62e580e8d6c792","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0.tgz","fileCount":88,"unpackedSize":435882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggo3sCRA9TVsSAnZWagAAzpMP/3eOsa+NxfV/hL1V8y8e\nMDFjZu3mvBBn19GUtIim6PKf9HvWYmRQOdhVTwA0tY4CsiGVbmwMrGF1CUCA\nLmnP2B3rsyjKxYJs9V9dfAmp7589BQ0ono9qFCEZvtnR3rFuGs2QxXMjbvXD\nXKnR4GrhymVEI9fKGUfl7rd2B4Xy6T5sO48cAT+HF+eq6iM54IGI0H3Eg8YW\n7mGjdvMdtSAnWIAUj3+Oqgtv4unrt5glZbIiP2eadFCgtI6r2XbfsD8EX7bV\n64wyqAOylScP6hyuCzDtsPgmnEznawXsB/ri2SeQGPD0zzOUV6LLBqVxJlx1\nw+WLzYIGynPitTci0wB1L9p7YJvE8RzldnroCZVgK9WCY2TIzF3BwvX+OxKV\n6huoQFpEV80+g//6ep9LNygKRk9wEtIxGFzgx0GltqAEz6hozpB3LvfQsDsx\nQWRIX+iBchmm21KyjL433ISNQOa9foaQow6Cc+sP88MYvAzcjovcWztJxMOh\nNYYTlSCpzZHP5i3Dj/sMpPwuD6UoNOF+kMQx4Hzn1yPwYGnESfpOD6kELRPs\nzxDuLhIhggvA/jAEJnOYcIEmKj1Swn9zmKxq3Qd1TXC6zrrAuhkny/J1EG+O\nuv8HBJGm2+OPhG9NBTz8UuumviT6XatZiDChGl0lAMSTgZFsGlNnoik+Y83w\njoyD\r\n=uilN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBW0Jny4o520UWxwar0zvMh18B80bxcXdRm13CEyucgAiA4trrRQ9B4sGYhMg3PkVmZzdGCOocb3fDoBfHDqUJRGQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0_1619168747397_0.7310403529182476"},"_hasShrinkwrap":false},"6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"43acdc316134eacfa3e7cd4a604527d6423d544a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-1khp6Zk3G1wE8WJ+g7efhQPM61Z6i3u++B15U1+VjeavbX9J/sHNsF4FvxMTX5IhejwgwznTSyYZAuTWbGMqrA==","shasum":"35d92dc99ebc06f9e75dfe7c2657e59bca3ef7bb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0.tgz","fileCount":88,"unpackedSize":435884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggo8eCRA9TVsSAnZWagAAxb0P/1GXKrw3RWC29ofwEVRJ\nV09JkgqgsGYiJ5pOq/MTMg+16if6GmpaiBtnQBRwE51oJtvlo/QCB1iPo9SK\nSlTiG5HRvPdNTAVVITAV12n6UP0rQXF/DhfQ+F3d77MLG0FQmEpH2/QPYaug\nFp6Yankmgl+fAfpGMVL3bijcrtk1AOpJUjWoVFFf+2qPlVUQgGp2X+qDJogH\nI9YUN+lv9Zu+Du7nu5WurjkRen9tsKdx1oG3qqI22u6x9mjVEGZE/AMEsivh\nmHhXLRqRnPBG2uQc+H4eTpkxKvK0Meg9RKeS50zh+GRUCOAQVJveMRv3SVIM\niUIwEY1MdpgdW68lbPSjeG6YgSzzzykC+xGKJuEz+SYmvGmMA6eaVx/Jssi+\nR2+anc0joi9YMAhz7a6paNynNjjBVxT9wRD6d1Ouxip7IQXfoUJWKu0EEyGK\nggcx9t23f/YnP1/HRkYXrBtHN8Kqbfsfl6zoGvJRmPg1ke9YpBXcibv+RlK8\n6xOuZw6Tr2XnuIiiZVdAg+Re3qKpza3rVzjzI/RJS6qDlXcHLNjJmSKjboaM\ntyaFD255INPBzXGxHXppcICr9HmyvD0VBnZ2F7taxRTx1sjfW/YqEDrx+sKh\no8X0kNqvA8MkySydPNBCSgY5/97sxoN4MyDrJ71o6wvVnM9RJVGEpEy/9uCS\nncUT\r\n=WIw4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5GecowL5mvlzotkm5Q+sth/1Fe9OVwwLk/cUDvOK1aAiAj0WejOQ/Z+rc7CLHOvBr5BFMC7F41xswk7U3Bt/W5GQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0_1619169053708_0.35513738463267286"},"_hasShrinkwrap":false},"6.8.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.1","gitHead":"3f1f72664b006837ed347a9832af62037c76126b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.1","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-4hF0tjEw0q9VnXOysOxOCOFNZw7vBfqDE3TyyOF3iSXjHok8Y2fLBxYhagFzSgOgNU4RmnrY8BnJIpgNRYK/8Q==","shasum":"56516e190d25925360f71a0fe8b31e362ec9e659","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.1.tgz","fileCount":88,"unpackedSize":436459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggo8+CRA9TVsSAnZWagAAs5IQAIZgK5yHgGpmPuMRhVj4\nzRQ2eYnhzWl557yppDPs3/C0ma0DRcPOQUJY2sigvR7kQnOvKg/aKqceFN2Q\nmlaMqcrBrnRVltp0UohygjCTwo5gMD5WXQ+slqQcQ3mc5T73T3IKnPpJ8Aj5\ndHzHB2OOhbZR9rLQl25N9q2SNk6tYDYoU/jEw6D+86Rgc4/EqB8znDpaHz8g\n61jFQGt+9qpX++35H55KPrXIbgVs9lySrfh+h3WXI8Kd5x+LW67t/Bjpz8Bz\nc2BeHoKgP+9/WvKiwJfnMaA38d741WerbhgBjvrTxqHFQtu/OtXHhJXKj60i\nWfbJDhjOrClEZk9S6OIONXC/SVUZtUyfwfbb0o6H7J/kPutqOT76h5qqSHuM\nWT0sZJee6/6ncPAeBgttQmFLu0sTdcpXwPyqsN6DQ0bMvkK/Lx56gWyPUL4w\nZB/GUe/Wr4r/oj7gLd2V7p/GXf8EmZYaz4s+bNGUgsyA+EEsYEmXvNm2MaMU\npCPQ72guUioTyWh8KygdVhgfcqM9cuWr4Ed7BuqKq46Ye0ROAexfYWixk6sa\n9VGprfdxsIeCugT1T0S1GpuVpUTcvnvlAsxg4un/sIrMT2k7DTmtdPZ9qwXV\nvseU8afY/QVHRd9aMM7h1i7X+KonyCvHXNQD53S11/aVZmqjPNCfdYgLP1Dn\naszj\r\n=EzKW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+FmfzOTAaeOb1sfISJyLxS0HgLoY5jQMxoKR5wBGI9AiAXvFDLbrqXH5KFdbPOwG8SSX1JqXvaChZa/5DTL3T6AA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.1_1619169086123_0.01269742095275106"},"_hasShrinkwrap":false},"6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.5.51","@types/jest":"^26.0.20","@types/node":"^14.14.32","@types/ramda":"^0.27.38","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.9","eslint":"^7.21.0","fast-check":"^2.13.0","google-gax":"^2.11.2","husky":"^5.1.3","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.3","ts-node":"^9.1.1","typescript":"^4.2.3","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"3f1f72664b006837ed347a9832af62037c76126b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-uWaJUrM+pZoUrVR54IhO563nK0KGMg/+lyFLshsYLr2DgCQW5QNn5K7KmHxm9pDM8N746N/So+I8Vggb1iIJtw==","shasum":"afa836822dd8f719be041dd7f391ae95c7fe5513","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0.tgz","fileCount":88,"unpackedSize":436502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggo+PCRA9TVsSAnZWagAAVNMP/1dj+U2KK76lcjUF6KjG\n5AZ4G7IsTKOdF0vmBzj+cKFGfCLuwADMOUSNtn2BPJLKNrRN6VQe1i7573wr\n5qrE/hevCh0CylZb8hmF8wmCXOMZHoj019A1I9vi8whLv6hX2azOaMYe4hkI\nEHKL4NL3UWmUq31wvrx0PaPILGMgjsweYQ6xF/D/cCh85LFosHSt+yDJzDVh\nWXVwNl5Y5Pp5SB67JqeqiKz4ln5acMBTAkqEPM2pXUxrteC365GJftkbCjAg\ndrvqmNnIuTYUVMa3xy40CseaBryI0OL2cbIdMHc4Ng7kPk85fB6yMDH+caDK\nscsSATX8dsvqPTuzysRq8Lk9dTUljI3KlvyLBuP0OQqAnQbaZKx0C62vP4lS\nClz9pldXkKbkJiYAgI27MeMloNgR0Ox8cumAqNflzCIqpwBIFZ/i6OiBjn2Z\nhkgY4IZ14PlbLo3O29GP93ND59zTQSY7VN+Dqb5cO++XAadc09jI9Ka/9CgN\nyQPFuwCdAIQ5mkK4/ENGoGlde7+wBLFnVenLOEtxb6xBAuY6/Jwcb3YLKNbR\n4WliY0frPX9vZ6WAE4K/HSV5aL6QCjiSaCs7VUuazD334mLBSLTG3unXj//G\npPOKZJ+lrEJiRAHXKCIOScjNkUOZEHz8kLq1NPE+8WZG6LYP2cCzH0urS3FA\n/Lgg\r\n=TGz9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlWhcnbUoeoetYBcFYToMw8ojFHbbmWdZ73wmpKtOA7AIgWn/5u2/lEFVbIrV2Hd2kBkAftQ3Fc+nxvlxLdiO2q1E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0_1619169166618_0.4163283405702094"},"_hasShrinkwrap":false},"6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0","gitHead":"8262b8d9464cde8ce029aeae61359ab3f662710e","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-UhZeg05CjesiNym6HDkkDMJUIt4Gwe1yvlVDDEs6QCwsicC5M7JGFkbn29b7Ydbk01wPhhdSizSmrTI9X/5yFA==","shasum":"4867c565a9ae320652d3935f2e9f4c8813bb2307","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0.tgz","fileCount":88,"unpackedSize":436745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggpYlCRA9TVsSAnZWagAAdy4P/jx25VBS7vquhmeqELAl\njLZHeZV+82e68Lg/XPfJOjGdzodfQ8eBxVCJ207lLf8tbVJIkY/ChSK5gLU7\ngnP1v6Nre9TFgv5Ymrj3YLZ1sIzi5GjiFgsKs7uUwEBs5WngiEiTV7+iOWcf\nUtleLyq3Z9eVJq31IKKq3OdSfJtTOHuWHknMUiHHXskW/j+diNoC7+GTgPDM\nXVguERNvur439ADb+rCbFvN3Ova8XUCPsdWzBGMTrGN+TCyK6aBuL8bjNNhN\nrtTfscRxXio4XKv6jqV0YLtuq7eXVBgmbvO8S6X+a9APG2abUyEASIu+Pk1i\nTqBY4mdvbpQh0PV4OG+q4IL0/8dyH4mqZWopOhlBYOkumcsQLEGlRwq1ibzU\ncNh+5vbQnHjHNpZDLZG4bLetxzRlpu/hkmgsbKudjWZwGuq12nRggkFklGvC\nm0Cx7DjPeFELC+qyRkN00LFN7IJizZHxenGpEfM9zCcosyX3+zsto/wMPPih\nn+HChZYXqfxQNpDMLQMK5vopYJLZLMfy+IvHzoSBwUvAxV34xLTCE53ME6Ht\nj0OB/QM7TlKkjvyRbG0NwTNPWRC5qZpwVQ3kjxFJf2GG+2Fd+BAeGgAGFp2J\ngOteQW7GKwIWi/+3uYxrG/zt00dcSa9EY2MDr8jPqrOqGAMd62tIpKJzZFrt\nQdZH\r\n=PoAz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCOhVBLbziV9IT/IsxftY6hpsccPs72XxDi0O/aEupOAiEA93yVO6FH05tG+ChGXAhZRGdgFTrONxomEoLa430IE2U="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0_1619170853059_0.8410531114280164"},"_hasShrinkwrap":false},"6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0","gitHead":"dd283f9e25479555d42d6a9ddca89bdc02f87f7c","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-bydw/yEyBOFTn9QHbzXZxGG/nn1GqtckdaVBdWUnrkAX7nGsRIv5l9G0O2hSMlX+BHnSZhgOn8WXIHtaSXrStQ==","shasum":"799ccf8ad9438a9de536e8b231373cc85526858f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0.tgz","fileCount":88,"unpackedSize":436745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggppXCRA9TVsSAnZWagAAM+wP/3pGYyFN+9Wl5RzMyJ3O\nzyVu3Afz7uPwRLhgbFlqTN2Zf/mlSc0gMw0YcsPqclVFRV9Ed77MOSKSlUE0\nw+uI6yGTgQl/FpuHJ8bN1E7+l3sgdfg/75M/m3EcC3epqlDXFt/Pp5s4toWB\no13T0s+nVoIBOUwklINHzKPM128DnJNFraiYNWl+5ZAfII9zmPoOcPMtSYsh\nLYxucM9gu59XwauLJv6TnaufoplHO3FO2KKrvpI9mo9Z5YQOlkKvgT8ewNjq\nSP8ncKldbfDv+F0dzO7DmtDqa3TuJaOyB8/txWBEPUcSwWMXBoNmyvOJvwHz\nHgscbrt8b784jiC3DKWZFhE4BarMZly3uhTWigvxDEISE9sPYi8UR1xUUGv4\nItG6KlwSvBtvApa3Mk6D8+ubk60ACTzB4KP/qpzvtqycEqXk/UCfyKm8gIhN\n6sFvUg+U+Uj7tWk++MwwnikAuhJu2QIJkfQQGbuVGusOrW/AKki/ZZGtpkRd\n42nlYTtDURWAWFBI0xkxRDvmGQ8sXel4Tx7kC/TkgBCm1pH6ypAVIaH1Uwkp\nUSE5klC//yqsTwtt7INGESoRNtOPXa6WpGBgIbYAhFL4rCBb4krcJeR8bs1g\nulmOaBom44Sv6twMyMgHtw8OhW7kVvxvz4Nd8hQzsPewkgNYtPvdYgx808YH\nwAtl\r\n=H8Wz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2e7WCFxoyc0OtPNZyNG9d7zHRYgwoW0hNRzs1FnwSRAiAmHhzY6Bess3MczV3qr/F8suWYFZ4jGLX3yesSsEvbvw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0_1619171926848_0.11731907274865949"},"_hasShrinkwrap":false},"6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0","gitHead":"8ac0e22fc18498c803c68d1c21b7e3e102a9d331","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-kXOekMOc0txlDA91UF/6VTk18Hs9soEiqSh9loXT8DJdbLmvWEuuiIo/MdXzb3o/WVw/P8VsYerbaJNmCTi9rw==","shasum":"1464efa3d53b3b0527d4dbb33d024f7208ebe747","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0.tgz","fileCount":88,"unpackedSize":436740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggpp8CRA9TVsSAnZWagAAD3AP/3vP4HouqqZ7O6aapAxp\nIMkfT3ZEVT5wdKJcYixFYGUXCk4jsbsKBtgyOxfFyha/L/iv2wZF56eNJ6ex\naf91cwFmByeJ6GJzx+nayhhZSzCxFtQgIjMOCj5yHrRpYdgWfm417hjU49op\nsPSFyZXfrzdygV7dGtAkO7qED+SuOslwgolXVTPI/IWpfSK8JHbW4Nv0CKRa\nq/qMMQhLcKXPN9yTccrQGuCtvT4U4cInklXb/uh9tB77OxQ/XgMj2q+98iio\nxf1+p3tno7Ul5GIVZ2bpdE/VowJgB/ZvNQuhWL5PG/zRduASgJ33HEQ2ULPQ\no5vyorfTheHzydpksVa/8e4Q5OO0iazFrVwCWzjPwrdMZ+5cZ/wd41B/p9SH\nVMEo7mJttTJXqegbg3K9eIvfoLfXKJloafrrn1T8mXVcTvaOt4ZDYOeFv2bp\ntADzzHL6IuWCt+ISF6Z3YlYYJ3DWzHOSL6XWUmbwgTlXjPCxOdiOb3Zzx8e+\nr57OzPAFerYia2Xoswm7RpdAl2XGXj7x331lw3zYDtnNwee5aymTZ3jd7Zp9\nUPtj5KmC+CCe1yKXwMv3iADXqFl+fB1PGxLjhaJRsih+tIE6sucR3pz/i4et\n2YKRgIWEa/MkongbnbXT8F65PvyhkBENnZyIOIaWiCYqK+ExbFp8dIWpYebI\nKRul\r\n=RyVU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFF6IjH0nBYJmjjnrBhjK8ZaMHc5iQgm38Il0vAAGmOAiEArKXPpIO1oq21fnkcoJ+R3CUP0oA901TyK3+Nx6MxU3c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0_1619171963929_0.9414581031534974"},"_hasShrinkwrap":false},"6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0","gitHead":"c7c3869783ab6b495ce67e9aaf6784f796e99ffa","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-SfnRLagXkvXGrSg9kT1Clf2dbj2bDmhMu/1nwEXUCJyGjg6I+d0IpE7wBUIp3MGaD7zoioI6MarEdkbpRkfAkA==","shasum":"5fee521d69f3c55ee8df7839636f57d4f74b9cb7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0.tgz","fileCount":88,"unpackedSize":437181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggp0ICRA9TVsSAnZWagAAq54P/2+nqNK7asWFClpNsBZO\neXhQL4AZD+kS4QYyaT7rNQOmOv13v/ygbj3tzy3wVf180Zzet5uq+Nsc8Wk0\nsujbb3LcPqZep/l7Lzss2Z1jtr1yVDuaWKKC+HQy+vdzB4A7ovQdFBHm2zWk\n3/+i0NV8uHbDa3Oz0h8CvlKSe96olo5TrVFDhvmB6WfskSI50/QFXlFLbluL\nZaRNeG/I4p7iTkcKKeZpykAmFULPkC/7rbNpsIBI9OMWMWi5u4OC9l2No31f\nAZnbpP1C+/XhNRwKhDJ0MlbzFJMq28OqtbK7AP0mwx7ssJPvNkNsFzJBQbqE\njI+2XEttXkpv/DZflYMwFMeiP5xg7EjdCVaKsxdnQxEdfqDGyiU4hzJp6Q8P\nGLa8cMMnsNYXBQLyjqI+JyzBupW7mRWvGzrr36KFhNo0OVZujkUONfbyuPLY\n1g+Ht5i09X8HbvrpmleDliK7MK7fdJOBvSvsgh8quy8CGdDbhBg8V3l+1nxR\nhlDWr0Wx3HMQgbxkIxgeKWCC93K3sEOLQop7FoK1y2Ud88gm3mRMmOjt+jzE\nxFSJs0cT24yccCpYbtZdG9coVCx6/u2LX6b0yf5BzD6hKxOWaU4aXaqzccJm\nQ3kJGIYuC/wW830/ujsVF/FXdVLqp9Fx5v+5PZBbhWwzrMITk6UrA9REPWuu\nxWGQ\r\n=9kpR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjN+KuBF/Z+ykOUwRm2XQiAiErOvk6dP7Qd0FCCMcl3AiA82MdJusdfQZmQy0yNL7km7RVWpEduoYHD14JKdjwlfg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0_1619172615772_0.9675365690243951"},"_hasShrinkwrap":false},"6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0","gitHead":"1d16b77b62b93a25246a60a0b82fb4c3811c0b47","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-w9hyhq5Fycj+aT+8dKCIL1ATquO9D0+mEDxlUamfaqqnqz9/Brr5wNEa3R1t2ZSQMFOZn/GdHVl3wwpKKL0BmA==","shasum":"9691e1c6b983674331f9ee395ea0d55db142c099","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0.tgz","fileCount":88,"unpackedSize":437434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqHpCRA9TVsSAnZWagAAsMcP/2HjwfmhQkWeGtNvOi/D\nm37weL4BO9UtowFhxIJ6LaGzx3zH7gnEwMTfxkICwwYs84qFCd/EE+OD5pcT\neZdd7eayP1+IaVjsS/klIJ285DM8+s1EbpgcQRmiv1scsK3T+0+2c66aeTX5\nZC4w8qgIWLH56hXCXqpRCXmHuL21Hji+oM+msw/1Npwyn0+nb1yivMYoJS4N\nyBD4jPa8H8bNtPoEqX6a/HkJ4vYi5j/96RIkVQX/SC1DJmvZvY6X/NcJQPD9\nDhkn+hB1cKl1dOgOe2L/5Wn0fK7LsMyuE+NA7EwuqMIJw3hE5A8qSgP62Uk7\ngmH1z2mn3kG+0oGy+BVa6YJ0I6yJ6PkMnN8wB+Ve5hqS4wmGhlKAehp/cT+v\nSNSPlJmhbSuak+MtOLJPFyvTYwTMYoVoUnsFj73lzyHAABdQ3klTExzZ6dWY\nxr6Issu6rvvLbmi6LdZiR9FhQIPYXQB5kWWBEBOLIOJ1cNTYLSlN8iPC1382\nudEJTqCTzVfml54zqdbzV8eQTq7Qr9j3EVD9vwxO6nsQxRemz2aOuWaJAt5G\nJyNxbBx+ZRJTcc6T8XYnXBkrxJcF2Do972XaiE6pwi8E8vbY6w/z20TkzMwE\ncL7UCRvTiV8hGj4X5x3ckJCKu6saVS0EUb53MELT74iNMUUxP2FHMTjGf3KW\nE86Q\r\n=1Pdf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+eBCVwuWiA24mXgmq1wy2xR1jVbTSkXNh9dZurnd4UgIgbGIv3dw2/Z27eDX7JzkuleCioPZLCsRpdJ7Yk5xgoTA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0_1619173865164_0.06881565595389127"},"_hasShrinkwrap":false},"6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"974d257f4facecfab266f63b71673f84bee93fb8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-qLzpq3bz54kG7d/hOnqSvtqkgZv0YrxXY2y1HzXdk9p07iqnF9c+W1GECiXzmIgBSDb+wJc0flpw223sOO8Ing==","shasum":"6f5c49171c8c65ddf09068c17e009bdaeb7b8756","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0.tgz","fileCount":88,"unpackedSize":437434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqLMCRA9TVsSAnZWagAA82wP/jYG8dxnHFVQcIm2SitE\n36QyfS5Pzb9lFCB3sDAg8lCFM0iqJOwQzD+uDB/oR2azrUPJAWwt3AfcMfwp\nevEKxs64VxjBMxC2w9wFd9vl368wxhxKvWU+4cJF4aSjfS3tHUt9RU6p/r8G\n2G9K+6nJrkkNOcJzeLozSze6KEgKv3L59Jylu4nfnAhtzvQkrVjik6zGTuBH\nvRi03yDu/ufGu/MSYvTj7eGolxUOHD+mjP2UahrFYziX0H3FoP/DI2OdHvmi\nY9VZMOZAd9uxPDdrzBjiReu50T3w3r/XFQbLoiec0qzJELbocROnXQ43AJfD\nF006Dj4yoBgx4ABTE1PsOFiQLPkzw+BMj5/S8R02UgTJv1PD9pEoYtufMiqB\na+RVVslaVR8xaSMdIyQBzvAgPffIQ9dhzc41Gbp1Tf1gsMo70c8aP6qEar3W\nqq7NxMopNUPwZNsn0lJp3Njlo/qqjzCIizRRpIHZvhth5o8R+LUPnm8hYuLv\nnwuAfBva6WT5XABduKIsucAAuc6OoqEXBrEYxWOypVVOd6wq86LXlKK0AU1+\noRtT+IVt+c076rMe9VtKFMTNhcLa9ZzPbn5wlKa3zTwjjsFrMAB6Nm474YUA\n7+YGVjNWX+hqFtgrG9hejSIj3SRMC5kMq8w0FFFxd8IybtEk2x6hr3MPoRmr\nwd2u\r\n=tJvM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwn11JUlbRcUKgedG1DJs7hAxGTmmTeANdcgnOZJxTZAiEAtOTRQ9I9SGy0Aju1JoUtpd+UWI+yYp0844V0t2CjK4c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0_1619174091548_0.3684979038244638"},"_hasShrinkwrap":false},"6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0","gitHead":"596ebdf362efcbfc74b84411280812c87b6f0698","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-+POKin9pF9kQJnJLEV19vtu8Z/O+UcjwLAI2cPDGem992UHJbso8VvUBVkCLcp1pqiHbgQPmWyCQRSUGgKcAOw==","shasum":"cec94edd965b4e3b3cfc2d513111f2e18ff4f6f3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0.tgz","fileCount":88,"unpackedSize":437684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqL2CRA9TVsSAnZWagAAdZcP/jTY2gpG1QrG3J97dCDL\n69ust1itjp58v+7guxOafJWkSBVtBSVGfblR1ppWfC5Bu/25X2jsxNS7h9Gz\npOYUCGcNjAmY9T9xbyY+5JRlqL/3WNf24v8iDBkp5Y3oqbfpmHlzpCVVz57+\nAA46FwQTa2iGzIVMbCwXZRdqh18AdCPdhc7Nb7vAvwqWI1HKD7F+o29Clbct\nsaK9AlElO8mtSclVhl/2l/q0KOtgzCd/bFl/tS/Pg4fdr4YvO6fskamoR5aI\nWif/QeNfrNF+0jKtJlTQdjCKA2dW1Ag0iuQ5iXvDK43vaCaw6gtG6+GS7sVY\nuslu0qDzuASBgVwwOEnUvc7O2Q7wM+flNxMeNiAzy4aF0U97ly488R2AAkDa\nzqiVpB+vV8Cn9kaDoGsAw7/Q4mIUyX6/NXtgAT9KbljWOFtzCE4OUYflyI68\n8y+VL8QeRr0IIcjNzXBKo4jbFpjnMHie9MrpzCAQ10KOBcwTt8Dk4xv60eZx\nNNgvzOQh9aY0SnIBxLyljOXek39h5BVa0Fp/cqSkAuZ2Nm20K4J3jNm4HQmk\nCV6W78HdcwRzB6/B5OUDLcYSiZZbeHryIht/RmqZLgrBVS/0Yp8Q4O6/RLy+\nNqb+4H9aEV4MrnHQfmamfb0CbXCqXJOIS9hj2n1g8deJfEoLjrTwGcZ/wVTv\n/RNs\r\n=x7iZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9Kk43VqzFnu1lucKedOBoIlaw5BD/RZC7dkgRYDErkwIhAOVqKcmnM3m+g52OC6UPJOsdQqrH4Rilk0sRTYRf4OZO"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0_1619174134105_0.7221369460132085"},"_hasShrinkwrap":false},"6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"7ff6dd06e6bd921cbf2120c66995216478a74724","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-lzyToVhwH7zSmIZMY16HHXTsFHCTjsNdp534BU28uOzpnSKlJ7hQvD1kCtSTBMDRHPtCYi09fjRAgSqXWz2xxw==","shasum":"b5c32d82a43b2abdbd9bb8ec4f7131724ee3cd51","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0.tgz","fileCount":88,"unpackedSize":437684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqNhCRA9TVsSAnZWagAAK9IP/AgOyg7fR12P0dfRKTyf\nnYBC1O+nbD4Nw9xyh8F2YUIbZQSv50DmyxEiVyA43QLEGogqH9rlYoh8I+3Y\ngBPP0XZq5s2UbvEZsbemFpBQbXy3u3vk0ZAb8C64/Qkk22jYwaERlXP2yW5F\nVPAuCA/oy4wOCZ9OV9mLTnXRW8YnAQTHOp+Zi1l4Y3wmmqsJz/x4DROcjTyo\npXFYY3J6BrJhjVdYaBwr/gIKtAaOg/dH8LfILOAIdOXDRLbW1uVEQcAoDs/A\nvb1aVqQ4EvCqaNq+bNipXPk8soPWSITWXVxag2f0U0OU8bS7JachKwDH3Y9h\nZM5KgiS5dWBnyHyJplltxrxRNmfTzYqNxkCoSzuk5zKpIauxU60XdbTItnV6\nf7sy5hOuhYI7wAaWVdICxX6P7mYiGADom/f3+tE8Vypp61CeYCjFT4lI1wtw\nam+fizzp4Fd5agBQejE43Wa+OSTXIt6cLcyLjWeZlRs2Usxnqo3qqS/36WAk\nehx813ISHp+Tq1zy5NrMgSCxWshsN/l0X7klFXOExVIaipV1ivnoynbp9ouL\n/b2cLn+fjeBnkkIjLp71mRSu9qij9jzvjK7wT+HuwU6ovwdDN9EpFipDvArQ\nxW3BaTTaXvSeH3sX17dNlbqDGIX8M+Ga2teIp4AdAOqEyYrSxi3zZcRXa8of\nCZmP\r\n=3HEj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgUdZGSXW7stEOFIBOoO12BNNKulTdNW7eg2SO+yPAcQIhANEoMimvhSQqQ0BxAMb61dLJApS0paiPCTE/X7SDxJRY"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0_1619174240467_0.47379772142040877"},"_hasShrinkwrap":false},"6.8.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.3","gitHead":"cfc351f17a3ad248dc8850b7629cedae5f1dda6d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.3","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-oxRtLiuE3H++hfHY3GyaBZG2KYL+QBLVxayXowuleY1dWB7nbPkSwkNrsnzVf9KdVJ2b69r7IjZAeDOooqnemw==","shasum":"87379721e0fab243a467084fbe209d608ff51eac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.3.tgz","fileCount":88,"unpackedSize":437918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqNyCRA9TVsSAnZWagAAZMYP/01/e4KHYQXHy0ZHieql\nVWuTWpoQ6Gx7pZu316os9QMhacnyjNzX39Y5eF85ND5uiJvmzQyzd1MiCsTD\ne8FbrMag7a6MDyGSwNnyN9tD/zweyLpHWL/m2lNzXYWlnmjH5dXzUALaoYmt\nVxnw8e3TrUur8TbpwI2WLsKr7a3qEd2IoN2WItHE7nRFZFZdR0ZI/KZ/CWfS\nRout7ftXxqM5rqgfpXBfWmmDzhpF4PTzRTusiWMdU3y/AgJ0mXb75WT1Ni0U\n8hqDN8ZWvhFuH+2QEIFzYzEkbMd3c/Kh/AVH6Vt0uz9tEX+QIpDGQo3AvXyJ\n5WEoKRJBeWlAPBmQGep8Vlf5mLO8hxCCyML9M0iXDiHABjNPv2pln64NHsNn\niJsObn06yITyMNhB+h9aOGjsCdsQcnfxV6/I6nEQSI71mntLq+qAdvWmHZaG\no44mXJTex4caa8Ozo/Fl7+uRMn3utKaIj0CxswVPOSlSGyQqa+SmEDUqE5pa\n6A2HPKnkvu1JodayV/kzJjTt13n8gaG7+CnNrkJRIEkcf1eWYUrMFqINg/GJ\ndOXIyADUoi0lvtSxo5TnAArTxcd9uCbXXM++iCErKRoMNSUdCi6gSKvuZtwj\n1HGqgKA8+6L5oYwziHEoMk5pQfLEhRgrK776Km+WTxZ2D3HrG8yC0YHMOuLf\nreGP\r\n=jydG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjaOwa+731zdowFT5p2Ocw6We8BcaZk2F3cm/MB8a0iQIgSTSR53E+qqVv4VVdXqZcNB1fg3/TpdcbbdnLT4k5U8g="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.3_1619174257441_0.11303257825856283"},"_hasShrinkwrap":false},"6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cfc351f17a3ad248dc8850b7629cedae5f1dda6d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-ZJ5Ymuedwv6j1DSrNEVWidTte5q84CgHGHVJ72rtk0hzsjKVn9gBW1RDL8+DCx6ZyFSa1z6xlbgClSn3ewBGBQ==","shasum":"1c8893959ee39ef05be8dff5af86de6e48994e70","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0.tgz","fileCount":88,"unpackedSize":437961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqOWCRA9TVsSAnZWagAA7OYP/07QH6HacpialZgZennX\nKghcFAPJSm8njZwFn0p89sWZoy6E06xrIHgiL8f22hwdVVeSSkOibTfhE0d7\nUtI81C7jltAAWMKirap23+JpPy6xa553lkED7gFGWWShs13ltRpz236Q2poL\nJGoRlHMu9E1Ito+yAmg2p7xX451eYNBlva+JUMyn1LdzGmeAdIrTkwxBboCi\nVKPO9J3Ta+HmUGNz9DqcaZTfcPp8nrSifysdhVr4Z4mWav/Sdt0fwD4Mwq1l\nT86414JEa66DS3mOcsDehoItOmeMVinWgVQmuyvyawSRS+vz6rUZAQbqmV7F\npHpZthAFCIQcP47KI0EJwKyvuv1vN/NqWlAA+v0/2uJ8wqMDuODIg+gfj2Z9\nesyiac9T5wJPCMw1qOkv5e7kLsKWVT9KtPXbXKJqsjsxv4xn1hcSEMGz6LRw\nHwb8XYHioNapBxBPOaUoMAi0PaDYiMrmT8cyv8ZV/eQV6gynLz+6bhOQ1FhS\nE//If1A0WKJJKLnbHw2gy1o2UaC60KyANqt2N8u16duhJ9gkBNG/fTuet/SV\nVdDWoqPZjiwaD3Kf4s9SwauE3Fg+ZToo81ZpIogAaigMzhT1C4MmEF7G8VbV\nrGmrQYkBuCIAiTPLvcxBaBFXfo1lSnRTR98kdQ9tWzYS71wJe2afR+/wrdvP\ncWuz\r\n=ftrN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEecvPom40bQLSTlPPtpjsSdivtkSo9LR/I+5tw+0/AwIgTWcaDQmBRztUiMg2rOpr9/BPh83eFYkWaRclBQOV1IE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0_1619174293287_0.7205109018432032"},"_hasShrinkwrap":false},"6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0","gitHead":"5a02b92b601d821e09599a45c883a204eae65d9b","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-Qq3GsLfOwD+0V71mNMrFDmHNSxe5oyBufzbh3Q9QbD8IqIufE9EvsJqueNWisCJ8uXzTpdtFkyS8VnhKjUczxg==","shasum":"1c1fbd992b02233da046caadb4aa1b76696a00b3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0.tgz","fileCount":88,"unpackedSize":437413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghouoCRA9TVsSAnZWagAAtz0P/3ULl/H+/VuwmwIsggPn\nHC+8jSgjeJZOZe/+MpiCjWPwG3rJGoHig/1O+y5IZBX6MgtyaDFjOuxDHOFw\nK3dkFm18YDSFeje+vZt0uZqZnSd8YwQnC65tTPqSemvhjkfIRJzyfwTr+heM\nDXxIwbsBmqiwXAIIsHR0PMSK1usewbJ4WaNRx93GstPImZoFB+Nfcakq4DLt\nKChSSPNyVFgDaximXWsg0AQoSFSwN6M5ve4bM6ahpTKXn+/9oBnfW6q+LSYp\n3TaGLvVlfcln/8QyNhxPLUSuZAhKT+EGLnQ0uKsUGP+m/bYlGHvSy4xO2zgX\n/QFp8L57Q60TtXnq5KNeIwCH74RXQI2ztOliekL2CgBg2GcLfZA6ebEBiWjD\n1NPyCnmZnCKaYdDCXARk/Wx80+7RrEjlAp56U4fuhpR2TnVi8vhGQZFGzzb7\nBCuOyUS8yqB/jQgvvUCB2fBPjEmRbnmP/n2yXpS8+LX7V8ZUGdYPqG7UqD7p\nyeI7zPkZnDbt1zfWhm2duglA/fDsNZHty1C+17jQWR6WBgG03Mvu3AcC7gAg\nwgWrFPLRtxXlMDqL8NpIODPO7firUMQEZBrwwIqsHzgXZtng37yo5VTV3H2x\n9r03ndFRYPRctxyPqtMcaXZxh2mZmmoBxLFUmGpWXyXfybKeZa8RCaSdzOPb\nRNcr\r\n=wpO7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd6OgO37hsrDQKxIaHLAqVsrINt3TUOh2SiwpdJi2h3AIhAL/yy2k85SHU5/g9rQq6rQ3qK/jdcV2Yo2yZDiL906iB"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0_1619430312154_0.5518847188722671"},"_hasShrinkwrap":false},"6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0","gitHead":"521e12dc92785b5412124799e8995a2942443fcd","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-IWsg11WqVY3cIrL80viKIG8D6anFB3crULg8Wj8YN/hCPuDhiM8Fjtc/iRPi41yDh+2M4xyrunrwK8IRnkbybw==","shasum":"db4c74436b892adb2c2ff2b3e4585efec4bd8fb4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0.tgz","fileCount":88,"unpackedSize":437413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghqLQCRA9TVsSAnZWagAA8v0P/jO5PQBa7aQr7a0wTHoS\nCagz8INe5qcLcddwiOQ0aty7MqTR2vimgWqQzzcXwZJrC4vzdoY9RcQ6phZD\nHwZuVbN3H+9jz460yCbc6mOen++0Bav9sTRN15Tk391lW114KWaKMIGqJtZe\nNqKUQpJ3EwEhk5Nc1CScTRZvhyA8wbgxNc4Xzv/AvX/imkBdQkCuUcuF4RTh\n3YO/CwKya3V5DQXFgd6undaZdNnvJxYvEvqz7i7dxBA9rjdL5qgTryTgm55p\nX3G8X0ZQSDZVwRUqjeM3/RmjSKqe4sKCSlBSHUNNTUxALrX1dxpRNDbT60UJ\nD1bxJNr0plTHtakF8oNA1K/Y5RSSBnLVIeOI7th2hXXpo9rtdt69mfLs5oG0\nLpc51YHfaHhNno3YUFiNHsmDhYaU/i0Lh7d4OM/myCoFqI9yxWPnYqXMPwM9\nBCLWfnmC/ILdTsLIYIwhovza5zSSRtrAfGAcwuGpV37qwXhWLlK7pUw9xOTG\n3E8iu92DQhMHFF0D9soXDGHfXxIbbvYfGvUMJyDDHEUsprnTpyt0T4PuTxFI\nk1i1+xSXe5YYcQ0+0rvwJ4SjQAg+qkUI/f6hjhaQnJ9lL8Dz+o33lGifq03H\nh5x9z8U7XWQr23/qec4oI6EZonvloTtvJi2dybbwnYAy3QLUVkPQ2gfA/HH3\nIKBl\r\n=kbvj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9k7wjjEXnOGJS7xnizKcEJX2X8VJiT5xyRbsV8ul07AIhAI1fz0zCjQew+S2fs4zQPIQRqBWaQQVrP3CkcnNZLP1R"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0_1619436239444_0.15112929907744665"},"_hasShrinkwrap":false},"6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0","gitHead":"97384e12054d287ea8162a14aa168306b1b4dfba","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-p1bSt4zkUjU8lBrssUUeclBiEZ9Y6vxqvYVFP14voFImlP1uUgbjCJDMqEFKPbEtmdvRMSb6ORMnndTEnJGRkA==","shasum":"f13e8f9d55b67af5a3d3267046ed1fa2be0b5040","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0.tgz","fileCount":88,"unpackedSize":437413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghqPxCRA9TVsSAnZWagAAx2MP/R11UQmcQ51/a2Sg5sD/\nF0r8mpdnonJfjltZQHy/rcCnQ1AGqqJNflCk59SkUoUj/YxgkKDumrOM2Mbr\n2baJPABr1ODi3hzH6029cM/DFjGxunmZv/T0KK9v4eyU7yxC8YlHkMqy0d7N\n02kqNcR3M69q5Mtbn/nkIDvBhVSZ/l+hp8iwXOt/awYkE8BX02hcIhtvwExC\nAdqn0WxaRqy8RLkeClApfp5ho4P9vGI9XiUy4O+8/ettwmeNFXirsxe5YREx\nmizwUFKcjfVwy+C4JQFe0yY5lLi/la02Cta3lTbMPkOZGaKRuX5rGGBElpvb\no+/c67FSnfVyhYg1udb+8GvuJ3YsEY06Tm5hd9UC0vlQtPkN0Hawte18fDM2\nUFYxA5AEgphv1+/z2zu8NMrrB6T7EGaYqKuuo/iESfhB7N4+L57VVmrW9mWM\nBn8opwW8z96iVpiRBxGDXRNZdQTC3Wq/mzJbz4qZyJYUjN4jofwX4vg8mfOv\nlJk79Q2l+/q5uy6+I4SXpz707dozZn6zWNkyvg3CmaTDApi6+/rO2+WGGYQ5\n6T8vJ4+scjQ5oXNkhyYFOK1SZS/u6NTInb8b5SSSCRBgSZq1tTsQvt1/3peR\nd+2hqk7y7f+b/ZFOuMBdeOvG+l5Du6+onBEmBeKKRDBJ7+iHZyJ930cOBJwh\n20IQ\r\n=BPCd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOKi+mTtQs3jjJTf76kBXsXyigLK7FM9DBIanAMlRnlAiBdCd20W94RlOayBv32ZcZvPz71iA9DbUvRyI0VdGiWtg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0_1619436529217_0.8926351847175713"},"_hasShrinkwrap":false},"6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0","gitHead":"ccb58c9d309724e3ccdda94566b7eaa820207552","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-HLldPWkwoBuSHlmLlU4AvwIPFuBI2ZahNn/lWc9HJrS8sL3BhNjnDSffFSCn1Dv9sDrSXY1rt3YSIPgfK85bUA==","shasum":"85c67ba2b781bca7b8300adb2f3d4c3c5c763267","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0.tgz","fileCount":88,"unpackedSize":437226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghsSwCRA9TVsSAnZWagAA3LIP/iDa09som97P1IgzGDTp\nfv+WRnPvG5dEeCfE1lNR/TyMNJjzOOQFTo/G6d1+E/6ebyOLBkSKIWyQ9HWG\nW+xXBaH8BlhUmSyMBidBvxbm05EqcXhS/WWo0vsoPj9eR3bU76lEi4E4K+Zm\n3LCfq4punrP65tKB1ZLHrA6tdTg+tNSaLmkKkqcHQQp/ZmYzXeaFe7MgH9W+\nhWQsKOLylemW9kSYenLrjQFXVflxGjUid4S9hTLq57gebyL/H6TVPJCPPuHA\nbx15e+rhOuj3hKIAWKT8CMXVh/CaOfFXCI197HMwLLdKr1PsE8gT0MFPEWZh\nK3pGfr+8feLKhQfnfzgi3adR7a1yPLOjk7S5v3QEjnjyTH9F7MuIhRq+h7iL\nU15vLLsXwmmfO8CRqCScJDfj3RC0hoG5f6pMrpBwsbQlHtyUNerotnZIaXwL\nzZkxJanhea2I1MjHOSbXCk/WLbV+SxWo4iKK1ZcgyS/I97X3YUrCWvagTOFu\nHNWB3eIa8bTs5d/CH40XykGHBxC4z6WxtywvU8uRz5UyvldV+/vWZtmk48ci\ni9ynqA1H+uktbbf2bwlD90VmAh/gy5Ymxugy4OArAyekElz21Zc63IKlJcZ/\ncAMhjb2h+J8wQasyDD+oXEIifYGXHHelf+3zc03gqUwPR2pvdm16os888/pm\nMxoV\r\n=YqJT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8SIBocgGP36E9EuzxlT3jPD+OKnUfrFs6KD51GP2+9AiBPqxdlcg0PAxjS9leGRcMeann9jioRMrMKrw/+xtaz1g=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0_1619444911255_0.15122388042459134"},"_hasShrinkwrap":false},"6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">= 12"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0","gitHead":"a908a9de2db0de631843324e6edcaf65a0809ce7","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-hBXR/WAug7wQC6sLsY60sb5RuFTd2+Z3Z29tPb5hYBO4EPtg333JObIc7XV5K9pNwjs3RMY8jS8X8M0fT0+r5Q==","shasum":"2a08cfaf7a146509c59ff81e94c0af80cd646907","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0.tgz","fileCount":88,"unpackedSize":439872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiliWCRA9TVsSAnZWagAAtfcP/jAjFH66SH5P10NCt/vy\nTxe+9EdaB16P2Q0ux5qLdU9uTS2/GJptibMWhvNSy4+ZbE7IUqTeRO1kj1pB\n2Sw9jeSyrDKmM445Y90k57nara0177gxwohNpfbFQk/6OOvFtg4FIlZtcHnj\nw92AP84I2QcpSt6KFmIXk004Y54xO7p+zVqJAZ5txujeb+9907arXhjpRpbj\nRb4YrZAdm8GHjIaZ4JjkMtumD24bkmZD6wpTB2UWOiavVLBj2dKl7XHWZIkA\n0y9c1bUwc32ubOE/CjjSRv682Fz/2FRj4HQDx2u9QS5PyJDJXddCYWaykYek\n33YQZm2DwLNyHDTC6Gchcw7u7WQjQxK9h4SIku0v6SDrdtXTQ3V01qz+zlHF\nz3nkEKdJsxxWO58HHyN+9ZKW8nbuPbY6HhN6lZDfI3bl6h/u0iRII/uMEBam\nYlagIzkNZklElAdqhzJdhvOYm4HcEha7p8pyk/lEynbRCcpciKbol4ZFASa4\nhQzUO5BQrYB+7R5tHdyn8lC0xRn9nXnr2LtvnKu99WIybAmEWIoSI9spdM7d\nI8XOFkwST7d7UYDrzqxOa22XjCsF8ucGsQj40HbPVyVag+OWHDFPAWyFYN/R\nnVX5dSW/v+39JToZNrIGKTmgWUwe0XvHPCKUIB5Me9Sduol3lR4s4eCkXv4k\nVwdk\r\n=PCyC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDM+obfjzThcwSgMyBv2Jzg628ECk07o3H9gQuHlujKQIhAIC+DEXj7TpHs91dq+0NfF/AplluqyRDgbL3LZNXPObC"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0_1619679382178_0.20101859427505242"},"_hasShrinkwrap":false},"6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"e886e5cd091940bef2495e659420e6d5303c8a25","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-rFpGcx8uELir6M4IWaUodSvASUJQrFZx6peP53zITT/LZfeRtewfd5pIU7chTNca1DGeEmcluVR2cQvGcZMulA==","shasum":"1ad68fd487b99d21434204e128fb653a169f0491","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0.tgz","fileCount":88,"unpackedSize":437413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6TtCRA9TVsSAnZWagAAzSYP/RA/A0IcytOP3srG/Fmy\noQ58kBXLNnHbLyGUzK9zTBaDsOp5FufBdqR7UEMVDiEZRLkOip7aYWfXsX+9\nVducOBC/j7HunyzL1fFNZVFQ6PhwL4ELOGHMEbWcPe/BrB6oDqNJH3kh+lfY\nPSdNyqgmY7gkMSj/V4rBNrIsz1HWI4RPWtFPqlEjuZ7x+/ek3WdxRJxhLeei\n2w+YAzABTUT7uTdFZK9aM4sWlYqeOtovR2qF++WYAV//ErqvWOag6HY7VdSe\nSS2gih/mtFbmALSUsCxotm4sA4Dd3JKg23gX2EDVEHL9NoeROSTGjehqjGZl\ntcmKnrVj+9wlxgA06dQA3BveWybtwdVvoBP4mpdWHB74qaSxkKGDu54amu2G\nhjxYZYG+a4pazNHa8nBih0kkgGmgUdIO/67S0obBz9wxWKQ/wWcGP9o3JviI\nY6dB4Q/66SClk99Ptm3ybS7acVZi/5GDzWIOxA14oy8WMFjTkAFDkU33Gu89\ndmQBLqDVkNkdxs34x4qwksAKfj6CwegtEBif3q+/fJ9fXbW71Ynb/dTJdivS\nuFu17cRBbtibkCELqnITQgDqLSrVmH3ccW0BWcemN317oZh+zu4myv5MI+hV\nCiRbpVQ6cybQMTNyq2e/AeDiciXMFs/8nl34CkJDGKg4vvqKXfOvhs7Qmp1s\niJqS\r\n=LPUx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrk/4y6sU/8yWI+HL0pe+4kxlAcQkGt2QrzaX7HbwEwAiAcqH7nT7ZcT2dWnVwuNTdWfxLcgBAC5ciLMJtdROTnjg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0_1619764461011_0.019922660315873753"},"_hasShrinkwrap":false},"6.8.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.4","gitHead":"35a7986e8e5b9e366abc16deb5c8fafad967d110","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.4","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-VcG5hHJ0whi0I4+4v9nFoY20p8nUnJRqRMM+oAeHx2jN4SOskO72bVI4gJI8tRZIxMLt1TH+mUYImywd2YKaJg==","shasum":"1caa5daa404c42e741024cbbf874c9d4b8f935ac","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.4.tgz","fileCount":88,"unpackedSize":437625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6T/CRA9TVsSAnZWagAAnWMP/jBdGcXVTIoZqrfQ4oaG\nqIbFcvZAIsEXbBJ13Rl6pON9eFEtuRTcRe6SJgGcSM4tYJY4KwMr+ou0lh7h\nKRmYq9JnJxqJaenR9jMHwjJtHPmkavIwFe02GsK2UgvENJIz+mWSTGRaBHsq\nlxegSiOjmGB7P7RD1FK90kxpSkpGQlmo7WTqzOaV9402fyU+qJsUmCfOybU8\n1lqRvxCxW+GLRaK1JZWx5+PgTDWj6APuaGi/fnnRKmwwcDPGQi5OHldrKgUt\n73jp1RWRTLMhlXcGmSzBO3qgOaBZ9IG/Gdt2DLnvB6lGBj8INW5H+Vec5SIv\nfcZPyPehYcFcAtOnrQ1GPujNHrJQcsw1VuHwUdKTpcUTvy5oW8M6L5rRKm3P\neRtuKNWQBOAlrm9fRtj60k2EtJhna6b/wFQG8iZ9PjOyrteFaBx8HHWA/fL4\nRZr4pMGxLjhgnGlZp0A4F0G3zRTf32bdxCOYEWlAW94ivqS2B+SWmm9Ax8zU\nnscNrbvH0QiSwtrJSgWC08eVPfD0Ht/vImXmg0cI7FCnmb1pxucnx0d3Itjh\npKkHElpj3XEr31gsExP6+QwYgWog3LCCJdXeii+VKXxIHuAWbn1b1OSOexE8\njotVYYHAe5FhTjX6SZzpUBUT1m4Jez5k67mWKGaXiFm2H6/BlcgbUpy5KKvc\nDBds\r\n=TmHH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuFttuwvAXFEhq+GHLD4HMDjvcHOASPlWlqxyI1k/CzgIhAP1Mn7GgZTtphgsfWml1nQjNfL6Y+fL3pVgHnco3720i"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.4_1619764479331_0.25339950067171646"},"_hasShrinkwrap":false},"6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"35a7986e8e5b9e366abc16deb5c8fafad967d110","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-jFsSsHT+uEiHZoqjlG4s1aR9jLJGLQ6yPfX7t+fVrARjeeVlqVmJgR3SQ4IfkIFkHwSWNCV6mQ2fnhnOVg9uJQ==","shasum":"c90eb0542eb067d789c641ebbf354d55d86c5bfa","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0.tgz","fileCount":88,"unpackedSize":437668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6UfCRA9TVsSAnZWagAAPpkQAJk+yEW3laF5CK6ZXYWn\nx4ORwTzse741wcqGhbMamwPKXGCt/m6P6vNxaaFrie0opp3fS7tyBFOZsGM9\ncE9YrAJ3Bg+b1rckHG1hli7Mzq0JQmRCHeckW1Z5nte8rgZeoIWvkc+82ugp\njy5B2GSyvcrkcelkCb/pMx8keLOFWe/Vznmux0maaNEZVcS7D8OJsvJ5L/lf\nWx6+QsskqeUSIPxQeydWKuJHRAZU/vsCU6cGSSSHi0u4o2TQr//v3hqNmLFt\n4I4+Mb6UjuqNsVeuYRHUZiUsqyswXkNDo9HoV+b7unuVLzWTYp4sa/T7yE7o\n08Pakp9XqKsoF/fi2i+t+SmwQNsIznn69oqEUErPtgVPhz2mtbDcT5tne8BP\nmZJHasm7MzcNjaKzLuoFu+/XUdrbAEMgEx8jcfD0lr6jc47JasFwCxnle6pR\nBYgEtH9n7GRRUlltxWonQoC/FKKGMmsEDVx4XxlAsBRX2WoEDvhGJjSPdqcx\nMIf8vj9DmYGy5BZojYDqC1P72YvCn4uEtkk11fY6TiiEoJyUTIynZ1JCRgXV\n9/DJQ4H0qEyiI7iqALRqHHaDkyzRfETUV9UKu+AEPXvN06MZ4NjjNPdexhhY\nzxfkGQPkygUxn4XXtjVugJCTJR3nJJ0ht3eE6iqWp9T7Gd7/wC/p5YyPyKc6\nCXnx\r\n=m5e+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDicrW6iW8hjLGlinckob1CfSrl9GP/zEKeNt53KVwY/QIhAOCwmy9IYeJp5kvdVi6oaAZOXp4v6yN7Jpg+7Hb9ZCB9"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0_1619764511076_0.3734946301074673"},"_hasShrinkwrap":false},"6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0","gitHead":"bef49c9a258a83be0c55bcd938bd6521c99302c2","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-ci97oS3rxwObg69ZlnDuHbqyyR2T3s2SgkhiH7QNjCOlu4tQe71N6qHo72byetq/JEwL7erXm3mhmNP8GfA4iQ==","shasum":"8601d70b815738cc201dadf05c9ca2dac2d836d8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0.tgz","fileCount":88,"unpackedSize":439579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6ZgCRA9TVsSAnZWagAAxqcP/1YnEZg6jEKnUmC2e83J\nECXRYByebDhRgRG17f8SJQyhglIR7X8MlrsbhZyX79YC634DH5ZotyCWJNZq\npP3n1xdnjjIqZY8lrk1N6oFRg12qtbI/HKt0bEcwUv9uPVU8GMUW69lpGTiQ\nTUfxPvZHOoXu/wHzejmroWQI3t5bsvaxASTGEUVx76r9joNt90fIxEY2CBvn\nhs+ObDR7/2igiDrYBNo3MwcJiil4e3snWuwCxAIL4EoOKI7O5P+sMk71xkjY\nPu/aXQP7oQGo9kPBKI1FL4MVW480t9C9KarI4DqkOpc9iJcwUUA2O29pzPHG\nC1pgSR+mm4w3TwAMaAiYB6P5yRujundBNjfRxIRnMXEXwtIJtLqDcJsdKaXE\nNuubiY3Sx2UK6yLB4Rxig8cm9Rw+6LPvlVYde3rNsgAob6oWhbruN7uOFBD2\nytY1PzRa8JpAHwforjn8k+NgpUL6k5bMzbaBOWZDnRQ2TL8lzRYCelS1+5eK\nHk2HnnUwUq9dMDQnio3FJy+hyVOy3m7WWeIhIbVZR/Qp5TPS5FdydqXssxeO\nT1pA6QgBx3OLO1nQeqZP80pTjGOxq46QcdMXYmtUxzCEgpdDBsYRO9zjvJ4k\n80Kmzt6WsgxJxCIn78NoCX0W89tdmIdbpMsjTb2jxnbgYCKNgHHfGzpvoT50\naCQ7\r\n=07f2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAubLgGUf7FV0mhxaRghiBmu9Il0alxHR9UtwW0YN2AtAiEAtiDWq62CX0hKH92MLOdTYUll4S7vVcAuAhVa/9Ztkqk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0_1619764832292_0.44819248427465164"},"_hasShrinkwrap":false},"6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"cda168acfebb042d353bc8ca42b41b2ad632e99b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-Ir0d9ovWlHYxNnT7eIPa0Q2OGNVOlfmCmjPi8o5OQH9BJi94DW0g1vIHb7RLAO3FmQhIIoH6+ucpQ06oxhx1bA==","shasum":"015829dcaccaa3dbb5600e115bfbfb66d15452b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0.tgz","fileCount":88,"unpackedSize":439579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6hCCRA9TVsSAnZWagAAsXMP/2WOFJW/xXBmR9jmoYgU\nx3rAdd9sUNI43pfuiOvKUSZYdqOZAU5Wtl4k33g8C07yIlsESKUsV7mq2Kzx\nMusoowWWTluNw/XAb31vpQZ1/uXrtK8ENzGT/1FL9K0T0nrhSIPMaZ4GMYfA\nTSxYZ+/QsmJxYTQ7A7D0j6cNrRAwySoTpzgjS3qzDlozDjAPkTaQm9iuuZp7\nQmQ91xpWeKkMuWtzLicr4jHdtVwBxuVUvihdj2u6JcjRA+AFwK9oCGVA++W6\nE7IL6Lp61bA6d4PK+Cw8z0moHLylusWR8FGEYD7DAmMgxddpKdLvvoeP38LU\n2zqQwVM+IQilKnS0t/hwu+4fLScap/cygdtHG7DOSRNbxJzSg3pAIBQL44n8\nP/7cKinm1ER0MTaVxYH0rh6GZqNYVAss2oryJowZLBoRmGz5kZ6J/BTGrkxN\nfsxjSUllcjnp0dCm9pBaYtwMwQuIjJNiaCVhmomfw4phvmhcCFou/e49wvmg\nRVERheVz8J0eeJ2pg0N8tJK9g6xyWWYHIM2UZsIpaGN2CsCOnrYTKbXvIMyg\ncsDX0GWRmWhqniOMtA6x9yzYAADZCtXWW+LfOpZFoxW1eIdeCK95PUGMI4yu\npE+ipIxEZe8HofeIAara4idnqTY/y1NYPcOvRbuCiFyqER6HRpgcB9rrf7By\n/+w6\r\n=zXxB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7eS6BUYW/LxpkVYWumVQrkdDFFrzpVIBJWHicbtP/JAiBhFQJEmg+M6o/zG7jeLRzIEYaY1H53EqIJSN0Q0pBdnQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0_1619765314109_0.562521848693083"},"_hasShrinkwrap":false},"6.9.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.0","gitHead":"9a3ff2923f442e3e79a57f88f0145c947232f23f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-f71lUY5ORSNIq4u2qWPxBbw/LyxP9KhXZa/+VGHKLIrvCjtyR3SDS6eaC/77NCy6rVob/nXs9vgggWdnSujMMA==","shasum":"69ba2bf7f4fd3a8ea3db6b565c1c2a51c6195bff","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.0.tgz","fileCount":88,"unpackedSize":439818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6hcCRA9TVsSAnZWagAAT8wQAIxKvASbbPYHf29lPx+D\nNHo+2dFstcrBPCkGeowNWmvT1X6aefFUYbWvT+RXdKkSIJIGnrP2s6ptMscQ\n3hYErPP8yl/blg8ZeuI0C/vwsDHmzbL5RGEzx+RPdQP/oa3FsT6f7aWcX9VQ\nh3jj0ClEItDn4t3Z0WVH3IoQlPFqbIQD7cbFSqJopffxYKtSOTpzhgSS7Oyu\ntz1i38a2MA3P2RUKbdfpEV788mHaVDu5NeDtVtoUq4t72DLriavJmdcglwrD\nixveFPYAbsfQEMl1bL11EMZi0kBYTHG4rRd0wAyNrR1ZxbBdVIOY2o+fDLpb\nCV10Eegk5z54OSTObflMHZE04AtIIPIWYqz5GKpRyrtJIAcqt2dSfeKhV6Po\nCZQm5FfgBPDCGrrrBOYVBhYHgvKJoSoS4shsPaIRD7jLo+1donNDs5p/FZX2\n1PVWRA7fb6qNq0uSskeE1HLoxNzU46SZPN4co/jnk4+iGxjtXDnEkBXTXMT6\nyrYkWRKVUhU8+RMqn+MJTgHNB/fa/atYw76NnDeKq5+2MGm27F9TqDXIjA8T\nB4aEpynB7+ohhy0A+KAKXuUW6jqwOejn+cwr/WIBcUiOD+qyZg79g52pjlKN\n3s4Z0t9lBMrRTi68UzwuXn5uo7nbG08ak+S0ShunAoEaIDzAP+TsD6M/NXX4\npSnb\r\n=tWzQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTsOIoaw7aP8Dql2CYs+n+GDdJ+bkqYAOTGQ2HGb7RrwIhAOMPVTmL4B+z2pmhs7jheChz43tTTFNjnFvRVfgvB4bL"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.0_1619765339614_0.32216679566572726"},"_hasShrinkwrap":false},"6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"9a3ff2923f442e3e79a57f88f0145c947232f23f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-5FGorlt/xvXOSowfdWkoJwVXHlzfkvG5DbE5sM+oINxac1p408M3VD7cxmPMvG5D3LkzZ1sAW2uk55vL+nWdvQ==","shasum":"4d842f88b41c072dbe262f3383f4bc90bfb3de9d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0.tgz","fileCount":88,"unpackedSize":439861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi6iECRA9TVsSAnZWagAAxXwP/RIuguDpl2nZktpOnRSX\nEVsCKdTZ9CzaGGu6+HHn0JiWd5dRTnh5/PKe8tV7OhL6msVGX3sLNpNUjgRC\nCzNp8rFawfDcAtQMxL3+dznOYVF6f2vAJwZ6xNj8qa6peVv2FSNvfC0MzdpI\nISUlr3f5waSghYkYCaZ9fSlatzAxpIKJ+6CFfqtSZ7fW/ZyUIpD12ZxIMMZF\nJK2cBATUZk2PutuFHlkJQW9NnkdoFnNfwQEhDLAHGHNlXLFKWpqWQ66i6tNH\nNwYSjsfYin/sX9EqBFuYlBOPpx/CFeYZoJMfH/bslnHykX27zKMj3wj3lGlK\nsw8If6GUot0rIHyPLs6ehNwduT8f9odXbVkmaUOVnIatfgmbMi1pt+C/4K8g\nMkSLayBowwaUpCsBVmwS8FaKGOgJwJdBLFpoHjc6PvPKrSyLhXpvpfB1gJdJ\nSRvyTm9HxjZXngTvamPbRByGQOLn0HCGyqDJDCansngXgFB3AdhjyLRB/MGl\nkLBr/O2DTp0AJ5ySZ8kjz9seQ995bQ0dA1/cPdNTXCrBEDKmobrh/zVh7Ux1\nysknX9rHKoc5bCNfSIaH+hT3llgd2AdQVyNpjX73wfw9qPtWoWXR1z4yUjPM\nu2/Ly1h1XcUVXqb+j/jGVM/zhshhBpwqpHosm/hRp4sPXYk9t2P9odKJsKD4\nOIxD\r\n=rwtp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4P/rYDpUxR0PfNjtimOKLb9Gff99dov4T6NFp8PVs2AIhAIcLNtSj/mdicDxmf/eaYwN1bfvbaNjVN7WLG3bSd20f"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0_1619765380113_0.18818469082014433"},"_hasShrinkwrap":false},"6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0","gitHead":"8fd9382b83c266ee274d374e6a97dd3d91a182d4","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-ksPVLUrPpe9dPJ+bNkOqwogLu6OmNniIw9T7zp2v8YlN9hfBnHar4MkuJghu+1p79VAcOuEud+RAz8APxZuA3w==","shasum":"43ef0b1ae4540600479b08975c1815960d4d8e02","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0.tgz","fileCount":88,"unpackedSize":439126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkl2rCRA9TVsSAnZWagAA7E0P/AxKY1G5wSrRlkNaDwsC\n9yRtZRauYDam3FqnNuWG3f5a8Od7r0KtmnCRLIj6r42VNIS7l4MTiHAQ0N75\nlcH2Dvron9Qm0uwjmVow69L30KTuZRgdpm7pzbMHKITXH+OV+n+rdOaIaacg\n5ShEQ8jiV4lOisJXWkof7fLo1hh6OBKyU9xMYHeXzRg6LPLQA8GN7ShplQMy\nTHU7+Qq5Ct8IBBW71BL5t0RobCykAXbH3AOUPrB11iXYvxCjwkcq1/uvw0LW\nNI2z8Dp3LIxSi/k7zwh/ycKbsTGt7xZdrZJKLm83d6n/6Orwim2tj+c7OqdI\nuJ4NSIct4+dsgV90IlnpaHcbuQVypBYYWyM7d2Yo91jMtffqkEIjtefUuNeD\npxEc9mXWmWx/dYqWznzX1lZn3gFNa9OSSDJ5m4rFs8JzBzH4kDnpBqgUkHH1\nMoSmpvjAKlrhaCzWSyZTxQkWGihinoM9I5RaklSYRMLFDQDrLXH/MKHVUZj2\niFpH6qZGl1VeDoLLYA3UXtsLbK03gI6ZFEOKxWfRMbsCKtPq2tjpmH0pP8TQ\nEGpe3n2NSjECy8D8I9qlpjkI/ewt3fDtIQHX/28UQ5HqiAZqdd7zFjElYMbH\njpkT44fh/PuqKX6bqP3a+lCn+5LiU0DPxLtwvXUGXqwEMJ19dx1moozcA2rC\nBMNM\r\n=Ckq/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1b3956ELTueFIVnGnAb2DLj0dLZp5CeuYHj8A3sVkDAiBehgybHR8Vf2qX0+4kQ+AJ7U1smv2zI+YKMMUR19YFsg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0_1620204970834_0.33804436292067686"},"_hasShrinkwrap":false},"6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-mZunBhIgz8JoLeCFHpUk89gBUkhJh7qWyz65I5qMorHm6vmQk3jIUKAIFe2l9M2p+ACm93T6krP/hhFsShsoYg==","shasum":"b5095b82e9d819e497f8d25aada55bd2a41aba50","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0.tgz","fileCount":88,"unpackedSize":439126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkl75CRA9TVsSAnZWagAArJcP/RxuPKpuWX+Y9HSlZxwv\n9hr+yJ6NxZoIpXirV55ypp6pP3GNcgrTJKFBmtQlesYKNFSZ1yYTKQ94u0sG\n3Esqgkvr2AiyMT2jnegWRKw3zAp9iWiHpaY7XsRxkvakNgWzpB5VKUK2VaHX\nEcAY0QROuvK4ADy+7jYuYhwUsYWXYoyti4Xq61lpZvDFEv2f2mCxeCOuqicY\nV8xvWx/CDBMde6sHsSTlkxM16C1phoIaex7vw6pjdeJvbgLLe267iq6Wh+Lq\npGMCevqktwMUxf9i3e4jXj7lIWugKtJq1DQA1d3bmCMbuYmLTXvA5C9Hb8A1\nkzcRlEDuOtaCnl3Hho2W7yJ0s1GpoO2rJTqa7Aq9BolVaQfyU2Z8QeN1paN1\ni83mEflcMiWva1D5a/P93unrrQOHHQe3w4PGHZjvmrtTCV+8zae+kAa3IjwQ\nU1mkFIUrP1rCmqyTnvwuUr/Z0zHGN5lUAUBz8bnYUL66GjtcAg0rFQ0a1N2Z\nZe/1O1W8rpI/vWrCH1GNzRnzo4qoXzHLsnzgGLu+kypyr2rNa+U82E6ww4aE\nt6l8VMpNKwsEZC1aXawBueG1YWfZniODjSDW2dZSdFSLrHLgWsR3B7lHChee\nHCYSHSxrDzoQqnQfEDeQo0L4hiPgMqp9QT+nPQ9vRpItu3pVamH76HZEWAnK\nj09g\r\n=eIaR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANsDx76sPI36rO9sdJ0mmyurWNzOUFWWhj/+ASRYAFVAiA4huxhwTG/snFSaoaMsMKDQPK2qkSYxVNqMs4eQaMzhQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0_1620205304792_0.5370659809915765"},"_hasShrinkwrap":false},"6.9.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.1","gitHead":"1f740fec78c2011643f32251ca0bb4b6c60234c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-goL518lzsHLT4X4rnk/sx4k0Sji5DcB7IsVLmk4reqKGCy7/p3mhMGZ2pTjsZqFIwDGLzJ6JXW53y6K2pjhZog==","shasum":"67ee183bbe87f49bfbc1cf5f15e5e2d8c0b975b6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.1.tgz","fileCount":88,"unpackedSize":439360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkl8NCRA9TVsSAnZWagAA7dAP/R/XFdW9S8rirRWywRuB\nFY3uJfD8hHFKuWwAwMQIC5LYqEGRWTW/zYYABHfgNmOcFKdTuIvTA/2/Cu6P\nXUbBRoKvcLqgyc7mKdW+CO7AKyWJdYG/d81493l0PzcEkdmT0vY6bjMHBLJ4\nZjN7p+PSeV9Ezsz3S1PtJ3eHUY+9T3XAk2ZQJlB8qf4WOAOhz/fLD4c+46y4\npBsWdJqtTHjmXKmHM4HTbz/xAzenMkJaQ41PJ//39/SzGA9gG7Z2EKZwlVhl\nA44gKIq0zdrnRzJ4hmcqt4k7YyHnulAJZMXOfMynSxCK9GA4hWzpq1Rb/9mR\nKHx0OECyqkCvyLmwk2CgLEFotGxMvcixlPEPfCnAvJDnWH7wsrdGYcYg1aNu\nlW89hMHwW3tOtFfBKkrYYYOKBp+uFQF0u4UsniMma5nJneEWBLEU/1uirrAl\nusTBngSVqsI9yT3/eyhhTImNNH1QvLbV1+ZlLhW2kwX0dlpxGzOQACuPdQh0\ncBQsYChTE4MvTvjMIRoC1Wvu+Ud/omvt4TTz8pICm18Q8+4UrNYAfPcXjfRJ\nxDtvS/UrTHjTvvyCz3+Nyt401q6VaIgzw1DYVajqrBtfHO5Zd+LzdGRN7i9T\ntBosF16W0CSk2d8o2R/Os5IXNGbDR1bkuzuA/a5erNTSMm4XpQXplh+F03b+\nDAL/\r\n=u0yT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFzdN8Li1AN6k4ZxWsAW8DqnmKgsyirVl60PXU7Tc7XAIhAICJ26uMkz9SPrg7o57xf7iTTJ8TI4Ohoxq9s82hkO+M"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.1_1620205324951_0.789330409633979"},"_hasShrinkwrap":false},"6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.12.2","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"1f740fec78c2011643f32251ca0bb4b6c60234c3","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-N3rknToJt2znLSzTDCr7g2Lux1HMQk99DVHpCVqjZAT1lAAFkF8llZjfWwUY4vLLGvvkmrvuh/eIkzD4fVAVQQ==","shasum":"1cdc5414a8ec704166ba04a4dc07cdf66bfcc056","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0.tgz","fileCount":88,"unpackedSize":439403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkl84CRA9TVsSAnZWagAA/TEP/04pscNF+X9o5RZc8nSB\nppVFHLSwTq9aQMdTKYJmuRZmGJh0kX2PBYJPrjABEMKrH3sQBMeWKfJ96flk\nIUJzQ/r4BRY2qk3Zut9I7/xCPXIKi/kNhC/1bLCqdEJ/OjnhNifOjRl6ZfSN\nWd0Jp15EmwxUlGNjhx1V0Z3LT09WWOfWcY4Ua4QYyjkmNrHsjOQ9szlx6lbs\nFcP0mio3x5Me6r13bmiIIac2EIysZc/GQ8gaY7O8KAbTa6mXjyok5O6qLc2v\n4h3leeWttaZUEECIRykAPj3Fi/hAEeGpO4oU0hlELvxnNG1pQ8/1Hd6uc3Xo\nyXvf8mH3MTcWEyEShIiVT/yiBvmHjX8qBN3Nd7GiEsmWsNKsT1Br2MmOTy0T\nW/Ilb1KXjoz0D928e850YpEHLZt+s25oYMq1Y3OXc3LFXR3ySEpRLcDQu18Y\nX0v7GcxnacoYYXhxWXDqXQ9pF6ELqfTpiJr4TzuL5dyMhPLzJFlVie951onu\nhMiXjrpFgtRSfC8sA1PhkTLVv8QPy5suj27Sh3yXpknwhNoXivCvlUtTyelP\ni9MqLXKXptdsVTNYxuAtgWfED9hqBtc4OmqjBUSEXGXH1bTaxV0pJo9Xysrl\nCc85c41R31HYBkYYHt3e2JLTqNqrL19Qs1fKiAB9KBUDSdRS6oPm6H69x1AO\nDrA2\r\n=xq52\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD767KYCDLvlP8GsUkeMzwndV7gj+7l7pt6E49Zh128RQIgAuwaymm/UqC2re67FHtpgTTkmW+qJJVe0c0EPD+d+Ro="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0_1620205367943_0.3212108111885599"},"_hasShrinkwrap":false},"6.9.2-cb511abdd54151c898f525211a859e1cda641694.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.2-cb511abdd54151c898f525211a859e1cda641694.0","gitHead":"cb511abdd54151c898f525211a859e1cda641694","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.2-cb511abdd54151c898f525211a859e1cda641694.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-mTfKh5ycYSIsg1iWtVAQFYaI6/3qW3omCcLIa2oEkpPBOYVa2IqtO620Yr8kyGBeW1UYLmr2XINx6/jRZrsQwg==","shasum":"93618ca8f80d6b947bb7e6f133ea1f660478416f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.2-cb511abdd54151c898f525211a859e1cda641694.0.tgz","fileCount":88,"unpackedSize":439089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmfvCRA9TVsSAnZWagAA0bEP/iEmoCMHbd4cKbU0HIXh\nnpTZQh2gdmHq8W/tli3kTJayEdrvvXhN/mkgn7qcIQnFtD0ZLECt6Bi+cAxP\nxlFIg3jnlvut1ffys18w9JyeabHsPpyeOyF7E0MJ/O+smamtLlJyL5AxDT2L\nVwXzFFv5nffBIs1nnLt4XnDjb6ovmh9zs5AVu2+o3pMp3NafFD+VY1DE9mub\nA/HBfVSPEXmNTctJJP6xlOpSN1HFO7Pypv5gFgjo0q1jzJo22Q9lsr3rD5L+\naGk2ZQ5DS1FWgs7iI9uVybKSBcvesPMtD1FDz/UfMjpgkMxSrNT8V3JB7ekA\nwrCiVXsQBbb2qSt7XAeFXxQy4bi+saxKDr6Bfw0GZ4HnObtgo/O6tOmLktvj\n9JYTmtN1k/an73gsW38G9+C3v95rhgNrIdZt2LaP+hU2Ml9cdKTQ7YJYipn5\nM4rgAlqIDAlGBMJoguUgtZex12vZi5IL7GT9VZcU6ZyExtyCHQe2GaGRptJl\noi8bcM2Nwg1pwA5jYTNFuLZlW9LXzqrKFKaKvSH2WOhR3t5u3Xp4kLMuzwaV\nV+Dq1pgcWh8oACp9gS17qesl2A40PmlmOYa1wgHgQ1hJh5pQKlEMoRQ5baUU\nO5FV36rD77nm/Idwz+j31WisuueFRRpKYqNHV8E48QB4k5eYQodp6zuCTwgU\nov/n\r\n=pGwR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHx8X6gubxIWx1kcjL003hGVL1Lnpa5kvXMKb7Z925MjAiAAk80maNjOJ3uCUD3Y1LiH4pPGZaOHV2bA6YFqdFeobg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.2-cb511abdd54151c898f525211a859e1cda641694.0_1620207598877_0.8818193632040789"},"_hasShrinkwrap":false},"6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"87f947b83afea7f6ca2baee16060ffb7ac5c54dd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-T36ok8aQyUO2ewtbysXmsSZvpA8kI9NgGqHgXoMzpgvNtGhxlOjeSUU1yo6x+mTjImrKc/0wVDxTu2BX2lEArA==","shasum":"e6dd873933e60252c03b5241bb2d4a6991ff261b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0.tgz","fileCount":88,"unpackedSize":439089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmiXCRA9TVsSAnZWagAAaFMP/12DYAKFoF/OU0T1PXgP\nH1ZloFglPhGCrXvXNGcM4ANX+0TKQQj/mM419U8+4aUdg58hiAg14IjMTFEf\nPFRIZG+GvYNPylueb6/bB3wvtP+Pt/1ZI1gg0zbGeVdU7laxf2IbubwLxJ4a\nEObarLbNrwKtWHgqv6jJXm3dlk/+5x+3oyycQeIBOL8cPnzO5nEEU6aPzDKt\nyKuvotDq4tJe4kmX7jbXbD8rSdS+07AnvCRIZN+vv31u9zNIZgv8sAoJwK0H\nDaN/IsTaiMcdIYhaacOhszRY7AATxqwX1l8liCGQOk9GDXzbcqMJcw7cLmaG\nJHJs3s52fjCMlwOXP0AsIVCmY2AaIVtk+hhFf/JfT6syA5rwtWd5+Nkg7PGF\nM2T7T/Ir+mU8MD+u+blWYI05ilz07hydqhKAWvr3EhLg9FOYkhQuUwncmFxc\nQtOYhSivzcGfacAA109beUpdX+y+9QSCNWgclHLO0AzWVLpokyCsgLpEDzMY\n1QflBvJffBZ14EIGcXS2GxCo6BA/5TRrrQtXjGjjz5oOXQmCJ87xieQ3MWME\nznr56WOU4vvuU/5YFn+XFg0m5cDHgZqFW4SS3HO+yvyjq6zZkZ1UiRc2IgpJ\nysfyY8Bqr8fzdrQJphvsJ6e582ynZwexmr5Jt57LLN/++hexXtfp5XU92fm0\nBdlH\r\n=UjQ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRCTXJWhgTCZqU/U+l2CIXPYZRKktEsBzk0ptzI/vRXAiEAjpukpZm/jW6bwZ9cPrb7RSeasYUPhu/g90/azojNgwQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0_1620207767024_0.9358172013813564"},"_hasShrinkwrap":false},"6.9.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.2","gitHead":"164bb66255eb58b7be82acc10725dc165d4ba9e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-6abzofpTth9XOo9h32dTIGngqUNGPqJuPWm6SLZsc0pN4eaYKOJO/1RYRBR/VrD9HJ7QJFkxF6FKpLVy8WXI+w==","shasum":"fda6d54573147eeec5aa1d7ec1c918936f172e4b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.2.tgz","fileCount":88,"unpackedSize":439312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmizCRA9TVsSAnZWagAA96wP/iJWIJdF7cj1qBaDb2QC\ncu47eaW1frx1myPmZvTrkUUiNcY3+VvozKEX59+H2eNJ4le9CDK6sqigr5Zk\nzax0mb0a7WVat0t4+QONqVDnOAsNmm4vF8oOAyGDnh00Le3afH/EgDmra86G\n5A94Ma0EN7umhgGs5Lzc1zL7fOR/wp87Nza7KbjUoJkKWfiImXn8cx6CPEoO\nvySSICup6+Xm6PJPzBF8DVNzopOjBBe9vj9ALNBpv5RZ4tkvLiQUgcPGJcWW\nYbmriAsQ52MwnN+pXHIz5BbLEOYa/6445bF3dPDrbYnuaP3G/B1Ei+Ya3yhU\nt0t2hb8Lp0pbpmDeuuC5MoppGY4xC0XReipXCR4Y3QRDJaSmkga/XqvcUGgX\nrRM6wQ6u2KP13E8r9cBhjd3Z5Xv5a0mf9jmKor11jIFyxfgH2BQ6s8b5pNlp\nUJfYMMQpUoAG+fAGCL/AbSqRFOqtJCX4Hmjn0BYLuflcz7nm81FOzIgbRs6h\nGanDiLc8gsCkxe6e8q4b2eJPCN/h+vWzVIhf2i3DtrIrUK5e5Gyr4lo5+6xl\nQD6S4SvqAnt478kXzObRxGJVoM810dsoqUnRdVPJpheU4u8zfJ2SL9l2qUmc\nFopncpbOxDMMxRTdhAhsTEr1N9L9+N2G+9UBrV3dcSQTVj6xWpmIqR/hFqrO\nHxAU\r\n=mqsQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICSeHoSB5ATcQ/jRj9O2AokvZqxJdlYJqMQAUw6e5FSpAiEAh8n8PO9eA5SH68mYZixrozjFr/Jmqj2sNb1Ay0XcnfE="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.2_1620207794491_0.5564044239175303"},"_hasShrinkwrap":false},"6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"164bb66255eb58b7be82acc10725dc165d4ba9e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-gOqsdX+4ylD+Sz22adudvUCkq/Icdd0fnqDf4E9h5/j2/u2ggX30RBk79DszTCqzSUpHKfQbDGZ0akx1QpECaw==","shasum":"33326baadf95d6b084158c6c75417d7bcb29e52c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0.tgz","fileCount":88,"unpackedSize":439355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmjVCRA9TVsSAnZWagAAnSgP/1Fclrjd3gWCvR0QuxLR\njstt47Q/nipUxPiEB0OfsHuIMn17wBchHX7ii+tln260Q3ksc00q1obNppo8\nyq4bTJXRkc3oMAOlSDHuOOY8G5nN5KjuXdNzJ5FWBxUBt44g5Z2dg+Orpobi\nip8AU6rcGChl3ZXUj0w5dybVRuPrXENgAOmS5rqVnsyvp8J1ptKYssXtdvzS\ngOwsIk8QnefiACOcijqIqL5OPBQ5poVje82JsgDlISG0ewN1TIoa7t6iyKx5\n7Ldx9+HIWxUq5Y8sd17QnzFi4DZtiiC2UVSEGgQEZASTq1NNUTpS1Dzpr0sA\nSXOmmuI+o5m/TPelqKetoJZUxsph/rC6Gwbnxp4c3Qkft4JXKpjrqYq4mLa7\nTbgRL8dgeWww/hQ5Nddorz2+tkrCil9uxeTUyjVngI079LgGbWyRYswPtRy1\nGPDxjwSdyu/r1RIATqIu5KR80LhVw4apPTUs8XU3yPwhRDOv4um2EnVpsgOV\nskok9xshsE5ZwVkNm6CRKBnFni/7AgupF6C4OulEFjUDN1R7YLzbbs/NZ0gc\nxJI9y8spsJ2v1LAFlC8ZJ4pYvGV1f3NoZW1iZKGLvTz6grfhCRdqj6kwv0yK\nFF1xnSVmZieVuhIA0LtVGlQxBD5VGy0h4xObhEpKLiwWSGJAQDCDsbcCmTI6\nDdZn\r\n=rgIf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgjNCVwUcCncfVZqdepPdvHFq/2eMkeyqXSpENWqhaVAiEAr1vcdNSpG2MWYUPkINxU/GdbiYs4YCYEsCwwi/DpR+k="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0_1620207828969_0.6068480545825445"},"_hasShrinkwrap":false},"6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0","gitHead":"162b41c37ee3f72f60f7c73e3ce72f426a222ef8","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-jkVGEUzCEG5rV/FoPir/lVimuNJ2oW3QnwXQY9+kbKdssKhBd+5yCrD5uM/FzxhUvjGHQeZvrbNpQ1JxBi8M1A==","shasum":"d0a6bbf8c041662757eebaabae3a2ab3b4491d2d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0.tgz","fileCount":88,"unpackedSize":439437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk57/CRA9TVsSAnZWagAA8XUP/RGgNCISdBzLZt9zr7l8\nykQeqBLTKoYZ8P7hritTMTrwrc9a9/8HNWmHgXyT1sF9ismQUuQODbSF4/CO\niMxPJYEcg9ocVIpQ+Qds4oqyBQPFdylpjaOrgjFSte+EZEzFB74Jay700x9c\naC7gbop7VxNiEDwZrVLuLGW3g030w6yNMqr0uJhb6AJ4TLavzeqdMYoNVK5Y\nlBktaQe7QoQmcSgyzWcJF7dqRHq7YEga+NT/fjhEAaBPFRalIdA4iDsO0PZu\nrZpMAybPWVJwViw4C/66WU23mBGKmFe5DLkaXAk1rT5lohS6m/tNO4nrdCoP\naG6pBhImWFSGZyJDyegmgPzyaxSnrmRQ9ttYVcQXdigr96N5l01iO3Yq9M/h\na8vYICudAkTF+hlg+2/k0mjlxM0VcqjJJW8EtV2dzbxVw4nTewk64vKwKJJx\n0ZYChbm5Dj/oHqV5L8LlrEUuxXIOecBbPJ0eTqADyMJommyEtQypdR2mKkvD\nZ00ePFI88c3Hen4JvI6h1ORA1isiX73QMf7zAbcTzzaLlfd3N43od9WUMOt1\n38YoTxwy6U6/dKZG4se6aIggrqhgGwxiLm7PBRKozJjZI/xjppazEsg1pW6I\nYejnoocK42OGKjVrKtxr1pdeDmWOcrPAJLZ5nFoJFV83f1EGaMKYyJIP9ybp\nJZRS\r\n=Ge0l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQS7f/k5/C+kF3fPmVeOu4QuoCXH9pAWQf9ZrCHkFatAiEAwdRUB8fb9nmnfeQjyQdQAC5CL78bLPDmArL5pdLqpYM="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0_1620287230861_0.2053473914623165"},"_hasShrinkwrap":false},"6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"f71bfa5cb5710388114a258d9c652a64e58ecf83","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-jvDqVuZyR6Gtp/l6mePsZ626B2uFYdq8kB3cYf4EKrU2euYrh7W9jdjyn7rHTF3I2VLfVycbxL3tqpae/RvCYw==","shasum":"545d8b263cd5d2147ddf15fdeec13d726dc3207b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0.tgz","fileCount":88,"unpackedSize":439437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk9ZJCRA9TVsSAnZWagAAqzcQAI1ZpRUS9xLhCXdgiCLs\niKs4KF9Qph9t6XApwC+vq0Ftow6kCZokEu4APoU4VOuSgQ2CK5hbCR0vp68q\n4Qp5vtm9k5tvkDRfbdWDBE+rxduVbEN6LlRg0ivfNPy7Vkgpcr50AVB/aEkG\nNozZpg7uzPpnPqEn7hjtc1Vg1B55osvGLIyI3ZK3k0Rf8d7CFevmjoHmLJYZ\nI0CSqGUm4AtpC6iv2AXjePaQaXXh2GOtyxREHcW2euJf4LbSpx1cvJCP+HM/\nV3vnMYJSpSIzvr587KDAb+jxzwF8S6e/O04Pxe+W3E/laCEW0PVjWs7qr0DA\n5M0OaIEKj2vvJ439HApC/sMpPW+2Jp7NrBQ3N7i8nZCwDKMXIXFpEUkYqaQj\nCHeAvAGzWvvRlx+ZfypB22YWo2ueQlPjDT9LcLLUQVeDcXg+nn1u+KdnqaFz\nPmDq0TPKEI7pSurED63mrayrkmjgPu7r6EVrsHXDQJj9FHJHeBiyrvFwiHCw\nvdUJzhMoUqEWRZkmrA0GIaR4mMF5uty0FSiyQ3Tadu/p4omb747F93i7tN/u\ncvGk4ALBAmOM9mERyX1BwK4wjruLR5/AdaiGHKhUsuzL/oE2JCShh1kghAR8\nazs1xU+RXmK3oiB+yGaV0HqrkSgjX6ae6aVYcLDcS5zxZFsN2Igo4ACPzmq8\nCFWK\r\n=UF1v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7c1mL1O634Fu4hLNHdu3qIlYKQTaj42K/Ve+psazgzAiALAPeI0/1pp8vPPI7IsNte3GHD847evKxaSkdhV4BjcA=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0_1620301385225_0.9344423471934475"},"_hasShrinkwrap":false},"6.9.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.3","gitHead":"caa6df3d58aa6ef7d5ba999a856a8146999d713b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.3","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-szzDuuSBz+jhQNR21ziogwnu1X0EYYQ+ToBG8EU3sFVzX8QQcMhj8iPKc44Q/wtf8TW58tFhy0VhTceDsy0fEg==","shasum":"cb9781df33e5a06fe186fee40fe66e81bda65b70","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.3.tgz","fileCount":88,"unpackedSize":439653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk9ZjCRA9TVsSAnZWagAAelwP/3hpg0AXNnw0Sma9Iht+\nWBKcsEcPOcR17bcE46r5ORylb7Z6iQxqYm9u8YLo26bs6ugeiuWxqU5T8Nxo\nAfcMa1DjAPiTVxXOvvJgOBWw7IT9gbLRQt6t/ugca8piWcIImln+x0ri31eN\nwfoubR6VJur1Uij13fP2EDxuE4dAocV1UOgmjZsJK7uMsCh/NoTk10K2BsTs\nl9ycnzp4Rk4zAHGcZTc7ep3aeoNLsDY+GcvvPNLHAZ97TSNQra6PxjzHSQcl\nranSqH0qJvCl3EsxPd0Iu2ZzxTRrnBIKs57bUqf/J/qKOy5Ws+lFqRmwavdL\n+Ov8BxEqayAxz75XwpJBXiadnzD8RyHnq/R0KuXUncfAIzs8haD7BYIXyhNM\nKzixtXto4yPgeaasfL5MZrAcabmWeJhl/U9WpNcJXBumvYD4CQpJ09YOOQRV\nueHLzerC4jvdsNOZI+K3JXcOif9USg6Vhsq+n1Af8Q/sOdPx9Kii9iE02dgO\nbKrKp6Hjtb9nY3dTp4+HZF0+lwhDKezHhth8fNjTAsGfakcdxM5KY9CJTy7h\nmOuMzYDmrc8Q4SapIdtJCMAsVG6k/z9UzEoeWD0CWhyFkaTO+Oa339ykudaY\nYyLGvT/jlQi0cnqZTXvtxL8AYSiFQXn37E0XGD/3rtbzzfvCUxhMpczzu+O7\nnBej\r\n=LKMh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy6ilmH085Bl313jjJ4lW7wsdOQzTF5nphmt3ZKV7XfgIhAM+pZLI2kzp2VUFANf8fNdQQg8dDsCowJ2U/U8Dhyv6h"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.3_1620301410477_0.289952852274016"},"_hasShrinkwrap":false},"6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"caa6df3d58aa6ef7d5ba999a856a8146999d713b","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-vEyRLUMBlZQtMLK5J24faVdi7HcqiaTZvhbuEX06jxCxH+TuPSoOQY8ieFXe02B3KSa0xKbqZ86Drt9xe6QaQw==","shasum":"21af7bcb6724c39f1642e606f586fff67bed9b2a","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0.tgz","fileCount":88,"unpackedSize":439696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk9aFCRA9TVsSAnZWagAAJbwQAKC37FEzkbxHLaUh6cFn\nsKOCIM+zSBVyJSMqBLUeMrw5ngkK2Golo3/UVlC6TgV+xg3CzK80WFAFJTpl\nmsieYNq2lFrhOO1p2q5pqzekzicbvXQSy0wXNwKhVvbrmqVOXUOd2nY1u/SS\nR1hpgqdDyVzplqJLEZIifXOIjLz73aNpwPX5E3eJkiCvnTK2mdBhfIitpa1w\nU+TJk6cl1Ov84GOLulQbbJiyPr57A/DxOKjrmTxnzpHtJv7W40UGz4pAFN74\nRnUjAfVhjG0HRKnzsH6HjBAbR1lzaxc4zOjwRHGMcNilx7ILrCYwtw4OrNzt\nzwNvPKvZHqfYeGxosOLlibjsPyVfVFNMle0VlvK0AYD2MkEMk3613BXnpjIV\nyCwDmtnKRTb874pY/oHpxrei6+4z0bK/WcZXS7WvNvMx/k8TLUIhzEt0N+fb\nHR81LEILMiMfdSgRidDUJRDVT+SDu5XdnHPZyA+S0Y/9aWdwqtuvcFhCqvZN\n6KEKEFwTKPjmeqBvPOCo3Q1dBNu/VM+rtBUrS70HG6Y3S9ebkU4bntfIXEUw\nSxcXYTNuOsvBHyq0zu53VHcVUGQMrT2qObzVc1nLR+akHjucZ7XcnsH/FU2L\nhMN82MM93qiXmYyy507eBlCUNtW1y/N94dsdCyJDeYjSDZNVKWd3TK0Oq1nc\nl1rj\r\n=KaYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICoOaWDPY/B4V/g3ppWIqqnoQvc/5SAH2dyhn1q4UsxPAiEAwM3Nh2O3/Ve/c32Zhumi0Ri69jHZryOWPRt4TDs30+w="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0_1620301444680_0.06730350028442422"},"_hasShrinkwrap":false},"6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0","gitHead":"ede1f5363f6214e9e029491604cf5d981465b171","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-it//3Kq5m4kaW2BNuFtZ6q9SKNMmKb+D28C65z5NpJWEGiMqjq7WoKdFO+oBD/4zCk7aUZwOCip1LwmFrn7cAA==","shasum":"8494196af73a5f0f48fba4191caddb66054661bd","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0.tgz","fileCount":88,"unpackedSize":446633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglTSbCRA9TVsSAnZWagAAyOAQAJjyLXev3XA1CiMq0Cdb\nn7pfWQu5O7PHXwBI0BHoSwXYcuiNjZXgWTp560xZr9NVLt+6KKn2LEwvIjZK\n0VPYwnrP8c+PNoMDSTTXCrpZw2gSRn3sV8dxw4jVvYrz+P2lGkxg9I3lM83u\nhpPijSOtVSrLkkcxtYTpXJX/PniQtKz06MCPk7eiFxtVGBY0OY5bw9nADUxs\nvuszmESAjHtMmvcYfw97oiXY9y6pVck9L0TQs8XmBWiarQhXm4bODJSHjdSU\novij27DljxvxKRzUVILA7gI1+9V4F4kmW3Jn82rXtusBGTu2dgGGtvOhUUx/\ntbkfOILMbjS6bzZrTVGSNSI4z7W8dWmX6UczvPiJOMkUTD8Y4L6fNgaxuZQZ\nNIILk2KgTHJIeG3jPkMxMqkNtGs1KbSRjuSiDIRkasiSoVbG4b+bWNhWuntH\nBc4wBwUwZVCPTkf2O+xXxzJnk06QuASu2kwW8jxZsz40n+ZACbcJ+vrLK3Lq\n0UDBAEoRIt2ZFRaT+zSeorJOALvGf4VPOlC5OZ+YbUw4cmwFHjBuqCOuXO/v\nlaL21fK5zv6Mi12m4ZYK2psNErkPHLJIAo/HhdP/kQnKgtf1PldrDPSQEhVk\nk49I66fHK/CxXLmKHu2hmkkuodiobVyv66Bu+9LgfAz5SgXEyUx605BHq7cr\nJ67y\r\n=VcAH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzQAX5dNeIjfW/FvSoLG7apnpYvCIRrM4u/hcZgoV12AiA7vwmL2laKfOwKl4lgKozE4jp2S/oth+b/wjX1hnH0Ug=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0_1620391066254_0.8891008963220697"},"_hasShrinkwrap":false},"6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0","gitHead":"881ae78dce1e6823a6fe8565b06c3cf9377806d7","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-tg/V2NFzkB2zey6a6FSSezp7MGysNY8Bsn+7Peo3mMsZcWC2gL3tvzvKOqvuzYAGz5IqJ2vaFPXEsuAdbcmTCQ==","shasum":"2f871920c436462b0fae841bf80cb707d7cbdc96","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0.tgz","fileCount":88,"unpackedSize":446580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmjU8CRA9TVsSAnZWagAA/98P/1WtSYQpTWtpxywyz9wY\n9RnrzHWYDzXc9RZ5YYzpKIpl2Mp8hK3Nhwii7opkgToLrlNZfYfmIbvarGLp\nlvyEF5kOiuomoaW/zFuS2TCGpLBWXntKuE49JJZcjI96QSSrmUKgB86x8+Dj\nuKnmz8vbcKl6wqlCR2xeBaWkc7OHYPcudozAkz8y/HnKZFoSc2F6dFS2X/l5\nwV9AxsdXFU8SKVI5ybY/mcJIowrjREpOMHzCnNdqEHvAFWcW9ONK1L40Z/6c\n/KLe7Oop1D0uW7he9Xe3BtpmFK1v3Pq22ptXw+kItA3KZDnGRCwWl4YGGIXK\nkQ4A0Od4/t41CibGVA+iSTYI7Xu5W5p3SFOh/p74Qbo6nxEIX3tSNogtNEul\niaUdoYELztp/HnPCrzs1qXNaa2dWh9zfrlGvmUZifaQ433yWkFr4jINo6JTC\nTmINC9D4gIbI1Zx8EXf4yc0QnqVVu3+cQspk89KDTdwZ5KYSQFPCPR1ZnrLb\n9DilVIUJKhdfHmBF2wWFXCDvh509D2gh/6cKKANfC+FSV42rDugqrlgim/a6\nZHXcvhJlEAF7/zRCmfc9yaT4ib4uKO0pUI93u9DMmXwjPsF+HXE11zg+FyN7\nqzSQHT5zc16Ek+Wcq3zF/1viLTwN0+uPC/fxzkbfbN/vdTkMxdeq1aYUf5uY\n21Mk\r\n=71xw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFX2LkCDhzzjHE1fZKkXWDE3GcWDxOG3GWw4aCKy+EVAiEAq/gKxyUiEBTX9cjm0MpD3Xiydw/kIi5ujwd7QmwAyGs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0_1620718908199_0.3756472768178043"},"_hasShrinkwrap":false},"6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"5bea2a4c8a7490fc4faa873c7073aaa5de681130","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-CIp7WmgKMjKptZmtXPyoQJHohGKK456q+6ndQ3kmGK9aeRYrC1hRuSjrLH6tR5XSN4KX1V65ew1ZmA/KvKSXPA==","shasum":"0c4b38c3cb3c3c0c0462b096fb6ba15028ca810c","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0.tgz","fileCount":88,"unpackedSize":446580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmjZSCRA9TVsSAnZWagAApjwP/i+dajRKT6n8aLehbcFn\n99FAMjFOUocF1tU2FIGPQYZS0F2JwV2Ed82oMSBjyPaZNMqMX0f64h/75FE7\ngvDI7irXbFIi5tErtUS5bgyYtYKo89KzLH13EIFkuNlbYuXL1sKO3n9J8Zkq\n1tfXjQP5dIynV2itQE3RyDDxeagmearA94OjjgvvhaGvQebX2Zi9r8gr59EM\n4t8ECv8zNx87ok5p8T9CkdnwsC/dRV6M+UMHQL7fCa8l3LpU/GGeAH/zmk2c\nOLt9SUY0evRbyzctDpScbSCxMb5jby3NvyInUZUp3X5P5WJIne8OrjcSOkgY\nAwgrpZGHAPi1cAKNs4nea47R++UMRDKY7I6yec9GHEGxBNxM+fBeWsE/IYpW\ncK2LQg7lfxfOOtlsUx7iKouDv6uhazUlbOq6EISr0yfVk/aIc6eKZPdh+muW\n9jLA3CrZMtz7DIjfgtHdHtrhWpQ58X7GbgyOXS3QU7WQkNpeGxUwbWUmMQ+O\n6OZ1Snaj1NYDgmHbpnW+qfDyMY1R5vPrJk8Z6KbAoaG84/v2s0VXfTyoqjQv\n+XAfxIHOekl2k169XQNmwbmqfPtwpF7fSQ4dwxy0KTfXGR6Rfm65XhIP2IMm\n4C1vxTUNNrlxoVZxgqxZSUEQPJ7M45Hizqg2YJGkhLt0m/9yXFi5PoHCTgP5\nmoPZ\r\n=PfLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtzkfedFOeFmqEDN3suezQEiVDelk3+a+3FVf3Kd3BxwIhAIJBloWIP5tdWuznJGRCHuaDrzQEyYCDxHsAqUoV1raB"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0_1620719186326_0.0957619491712729"},"_hasShrinkwrap":false},"6.10.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.0","gitHead":"c9487d4148a3062aedeca1bdcffb4c39d717154e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-ajHnPhku7l2Wscu82HSJutB9BZ0CZx+TFRZ6WCWFnk5y/wEc4K/9/e83gxxqlC9xGvsT7s+6ESCm8FQPcrUJSw==","shasum":"d74a066cb34789157c74574b8bcb854a8fdff675","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.0.tgz","fileCount":88,"unpackedSize":446790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmjZiCRA9TVsSAnZWagAA0+wP/04XQoCifQ9W3D2WMtLu\nYIlYdiiAMzn9SMfB++9v1XJGaFsLDaX0gHgc8KUTHTrlPpidMgkSWTrIR5eZ\n8qf88xXyiU35A61foOkye1BnCrEMGgplaUyv0ZZxHNkKS83x8f2juX2CjNVH\nStcfKgHBEVgEr993oXCPg0B5vuMcetHYtURz22Uwyi0qcdr6CUsCUCNXbMzn\nOOxiykuWYE59rua6pMZvZfFQa7m/U0JgIUJUE9qZ7Y/JfhP3s87KvMxKY8Gz\n6gsrBjFiEgf8IKHOvveCygHtyJLHLZVs9maw4rBh+V+kelS/XLEftpmQ2qdz\nALuNX2kkYCwoZs3NX/Myz9q868P++10yZCo1fHpnWUzsLrOc1KLoB/x/9XH3\nAZsnyUGd9Gzx/s51PHBGYpf8MZo6Y2KvvWCeKyDRC/VwieU1kUlm35a3FuvG\nDYt57MxF5N9q3+u0cMIpcNfIvoVfg66c9n75KuHRnrgsY+xa2FXqxzSVkmhY\n+Ik42Tjr6DTpetq7eW+TaajVntTBDhbXTwWLN4f9LOra4c/uSnSkiGKbLoYg\nPWyJRoW8HIdIPVwI0Su1ZTkM/9hM+yGgE6LqfF/1FOqIkg+rc7iV+atS/dp1\nrc8QAMDO6H1TRgwM8V5RHQ4f8aB8wlviT8oR3rOEq02mWjpC6bVV16VvCEic\nvWQn\r\n=IkVs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFH6kHGmYaDwXCH3kn1Wj9xDwJrA2pQp7+NFeg4b1NARAiB7aiS9OLA7D0YA4kwaiE5WAbgdx8yb9oJtI8cK242UZw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.0_1620719202166_0.5892357155995214"},"_hasShrinkwrap":false},"6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"c9487d4148a3062aedeca1bdcffb4c39d717154e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-2z5palxgQwL412Wz3qRf9dYFrkNU7okh/OT3GPexlFy/aOhz1YWszOuI3SWFjdiZOQ8PMaky3DUPXdLrhLlE/g==","shasum":"ad3292a10a8fff25732d361ba63527e06a3ec8b2","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0.tgz","fileCount":88,"unpackedSize":446833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmjaICRA9TVsSAnZWagAAPDYP/jaroGr7uYZe9kpLii8Q\nUNgBSuxgxGPbicxZ/4Xs2ML+1gCgtfFM9qQuuS996ceqqe87z0dSg+FDU/zj\n/cmoMZNF/pxCqABzI2cR/ZGU3LyO491IG9g3owCiGwHuGjIziGYJcVVWHdMO\nA1m5FjHUhTGKpUtikKKOYSCEbOuSzf+kDEHrL9sJ9NEuP2YAVHytDl0OOJFS\ncatJpz1Q6SaZbUo+2MmwDyT10kc1ljv2bkUxx4Twx4lQ7KU2mdiiU/rQ5DgW\nw9wJ9OoYXTH+HJgdn4P8e/fhpYaIPbhdNvsk447WWTXOj6DzVNojOac7Xcry\n9gAZgKqBXIia01mz8b01i5bu1wJDiVeCKXCrKkWaxnaNkyIUHSaDDuhMJ4M9\nE3whQDlhQu/jFl3ihV+TFoI1qKAq1L19ybmgZ0JwxCQvbGlqwtiDdxOs7ZJk\nB22VVu4c1Lav+jDfdtsTqVWBR5VM7KnGQU6VBS9S5vSXptDBbalczZVAwvQA\nPJiy1ozGgYNwZtaSA97kO0AtDUGSCI6qMBq0ec6DObgsJUYMy7buyvVhoS01\nojP6BpM3ssm1DbIpe4sSH/PRkyV1w/M4NPZGc46zU6rwKWGtcXQ22DhUuTkf\n3Q5YWSHuijCdrvd1qyIiBh6L+QSGBLpeFZ1S4iDO0dgI1Fwwsp9fnh2ofv6z\nXp1T\r\n=mcPh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGf8qPDO+D+2vDnfRQdnHSvEE/phrIzpEMvcWiolA3nYAiBYtWe04VaE/GLDo7P2ctdEE3+/kgXAYqOf9TwZ4Y3Hgw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0_1620719239805_0.9843711826895774"},"_hasShrinkwrap":false},"6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0","gitHead":"336557f65fe01a40d867dcea7769f347479653f5","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-mN71nk+Q9lRdS2MVi1gc9Uik2j9mylDhuistZc5m4DwdIL6hqi5KBm2EIRJWRvhaQ3CWJcome0SWQvmAOuXcdA==","shasum":"c7c7d9e5b29805a90c2c59e8173ecc0653a9ad80","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0.tgz","fileCount":88,"unpackedSize":454389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnmgaCRA9TVsSAnZWagAAbTAP/jAUDeN7/4la/PW4zMl6\n6yLnfBqyzttDTB7JNRj2DUSC6+JHCNJXRpEwPn5QVR36vta667OV7ZbcK8wi\nMtqTNBB7ZTYHX1beFYIxyM+Cyekcoy4mKguhg0qvHHZ0PjPiX64tdDOUnPq+\nFW7HbJa7IFFXUuWhjvM4qhWkK230eT03pNC2RglvpauFrX3ZGXDVWQayPRqg\nTGUZuMLY8h2x0aesUl7LtP9gqS8VimsGpuWLY/P208T/SCn7sjQ2PUl7vz8S\nhIDQUlrnQqitVNpb0LsdKWG4BcQVG1rKyuEZ5X7p67+XTzBJv2++kVOlnnt+\nuwetE6zOcud17cyBTR/8xITHPUxAyuqTle7XOs6ZFTLEErtSX+GU7nPrPLYy\nFerXyaHO6ak0z0sjzgU2wQJBvsqlwfG5H0R6oQmH56kuhXaolt0Lv7WajxLh\nYw0lhVMmVn6X8Wz6MrlmGQkcwY6vLaR802X1AYUfiJQo6xREpmo8sjTpebtx\n/qewj9uH5fR02qFh86QOEoguvJIzttOC1Qr41yZRkQc5X2gt7N8EFUQR1bUc\nQkIPMLc9dqrEBrkbLAuqybxO5bpeJpcNQ8hhwHNMuD65Ktif6ZPPVmXVZZhV\nysOawED3SuwJInXZ1vpxYQkninftN5E/MpNXDlBEyMIY0i6AFQ9lYQCtSoe7\nxJt2\r\n=yE6J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAn7hmPsyvDifQo/SeZIgzTumgmonHOCyXzTb9BF+U11AiEAxA8MH7Y00ZLVX+wZIJQNtm6bgokcJ5+X6BPnHKtJizY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0_1620994073471_0.14464212235787444"},"_hasShrinkwrap":false},"6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0","gitHead":"61bcd35dd5bc388c89e554a823c09ccc8419a6ec","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst metrics = myCollectionSubscription.metrics();\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-BrlEv/nUfK3fyYhXsxZdOrszvPzapoytIOcX5QL3I/n8dySt7jBeKdjDgE4wRswAYclu8SmzKy2PI4wHbg8XHg==","shasum":"31a74849f4819c07dcfc42fd4246c48d7fe89dc9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0.tgz","fileCount":88,"unpackedSize":455060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgojI6CRA9TVsSAnZWagAAwh0P+wULYFjxUOkgZQ3i0kRZ\nuEx4OQSyK3dOBVIIuIRUf6lOJ0IPorNlx5agYZ7D76F8/Xb9JISzuUTYY9uh\nETOB9CuA/Shwy2dptLfXL4nM1STf0KReLr6AQHdDtjuywE57gm7IUBxV3qKW\ndfPrUWmfpGfSIFOGSzp2lO6nJYHzb+fxQJOM5L8qFQ0USPCn/LKQCgcCxf6P\n5qEjPwpvAtizhCsfq2EuXt9+NSBgq2Iatq6K6mZ/azsGuldbcQW/oaQECrk3\nrr98ozkXTNls2E5A3aiZ72sejShi8hOIJ1cUY5yid/EAE0Fnj6KiIMhS6Nnw\nSjaPkQQQRAyZze9atOJrKGH2q9GtZDhuuQWvg6slhr6fFm74K65UohkLDavu\nkEeDO2/6rwebWFUV+IckoXjnUDulpmsgKFrr2rtE8Ab7rJoII2zisJamlA3f\nAfTJiOnKAXzDoWenuiuKYujoCG2vKI67+Atumh0+OoiK8tdHPkm1J5/mLdWO\naIapk9IZRPyEfqfCPFGOLOdyX6VwWBJ1WwRY2Nx89VRVcPj0pN12DbtH7epa\nABJXC3VZmmShqBp2YRzapPFUcvwR42CBhu1hKaRS3O+cYqppRyafEpNxwAhe\nu72lus066dylq8jri2k5dClHQN1XItfx8IM7xX1NJzYpw8wlNfx0jJIOuwT2\nRByT\r\n=pkbR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGyImsr5IgqV7fhGvMnq0t+fr0JualP2UlLMF4b3lGAfAiEA3IVtcCnwpA1QOsSetp7Kud3iHaYS296fZ2ODaYQFg80="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0_1621242426242_0.5514083055937751"},"_hasShrinkwrap":false},"6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0","gitHead":"39d52a2af2efd21fc1603bda2f6a2f3f73fde763","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-lW9eLMpL2P4iMxCvyqMBKnQxktFlOBJVYtr+bkP2FkWFhOKN+LD/oH5h58243ywVJKvguNCjKiquD3aUdyj1Gw==","shasum":"d99ab4483de766b2ee4f61c0635d8a9b0c19c6bf","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0.tgz","fileCount":88,"unpackedSize":455236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgojl7CRA9TVsSAnZWagAAMwAP+gMgF5liV+96qZDfpyTQ\n53k9uwniPsvUcn46hSyWeuG1dNUVw2lw0wkHMHupc6HDM0TTyMRr5yLnwP8C\nu4o3iIvqHQ2vty84cC9MKBJ1LNmSdMygbl9MkdEbiRH3iMd6bwvlo+pSgxXg\nWxgmnNxDQgVlaLNUv/I611SdbTPAoMMVvHbYkoB9V0eZwNuuTVaPkJRpI/cw\nKu492CIWMg0Q5aGeP8lD0+zbymgXmpTPnRwTWRsW3gcD7IMZu1Klsuf9Xnhl\njp+7SfeyNaWLkeurC5vNaVVMgN6O8WfB5mK3xPwplKw+wR489bqJau/zrEyy\nJIPvS/CqvRl3FDVWGPIjDiaRLoftTq5EFh/bl/+/E53F4aSevS76pUmhNKdX\nve4z8ctWSts64vQpTFgbo1yabn9hnz8lVT9Wo2F0FsaCo99xLcjo/78W8W7F\nrcmxAuqHiitw1sXhOmNc3yDnt/P2VdxRwgpdc38/bwG01ubLfyPfzXUxeQUH\nN8cKXc7ZLLVrQto6s23zEu7Zqny/SrBxZSZbamKDAt7ZUdrA62IiNFq5NIZa\nZB69OWfuj2oH7EyLIyAOcxdp/98zHBlis3EwRci7vftfuuf29aTwyoSflhGZ\nUguDRnoOK6z/+1umCtcxmjHFv8SoYhxjdvuO47B+kGz++Fbcu2jvpirUVLfT\n/LYb\r\n=IJ0J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDj5HGCDAMD7AdeCXG/KIQc4qdDFFwA6h/kKDWC34YDBAiBsUVHs3xNNHJ2QVdATJF8QH0d95TSkp01Pao0Mbl1rDg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0_1621244282882_0.16981994385622645"},"_hasShrinkwrap":false},"6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0","gitHead":"7aedc3984902f652ebd03a0004cc8cc21ddb4149","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-8LijqznF7xS6+Xn1xi193MRcwCNy+tuGcKuoJj8ZRHS6HW+0RSj/HV/FL0qTuF3dvWuloUWVm7PLAptC3c7SkA==","shasum":"dc673a08be8b4adfa3fa0306b2efd65141c9cb93","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0.tgz","fileCount":88,"unpackedSize":454169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgonUACRA9TVsSAnZWagAApGgP/1UcF/VkZyRkz1RZTDFb\nX0GFoEnnX5hMr6oIKBipuzcQgZI93n56XFB9cePmclFLGoKdUmP7V4MiSvl5\n7GbXZkK8CUiJV9I0blAIZ8BOBXiGkQbyTg1yVatyysLS0MlQRBjEpFF5ea5u\niifJcjtCD592yvdItp+uzrWLVfze1o84IwiDlJlp5FgiEfg9zyFl7aVvWOPE\nQ2XO4K0fm4/UPGGmsqPT7Y8BiSMg1wk5UdSHVKrmUtM5Hzfkh7J6IJjSEGCa\nUSqMi9Nmo+oaCP6/8xvDCK9H+DqQn3HOaLlzJhyRh3ki+M9sYaCxUVkZC+5n\ncJDOmA45vP/7MkyqSvgp+lgBLVpV4Qw7qYPdKuw9YXWX+gXVNLOSyMqyXNlY\nGp42dbfb2bgqpdpKqppCwvuRRh2TX55X7y81n5qkfal6gugmU5u6FoTaxRM4\nNvGoGOFv6HgJOjhWoS5EPgNDlVKJRdAX1CMNxX2U8Wr6DfU8CTVcdyOevgdz\nHCj0PvOXdnWQOjeZF5mI002WzrUt+TlYkrtwm/YXsaLh1nzUzJqg/PmETNqq\ns8kiNAXEIjzlUPBwRB6smibvOPFo0eXE0GAgQ0F5+KWpzKi/0o8Wcw5LSwu0\n1l+t/s05fRBtKKmVM2z5JEZKr4dUGvDDTyAjDRJI9tmLKjm6WSOytK9OZ3fW\nfaC3\r\n=mB/Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFXFpAadsZsuTVHiwPDOlJbPzE+veiWc1/DHd7pszl4QIhAOgKqTsCL7Li8vI3gTC2z2Dpd3q2ye0oj2hDN6hg0ou7"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0_1621259519448_0.22781717471004592"},"_hasShrinkwrap":false},"6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0","gitHead":"959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-3ILhYIHdA/C4zlcM/0Xdfi5LBG6DNE+/hg/rnycbKfgidOADolEXL94mya1/JRHKXOX6lJEZRQi3rbnAA1jwnA==","shasum":"9f4a57f505320bae4c3d3d39da396fc204b4e3d5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0.tgz","fileCount":88,"unpackedSize":453798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo2IxCRA9TVsSAnZWagAAthcP/icFDPcfUcaYv2VsBG3x\n1VXBhUGsFzmeNXK953t9EPSB4J2ZjVmIqPburCGFAqFb40M/H3utDFML+hlF\nGj6KfFH4zajZNBlyVaLUbNoOhDrvgghoA//MwJDB25UwhpSMt5yYE8Mqrurx\n0dUSvi94oD+c4uTy/FF8klOADaTOpCTZ6aEmYq5rJcWR4OJII/hRVluVDCaW\nPkYgop7cH+Xh8Q/Tk3V8BQljfHarSPZOWg1iEzqTA1LUROENksSSN4djavro\nDOvCmOR1WuWjAIaY2cvbBOcpSF70/JC4RqwlPmevzH0vHU63do84rH1y+VE+\nFPEPsbUoxrTHxdNqinLzHyaC7GbLy25tmDB+/L/As9UC93q0K/JtcWOTbGOc\nRhqPf7ffx3m2c2zwhqKzQVCiN8nBLSmpiIeOn/+/aQM3JPXtwgysH09fzyTt\n+L5WfqGLisWC7LYLOeiipIBoPMfFSC2RIQKBmh2EdO6GDlftGfN3S2Xq+vfT\ncxZfFqGheNp7PNxlkK8GYz51K1qIQV8VeCKg7Aj6u9sQZ+KZvveS3iSPI1YH\nP8Zg+UDAoCMiGJ/cXnbBNcsQHmIZH6Xj+Rk5C15iyMRT4bixFcoD51GC4vc7\nBwGeaGcKTopXpkmOjBAuJWzFNjn37ER8nvMhBIOOxTsjd5NsbilSJRRLsxQj\nA2Js\r\n=dke9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPMQmba7N+C3+jV5aVZuMsVlOCdFo2rvk1h06EQZd5NAiEAxxF6ASdOc7nv/+Z8BdW0eI7kwnog0oJ0DwxXoGcVQ3E="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0_1621320240416_0.5153947101325635"},"_hasShrinkwrap":false},"6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0","gitHead":"ad76fff782315d19d91b027954f3b7dbbdddaae1","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-15Lk070IX1EWMlYSwnHx2cx8mwmoAbStXykK4+h7WBDQ0RPEeQL7o+KOOTwfwN660emxYPdkFp/WexO2GdbVog==","shasum":"77bfa1e517f53af93a001a6322cd38bff696ebde","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0.tgz","fileCount":88,"unpackedSize":453893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo4k2CRA9TVsSAnZWagAAJZAP/3w3ndUTEM3ZOQZYmg7j\nhQHyxBTv7FYmJKnXL25PcQgD/zK/yn64hanE994gp/hzicPRNLaELn2OWO4J\n2XIGWQqipwqCUGXv+LnHSdSnBV8C9ri6bUSvEODcFtpOjqeKldCOrz3lG1OM\nGdPuuzn8PNOFU6VIP1lfRoyQkBI6Whl6nW/VZSjJhS7BdeNbegoMWycIr/TP\ntDsVAY3OZx/iEYyPJF3QBJ+q36nZeJeOOxC7iGOTIqHQbsKrpMSaPRDvXeXK\nijwWWZHXxKAu+OHuJAcnhpf//U8uNxgQHkQzhKFMZRgiRJUYxzf9XGSCGgvn\nb6xNKt2n/MlS6jmk9ZJdoEujFM8J4yRCoP+19dRyNUIn4ZB2Nj+U5mYfJp9F\noaRT05WUHv+ZuJIU2m/pxISU3xVI4dqTGLndLyzSc3XOmkvVBBAzWKKIRJDG\nLBObhljesJzmS5E0zpCwvMdPC8fppqaOSPZQCDqMpnX5s2pc4+h+3k0uBE1f\nR3sQ9qI1Tj0Q8dQTuYfJuQok8OblWSM2cZ3ROjK/lYrguSeCizBTLtz24Oqq\n4Q7eWVsIfObiP1yL7PeCgOF855XgVhXRZNzYrTqGvr2w8DObWQ10WCjvt7s4\n1eMLK5T3pPgKc6PUBbntObCqevoCaMJy2tvLxsoxyi92aqGl1IXeOoSny8rl\nz7uA\r\n=6lew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlcCTkUsVjMDIn0Dlxfpqqb9bvwWGI3sJ1S/wUEpb1IgIgQojIKVDGwCfe2L/30AwFyP5XYzVjuMr2XO23RJtkQBw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0_1621330229718_0.7984789728622617"},"_hasShrinkwrap":false},"6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"757d5602fa6821266cc3cf0adc05741e895c72a8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-MjokLdYT1fuHMw4eMADMbmml/XmKmaUn3GGqmEYSGeCcVDa0dzsFAwreIUtJD5+41+j1MEoXERQ9Jh3rI0u0iA==","shasum":"a344333d8eff338ddb82114be5e1b9983fd3d43e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0.tgz","fileCount":88,"unpackedSize":453893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo5BwCRA9TVsSAnZWagAAAocQAIj0wmzUAGZGAUpSbR8C\nJuIl0E5MzrHRWXQd6zItpwwvkiT4d2xEjj52XZzW1DYNluo34WQZpnNk/1se\nBbHznXfNIby9hx8gik3MFwn5FOHSOtLQR8rw6CIpZ8JC99FOeAa/18eWUnm2\nsGxe+tTkq3VTRx4xrq8Dt0IhIbKPz/LWihFqqotluBCrq46rlO8uD6/duEwH\nlyzqSAtSVTHV45k8S883c9IFLhOh7Xb0ZUq36D+EUte8QWCo5OD+ZEJsA+rN\n8vXXHktKewLQMXQbmrnnzqVSuK1Tx8MfPTHvuwThkyvIHpbb0B5wz1+pclKL\nv+nd3jNpKSkGEU7YPGucJFt4GpYephTWHVY7OZ6ciF/z4LnEACQ1Gu+iWrgH\n+z1AN/VmkyGLMYv0XFnYcm/X1CakuTiT87Bhl816Uz9eHjBxeSWQRdnRkGcJ\njV7K8dLUoIsAxj6MQAtKDFiGlZEP2WB0P9V1A+QcFL9lLN/6gFcLSAu4SqfL\n6Sg6XFz4DFkxumaHOV2S5zcdFDbrhaohKoFHXLF8/alDB0nAIpQu5QB+Npf/\n0VhV4gzA2oSLokCXSipCwFoYfS2T1LCLzihjN3BGABo363Yb7yMu8J7SEi9p\npMyrTjVL+aIJghgRzq2SrVWU0zWZ3C+8UKIDXn5V3KjoSnW/MuQkjIJsIKlk\nHTrw\r\n=QKTJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtR1aWL62N4BULWyHIgEelr1eGMA9NB+blaZcM7/h2mAiEA4mMiOkgrc2TI4bUlol9XMEuJoU/FUmc+GmGXKWoFC4k="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0_1621332080180_0.09790863152187623"},"_hasShrinkwrap":false},"6.11.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.0","gitHead":"b51c23e2f8b57974f5d8c842e48e0e48c65b58dc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-PM0eMoJfweyCM2cnwlc5YkaDXPH53iEiBD4/+kcKP743VChylavh9bA++bekfJA9wczBWRVpiElhw0hvoXEtfA==","shasum":"9a6d85a5a15603f5b1c9768d3b304e791801cadb","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.0.tgz","fileCount":88,"unpackedSize":454102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo6elCRA9TVsSAnZWagAAwgEP/1tLklWXAyNjzZEUheh5\nDiL+A3lxWU1OImMSAv4LXcUQmAabaxGTmwmz1fk122Vja38ZbXe6ismGp9oH\ntNDDbSGLPk6Xp2Gn6FlWYCFXp/Ww8qw16DqdG4bxhJtrSVo4hCKBf7P0x5FU\nJRWWbJ+kWKddq6VrpzpmlCTvW3lWbvGSGvTviqD62uXaWodRJi3UWlkZ4Uyh\noYRIPQ15Sng+L9YXWFLo3gwCGhc+m8/HIochVaCI1NQDOlH4KkbeHISEh4/y\nEtXMQ3G7vkxbNqUdxulhwqRGwQEl930qvgPaFCC8NSVv8iiQ3KX/zUoPJ5yv\nL7fFfesV7T0mHlq8PAJIL2qtnWp0FTmfxBdgv0XYCIl7ph8oeEhZ+DVrdLUk\ndmRgX8OZBWYuIwp5wzRb5vUUf7G0uKv0ZDPZEEBcbs10F19cTTBBY2EIE4Uw\nLT/LHoxcuWtBxZprJn7l+JHOqAIZNbbmRD1lghajrP68BvtKz291wt5POB/Q\nzaUJT7kAnS9Bni994l4DT8UYBHeVcqMtoUUm4RrG7P0gTBVPw0SPgvr0ULMz\n866u1xPCgY9fwWyC7FgsO/WNwpfj8S+zDS8tUintrnY7O/QT6JBmwMR0RYPh\nFQfYsTmUN7hy5q30QxKh3nNfDSF3fgigsz58b8o4KqeIFJml7vc58npbDgWd\nSak1\r\n=0Hkc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqb2BSSTzVxlsC0cthA2ZGHxrZC2avwyk4TUMgIP1FtQIgGwDNj1F0yXk0zAW1TBOdPAmbs39Hu9iPrXF8DcMao0c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.0_1621338021360_0.7181152710297263"},"_hasShrinkwrap":false},"6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","gitHead":"b51c23e2f8b57974f5d8c842e48e0e48c65b58dc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-/J7gfDNEllVStSjriRZ0DanKlqmAO7+ls8kUOCVH7NblsRDJuuFV7JwpEqNneLOuJlfJ5tuyJiWhhRk5KYKvoA==","shasum":"9cc15ad806dbb905b3f810a8633223aa5acdaa90","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0.tgz","fileCount":88,"unpackedSize":454145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo64SCRA9TVsSAnZWagAAlX0QAIUv51EVYd6YogEMllnJ\njps1ir3ZG6tNzTPAqsBDJqq3pC3YE8MzicxJ7HVppkywoCxWv7/Kf7UUeCNI\ngFRguaWaSAJbJEeHhzsgDzXaEnyse609WfRPX54jnf/TItb3Vuj5WIrY3Axa\nhgWC4939C0N66XTAeqfOKwZY54iDk+qQF90rEsQnQxqQsMf6p4wREBVu25Ra\neiEFqs/ixAa8JcuWUNPpmDDFfdZU6HOwDRkseSJeYd07cOUWdIdt5D3H1U5V\nmk+ippAyBoZAfYfn8FLMm5+0m2bGDNiT9a3QYo4RNnnBfN306/hf34vwFxkY\nkNC3YsbAHfu9Hvco0paP06+/JAAQ1Wzl1opYJ8oX8m1ExBwlSxqjwkYYjNFh\n0djOb2kPGtga9usvQarbPlfiQKkt1rgi2rVT4BMLbNX7KSQslYARgnNn/ojY\njxu8UPJ21kaAIixwAE8osQb3az+BPLT2jqLky5OypsTFo8FKKGDl0Iqjz9r/\n4E5sGfb/GGjcm7jJtQT//8uLB1RpoRNgxYlEdAE/5o5GnfuR9TxhH0Q1bPLL\n03+0A38TK0r8em5dT194XiD4ZGvfBTXy7GPiKkchw76KPbMuuUkxWh4ZCJMz\nMfa61KivWrna2hrWrzaaUIOR/+F8VWdUSWtXp0RM+kFq/mbZhcIueLePRsV+\ntvSK\r\n=2sU6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClpbk4wPPj+DimBXYPmCOblzeVaCN2AcW4WjbUnhsgLQIgO/x9TR/dQRy/++JXtUDUt6Z2coYEJ7hcJ46Ep1OksaQ="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0_1621339665915_0.7643885427152182"},"_hasShrinkwrap":false},"6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0","gitHead":"28212d94d9091fcbb6ef2545426f57ec3bb97548","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-Zhx6yiiyS4HRIwZCsiqyAVXXm0M+J5Lff6fKu78GsRWGPCFwXycrUhnBgHRwkU4o0JpnPzUxlKQjidAzq0LnJQ==","shasum":"872045e89815560e621fdb4bf98671c9fdc83ac8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0.tgz","fileCount":77,"unpackedSize":402293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr2e1CRA9TVsSAnZWagAAhd4P/3LWC6goFiMiOqlBfE6n\n4myoCr0SLj4jV7rxOFIfGwN1iWnBbiaMj5jX3OSyIQ9CPl39k+C5ZqfT1CE6\nbQyiFgShn5KbQK/Hldc9jQ45S9h3JXZeZoAx6LjX7S6qjhmCVJj9YoUyhbmj\nnoMs3Pf2H9Yr9d8N/IvMh2VRHqcw6Af2YPZVQ0qLB9quFIAMv4BvAds0e/aY\nWzOn3EZ2XpjAAPrSqPj6KiNmp5CAprjf23jmry4qkZO7076xAJE0nkrggE2H\nu2q7sVdGaB/sCOQYfMnnjKMS6rn9IjVGNlyf/P5l8wGv1TJgNhN7pkR1fJXv\nbp/7vEt+MuF7tA+C1eWzQPO0bNJrRItLtdgssZXK9FbgS8GTksGw1csCPdjw\nUVdCEtri/5ewgXSJ4iWMEDub2r1BYk2IMqkEii5d7SSQ9vruYAs5sgUFOlJJ\nqbfs1YNtBOX9GBEgtORmk7A8Hxf5XXREMVfQzJSc8EvjZY6y9cvc00TpxMw9\ngUAo0/GgYRE2JFds641Y2NlJNlOVBxZ/mhAmi6z4jyu2H6xY/F1rAU+Hb5LV\nGSuiE+7sZg9190q6+WyFRnIsQTbqjfeSl6C+ksIERcBaTD5vI3KhzHlZ/P3Y\n0K4ZDSqG2d2cKr9ocWnvH0AA46Ao9wBShir+WPhlSamvZPDQlG1rsdy6KHjP\nWyWQ\r\n=IJU5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICzMno9zHjWDD1FBmsbUKGIl1Rc00oaWN5pxi4XbES3WAiBnQdSmnJnvvBf5buZsqkD3gePqD2N4DN7SwQ5SBcfufg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0_1622108084663_0.957994961873492"},"_hasShrinkwrap":false},"6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0","gitHead":"6e3d9821806d4623951549745d857a8cfcdb153e","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-WLG/8v3v434on3btP7mLUHyDoJiyUKF08MPesZJad4O7EBnrSmfbBJZvErgdBMdgz/a63hG1Gz0kvT462NZv2g==","shasum":"b4e211065f206a3292c69df268791bd0ad0c215d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0.tgz","fileCount":77,"unpackedSize":402293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr2hQCRA9TVsSAnZWagAABlMP/j2bPz3rF/AwKX4jQxrq\ntSqFJNMBXZ8IErTvxNBdlKpLxb9RzK2/QB4g/hKpnU6u2EnUOp0/GkVCZiT8\nA12i+gumZ/ZMO8JOKhKQB0BdrlGrhUuGNi+rE1vZHxA9/0zErNujtLs6fv4m\nlXC4z2ZArOSMSZMtcwT3frGzPJuSDf+mibv+qjTnVXfu30npZiJREqIBZK59\n3evDLdhWVWTi940rd9irU7RsdNB/UOJhX7qspQXdEI1T3Sqs626jnLwAej2a\nH0FsPcb980qTdGHycV0qVXEpJomvQNK3COpMgI0SMRhGsBxCvarpTZ3sZWO9\nCxH2zXcZASMTS3C49bkqVzTU5fnnFQJNliAmP1t28gHszG0YJJDqAQ1J3CkJ\nBWDYvOkPlrnjqOFleJJfun52ykgFMmL+ygybdxSwDMMyrjiTxdqIKYt0BV1J\nryKWgzKCn2A50sl7TQ4ff/adsz4pLZJ3cPVRw2OBD9UikXDxsPwj3BfWoY5b\nQ2Xhi8oEMCKZFuzRSKFkj4JyN/IjkXPYRWDzTUWDxS+0RRZLsKPDSM0xVxZL\nxXdv5JrYsUo64qrQYSFEdPwilFjs0VKcfDkwxtZ5aEDGAPCnbv3i+l4dcXO3\nKVGxvassx9i7zi+DooQ2zEl7w3siHgnuU654w4nfBE9eIh3f14PUciLRRiPL\nf8ED\r\n=2+MF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+hrW/Mbju/gcQ8G6bWcX//5lyQ3QXQst/hqvSbDYFcgIgLZYJ331zepZuCrPkualgq5U9MvdRKUxH3ginf85Scqc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0_1622108239731_0.24057749702373354"},"_hasShrinkwrap":false},"6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0","gitHead":"2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=SP8tvf)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Usage\n\n### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n#### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n#### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n#### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n#### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n#### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n#### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n#### Migrating from v1\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = ((firestore.collection('my-collection') as unknown) as {\n  toProto: () => google.firestore.v1.IRunQueryRequest;\n}).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n<!-- Instructions -->\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v10, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-sODLBYW7P9R3oxMwYI7ITLnFmx3r56iPn6c4M+rh4/Fd8hgo2i8f4tNa3q2RIPkKAhK3j9WbQf2ZvboQGFWLCQ==","shasum":"816b1b98f5a8708df59df5da889677e43bea3e2f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0.tgz","fileCount":72,"unpackedSize":354298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr2nzCRA9TVsSAnZWagAAV7YP/jUirnHLEEYSw4mQMtXD\ntzTTynnhdh7wamghNMVMp+FH9U7ZEk6vCxKFIVZbqyQMr3u+MBiCT5JOKGy6\nhw7Zu/bsRlxSr7wmMWFUv6OziUQIaej9hBaVzH8u86RR/gEJHbkeqM/t7EVs\npklCQTD2qV5+Fbz2E4xvQYX0sIfqMzzplPxhkhn+QqrSmvw2D2zHizcebx6X\nQvE7cpxk9p+9GTI/Dsc0sfWnv4oJogk3FK6Y4YaXab5DKgq5f/rOC3HfXyym\nRJ8jAFmWP8vIzhzXzk9b8zFyhQbEfZOuzYlJL9JS2iOctCDc03Xj1epqWHmA\nVRu+ST25T5G1sKMgwewoE5wZBhhSDz5CjA+UG/sv3rhL5kU+HMsy6ZGrIQVR\n3lnraK80TubWZGIR6GdNXfbXbjmZ3ldmC4mSBLKUF7xutMHqN5uevYXDiz8Y\nBdUW9n2zRJwVYAUPie7a5moP5LV9wWtbt1w2ZL9yfJP1UDu9dhYcRo5yhIIE\nmCL4feGA0Lji2z1fSbPa8vEhgBSp/ZOOMvS8CjZpIhVbKzBoq1mAD4LLew2N\nNR835aJDprhQMFtmS6sAHQ8X7sP+TU9vPU0xeGe/dx9+Y2cWdJf4UpYLwKWf\nFEUpq2LZjEMM0Mmk4uVQlZZdf0FTa7f+lv93MS0lzwg34xvCg53lAofWJaZY\nq6GF\r\n=ia/s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDDEXkjToTs8A55aMYW8/uQKdAisT0PkIoBXegjMKyOAiAvA0cZUQimNg/humeSUgfXkNyFN0BSddChtMGpvIgTGg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0_1622108659337_0.75311848728255"},"_hasShrinkwrap":false},"6.11.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.10.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.3","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^26.6.3","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.5","ts-node":"^9.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.10.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.1","gitHead":"d1aad0c9f387ac7fe2ac8c4c13f8132d1685a5c5","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-5fbUv5+Lx5pabmrR4jDuL9oehe2SgQRCteuUhMpmqhAtmtS60Wc1xZweHv0rYtnzhmE0mDEhWxIWORBdFyRW+w==","shasum":"7655e3205d6f4502de43eac6617a8c9700c12170","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.1.tgz","fileCount":88,"unpackedSize":454367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr2xQCRA9TVsSAnZWagAAFEAP/2TSyT0dZ1a+KYSMXCVr\nuj9OV0m5alEc748e4GZaD5w/fHqu36S6UZBscs24mIwWgn7xJmuRg7lkajbe\nUr+S6Cq+bJdh+jxGvhq88GFV5VzRhPYrZRR5yqmSo998oRo3dCKgVdZT/paD\n8RvCvArlKlkVeQKh6obs/dOk1XwTeohhWnOXX73qKW9E+GNBnuSxlUJa1GGc\nSZaO3S9LI4ugxuTcG5ayrbuwJoiH6SfT0X85B1OPPb26Cm9PQYfs84SeDu6O\n294pxlFK6PIV3uE0sgvmPMjnuXRt2BTWXMw/VZmR9ymab9jFZYz0TLaPu5Uv\n0+5WlsKprovg2/Lo2Up9lHY0pf6bQU6C2rQaQ8lBMN/BX9d4F3LUPmLGJ6mA\ncVycehFMOCNpfdh2eE3IHamJoKE8oXTjgr4A8uKtIsYk822yZqeLC7Ndf9T7\n2Ta7w4iHRmzKJXobBl4HsXp+mmz9FUGBF0ob3XpRz0Hvb6dcyGeu18w+pqgD\nlWoRvAA63U5NapvDcoN3lN7oFtzKJzEH1by2SS/r7mzQIF7KbAqN2y93/zse\n7Ov6XWjA0Qg7RmzfCRL0lYaWVMqKEBYztD/FT2lTcgt/8qrbtK2MOW8yJd/U\nzvZdECK8h/XEXWJzuhI0hCqitnDhUT8Gi562W18PJ45xh28T9+URxRb+yiJY\nqE7b\r\n=MCjK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDE3vfrkBq7/8ggofm5HUQ73DVl9Z3dmX+DcKPscIm88AiEA/xPX6JSMwhuVkcsp4E2AdUQvFWBeyaGYIgc7SGhVaiI="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.1_1622109264329_0.5762043913099375"},"_hasShrinkwrap":false},"6.11.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.2","gitHead":"86ceb837e2c6d0d5766703d225a18501fda15b62","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-A7C6ZayZ/9yHlZKdVnRAacx4jP0s1tY3AByxB2X76dIw8pKvy0f6pezsAZphoEXM7SJ1Rl9C63RgLbn/1CwCOQ==","shasum":"4d0ae6090b46bcc46a070d514090bc4c5cba1d68","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.2.tgz","fileCount":88,"unpackedSize":455488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr23xCRA9TVsSAnZWagAAUo8P/RHf6L6vI629UqAWfA6P\ns8CeuNEF9tIR6Oz6vJk51sRYlio5peVb/R3Rt5x/pHAapXjav8rHL13Xl6DZ\ncY5pvRgfC/HHQn0uKvBHDRwj3yTACz6hsX5W9HqFxLZEj3Vjq3PIZAoZFxld\nvvdBVo0S/U1WSI9AtPMlsf3ah0nQnA62/p5cKnc6fA2LHChCDAwR7xO/6jbD\nv02epZOUpoAw3JKtsxpqN6wkgp0CFAfPJeC5+Prb2Byxk02uq3nFD3je6nyE\nQOwvPXk7+7xTYB7BJdlW0NTpsSzQb8JuNTDeE1NYSoDCAoubZ6JQkJ7jbqu6\n9N2/Avn1tckJSbZNi9pl9dWh5O1biIytLotvHh9zbkgh9xUcRFYYoRsEnOl0\n51gEZ+a2ox8P3TyWW/E2S/DoQs5y+qfPjQgGth7r4I8yLxGb7Tj+yhZ9ImGC\ntCDVSli1+HMRdWsizqthFlCSVQli5YVfFqIy5fMR6IoKVEZAFv9bJSmoN6Ut\nFMN2pL1Q07bRXaiqKoXRmSiSAfn5atIVKPDSBwjvcfWnzcTcMEeZHyiBw9PH\nq/F+HBrezmro05JEtXappLzGgmkv3SoQHfr8WxiK5ZIccw52/hbUI0A2BOyo\nSzAU/06fY8Op1dJ7aM5WnhRbg/y3EpxzkfgoLr3sKV6c8+OU+85+OU8BWwT3\nCHib\r\n=ZwCv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmQJ69yq8gmMwEEZitYTkv0LTSEKzZXIXfT8ANuGjcFAiEAhftYpayAYiiV1UjPZSl++WMVqTg78PDX3t4JWc8vxOY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.2_1622109680685_0.41909043153493575"},"_hasShrinkwrap":false},"6.11.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^10.5.4","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.3","gitHead":"0b78b9c4aa3521981212284472354ebdd3315352","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.3","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-G3ElyJ6D8aYDXcNeeyjubDs+Amb0S1t+7yatgd+Q8Q4pv4rg0kg+jt+iBZjEJb2XHkI4k7Z/N/rMwrm5xPdBhQ==","shasum":"2874c85d34b67ac45bb6f809e3b0d8318d986e71","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.3.tgz","fileCount":88,"unpackedSize":455768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3b6CRA9TVsSAnZWagAAdCoP/2LeKOhP+9489Xz36YwZ\nKAtfmTS1kgCVRMyfmphb1+eJeXQKe7ZnW0+vMZDuazR2W0VQCAbKGlNvGc9M\ncKlSf4t4Uo+3pBin2dc5vMvLJKq0ZU/KfXIlwcFEpSOxG4AalAxzWRKDmtb5\nTJ9cNe/ud57dywtPGYTnwsYFwlXaVz+KDrAU3mLCHg/hz8VrqpBNzB3+f5bJ\ntgTidkrmrazPGvooB9IGHNQ8N9ECTft3p4bnIqFxbfMyPZX0+FV1L/B1wHGG\nJ5gGD3ASoHHYkZWnblHUKVbg4YW0yNnN0ihCQtnLNRrjGncai8YsIJTeo0KF\nJYA6qCfkQDMOaxamPlbcb4rx/Z0OND5XJnihiVQqNGOzaDSgQqiSmOIP5rFF\n6wgYjLxx0AZpJKpjFdE0SjaA54GsrzNYe6YdXUozOatCGc9WlC+LTEgYvS8z\nEfbLHvM1h2oeEX8Xms/VBQO9XE+y5EI71qc2S+6eMiV50OFw0fLkvdwUuRy4\nSsa2bku27ngmgu5Ql8j2uF9XBZ2CUtfDdqkslHKOWFGTha0IyHGFso/vFAsi\nbcv6QZduMoAmjF+5rO8rgXrAS4bdBT+qCSELeUtRYKMEWGX1dOwKJJHqkRMM\nlv82f4Qj4tKB24eQNXItZjQacW9YAi0HYJYYDx7KNKiSBo2fISK4e+UWvyTB\nz8D3\r\n=rVys\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWNYB7RIpqBF2IXI+ARxRJpv/K4NWgcRnvrP/pgXW4rQIgP7cX/gw+7Mhs/egun21KBITuGPXIMV3/ajb6tM2BF8c="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.3_1622111993677_0.8736200365493976"},"_hasShrinkwrap":false},"6.11.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.3.12","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^4.3.8","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.4","gitHead":"41321863ff6de501bd985e5f005d14ab325257a7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.4","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-PsqLdlegiNJy/rsrKfCQ6EuNgCsOAvIS+zXcmAOxFagm2f8oefleeNjz3gvS26Jje5u1hED/HGHWGoM/F4mB9w==","shasum":"9dfbe8d641b14bf7d8a2fd57c5baac1730eceeb8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.4.tgz","fileCount":88,"unpackedSize":456050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3jLCRA9TVsSAnZWagAA6hcP/2XpF7qVQE1r4KqXbFp0\n76Trj+eJGy3+wXxES8nOUPtATob+aRyeKsFRQRV9GfQc0btRGD1G5xsHEao4\nuOH50oG7mROToxdtmHUdSuS5zrSgk8Phbw70teEciaeHf8akNcD0FAnuuRFk\n9ZgJeep++pNHK7Q6iiQDpNg+gaUOt4t3Eom+7gBKkHbNiwuSXbSyduR9ywSb\nf6xQdN1xlM3f4nCRRsiyLGxmISnWzk4DWGdc24i8fCGlrrWYT4tkcqCcqkp1\n+I9skzOVHf8vIHof+n1+mOj9FY/sp6XDlzal88EtoItNxZH6hJv5CL4xA2a1\nNU0etJ59lSpm1RYxW2qR/vUlM/em+Sab0Za61pWgUXGHbz1l79eICWWDzpdT\niIgYZH7g91oWCfLcOHCIEzt1aBgad2ruFs8C9HSoJ1fNCHHUjLtueQs6J74U\nl70fB2stHD61f3oJh6e7uocjuhjpqRTqIVkRCpNyTEIyGN6IfkzgoVts58PC\ntLnz0sWF+7R/sLwFh7DKO99aFFI/C5BEzFqOiNpbUgqgweukIDRcYuq/OrQT\nABNVVxnSkZO4gTwpalINKTr5dIXleA1SLcwyRtKUSblAmJRQu++3jdBZbm2N\n+aMIrPFF5dWZfohYBRmQVBgBsbsDPciK+CvEsHzBi0iGy8oOkGJ/PqDPzb5w\nUcEM\r\n=rvtQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6iKomxznMxiOIHFb8ehuRhQNTdxxa045yIpctiZUuzAiAiMqT/vYSdd/eobbRnjI27Sjwf7I/mMAPFveq/Tf0C1Q=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.4_1622112458320_0.2794173383270444"},"_hasShrinkwrap":false},"6.11.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.24.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.5","gitHead":"6ddc14e200ec9eee0de31aafb34fe97c902bfd93","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.5","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-CEoD76SMz2i/zlA68Tb2X0ikLNExlZC8j4/qUbjDh+sEZujOVgbwOKnBulpMZaCrd2Up0H32oh3Z1NJukCtx3g==","shasum":"103b92b0a6101c70460f63647d69254c5228f44d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.5.tgz","fileCount":88,"unpackedSize":456484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3mZCRA9TVsSAnZWagAAUZkP/2e4AuO9FS7iNqN9VOMk\nf5PzZfWjAbXhQdGwQwow5pNxaB6e3DZ62x/JAK/ycjV9wdR1+PyL2WS8NSU2\no0qgVvwm6qH+moSx4IPJz03TgQnb059JT8A8/irXyPau7SVaCzT2KZQRBWrm\nQsk+Qv+D/zp2DaJsOXIng8PGIKMP0PHwpDAZQ8dbXXh/BukcT+T1VyS/5jb3\npZWQTNqTUVZ4GbcaN1oTh/bGS5urqtjw0r1Vs6q1kfI4pCe+HlftvaAMWRC/\nTdLcm/IHga6xE1Zde1bxyXoskKb+J2KjE31UMEbu60CBjNhKb7TzyeHKP3KK\nFKCuVyWNPTUeqkxSdIx2SrPRnHVP4vLn9qwWMZZ6c9LoBtK97KL5ddIswrap\nfVKjXN6m97+N+85zDWXdCrft6tgy16Tgf1GI/7z9ecSRLIiHd/vg63ZgCDMi\nRDsenFT3z8sE2aYzcwpOZBUB3nT7x6lxluzgxlUYk2CE3hMraYSVKfvV2Mk6\nqRUp8YPRw0W+hHrMP1SJoPE+JJVUDfzEUDX1941NVGsM3Dhz4w6W3nZJFamH\nqB0CQJejt+Poet10C/gME2yAk9ZF2S2/QgGpnfxggWCKuv0Pn/HRPNMv7MTF\nzyERwmlWBSz5k+H3wmCjQa5PYBIcRP48/p8lredI6IxRa1/ct+pEXZmS/yvR\nQsXU\r\n=5hIz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYXT87rd6qN9FSKKrvGkhMjQ3cvSu1tyd/ZgVz9uk8OwIhAPj43SsBWHMSA+5pS94c9j0VGND0O4zIgv+PnawcWks6"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.5_1622112664350_0.07722341355502227"},"_hasShrinkwrap":false},"6.11.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.12","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.6","gitHead":"70dfc8c04aad3fc4be611869aa2c2bd44d4f4de7","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.6","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-12aSO+XaWQwu/V2GL7yxrqhHKzQjfzKE8MnKyI71Ye0WvRmTO6v0OTeI38+39R3jAFZQ+ImTvGye7M2X9sl9dA==","shasum":"55dfa0be86c06b50ca9a19a8701dbdffd3fd4153","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.6.tgz","fileCount":88,"unpackedSize":456928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3pLCRA9TVsSAnZWagAAjq0P/2iU5qbxM/l1SSAPh13F\n+su1AaC6eSSxMY22e0EM8Yg7UhaTuF3L8Ur050Q6hggqGRzyvlgW7D5693oW\nYcBs01EZlXoMb3akjsEKqr59FfSx0sShk+9sxv1dMLPNH1Cn0BgN/AlV+48Y\nsg++5mS52lhIw8yxBm/YK+t8kNymQQ6IELo0cbyTFjawGcvnmUZZO4kFPWG0\nrzrPwd8KH3dzM1ktQUvXUfBnC5UHzQbIkRBKA+PORBpsfJnciiNaOcLGBJNl\nbSj1lTFiFCUaLvV6Hc6MzhDWOKc7vz3CGk/r7izAsRoHi+oI8uEDCVljyaas\nYEiFW1vOyE9JXRUFk5yS9t4NecY1zsF0ICfI2qmgOx1eYPhuCDOkKylTyW7W\ncqcYBgHvWqWfc1SgFZsQ5/nzh5GV1To06BxX8I5ocF97k47hIh8jXnWna7vQ\nDs5ZxrBpZI7I7cwCrt/4LaFSQQ06YbiagNwhFwUlYIjAllcM5NMc5gyq//eD\n/5ZJxO5VpM6FDcy1oCZQ4C9e/mqdQ1gSO5Y2fkBsiUHLJI4gOLZPr+WhS67N\nDWWVJHANzz34kHYJcyzvyYWlJVUtWgQBdErn6VVE5H/kOGbRuFtbyuiQLNQo\nnGIBtn7G5qunRZzC6Z39V11DOpLrEaNaKMak+qgiJNknb6AZelcMGb/GHUwR\n4a7k\r\n=PsL6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBcu4218sZHxPhVV9eqXtdXYx53pw4J/RVj9kVvm022MAiBGL1L4JHqA21b4IUhy0KEcoLr2kszjMZ2DiwFdC5YUDg=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.6_1622112842737_0.6020352658784625"},"_hasShrinkwrap":false},"6.11.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.7","gitHead":"186ff9704da50d567b98caa615a3eb6c5352e7a4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.7","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-uxbLZv5IgrywP5lByDe1k3EGRd8ZKizPkDU+d7mq3ePKxMGdxRcj1BgbyeFtraIg3Emc2e4fPBAQk42jUxzCZQ==","shasum":"4fa44742d0f220f6473c9397d83b596f68516ce5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.7.tgz","fileCount":88,"unpackedSize":457224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3ruCRA9TVsSAnZWagAA/zUP/2E+LZ+eGvjUmcJWTieR\niAwBmWVM0VPaDlFoS3iwj9sXwDz/G4cLWD9hDzej9Z82aBuzaZQkxrkToG3/\nsSjwni7YFS3Kj0cE2EXTuBXOrAYLHjitxVG7zXUwc6BTHfDPG4jxhj0b7zFD\n5dKDaTUIqhPPZ3T6if7t/RbRJlbnGlcVQGw3UHWRnYOmpaOz2bAsIe+e2blI\nue+oF7wf0WjwkJTD5WmASHrRugwmkbAv0dpV1LcW4DmzrsdQ5GKukE1I5ArZ\nzNHLmTi2NLiwRHb44AKDZPdnM19VIh0Smf0RJVsAqGLMcRJbWW4p637NHF0z\nu2fJvVldmWssf0CAtIeJFS0glxLMktYO99C9X5aU3GrVBophjKvd8glN6M+M\nASVSoMG1f5SEBo6D1Y2qd5YqPlF0lsGeCdSl75HP6F3Hgp9P9drtobAu/w4u\npX9kG7Pl55kATOAb4ZQj87TVcZHyEZo+D0plgNEI0HEbScRnYVH5d7mR3itr\nIYw5cs2OuKAD/ufdlZG5r2m3/fPCW6Q82wzGnINlYreSKQIlXddxjKPBGbMT\nB7jvhzuoDeFWySioUYWZ7jiube/Ppud25RMVT3Rjc7W3EPVUXUqf1BViEbxk\nmehmXNatQeeb1unnBhmqXCSgiQuQW/lKf6No+9j4Apxcahz+VV+vVpuT63kO\n+wx8\r\n=RNwJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQ4mx5D7kyvY6oZb260QkXk0/YcCFpXljQLwH+TrQS/AiB5POukMoLFTPp1OvfoJcGj8EUtxKtPYwMgoM+HY8PJjw=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.7_1622113006040_0.31443960129279347"},"_hasShrinkwrap":false},"6.11.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^26.6.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^26.5.6","ts-node":"^9.1.1","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.8","gitHead":"55446e72959eeecf93d1d892c160bf91c69dde70","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.8","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-oXy8KIVTWj1HeZKcgpg0VWWiudZ6WKpbwvG6sZM1/7+ofb5qeBxASvbzPtTsawarTLxsscLsYxDPTTCnY2zuKQ==","shasum":"5040a7b913919c80ced28bbc5624fd9d52f51241","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.8.tgz","fileCount":88,"unpackedSize":457510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3vFCRA9TVsSAnZWagAAHdcP/jtyiUKIMUN7+WjR3RTR\nXE/WTJSD1gtpXBGu2HpjctoMSKyJl8tV1OU07Sw7R4jbbtygVZFS+ta8M6bs\nlr38Is6z7xDDpnNu4EZbPvgjb7xanMYrWO2CSLSDj1zPsSChuKfgoXuBx0vW\nHkUc4bvLhsymWKD8XGIAhwqfEbzkt5CCJgayx7nc8PFYs9nQz/4iA4JIZGsG\ndV6GizRK+2A33A0Ij06h55JQVNvC0URODsOeH9838sKLpubIVzBj/fxuxKRq\nMW3A9Pd+cd0wAQCNnu6GWt15xdZZIR1N5alDZEAwEsNltJMtoE9pdnnApKnM\nfgnaA8hykqcYYqM34TzJG931Ja08frQC6jeVGT4TCWyqcFRsN1qyPTJIUtnw\nwUnfPOA0ybBgCU9u1EjyP0VDcTktArOo3INfYjjaJ9XiFmQt2bw76ML/HGzh\ne8o170PvC/UZT4cUIPAgefOLFoQ3V0YfHdtqwxFfm7HIhFrQOOQ/kahS15BO\nCmyL7ft9I/uRy+iyHd6hhKAC8LuHsusN/9R5xOVeoYyoBcpH53d2/Tsk3wpZ\nna2Fvq3TJWSLhsU/p2EY62GSWE7jWmKjHmb7ZDctNNC41rNtj9jH9VeVRV9w\nqcrWPWS8a+BEVDwP4ekANp4+bEi5MexUOhzuCWGP5Tx6hp8ECXJH7KSdIF/g\nc+1h\r\n=PJu+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7q2UNME0Nn4N40K8mF53LIvOp1q22rj0wK0eRSU/wvAiEAuK/dubSM5AjSjjYwkMN7Th4AvmpANDOqMg6q7TmJBTk="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.8_1622113221104_0.8741429707034305"},"_hasShrinkwrap":false},"6.11.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.11.9","gitHead":"27875c0d378ffc8b05014d64ee75914db6a177f4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.11.9","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-20VJS1oNTpsa+5wSpWULv4QSFMfM0jgZFqFreGE7ihulHLTeAZjM/oTLa4GtITJhMNibaZegbrVzG3HCu2+8zw==","shasum":"b73997032670c813b5c2c039fd4134aac06084d9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.11.9.tgz","fileCount":88,"unpackedSize":457786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr4LxCRA9TVsSAnZWagAAAOcP/06wlPE67D5xVQR0CEa4\nzGfKqQCEZUBBvf+OaOOQR8zU1RC55iAYXK3hthcveB5Y2Xsa3hPJFhOqdL64\n6N2kBsAbSgx7X1NJfOf7cMwrgiEhE9FlQTJ4vKUfUUIFUpC8xKKh+j+qzgCI\nG5rIKO6Kft3O24SvnXLNuOruMlKwmzLwHwtO7H1j7BaaslLU7cAncEMfM/KF\nbNskGicAvbEFSfC4YrlDg5g4xdUOL6PPe6oaaziIj6KKuISm3h78ISUbXiCb\nBDkxpgCZYwy8tBt3IuqT3UnXX/MZARd4RXFnfNCJTzB6ZuhJtmuiRjwQkIjU\nsLku2o9DQb2Q7WF6eEh/wxDUAefSgI7fdiv91fJpKHjUf8TPT+9cVzdVoo2n\nWW6c9c/YefvXoYdOHRrKnOR3rbVuAbHteojpNpzXIGxom7saMRxa7Fwu9Cq7\npfooHBnV7Q8g2g3fbiy7cj8EEsqGAmNlSN8mwYKE4g95/PnwC3BQq2tQtYrz\nhhhqMdY5+GUHijLRpiKdcU2aI/rg6xew6JdcDJBIwTy7jzOmwBcw2On5EhId\nMvTecu6hr+t6h2yGD/X3Qa50g5kt5wh8r8dQXIjFe+nIXDUT6wVMfbMA+FM/\n30OgQCwvTLQRQdTc+xwe34Gt+REEoZPl1hNxGSO4GyWOkA4cEIpTM85kyLB3\nPY5I\r\n=9lYe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqFnILD2abcmRs5I4rfbybKPplgyNJL9WeKRj/IOP9igIhAJY5Qi3D6VQVfguzf76wh8XHemfKtyOsq1DVt7GjjDd9"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.11.9_1622115057437_0.06408497866513652"},"_hasShrinkwrap":false},"6.12.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.12.0","gitHead":"7c24017e2f6b2121f4e62132718acf1f3d0efe4a","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.12.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-Yw93U7jeCiDazJmE1bWQ/Xrk3gekyWqDmnt0M5D8dsKtOjYfmVOnSe45n+rVyuIy2qkC6+tHnpFD/TfObT9LJg==","shasum":"81177a7ebd69fe342274afd2324fa9990dca58c3","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.12.0.tgz","fileCount":87,"unpackedSize":319740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr4prCRA9TVsSAnZWagAAwM4P/jOnkc1+rHWgSczSiMAj\nDZqB+iD7k9uJCDBC/rhoAJwi8GAHIeePkYT/1gpPyORj1BqPP7P+UuO36rK8\ne7A+X4F6FHkuMmVRAW4yHrAOVhVVf1dMmwCXJaZ77+3HwrSFOmpBnGZn/1JB\nPORhEQGTlHD22BKQuKOPhOmI/QjplM3PagDqTXfAXpx7qO52bMuI8Dh/DyWF\nDaUNIQl6yYt4TnFZW18DZH6OYd8gY3Uue/VygOkMm+fS4WIHr7ekwPa+kabu\nG3l2Ln8dtToVbJuGhRG4XHLLDX7qwB/x9nNA2tKYXqXI9+q2JbSJ6wkRTxzQ\nM3tWO79fRwpTQdb0CGcMY22l96i7AW4KbMS5WqR7CtBvFdxjXE+HYmdD+8on\nQ0uqGPE59rxgdYVtHc03wNK8zT1hl/sRc6CxkdTz9tzlE6S5yiKIrxooDGyW\nzGA6nBrmekCYADmf43SverBNxHxF3nQjCmkw0tNrgYFaOERj40NRjjDkrw7U\n95T8R9AXCylprSEWYhaEa4q2b9CiMUWapnt3AdNFEVFH17xszaoChoq+Tnmz\n+IbERk59DCWYs6iTQLNQ69B7U0wPEwNHJUF+N1Vd+pJEiDpE/lNbYZBUsLPg\nQeQofqhU23TWjZGSBzvXZW8HEayJe+STob06sdlcijZzLl+ojeuGe7ONR61y\nU2td\r\n=sWzr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZyN08JMj5Xo0yr5ru47o9RS5EPPNUa9ffqfJItpSxVgIhAMqa+TTZ9iYXAHADtwNGgxvD257NrXbbVoFWF8y+bcY4"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.12.0_1622116971250_0.932156912642955"},"_hasShrinkwrap":false},"6.12.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.12.1","gitHead":"013221b9f7ee86811f4fa43f26dc8dfb35d2c759","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.12.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-yrLNHNak4z+nNQYcPKzoEQcLF7W5tG9DrGq8hZXRA6K/BoumJetQ0aOxKymvsa+Ad1wONA9MRtBAikbnO7ZYpw==","shasum":"066e047a2744e45178949669d3aa2d8304d567ce","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.12.1.tgz","fileCount":87,"unpackedSize":319740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr5dsCRA9TVsSAnZWagAAf2sP/RP2pqK6Eg5HqL4YqQpi\nE+QLC8SJGqzA4eotmymL8GHV2A5W2pJaHdkaj9IHDDJBq/VTtoDY/9HvpnQC\ntE3o4itiCyNm4Gvv8LiXYAbHAinGe2USpUwkBI3CiougfQFoAc1907/Fi1oH\ntU4AVqi+6H/8Blzxjhwj0uw7APhR+keZdLLhNGifENs7LK7omKXEUbroR1v/\neXoWfVdVrKaoOp8eSREac/B7Nz/gee858tqA7bMecjFSoEqBBvzGcSxC1lRg\nxrhG9JTA8alLjpPs+x/dhUtMZnW/xk6tcO8KgruErs/TvK3vJJT4u0uyOrHu\njEC9QAqDELVpTZA/7oxuoRojTN2/+DWqkc4fNxjGRxbY+8K19EKk6vdH3Chk\nXfh03u90hBea+Aw5HM0HdTq4HR2/0nMa/c/Larou2lq10cyNCta0BedFU6WO\nl68VP2XqtDkdXyJmIJL/3l4DNgiqN9UZVd/wGpA0R4hCp2cAEbysXlhsaaV/\nmSHFUE5K4czrKaxMAtyMBFmupL828oSRqcGzdiAbP1wYQJGefrxE6vPbzCs0\n3bXPciyl9O30CnOY51Cad6VK2hBIIMqkyv7oLjuJaPZLE6tQtMHRUWDyjIR+\nO8+0Ay0qLuMasDWfHm8/zKAIpfAFGn537fGVxvmW8OjTg/xyItNmnTmte+ym\nwbGg\r\n=w1Q6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHnPq86GQKJo4CYN7Lqlglc5Wk9YRbvEkGOKSBx6gqkAIgBHt1rbPHXh1vi0mhT0Zip8MlrKxA1nLd7ER5QZ3lB70="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.12.1_1622120300110_0.41346062447240595"},"_hasShrinkwrap":false},"6.13.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.0","gitHead":"506aaed4f5dcf606225f80a7e69862969a3af90d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-QM41+Jyg2TUdfj8kGksMin0iED80IY479WED2lSBGESb+OlqibL3XxsLZ6/XPUgcX2cQRWYmpEdRbmXOtZYfVQ==","shasum":"2a12e64295ca07c346bc28d98ea4dbddd87af5f5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.0.tgz","fileCount":71,"unpackedSize":219893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr6ZyCRA9TVsSAnZWagAAOisP/2YC+kYg9eyCHRM+8B8+\nRL3SqtDcd+U3vVCs5M0KWku3/BRaiJEHUtbHWoI3spO/geBi2rDWkz63IY6Z\nmXqI3Micat/Zz7CRTR/GavDuXVj44RS+hO/XzsFvlK8KvwU+BS0Qi9FmhC6i\nmiFtDYbeOI8hfgAudjPp11o9scxu1Uf5ATz6y3W/i3RBOxwtihXsNwRIMraq\nKrtSbth9lHso+E33/KOOZ96kPRREEA8kdrgGe8/s4N50oGFyAePYTLI/lZAL\neWFxhvYYv0AQcz4yw6/HykMOAtIVPmaEId5FqhBORzb4Sxr223cVFuCNGh2V\nmdiJPCPOv1RkCAQ5GTT3R/A85mFd6nbGFhkSd8XibkFErKj1G6yNu9cF+iu3\nPTfFe9ywMbNAXTV2Y2KRZ2vlElAWr8EFYb2lt33U+nt1CaxCGF9xOTzhU8PA\nXfJH3fkQLpxqHjvwfvxgPXI6BbrNZOgu1yCYSM+dOhXNImxhhdlkxmaLSW2E\nncWzZCfuUZ0ROm4NVY4MM6bMpMJpsyqrEHYXdrxU1GRungr8ffjmmDqPC3sI\ncHchB02GBoQLUyT/Tt6mWakHUAJuyLK2Nt6H3j1DzYI6vhNOaSUdxYb6/RVQ\n5ydyuP7ZP3IMjY8v6gUasLhHDlnWDlExK/YSxAK/fvKCM0UM2/AP2WCthq7F\nsnVq\r\n=yKqR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALmv0ffaQbe4XwyHerI2nhaASv/zfgHZ/LTm5WslGYeAiACGGex3YDhk6Mmwtr2vaj2m6r/2b2gYGn9Ovo5oIP7Ow=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.0_1622124145738_0.29119400680196805"},"_hasShrinkwrap":false},"6.13.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.1","gitHead":"ac09ce6896a13b80617f53506d931ee24673e108","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-pXt6SmYRbeGsNbZTxxHvqwp5V5fqFzamPcJULmCm8sWPypm1086j602eLtvYWhuaZ8bB6bTLhVTCAqGZYQQ44w==","shasum":"0eec7d7cb1e4f15eb6e5ffb88142388b57531176","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.1.tgz","fileCount":71,"unpackedSize":219967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr67uCRA9TVsSAnZWagAAEN0P/3MtkFNp7AT03KmfxniY\nE3N9wHB7/tUQzY8Gt0NQyVviQLWqb5KpKuq4w1W0exuySIx8vAm5mUUc5s8a\nyU3msnb8KGzMgya5nsxD6tPj+1eKUEJ+ifRcLojCgsmrEa6mHGhLOnzInXIT\nq7Nt2TLMKpn3HXHMiTf8q349Nh3PMGaE3I9pl3liXln3ljPsIxs9u4Jtpi68\n2Z50OBGpesA6SVORS16wlAmXhzEwvLXRa9vIYznDzkuMiXLm8UDA7X+WR7D6\n4tifyALzpTyuzxTbD14zqmyNDls0OD+GTKUKOszcF2oW8snl1wysPSR2SCVR\n53+PLjtFaS762F3FdFQfvuIPosq0qM/AxS+0Vesic+UwHLTxQ1NNVQX6uu5D\n/4cDo875We/3/qmx39C0mUCz7LIgIMEKKZErTdPwm1ek7jGE5XV+VR5/14mS\nh70i0UvflD0I1+yeBHKmWZHPfHg2WzBa/gGFWwbQmtmcoDZddMGDboC9XNTK\nJ6jKyk6zgXIgW57Vcxj/x64lJXahEUh/Rsa1MAd30rzN7ICYduyGaagw/UOr\nL0DJ0pGT/0J4fZnY+Y70QWHelpeHj5SRPVb+vlKfFmgF3ZOIy6T1PDu7xIUc\nxy4SyskEPGPkZjXM1JNGGDLQ2mx9taJncrWTRKIM+UXsB+OZtz/zvfAhHHt7\nQ/fT\r\n=EJBA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqc5tg3+g7i2xBI8WaeWW8R4UmupSkTAiE5f4cwx/62QIgLG2x5ttrkjGMtIT9WRQrH3hQ5FDaMMW/frkiFLy5PWY="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.1_1622126318259_0.127920941549593"},"_hasShrinkwrap":false},"6.13.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run husky:pre-commit"}},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","husky:lint-staged":"lint-staged","husky:pre-commit":"run-p spellcheck husky:lint-staged","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.2","gitHead":"f1029917e284c241eb077bd987b3cb6f09ec8c79","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-muGugj2o14UbcPk0oUZ350lbOx+xSlr9JN6rgMWiTzMAYVdOGH6zxzzoc+C7kx/iWe2EWsAzoP7Jq5/oFnR3iQ==","shasum":"2a15ffabdbd575ab986f1665f16b60ed3566371d","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.2.tgz","fileCount":71,"unpackedSize":219967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr6/CCRA9TVsSAnZWagAAyFYP/iOqL1QJ/8fLfsJGve7h\neFP0metgluV2x5lUBrRxgRzEXl4ZGjP7H0tdFKHUYKkAldWkrhArlhZjdxV9\nAlh4fDZFsQ6Ma9Tv/0GnTLhI3J9Otx8b0lmp4GYNrO4GUTQ9Cg7wtnBQTJrn\n3Nr/GytyQgf8YcMplcbsrA4IQFLsSVpyFvecxdhgLMXoU0UZWrUYj2rY1/jx\ngiQDrppo2lTPqn1Wp6ICNo2zt0zBCB01YpgA5WrN1bLJTz42MuQE7YCj7Kf7\nmA24BtBZ6lVYxNDa021I+NTS+/sc1F2k4RW3eykMsp0R7NRjBLQunn7rC8ce\nPCIDQk+X7mGGnUZyD4+sRhRvY8ENoGgw++71mSQWbdZdpni/I90CgOTmnyc8\nnuBWrQ8VNW4RKKIFp7JVjlnJ1HqeYiJu5aqJKsXYFOBmWz6HC2DTnk4RXlXq\nbnnOtT4lEjO3tKBjiLViU0h9GYronz5TgCXAjgftrubnoVSTQ74GMjV0ysEf\ndV91qP/AFos7Ug4EYi+mWa8dkSnzBD9TBbbQVz0unWKk0nUWH7gM2no2wRUR\nwSmnX/YdiJMOzZGcCr+zwXyNiKMI3T7At0BTuaVHu948fV/Aq5hwtSy8oBIL\nHZBboSZ7UqLDH6P9GerclJWX7XLdUzfkSg3ex0bKT3ReSCZ0hTqNG4IoHg3M\nVyWQ\r\n=k9Pb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBb/1+FHPa9k30/ivnp8reX8/VpPPbGY4XGTY5O4vqOJAiEA7DSOTMzfYLl+GiqGBhVfbxqTj/hZbX+EN8/RhLIX1Fc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.2_1622126530035_0.4414175373353768"},"_hasShrinkwrap":false},"6.13.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"UNLICENSED","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.3","gitHead":"b4e740b4e60c678cf7f8a5bc47754465aeb238eb","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.3","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-mzszykWjbDUA1pLlI+UBq9zovwKW5IGKkGX7tYN7JLFk5PhrP+/Vpx+Oora33XlDkLwbJ91F8F1V5KkhrHupXg==","shasum":"96b5aeb1b3b588c24fa212b43f4a2939d946deb6","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.3.tgz","fileCount":71,"unpackedSize":219725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr7CXCRA9TVsSAnZWagAAxM0P/ilogrtkGiIEB3e6oHzf\nUDjIqWdAf0KkH4yJ4cyROtqAppGm3sVV5kLNZXmCyd77HIbXDRoWs76SJJln\nVqSk4QRh3QJzHD5vXl58zJ1Id4/ICVA7oNkWDESDYxvrC245AOMZncVK5TIm\nd/5mZQ6CuR3ehdi1qqBNLSyuchLtycsxYZu/vBu+wxkKXh3EyNzDPmE0+fGj\n5lPJsMOHoyu3MSpoiTI0veRMQBr3VvC1M+vaRicX892UeahM/ql0GpilxbZo\nkWqLa9WN7Ex8EoY9xnXiVD3COVdKp6zxuv4Z6PyQ+B5sLdqcWhQN+XoU9vuO\nD/pCNZtUJSmrOHVx62vSR4QviUWBVeO6lcXvqsqCvzjBk1KKVhyYsXU/miot\n7FIJ9kKlW4gcMbFQJctLY508S9S4MwNT/Nk7C1ln6lXR4hgNeJn/KPHvJnB5\nRXYFsU/PlMRfmuyLsMlGAlt2B0O/NY64/qrtR3HVlArqRgLZOK6pWoBalWs2\noT7T0Yz1gSKiq85hYu+ogV43TLmnn0XW8iYaJjuCYln85VD8cyd17Z725IJ8\n2HKG4Tp+WZgkjXYZvNyNJw+34QbrNgTd46TJ0XF+c+WsBSdPtxresp30DMTn\niw3OgqwEHpuschxMq2hMPWxIB3S216gsojNxqXnHgtsIydtfkd9nA57u8JlO\nfMxu\r\n=ih9R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvS4oweqvl0x1SEBTsrZ6hY9L0/8zrcSpvsuxAs0NJaAiBGfNJm/jYoc26uA99pNuqEkNYJ0fIzRuMPQs6ZwQU5PQ=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.3_1622126743321_0.38052396793906706"},"_hasShrinkwrap":false},"6.13.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.4","gitHead":"a5353a2397795b9547ac6f6bda57ad9507ff21a6","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.4","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-SVLjkgC1IH4Z3N2qN6MfLCuiIGrUQspxTpBOCqYDdWz5/+CdmApMQAI04GrdDkRe63P1+r78jNqTr5Vw45thMw==","shasum":"9cab0a80c398b72457bd3b6a8794b9b7ca174ec0","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.4.tgz","fileCount":71,"unpackedSize":220771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr7FLCRA9TVsSAnZWagAABOIP/2tIxAHOssL0diM7grzF\nuSdE0jUd3GYoreRrDsEEFkv9qm4oTxT4XztO8nA2V718R5Mj9wXYMllhHm+B\nnaX/4PUiBW88oSGD14GQrFqfTs6KjEi0aVM4bndK70Y8+Bc88qKmeKnLaX7R\n/PcdWQRzU9YY7c8dd8ytEhJYunLFzmirW4wngCKBXSpa8YbnK/PAtWYVdw3L\nyS7uvSNgupcvNuzwQ3PCp9qMEXO5rZOuj7ZoWVaYnodVMzZD9yCtb8B7J0Wk\nCcywm0Sya8seo/lH38IATJVLymOFpiuWAN/acY7QO9QEvnSoEH7o2GaXTtxq\n6NpV8U4b50pRfttD8MZwvGidEVlOf9txoccS52UYGFGlyCI7ExqxLH/AGpTt\niL2Upx88MChd9T8t6YSd4NQ3HHTJ7wCNUYcgA0qbUbBfGNvh8A1VrOTJG0PZ\n0wkmfdYPHoUumFPG2LdglPifXhFliUetGJVhzZxRNh5omC980hbJjWYUInXA\nYsC/cS/S/BEzEb+wlprWONzs3jb1jv/u8Xnphx0evNRb9tKYU2BBpdsKRz/Q\n+leHI8knCAsTmdx2dUD+XyC6bXyNmuG1LUi0fTzS+WcjJF0p9fRYuLa6GgqH\nXYeR/jIVcf5oDqFzhirtRu48v8TjKbEbIdo/Q4wjQNGTkZs7/LUMo0cuhDFm\nZreR\r\n=BbU3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICTCRUU/gyDF7aONnuQt/MWlOwXVkLkxxlURnBTVh5otAiEA3oOHf+hG4CecRcWIyUAGf0mrf7Hta0Y7e8rs8fBOnTs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"m@merlinnot.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.4_1622126922616_0.31589010151619057"},"_hasShrinkwrap":false},"6.13.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.5","gitHead":"9b6b5e07f254b51c2453fb7bbdcb3e03cc41a9e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.5","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-Dj8NhxNlj45q0gV+Vv1qrxK6XbjbP1080KCMtFu+nu5plfLQHWf+C654/XbZdBp225r448ZqYnL3ubpepYbXyw==","shasum":"9255fb2237d95d3189017532b77986ed27ea4f65","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.5.tgz","fileCount":75,"unpackedSize":231859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr9QHCRA9TVsSAnZWagAA2c4QAJHIRo87yxjTUIjzy4Yg\nxjBYmJ1QPgQ8xhyD/IVPU+yZICUiVCl0rGnOnZQsp9KLldcXKcRvXMjVsZLq\nKHDihlsLt8qpq+QtjCOAVyZyswORcWYPpRqDgepR2hNK5qwEOzDGX2Y5/++O\nMtmftjNB8a3oEyySIoGx7v7zmXKOfG3OKC24tUadn1xA0+V2jxRA9QpyJVtr\nHuZV6G0zHa7BvBB24ZLaD29kB0BfUVHtsbLgLvz1opA8cLkpI6qfcP9/HmQ2\nhNr+HHVYJ/y33MS+q1LsH3mMLYlEuqoLJo5k+cY3ueFLQIHJjNJlYACrWQ4Z\n95XzPJSmOjsKz9iJkiIeogk/6f75qOPQkSlKWebRU7zalAtZriZdaxgOjhYv\n87Cv1zF14+amShT8Osht9X9VTnQUe/9gyXFMRDpA2Aeb9wHD6+mnkyTIVmyy\n23ufyyYAVby/fYSY7MWDhHVg1znAqT2wjUHfHmacAoPhl0qSXM8uDj3FuYDX\nwDUKcMnTdkTMao0+N0+wLEa9lV2c/I+kklgg0M6yML3XU8RaxvNldnpAL7xl\nwV0YWU6BCvCKBOgPq1BlFkZAOccSabNXBdLRDU6F4JGbArGbgr3iPy+Snweg\nv/gErYvIcfQdiNAnRUMiRM+hByRnwp9xreOgoXgLkz/Saqo28q5HXNcTzs+G\nnYCg\r\n=TbUS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDuct++u6sOMtfu922X8VFXkOs+y5PxZO1MAnWVwuoCwIgYM4ypc+cHVJYNM36bXhmcZEte/vKaB0Xq6iGkmfjKG0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.5_1622135815047_0.7249211959022996"},"_hasShrinkwrap":false},"6.13.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.13.6","gitHead":"6c0d5a443f4cc2368df295c3a32f18eb11e56d53","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.13.6","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-mSnKIkFuav5FN+YFhPC4v+OI/8ETZqd0MltetCzaGfSBWJ0Y+04KkH/KbIwMqMmm/k/erUOobQfQIk54Ep3kWw==","shasum":"c29fd59555bb0fe6018315671e94f6e99b2b0d69","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.13.6.tgz","fileCount":75,"unpackedSize":231859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr9frCRA9TVsSAnZWagAAfPUP/AqaiOsYnrW5hlZ6+gh9\nNMC/VJD0G6J1+TVOgWUVsxawb6ynz2IntKJUECbj7be1o75jcY506gZz2N2E\nfgw0mS7MO5KanWtbM4c5ISLMfvn2jgCVSbMs8tricF7TiWST7Xlvz7XudOqN\nDVe1VFbmhQ3QYDbNazCEmdl1Pi70I+G1F0UFIbrH/Ilugvf7j/Yo3rW/7hY3\nPjXLY+jKCd910+U2Xyk/ixJQx6xLiUNh8na7eRPMAjRD65GemhVh+d4JUj/b\nawnR2Di/ODLLn1R71nMxUfkcGqIZzIRn1CnxsQJltrNz2cZzTlYMvYEFE66H\nvn5VzWe0dASLvl7fg3D+YTMcm3rKSuP4wzMEn81PMVWjWBMUxoEQIaHAmgY/\nJDot/lVfxbOKHMcXlaGf23iOmPeBi79sEIekVHtALzrsZKnm7AFqlPsbjBsu\npVQlM3Q1qNe+cUV9pl5CMJaBwm/C524hDOmIEHozcZridOblcYGfm7M0Jfzi\ne9w7Ez5qfnfcRtVrFS6gMqE+u8E55DtTpLVShNqYLiOAU2KzNQrpkYNcfvc/\nsjCXr0cM6AOl2mVougjTeAITcAocotAE+/EmSvihPLw4ZtiHTHylO7kdejKR\nRme5qcHsUbdznuUSFy7QBFlXq0PX0qzmxaRly6lAd0smA+k69X82/R9/s/3N\ncDb2\r\n=/ojA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj8cPz1eMVVX0h1lmtRnkvWE4Ts8BETFhipld6jtDmJQIhAO5a+wsD5kYsTVv1F9jAOGuTjaUKljYroX31Qcn9U4DY"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.13.6_1622136810975_0.5074099221316324"},"_hasShrinkwrap":false},"6.14.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.14.0","gitHead":"72fcd85479aa80cd19db9be23527dbf1391c83c2","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.14.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-u4I87vLFfv5ZEbcKfsLVvhYu2yklvDobf1kWKCmNW02gHlPDEh8MiWjq1AKoZBYTF7eQEqlncmMLtPI1GjawzA==","shasum":"0c6e7eb74e543e4bb91e8002cbdc7d318b380648","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.14.0.tgz","fileCount":75,"unpackedSize":231990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr9/+CRA9TVsSAnZWagAAFFwP/iAdhTEqw5p4YU6QEksb\n/jKtwv5odMWXMmGVKRv/3PJYKrcGwIdMQhO4YufHdOHjwlOKN0Sva1kfL3de\nz5TfjVyxPE2e6n0yL24Hgaxp/tmjqMGerfylk4Mzo1PP8N5TxvoAPglh+bCP\n4y/NJJ0SlQTfhA443Ytzmu/QvHSNV43QV2pV0Ni0O3NbRpuNVqsQg8FFCOI3\nFxDSyyD/iFZnIn6/SmZ8XZe4TgTcm8x3udN+v4Y6K2y86Tko65565a3f1HNQ\nC0S7lenGXGhQtUnhjUodTruYUpG0L57YmIs+ZgaAuNVkBPhV2/dRHVaHstmV\nsVb7cCH8BrtWeAmSJLxrLbiELfZ3QVexbinduLvAmV1/6/phmO7xnoSl+ZKF\nrLzEpDJ8G5vTbOOYAyQZa8ljec/WIpoGx5dYaRT2si2yNzPzcEAc1pj7GCgF\nC/VKHRAs+sw3TeiuWzEPDFoG+26APzyszR1aPtcwebasvsD9DgFOJ6/3RPd9\nahdYkwxX30dk9wsWdMRSwUDY55XeMu/q55z3chgtBKlv4bjhRv+XjmmSv8l/\n0rVPVAbXE+x9BHdyNYzXkLrBPlRzC+X6z2zpf14uTnjGkPDM6gpRzef9+B6N\naGy50QRckhO4VWwqX5mC21vypPR8luyECtRgkIYaydBm4ZpnwZvxUaKkZUQu\nYPj5\r\n=LUby\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrfBsuB2XQRtyEx2PYAlOV0ZISbRf9wSbz82gkd3qo4AIhAMJTpcex83h7rC88sau84RV+RF913qnm0Mz0/n7RFwz5"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.14.0_1622138878115_0.9748918880958659"},"_hasShrinkwrap":false},"6.15.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.15.0","gitHead":"36f4cc51d399db1cb1d15359524cab4a300ef1dd","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.15.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-DE84fNMopp0Kz/K4cV5+NAOIqQbL3RBJhKBRICzB2eefASUT+5LV4f1N367UPwtAgHv8XYl4gKCmJtiijONSZw==","shasum":"50d981a833636f8e90d898b1058808ff2fee61bc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.15.0.tgz","fileCount":75,"unpackedSize":232454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr+PkCRA9TVsSAnZWagAA6bkP/2kJ6SSZFdKpJBlFVuGM\nWUZgjU2agOVx8qgom4NEKDZKMQxRUe2gvU2MdcsM+61/THxvjq6JurxzP6rN\nLzZ1a3sArBwGCaFko1n5snRycIdQhlMtsZhO+o1LTtI4AJ3p2aJmB/g196Wj\nRh1CqUn8ixgD94qkcdd3UzQvKAans9SbquUbY4I3bxgHuKqbtI0lnMSL6eG4\nmyF+Uw80gmsx+0caCh+BCkghnMKgSJi/6XYU+ca7OSXEKHqxv1k2H4jUWpjF\nteDnaKRExKcMZMyYv0LuLPQxRmipEXS+zsweElbqak0aFSktvvKQ/4rIU/I2\nFXt30M0gTUzLTBr7qD5HAga7F4DaBuPmIFvtqcPW+rtu6uKHUmSZvhpnwIM3\n3mzpVy4QGeEaNfuBpY0UVrw1XX0t8xLSHSEhZ4zUmIOy/R+ftSg9Y94/0OMn\nLxxfkBfLeIzArDsKVRi4x8++uzZF35FbGDYfrXuuaCydB4ioFkSYMELYEc8t\nFvlJRrjniruJ0vkfu5W6v1b30pbBMzr2kn8qKVCTCYZFir0NCrfcrB8rACG7\nda4Akh1ogYRWxGYaojepOOX8/IDAJ9aG1Ah4RTFzgn1IZBT1PKVvWIWCliww\ne15lGpE023CR4PwyIP+3kDPkkbmgbfZ/6KnlQyWwvUvdYCGYZMLU50pl9qgq\nnfFB\r\n=DBk4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuBJwPcRwiYYvKEpT+nvf0W5SY5dA0dK7JftPICMdyYgIhAPppkNGTnpB/t4UGKeZGyK285t9MYmdiCDltivkrqXrX"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.15.0_1622139876131_0.40391682748209745"},"_hasShrinkwrap":false},"6.16.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.0","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.0","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.0","gitHead":"5499a2a8f8adb4348f511c7a875978f7a47e363c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-k/TV5qwiilzAWRjBtBjJ+u9YcqLMUETDZr7BJTZybGrkfeCLctStYlk4u2xe366zaX+ssqA7acxoEed5CEALYg==","shasum":"1c5ac0afd21649096be753e733f8bfc4a1b0ddc4","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.0.tgz","fileCount":75,"unpackedSize":233923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr+29CRA9TVsSAnZWagAA/AYQAJeMdakQX8gYNKBNNcDV\n/Vo+iNQjkQHEu5M2yTisBmB2nnn2hF/tTtUyyhljwGwqUG+HdpzmM3dtLq12\nY2mEzIujxTLPsooY0TStndPOchHo7ROxTSAL8TEkrfofyNxpvXoVlwBUYrQM\ncZXxRkU1RbP8WJYPIEd3A1lphhHU4YhQI/hUjIWNLr62LQfVY/4dr/79p4gH\n7X+pb8vt7vDkBNxRQmAHQ4Olp+gEmE5hxZvodEZcK5uqeMY6WUGgqiiCpwRU\nOSxM3eassoNEKoY0sSnIGT+OhrFIYWLSbGxVyXfMJQNFFv58iLXRhJGXQBSN\nd9muYOfkm42/gqq3uy8iUZaGcOlTgA16c1osqPHTDoq9kDO/UgQOG6VTORbc\nlXFGvJfqY1nvcPRt095b3vGZiNq+b8mjwZ05wHHJ0KjBWYoYEuf9riHYNdbF\nEW0knsgeCSJsJT2YVHCGOGNUlLoOfN8ZW4F9BdlQWab6U7WFOPmdmziO96N+\nWXOojTdg5Kef8f3GFAnWe+PSjlMiUUy3Q6+WZBG6BX1NSSPFVoQYDunETTcV\nhniguzn4gSg19+Dm7lF12Ho/PkVqw3e4gH9lbUJQkoR+v2T/4OOBHNMQze7Z\n5eHysd7FV8HIjtA0D5qR8UlFRTHD6WPvsFpzPszG8AxXxVniHyGmHtoGhThH\nNJft\r\n=p13D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDl9/e2cD05/DZAfNw/iYmEnZSC1P6rEd+Uad/bWEwlHgIhAOkW68IyG46iXYFgODsDXQhUG3zRtw6bMwSUi8JEAjv3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.0_1622142394425_0.8048632473559547"},"_hasShrinkwrap":false},"6.16.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.1","gitHead":"66bc4c8ae12f3bb69e45628265d8a586907443cc","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-bIpdehyRIkRrtanBcYutJUfA57ShM4l1FkOdCWvWybXbC5HrPeeo+NjS3DfLFYPT0UQ6vkoEcIsfZ+DIt46D3g==","shasum":"f588514b9dc6cfe3f590270600cfe6be9ba3c1ab","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.1.tgz","fileCount":75,"unpackedSize":233923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsHwmCRA9TVsSAnZWagAAMNoP/R/+ob+XDkcnyuuDvsac\njUzWzPtrAFo4+Xy0u56xEb4WEdYrIoTWI8YQk31UgVQIMV0QXvESYJPf63uO\n4cUoJCjSQXDcvOVErvPT6fp3sQJX9ibpJyXvAeLRpiLgysVDqm0+Zbf8T1Di\nLpGumPNPQUoO03zlJXVIHfjEXTEKT0M9sRsxvOOOfKDguRx/PMKxWNcuhId5\nBPKDjIyqmS9bbZqB4Cvrfy9vodomiTPujmmmaWVr+nSFDYA0waIFGHRgIl3l\n+DWeLOc9z3oJl/81ieGCe9Y05szyklXlayoQEjrAuX0hMMxF7gFsg6ZgO506\nq+hdZmE14fW+zG3fKuVQmqh/S0fxyxHiW/Z0xgqKvOR7AYkZXWaoqZFTVF0d\nu3uYz2IP0mJQm2Vhcs4AmbGCA0GwhoF/aTQRkVsI5jMvquhainVFu/XHqTsy\ne65TPA3rwFbKtxJDVvLZD7zrY14TD7EPHFXgxpVsl1OVIxDuKXQNdJYWmiOq\npuSme5jIFBl9MgGk53dW8dzUNR/a4BI5TqnR2OWPek6yc0wR9WP1PW0fZD17\nUMTsIslHzK5r44wiO13K6Xi8I8l7nwCrOQdz8AWAAyjzjGk4hkaRm1gnxKnO\nD0ny/Hi3+LKUGhpjK2J/5vhv/VRVnUb0n+XtuOKf8eVuSEhdPzpp3F8vaCXD\nCP0S\r\n=Va92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhiRqd4UpzhC0NdM3Mz5/pX1VhmPq6/v/fNjNq0/GUzwIgecrBgYgkCiylMRVmQdphAa5ZUAJUqWuHvdwE9Pl60e4="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.1_1622178853585_0.8407560059046608"},"_hasShrinkwrap":false},"6.16.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.2","gitHead":"7bd3596af976b53aae9de79eea7b2375d8de6908","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-i+zGKv6yuxSZYhuCuA7dia7M1whXwPUaXNRIAkTTBclSmhnkrAyWMnpVyMf0aqphs5PmdnVWqtPkmhZhw7jFqQ==","shasum":"0e38d11539e132c7c31e0411a48d8d24df3f9a06","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.2.tgz","fileCount":75,"unpackedSize":233923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsIe9CRA9TVsSAnZWagAAVO0P/24wp4iBQe0jrZE0uD1y\ngPp2TnzB/7xqq7LFOtE/hVmZheTPS4eWWDmlkz/Ia9em7g0C2niuwMY4lLJF\nu68YkPo0KimSkdv63q9x6y/5LxeS8CXMecKmWDNORfRudMbUClN6ITI6HykR\nUALOI2ErWsnMcmKPKlGb0pbsNPqceHtezkNULqQmqbPfd2EHgdf40qJ6icPr\nogZZ6WxvIdccbWO0ydNfOxdjUfuWiZ8nMgAeAwI8BllM9szVMgPo0ZwXSiSk\nO5AnERIIrbSRkCEm9lagQKlTv7B+OLAXwIFxrereHemxK4peAGIEis8jQbXj\niI+krIUIK3QuaDI+/PNMtdosipEdeUDwT8ftKSDY5pjdta19HKHKwhwRTqIp\nMomveJZA8bXwigRq/xJchzADbChcj8Ol5TXIv2KYHI6nbLeZjuwloexzQ2I/\nG7SK4dU40ua+IrCRVNHQKgaRwvENiNpkNK6i5pGhqGTOAKLI8hgpog536q/n\nQWVciQ1pm+i9bbGoAVNn/LpNjuKQhthP7Ajg0tbjiszqQzIchPZKdw5RFeUJ\nXGVTDkau/nVi4TnXF0AItB+RsQVohh7qYY4BudB3tkhSSkgCJD4KuclvjaLe\nT5MNiMlp4kcC8GPWH85skL7CAN7KHR92gN3oLtKJPeJ4h5lsNnd/cV31jI0c\njbjf\r\n=WsS+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJWUC1Vp0vzX2+DC9z6um+dN1XbCYk/5iNgcpvNkZbFwIhAIhZP2V4I/GbNwuvAW7KiqZAHvIQKaQshSjL9JT/LXMA"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.2_1622181821251_0.13883138900620096"},"_hasShrinkwrap":false},"6.16.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.14.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.1","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.1","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.3","gitHead":"f1f05f2098026847c2d500503d4d5b14a2d67c2c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.3","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-krtKUv+Sl9OISOgM+xsWrKOlj0V6Jd/T156vZF0c+gPcsAUh/OJkNMVSeGPbsy+2ei7XyF047l2kZydbEFrm+g==","shasum":"ee96da22e5e726836fc0307f6ef47765de207aef","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.3.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsLOoCRA9TVsSAnZWagAAgMgP/3mh0Ivc4aH5gF7BrhE8\ny79GWqk8jpCEYdCWr/a9GHki6SDuKu+2sV1Ulgtx9rB/IQa0VN613EpTStVw\n0faRtY+7zgTTCzFNd3L1sPo+r2yhF+jDUzOwwb6bWNmEsDbfmu0QtOUzLUvU\n48N7URO7alti8PJgxAT1JG2U85Lx9+R+rxVppGJE++peozzTd1mN4vjCjgYQ\nvhST6WIBmW4yHUAc7dS6rIyJEXdXQOC+uobFSqrZOzsr/TfeVzHPm09WcpnR\n7OH9dZ3DRqviA8LSHCYuNipl/8FdKzcKLxAU4thbWL869xu9tIbc2O2dDcIs\nRVTykuGCRaR1lf2kXexvnPstq9dM35HaSSVJb+hJXkJsJqTq/0CTHCyNd6xj\nwi0MZQ3hyRwHlURoEzddhPI5YThlZ2FbDY5HSbbakPiueUk/pEXaMVYMlHqi\nPDMcuO+khRxKd1gLYxEUIVtVa2+0ldc4g2fD2BZPU7xTvUKx+MYEM3hTJDLo\ndHHBvO+HSV4KCq4l2MCNPMAfWBsizfqobYXQAhyvT6sGwpZfnrS8A60VbZSz\n0W6HsfArBWIhZGK3GpwONK8Jqtzn9DDhNewm3Rfylrr7aibWidnWdEnE1RdR\nuNJBR+p24DfJ8l1z62ERlTJXq8xi3TXBQ+HgI/8vI0KyguW2gvAMyHjoGWWa\nb4Op\r\n=XsGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYQPxYOesHg+aWshBbFxLANdL/hkdpS32gnDatjHrCvwIhAOYMoh0RBzL8VWp+wob9eZTPSJPxsgzWZMcgZZgW5F5K"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.3_1622193063938_0.1985628913537758"},"_hasShrinkwrap":false},"6.16.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.4.1","eslint":"^7.27.0","fast-check":"^2.15.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.4","gitHead":"894d09e2afea1537ccd9100a57d6eb0878bbf822","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.4","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-HwbT8ED3OvhepaOY5YusQsHCY8ks1Si3MCOFikOib5P6MsldS2eTjsR9fjLIf3aNQmpFN5OUnblApu98IbmeFg==","shasum":"73937c9c1fc74d9681a74dd48407de89c78b1eec","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.4.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtHiECRA9TVsSAnZWagAA/e0P/ixSgc6teBm8NWmKSBQx\nlLLWDOC8S+A/DyaLo5DkkdGZOBL28kkIwQtDxYpylvF/4sHB6TRGKqtQNswZ\nFJot4jq1jzIbA7oL3We2F2FXcpAJMl2qVpcoiaQ/CMEEyWbeFUhqegxfCSMN\nc4rFE8pBBQ3OTMfK6/1cmIT2eWUoFh/yF0Gy6x1jlJKs9H2JzprutN4BatRr\nqPbcNG1HWapdzvr6frin2dIZtjEff7MAu7+7UhyPJ3t2yO033aK32sSCqIvT\n9m0cXJFxsPILDUVCPVn0+5qh8yMUQrnsKg8IzT7jtK27BjacnzbExZdYYP5P\nLI11HuYn0/sfJvQIiTj+y5+HcUFYpdoA76cWBnwFJJsMkKPjc0YAvJVJyiAi\n5k3OoFjL3Xy1KjdzfmYln+eYuH2b8TCBukdeWB0REljjWch+S3KXdhM/qDte\nM4Eo5DHf4HCLfVf8Bnd0gVWVoz4GsHlxT1DD7kbIIrvya7+T+T+l20UzBjtK\nhJy8vePLPLSuYkyYEiooT69KuLQ3szenkVo0f6KEoDdAtDZKqj/dUy+gMNuN\nLoWAMVPGRKhHyRCXYuxgKOWFUdtnjwWKXe3wPLWoayTU6Bdcg6OUpy5fyN1z\ntrByw7cOwlB1e9eIf9zgDEBw3yECcLteylH/Fq+1/XLeSrRYcgS5D4gPmTVx\nvVcS\r\n=1DA0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSnxifWKtGzRYiVkGnblFlLVFT1aT6uxGmusj7+tF0dAiEA/Hvk0SwQTpTvL5j7IKDYFLEjhEiIWgaxz6TomRGFKH0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.4_1622440067719_0.9425586452183419"},"_hasShrinkwrap":false},"6.16.5":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.27.0","fast-check":"^2.15.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.5","gitHead":"0774351074486bc3662c151a57b333523caef3d9","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.5","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-W/ApSKshIgZS4xzbrNeA2zz0wsxZRoLlpU0Uolz+i6suqsIrL+MOxknd7fuDSpaSOHTjIrJseLCJdGdMT9jtWA==","shasum":"763f28e414f0d10678e32175a238a6525dfdb379","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.5.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtHjMCRA9TVsSAnZWagAAF8oP/2mv/NR1d0yaBzxKJm6n\nzlGksvqQ5WkDQlkC+Zbzmju1bl1KgtkfwcQMU6IeB1y6LKYbiTlYTlhvaxSu\nBSe2vB7mHFujoDpJ8+3CKRnFziUVo5D+7VJe0FCW1mxgns3cayHzHP9/edck\nfS2JTNZ1nOJ8cefuaTy1hEUIy2Wb2JPbhwIzp3YCt2qKKonCCHB+qyzhLaG8\nCilUy7lAJhPr+qp7I3nc5TrDBr18js3RjT76zQM7qwIpl7qIHVWx+20sbArq\n7otWX+1XhWe6SsEhb1KVOpf5PxN5FRw9CqjRrD31paRSnikp9+GEKFSKl2N+\nTa4cxOAjgSqwyJsnTln/pRfIIp1SiVqQxCNHhHVAkV5b88edS7T73hdXkUs1\ng8cF+4DHRJgE46+gNPhnSgkQb4+uTj0ZplP0GjwIgZ4SlJ1Zm2UDci2exiwC\nvWOoJQxnT+TeZmV7HA0kJurTMrxnudgKYfdcultvRElUp0A5XqE1dcp3/uwI\nFbMrCVIJRYx19Ko16Kt4XK7e/Ox64OogHx6bawPMq7aKZHsU7CA8AdiMo0Ar\nfCkKNZ1LkvQSij8HAHMtR/oJ0XdkVYaSR3MP26hvRg2JNAgFZ6JLSeIbDfaa\nLqp+ziMRuhZ9NxmUS2zqx5XD9y1M9UXIRgb9hUZNHhmocxbn3/clSLI4f3Gz\nwLkV\r\n=ukZc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkc7qoZn6jZlKtkijC6KwdtNsE0T4gH8qgij3LfMNwtAiAv1sxUhEpDehpY5xyOtp21Cb1/B59AxkXsiu0a24jZ2A=="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.5_1622440139987_0.7931463198623852"},"_hasShrinkwrap":false},"6.16.6":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.27.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.6","gitHead":"ba686e23d55d09cda1c80e05501cc35fd8ce076f","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.6","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-+4JJOhJBp5shsLb0IfMygG65973qmkhEVpaHiUPjzmysJ5QmtA+cPdDcXbAFheKPJ5o1b6+3Pf31zMT8iElSFw==","shasum":"44026598d97aefc3504684abceb58640bb4f73b8","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.6.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguGm/CRA9TVsSAnZWagAA7VEQAJ8f4kgCyUUzCLqqP201\njYE3JvAJtoyXy4ffF495mxu4RtmVL9spq7lPX8xCxJAGl1qRolc/nTDKaJUG\nPj6q3ezekTO973Yx9XoZ+9HIhLAQZMuGyzwx0MDoiMmZ/xA1id5nAHlUcOqz\ncwSu79EZQYTOH9O8m41KP0RIYSCIg7xC0ofNI7ewWOe1W3giRTFPIiIIWqnl\nFwsbPpRPTPdLZjo39NGUYwZCbO5Qxz1JQcFbrqoUNB6EpoIgBHuZUZYb+CWb\ni5SjH2+1jUtGoV53IFiMdtVDXK9ADGlhRvMOsS3ex+Smw1pN9YDbnJ3iY1RH\nvyhig513e8ERnvVFaLcCBlDU4HV0Gf30DB/fe9CAQ2NaQXKr7SSPUsGlH+45\n38kJmMilsDa2qxbW6AQ2A2BUCCZHhG/AlhMgawUifvjOUyWX8J9B5E6wkYs0\nxu4aUwIam2HHmVG9gld+87z+46ae8FLHmdLjUQWt0OdCE4WBr+2BflVZi/HU\nT9blbYUounBQB+xWvI94V8nlEQrxr5DNpHiZl3JQ231xUrnUAOLQ/F5JlBxF\nTkcdmsg8lq93FpkxxgVvFxer9azvUZxStlREBzpzgSX/6EgPjy2mAxZBd/k2\njR3BUanq4ms608WFZ09+alowIB/5HACP3TZyBbYUcrg1KlfEBUQKDk2FqLju\nd6V+\r\n=BKgS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGTskwkoi1YzTHIkC/14mZqxg76/mI38SMKeuVytzevAIhANXLi2jSwAQ7p2RMUcPOGAs5hELByL4Rt7o4nv17WCOt"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.6_1622698431407_0.010769952493322021"},"_hasShrinkwrap":false},"6.16.7":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.30","@types/jest":"^26.0.23","@types/node":"^15.9.0","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.27.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.7","gitHead":"0a34abb5f4485f7ce78ce48f83e8cbc3b43083b4","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.7","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-O8Oiisa4ypdqYRIQDZ6XnwiblRknRot9wf+UzTLQu73/ka6WP4A9jJHW4WXL+dCiOJk+Nai7VGHC3caC/V1PTQ==","shasum":"cc4d1327a45288664b8d0d0e8c188d27cc6f6e4e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.7.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguGprCRA9TVsSAnZWagAAjg4QAICIKBXIjLDh4czI4f8U\nNC2ylhjS/2Kgun1zQ1p6kGSupg8TCIwlQuktfGPvCojpmWMLP58X0JJXLkAn\n1eS0335YfWtGYAvDS9VFP9jU7BhMKIgrpJLECesV/QPxUPS4CcKlIWw88nhQ\nR8S7jW3HJ6JIRYLGC1ot90UvUjI5rojpCZzfhcguo5ZMPeCaZ/neeQ4/MamA\nOv7tTSmEGDbv1gKuj+FH3yoEYoYcc4fXg4pieK/i55HRiV2Xd8Vwmt7aMQ22\nWMALQh59U3biX6bmS17OPPgn3EOXz3Lyz5gP0RJ9vkYEo6b0lTdeq09I2ALb\nIoQCeMNBoLYrF4jgs4JZ/sNJApCpgdLLf8Y7vOz5txs77xNU5wI6uAt1YrWf\nUTQdADl0fMHQqbePTeAk29IhQ7dTNKNhI4sl+TOZkDxGQB8zBciZ0tsuJbis\nhkgBV/OPUs35iWUPQVf4PM/S2N3i2hU4VS2bt98qXR5hc1PO8YJEIpQsNdL+\n5mIkq9U9IkopGtOmdZm+J7jmfRTJp3OKWU1Ul9sx8ky5SN4x31zS9yS2oZW3\nrvHISG5Kljdj989jUbB+pTMQvyA8TxD9CrigW46zPj3/2MEDzvJcZrrjU1EN\nGsBMoTdU6CXKzwlc30d3iDLCg8y99QzRz6IhZ3ggUm/fangKKOhFmlWWpeZx\n35be\r\n=UCrO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgahfZGOcIpKXr0xA4/YN3pFjXfPEOgg+f8O1ZztF1UwIgS8+cx9IcSzOj6JB3LlHjli6X/ruAbZGGINxYxvIlfrs="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.7_1622698603541_0.7746344022474463"},"_hasShrinkwrap":false},"6.16.8":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.9.0","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.27.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.3","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.8","gitHead":"67804330414b27bffa8ee9231059243bde233176","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.8","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-mHzqzaZ5LgkrbOfbWJHbCZuXvQEz2iA0KZm2Vgu6f+n3PALMLvXLy6ZTQhofGeZdor8mhDjDwrZyj3ciNaAZKg==","shasum":"285f2226b9938e1aeba09a639c75461393af00ae","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.8.tgz","fileCount":75,"unpackedSize":234264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguIgJCRA9TVsSAnZWagAAmaoP/ifC+is2jcDi2iKB/peV\nTNamHoR8T5BA1volaPqoPFG0I25FIvMnSEg7hoPWIceD3Lm7bCT3I56iEsXz\n4JEbWxwywgM8crREAO9Kcw8JphU/bDRtUsrRG2GdFrJRSfZU6NC4ktE+vpyr\n/B0J0gDwfo4KR6z2D7puDBcJBwqxw/5ODCg7o88AoX7kRnFrA3ZWcmbsG/a7\nb8RypzDdlEsIPxcAjDRPH2kR9HHRRgDYCsRdC3q/5q3227IQwhwsAuDJqBuT\nSj9Sztd1NS6AxqmdcUlGgyq9tb0lXmr1P2qd1iUQQ1uGu+ik8ha2aySkD3fN\nZV+omw0AlIqVPK7JE3QSdDibwPRs+v/lZ4jWSDGZgvp5qte3xTwr7qdm2gp8\n9s5DYNJVcm66fgtsVbR7r4Uj4DuqPonWjW+4uAK+pcJMTIbkoTwLdlhQHW08\n3TQEVa+aUHfEJi3KCS5uQFMYAkgJDJzsOIYu3aqY1T8tIODvhGzgDfM7BjM+\n8q9cB6clP+w3ua7deERkvBP19sxRRv+GMiU24WOD9McLCvaYR3LiV9ufEDg2\nYZtr1AqR+huZYR/PMEktT3dAYCnQhYDtZJKX/BYkft2CDx9HF8JDlsEFAKGe\naO17+2RwVDousT2Hf0f19rWhc7QgjjINr53c2aGoAtVihp+VLJb7xfTEXEOc\nX6uK\r\n=vNEW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3WWIhAOUijKQ41FXWlqcCkaNqZ9l4lth9Qz38CGY7kAiEAw7jwZ8E5uq8RXuujRGZEcbShuJtit0eVaeZA7S3bpGg="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.8_1622706185347_0.5343570256944237"},"_hasShrinkwrap":false},"6.16.9":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.0","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.27.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.2","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.9","gitHead":"e757bffc52d33b5034c502847976c78e0df1e83e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.9","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-YIl6+S9d1vjNKsOi4PHZ3xFrYOug14DFMHElHpgPYemk2kKq3C/038QvtgvQL/k9moGfWwnIKUG7//qTaOcjvw==","shasum":"029b8a64a0f150f42f50eb8d846d440acd9aa13f","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.9.tgz","fileCount":75,"unpackedSize":234265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgubwICRA9TVsSAnZWagAACa0P/2tvJSF6EoTizjIbkLVT\nWg7YlgbbD2QLlaBpOqwffjmxlkQsigmFOVNZGTu/5hHdJ8z/AGrM+UrL6E63\nwiQrw+jZuKfOpmrZ0NbctSKEoPhGduNmnIBBBoo1OwGDzYATB2Ws4l6Z6B6Q\ndmqWqqP5rSX7ipxhvQ+JsThTSq0HrpbC1M6qCnKzhG9OBuMjp31+Snl8devj\n/6Gz9NxW4NecK4sfs1/pGCDimXJ1ssmj2YvUBZuZHzdtLWl4M7Sbe4bfOovI\nRgHcZicHMImUQmoxm3msFfkcjaW+nMVC1Jqg+eb/FCbS7OM7sWhfWHAdSWyt\ndIzph4q0mFqkMxF6UshI4lrGzV6wcORwP4/32iNuInYnNuVlrGS1HWsKmxEe\n26ST6BFfrcpybaIQ2FgXTz0cxMQ0xswJZn/L9thgJHdZpU0LkTq0ttNELfO2\naCuRA9BjjfGY5HIysVcZp9M5Hjsui8kgsqul8E0qXx4Z17FAXU1SbivkRrdX\nVAgTqVF4OiLLOhEJUGmAjOG+WnHnMehcy+bUZc0ECC8hfpNi+yUxayCTM0b4\nCb4DHQ9Dlk9s9E1ObfqLJMGpHzRc53bVdRJSfZyVblt+9eFz/0TwHwfPU9Zk\n8UkJHsa9PH3RZrdL/Xjj3j0AO2BSOOt6ngCbw09d7nsHYOxZtqgtl8p5Xlt/\ninbZ\r\n=N1Lq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/uZtmgKR/ebOQSe6JSv14mTqNSk3YSCuWHEBbRbQvVAiEA4mmc+6j96LM9CIip1kYdMxShNSker4vF4gge5GCQ0FA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.9_1622785032800_0.4783819934478304"},"_hasShrinkwrap":false},"6.16.10":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.0","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.10","gitHead":"d5e4909181003295522d9bf90785367be60cf063","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.10","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-yDVHoz6+PmJwEN1y7cTpIN9igsvN4wZfKQ5PXXUjinD3r4V9wEcjT7nHGx7lr8WvzND/IbsL86m8RpilekcrcA==","shasum":"f28870f9cb889536cbf779ded8abd579e1385da9","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.10.tgz","fileCount":75,"unpackedSize":234266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvbOwCRA9TVsSAnZWagAAn/sP/3NQtlDknlUhazxlL5m2\nI4BkG8WNLIjDsz3nrWvoW+zaH483Ru1k57jj/LnO0EINuvwa1Y8tnNG5Udo0\njAYCgr9ndMsOxluISjTOJdSstv/pDZvvW56uIaqnpKihQQNhe99k19cmOyyq\nvmhiGgyYAgMzAQD64VEszV2oqV+AshJfF91Pc73gdoRWstb7UpxZS6HrDebA\nn2agUQJY9s6O5/Rsrgnr6GdK1r8uWhh6Yp/9DyjBoBk1Ge9yyNBLlKw4bRAy\nVQtm7cMaciQvyBrZAMs69N2MNlPx7w55zSBcl8GEarDcI68qC2GlMEbEAI4m\nmNt0nZVentfK3DfTff45h6ZHR7B4SbvoOC0K05TiWThLoUBej/9uiGxLqYwl\nvUyq3lwUeNhYg7+pVouYAQgun5FcrrEB4x1YJ5VaF/YAgm53a9PhgpbbgPOu\ntL8wL6qiZtii2xsgXFtMf2DZvJ8NFow8rpegCMy+aU1C5DLxC1Y0VG4waR67\nL/N6ndsHeqxMO8w4FleIPgmUrq8knqxc7L1qbmSvQf2TiP4Wu9enoaxJVIZM\n2/n9IFS5yVGEOuyGFCslGGlzzod3vXeTGVNXAN45TWAsclvEDCH9YZsVZvwV\nJarYWScorOAveYCjUNsBLZD6ZgFREuOqoUnxkiq7sUpfAiO54KRCCsiXGH1Q\nIemw\r\n=ZnJc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbB6nH2NJnUmJDKqd55sHw/42whh99vw7qQe1sYhkcjQIhAKdcHztOJz5pKaGXOJfeu4QdRQf4z2tvqiAV3JgLKa84"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.10_1623045040859_0.33455312621989286"},"_hasShrinkwrap":false},"6.16.11":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.0.11","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.11","gitHead":"5e848afecb3b7dc689953d37d103017b7499438d","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.11","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-jKRTlv7me6ckl3u0YcrbdgghQwa7yZGmLsGm1buCBoOVQjHNNoGgK3w1dWXjpyH0ZOhWrfVnAfd4fpfKc7p4Vw==","shasum":"29cb7614c1b074f8e9135a984b733375db62817b","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.11.tgz","fileCount":75,"unpackedSize":234266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvbQFCRA9TVsSAnZWagAAiBQP/3jK1QzPInPob0rdI6tx\nkchmAdFw1lQ2Tc+XXJOTe63QdNMD+OZMNZsfN23IPc89SQuQAKE/22inX38I\nQHr4O31aJaCNE2qh3wiKS7zrN++Y1v0okLQkcgAIkZECwCTKGYscFjfT0Iws\nxjDQWALr+7NEEx2o4yns4ufocjKSNF98gTL0eidb1BHsPwEGrhMV324rvtmK\nVUISpGqxOceLrYZQm3SgPKey44lFMw38dYub4nW84Sp1NDSoU8wcB5mPui2g\nOJ9YmNbrsrGKGxEX7aplfNtRwLhEa0EqzNQqJQdUue40pkaqxMo+qg20Z4ov\nn4tGqpio2gEaSWYQYgpZe59iL7zh7TxCdcNEer1wttQkomNhEJ1Wfp0JVF5o\nyupfarmSNKDiPWyHZAhFBmjJRfgkTq/G8qn8FHIOCTwOuP+RHG/qAkqH/0a3\n3NXWCo10SkfXlHW39Xpo7V2TyCvCyY8o5587A64Bu5Q31SquJ9jKIZHxu7/D\nmoT+GawJinyiAXosSzDE5+6fZ+nmQYRU9V3r8V4eKNQCKkutcJpW1BOpclsd\npUw+Ml/9T2PPxmi22vPEedSmDuGxIJ0RnXm0xTBZLChr5UuiDjTbzWeg0y0X\nHr2njCZNa57D1Nkvt/q+QbvPcHad397kesrE+GwZLL00CglqPxENhY4bzSjR\nfxow\r\n=cXCb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEDIg+jZsZv/nGwgMozsmR8PeEqMtQiO+7TlgTp3bB3QIhAM56VexUpxKxz/dCB7tG0VNU0N8s7SBprflFWIc+r6h3"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.11_1623045125413_0.42282752697950987"},"_hasShrinkwrap":false},"6.16.12":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.1","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.12","gitHead":"6157bd25c840dd5cba779c4a0ebe043b3dd4e2e1","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.12","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-T8QoZFUZTw5V6ebeU/oc5/GYVtviF5weL+6oe1VWJ6HNlGcH1MB2FNIwe24C1hvTgIS6SzXfNKbS1LRCh5lHpA==","shasum":"adadd85a759b9b231fe01ad5a880c1466fd1fece","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.12.tgz","fileCount":75,"unpackedSize":234265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvdYACRA9TVsSAnZWagAA1AEQAIbwOWElL472wlH+4Ha8\ndEen70vOZu5vrCcUyjXvXGZdc0Pgre8hOo+iFWE7dfPvea+SucCbLmKMfKwR\n4B/5hYkeBKI1Tg8u+3uUYre9jhYHJqJNvu9X+HGMMfioJDWF5/kh9YWWQFoo\n7t917twcvUtHwe4WNUEeE2Fn3BwtDzGjJ7WVlNgVxLlFGo8X8xJ/n+3V59Z4\n1wF1TsRrYrkPd/xJE2BABHWcf1kfvjuQ8Ay94y6KxjvtjTcFAE52nlva5tPh\ntp57oJifkGCg/cSA9bZaPZJBbqE3pI+1DOfgpKGzCQc4kn7i8QCJnLrK61/U\nxO4XiQ7nsPYwfY0ij65dRfIjw0lbHIXcwJukDCHQKaNq7Ce7aUQT/PQFx+5t\naPwM8n0WOoAELWkUVJlHJ+4MkETX3Dj046OfXgKSq7Bzq19oD28ybXXqchU1\n87EQbBo3mM8MUJPqX5o7XXdUvLbcVNw/gaf8rwMBx3o+npe8ZFRtCFdbT674\nlMAhiaClW33i2KFU/v8GouqEAvYBknTkT4z3KPyAcX/Oa/5Dc+QOv3Pai9dM\n8uZAQJCNB/UKv0AkeYvR/AlDNWzr6OthVz4m865z1Xigfsc3vmnOCwOK8Pzi\nBEW2M9NGtjmtQM3T6Mu4cit80PLHpc2RNyY+4W/v0Q3DoC5XmXKhV4ZPd5PR\nQ1/B\r\n=r0jR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8JsoKB5tj12cxcLIj9o9+e/yKWaR1qgqTLLvUpwbhVQIgaOzUFfHN17lFUVBRA/3gSZCVxqhNZ7QAPpAQkibZD3A="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.12_1623053824171_0.6732590477958407"},"_hasShrinkwrap":false},"6.16.13":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.16.13","gitHead":"2440ba54b157e1264fb44ab81affba02fbec2e90","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.16.13","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-gBxPLtJ6uJEgvbmmk5AsINBvIoWqeThYo9+8grHDORBrSYCkNI6UVUbgRmDe4zRG47wIUCfD4tbGJc6rognsfA==","shasum":"b52f2e518545acdb2bf59491f7d06a3104be19c7","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.16.13.tgz","fileCount":75,"unpackedSize":234265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvvxnCRA9TVsSAnZWagAAFCoP/0BLT3abk5K1u+l4kpyP\npOcGb27eLkNcrMHjKKtR/hTpH6Z0awVNupquV4mnN+aIyusR6160fKx75f3v\n0XmF6rTK9PAgSesMqCyabMAXnGReq0LZ7OMpJ6fARRtPDpu5OJ/AvzeIqzep\nqgHn4KFWs1R9bMaRF93zByMQiiSq271dHlsckZQ6aIvIb/MZTYYXzGXUcAV/\noJ7GkM89BjfF8nx4UtSmPYBLxSOtU/Bw0rrk46iF0TT+9Fb2AmQcOfjbuz17\nprhESkN1XO0/YzfJH3AMG/I9lJSgt7f/dRE3yEdp0NOXMud4KCk5PF/2hnLf\nCAksxcvtrC2ur5WGQ+KD3+ZxZLGyQB7676LV7Dz7LRCdFkB8XFMXKf+N14rS\nXVXzZcb79anoYVdGj01OGCpIHCyCKE0SAs6BjXtGIdx0abfnumQFjW+G9cjw\nKm2XC42r6bGSSBjcSoOZkcPVqI2McLAFtJ9gKh9wrFolUx/nqIRGXqwZoZ2D\nLWtNilupnIpv7bBXupv/oaRragOuzWyCoVQvAaSDNWtRaQL2kaiaElAx+uar\ndE06OkjO/JIGc7xAIPfBp6T5z8NdEgyKgi0OsTH0EMSbCKOIIMg1QqPs9Xqo\nLNjr11WHCt6YU+3ZeuEequkXrxzMdlBkqkbn25l0FLzQIac/aiDuT0bDpMqC\nxK7j\r\n=JB2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjOenO/QV4oefS5OY3tKdo6laZOFWduOZaL2O+GazdyAIhAIB7hxd4Sf+SMRA3wfaoibOjRrULQ9DF/SEih3rmjbvr"}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.16.13_1623129191643_0.5419418091657764"},"_hasShrinkwrap":false},"6.17.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.17.0","gitHead":"bc83358c4b21fb040cafcfc9be96dc12c232db9e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.17.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-JTR+F13wV8dgB92Z8Qs7vPNq3WOKnMGo99MSmd/Bg4W/4tYKy7nv8qXxZJYR/dboCxtAWaAh8T+kSFv4J3mSVA==","shasum":"f8e47dc8cbe9221ff006dfc34e9cf1d3a5e5e3a5","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.17.0.tgz","fileCount":75,"unpackedSize":234970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwgTxCRA9TVsSAnZWagAAsWIQAJDSr+OhGtovqM7m0k2v\nrJ6tkRhFxS4f5JyNBW5oIT2n1IWpZrRUcCy9f3p/RkLirgOq5IXyJXO2hCT+\nEq463bpcVhbHTi0/BxOxUvpeRo0at8cHu23f8OErlmLRgNr5yxC7grRla3GA\nlDUrQ0cDkMFlvXk1iS5GQMY5Z8Hy1/MDCTYEuG40jI87sfhBi8j/fmj0Y5lr\nHm2k9wO3X0V6AOEUtYHlXr61cuLpy7rh/FzI0aiOQL+OlSSwoU8EuXLUsq4A\neLCpQt1kUvlPKvKtH83pLjh4L3CymtJyfNw4g7+Q4sm0XSkcoef8Xuuextyc\n6hBIJD+rS94LnhWVVARj3AZEr6ExpthS0tL8Y6x56fBFBI1EkP+wAejpaxku\nDplNrUwbebED4p0N8d1Q4bMYT8Hn0/UbgFsoRpdihr7JkJnidDr37es5J07q\nwFPvE/x9s3Gbs7fTqe9oFquMflO0xkvTN+d347WZKzOMUAiNX+aGhJUxxE0x\np8U1imuYE0GKvkI8uim/fvyDOh4VrQIfY+Qq6EomStGTSiGjZ47I65qFfmgC\nHCR8JVwbEaxKUl+GQpf9LPnTbceRL9/wlnmQYXZU4H3Olbu/CxbP1IWZJ3jT\noRpK1MhF8jA6KcUnE/pq4USt9rEqT4J1Q5ipXN1za5up7ggZAM+5+X266o/q\nrH6Q\r\n=mlYC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBvHloybaG48sld36JGIPUJWCTjjeBv9UidfgGbwhXUAiEAgetb5USlmy7ODjWSEu1GyLDqafnb8884L5mz0fq7mo0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.17.0_1623327984919_0.29506889332336494"},"_hasShrinkwrap":false},"6.18.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.18.0","gitHead":"5efd3f3ff9efc5931a5d6a029055f079a2ff825c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.18.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-POE87JgrymeSGqTWCBM+8CHbhWaB9Cegw6YZVDQSIU3Ibce8h8I8PLkFmP9eNElCWgGGaUveUvAVK43EFK6PdA==","shasum":"d663471c51ed2ea7a1e1bbfdcf67a491b1ce5d54","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.18.0.tgz","fileCount":76,"unpackedSize":239081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwmj2CRA9TVsSAnZWagAAuOYP/13Df6u9FcEHbrFqRGJT\nqvSO5KWE0Di8nMAzg3SjwXIG/i8azpq8KlEqbh7jLAdKXWF3dPTosyquJq9F\nu6AH3tzRz6hYIVOCyzMo99TZnQq+LkNpc58Aeol8uq/rlWKlFDOfvWPlkJ0X\nqmcDJ8DiC+x3yEFzCqjgG0ohlHToPQaybgM5TvJaAwCdZR0K/vvMxkrtf/in\nrGhskNi68Sw6fwVhWHx83puDacMMCDAgAmGRdjIUqn2tY1hX7y+o62+RTfXk\nkXO9RmlSJyUy+P9dvsvOKtY2Rkhgwm68CpKqdzW0hBP9xdyyyY3l2gIa9bwO\njTEdgGPvY7LiY9dFSzXFNwiy4WJ8b+WX3vtE3E+vbMWF+jC5x408X5TEHmOY\n21sj26CcpSl/ZhGi2/whHd0OStXX3bt7sbUzjKKbPmwpfD3iLmiqo9Mh/dCH\ncWM1Vamao7OUWakSUs7g3gCYnhMJQ9+b63F+ctZvGJC090oNWJn1QAkIqbkH\npPdcJzKEazYfStWpvbT8CLxiEC7luk+GXQLt2QechcbA7MNbIjwCdeatVBsd\nKU4V0jQh0piVJ3aaQs432eh2zq73vAXI5xJEYifFLxQUJuEkQ0TpBHLdVKnZ\n1ypyOhg1KL6bwCNXxKcnjVMPD4yzmCoKhVUWzfv43RSZurvANXYhbxkGZFfx\nkK6z\r\n=aIUT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgrU5RvIER6/zXYPEb0eFOXjcOcTA4ex5RY7UMS2EfFAiEAg5iApO+5IwialDyVQuDqMVSDrPRZr0np7Yi7GbCIDBA="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.18.0_1623353590584_0.005184324955981978"},"_hasShrinkwrap":false},"6.19.0":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.5.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.19.0","gitHead":"688b327311d694eba7434b1385c696449ec894c8","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.19.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-rLGUcVQVQ/N5Lx6a0XcKrHuyhwfHxh4reQmJARC2/l6/pl5Mt2eU2GQJ7FMTSBZmMN83ZRcCYxyqbU7xMwchMQ==","shasum":"0e7b7e8742054cc0b41ca93e8351298211e64278","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.19.0.tgz","fileCount":76,"unpackedSize":240767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwnl6CRA9TVsSAnZWagAAVZwP/RTy3k2mlD4EgbWQPQAF\nWweGeyE0jj//w7op17Q0NVlt8SUIq2+S7UbgouOiTzJTqDwKWF4JyKBNG43t\n4d5060sB4esgkL9d/CIKctOqLAzRppW+i0/La7ffybsbQGUhAsKcWvbtYTG0\nTTK++VDvB9b7ksn0/qzTGyKwcBJ5zXcCN0ThMFRANZdUA56VXBNi/mEwAx74\nL7cuoEn28WK1zUF9XosSPgEeTieRoZOoosqogh5MHt5bDP5Cmd7Sr7o15COd\n08Ms5et00SQPWTcWUk14/IlC96QZTIH6H/nITNUhQK3wJK3iiov+X31C3gAz\nn/rGNZVtf8s5STa+Sz8IYYyoHAMsKaRW4Ica7fEuftFSD7NnFEs7J9hxvITC\nqTsrQVyiOYjoyfFfg2/7h5a/OX8w3dQu9tjBxFOm7PQ10SJoV03wtJgnzv9q\nERBCcT5cG6xO3yAfkK7kMVbYOBmlqwIjgDgtsokddwJna+8s/HAJsRcUIFAH\ng8L4vPv+XKzPTJT2A1OpVP8BYJXsLACg6lmUBE960NTJ7IaCGNdy/W8tzWQm\nSukzIGX5V1pLr/0xAyhksaZehC0/duw7kCKmHjOQOlyBhjS9Z9kHT3l2HtPq\n411iw4pmR+ILY5pwfQMQs8+d/j/7p5mw6oHR4X+eoBJXdya2oQX8Sxa8lOEK\nHZnq\r\n=mCOk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5GoUD4Xi5ug0WzmS3vuIW6O72eb9JMuoF9c5qS1+TTAiEAxaudLDAs5E/fU7XcT+2h/E7fdsE8Tb4sX9j+5MHHvTw="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.19.0_1623357818325_0.16737283822282145"},"_hasShrinkwrap":false},"6.19.1":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.6.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.11.2","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.19.1","gitHead":"3ba633a20faf398ddfa10248639905e4556aaf6e","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.19.1","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-yt4OMTpU50QHnoinsHsnlqxmGbdYUMOsbAXOAeRfO3vnGfsRhPCuRYTwGN1TXngtabjpFIJDDp9KuwP/pXOAaQ==","shasum":"928849638a28799029007af8c33791b6ef09d436","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.19.1.tgz","fileCount":76,"unpackedSize":240767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvIjCRA9TVsSAnZWagAAX4cQAKLrOqExcSMr9lh2R+xv\nXh5IQf98nc+F6TbMl5Ke+aQWoS8wWyc5F6L2xWa96FqQdSNCGkKqp1FRlGRf\ncBlvPi4dHIg4BLhZcpuyopx1Fg9YKkS52XJT99iZzLWxxZnyDbBiC6MTr+m+\nD0IYdzdtiCQTuDSmZEZkVKlt+lO37At/5pid682kpFw9F5qQuXJrDb0pW+K3\nGRhUyJLkuoUV7Atr1d/ZDVVT9cAzOqApkWT0dTRbj/xkBoi5UW3bvbOa7KtD\nOl7QaHYoJnKEzBzS0Ahi0e9/qJvMavBzCPqoEKE9bL92LMVIlpB7XHqqsy+O\niKkctDbThqtYXDb59avL8ZWC/OKJb2MKft1QPmU09IdmbYt79bJlTCt1dUm+\ny2qaq9SFI1+Dv78XWiSPJ1EtffIBvmtNXR+xDFUEDuS9wrmqN8rm2Swwh7CG\nUwfl/rCVdOVuREzIa+oDu6/uBeFaGSN8KhhKrz0k/xqWESFXlzkZbe0V94D2\nE2ZIT8Us+Fa7h5WLMYgpzYTf49+cukP3eVq91xUqpmnBgbQWbZO7cV5noucI\nZ4jI31azNCERA68YLNuRddLx8ANV3lYVaeOivz6nDX+fvpkMwEr9bU9rB4Hk\nyXcoMhKyuM4sMwMintLbi+HLPs1kTxcEEewws6sXlzWNq68m12Gvv0eJrZkN\nP53D\r\n=aU+Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbTyLPT5qd5aE/uF11hFeTqAgexYjAKIXxKFEkeEIWUgIgdCaRRJMoo9AOgcA1NzCuWSm7Zjyo4tWmCo48kfFwuQ8="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.19.1_1623388707509_0.8575757367622729"},"_hasShrinkwrap":false},"6.19.2":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.6.2","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.15.0","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.19.2","gitHead":"17898de4072d9242ce285b01ab2be9c9f992ca6c","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.19.2","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-5kBaH3qobpXLQIwPWbPvwLYRl/fDJEEYz7c2P6oli/DksUWtRQH5YMzSTBrrD+RMv6GcqJ7NXIQ5koLOmrJdpw==","shasum":"140f2c2544816ebdbd2b0e6ec4d18ac3cbb69339","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.19.2.tgz","fileCount":76,"unpackedSize":240767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwwA/CRA9TVsSAnZWagAA+HoP/A18SaozMdQGHI3onljk\naxG2izVg1CvsOOk0+vQznV6GhK/NgiWpACp4LxTqxrQySk40LVm56/dO+zhb\n1sEp4H0B17O1gAzl2OBjTnRjQGvmesK73Abr4RxwSM3QKc8zAhMiIHCQO/KF\nLg0ojsyjjfxYsOBMd88gYLmWQWlRItuY5M+/V8jo7rpWYVBVXTbAoxRA5Hjf\n+8136RaS4ntTZUxwoLQVT+N9kEgeSH5Vi7xlfmu6QaGiTWxe6eyVUWETO4tc\n1JweuyRiEEWbTJGt+Ew/LsnANb1RaIAR7ts6E9jiuJ/PabE08W9Ig8eTkAHb\nBfdOeVcOfrF0evxkfTFVE6L49/bjPkirJ/ASIVkzZ4VWH7U6kD3jE4iMnKVh\nHIoO5dsmDT/c+gZbiz2wyrRK91ZcYX3T0NjnocfRPwvrz5vXFSmuJriWkBJG\njUnJeDsvbW8QP3mam4JRZrP2+oFJoYFxlqFMs/nCH9vubYZduCKv1osaHTSa\nXBbAkG/KuCidtpGgYI/Vic2rpCwr+pLRpKow3wVzm4+c2vOU+M0xHH4+tzhu\nDvCyw4RE/wTnRSw6//JCx36W+Icn0gjcZwfE86j547ANIlG7ZwGTWV0YXJpJ\nZGTwZxVrjjHMPmfRQmaMGbVMfZj5OpkgWD6xvBK4Or2QifQZGq5DGMplI2LY\n7al/\r\n=U0f5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8QFdC7CJm1vqGPj4BXMM5aVOiZFkz8hmn6VtJjBhvjQIgUk4ffXkh/dv5lioDcTCSgAsU+CtkBsenfh4L/OR2hmc="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.19.2_1623392319130_0.8789221485603391"},"_hasShrinkwrap":false},"6.19.3":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.6.3","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.15.0","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.19.3","gitHead":"de4fb20333651d942655850e889f8d6b267fd404","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.19.3","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-JMucb43ONNjcmKlEmuoxGLXHwTWyuogmKjdm4GaNgqR4Ku3vJcGZ5ZowhP/WuXe8wMtZ1rsnNiTOnk+A3+MQyQ==","shasum":"fc6e6a5cbb727b2f303bb867f230684a07a667dc","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.19.3.tgz","fileCount":76,"unpackedSize":240767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxvKVCRA9TVsSAnZWagAARGQQAJfkIXNsq9c7oh31Jl2I\n/h4+crMkHrmkmxLMlkH6vm4B7N6/f/S+tw/OUff4AM3ZKUX3PdruuATzkZcC\nA9kOfj2vYzdDZ6iUsMEcxspRqo8flhz1+8cbqEMEFrOM0ed/cePf7ekYLf8A\n7gfthgzPBzLnceMXi+7ldaCKkdjjim9i8JRnacyZMK4d9buN3yhcQHRrHELK\nG7WEqtrra9kAjiE4sIUV2vpXGq6gYpngEdNu5f/X+BtngxVl9XYW5Ja2PUZg\ntzfZxKnNIslZ/kk0fd9o5Zytl4zSwEwgif+Tf9NKORvLmMa51jvvxVYfC00V\noxYeeKWyLKDX/yIqMHxBYoRc4a7eIYEA1ISNqnGtD82P/GpOhfVnZBuHiDIJ\ntzZXqBkc4avf+g6fgLOhhtwEDBZWw1J5ozRP7aTHgkThvJQx03wJoUpzGCKE\ndZXcTA9z/MFlq7yUtB+lVZr76ireL4UK4ZeoTrh43sCLonUtO8USuwKBzOeO\ns3I7ye52L7PDdlndszwm6pACJeT3V+Xa/OIvlP0OeDrZycTOwIDN3EKjmEto\npuDFpkK7Q46I2i70gFU0yVHWGWAS7glsTn8GcQFubb4iWqu17jlb2YX86u0I\nYyllGrF46c6e8C3emsE616KkIpnAvutcVVTnJSoH5LmYZAVPXwzMLksR32wN\ni07/\r\n=3ZlV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH25kCKngjMsauiS/AMTSvsgcBXUxehpHqJKpHL7TMBoAiEAwzgrRO7nosErOvUqGlQN0ruy8If9sdMTyIGzZnya/B0="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.19.3_1623650965384_0.6057104961078652"},"_hasShrinkwrap":false},"6.19.4":{"config":{"commitizen":{"path":"cz-conventional-changelog"}},"dependencies":{"ramda":"^0.27.1"},"description":"A collection of Firestore utilities.","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@google-cloud/firestore":"^4.12.2","@ridedott/eslint-config":"^2.13.34","@types/jest":"^26.0.23","@types/node":"^15.12.2","@types/ramda":"^0.27.40","@types/uuid":"^8.3.0","commitizen":"^4.2.4","cspell":"^5.6.3","eslint":"^7.28.0","fast-check":"^2.16.0","google-gax":"^2.15.0","husky":"^6.0.0","jest":"^27.0.4","jest-circus":"^27.0.1","lint-staged":"^11.0.0","nock":"^13.1.0","npm-run-all":"^4.1.5","prettier":"^2.3.0","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.2","uuid":"^8.3.2"},"engines":{"node":">=14","npm":">=7"},"license":"MIT","lint-staged":{"*.ts":["eslint"],"*.{json,md,ts,yml,yaml}":["prettier --write"]},"main":"lib/index.js","name":"@ridedott/firestore-extensions","peerDependencies":{"@google-cloud/firestore":"^4.12.2","google-gax":"^2.10.3"},"private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"scripts":{"build":"run-s clean build:*","build:ts":"tsc --project tsconfig.production.json","build:ts:watch":"tsc --project tsconfig.production.json --watch","clean":"rm -rf lib","cz":"git-cz","cz:retry":"git-cz --retry","format":"prettier --check '**/*.{js,json,md,ts,yml,yaml}'","format:fix":"prettier --write '**/*.{js,json,md,ts,yml,yaml}'","lint":"eslint --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","lint:fix":"eslint --fix --resolve-plugins-relative-to './node_modules/@ridedott/eslint-config' '**/*.ts'","spellcheck":"cspell '**/*'","test":"jest","test:ci":"jest --ci --collect-coverage","test:coverage":"jest --collect-coverage","test:start":"./scripts/dev/emulators.sh","test:watch":"jest --watch --verbose false","types":"tsc --noEmit"},"version":"6.19.4","gitHead":"bc8872e653b228f1bba5650ef71bd69872084312","bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"homepage":"https://github.com/ridedott/firestore-extensions#readme","_id":"@ridedott/firestore-extensions@6.19.4","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-zDHN3+vgTZSdXn4hDdBORB/mIB7CY5l9ixNH6vFa/WVWAwYVOyNXGfl+qJQ3GikjO05D4W4GeJ3GdubfcRaMSQ==","shasum":"54c4b8e04068b90fddcf57c2e8c25e48dba0cf8e","tarball":"https://registry.npmjs.org/@ridedott/firestore-extensions/-/firestore-extensions-6.19.4.tgz","fileCount":76,"unpackedSize":240767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxzIxCRA9TVsSAnZWagAA9/gP/3MuG8d+SX49bunP2JpR\nuYIbqp+wfF53rMtZnDWcWQ0VZuHIf836QBpXGHaumV5QTDJp49r9XG6DMSRN\n+yTOCo5YZ8ngX63JIe/aITHdeYp8HjK6UWk3uKHTIHI4n1X7WkPh/Reqk9Ls\njJ50oc1wXZNnQ/JlB1T9bkHK64IWpemuV+PuaApao2wvtGIe+oIoUhIRy9oJ\nk49BN+OYINR+rrCvo6+YYIT02Dl0kT1Tla5FhLUh6/BzG0vfBDV8QTXM21ks\n6Gdb4o1Y5icfzSQE79ko2xtpEsE7PyR9xSn+RZZVEC0T+1bryZ+aoKkQwYcc\nh3bOjpdtIU27FDTWqn+nsfI9Ov5PfSq7xCgkO3jjuUIcC9hlqzRA96K7c04q\nSfRkab5M0w/fbpRzGg3x9ZOUMsdM2hA4qJSQxBgVwjWbfgMNXxI3h7I06I9X\nIiJwTkMsMZtmAlxky5mPUnVxicvT5fVNhsi0I0bAqYLHon/mw8Y1HieFegQg\noUjkE/NVM9/GJNE2JOFQHV3gcHeogwW8PgLgmXuDDMJVG4q22btDEhkEXfuT\n9PLroGG9Pnvlxn9phfzxcSIF8X2N7Qgsxzl8j5K24HGgJKdrGaD0S16SMFHR\nABoWPjNUroKCnRlEuvSPEJwbZ9GBWgF2/z8+Ci3z83OK6Pdzp82TTGZNKBd8\nkHqf\r\n=5qKU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCUI+KYkkadWRdkWtJNrnGtQdzLUrcFyXZWX0iZ2ducAiEA37ui7rFUbsj07Rq2bHCeQSAsReentXlmBWCiVikPd90="}]},"_npmUser":{"name":"ridedott-bot","email":"bot@ridedott.com"},"directories":{},"maintainers":[{"name":"merlinnot","email":"merlinnot@gmail.com"},{"name":"ridedott-bot","email":"bot@ridedott.com"},{"name":"acazacu","email":"alexandru.cazacu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firestore-extensions_6.19.4_1623667249692_0.19049766221978204"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-02T12:52:33.952Z","0.0.1-f8f87daff42ae5c0d0cc2c2330550415367249a1.0":"2020-03-02T12:52:34.078Z","modified":"2023-10-18T10:21:37.055Z","0.0.1-2e8c4f9b9983e9c8b24701f30369d5f11c669175.0":"2020-03-02T12:55:49.104Z","0.0.1-f1a2d87189daeab370ff6940b49a340d2baad014.0":"2020-03-02T12:56:52.188Z","0.0.1-9c41de9f46832062dfa8c2ad85ecd37d69405b5a.0":"2020-03-02T13:18:58.035Z","0.0.1-5a3d525ccdcfbfbce6207e1b7de1e7fbf7f69e19.0":"2020-03-03T10:03:29.287Z","0.0.1-bb27e1f9375130a459674e87ccf8ddd479a2225a.0":"2020-03-03T13:31:52.192Z","0.0.1-4e1d27a5abc49caacfbca448af47f0f98b851207.0":"2020-03-04T08:06:54.166Z","0.0.1-8ce1f25c619fd154de0cc779de7dc8e7149f4767.0":"2020-03-04T13:36:30.413Z","0.0.1-8dd6a9be51bfa2a2d842e9cf47c6c5328e7251f3.0":"2020-03-05T13:47:32.134Z","0.0.1-fcda419fa97ec3b068aa5e129389143d69a156e3.0":"2020-03-05T14:52:20.725Z","0.0.1-29f4820a87316d93d395c09efba21ac27abc990e.0":"2020-03-05T15:01:00.797Z","1.0.0":"2020-03-05T15:01:23.132Z","1.0.1-1e2ae29765a81a619621ab15daacea36679c578a.0":"2020-03-05T15:02:08.925Z","1.0.1-f05b656496b9e4d9972c9f689d95bea00177099a.0":"2020-03-05T15:05:16.211Z","1.0.1-c2aaddf91d465e7c8d6f9ddf6bc3ba33d59147b8.0":"2020-03-05T16:42:45.382Z","1.0.1-f9f2cc2484311e00379fc2211b68afa52eef46f0.0":"2020-03-05T17:07:06.919Z","1.0.1-dd17bb9232d46aaac266dc5dae08ae8d67dd66f3.0":"2020-03-05T17:11:23.885Z","1.0.1-2d2a7bf80d08415b980080a52282a3bb990b9129.0":"2020-03-05T17:24:42.296Z","1.0.1-8663445932c9fa30f2d9c034d7c572e32a9e7715.0":"2020-03-05T17:36:21.227Z","1.0.1-b5bfbb2ad1c896eeee9660ed45fe08c544d2c8d4.0":"2020-03-05T18:04:11.929Z","1.0.1-aa4ad2d751a9926628a390d051e7f5571a04152b.0":"2020-03-05T22:55:46.840Z","1.0.1-d0bde224eb49c5403783df2be3a552d5d147f93e.0":"2020-03-06T11:36:05.030Z","1.0.1-d2b4c79cb596dba52854c8557ac1d08ddca92804.0":"2020-03-06T19:01:30.639Z","1.0.1-a3780c4f676fa62c22abb14deb1ad769767e8de6.0":"2020-03-06T19:03:01.674Z","1.0.1":"2020-03-06T19:03:17.556Z","1.0.2-073a2fefb7b8cd4f8aee52a160667e0512f4ebe0.0":"2020-03-06T19:03:50.201Z","1.0.2-e1dcb09479984f9f1bc2fcecc65ab644cc706fef.0":"2020-03-07T02:00:13.017Z","1.0.2-f76a471d431151f839109cda6994690a5d2af42e.0":"2020-03-07T02:01:41.745Z","1.0.2":"2020-03-07T02:01:53.699Z","1.0.3-f4591b3a4d6197a98104a5274a048cb3c950909a.0":"2020-03-07T02:02:33.812Z","1.0.3-a578a28f6b4a68e300439b65730e779faf2907aa.0":"2020-03-09T11:50:57.193Z","1.0.3-dcfc6c2591b3cbcc22f0c5ec82421559c1420036.0":"2020-03-09T11:51:06.836Z","1.0.3-12ec8be63f1fed239425cb656f63e3b7897abd65.0":"2020-03-09T11:51:17.823Z","1.0.3-791f2ab3fa316eaab11cfa684fcbe160dc12dcb0.0":"2020-03-09T12:10:43.560Z","1.0.3-86afa445658cbee58273245b44cfc321b5f14d70.0":"2020-03-09T12:13:47.546Z","1.0.3-4e7fedabfad26a5a0c865c9221fc80f445334e3e.0":"2020-03-09T12:22:47.710Z","1.1.0":"2020-03-09T12:22:58.907Z","1.1.1-7eebd5447b8a05963d81ab355b2592fc4b24b1f0.0":"2020-03-09T12:23:41.125Z","1.1.1-e9ff05ef0fce090fd4d689c498716648a0743f76.0":"2020-03-09T18:20:04.789Z","1.1.1":"2020-03-09T18:21:55.770Z","1.1.1-a9174165042fdb46196365a3dada2e82a8f3ccb6.0":"2020-03-09T18:22:07.346Z","1.1.2-dc51286a3b4d8f5712483f746b6fa8e4d794d3f9.0":"2020-03-09T18:22:31.406Z","1.1.2-f41aaf7f252cbde7f3e3cb7dd1c130791f151143.0":"2020-03-10T14:59:16.011Z","1.1.2-4a5ff5e8ccddcc54f9cf9d1ea7628d972f8fad60.0":"2020-03-10T15:04:10.133Z","1.1.2-626135243bd2b6dcd1aeebde61d47c7a7a251ce3.0":"2020-03-10T15:12:24.772Z","1.1.2-53d0f110ed2c1adb0517bd72d6b6401b6d4d9c1a.0":"2020-03-11T09:15:59.882Z","1.1.2-cd0fe8151a950cbfa37bc6ec0f6f212287ff1084.0":"2020-03-11T16:13:14.328Z","1.1.2-a257c70b71ba02cd86fe3bb5b430cdd66c6249bf.0":"2020-03-11T16:14:35.742Z","1.1.2-a66fc2fc48f50b9795e2574012a0279726e69ee2.0":"2020-03-11T16:40:43.166Z","1.1.2-ea63d8d14fddc234861588b8c0c4900e4f83f5c7.0":"2020-03-11T16:42:22.386Z","1.1.2-9c65cc9721e1971bba6fc5e3cacb89adbe88dcf3.0":"2020-03-11T21:45:27.735Z","1.1.2-d755be6e4c9d635a7e0a1053520e12d59956a0df.0":"2020-03-11T21:46:35.377Z","1.1.2-54719815622e8cfb839824f3cad94015930d7b27.0":"2020-03-12T11:09:49.669Z","1.1.2-68563129a833ac8fcb62099b057953b474d5e3c7.0":"2020-03-12T11:11:57.520Z","1.1.2-50ca1a06ee6310c1c4d7531af1d0151435447bc8.0":"2020-03-12T14:09:44.402Z","1.1.2-c2301d7db2cb4891aa7a7dd7bbd6a55fa220bae5.0":"2020-03-12T14:11:06.273Z","1.1.2":"2020-03-12T14:11:22.962Z","1.1.3-043233db5ce5c9f3d51a326145d4955a645e02fc.0":"2020-03-12T14:11:49.195Z","1.1.3-af5c9180e586ad6828da0b3a43a122523e0f6df5.0":"2020-03-13T00:46:53.657Z","1.1.3-ca93d9372795d4907f4771f580c9b2974942cc73.0":"2020-03-13T00:48:21.308Z","1.1.3-b86083aa924a848180be10b2605bef2f130cd940.0":"2020-03-16T17:25:13.286Z","1.1.3-a65c431408c2328a0694f3a1d63d9c4282a72d98.0":"2020-03-16T17:26:43.619Z","1.1.3-4f915db136a0243be4f4a8c4fa00b56d7ffdca47.0":"2020-03-16T23:53:28.283Z","1.1.3-8933e2974173b6214a597138545ca1309601b9c2.0":"2020-03-16T23:55:20.736Z","1.1.3":"2020-03-16T23:55:37.769Z","1.1.4-431b4a7edc42044dec38848773659dbbb3d19d3b.0":"2020-03-16T23:56:12.731Z","1.1.4-b14a3f2e36445ac5f906b4db631cf660714b56bb.0":"2020-03-17T11:57:22.210Z","1.1.4-804732846fc35f5945cd3e1de578935522f4fe17.0":"2020-03-17T11:58:33.177Z","1.1.4-eab841125d55d27b016aebb0eddaf1fa799e4c4d.0":"2020-03-18T10:39:15.436Z","1.1.4-83a6d2d9eeb1d8e59f7971e9718caa77eb5e5828.0":"2020-03-18T10:45:04.791Z","1.1.4-f6ca7ed209f64f72af77392ea5b4d918fd0d455e.0":"2020-03-18T10:51:32.329Z","1.1.4-65899c4606f3e8680ebcee8e2c13f5d71164877d.0":"2020-03-18T11:15:42.358Z","1.1.4-2cde7518020cc2ab91bbfa8c219065216db8367e.0":"2020-03-18T15:07:57.758Z","1.2.0":"2020-03-18T15:08:22.079Z","1.2.1-7a23966c05682e07abfa934b084f3115f11707f6.0":"2020-03-18T15:08:53.251Z","1.2.1-a9a1c895dff058718804fc633f975511eeed728f.0":"2020-03-18T21:08:48.122Z","1.2.1-f2d7f2899e82e85fd25350ef4ab3fd56e827f4d1.0":"2020-03-18T21:10:39.850Z","1.2.1-74467e88c4833934fb468724aa4f0fe321cfc7d8.0":"2020-03-18T21:24:52.964Z","1.2.1-fcbec74d785f5c1e1fa9020bac28eb3b7402fe8d.0":"2020-03-18T21:26:11.830Z","1.2.1-3b487b9acbd10c4681c1ce4ac0b7d9064e3bb05b.0":"2020-03-19T16:14:46.334Z","1.2.1":"2020-03-19T16:15:01.753Z","1.2.2-a0cf280285289c5f940758c517355b13a8b6217b.0":"2020-03-19T16:15:37.247Z","1.2.2-25178dc555ae625d155e431d114eba673c2caeef.0":"2020-03-21T20:11:06.677Z","1.2.2-8f7f34b9efe1a3ea79d3541877d38790f2bdc045.0":"2020-03-21T20:12:19.959Z","1.2.2-c013340b67caec3a94ddef2d042463b57ca188dc.0":"2020-03-22T00:00:32.926Z","1.2.2-28e552ef0dd71913003af24fcedd3b8c92395b23.0":"2020-03-22T00:02:05.381Z","1.2.2-14de886fd41cf21e046b5f808170f3a9c221bffd.0":"2020-03-22T00:19:33.825Z","1.2.2-47881c56b36e65e3e7a63fb927ca99d91808c49c.0":"2020-03-22T00:20:54.629Z","1.2.2-d80a9b97d359dd33466da5b62a1cac91f94af0d4.0":"2020-03-22T02:10:17.383Z","1.2.2-01697ee80b802e68de54e2ce8fc3d8bab415752e.0":"2020-03-22T02:11:34.426Z","1.2.2-012e582bfa9fde9aa02b8a77fa284f95aaef79df.0":"2020-03-22T10:17:49.007Z","1.2.2-347c0f427e647377a817a1e5b625d1174839f19a.0":"2020-03-22T10:18:54.657Z","1.2.2-d680917533de0db79c587182c7f5f4a50e50df09.0":"2020-03-22T13:27:22.712Z","1.2.2-816434425d1d382b72cadc4710ed7aa8f6a5abcc.0":"2020-03-22T13:28:46.446Z","1.2.2-763885f070b226e14ff3c68fcd24f9ad1ce6ea81.0":"2020-03-23T20:08:01.089Z","1.2.2-ec360df32533ea7ffb666c59e364a31038da3175.0":"2020-03-23T20:09:25.738Z","1.2.2-d308a43e7447b8cbe20d9d2cd852c9c891199b1f.0":"2020-03-23T22:39:10.501Z","1.2.2-85a56c0ed3471514b1e0479bd6251c364182ac31.0":"2020-03-23T22:40:35.881Z","1.2.2-b930ec738faf4e3766e00479e1d4ac9d7db183d6.0":"2020-03-24T05:27:55.473Z","1.2.2-3e43edf8b7fd17aceab10fb1cd2f7f467608450c.0":"2020-03-25T07:57:23.887Z","1.2.2-4eb1baf1124ad4fff346508cdeaac46da90d335f.0":"2020-03-25T07:58:52.557Z","1.2.2-ed14156d1439318c0af5ba303cb6465e5b47f890.0":"2020-03-25T18:08:16.704Z","1.2.2-8f2183a7fa77904cebe954356716093afac6c007.0":"2020-03-25T18:09:32.792Z","1.2.2-38a2824187f5745df469245c5a8766f8ea7370d9.0":"2020-03-25T18:11:54.423Z","1.2.2-188d0c4000cfa9a96eb624550d0664c565c303bb.0":"2020-03-25T18:13:10.694Z","1.2.2-80572a7ef260306cdbf4d5b4660f1b7958fd7226.0":"2020-03-26T09:40:18.140Z","1.2.2-cea8c126406fc04463e25bfa527fb6aa10d9709c.0":"2020-03-26T09:41:37.675Z","1.2.2-1760ee84c718d88073f203c9b6e2d4dd9dabc455.0":"2020-03-26T15:30:20.458Z","1.2.2-980b72fcc6ce0e217a645f53ec702dc5c6ee2b00.0":"2020-03-26T15:31:44.053Z","1.2.2-4d621f57d2e6faae39be1545529868e29ac68865.0":"2020-03-26T16:40:13.620Z","1.2.2-e885962af27652c040af2c618d57c882957f5c87.0":"2020-03-26T16:41:42.579Z","1.2.2-cc5af6526f0008609a2817c2c386d04da4757072.0":"2020-03-26T20:41:35.638Z","1.2.2-5aadfd445bb51f52b315d375b417075aa78fe747.0":"2020-03-26T20:43:01.632Z","1.2.2-32810c4f55511335be07c7ddf320629b271ce13d.0":"2020-03-27T00:52:22.356Z","1.2.2-b9f4255070bf8ade0ebbab502579eaf455d5dc6f.0":"2020-03-27T00:53:49.259Z","1.2.2":"2020-03-27T00:54:00.787Z","1.2.3-484baac7b0dbc789d4ef77f089fa3b73aab83240.0":"2020-03-27T00:54:31.142Z","1.2.3-99f423670bf015c5673a07d7db065d05b6827bf0.0":"2020-03-27T08:37:53.013Z","1.2.3-27307c8e649c67646adf362ab0f5ba8993d08940.0":"2020-03-27T08:39:14.433Z","1.2.3-3bfd0b277e349bb60c87830fc16691c3e200f08d.0":"2020-03-27T17:01:50.006Z","1.2.3-d64e116f10e4f090d9e27e68e80becc7c3731580.0":"2020-03-27T17:03:44.098Z","1.2.3-df90165fe8bc490a1c59f486e6c43d9ac5a1fe15.0":"2020-03-29T13:32:24.612Z","1.2.3-dc13a680ae6c31365a96eae3a3dcfc5b624a6392.0":"2020-03-29T13:33:37.843Z","1.2.3-3c79f0bc0169028cd59a447e47f80ed7d48c4580.0":"2020-03-29T20:00:33.220Z","1.2.3-6bf616493e3682d22dd1122976ba4f497904b72f.0":"2020-03-29T20:01:59.612Z","1.2.3-f59844f1efca49bf8d777cc19f97f5fb6b6061c7.0":"2020-03-30T08:18:25.448Z","1.2.3-1a602ea6b4bc012ff7fce2747dd73375bb639b2f.0":"2020-03-30T08:19:41.007Z","1.2.3-4f065c0864cc0cd356a41130da69e9074caffc07.0":"2020-03-30T13:49:33.237Z","1.2.3-6a38cb50964d4f252ad0d200b2cb394fc669d556.0":"2020-03-30T13:50:07.701Z","1.2.3-1a0c575adb0da31f7436e786e6d318a8a6cceaa4.0":"2020-03-30T19:46:05.485Z","1.2.3-ad10748c8cf707d76f3381fd1514f2288ab75938.0":"2020-03-30T19:47:45.612Z","1.2.3-42b6c525524d7117c74c1474e12f9e374ffdf585.0":"2020-03-30T22:33:09.350Z","1.2.3-c3f694c967387f653b83c79def343ba07e19c5d7.0":"2020-03-30T22:34:28.284Z","1.2.3-c9ea25a20ff4aed03c2f6e684de3b061c7eaf186.0":"2020-03-30T23:32:08.454Z","1.2.3-b0b896a6aa10ee894325cd7f9a8fc9542f566b2d.0":"2020-03-30T23:33:29.997Z","1.2.3-12fdbb79f0d1e9e4ff14c91e474a2d27dea73f83.0":"2020-03-31T00:01:27.132Z","1.2.3-003296202731b0e2ae41452506b364f990256b25.0":"2020-03-31T00:03:58.760Z","1.2.3-5094471617d65b5b4b3282767056c3bf8064aae7.0":"2020-03-31T14:04:03.927Z","1.2.3-993568b48167643d9d9f26c6a44dfba3818764ac.0":"2020-03-31T14:05:30.835Z","1.2.3-7163c63e6f01354a0680edfc32fdb04f1c907288.0":"2020-03-31T19:46:02.390Z","1.2.3-b52e5438f8c631be3f88d5ee825742d978cb9d57.0":"2020-03-31T19:47:24.508Z","1.2.3":"2020-03-31T19:47:42.511Z","1.2.4-ed956ac86a88875415e97b45a5d73af3ff1bb52d.0":"2020-03-31T19:48:15.713Z","1.2.4-abfef04e2316f2f570466fdb238945f77a103ee5.0":"2020-04-02T10:48:11.045Z","1.2.4-3db96d2955e07d7f26805f0ee4dc9cfcb314a553.0":"2020-04-02T10:49:31.332Z","1.2.4-586ec2ced7db46e473d8c4dd5adda29792c2af35.0":"2020-04-02T17:01:57.085Z","1.2.4-2c4164c534a1f423215e45255914d4132b67b03e.0":"2020-04-02T17:03:42.098Z","1.2.4-5786e52b379c06ed1e5551c462f49730a325f4f6.0":"2020-04-02T17:06:09.227Z","1.2.4-d565ee3968c6df5dfe1bf7235de6553b06858838.0":"2020-04-02T17:07:40.489Z","1.2.4-134a488e45c11199d8f1d6b92a90d69621197c52.0":"2020-04-03T08:52:02.946Z","1.2.4-2eb1114119efec11f9f09a359c434b99d193bece.0":"2020-04-03T08:53:22.208Z","1.2.4-29ac32449f17d5e9eb92fe0d8b91dd4f57f7aaab.0":"2020-04-03T21:03:09.770Z","1.2.4-4cc95dd884b1c76425968c593563d121be9e171d.0":"2020-04-03T21:05:16.427Z","1.2.4-5da9343ab66b7730aa9e131ab8ae7cc4267fc1d7.0":"2020-04-03T21:32:23.908Z","1.2.4-fcc4d0d68e844a0dcc3d4ade65f0dc0bd5969de7.0":"2020-04-03T21:33:44.694Z","1.2.4-99e47716791c05c0d47dba7d3d987c8c2e022c90.0":"2020-04-05T01:49:32.926Z","1.2.4-9457bb12fe7295c8d6b939a31637dde4429b7e02.0":"2020-04-05T01:51:01.309Z","1.2.4-15f9d942952817a2c8d45006aa7b05205cd9f307.0":"2020-04-05T09:17:28.368Z","1.2.4-1d3ae6e4c7442050a13fa08a5b2d783298b12223.0":"2020-04-05T09:18:41.881Z","1.2.4-262156dd190a5669d56cabab1556960768180dc9.0":"2020-04-05T21:09:16.856Z","1.2.4-18e1a3fca0d155bd62f18f40652660b0b694f48d.0":"2020-04-06T12:26:14.396Z","1.2.4-4feee49321891bf4cd88ac5e7f26ef8c179253f4.0":"2020-04-06T12:31:44.848Z","1.2.4-568e8bc555dbe8c0ff99f46392c32c903c4e232c.0":"2020-04-06T12:32:06.337Z","1.2.4-8bc4a682d71c28a286ad6c2c97af4b06d2fd7564.0":"2020-04-06T19:14:45.410Z","1.2.4-413674f56be006a7d7519cae841254086f42b2af.0":"2020-04-07T20:14:21.500Z","1.2.4-9b0d64d1bd3db240c7dd3587e5bd585001957474.0":"2020-04-07T20:16:10.875Z","1.2.4-933a46e907a10eed49445146ac64daccdfb427f6.0":"2020-04-07T20:18:12.291Z","1.2.4-b3f865e98040b798241f0169e7be18da4e1a711d.0":"2020-04-08T13:36:18.202Z","1.2.4-d1e12757312f81cec0aa1f77d5d83ba75aa1280a.0":"2020-04-08T13:36:55.770Z","1.2.4-1ddcfe140e26ded6c26e2bb6cffa9f8ee1e0cf14.0":"2020-04-08T19:12:16.991Z","1.2.4-529b3a40ec7a09ee92a597bc46de62d793bdaaf0.0":"2020-04-08T19:13:59.178Z","1.2.4-863782127e3576a5bbb1fad76d6922e4b68602f6.0":"2020-04-08T19:15:52.044Z","1.2.4-a7bdbadbda86e9f0a013e51e3207350f9621dd89.0":"2020-04-09T16:42:14.283Z","1.2.4-f9438c2ddc01b39c3cee2edbbc4411be0e9567f2.0":"2020-04-09T16:43:47.218Z","1.2.4-e77f7db3044a28d25b1eaad06f32990b5a8c24ca.0":"2020-04-09T21:34:55.562Z","1.2.4-db60c7c6e98048d960a9f836a3470ee251487195.0":"2020-04-09T21:36:21.218Z","1.2.4-1abfc7dc0e7c9c1994a009b73d9a41f481cdc7e4.0":"2020-04-10T08:07:21.651Z","1.2.4-a14c9d193b14327b83646b1d64ba86a52bb994d6.0":"2020-04-10T08:08:41.088Z","1.2.4-1dbd7c53697b40ceacb891e9a3492d1767763ea4.0":"2020-04-10T09:45:55.526Z","1.2.4":"2020-04-10T09:47:38.088Z","1.2.5-e56f9c6b4774a8b1a14c1c0d5172fbf1dc5b8738.0":"2020-04-10T09:48:09.527Z","1.2.4-af0c109ed8ef443d39e896b786f0d361e44be704.0":"2020-04-10T09:48:33.004Z","1.2.5-8b0c0de2257ba1eeb7514350547104f84493eeb3.0":"2020-04-10T21:07:45.833Z","1.2.5-e3207e73ea5e92d23be79df61d55b1a682a8234f.0":"2020-04-10T21:09:08.957Z","1.2.5":"2020-04-10T21:09:32.872Z","1.2.6-222a22602e96256e6b1351f4108e550fdd02dd7d.0":"2020-04-10T21:10:07.468Z","1.2.6-cc32d53443cb94743368dc3247bdf8b8b1ab93cf.0":"2020-04-11T15:20:41.547Z","1.2.6-bf10ade4f76d69e5d98ed2e72d5760f35a817690.0":"2020-04-13T08:05:50.388Z","1.2.6-fd35a25d459776c00b71fa628e771d2ffcc27162.0":"2020-04-14T07:53:04.475Z","1.2.6-b0a24e2963565affe71743118578f9ee249d7cfc.0":"2020-04-16T14:00:14.923Z","1.2.6-ce158feebf278bfde2e9f25e73bb29d17f567217.0":"2020-04-16T14:51:15.518Z","1.2.6-ac170a22e658c91319c21aa74e8a601bf16faac7.0":"2020-04-17T07:52:09.025Z","1.2.6-4b3084adce7faef45568ae48be71d45a0f44295d.0":"2020-04-17T07:52:43.213Z","1.2.6":"2020-04-17T07:53:01.074Z","1.2.7-8f43751352aa8cba64dafa46277cd457c87fcc3c.0":"2020-04-17T07:53:28.548Z","1.2.7-d103e6525a731047ec50bafc79570a85a2dc8ede.0":"2020-04-17T07:56:55.830Z","1.2.7-0bd16eebaedd642681f2b586e6e66854397d444c.0":"2020-04-17T07:59:05.787Z","1.2.7-cac13f5b4fb68acd7746b4c1019a41d08ac6754e.0":"2020-04-17T08:02:30.063Z","1.2.8-33b188aec8266c4a7dffb128c132fc878bb9d58d.0":"2020-04-17T08:03:32.771Z","1.2.8-506150f727c1a1473ba8374c076a8273c08b3b5e.0":"2020-04-17T08:07:57.829Z","1.2.8-83683a0ca2ee6d00a386a0ef8e52a0cd620d49dc.0":"2020-04-17T08:10:06.156Z","1.2.9-bc1dc5cde0519de1de9cbe8da193f907901cabdd.0":"2020-04-17T08:10:51.910Z","1.2.9-dd4ed5a079c06608c080001a40abcdd5959ab824.0":"2020-04-17T08:13:13.347Z","1.2.9-18875340e16a53821bbc5ae5b17c84f6cb5489a1.0":"2020-04-17T08:13:52.166Z","1.2.9-ba53be592e953f796d5c2f304b70fe447ab0bbc0.0":"2020-04-17T08:19:01.408Z","1.2.9-68ec0bcbc481e92e780ecb64fd5fe3be55e52473.0":"2020-04-17T08:19:58.064Z","1.2.9":"2020-04-17T08:20:10.059Z","1.2.10-164e64ed5d290a34cc4d3467fb5df84a7ed35f6e.0":"2020-04-17T08:20:54.111Z","1.2.10-455a7093561dfe78ead5576c47bc53ab097bdc3b.0":"2020-04-17T08:21:24.058Z","1.2.10-9c1d70ff77923fb8b523c13d6db072430f3e0161.0":"2020-04-17T08:21:43.221Z","1.2.10-ecc903da7bc5708468c68b7ab1fe0004a83c38f9.0":"2020-04-17T08:22:36.962Z","1.2.10-859dae7d874ff71f126ec45e691fa6c897d4f4d9.0":"2020-04-17T08:23:13.702Z","1.2.10-85b9b6b5d2bc051fd84abe36b639c1d0ce5554c0.0":"2020-04-17T08:23:24.255Z","1.2.10":"2020-04-17T08:23:38.649Z","1.2.10-a7fe5d4912204e081b072ed1b66428fccec5a0d3.0":"2020-04-17T08:24:03.584Z","1.2.11-f8c79d5bd55b503f50c8d7f959acabc5deb11b07.0":"2020-04-17T08:24:09.725Z","1.2.11-0c7fe8e2013b10a447130f60b82e46f13fc6ae5e.0":"2020-04-17T08:24:33.133Z","1.2.11-09fb3056fb83f908db0b03d3dc9e261d3616c94f.0":"2020-04-17T08:24:38.278Z","1.2.11-bba406ac585f3a8bc6f74314bbc526921a034244.0":"2020-04-17T08:26:45.578Z","1.2.11-2594669582ab397a3876870cceee8e0822fc6529.0":"2020-04-17T08:27:05.412Z","1.2.11":"2020-04-17T08:27:20.522Z","1.2.12-aeb60c35eb2f48eb8bc85bdf50b6b48ba5da002c.0":"2020-04-17T08:27:36.239Z","1.2.12-4c3e4d5c9a440135830e2735d1fc1f67bd172fa4.0":"2020-04-17T08:28:22.727Z","1.2.12-20e8e5e4c2b7453be11842526938a7f98edaff09.0":"2020-04-17T08:29:54.866Z","1.2.12":"2020-04-17T08:30:22.347Z","1.2.13-c2c011b566deb9a004db2ed9d5b88d0584a43de5.0":"2020-04-17T08:30:54.729Z","1.2.13-e9ff48ad97191b9d8b97c4595a3e4209623a3f63.0":"2020-04-17T08:34:57.442Z","1.2.13-057ad2ec0508029df2f2ae498060cd5d88b11503.0":"2020-04-17T08:52:53.964Z","1.2.13-30eca418757411c0c3ab2f64de98ea4fbaf0f70f.0":"2020-04-17T09:13:02.341Z","1.2.13-2c5cae19633095273c54cd319e9ef32a5df1223f.0":"2020-04-17T09:14:18.251Z","1.2.13":"2020-04-17T09:14:39.504Z","1.2.14-5086410ee3048df6446b0bc102ab8d090e20d2c5.0":"2020-04-17T09:15:11.035Z","1.2.14-a4d3609ff0948cb42e1d9a8fc7a8480350dc815a.0":"2020-04-17T09:22:17.948Z","1.2.14-4fe473bb08c1d9d5834710c43c2e3fd56c9d915a.0":"2020-04-17T15:08:01.299Z","1.2.14-5101751fccff89dee1f207f985759a59e5536485.0":"2020-04-17T15:09:20.805Z","1.2.14":"2020-04-17T15:09:38.806Z","1.2.15-8a989a7bb0d9de41dba662009223a5b6531f21bb.0":"2020-04-17T15:10:14.338Z","1.2.15-9116437540125cdadfe66abef9207e4c93fec006.0":"2020-04-17T21:22:28.891Z","1.2.15-5fa23c56154ee357a0a675d0c866878256dbffe4.0":"2020-04-17T21:23:47.149Z","1.2.15":"2020-04-17T21:24:18.495Z","1.2.16-fa07ea5258e62a6f2f7f2d9968f65bcb9c001862.0":"2020-04-17T21:24:51.752Z","1.2.16-5b3e1887398fe052eb326d90f7f441c38e64f891.0":"2020-04-18T08:24:10.380Z","1.2.16-f26cca8bed39a3824f9510938198b7c506e2a221.0":"2020-04-18T08:28:57.912Z","1.2.16":"2020-04-18T08:29:32.651Z","1.2.17-acd3827c81198927196fa5696dc3ac4ed2861eb5.0":"2020-04-18T08:30:12.119Z","1.2.17-dae9362d93745b179f8a28cecaf5686cd6861a71.0":"2020-04-19T09:30:49.678Z","1.2.17-a1bbeb80c08fbca06d3587449a8c30587184a76c.0":"2020-04-19T09:32:08.316Z","1.2.17":"2020-04-19T09:32:24.083Z","1.2.18-98b7a8f0a949cc75120f3481bf8975db5b4a6e08.0":"2020-04-19T09:32:53.315Z","1.2.18-f1c535b10dfe8ed5230d140866cf56297fb24dec.0":"2020-04-19T09:47:57.854Z","1.2.18-cc22a2e5dcc7cd11d07cd01708489ca55f639a1a.0":"2020-04-19T09:50:01.047Z","1.2.18":"2020-04-19T09:50:06.253Z","1.2.19-5f388723b3aba7c448dd5942e3ec896f243fe523.0":"2020-04-19T09:50:49.405Z","1.2.19-fa9dc5bffb40bb2bbb222b23d744879205d84286.0":"2020-04-19T10:20:39.341Z","1.2.19-8802554c59587b389519129be8af53c014e84269.0":"2020-04-19T10:21:59.967Z","1.2.19":"2020-04-19T10:22:16.698Z","1.2.20-8c5ed8eccf07cf4a862254b328878bf2db6ee6a8.0":"2020-04-19T10:22:45.090Z","1.2.20-0068454f8c979aa2d1c4b2d4a41e96049c72aecf.0":"2020-04-19T22:09:37.240Z","1.2.20-c129fae7caf7b0aa24ef5d8e7b2434114a8f65c0.0":"2020-04-19T22:10:49.809Z","1.2.20":"2020-04-19T22:11:12.974Z","1.2.21-ca6e545fbbd7390b8c8d1eeff15d806ca7dd2b84.0":"2020-04-19T22:11:43.999Z","1.2.21-0e517734d3abf0eb1c15aa305f0e42c49cde9f6c.0":"2020-04-19T22:43:58.190Z","1.2.21-af2cd5cb28dc4af522a158a3f2e71a6773a21a97.0":"2020-04-19T22:45:19.721Z","1.2.21":"2020-04-19T22:45:38.020Z","1.2.22-d513e4d6791c6ab1fab730db25265c5f568a78b3.0":"2020-04-19T22:46:15.800Z","1.2.22-004c0961a35dd4658bcb43abac901c2018aea514.0":"2020-04-20T16:33:38.117Z","1.2.22-c68820e92284166cb2fbd401b80cc115c9e2291e.0":"2020-04-20T16:34:59.280Z","1.2.22":"2020-04-20T16:35:19.311Z","1.2.23-63fd1a6b7eeb1c966cca387c7fe961ada6a74b1f.0":"2020-04-20T16:35:52.920Z","1.2.23-c6c2d54e1e6ad46a404e504c5c63900427e2c0de.0":"2020-04-20T19:41:04.005Z","1.2.23-7bb0761f8532984d5f54cfa8f021506f2abebc85.0":"2020-04-20T19:42:18.985Z","1.2.23":"2020-04-20T19:42:41.984Z","1.2.24-4f96af794fbaee20b228d670e0df194189850d4f.0":"2020-04-20T19:43:12.178Z","1.2.24-4c2101a8a05b60c3ecad6c68c1b893d7c02812f3.0":"2020-04-20T20:35:33.685Z","1.2.24-5418b9df7fe8761af0be5404658c40c617aceaef.0":"2020-04-20T20:36:57.946Z","1.2.24":"2020-04-20T20:37:26.937Z","1.2.25-2fb5fad5cabe44c95fff540608a06ae896f32dcf.0":"2020-04-20T20:37:58.884Z","1.2.25-922c8e91452bbe1214363c34694acc21cbcf2266.0":"2020-04-21T07:59:08.380Z","1.2.25-de1e5e511a46df0124e2399cd1fc5acdf728c84a.0":"2020-04-21T08:00:22.776Z","1.2.25":"2020-04-21T08:00:39.666Z","1.2.26-cbd0330f84bc9cc237af62e74b1cc76fa6d4d92e.0":"2020-04-21T08:01:09.858Z","1.2.26-45116d564650214bc9140cf6cf5fb2c29b60733a.0":"2020-04-21T12:22:27.536Z","1.2.26-0fa5d53aab81e1209c6ab72fe3891ddda858a2a2.0":"2020-04-21T12:23:30.103Z","1.2.26":"2020-04-21T12:23:47.787Z","1.2.27-416fb9b9592716aba2b1c7785b2130dd91bad73a.0":"2020-04-21T12:24:20.412Z","1.2.27-9286989923c18adfeeb80ac5df6cc9d7b6144c84.0":"2020-04-21T17:16:53.306Z","1.2.27-c1bb7fed813d6f36b63d5aced12050db5a3b07f7.0":"2020-04-21T17:18:10.510Z","1.2.27":"2020-04-21T17:18:27.298Z","1.2.28-98d09fee71d9374e623be97394cbf333e0719f30.0":"2020-04-21T17:20:04.750Z","1.2.28-e454fc26c90f666447be871d4cca78ccdfc246ff.0":"2020-04-21T17:40:42.492Z","1.2.28-87285fa8ec6840d0b562f0083a13c286c47bef5a.0":"2020-04-21T17:41:58.362Z","1.2.28":"2020-04-21T17:42:18.520Z","1.2.29-a61d98d9b2c8add7fc767cffa34980d904e9a3fa.0":"2020-04-21T17:42:52.310Z","1.2.29-64a35457f184fbd2132686cfcbd07121d6a2b575.0":"2020-04-21T19:48:00.469Z","1.2.29-8b5d6e976f987ea995cdb588a393238451e73fba.0":"2020-04-21T19:49:13.978Z","1.2.29":"2020-04-21T19:49:35.159Z","1.2.30-18613cd002163e8e76488f3dc8b51374527b08b4.0":"2020-04-21T19:50:07.313Z","1.2.30-531c28738ea1eaf921516b43c473676f65eb3532.0":"2020-04-22T02:35:57.516Z","1.2.30-2013fafa98862a618378773dd99b4a69110b67df.0":"2020-04-22T02:37:09.803Z","1.2.30":"2020-04-22T02:37:28.939Z","1.2.31-2c1df340931789318f2d14887f4fa5cb225aa46a.0":"2020-04-22T02:37:55.738Z","1.2.31-15ea6b3d7b6b195ca1889bc45016381ae7a7a224.0":"2020-04-22T07:57:12.842Z","1.2.31-c907d595805f90e78b0eb5532cdbf7b6fa3a294a.0":"2020-04-22T07:58:37.127Z","1.2.31":"2020-04-22T07:59:01.241Z","1.2.32-8a907967b7960137842e613c57d3b9c87d8a65d6.0":"2020-04-22T07:59:32.727Z","1.2.32-c14d0da00662a73119b85bfaaea925da11dd4c10.0":"2020-04-22T09:05:00.016Z","1.2.32-f13c187ebb24b6cdb42956059cd0ebe7cd6fb413.0":"2020-04-22T09:06:49.672Z","1.2.32":"2020-04-22T09:07:04.902Z","1.2.33-4c19bd30f30a0ac912a1e3c7630681f107a67c54.0":"2020-04-22T09:07:33.729Z","1.2.33-6efc1b014d3b27510b8a5f8bcd41fd746b5f878b.0":"2020-04-23T10:44:25.224Z","1.2.33-00cb3e4719fc0abc869678402baef056339f51e4.0":"2020-04-23T10:57:40.860Z","1.3.0":"2020-04-23T10:57:55.841Z","1.3.1-ec21c4dece300cdb9507864fa5738b50e2945397.0":"2020-04-23T10:58:24.744Z","1.3.1-e496ae249e8b378e4a88aefac77b333a02092b3d.0":"2020-04-23T14:22:22.814Z","1.3.1-5cae974fcaf7fabd4e34e18e88fd4568b44e7360.0":"2020-04-23T14:25:37.502Z","1.4.0":"2020-04-23T14:26:20.605Z","1.4.1-c7597f2aa084ddb874b764c3dd6ebe90f4699841.0":"2020-04-23T14:26:51.858Z","1.4.1-9b0ed6624426ec123a797ec49546a1f2518c6ed0.0":"2020-04-23T15:49:52.709Z","1.4.1-83fbf417ab43e7a92f8ba996d6b7bbcee10d1988.0":"2020-04-24T07:06:04.267Z","1.4.1-7058b0ba9a2fe25bd1158b46deb4c612c09952a4.0":"2020-04-24T07:08:29.591Z","1.4.1-2790bf1298ed68b19fb339dd635d5e1609432326.0":"2020-04-24T07:18:43.620Z","1.4.1-d6194a47b6aa0be87e6d5ce67d630f0cf863135d.0":"2020-04-24T07:22:44.470Z","1.4.1-c1a532a9a376f829057d10ec760fd2e0b35b1100.0":"2020-04-24T09:07:17.868Z","2.0.0":"2020-04-24T09:07:37.448Z","2.0.1-dd8a5d5430eb1a65904b735c652d324c963fe817.0":"2020-04-24T09:08:12.040Z","2.0.1-5e01d93e0c214405686df7c471b35cc954a31ebd.0":"2020-04-25T03:23:36.911Z","2.0.1-93709ebe0ad93d0596585db9fcf4cadb8ba7a5de.0":"2020-04-25T03:25:14.097Z","2.0.1":"2020-04-25T03:25:30.035Z","2.0.2-0330538ef7ddf3a0a9d70d6f45f0f86741d3b4ac.0":"2020-04-25T03:25:58.972Z","2.0.2-5ba6757e04742428c6b92acd7b3f637574e1d8a7.0":"2020-04-26T05:59:22.164Z","2.0.2-f92bbc24b785e739500e15387e87611cdec9cb2b.0":"2020-04-26T06:00:49.271Z","2.0.2":"2020-04-26T06:01:02.963Z","2.0.3-c213e43371b595532edcce993c129fa0f4d08ff3.0":"2020-04-26T06:01:37.355Z","2.0.3-79df4ca274bdd541b9bd880c2d6147866dd9e23d.0":"2020-04-26T16:50:57.557Z","2.0.3-9e60c6e04aef42cc2bca5b4e704bcb6d0ceddfde.0":"2020-04-26T16:52:31.262Z","2.0.3":"2020-04-26T16:52:46.850Z","2.0.4-de51af16a7d8877fcb38b1116bbdd7d47b6a6c60.0":"2020-04-26T16:53:26.314Z","2.0.4-18d2a6a5db6fc5c9d8609c5227c5075804a64d30.0":"2020-04-26T17:59:59.180Z","2.0.4-45df00f32829b6631dc5a3da153e82c9d0ad1c8c.0":"2020-04-26T18:01:22.643Z","2.0.4":"2020-04-26T18:01:52.371Z","2.0.5-a49e25c1d8624a009b756da28f1e4815988ce9c3.0":"2020-04-26T18:02:28.920Z","2.0.5-d0dfcd8228fb84676a4440196d6daac163527aa3.0":"2020-04-27T19:47:22.931Z","2.0.5-c2b33a19dbe9528ff97f11d46e3828046f68a08b.0":"2020-04-27T20:43:49.126Z","2.0.5-15aec9eece02b10807e5d4c2eaac4012e10fd6e3.0":"2020-04-28T13:32:07.855Z","2.0.5-4878830d3373c569178abe502fc424ee02816ed1.0":"2020-04-28T16:04:17.192Z","2.0.5-a7423447009d24f2edc6c521686d88164890d0c9.0":"2020-04-28T19:54:12.772Z","2.0.5-e5bdfe1966ad85d1e5fbdb80ebd8f11b097abba8.0":"2020-04-28T19:55:57.787Z","2.0.5":"2020-04-28T19:56:10.993Z","2.0.6-e15140334d84ca31904ac1381053154dffd881fb.0":"2020-04-28T19:56:50.235Z","2.0.6-ad7b87ccabf6bf896a8eeb725395dfa6176f8fd0.0":"2020-04-28T19:57:53.119Z","2.0.6-175bc750c943abd58f87c6979e408b0962600842.0":"2020-04-28T19:57:59.956Z","2.0.6-6da5a3aedfa826c0688101b99ea58e00282221c9.0":"2020-04-28T19:59:11.344Z","2.0.6":"2020-04-28T19:59:36.257Z","2.0.7-5b922f20ea4ae1fb5c790419c415c7966a27f2c6.0":"2020-04-28T20:00:10.142Z","2.0.7-c8c9d5f41fec4e6b60d0dc3d614ccd45e33f770a.0":"2020-04-28T20:01:38.339Z","2.0.7-6bbf0e0c323ad895842c18622c46c415df61f934.0":"2020-04-29T11:01:50.254Z","2.0.7-405c3ebd5456e94925daff4e7be9591a5caf0545.0":"2020-04-29T11:03:17.599Z","2.0.7":"2020-04-29T11:03:21.727Z","2.0.8-97d04290f93c8e5b4e61f0965ad8e34abf19f9a2.0":"2020-04-29T11:03:58.238Z","2.0.8-c1e382a4a05fef862238ba19fdae066bfe0b6995.0":"2020-04-29T11:05:12.609Z","2.0.8-bb388391e335bbe0990340c9ee1dc1678ea212a4.0":"2020-04-29T16:09:16.828Z","2.0.8-c4ebc95b639e31249d08b1f2268d1c31f0162466.0":"2020-04-29T16:10:16.126Z","2.0.8-cc2f29b7e4e3418ef4601736a52c6e43839ad2c0.0":"2020-04-29T16:15:03.345Z","2.0.8-9d54a4fd3a3c70219910ab0eee5cfcd75446d2d2.0":"2020-04-29T16:16:45.297Z","2.0.8-8435ad5e8e6fbc761d29def61c31d4854a4b5d03.0":"2020-04-29T19:08:18.440Z","2.0.8":"2020-04-29T19:08:24.724Z","2.0.9-1e7b65804f9dcafc781bd79375b77a7dc0dd4fa9.0":"2020-04-29T19:09:01.985Z","2.0.9-66baef64ef64ea1ab4dd0e526a44d90738683219.0":"2020-04-29T19:10:09.921Z","2.0.9-e7118401ab4e1efb9d4acca06b194396bc30b573.0":"2020-04-29T21:56:19.634Z","2.0.9-5810567702b40ce66e9e929d4bd2760573434f8d.0":"2020-04-29T21:57:51.363Z","2.0.9":"2020-04-29T21:59:26.889Z","2.0.10-e21a8d2e61dcf287b2e66c1fcc0b1fe642a23fe8.0":"2020-04-29T22:00:04.118Z","2.0.9-fd853343aec556daafe2fc96c278013d2231f30b.0":"2020-04-29T22:00:08.817Z","2.0.10-3b69fa8e8b6bff4cbe57d3e01b00625f6cd2a0f4.0":"2020-04-29T22:02:23.531Z","2.0.10-8f3bc082808df4af078f161f7ca357429fe66aaf.0":"2020-04-30T11:43:40.535Z","2.0.10-010f1a36a93322a7e08e70908ff0774b6b563961.0":"2020-04-30T11:45:31.129Z","2.0.10":"2020-04-30T11:45:51.391Z","2.0.11-357c2bfefb36e753fd41c75c0ae73830fe93cd1a.0":"2020-04-30T11:46:23.248Z","2.0.11-f556a966b26e65c3d77fbc973891d6e41f2f506e.0":"2020-04-30T11:47:47.364Z","2.0.11-804c1af648e48e004b2e7ada2ca327a3bf2e73ac.0":"2020-04-30T15:03:45.878Z","2.0.11-9ff57033f41bd0cf3af72269bfe0f3c59aea9aa2.0":"2020-04-30T18:28:56.600Z","2.0.11":"2020-04-30T18:30:41.674Z","2.0.11-696dfb999803d57b9196b7db8b0515217988506c.0":"2020-04-30T18:31:23.760Z","2.0.12-db9a06f7499073dece2cfa947b8d191e883c0e18.0":"2020-04-30T18:33:07.848Z","2.0.12-f62f87293fc2edeafc1b53f124249b378be90444.0":"2020-04-30T18:34:28.449Z","2.0.12-5ad039e719f8804d1800eed4b73a8de41e3259fd.0":"2020-04-30T18:35:36.438Z","2.0.12-ff346aedd1e6596080831b01a5bc8a187d72ecd3.0":"2020-04-30T22:23:57.285Z","2.0.12-7bd73ba70e2a39ad00abb2a3b6a8e536a3656ec1.0":"2020-04-30T22:25:13.198Z","2.0.12":"2020-04-30T22:25:35.264Z","2.0.13-23d295a95d5c8411b11cddc4f953452406e6d63b.0":"2020-04-30T22:26:10.315Z","2.0.13-8f41d45c936337678f08c3b7a82948d4a6d51cc4.0":"2020-04-30T22:27:21.999Z","2.0.13-21db087816385e29bd0f8b3e2ec06d5a5317ef86.0":"2020-05-01T04:16:55.782Z","2.0.13-4fdcf81a1d895589f9e4b3d77b5d810b356abc4e.0":"2020-05-01T04:18:34.088Z","2.0.13":"2020-05-01T04:18:50.166Z","2.0.14-547488ee1d418e97884879edee4fd5650cc40501.0":"2020-05-01T04:19:22.583Z","2.0.14-812eff788affffca89cca9b20e2031be46e5bf96.0":"2020-05-01T04:20:37.353Z","2.0.14-922b926a62642263efaacf02c59a0c5930b9b86e.0":"2020-05-01T05:20:51.101Z","2.0.14-4cefb351abf7dc9effed1cf8c7826e432fde0e6c.0":"2020-05-01T09:57:29.063Z","2.0.14-fcff967928e991a325de2078be27d5440db8a995.0":"2020-05-01T12:36:11.384Z","2.0.14-a57cdf5bfa49ecb4a21a1d353e841269b99fae82.0":"2020-05-01T13:33:36.619Z","2.0.14-1ff45add5afe2390be92a324ae4a117c8b1919d0.0":"2020-05-01T13:49:58.189Z","2.0.14-5610bae6ec0238800fe96d9c6a2ea7946eb867cf.0":"2020-05-01T13:54:57.110Z","2.1.0":"2020-05-01T13:55:23.328Z","2.1.1-b4d6271432c06e4838c69b464adf17a46a6375a2.0":"2020-05-01T13:55:54.800Z","2.1.1-b1f7254237039bf696b1cf0136f87376f7420488.0":"2020-05-01T13:58:34.242Z","2.1.1-bcd2f948298d29e161a06864e536d2e94d024e22.0":"2020-05-02T08:28:39.602Z","2.1.1-b3a836abd0cd35d47461095121017f9934007992.0":"2020-05-02T08:29:49.631Z","2.1.1":"2020-05-02T08:29:54.137Z","2.1.2-a0133e20e7ef0d07372d7983992fd1e1d89025b0.0":"2020-05-02T08:30:27.062Z","2.1.2-e9f6d4d4a926248fe831c36e88d4d01f1522fe4e.0":"2020-05-02T08:31:53.130Z","2.1.2-7a094f47bc359fc7e95cb1f6fc7415356d48673a.0":"2020-05-03T05:14:44.317Z","2.1.2-81b1eca5cbd095388ce687a632b00e279a0abcad.0":"2020-05-03T05:15:36.506Z","2.1.2":"2020-05-03T05:16:24.615Z","2.1.3-8ab3b166b6a2cb829041410ae5bcd9219eb62080.0":"2020-05-03T05:17:00.487Z","2.1.3-d0a64668a4b7eb954c45afda5f270fad732ad962.0":"2020-05-03T05:17:59.894Z","2.1.3-06a4574bb53b7e322bafd42fdd5e43179ee94948.0":"2020-05-03T07:03:30.347Z","2.1.3-aedad060e89780ae952cd12546d338d3555981ce.0":"2020-05-03T07:04:53.146Z","2.1.3":"2020-05-03T07:05:11.184Z","2.1.4-61afe38e31caa779910b7020cdc5aa373213fddd.0":"2020-05-03T07:05:44.474Z","2.1.4-53f5573753e0a46145c91826334277edf4955665.0":"2020-05-03T07:07:20.355Z","2.1.4-45920c4da16587bd0d124d53cc80a9f3be8e790a.0":"2020-05-04T10:08:48.910Z","2.1.4-5b617effac1243a659e58c51e564e2924861feb5.0":"2020-05-04T21:24:41.011Z","2.1.4-37b68902a83fe19057887e2ee779e6c098faab26.0":"2020-05-04T22:37:27.730Z","2.1.4-8abe751af8b6e27320d4199125b25bd34b021111.0":"2020-05-04T22:38:57.260Z","2.1.4":"2020-05-04T22:39:05.201Z","2.1.5-3d5fc3bcaebb74eca0f3eb59fcffce5b61d605b1.0":"2020-05-04T22:39:38.828Z","2.1.5-f9910956e80fda5ec8640eaafbef70443c8402e8.0":"2020-05-04T22:41:10.871Z","2.1.5-d5d0fb15bead23aa27433272f3360581a13ac920.0":"2020-05-05T08:54:35.503Z","2.1.5-4a36ba286144c8315730f9d87bebe673add2cc81.0":"2020-05-05T09:43:13.470Z","2.1.5-7fd6cc88efa4158041e5a2264ea38aecc4bf77cb.0":"2020-05-05T09:45:09.798Z","2.1.5":"2020-05-05T09:45:37.002Z","2.1.6-57a1346203648ef99316d56f0c5eb0537bbdd3c7.0":"2020-05-05T09:46:19.274Z","2.1.6-1d4e464b81707d501446f594f4ebcf0d02987617.0":"2020-05-05T09:47:22.283Z","2.1.6-9ed284b74f7c0219b857d1b044fff0acc1e43e0c.0":"2020-05-05T09:49:25.219Z","2.1.6-23e94be2e704ada37ceb326a69473f9083840438.0":"2020-05-05T12:22:09.328Z","2.1.6-ffbb15a0f306f68b2229326e6d169f6a76d42334.0":"2020-05-05T12:23:31.069Z","2.1.6":"2020-05-05T12:23:54.278Z","2.1.7-49642b089de9b2bbfff1be8c060e242f01a125a4.0":"2020-05-05T12:24:36.693Z","2.1.7-5f4ec9a77a82c7e4fa8a1772e0bc6a6286557dc3.0":"2020-05-05T12:25:55.558Z","2.1.7-e801c04a3862f4df9c16841b5041ce90a8384b43.0":"2020-05-05T13:58:07.097Z","2.1.7-5898f14f1b2e74df008716fbb69dd40c3aa6429d.0":"2020-05-05T19:11:46.781Z","2.1.7-64ff60011bfdb68234d6d209016c40a77cf7e7f0.0":"2020-05-05T19:13:05.780Z","2.1.7":"2020-05-05T19:13:58.547Z","2.1.8-3152ebd5da166b0aa6b37a282a82f49e243d66dd.0":"2020-05-05T19:14:32.952Z","2.1.8-fc3c3defb95df0fcaa4eb53ae42951a51ee8b9ee.0":"2020-05-05T19:15:20.300Z","2.1.8-13cd163b661de9b186363a3ad72b3f5e97b6caf7.0":"2020-05-05T20:56:51.983Z","2.1.8-f4dadcc4d8bc3f818963571d1b8620e525ae99da.0":"2020-05-05T20:58:09.782Z","2.1.8":"2020-05-05T20:58:32.343Z","2.1.9-a22c36ad513270c6c6e21984b7cc7da9523bfde1.0":"2020-05-05T20:59:10.143Z","2.1.9-064ad8484f932b3456469cec3e815b067f75e54c.0":"2020-05-05T21:00:26.583Z","2.1.9-e698fc51b7883642ac77c81118eaba57a8522cbd.0":"2020-05-06T09:04:12.112Z","2.1.9-54847b8739f35df085be18b69fc7b4cc271efaeb.0":"2020-05-06T09:06:47.719Z","2.1.9":"2020-05-06T09:07:06.026Z","2.1.10-dc33612c23f2648f84436c5fd4e1bcc0de1cb052.0":"2020-05-06T09:07:39.566Z","2.1.10-a7f163dd06580b4e0dac4c1adecc821e6451e1da.0":"2020-05-06T09:08:43.844Z","2.1.10-9196afb4b1b62eb0545e51aa8fcac0d8aabcdaab.0":"2020-05-06T13:25:25.727Z","2.1.10-d3945ea6a9462f9a021e90a3f804afb971f3388f.0":"2020-05-06T15:21:56.416Z","2.1.10-9733326839d315c20bc6bcfd25325944d7c832c9.0":"2020-05-06T15:23:19.848Z","2.1.10":"2020-05-06T15:23:36.714Z","2.1.11-388e86f779f1d18c8db05f8809d77d5deefcf409.0":"2020-05-06T15:24:11.521Z","2.1.11-8217a8ab7646de86fffa7c95129dd74ae02179de.0":"2020-05-06T15:25:29.104Z","2.1.11-86aa3584a71166eb9299150c9dd2a46ba0897e59.0":"2020-05-06T21:37:10.271Z","2.1.11-5de1c79c51b236443842d04d2d1dbc40d4d3ad2b.0":"2020-05-06T21:38:35.364Z","2.1.11":"2020-05-06T21:38:50.888Z","2.1.12-ced28a5e1af292e1594b9faa25ebddd8db846f26.0":"2020-05-06T21:39:22.918Z","2.1.12-6298a46232289b4953e58e7758c5d749588d2552.0":"2020-05-06T21:40:37.234Z","2.1.12-bfdf3526e40cf13b13f63c810abd6ce8ba7bae83.0":"2020-05-07T17:38:17.579Z","2.1.12":"2020-05-07T17:40:06.299Z","2.1.12-e0366aa647f5ceb0f807cfb51736e1462cf1f579.0":"2020-05-07T17:41:04.890Z","2.1.13-e5c089df7a8ba52e8bdba33a7a765c85fb358a4f.0":"2020-05-07T17:42:22.079Z","2.1.13-01b1a4ce8b622c80eea4af94077ab99cbbcf2634.0":"2020-05-07T17:43:10.203Z","2.1.13-ef27bc5534a03944848b2631bf63e0b7193829ed.0":"2020-05-08T07:10:54.187Z","2.1.13-da18b3f772fd688e4267a0e58921144049613bc7.0":"2020-05-08T07:22:42.725Z","2.2.0":"2020-05-08T07:23:15.794Z","2.2.1-2f0f5382e19656fa6deb00953600450c0b6e1d82.0":"2020-05-08T07:23:47.556Z","2.2.1-3469337795a3cc5ffb85a6aebef5fee820a4110d.0":"2020-05-08T07:26:13.333Z","2.2.1-73cb0f750f49fa9527964707bd158e585ccf1a07.0":"2020-05-09T00:14:21.723Z","2.2.1-33ed86cc9909ada93a05070f0cce19ac664da415.0":"2020-05-09T08:59:11.214Z","2.2.1-66c43034c8f47dc7ea6fec5cb5e8dc66e9366d2c.0":"2020-05-09T09:00:37.265Z","2.2.1":"2020-05-09T09:00:58.770Z","2.2.2-df7e17c295b56a25f53eb5ca3daf33349b0a4dde.0":"2020-05-09T09:01:36.267Z","2.2.2-4a80bb324559f56abf1baa0297d1470bebc2a1b2.0":"2020-05-09T09:02:37.714Z","2.2.2-5f807b4c157d57c07800b9cd2bf337d4fa873a3e.0":"2020-05-11T08:16:08.396Z","2.2.2-4c63e24e8186917a7abbf71551441dbe1bebcbd0.0":"2020-05-11T20:49:37.570Z","2.2.2-2755e2d4260b7cfa692d0cf4039646d24ff4f09a.0":"2020-05-12T20:44:47.464Z","2.2.2-31993e694344574f93777a8510f721ce4692fc60.0":"2020-05-12T21:27:20.629Z","2.2.2-ef0ef96ff1673979d2840712f374bf0d43b51734.0":"2020-05-12T21:28:38.283Z","2.2.2":"2020-05-12T21:28:56.735Z","2.2.3-5c37b02942998f971c92f642922e29e988665164.0":"2020-05-12T21:29:41.311Z","2.2.3-7e59761ba4f6238248aa3439e0519240435e103f.0":"2020-05-12T21:30:38.324Z","2.2.3-71c9698cc105408ca332ceee94a22ed1429febc2.0":"2020-05-12T22:10:46.351Z","2.2.3-e30f5757785ead2b6d1ee26c7e362656cc0b3782.0":"2020-05-12T23:06:54.771Z","2.2.3-fd18c41e93cc6ef39020f70089605de162d7fcf1.0":"2020-05-13T00:01:30.790Z","2.2.3-51764c2bb42b506d5f815616939d62af740eec9d.0":"2020-05-13T00:02:52.941Z","2.2.3":"2020-05-13T00:03:10.732Z","2.2.4-370d9897153c847499054c76bfaa5aa6e27c73ce.0":"2020-05-13T00:03:49.105Z","2.2.4-5040a3440f20a3dac98a29210a3e3e51f311860d.0":"2020-05-13T00:05:10.089Z","2.2.4-769ebe6e97900e80d1b1f9f2bf4121974620af81.0":"2020-05-13T00:39:48.067Z","2.2.4-0dbc0c5a5bf78d7a839b76713a5dc4e684cb26b9.0":"2020-05-13T00:41:08.577Z","2.2.4":"2020-05-13T00:41:19.147Z","2.2.5-8c27af05f0a55404e405b1e702c915e8b41e05c7.0":"2020-05-13T00:42:02.690Z","2.2.5-a6aba05191f40beadd8459e2ed9000a2b41a38ae.0":"2020-05-13T00:43:15.128Z","2.2.5-c536bc45210ca5aca87e8dcb8675a0b481f1bc34.0":"2020-05-13T05:30:44.080Z","2.2.5-4d196d6231a2ea98a1da82bda9feb2de1ced6bf4.0":"2020-05-13T05:31:47.385Z","2.2.5":"2020-05-13T05:32:06.057Z","2.2.6-663fd77dd6ddcf1d68fa6232c5ffdd26106239aa.0":"2020-05-13T05:32:51.820Z","2.2.6-a60572e45661d94398f89068f1dcb84b765c565f.0":"2020-05-13T05:34:04.017Z","2.2.6-0888ff28c81c050415469343ec2cf434e37c3400.0":"2020-05-13T07:38:37.158Z","2.2.6-0f6372d5f9e302c0169e749573ed957f529d7a71.0":"2020-05-13T07:52:32.283Z","2.2.6-ecec3bfb03f6ea71449c59cdd687db32d957f203.0":"2020-05-13T07:55:23.605Z","2.3.0":"2020-05-13T07:55:50.446Z","2.3.1-44b5c636942cb0a5a80e521b219ef42b212e5357.0":"2020-05-13T07:56:30.888Z","2.3.1-4608674cb2f727017cc06b7c6f20b51e65f4f5bc.0":"2020-05-13T08:00:25.702Z","2.3.1-024d8c70ec37b624772f48eb42efdd6d8b2eb8cc.0":"2020-05-13T08:51:09.720Z","2.3.1-58205f12694e5330d8b340762f6ce0c08dbf8e4e.0":"2020-05-13T09:43:21.756Z","2.3.1-2a10b3b3a94e263402a8b208abf9e9dce4acdf5f.0":"2020-05-13T09:50:53.002Z","2.3.1":"2020-05-13T09:51:16.714Z","2.3.2-7a155d850099bc220ee2aa49ac2f78b871745a47.0":"2020-05-13T09:51:57.676Z","2.3.2-371852d8985c4ab2ccd73897b18fd893203cb641.0":"2020-05-13T09:53:49.044Z","2.3.2-6f276a09d985308229042bc496f9695e31601598.0":"2020-05-13T09:58:07.377Z","3.0.0":"2020-05-13T09:58:30.186Z","3.0.1-33ea6cb07ddac8b1c16d8ba03c6f74c4fc8f6b69.0":"2020-05-13T09:59:08.038Z","3.0.1-9baa925518a8643c7b61398c6db1048f053100e2.0":"2020-05-13T10:22:49.146Z","3.0.1-9475b467c964c5f90f8d49b812a45f851547b168.0":"2020-05-13T18:55:19.511Z","3.0.1":"2020-05-13T18:55:46.304Z","3.0.1-e842aaa2b9ff6f831391b17bae5f90550e7a0a0e.0":"2020-05-13T18:56:51.399Z","3.0.2-cc90e06c3687749534c97bc61a128de5f10625a5.0":"2020-05-13T18:57:42.494Z","3.0.2-7697acc5e02c20de071c567e1cb233d4511e8b13.0":"2020-05-13T18:58:24.812Z","3.0.2-54873ce35e3a12eae288e0d3839eb6804f379d40.0":"2020-05-13T19:14:46.060Z","3.0.2-ee6a4a90050cd3af7b4c65863132c8a861f726c9.0":"2020-05-14T09:05:24.821Z","3.0.2-0306e54bd10d53d855cb0cf46eaf1e5b9cb609e3.0":"2020-05-14T09:22:43.457Z","3.0.2-1fc86030e1c320a58a9b6d19eda1b1a29252ec0c.0":"2020-05-14T10:22:36.652Z","3.0.2-888c2c1910f6f15f7eb5cc60a365830f7d65e250.0":"2020-05-14T10:37:21.443Z","3.0.2-335c2178000c35b0f98336687066faec928e59c7.0":"2020-05-14T10:39:21.419Z","3.0.2-28dc6351a5ebcec669e4a8b0cf4444c2cb37dad5.0":"2020-05-14T14:26:30.017Z","3.0.2-6c9e72d85c6389275a257755f0edc9db5199723e.0":"2020-05-14T14:36:42.124Z","3.0.2-aa966ce2817078c0c2c307f12cc68782eb7d66e3.0":"2020-05-14T14:38:22.148Z","3.0.2":"2020-05-14T14:38:43.089Z","3.0.3-7c8eef260c5947cf0118b91dd4d0f8c8e7be6684.0":"2020-05-14T14:39:23.497Z","3.0.3-080e11a2c8c0a5c8876fe87c15429a81ea4e6016.0":"2020-05-14T14:40:38.231Z","3.0.3-27a7c1d70b9899d350e0b2b88ba1f532fe0ae189.0":"2020-05-15T15:58:20.050Z","3.0.3-6dc32d8a061841fa34814b5b4e2d9cbdf7f27781.0":"2020-05-15T15:59:46.217Z","3.0.3":"2020-05-15T16:00:27.718Z","3.0.4-326508a52f8a8f7701f19618988c97b310dfeb18.0":"2020-05-15T16:01:08.323Z","3.0.4-f80533087b14c1f0aa8a687a417188f979567935.0":"2020-05-15T16:02:00.589Z","3.0.4-e1d644f49685252d8153ab414f46430e5a4ea1cc.0":"2020-05-16T09:03:14.340Z","3.0.4-34b29eb235e5a8374932ee65873a0f7c824bd11c.0":"2020-05-16T10:15:05.608Z","3.0.4-24527a376a7f5102c353d4512ed3e1d51e1ace6a.0":"2020-05-16T10:59:02.485Z","3.0.4":"2020-05-16T11:01:13.976Z","3.0.4-7f5f9ff60f93d9cb0699d40479ad77ec02fcab95.0":"2020-05-16T11:01:34.362Z","3.0.5-60804d357b0f6da07268c5791c569292068442b5.0":"2020-05-16T11:03:04.706Z","3.0.5-0a62018e554f2729cc0e750f34b437a2fc55842b.0":"2020-05-16T11:04:04.040Z","3.0.5-c064d86841c2226cd098a5fe6a9680db3b860ce0.0":"2020-05-16T21:53:32.763Z","3.0.5-86e43d5346cb96704514607356cdba59a516f4ad.0":"2020-05-16T21:55:02.324Z","3.0.5":"2020-05-16T21:55:34.290Z","3.0.6-1ec5805ab0798e45ba836f43b407e8e8d2e71254.0":"2020-05-16T21:56:37.747Z","3.0.6-83b21fcae932e46539a853fb9dfb568d3fea656f.0":"2020-05-16T21:57:13.034Z","3.0.6-7525a30d71ac85782e23bab0bce0e6a1cb7abb65.0":"2020-05-17T09:31:51.915Z","3.0.6-217d955502511cc2725abf7e4a8e443e85c2b4ab.0":"2020-05-18T18:22:17.142Z","3.0.6-62fbe12b82739d29ddaf12a122553448bc63a75a.0":"2020-05-18T18:24:17.055Z","3.0.6":"2020-05-18T18:24:38.735Z","3.0.7-5b01cf55697d7bb3d9a757204c732d3b5624a511.0":"2020-05-18T18:25:22.751Z","3.0.7-a59ac2b24baf1e7f245ee4790ba9ffdbe0c95a17.0":"2020-05-18T18:26:31.309Z","3.0.7-87987dc4a4d1c661c00425608c979c07ce8c9a55.0":"2020-05-18T18:27:55.605Z","3.0.7":"2020-05-18T18:28:24.797Z","3.0.8-dc531815d1d12b8c97f905afd1cc9f2ac6a39019.0":"2020-05-18T18:28:51.342Z","3.0.8-f981c2ba793515a6a5ef891ca925eb6c033b32f7.0":"2020-05-18T22:51:33.428Z","3.0.8-2fe65981da88adeedb63265e16055190e0b9fd3a.0":"2020-05-18T22:52:30.551Z","3.0.8":"2020-05-18T22:52:48.806Z","3.0.9-592924bfcd582acdb9bf541752479f60c3474b14.0":"2020-05-18T22:53:26.794Z","3.0.9-f9d4ba313ebbb7feed1fb141aa745a3c6db954c4.0":"2020-05-19T00:08:35.672Z","3.0.9-bfc1310687339547afc4324c41f9cb2fd3dad9f0.0":"2020-05-19T00:09:50.193Z","3.0.9":"2020-05-19T00:10:23.095Z","3.0.10-936e5e80672b855810bc598d47c207a9db1d3968.0":"2020-05-19T00:11:16.407Z","3.0.10-bc6669ce34f5736610e9a9013379c20758dd5b5f.0":"2020-05-19T01:50:55.712Z","3.0.10-3078f4b9e68559a64f46cc5651683b9783848dae.0":"2020-05-19T01:52:18.561Z","3.0.10":"2020-05-19T01:53:37.863Z","3.0.11-263c4635353f78770c768fa8e766578baaa2805d.0":"2020-05-19T01:54:20.699Z","3.0.11-de92bac5bdfddf3ac79c627d795b47325d390156.0":"2020-05-19T19:46:40.069Z","3.0.11-de3fb65e0157647752d98397ab67e420da68b597.0":"2020-05-19T19:48:07.000Z","3.0.11":"2020-05-19T19:48:28.074Z","3.0.12-4a299a8091e14af01be52f5af6acc21ed5ae15fe.0":"2020-05-19T19:49:10.538Z","3.0.12-057e701d4b053695af852661a42daca111eaa2ce.0":"2020-05-19T20:49:05.650Z","3.0.12-1d07a86f0d049fefd822f8d7fef4e36a304b5605.0":"2020-05-19T20:50:02.119Z","3.0.12":"2020-05-19T20:50:17.962Z","3.0.13-e012040e8f800ca9c989c23e68cc107c4ac41915.0":"2020-05-19T20:51:02.848Z","3.0.13-b49ded39b4d84a2cc10fa809795be021eaa228bd.0":"2020-05-19T22:23:25.432Z","3.0.13-e678f5cac18252054196c2fffe590445979d7890.0":"2020-05-19T22:24:44.194Z","3.0.13":"2020-05-19T22:25:42.030Z","3.0.14-3c8de9e6c13e87e79f3f4a70f021ae454b7b3443.0":"2020-05-19T22:26:16.396Z","3.0.14-73bad6842e96f88fab35e563d2edbb4508fcba31.0":"2020-05-19T23:52:36.530Z","3.0.14-cbc5b9fb2f94f804142219d19f279d79988c9c3b.0":"2020-05-19T23:54:14.244Z","3.0.14":"2020-05-19T23:54:36.819Z","3.0.15-92091b2e4dacbd3effd153de3ee8bd05fefc4a6e.0":"2020-05-19T23:55:21.445Z","3.0.15-f3038a9474ec13d1870ecb9e4c9841d3cd64460e.0":"2020-05-20T00:45:13.088Z","3.0.15-8f65c05be854ebaf5a421e51675cc93b2fc2fdac.0":"2020-05-20T00:46:28.282Z","3.0.15":"2020-05-20T00:46:38.885Z","3.0.16-d68fcb4377046cae97179558685c192fc4afdd36.0":"2020-05-20T00:47:46.193Z","3.0.16-7e93095265b5388f4e74b7d2e6a96ab1164fdda7.0":"2020-05-20T01:04:46.996Z","3.0.16-78174ae085a080ba1068902ae9640bade3e8bf54.0":"2020-05-20T01:05:06.237Z","3.0.16":"2020-05-20T01:05:34.196Z","3.0.17-b641d55c6e8ede25dc5121aec8b3cbef4a8f0da9.0":"2020-05-20T01:06:11.712Z","3.0.17-e4a98b18ee6c5b253dbea4253c332d25767101b2.0":"2020-05-20T21:15:18.854Z","3.0.17-247842669e11488ff6927183c9ec2aa1726445ef.0":"2020-05-20T21:39:43.999Z","3.0.17-aa8ac966dcdcb576c3c8c70aad2605ded2c86866.0":"2020-05-21T07:27:06.615Z","3.0.17-45440216462f5f6c5e9dd8b58205be6ae4688870.0":"2020-05-21T07:30:19.590Z","3.0.17-41d88d356a71acfb6c8f50af15e64e3f61e0d201.0":"2020-05-21T07:33:11.638Z","3.0.17-a670c397895755821a0828e926f1d39b7dc4f6d2.0":"2020-05-21T07:35:02.235Z","3.1.0":"2020-05-21T07:35:25.159Z","3.1.1-11ca8327bccfbf998091f1d8ebe53eb5782e2fb1.0":"2020-05-21T07:35:53.127Z","3.1.1-3b8c7006229dd832a47c629b1ce03508abc07723.0":"2020-05-21T21:03:32.830Z","3.1.1":"2020-05-21T21:05:28.321Z","3.1.1-b38b558f07ee5d39049e14198a4b5a1ba05a6acb.0":"2020-05-21T21:05:34.575Z","3.1.2-069698fb926dc4dc149d1938cba24748c930659e.0":"2020-05-21T21:06:25.559Z","3.1.2-6563eec5080a83da42866c6a22e635b275ea025a.0":"2020-05-22T10:31:04.127Z","3.1.2-036b74ee870a314122fe32d1c910480c216101db.0":"2020-05-22T10:32:35.473Z","3.1.2-a63b3fef5726dfe6ef7dd202f5088b21036ce740.0":"2020-05-22T10:32:51.824Z","3.1.2-7171e5a0ddf554e849d9b46f24cbcf5fa5521143.0":"2020-05-22T10:33:13.712Z","3.1.2":"2020-05-22T10:33:26.843Z","3.1.3-1895046c6d567de5243af4e2df9efbddfebbfc1f.0":"2020-05-22T10:34:18.829Z","3.1.3-2251903324bc68d50da48df59a074f3e57c88162.0":"2020-05-25T06:28:17.356Z","3.1.3-85ea16fef7552d7cfa8b1902636908907a4f83aa.0":"2020-05-25T06:30:29.530Z","3.1.3-2259eea1876534dff478830ebac5a96161a490d3.0":"2020-05-25T08:00:21.309Z","3.1.3-1b6c5a6bb7c5e1ab3b797812410ce6aed27ccdb7.0":"2020-05-25T08:04:49.373Z","3.2.0":"2020-05-25T08:05:07.286Z","3.2.1-85d5404762c29c1553e496b22eb2c8ba3455876b.0":"2020-05-25T08:06:13.229Z","3.2.1-aea34863eb542e9eb9974610cac9a9fe4b1716da.0":"2020-05-25T09:11:32.198Z","3.2.1-60fd30d35cec04533458d68f1e479889e5bf9556.0":"2020-05-26T09:44:18.414Z","3.2.1-f3233bd9885126a7509b607c7f0a1a200074e7b7.0":"2020-05-26T10:07:52.336Z","3.2.1-0e5e361a449f133754ee3d6bf9c75f7fda2bf634.0":"2020-05-26T10:10:10.472Z","3.3.0":"2020-05-26T10:10:26.323Z","3.3.1-f2f1b821295a65be14b4659b40024b91d6353875.0":"2020-05-26T10:11:33.386Z","3.3.1-b7a566ff7eb85ff5858762a3703ca77d3eaa4b0e.0":"2020-05-27T09:45:58.177Z","3.3.1-e7257e44c3dd2e6f8e2b410506e1c45a61e9c3b4.0":"2020-05-27T13:23:15.326Z","3.3.1-c640eef375b06e18f1c7945d8068a74b070c0788.0":"2020-05-27T13:55:56.564Z","3.3.1-720c147737bf5ee6359c232633cecf2ae99462a6.0":"2020-05-27T14:02:16.875Z","3.3.1":"2020-05-27T14:02:28.697Z","3.3.2-03324b2111f6481f05b0a25207daddaef87395f8.0":"2020-05-27T14:03:33.640Z","3.3.2-2d755b49e496f5679ce76bf89797b198308c8dfc.0":"2020-05-27T14:07:24.263Z","3.3.2-82256032456f2917e0d82c3b28c3ac9408c0adce.0":"2020-05-27T14:08:28.301Z","4.0.0":"2020-05-27T14:15:42.699Z","3.3.2-6a9426863b1e9a26d3e57817425aaf14ad007f01.0":"2020-05-27T14:15:49.931Z","4.0.1-e2dd4cd7d6aedd661982695d9b5d126b65bcbb30.0":"2020-05-27T14:16:45.628Z","4.0.1-839d1c664e4da4d7b2d2f966b08d4eb619ad4f45.0":"2020-05-28T01:20:26.438Z","4.0.1":"2020-05-28T01:21:58.411Z","4.0.1-c085cdb9735082bba7484a81f19a0e7f5eda7fbf.0":"2020-05-28T01:22:16.944Z","4.0.2-21c255bf57ce1b119b9912db7c94bafafc330d2b.0":"2020-05-28T01:22:36.903Z","4.0.2-10dd663eed2f461a7b9942011b1ad72d8d6b57ea.0":"2020-05-28T18:53:46.992Z","4.0.2-adf9ff9854526a9f14a0a32efdebf6ad6785ab95.0":"2020-05-28T18:58:27.848Z","4.0.2":"2020-05-28T18:58:35.642Z","4.0.3-b33efb531408c82bcf3e95e66926b06b97aad8ed.0":"2020-05-28T18:59:21.700Z","4.0.3-548187ede3e7da5dc35f23e0630a18231757870c.0":"2020-05-29T06:14:39.410Z","4.0.3":"2020-05-29T06:16:21.938Z","4.0.3-d9e4ed6a48396933207fa096487c3405eef66e79.0":"2020-05-29T06:16:46.253Z","4.0.4-7c64dd1685d284b57d835cb079116916054076f9.0":"2020-05-29T06:17:07.594Z","4.0.4-5041526839201845a568cc0c618f111bb25cdc86.0":"2020-05-30T01:34:47.311Z","4.0.4-b589f47c9941b73b0536b35fa4de39b3af94fe57.0":"2020-05-30T01:36:21.791Z","4.0.4":"2020-05-30T01:36:39.281Z","4.0.5-7082a5bf247be297d44c565ae1202de49740ea92.0":"2020-05-30T01:37:15.553Z","4.0.5-8309b41c7b9df91dfe3ed6ad505eba594ca6a418.0":"2020-05-30T06:09:26.438Z","4.0.5-a68c99cef8a2bfc7f996d1a7b19db6cccd71e64d.0":"2020-05-30T06:10:28.908Z","4.0.5":"2020-05-30T06:11:50.384Z","4.0.6-32d5de493553da6fc3f41b1c7ddeefd6b66679e5.0":"2020-05-30T06:12:56.550Z","4.0.6-239e7ac165b8a31f2af8ff6ad5ea2d46f9e76d65.0":"2020-06-01T11:18:41.200Z","4.0.6-816fcc560b66193da59418f1edf0ddea4cc57f04.0":"2020-06-01T11:20:33.906Z","4.0.6":"2020-06-01T11:20:52.618Z","4.0.7-15762236af1402e36abbfcee59f79b599daf4fbc.0":"2020-06-01T11:21:21.104Z","4.0.7-a7c8b4109425f0311c52c6c0c144ecf4f4559c28.0":"2020-06-02T00:06:05.719Z","4.0.7-5e39b223576cbc6e2890b386a713147ae9d5c05d.0":"2020-06-02T00:10:23.375Z","4.0.7":"2020-06-02T00:10:55.059Z","4.0.8-fe3275dbae0b318aea4688f4afb0ff933f5c225e.0":"2020-06-02T00:11:47.289Z","4.0.8-ce201114893b3c091018a990ce8ffde95af9f6e8.0":"2020-06-02T02:19:57.739Z","4.0.8-8806fa8cd0012dcd2580b36f11d04405b73dfeaa.0":"2020-06-02T02:20:45.637Z","4.0.8":"2020-06-02T02:21:06.398Z","4.0.9-82e4c55207c528b74a8f4c32c4aa6062605885c3.0":"2020-06-02T02:21:50.259Z","4.0.9-61b8ee84b003a248e8ae805b42c6c000dd994f34.0":"2020-06-03T18:16:54.591Z","4.0.9":"2020-06-03T18:19:08.231Z","4.0.10-41e1333116c708e2728caa706c220f3bf583bb78.0":"2020-06-03T18:19:55.824Z","4.0.9-e2963a5c7e1862db8f3059fe793c4124a4316127.0":"2020-06-03T18:21:31.517Z","4.0.10-6f2e8f3680885be3462c7f9b93ff1e19e6e6957c.0":"2020-06-04T01:18:38.300Z","4.0.10-766d133bd82f8a257197a2a2c0f506d2a47bd5fb.0":"2020-06-04T01:20:59.041Z","4.0.10":"2020-06-04T01:21:13.140Z","4.0.11-c5de7a82b9de951fc58b96ee4205303622270de1.0":"2020-06-04T01:22:06.936Z","4.0.11-ebffce3fcf12ed082811fdf32557b9e597141fc6.0":"2020-06-04T16:24:21.495Z","4.0.11-6caa3665362901f4b24c59b6364690f9165ee733.0":"2020-06-04T16:25:33.638Z","4.0.11":"2020-06-04T16:25:53.223Z","4.0.12-0229bc6db5afb661b8663e3b7367a97ec53cfd80.0":"2020-06-04T16:26:30.064Z","4.0.12-23da4a100425001dae4cbc6b55f1d82cb9108b38.0":"2020-06-04T22:01:58.304Z","4.0.12-6e79466d480761c214cf5b6213be23354bb50edf.0":"2020-06-04T22:04:24.195Z","4.0.12":"2020-06-04T22:04:49.332Z","4.0.13-98cf08c60d036c32c7e35bb08f9eac8b699ee546.0":"2020-06-04T22:05:02.055Z","4.0.13-3808f4dfc6a8fbc21a7fafb6a01bce96a727d7eb.0":"2020-06-05T10:25:45.554Z","4.0.13-c7fd2dedf36fbf9dc51439c720ba5d989c3cdaad.0":"2020-06-05T10:27:08.719Z","4.0.13":"2020-06-05T10:27:53.731Z","4.0.14-79220835cdad91ae860a86629a215b969e043ae2.0":"2020-06-05T10:29:01.642Z","4.0.14-12fdfd9e4b69540dc323346da5e2e3d9da12aeec.0":"2020-06-09T10:37:41.692Z","4.0.14-b0a20ba2dc19ee8428475f84c67bcc5171dcac5d.0":"2020-06-09T10:39:46.709Z","4.0.14":"2020-06-09T10:40:06.738Z","4.0.15-503fbf35ec81ed232d83b9f772342b5d9e972df3.0":"2020-06-09T10:41:06.776Z","4.0.15-773811aa1ffc95bd3896ad4ec16e9e96d1447e46.0":"2020-06-10T10:19:28.464Z","4.0.15-024587912dc26ee48bc7f84c97e6af904a9527fb.0":"2020-06-10T10:21:22.359Z","4.0.15":"2020-06-10T10:21:52.972Z","4.0.15-e7ad422c6cf5350110d2c93b9f3f270e865fe207.0":"2020-06-10T10:22:12.599Z","4.0.16-448ee658d865598d54a707a103960ab954df8927.0":"2020-06-10T10:22:46.515Z","4.0.15-0fc601b47d9d08b947a4f4d93f1b50cff742a207.0":"2020-06-10T10:23:21.935Z","4.0.16-012434ea707d5880b31a5e94e52f05464e566d57.0":"2020-06-10T10:23:53.632Z","4.0.16":"2020-06-10T10:24:33.318Z","4.0.16-8b043267b79f521a61eb33168bd9a7e1a61e78a1.0":"2020-06-10T10:24:43.142Z","4.0.17-8aca189c4998a669dbb4738eb3b275e07c7e1fb2.0":"2020-06-10T10:25:09.675Z","4.0.17-dbef6a403b702cf64a1c67e0dda22bc7aaf9476e.0":"2020-06-10T10:25:52.107Z","4.0.17-a2d6771b10317ad2a2a2fa66400184a9bd686eff.0":"2020-06-10T10:26:11.124Z","4.0.17":"2020-06-10T10:26:33.850Z","4.0.18-acfc6d119165cc5d7ed608325c802df7cfd128b7.0":"2020-06-10T10:27:18.158Z","4.0.18-f0af64d0dca359a2f0480488540b01137994f955.0":"2020-06-12T09:52:47.794Z","4.0.18-b8aa6fe0f5bc994eddd85cccc25968308b56c078.0":"2020-06-12T09:54:15.884Z","4.0.18-18d6bcc2935d1eaab98fd6743269144ca505b152.0":"2020-06-12T09:54:25.976Z","4.0.18":"2020-06-12T09:54:37.378Z","4.0.19-7b43caa91ea9556a6a737bbce0dddf683c8c60d0.0":"2020-06-12T09:54:59.446Z","4.0.19":"2020-06-12T09:55:13.626Z","4.0.20-24031f5866cae31d592db7ba04a13e2fb83488dc.0":"2020-06-12T09:55:53.603Z","4.0.19-eb3f78ea8dc05d79682e19562be5ec48fa916853.0":"2020-06-12T09:56:24.130Z","4.0.20-7bcf9de5bda7c5b626ccb49c404ba1dc60547e73.0":"2020-06-15T11:09:35.364Z","4.0.20-e3ae1dc7f46f1417b5ab438e59a967cf14d332d1.0":"2020-06-15T11:11:45.284Z","4.0.20":"2020-06-15T11:16:48.187Z","4.0.21-c0d6a5ae653345710231b0e11112aff2528ed601.0":"2020-06-15T11:23:49.222Z","4.0.21-abe74b5a3475bd89c3f49b7c247e25ab81428f1a.0":"2020-06-17T10:30:13.855Z","4.0.21":"2020-06-17T10:35:02.945Z","4.0.21-a87454b11546eede10c32df79bfeac79c14783fa.0":"2020-06-17T10:35:19.616Z","4.0.22-d89961efc4b89381fe5fbc18a2fb1793c8eea939.0":"2020-06-17T10:35:42.331Z","4.0.22-d5a285a048bb4d1097e4a9fa70bcc17d0e14246d.0":"2020-06-22T11:42:12.611Z","4.0.22-f019f18f26420569862ec7da31fa3b49e6223117.0":"2020-06-22T11:44:01.965Z","4.0.22":"2020-06-22T11:44:20.179Z","4.0.22-e1dff94c49bf60858a5e5a2032b3d6856849e5c0.0":"2020-06-22T11:44:38.670Z","4.0.23-f83009ce666f568aab33c3df3d97293c9e19d702.0":"2020-06-22T11:44:58.795Z","4.0.22-6134456b4adea20b7110abf3e259b94f6486f323.0":"2020-06-22T11:45:16.515Z","4.0.23-3da5b9821a32ffd9f7e65f2f8f5740c57197dd9f.0":"2020-06-22T11:45:34.089Z","4.0.23-a9d187f5af191c0b94811439f5fdc166d4842b62.0":"2020-06-22T11:45:48.342Z","4.0.23":"2020-06-22T11:47:12.169Z","4.0.24-94e49443a416294a4b7c6bade69d442b1b6f027a.0":"2020-06-22T11:48:09.657Z","4.0.24":"2020-06-22T11:48:28.622Z","4.0.24-2f70e894e5521da9e6b0dafd6d77b6d206cb5e81.0":"2020-06-22T11:48:43.643Z","4.0.25-c0f930b5f3c847f565552081b19cd56b1cc879d5.0":"2020-06-22T11:49:14.166Z","4.0.24-f3dde32e0ad2b2941fd295627fe6db47be2811e7.0":"2020-06-22T11:49:25.323Z","4.0.25-f299192f9a9142ede97de982cc564ce4ef31181e.0":"2020-06-24T14:37:21.310Z","4.0.25-0d3d946e70ea34e59ccd0069d496253adad043cd.0":"2020-06-24T14:39:37.710Z","4.0.25":"2020-06-24T14:40:15.523Z","4.0.26-be7aaf592de36dcc51c0ffcc67d0e1dcb2b20727.0":"2020-06-24T14:41:17.853Z","4.0.26-ad313360f57d40ac53b3a0d11adba20f5d86fe05.0":"2020-06-24T14:41:43.437Z","4.0.26-2a6504706e7735dca90c2a76a9389188120baf62.0":"2020-06-24T14:43:00.442Z","4.0.26":"2020-06-24T14:43:17.161Z","4.0.25-79985284141cdca2b3d6ecc42d03de2cab892df8.0":"2020-06-24T14:43:46.408Z","4.0.27-397c11618f0b94d8e146d19fca96195e0ef786cb.0":"2020-06-24T14:44:23.169Z","4.0.27-063bedc12db7325a9d15d0ac0b3196036e9fef52.0":"2020-06-24T19:02:14.361Z","4.0.27-37452551bb5b2dd20b1c25db980311a69afa6842.0":"2020-06-24T19:03:35.998Z","4.0.27":"2020-06-24T19:06:57.048Z","4.0.28-65b55395c3b54ef10a753ed6161b40f5d058df78.0":"2020-06-24T19:07:38.991Z","4.0.28-d447d272e580690e7e2196d6b9117d3c4c8bba6e.0":"2020-06-25T14:08:50.691Z","4.0.28-fab1f622267e3fc47f00223a76c079a052b64657.0":"2020-06-25T14:40:51.161Z","4.0.28-bc630e0f0877d4c668c8023efd7f00217e82be87.0":"2020-06-26T07:48:42.332Z","4.1.0":"2020-06-26T07:49:06.016Z","4.1.1-15d6ce19e03d4eb577b0d2bdf2ec2973c9e216ad.0":"2020-06-26T07:49:34.017Z","4.1.1-920b584ab16b2ae230a3c761fb852cab624bb4ad.0":"2020-06-26T07:56:30.809Z","4.1.1-d4e917e1de20f67fcd3ad211295144bd00dff84a.0":"2020-06-26T07:59:30.095Z","4.1.1":"2020-06-26T07:59:40.301Z","4.1.2-03dcbd19afedba9bde318cb3dd538deab94fbb27.0":"2020-06-26T08:00:17.904Z","4.1.2-fa546679c415679c155e1c0cc5df185b9f23dc80.0":"2020-06-26T08:00:38.063Z","4.1.2-a4d2ad92ff4e79734439b5e987a18563db7e4788.0":"2020-06-26T08:00:45.775Z","4.1.2-48f863a1a699121f21e17e8d82b68b4f3cc150d2.0":"2020-06-26T08:03:23.681Z","5.0.0":"2020-06-26T08:03:41.415Z","5.0.1-6f8bd16677f36693c4051380f9ea06fd273d2fc9.0":"2020-06-26T08:04:33.613Z","5.0.1-fe58c1573ae8c4fbb341ec078d6dfa84373cd8cf.0":"2020-06-28T16:55:43.997Z","5.0.1-977620dcd4342231370593d3bc296e65fe57a640.0":"2020-06-28T16:56:48.794Z","5.0.1":"2020-06-28T16:57:09.625Z","5.0.2-779a0a19fa47e09eae92ae09567231575612e272.0":"2020-06-28T16:57:50.832Z","5.0.2-d737459596fd1d8b38bf35bb3894651121d812ab.0":"2020-07-01T00:56:10.386Z","5.0.2-ae989f7f5ef01c475e11b1cc77763dfb52fd2b33.0":"2020-07-01T00:58:03.695Z","5.0.2":"2020-07-01T00:58:24.386Z","5.0.3-b7626d42f7194aa197e2df5331530484f222f5d0.0":"2020-07-01T00:59:24.090Z","5.0.3-772a8610632e17c88933ed324595acd599c52df4.0":"2020-07-01T23:56:40.402Z","5.0.3-6752ef0ef9907e919e2dafe3c8f32d8a566d5f09.0":"2020-07-01T23:58:14.662Z","5.0.3":"2020-07-01T23:58:28.157Z","5.0.4-b8d355c3874ffeaf1cea202a7a934b2719b2760a.0":"2020-07-02T00:00:46.953Z","5.0.4-d90d998cfe86548aac9df0fc5164b53e1cf9ef18.0":"2020-07-02T00:36:53.175Z","5.0.4-dffff67d593941d5d3632891e08539be703cff80.0":"2020-07-02T00:37:11.933Z","5.0.4-1a806754b6a77c8e84c70e92605a6d72a94a5392.0":"2020-07-02T00:38:37.999Z","5.0.4-d167f19d5817f093f428bf37bc3a49e7256cf795.0":"2020-07-02T00:38:57.958Z","5.0.4":"2020-07-02T00:39:15.986Z","5.0.5-acda8331907852b89fc735a484d11cd52a9b1e49.0":"2020-07-02T00:39:42.869Z","5.0.5-dcaf6c6b784477d12a55b7205e024256ce080593.0":"2020-07-07T00:54:43.517Z","5.0.5-156eb255a2082289de003d5ab04c0867c8847a92.0":"2020-07-07T00:56:24.729Z","5.0.5":"2020-07-07T00:56:45.123Z","5.0.6-12f8b4607e01e1db69d39b4633f42c7b14f39ed1.0":"2020-07-07T00:57:28.040Z","5.0.6-5c9d447a6dded38cfff870a47e61538dbd50593a.0":"2020-07-07T01:32:46.000Z","5.0.6-b7956fd37680fbe89730ccddb65503f9f79b19e8.0":"2020-07-07T01:34:20.772Z","5.0.6":"2020-07-07T01:34:38.868Z","5.0.7-7f4a321e0e52a5fa2a7888a6aa8f5ad5ef4c8f41.0":"2020-07-07T01:35:17.379Z","5.0.7-916a6347b3fe401368f0508ad4c2ae1d011ac999.0":"2020-07-07T22:06:01.982Z","5.0.7-5c64e2bc82ec7b4c4f08c21bc91e228d0bec75ed.0":"2020-07-07T22:07:26.080Z","5.0.7":"2020-07-07T22:07:55.917Z","5.0.8-e91922337256f78677266a6c1aa59e1bb65c80f5.0":"2020-07-07T22:08:29.059Z","5.0.8-0461aded08045fa9bc710ae3b3dcd8db474c9a5b.0":"2020-07-07T22:38:56.929Z","5.0.8-24bdcea41a9f488456fc8dc388f404ce18ca47d4.0":"2020-07-07T22:40:15.418Z","5.0.8":"2020-07-07T22:40:31.481Z","5.0.9-08fe1b9ea5b34e6229c23cd4bee69855fd7eda9c.0":"2020-07-07T22:41:18.185Z","5.0.9-a63b676ed04d3ee8985fa21b8cc2e74335d68934.0":"2020-07-08T20:26:48.074Z","5.0.9":"2020-07-08T20:28:42.020Z","5.0.9-b450a2e70578aed4ae4f1fffd2ceb661e9b33c6c.0":"2020-07-08T20:29:02.109Z","5.0.10-5535a3effd66497c657cfca3c3964e78beb4afd6.0":"2020-07-08T20:29:32.801Z","5.0.10-fb4e208972fed81ac5ce0b7d710c003d2c63ed38.0":"2020-07-08T22:56:37.964Z","5.0.10-1caf12bc033cb5ffc53656084d519dd7a5acb38c.0":"2020-07-08T22:58:11.244Z","5.0.10":"2020-07-08T22:58:29.425Z","5.0.11-9c472e5085d265b2ea4181cc4825d2d5f7538f0f.0":"2020-07-08T22:58:43.882Z","5.0.11-377f3cf2d11515fa47784df7b1bc919febc9a88b.0":"2020-07-08T23:13:47.131Z","5.0.11-00dbf082675ab2cfc4ce7d2b1b6090dd878382a0.0":"2020-07-08T23:15:02.944Z","5.0.11":"2020-07-08T23:15:29.793Z","5.0.12-5d303ae37af10c4726f17b3ecdc7b8ace6e3399c.0":"2020-07-08T23:16:13.566Z","5.0.12-d1092dd868edc452d94e2185430f9ec8163508ed.0":"2020-07-10T01:41:10.218Z","5.0.12-9da21a102e40ff32c499b953de8faf150f30091f.0":"2020-07-10T01:42:07.751Z","5.0.12":"2020-07-10T01:42:27.683Z","5.0.13-d362b825a8fb4b987d9f8b13b9eb5ec0309ca0d6.0":"2020-07-10T01:43:11.824Z","5.0.13-a5c6e37c1a6b7284e6b58678dfde44262a59b10f.0":"2020-07-10T18:33:37.995Z","5.0.13-9f108d2be75f5e25f8731a61753bc61364ffe3e1.0":"2020-07-10T18:34:58.320Z","5.0.13":"2020-07-10T18:35:27.268Z","5.0.14-84f363204263da63b5af0656d6e1cb4be37433d6.0":"2020-07-10T18:36:28.615Z","5.0.14-76edcfcadba65faae27617290bbbf2bb91026994.0":"2020-07-12T09:28:11.708Z","5.0.14-2c10643eda1889ebfe86c4e0bfaafeb96f5562fa.0":"2020-07-12T09:29:28.080Z","5.0.14":"2020-07-12T09:29:50.801Z","5.0.15-5eeb1c97ce2171a02631efbfe1366f877ee63c61.0":"2020-07-12T09:31:29.761Z","5.0.15-df31511012d446d36e2e91c3d2b6e1d9f4bf2955.0":"2020-07-13T03:57:29.555Z","5.0.15-04fb0ba9a013d718f8d1290755bd36c47a04a284.0":"2020-07-13T03:59:34.761Z","5.0.15":"2020-07-13T04:00:17.442Z","5.0.16-d9b519d7de2b900c746b17fed328c8c3d04c21d4.0":"2020-07-13T04:01:11.177Z","5.0.16-b3d92aac65e1dc75180e37f7efa474a0b4c6b340.0":"2020-07-13T04:08:16.762Z","5.0.16-bfb12ae2e62192d86460634d4545fde859eaaa46.0":"2020-07-13T04:09:51.524Z","5.0.16":"2020-07-13T04:10:22.759Z","5.0.17-24f97ec2cae9cc981c4a764651088a2fc5a1927c.0":"2020-07-13T04:11:14.989Z","5.0.17-4f0281a25065a3ef586bed32889678139539fcda.0":"2020-07-13T18:41:30.157Z","5.0.17-9ce04c1df1fe48c5771b452411cbe05fd1ff77de.0":"2020-07-13T18:43:06.920Z","5.0.17":"2020-07-13T18:43:20.955Z","5.0.18-62060035ba2b16c5b95e7728ea1ce2eb76d4da18.0":"2020-07-13T18:44:10.509Z","5.0.18-0fe04be087e237bc9be7b04cb24844ca2eab5aa9.0":"2020-07-13T22:40:45.565Z","5.0.18-75898d595275cade567308ffdfed2aacd118b9ae.0":"2020-07-13T22:42:09.578Z","5.0.18":"2020-07-13T22:42:18.929Z","5.0.19-ed85b8451ba6678881fd0af3979d68c8f01e97a7.0":"2020-07-13T22:43:11.336Z","5.0.19-65e020bc907ceac08cf7a39626f89fadc8931f0f.0":"2020-07-16T20:26:47.220Z","5.0.19":"2020-07-16T20:28:42.885Z","5.0.19-aedf8ddca34e5bd4216102fe2de68b034f8dcba2.0":"2020-07-16T20:29:13.534Z","5.0.20-6121aab12d022df57b1bbf2169e7c37a1c59266e.0":"2020-07-16T20:29:33.483Z","5.0.20-3c1da0d0d862b9183ecd832f944c43b145a314c3.0":"2020-07-17T06:28:54.755Z","5.0.20-ff6a4cdf7d2802cad0a45a6557ca1d8e3f434815.0":"2020-07-17T06:30:28.336Z","5.0.20":"2020-07-17T06:30:49.269Z","5.0.21-9e29dd7493a327a375ecefd43b6a66b7a18feb78.0":"2020-07-17T06:31:43.415Z","5.0.21-f72e055840d140df4279ed66ac658867184147bc.0":"2020-07-18T15:59:10.187Z","5.0.21-e30b9b89461014825f78d4dbbb257cd9607d92cb.0":"2020-07-18T16:00:20.779Z","5.0.21":"2020-07-18T16:00:42.665Z","5.0.22-602d55eb4e61fef5fe65238557e2bb6389f5c2fe.0":"2020-07-18T16:01:17.135Z","5.0.22-3afda9dcc310a96e3234cbb5374e0744800ca3c1.0":"2020-07-21T00:58:09.445Z","5.0.22-47d5af28aaa37b1a94f370347f607694578e7b4c.0":"2020-07-21T00:59:47.533Z","5.0.22":"2020-07-21T01:00:05.629Z","5.0.23-88a33f478aab0ff18769e9b970732baa25dde18d.0":"2020-07-21T01:01:09.670Z","5.0.23-d5ae03e0bd2af4c28bd01e9725f25d5e26a8a1cc.0":"2020-07-23T18:32:13.749Z","5.0.23-8f1448dfce4fc681f46c8db06002d4d395760b0b.0":"2020-07-23T18:33:50.801Z","5.0.23":"2020-07-23T18:34:10.291Z","5.0.24-8d561a4f92211001c301c7b38d1de4d2164e4c3c.0":"2020-07-23T18:34:53.724Z","5.0.24-c204b43a6a9f75e4f86100a1bf591c5939e88214.0":"2020-07-23T23:28:45.047Z","5.0.24-2fee92897320e140b02c3c41490d2eacbe10a0bb.0":"2020-07-23T23:30:02.522Z","5.0.24":"2020-07-23T23:30:54.603Z","5.0.25-a56e81462c804f083322ab0a0f96de6d9c794448.0":"2020-07-23T23:31:25.492Z","5.0.25-09cf03746b5e8346a2ae7efb46d3c90dc97f6fdc.0":"2020-07-24T00:49:11.871Z","5.0.25-3357d2a60805d42040e358db43d2ac04951f0eee.0":"2020-07-24T00:50:31.977Z","5.0.25":"2020-07-24T00:50:53.601Z","5.0.26-db8e274ef98d8ccaf978bbafdc393fb3dad74154.0":"2020-07-24T00:51:35.607Z","5.0.26-3280d69ec2a200f056adb569e8f0d161bcc578b3.0":"2020-07-24T19:46:18.114Z","5.0.26-86735615ba52f530bf8746eec9923e0d073a3a57.0":"2020-07-24T19:48:02.332Z","5.0.26":"2020-07-24T19:48:16.459Z","5.0.27-2d73ee22b1a35729f8accce4aebe1afba8c84a48.0":"2020-07-24T19:48:53.584Z","5.0.27-5e668684961c689b7e1273be8c5332b79102f16d.0":"2020-07-25T08:34:44.197Z","5.0.27-b5df8f293355484735a06b6c31e346c798ae2411.0":"2020-07-25T08:36:25.381Z","5.0.27":"2020-07-25T08:36:32.912Z","5.0.28-a4936e95d9bf626f834ef43d99cfc8d34bcfe38f.0":"2020-07-25T08:37:18.453Z","5.0.28-bc424fb59780ec02036049ad2d9caf73d219a8cb.0":"2020-07-27T20:59:59.565Z","5.0.28-1f5f4e4a63186a3b7a4ae7474f0472264eebf45e.0":"2020-07-27T21:01:18.471Z","5.0.28":"2020-07-27T21:01:34.090Z","5.0.29-94aacde2148acdabfb3ac8930877cedb5cf58d41.0":"2020-07-27T21:02:12.000Z","5.0.29-48e5693ec025b2ec9c3e46704b250d2c19ec33ec.0":"2020-07-27T22:40:59.607Z","5.0.29-9b66ca67f34c317336b4aeb9e8d4f395733d3129.0":"2020-07-27T22:42:23.771Z","5.0.29":"2020-07-27T22:42:46.853Z","5.0.30-690d981ce906eab5a2e6fe4efeccdb89e63c2a45.0":"2020-07-27T22:43:16.886Z","5.0.30-813e4b0163cdb956e2ad97d3442bfbc3e92a6477.0":"2020-07-28T10:39:28.740Z","5.0.30-df504a5caf8f02c02720aa1777bd456c0dbd27c7.0":"2020-07-28T10:40:55.960Z","5.0.30":"2020-07-28T10:41:57.364Z","5.0.31-b28cf20f3d562a3e398bc1bca13bbb4e659ab362.0":"2020-07-28T10:42:39.679Z","5.0.31-8f4c64fdc957567b2141e5486ebf98c200da1fd7.0":"2020-07-28T23:17:32.009Z","5.0.31":"2020-07-28T23:19:18.542Z","5.0.31-9b27ab7ad7008a8fe9ab28891202c1ad4b5d9b09.0":"2020-07-28T23:19:37.861Z","5.0.32-a483c3920b0d7b3f44f785ac1fcca8fceb1a251f.0":"2020-07-28T23:19:51.363Z","5.0.32-8779c925c419c3883592e491a005b787140559d4.0":"2020-07-29T00:57:59.108Z","5.0.32-8696ab60bbd1e060f09526afc66fd253114960fa.0":"2020-07-29T00:59:46.506Z","5.0.32":"2020-07-29T01:00:02.163Z","5.0.33-0f1bbef99846ee4c675427f4944aea2c826e41ce.0":"2020-07-29T01:00:42.698Z","5.0.33-7d7a3c14cafab844cb365a274b3fc7dafe4aa611.0":"2020-07-29T17:07:57.417Z","5.0.33-1d2be942c9b3039c7b7d841fe77c95ace344649b.0":"2020-07-29T17:09:51.280Z","5.0.33":"2020-07-29T17:10:08.607Z","5.0.34-2a1881031a3e97a4d91d5819b9c9d5001045e5fc.0":"2020-07-29T17:10:45.317Z","5.0.34-7135d9859e53b168524d59d1cdbc3ca25ab99ae6.0":"2020-07-30T11:55:09.261Z","5.0.34-61d58933d51494466d2c66b1d54305a4bfd3ec2a.0":"2020-07-30T11:55:51.707Z","5.0.34-d3e3c8c91d164aef8d037cec9b634fb4759c91e5.0":"2020-07-30T11:56:09.631Z","5.0.34":"2020-07-30T11:56:25.690Z","5.0.35-928d8c78af131cf10b148d0d92ba95fc4d92c7e3.0":"2020-07-30T11:57:28.114Z","5.0.35-eb71cd249b29775768059228d77c2e19eba72769.0":"2020-07-30T11:57:37.930Z","5.0.35":"2020-07-30T11:57:56.951Z","5.0.36-d4dd93af2d8275f1ef707cb5e482bef62374265f.0":"2020-07-30T11:58:31.010Z","5.0.36-a97757e51f93ccba933889c1ca1ed04988acfb63.0":"2020-07-31T13:48:14.667Z","5.0.36-3eeacfca1109dd7256067595ba3fb6fc50d72a58.0":"2020-07-31T13:49:21.189Z","5.0.36":"2020-07-31T13:49:37.528Z","5.0.37-834bf263ee505d0e32f52fc19c57e2e5483a7cec.0":"2020-07-31T13:50:12.571Z","5.0.37-cf0d526148b2bff6ddd87f75ce4a2db48fe736c7.0":"2020-07-31T13:52:55.081Z","5.0.37-962a7b406c3d6f1a9666e20943edae74b6770f42.0":"2020-07-31T13:54:34.871Z","5.0.37":"2020-07-31T13:54:50.786Z","5.0.38-15c1ea0f3ad35ea7addd93243561af656eca3d7e.0":"2020-07-31T13:55:31.609Z","5.0.38-412f409058dbcaf7377b37a552694178e867d120.0":"2020-07-31T18:38:52.026Z","5.0.38-f0408d44bd648e1b0e3d1d282a10fe649e240572.0":"2020-07-31T18:39:49.664Z","5.0.38":"2020-07-31T18:40:17.394Z","5.0.39-e6aa0e2a5c24f5cc66755a830c55f41515988efe.0":"2020-07-31T18:40:50.197Z","5.0.39-adcea12363898e57d7068c1d67f27a2c938b4421.0":"2020-08-04T03:01:11.898Z","5.0.39-c4171c0eefe66339bf9510eef08c679922489b27.0":"2020-08-04T03:03:14.922Z","5.0.39":"2020-08-04T03:03:43.911Z","5.0.40-1221f4735e49edf67540990591df45e5582b1a20.0":"2020-08-04T03:04:28.034Z","5.0.40-e622afc27ab4ab863f37de57359b8bb1739c7117.0":"2020-08-06T01:28:26.000Z","5.0.40-23a35697a120d9818a867deac227f0858e8a31b9.0":"2020-08-06T01:29:45.763Z","5.0.40":"2020-08-06T01:30:16.036Z","5.0.41-0cd7ed970c37d09a1c749374754f628f2c9003b4.0":"2020-08-06T01:30:38.970Z","5.0.41-0a2d89bf324c17dc51fe3264ebf19a6fc9ce5a49.0":"2020-08-07T11:01:47.168Z","5.0.41-f39b8c7c702821412a98dc15847dba8f59d3aa3c.0":"2020-08-07T11:03:17.919Z","5.0.41":"2020-08-07T11:03:27.372Z","5.0.42-231170b6ad289986a4e0769b4707f87924c5c9f9.0":"2020-08-07T11:04:31.836Z","5.0.42-95e72a1689b8d19fab54859478c861fb8c9b2ae0.0":"2020-08-10T21:44:19.950Z","5.0.42-6be9eabc28742e85202ec165c797f4470201cff5.0":"2020-08-10T21:45:48.058Z","5.0.42":"2020-08-10T21:46:19.111Z","5.0.43-c1afa148407cb484b35a1c528380100c56c8048e.0":"2020-08-10T21:47:07.175Z","5.0.43-2459cc29dea38c73852fe8772d408f18997d4f40.0":"2020-08-11T15:17:59.976Z","5.0.43-29011bb303eae2d033f9270bd0bf09335b49f8b8.0":"2020-08-11T15:19:29.385Z","5.0.43":"2020-08-11T15:19:54.485Z","5.0.44-6178b0d9b311a1cbe8cd9614768b4877c242ee46.0":"2020-08-11T15:20:36.417Z","5.0.44-2f600add83b3d0887a3ac8878ad5c2f54b91b0b3.0":"2020-08-12T02:38:17.752Z","5.0.44-0781d0b643967eee158bb7ccac413439a1950007.0":"2020-08-12T02:40:48.709Z","5.0.44":"2020-08-12T02:41:10.693Z","5.0.45-d59340d28718593d292e853c15cb1c0496bc0a12.0":"2020-08-12T02:41:47.637Z","5.0.45-b3d6954342af16ab12b58bf33dc399af64096dd4.0":"2020-08-13T02:10:11.636Z","5.0.45-9c421b2e5c34b6600c36b188815cac13face8ad7.0":"2020-08-13T02:11:28.753Z","5.0.45":"2020-08-13T02:11:55.218Z","5.0.46-159729eaebb95613bdede59d4157bc3bb21c31e0.0":"2020-08-13T02:12:22.394Z","5.0.46-5e0ed5f2ab74dbe6f2dc363908c7e697b0648fe6.0":"2020-08-13T03:28:50.106Z","5.0.46-7233b1b7c0336e5c02586e5521dd59b82bb528d9.0":"2020-08-13T03:30:01.894Z","5.0.46":"2020-08-13T03:30:26.831Z","5.0.47-9dd6ebb624c3d0b7e3def16f61b343ca06d8ba33.0":"2020-08-13T03:31:46.629Z","5.0.47-707ee924e0f4cb3ce2954c5161f9de2f558fa3cf.0":"2020-08-15T01:27:29.470Z","5.0.47-65c36a22836edfa7eff5def346cb7e7a9d622616.0":"2020-08-15T01:28:38.753Z","5.0.47":"2020-08-15T01:29:04.260Z","5.0.48-deb2693e9ea9e6e94290a4a6cb10273f8ce1144d.0":"2020-08-15T01:29:40.390Z","5.0.48-0b212a3aa47dd7c74a384515c062dd30feec15d4.0":"2020-08-16T07:00:06.573Z","5.0.48":"2020-08-16T07:01:59.682Z","5.0.48-d9bb6aaddd379fe6a2d17a317a0258cb5c0bb701.0":"2020-08-16T07:02:19.018Z","5.0.49-ca23f62311543d3717559b0c58c7b76751512290.0":"2020-08-16T07:03:50.544Z","5.0.49-5a9bb8b5857f25583eace51ac6e397620b8af176.0":"2020-08-16T07:12:47.785Z","5.0.49":"2020-08-16T07:14:39.812Z","5.0.49-0124d5688e79e7fc723ca2d0be68b25ab471b962.0":"2020-08-16T07:15:13.476Z","5.0.50-33e439b7d104dad7e62a76ee55c5f2b15d7f231b.0":"2020-08-16T07:15:27.442Z","5.0.50-024f6de93168baec29c9fbbaaca5e72572ffa269.0":"2020-08-18T01:08:17.533Z","5.0.50-aba09486d83411cd1ae4ec110dffc1f7a468863b.0":"2020-08-18T01:10:20.610Z","5.0.50":"2020-08-18T01:10:41.712Z","5.0.51-41a15590361d72f4f0661f46e0311fd3710bd626.0":"2020-08-18T01:12:08.085Z","5.0.51-26fc3197ea8e30f27c2c0397cb100d7584667430.0":"2020-08-21T15:15:59.106Z","5.0.51-19550f255998150bd7cb1fb28415d19cc7c28b81.0":"2020-08-21T15:17:23.005Z","5.0.51-dbc16e56fb9a47fb35038bb2167bd809d27efefc.0":"2020-08-21T15:17:43.335Z","5.0.51-677344b2a773fe46568e8d6319a99ea5d1e9992d.0":"2020-08-21T15:19:02.014Z","5.0.51":"2020-08-21T15:19:28.496Z","5.0.52-62fdc086641007da6af45b24a86c91fd0c2dc776.0":"2020-08-21T15:20:03.357Z","5.0.52-a5db4b42a0707a21550c94d4d855cc3a51ea99cd.0":"2020-08-22T04:06:47.788Z","5.0.52-b9dc429c89b64678df7e052d4b2f525440f92752.0":"2020-08-22T04:08:06.351Z","5.0.52":"2020-08-22T04:08:31.366Z","5.0.53-32df79f660de220e5f2415f6aa294a1d35148a51.0":"2020-08-22T04:11:16.464Z","5.0.53-29a761c1bceb8a17133fb408c65b3b52dbf6270c.0":"2020-08-22T04:15:25.908Z","5.0.53-16c3076431aba17a5a9a4ddcb8c812458fe6a216.0":"2020-08-22T04:16:21.884Z","5.0.53":"2020-08-22T04:16:45.465Z","5.0.54-cddc6ca62e879aa605658c7b151d044cdf2475a4.0":"2020-08-22T04:17:20.903Z","5.0.54-09aefc6ffe3936fb91931f4669c3795aff8e6f60.0":"2020-08-22T13:11:12.695Z","5.0.54-019589eb17d810513991f3a638bf77be746426f5.0":"2020-08-22T13:13:49.251Z","5.0.54":"2020-08-22T13:13:59.021Z","5.0.55-51809ec785c34be395c169c90da80359b45a8e61.0":"2020-08-22T13:14:58.260Z","5.0.55-aa0b31e28416fed12334fe21068eb4127353737b.0":"2020-08-24T15:22:46.622Z","5.0.55":"2020-08-24T15:24:36.630Z","5.0.55-ab52f258876076a95e821d4bf8fd45b49b64b77b.0":"2020-08-24T15:25:13.878Z","5.0.56-7816c2ddfdc07ef5197a63408d85adde44041573.0":"2020-08-24T15:25:31.522Z","5.0.56-15c4b2e3b083223d98a134e5b45503359e94ce75.0":"2020-08-24T15:26:46.770Z","5.0.56":"2020-08-24T15:27:27.502Z","5.0.57-47d27ef673383affe8d539b380ace8f4119a4fa1.0":"2020-08-24T15:28:02.281Z","5.0.57-6f6aea973fd4a19c43e6a40238b7280b176f75c3.0":"2020-08-25T08:57:07.745Z","5.0.57-fa0cb6a00e5e358c0300d3fc8cb0519820f7cef4.0":"2020-08-25T08:58:37.092Z","5.0.57":"2020-08-25T08:59:12.978Z","5.0.58-020ec4c829b74dfac216be0a1021111b89f729af.0":"2020-08-25T08:59:33.718Z","5.0.58-3669cd02d61e59a6ab56373feb2f7c096c5c7097.0":"2020-08-26T10:30:43.367Z","5.0.58-2164200218205a02acfd90d5aea1c155ec29d474.0":"2020-08-26T10:32:02.888Z","5.0.58":"2020-08-26T10:32:28.263Z","5.0.59-3df845af9da1e77b026bbe7ee36412cdb986f7f4.0":"2020-08-26T10:32:58.871Z","5.0.59-41d6fe8b0c6cde9e16f11d4cb22e7eb1f3f05e11.0":"2020-08-26T16:08:16.768Z","5.0.59-9fc98066c6b9b2348429fbced94c915dcdd2a24d.0":"2020-08-26T16:10:59.413Z","5.0.59":"2020-08-26T16:11:23.705Z","5.0.60-40096d7fcc264abce29d1f5116aea0dbae2b2cdf.0":"2020-08-26T16:11:56.250Z","5.0.60-e6ee0d3642f07556678c1ed8e000585c6fef387c.0":"2020-08-27T04:28:33.990Z","5.0.60-fe43bbf26e47cef7f63cd3c7e326b56419e48449.0":"2020-08-27T04:29:57.059Z","5.0.60":"2020-08-27T04:30:18.650Z","5.0.61-68c2e609c1f463741725e8b6509329fe0b66efe7.0":"2020-08-27T04:31:07.120Z","5.0.61-e8413c72da444eebaaf1a68cc30954ea0f15d173.0":"2020-08-27T06:06:46.495Z","5.0.61-41dc08394f1a6ef1927b8a88d8c49f769f8b399f.0":"2020-08-27T06:08:21.836Z","5.0.61":"2020-08-27T06:09:15.838Z","5.0.62-889731c9671eeef2cf0ef3bcde11ba2c0a989b4b.0":"2020-08-27T06:09:58.862Z","5.0.62-fc91e51bd1a88852ed7ca53f9a5c2ca2aee90027.0":"2020-08-27T06:57:46.104Z","5.0.62-646286829134e19c5627adcd5809cabf488dcb61.0":"2020-08-28T06:27:33.299Z","5.0.62-15ddd3f565f453c73431b32f5b33a93e5fdcc7b3.0":"2020-08-28T08:13:43.460Z","5.1.0":"2020-08-28T08:14:18.554Z","5.1.1-295514e51439c4f677cf22148ab85d306aa824f1.0":"2020-08-28T08:14:43.566Z","5.1.1-a5165ac3e330c1dcb44754c9dec09dfd38d6434e.0":"2020-08-28T08:16:47.855Z","5.1.1-420ff66a8fa01de0de79b23619056612359d6f07.0":"2020-08-30T21:49:27.137Z","5.1.1-f7e9c56b2c0ed920e6cd86e7f1079f56a4c2c07c.0":"2020-08-30T21:51:09.053Z","5.1.1":"2020-08-30T21:51:29.051Z","5.1.2-606f71f58dcc74cd476cbe26f1bfb86625a04b81.0":"2020-08-30T21:51:39.995Z","5.1.2-2b2121dae9641e782226097b35f5c90b8f7c2fcf.0":"2020-08-30T21:53:23.108Z","5.1.2-0c0d527525dc0979ae5b1ceca531a02fc1916e7d.0":"2020-08-31T15:28:55.239Z","5.1.2-134237305fa77f79d47dcd1ba58047f8efbeec1f.0":"2020-08-31T15:30:21.478Z","5.1.2":"2020-08-31T15:30:41.537Z","5.1.3-b9876667a4df71646c02a69bbf36eed7e65946fd.0":"2020-08-31T15:31:15.391Z","5.1.3-185120422d3ad36fdf2bcba7d906daf8626396cd.0":"2020-08-31T15:32:41.141Z","5.1.3-f52aa519f483b73b0afb4c67ac3467e6411366f3.0":"2020-09-01T15:20:47.592Z","5.1.3-3f2b1742aa0609b9338bb8019de62f1534b03451.0":"2020-09-01T15:21:59.501Z","5.1.3":"2020-09-01T15:22:36.327Z","5.1.4-3f40fa62548350ae016d283974300c4b03885e0f.0":"2020-09-01T15:23:05.261Z","5.1.4-ad5d2e94f7dae2f0ff7befc703e6ffd7ed3d7718.0":"2020-09-01T15:24:25.868Z","5.1.4-86f9b8db015c54537da90fed910cb6f64475cf7a.0":"2020-09-02T13:16:55.784Z","5.1.4-455ee47b1b665669dbc7627861434c5e933910e1.0":"2020-09-02T13:20:42.218Z","5.1.4-ec4994f0f9caeeb7280f72dfcd11c455df990083.0":"2020-09-02T13:25:34.983Z","5.1.4-89390e962c8fa56d109bb3601fa5160176f2568a.0":"2020-09-02T13:27:50.875Z","5.2.0":"2020-09-02T13:28:48.006Z","5.2.1-2af00a5accedf09aeb3951d1cb2ae3038e7f1c27.0":"2020-09-02T13:29:39.411Z","5.2.1-87c6d63da9258a8d0047e8de2ee1c99e1561bff9.0":"2020-09-02T13:31:42.533Z","5.2.1-c8f7f6804c96bc8f04a64edf2c963a11b6948e43.0":"2020-09-03T15:19:48.997Z","5.2.1-501728920a3f894d96b2b29bd31448a379a05c0a.0":"2020-09-03T15:21:17.086Z","5.2.1":"2020-09-03T15:21:34.089Z","5.2.2-8111029bcc3378dec78463e404ce941e46c62bf0.0":"2020-09-03T15:22:14.471Z","5.2.2-182d3c079dd754ed31c7b44ea5565d4d4c2e0e10.0":"2020-09-03T15:23:20.219Z","5.2.2-ee752fc6c4aab4e6b565f7a3e98e58920d5a7624.0":"2020-09-04T06:58:42.613Z","5.2.2-5824406567f77eee3cd7d1ea2f1129cece54fc1e.0":"2020-09-04T06:59:32.236Z","5.2.2":"2020-09-04T06:59:51.721Z","5.2.3-686ce9d1135b8afc7c2df96b73b5cf7d5f9fa399.0":"2020-09-04T07:00:51.225Z","5.2.3-1393f124224764a8474d6b176a252aef09769537.0":"2020-09-04T07:01:38.015Z","5.2.3-8b53ef67c9fe813e3f078c140c1d541fe91782aa.0":"2020-09-07T15:53:51.322Z","5.2.3-9cd95f0a25690302dfe0f7667c411288d430e8c7.0":"2020-09-07T15:54:24.330Z","5.2.3-27f03e2efb96371523a31b4a7713cfd7d5d70a28.0":"2020-09-07T15:55:05.624Z","5.2.3-536fe08dc022841a13e311abd875772c20775f93.0":"2020-09-07T15:55:48.137Z","5.2.3":"2020-09-07T15:56:12.280Z","5.2.4-6886a89e2e0236be1f3f26a0c58e9edcccb71771.0":"2020-09-07T15:57:14.879Z","5.2.4-a88ef65d1f85987bab0c178044c4dd473490c74c.0":"2020-09-07T15:57:35.056Z","5.2.4-60789e4242f4f043ea80eaf2f48a803e25d62487.0":"2020-09-09T02:55:25.141Z","5.2.4-2dc62b357b3c106558830736d504729a9fa02c73.0":"2020-09-09T02:56:37.123Z","5.2.4":"2020-09-09T02:57:01.905Z","5.2.5-97b3b1c6e653951ea49b8e755416d6b2b2f5a4ce.0":"2020-09-09T02:57:34.665Z","5.2.5-f0c157a1921d065880a3102f6934374ede452b59.0":"2020-09-09T02:59:12.122Z","5.2.5-474d12268e86e3e63bce2868db2e313682bb1bd0.0":"2020-09-09T03:01:01.291Z","5.2.5-7f5caa60f75d32e2741eeefcbd166cf9ee07aeca.0":"2020-09-10T05:58:56.037Z","5.2.5-4ca88f6375ca434f170772813f8357d90ef1ad15.0":"2020-09-10T06:00:28.153Z","5.2.5":"2020-09-10T06:00:53.892Z","5.2.6-462e4d1c16a10e0cf0661fcb716203abe5e5a197.0":"2020-09-10T06:01:26.381Z","5.2.6-2302561d9aaec3922a112cf16d8bf0914426c30e.0":"2020-09-10T06:02:34.856Z","5.2.6-acb14215b8c524ff9806b6b044202426c69b1753.0":"2020-09-10T06:04:34.167Z","5.2.6-21ffb92218e279bccbc642df498655751f0f446f.0":"2020-09-10T11:20:02.648Z","5.2.6-d46693ac91c771660e8f9f5ca8572d75ab643a55.0":"2020-09-10T11:21:35.760Z","5.2.6":"2020-09-10T11:21:46.310Z","5.2.7-47196f42de46c8197a18e7b66d009a2e2c29a621.0":"2020-09-10T11:22:23.175Z","5.2.7-b8444d08cbb7091527508b23695cf1db37b534c0.0":"2020-09-10T11:23:39.092Z","5.2.7-2f3a9980655567a02fb2ea3a8efe47fb4f0739a3.0":"2020-09-11T13:45:57.286Z","5.2.7-01214931b241e881925b770f6c0a614f69dc52ef.0":"2020-09-11T13:47:17.817Z","5.2.7":"2020-09-11T13:47:40.666Z","5.2.7-f6fa686b424c84a03d9920f727fb2634db814f7b.0":"2020-09-11T13:48:07.298Z","5.2.8-7b0066857b7cdb9946977087fe9b5fae28109515.0":"2020-09-11T13:48:19.906Z","5.2.8-e351a56af21cc37a3d26115f51deec48c721f7ea.0":"2020-09-11T13:49:26.247Z","5.2.8-f4ae59451e3b6f754c7c1a2d23208a0d83c353da.0":"2020-09-11T13:49:46.642Z","5.2.8-236ca8a5234771e00e5761deb5ca0fd9aa8768fc.0":"2020-09-13T09:14:45.935Z","5.2.8-0677a191fb824b905d85d0a87a28b5ddc80c00ff.0":"2020-09-13T09:16:09.702Z","5.2.8":"2020-09-13T09:16:48.282Z","5.2.8-035a21342f8eb7a8198be702559d3e37ac012574.0":"2020-09-13T09:17:08.341Z","5.2.9-0e3da3d6ed9947beb9e53aeaee2b4c0b760e9855.0":"2020-09-13T09:17:35.962Z","5.2.9-d313a6a48dc69752444fc1e174ea7665d0e808d9.0":"2020-09-13T09:18:05.266Z","5.2.9-0a02d6bf80acbafc9969f9a918fac38a1d7ef0d8.0":"2020-09-13T09:18:32.270Z","5.2.9-b21866d3b5530a074945aae00230055b146c96a2.0":"2020-09-13T09:19:34.558Z","5.2.9-2157e9bf99f47934ecc764a1662edce3d0811362.0":"2020-09-13T09:20:59.079Z","5.2.9":"2020-09-13T09:21:20.167Z","5.2.10-f352050b800a87dd308a9722b93e678986bd3879.0":"2020-09-13T09:22:19.005Z","5.2.10-8830cc1328a80da5d4ae1e853e67da770680d531.0":"2020-09-13T09:23:10.426Z","5.2.10-18de16c2e4bc7a04c4572233bbabd74fbf5729e9.0":"2020-09-13T09:32:51.952Z","5.2.10-c0e32177ed2fe8652417f2f57ab38b0cc27da880.0":"2020-09-13T09:34:51.110Z","5.2.10-8bc88cdc78ae2f5cd2fb75c641797aa14ffd5f6d.0":"2020-09-14T15:07:06.229Z","5.2.10-02ccdad55ba6ab4da8d548127ca604d6af34314a.0":"2020-09-14T15:08:35.759Z","5.2.10":"2020-09-14T15:08:55.871Z","5.2.11-f507bb4e8522f0c1805997bd0926e9bc6a77d416.0":"2020-09-14T15:09:34.538Z","5.2.11-f57557765b28eb223cb0e08a53a74074dff3a0aa.0":"2020-09-14T15:10:48.610Z","5.2.11-4a980c889e9147bb187addc2086ac554749a6680.0":"2020-09-14T15:14:18.527Z","5.2.11-ee02d69043243a080eab45b85c5e3a0232b6cba2.0":"2020-09-15T13:13:14.300Z","5.2.11-72cc112c197c803e771a1a0aa46b3730827c5f08.0":"2020-09-16T04:54:22.108Z","5.2.11-54508e24c6ef84a4425384b71ff1639ba6b8467a.0":"2020-09-16T04:55:19.656Z","5.2.11-41945273a90a47cecd71e370248ec5aa154a249b.0":"2020-09-16T04:55:47.441Z","5.2.11-6cfbcf4d3d8a88b63606ae823ec0e12c05b50717.0":"2020-09-16T04:56:39.466Z","5.2.11":"2020-09-16T04:56:57.666Z","5.2.11-93432d8d9c97621f4413ce0717115a826df12c5d.0":"2020-09-16T04:57:18.222Z","5.2.12-3412feb4504ef670bb011149251ce8aa7d783259.0":"2020-09-16T04:57:38.227Z","5.2.12-7a96bab22b6023556d520077639312fe4fdd8610.0":"2020-09-16T04:57:52.269Z","5.2.12-a937394165f876b9a61eb7d13ac3d126e43f216c.0":"2020-09-16T04:58:36.661Z","5.2.12-03419b13e44c761d6f364feeef1e4f38b0aa7995.0":"2020-09-16T12:24:07.753Z","5.2.12":"2020-09-16T12:27:06.025Z","5.2.12-72c00e65707b4a5ba69d5ee33a23a12e8f29f309.0":"2020-09-16T12:27:17.814Z","5.2.13-8f87ee41553baa8ec3bc054a2be17fefc1777f09.0":"2020-09-16T12:27:54.035Z","5.2.13-daf668462e4a1d09ef48b83c1152df9f11ffd29c.0":"2020-09-16T12:28:35.613Z","5.2.13-9d07c803563fab8ccaf919ffb229d00d7092a2ec.0":"2020-09-16T12:29:06.766Z","5.2.13-c50519c6ed8a4be50b5207c6dff8f583737392bd.0":"2020-09-16T12:29:48.591Z","5.2.13-9b42f8989b9c60c6e0d38fe9fdffb4beb84d1fd7.0":"2020-09-17T13:21:02.922Z","5.2.13-83921addabb224d8ff654c0c8bf3b73f0299b61e.0":"2020-09-17T13:22:54.263Z","5.2.13":"2020-09-17T13:23:16.352Z","5.2.14-8d4be2bb5cf1be02e681cd7d30f50666d347ce62.0":"2020-09-17T13:23:43.626Z","5.2.14-1d85dd7ff45412e8afb4164c9ee867e6ed5f4275.0":"2020-09-17T13:24:41.834Z","5.2.14-63315757e0cb732960aa4486b93728f1f8522cf3.0":"2020-09-17T13:25:03.801Z","5.2.14-faef6a92d86b627c786d4f8368d13ec409c08066.0":"2020-09-17T13:25:40.548Z","5.2.14-8c504294db4bd5197757e625be1ed02cd9c5ed85.0":"2020-09-17T14:03:10.959Z","5.2.14-425e80f54c923495367997e184104857066c2359.0":"2020-09-17T14:04:48.410Z","5.2.14":"2020-09-17T14:05:11.876Z","5.2.15-c8425123a0f451262c21f0f5630956d78966eb9b.0":"2020-09-17T14:05:52.403Z","5.2.15-e507b5ee440952ae6d43efc1db660f7b51eeb87b.0":"2020-09-17T14:06:15.334Z","5.2.15-3dd7b1a894bfcd9a4ba24e28d5c44e0bc0d91ea6.0":"2020-09-17T14:06:43.264Z","5.2.15-193d3fd174496c8ab007e133c0dcf49015884473.0":"2020-09-17T14:07:33.405Z","5.2.15-96dfbfea8a89cedf4520c586f8031f5b105e0caf.0":"2020-09-18T08:47:54.447Z","5.2.15-795dad87a18d4a917786d9d597a3bea5ca0934b8.0":"2020-09-18T08:55:08.240Z","5.2.15-7e4a03d47b590c93fb8bd8f6f073de5b6b3da921.0":"2020-09-18T09:44:20.898Z","5.2.15-f8598d1af1b141452fb77daef607da67e7d8a71f.0":"2020-09-18T09:48:25.667Z","5.2.15-6d5450d84fc1780f6e1467f90e2200f1d66fee97.0":"2020-09-18T09:56:58.953Z","6.0.0":"2020-09-18T09:57:18.501Z","6.0.1-4cc6077f0b865e2587270a4bf4c522577c754ed5.0":"2020-09-18T09:57:57.357Z","6.0.1-320c39a95df4308a7458b016f8e0e2d7339ecb37.0":"2020-09-18T10:00:01.765Z","6.0.1-4b27f1b4519f8277a8063556e586dbb7d2bfc6cd.0":"2020-09-18T10:00:12.182Z","6.0.1-b3be4b8e242269eca77670bafbca98e14847945f.0":"2020-09-19T07:17:35.454Z","6.0.1-cae40d7c6a07702addfca1852bc4fd54b7d03b67.0":"2020-09-20T11:01:17.557Z","6.0.1-02ea932a20351e08977ba1d36bd86784e9eb4268.0":"2020-09-20T11:02:35.209Z","6.0.1":"2020-09-20T11:03:09.958Z","6.0.1-9a05c1fc14ac516866e2a58304681090f1236579.0":"2020-09-20T11:03:35.917Z","6.0.2-72565a2de63ed50521087ed47c47ae27cb3e9315.0":"2020-09-20T11:04:03.046Z","6.0.2-15227faeebdb77d36daf83028cf30da300fa9387.0":"2020-09-20T11:04:50.975Z","6.0.2-47ca7420ebade50b4fd1d742d59fd212da42fd91.0":"2020-09-20T11:05:02.685Z","6.0.2-51909e01e98c45826878cc22c831b95a3d82a840.0":"2020-09-21T15:15:41.657Z","6.0.2-6e55035044d56b4c3b729bb2ebaee58f300b93f2.0":"2020-09-21T15:18:02.944Z","6.0.2":"2020-09-21T15:18:25.799Z","6.0.3-eeb78fdaabcfb6064b927de6250e716f2f93c6ac.0":"2020-09-21T15:18:42.379Z","6.0.3-622f633579553712cdae2a5237c331ab02a83717.0":"2020-09-21T15:19:07.118Z","6.0.3-0c089addbbd6c451832f3af0fb686ca4f022cc81.0":"2020-09-21T15:19:57.877Z","6.0.3-cfcebdfbef511169be8e7ab857263a6b9b36f6c8.0":"2020-09-21T15:20:22.556Z","6.0.3-a40eba5bacef2d98ac73c09060ded50460638a8c.0":"2020-09-22T13:45:30.246Z","6.0.3-0b2b53b1a4b2e9bbae6ee1cffe22ec4eb92da2f7.0":"2020-09-22T13:46:44.884Z","6.0.3":"2020-09-22T13:47:01.427Z","6.0.4-b7f05688af2214bd3b772180a4bf82d9f4cb9ef1.0":"2020-09-22T13:47:39.133Z","6.0.4-2790bffee000b4deaa4e0a73fa8d5fb59f5b7dbe.0":"2020-09-22T13:48:10.787Z","6.0.4-a749efcd018df691b481d9ea9246c6fb0262520b.0":"2020-09-22T13:48:55.750Z","6.0.4-df7166b85537d7b5aaaa4cee9078fbe30a42fde7.0":"2020-09-22T13:49:12.012Z","6.0.4-37af33eae65dc9c4f15ac62f8950233420aa71c4.0":"2020-09-23T02:54:50.621Z","6.0.4":"2020-09-23T02:55:08.185Z","6.0.5-8d5ded70825075a55226d7927f9c6dbff8db62ae.0":"2020-09-23T02:55:41.879Z","6.0.5-8dc3d09059279cb402a07e87bd77cd938c3d570c.0":"2020-09-23T02:55:55.293Z","6.0.4-4bd78648500ff1b6fe1cb4e910879b299feec2f8.0":"2020-09-23T02:56:19.488Z","6.0.5-bf13f3a2cbad5f6a028384ddcf776ea171cb213a.0":"2020-09-23T02:56:29.456Z","6.0.5-41ee58dcce8b430b0cbc5ff91b446616b68c9dae.0":"2020-09-23T02:57:03.787Z","6.0.5-338adf6ed288ae988df8360052c2607898a5e28e.0":"2020-09-25T14:22:02.365Z","6.0.5-141e3bf5b6d543b546e718311c9ecd91f98dbba7.0":"2020-09-25T14:23:38.221Z","6.0.5":"2020-09-25T14:23:51.919Z","6.0.6-064d7b7bd7cf61082d89cc7a4d5369bf688ca91a.0":"2020-09-25T14:24:27.609Z","6.0.6-6f111248060f9cc83405be108d91c4de5deeef6f.0":"2020-09-25T14:24:40.079Z","6.0.6-a2aff24b1d9775e665f530b062ab25f208486e91.0":"2020-09-25T14:25:24.081Z","6.0.6-a3d4afc407db4f732a28b773cf612c58621e4c8b.0":"2020-09-25T14:25:51.527Z","6.0.6-2dacafa3bf4156deed0f7daf7b3f2a495340bfe0.0":"2020-09-29T11:03:08.512Z","6.0.6-4ecae4685a04ac3c6d61a61c03464de3fa077b84.0":"2020-09-29T11:04:36.339Z","6.0.6":"2020-09-29T11:05:01.512Z","6.0.7-7a629f85a1d5bfe2e78da742664cf42dcc76dce1.0":"2020-09-29T11:05:38.560Z","6.0.7-42453da9dfb0844ae82c7becf551564dfa39c35e.0":"2020-09-29T11:05:50.596Z","6.0.7-8d42c70370fccfe9394834eba2d8874bb9950c8e.0":"2020-09-29T11:06:29.239Z","6.0.7-7e390735e515f7041c07850940eb240133c722b7.0":"2020-09-29T11:07:50.098Z","6.0.7-0916a185c8981bfcc4608189e78259d90dfbe768.0":"2020-09-29T11:09:04.806Z","6.0.7-6e9a477a03a1c79cfe2cb7d9aa8f2ea9e2cde162.0":"2020-09-30T03:18:44.071Z","6.0.7-63a01a5a6c847fd8809595c6dea12d82e4ec45e6.0":"2020-09-30T03:20:19.112Z","6.0.7":"2020-09-30T03:20:49.536Z","6.0.8-520e6a7f11e4409dd82908988ce224317a4dfae1.0":"2020-09-30T03:21:21.376Z","6.0.8-3b4ee7435d866aaf04b6be73b4657ba23d4fec89.0":"2020-09-30T03:21:33.608Z","6.0.8-42be46481666f102851ccff90367e09e4d7071a7.0":"2020-09-30T03:22:32.406Z","6.0.8-ca4cccddf69cb82b63808d82f39c2026b6f01e09.0":"2020-09-30T03:22:50.137Z","6.0.8-5e4b63d2e45fb83d7c0127dafeb67f4e5a569654.0":"2020-10-02T10:02:27.044Z","6.0.8-6e286d4dac1b97e5716d5a14e604c8bf817abd86.0":"2020-10-02T10:55:41.085Z","6.0.8-bad34fb81e3983bdc40f62dd6e8a36837416171f.0":"2020-10-02T14:57:14.455Z","6.0.8-15face595b0593a78367a8ae12dd20088704a216.0":"2020-10-03T07:20:47.178Z","6.0.8-0e8104f321063f6c887bba7ba63f2493b782f649.0":"2020-10-03T07:22:06.294Z","6.0.8":"2020-10-03T07:22:31.204Z","6.0.9-ee751f51d0d588a5900b9556822800e2dc8cdbc6.0":"2020-10-03T07:23:12.381Z","6.0.9-eff5d2b422d2bcd15148b5d225b6c66df4e7f0bf.0":"2020-10-03T07:23:31.690Z","6.0.9-c9d4dcd3a4f9763b21babcc922559fc2fc8d545a.0":"2020-10-03T07:24:02.502Z","6.0.9-65f9f4207028b2373a7956d3506002f724302705.0":"2020-10-03T07:24:33.254Z","6.0.9-043ac58580ae05c167b7b7ddf7e7d45e140c6599.0":"2020-10-05T16:18:14.201Z","6.0.9-e66183feec4e52b3d4b9d2245e403503279b4332.0":"2020-10-05T16:19:50.524Z","6.0.9":"2020-10-05T16:20:19.353Z","6.0.10-b3e8043d2009f641ea0efdf78ad5ec02dbcc539c.0":"2020-10-05T16:21:03.432Z","6.0.10-c6effa7836902b1de4fbcb3436809651de464be6.0":"2020-10-05T16:21:28.333Z","6.0.10-0b25ae4f009878ceb7dfb4c0d2e4e84010a4b581.0":"2020-10-05T16:21:58.761Z","6.0.10-8f853141fadabc89845a633d53ea8e23b482e8ed.0":"2020-10-05T16:22:22.710Z","6.0.10-ad2843894d2dc1c93cf77c460fa3a1f587be1e0e.0":"2020-10-06T14:55:25.892Z","6.0.10-2b758fa25340a36455a552f14cb11031880d1844.0":"2020-10-06T14:58:00.024Z","6.0.10":"2020-10-06T14:58:25.793Z","6.0.11-9deb10f5eb81108201e22cf4c2ec2bb11464a8c6.0":"2020-10-06T14:58:44.167Z","6.0.11-aee3a0447711badd2bb3ce8c94882ea3afa5d1f2.0":"2020-10-06T14:59:12.035Z","6.0.11-d8cfaf0c19aca1ded93c7a26b2dbac73da1e081f.0":"2020-10-06T14:59:21.670Z","6.0.11-95be94001c016d510456d7407b7842211d93a298.0":"2020-10-06T15:00:42.492Z","6.0.11-d6277c846ce4bc80b252e971b2960e7e922c941f.0":"2020-10-07T06:05:32.808Z","6.0.11-c5d4690e393c679ac4f2035da5488bdf187fb881.0":"2020-10-07T06:07:08.503Z","6.0.11":"2020-10-07T06:07:26.045Z","6.0.12-5f4d45aa288e30f2025b87b5e8b704b0b153bb7a.0":"2020-10-07T06:08:01.965Z","6.0.12-74939a768e748be50edc937207f4a5f9ae15684c.0":"2020-10-07T06:38:11.726Z","6.0.12-d839f002589fee15f6e05bdf6098f852486dbaa9.0":"2020-10-07T09:37:49.096Z","6.0.12-cd178ed4eeba69b48a96e31d7a50014a52b0df95.0":"2020-10-07T12:14:19.272Z","6.0.12-d3c1a6dafc82db029bcbd347dd98d0b23c840093.0":"2020-10-07T12:48:51.437Z","6.1.0":"2020-10-07T12:49:21.823Z","6.1.1-bfae3addb0a6402ada56e936c7113d9252f08ac4.0":"2020-10-07T12:49:59.261Z","6.1.1-eadc0ee8691d3542376382cec64e93ca25553579.0":"2020-10-07T12:51:02.391Z","6.1.1-bf27f587f53e3ebd9a5f9b7bf817d6aa4cc22132.0":"2020-10-07T17:47:07.574Z","6.1.1-6156a8b4366a92f1b71e6aab00deafda1fadfc28.0":"2020-10-08T12:09:47.699Z","6.1.1-bb7ea0cf3147459bacbbe85107566e4476c7c166.0":"2020-10-08T13:56:14.417Z","6.1.1-5491ad11232358cede5f0abfa7bccd2a916cbbb3.0":"2020-10-08T13:58:30.033Z","6.1.1":"2020-10-08T13:58:56.937Z","6.1.2-5bb196ad5377e9bad5cbada8be7295ee8fadb6e5.0":"2020-10-08T13:59:16.912Z","6.1.2-164d45873b50e68a76ded836a8e19ba3fd42f8bf.0":"2020-10-08T13:59:28.080Z","6.1.2-8412f941d3c01d5547bb81bfe4f375591750a98f.0":"2020-10-08T14:00:32.054Z","6.1.2-e638a7bfcad6d6826b9355fa2d5ef0048fbe680b.0":"2020-10-09T00:42:34.962Z","6.1.2-2aed4a2226260d45cf9634fb2fa7df7acf293b7e.0":"2020-10-09T17:32:23.784Z","6.1.2-278258f787eda33293c05fccc94771a26c1406e9.0":"2020-10-09T17:34:23.222Z","6.1.2-3a91487be63331984ac61670100fc7affe27d1fa.0":"2020-10-09T17:35:45.111Z","6.1.2-a4d7685c21ed6b530140c7fe2847d905a429402e.0":"2020-10-09T17:37:14.721Z","6.1.2":"2020-10-09T17:37:34.927Z","6.1.3-cddf65d96ae13fa9b542fc78e6d409f4b6cc842c.0":"2020-10-09T17:38:22.770Z","6.1.3-90361b86cf6eb5f3ed4ffe19873639d8f045cb22.0":"2020-10-09T17:40:32.224Z","6.1.3-0511a7ae39015886b26cb33857965e70c76f0284.0":"2020-10-10T06:46:08.507Z","6.1.3-9219382970899827aae19f5a8e0aa0ec84697b13.0":"2020-10-10T06:46:26.044Z","6.1.3":"2020-10-10T06:48:53.504Z","6.1.4-2d449530e6417d4334bfa573707703b0c654233a.0":"2020-10-10T06:49:22.464Z","6.1.3-dbd7abd4d3306b07dac2f79b7ba5ea94bb4b2eca.0":"2020-10-10T06:49:39.736Z","6.1.4-7788633ccaed6604f17d049362b2c69da86cef06.0":"2020-10-10T06:49:50.320Z","6.1.4-8d56bfee33b75f216e94b419d9f81091e8d9c327.0":"2020-10-10T06:50:19.859Z","6.1.4-bd9ffeb5595c578c4aeeac05d611728356d33c11.0":"2020-10-11T02:45:48.821Z","6.1.4-b453e091bdf0db8adec5ac79128a95c1ff00449e.0":"2020-10-11T18:18:46.117Z","6.1.4-c7daea96cb3c2ff49355ccdf14276df36b8bf6b4.0":"2020-10-11T18:20:08.320Z","6.1.4":"2020-10-11T18:21:19.530Z","6.1.4-819d4f3a94a78782ed2d01ca750670750c4c7647.0":"2020-10-11T18:21:33.209Z","6.1.5-46231c4a3f1957165ead5d059a56c49627f79a8f.0":"2020-10-11T18:22:07.027Z","6.1.5-f54dcfff0e428bae95374ebeb352b9fe3f64ce72.0":"2020-10-11T18:22:31.179Z","6.1.5-bad737f98381ac83ce03d201ae1cb04c80a2f1ba.0":"2020-10-11T18:23:04.508Z","6.1.5-b37a02a64d6eca0b2d8032062788850934ea6425.0":"2020-10-11T18:24:33.202Z","6.1.5-8c054d4d1311ca3a385a2fded43502143c7b0874.0":"2020-10-12T07:49:07.325Z","6.1.5-acb54f80d3a68083a85c16fc0277c161ed4c8abf.0":"2020-10-12T07:55:46.682Z","6.1.5":"2020-10-12T07:56:15.160Z","6.1.6-9d8e2bc0690efe572e70bf9e5a26f858b1542114.0":"2020-10-12T07:56:40.071Z","6.1.6-3bda81e71eecf4adcc048912e39c78f8f5b62278.0":"2020-10-12T07:57:51.477Z","6.1.6-67ee873bee5f20e22801dcc501982270beee8479.0":"2020-10-12T07:58:55.008Z","6.1.6-1c3794a29561701603c7491579987f76ee5b0799.0":"2020-10-12T15:22:27.052Z","6.1.6-14584d9ece93249663708d1e0961a1db123c5775.0":"2020-10-14T01:24:59.275Z","6.1.6-a2ae36a626e3f7d794c6bb12e76d23b6f496cc49.0":"2020-10-15T09:21:09.357Z","6.1.6-614434563afa9210c9c87af7cc10bd3a324cd56f.0":"2020-10-15T09:22:18.978Z","6.1.6":"2020-10-15T09:22:38.122Z","6.1.7-48a68082f261359a2196488b12c0a01e72491eac.0":"2020-10-15T09:23:05.346Z","6.1.7-cd187aa69b0126cc74a35371553c28a21c5487c7.0":"2020-10-15T09:23:20.457Z","6.1.7-c597fb7d53a66f9c6a210ee7460a6d9d9a63e45c.0":"2020-10-15T09:24:01.482Z","6.1.7-ef4873aea09c6cd2304139ad8365930cb48faeec.0":"2020-10-15T15:44:11.143Z","6.1.7-93d2807ea52a4f5741a4bde4d0ca1dc2ee88a5d5.0":"2020-10-15T15:54:47.511Z","6.1.7-c496cc34ff6f7decfb8c95c7438a47effa58d1e9.0":"2020-10-16T17:04:54.353Z","6.1.7-d22b206e94c1106c08155003a84ea808300d9a02.0":"2020-10-16T17:05:43.739Z","6.1.7-32840c2c8c452876b2827932287be9b6e4074c8d.0":"2020-10-16T17:06:07.668Z","6.1.7-54b44a857507a16b009f8ea86bcfcbefed9f4982.0":"2020-10-16T17:06:43.919Z","6.1.7-9f46206645ad4d024793ef893c0320387954d455.0":"2020-10-16T17:07:01.311Z","6.1.7":"2020-10-16T17:07:16.241Z","6.1.7-ad1fa127da3d766180e493a1c775aa4c6a0f2ad6.0":"2020-10-16T17:07:40.473Z","6.1.8-0dffd1335f9a4530b4ab17888f6fbd24f91aeaa3.0":"2020-10-16T17:07:58.134Z","6.1.8-7edd69b8b1239b4417535b35935d883f22eb72f8.0":"2020-10-16T17:08:38.238Z","6.1.8-68c3d47832fafba0437edfdac0d97e183dc52460.0":"2020-10-17T06:51:11.718Z","6.1.8-ce5aec34518ff75a309238577a445aeab97bfd16.0":"2020-10-17T06:53:47.505Z","6.1.8-66fa48d21e2d916263ab9dd05911cf42345c5960.0":"2020-10-17T06:54:53.134Z","6.1.8":"2020-10-17T06:55:17.028Z","6.1.9-b302bdc95eda3f0acf0df7d1643ae7fe6792f546.0":"2020-10-17T06:55:53.808Z","6.1.9-81dccf2d450fbdea08989110b77e1c642dfcdeb9.0":"2020-10-17T06:56:18.291Z","6.1.9-5e7c3890f290f74ce8e9f089811db7a8c133a5f2.0":"2020-10-17T06:56:27.729Z","6.1.9-7ba495c75020880c932edfb942d26e0c62d66436.0":"2020-10-17T07:06:41.519Z","6.1.9-bcb249c2783a5869a8185428c9db1f321980b00d.0":"2020-10-18T00:59:21.050Z","6.1.9-469ee7a81a714da7e8f33726a2dc4c92f5d98410.0":"2020-10-18T01:00:17.396Z","6.1.9-cfbfc5791f061dff2060df886ea1c20f0a60cb4c.0":"2020-10-18T01:00:41.296Z","6.1.9":"2020-10-18T01:01:03.207Z","6.1.10-ee0a0c92f7348428975c1fc7f28321fccd5ffe59.0":"2020-10-18T01:01:20.158Z","6.1.10-8414241844c745e7853bbfbaa59cc0705469098f.0":"2020-10-18T01:01:55.521Z","6.1.10":"2020-10-18T01:02:19.152Z","6.1.11-602276b1cbc29c32a87634f8922b5bf4e700acbb.0":"2020-10-18T01:02:45.321Z","6.1.11-16da805a4e8574b578a853badb1f229d10b8f528.0":"2020-10-18T01:07:17.715Z","6.1.11-25996429ccf97cbfe8d4bc1d81ab2f35a59a06d4.0":"2020-10-18T04:41:44.463Z","6.1.11-94fa9fddf23c3d14305329b96e0881274dec61b9.0":"2020-10-18T16:35:56.634Z","6.1.11-9af53f7bd5ff4cf5074ec66ee157d07b354d0c86.0":"2020-10-18T16:54:25.595Z","6.1.11-3954c0bf0b0ce1dad1fbe6c41a262bfe4b876f35.0":"2020-10-18T16:55:59.493Z","6.1.11":"2020-10-18T16:56:11.361Z","6.1.12-f7e27f531d1de90d79e4ab864cdd4a7884df2e62.0":"2020-10-18T16:56:34.917Z","6.1.12-ea68e3b68aaefe289232de7d8d50d3e5aba4a4a0.0":"2020-10-18T16:56:45.768Z","6.1.12-f65d8b92d20f2d32b835e18105530c41a33b5949.0":"2020-10-18T16:57:51.821Z","6.1.12-4fa1bcc93c15d06889f3cdd8ad899ffc725922eb.0":"2020-10-18T18:11:13.724Z","6.1.12-c19edcc28c81db91dd8777533948ce2b9be078b3.0":"2020-10-18T18:32:30.393Z","6.1.12-dfa658ba024c5eb9e463d4ba712a7e74a527b1d5.0":"2020-10-19T15:38:40.408Z","6.1.12-0b373186bf190be99cf16eaa6ad6cf4e4ffaef9a.0":"2020-10-19T15:40:10.894Z","6.1.12":"2020-10-19T15:40:44.341Z","6.1.13-501c0d6dfa721f75c4e49d7316926912b56b4407.0":"2020-10-19T15:40:55.063Z","6.1.13-fe4e3945d183489cd4ae3f09e02cdbab202076be.0":"2020-10-19T15:41:11.859Z","6.1.13-92f51823b1ec472b5eb93f97c150a1646376fcfa.0":"2020-10-19T15:41:38.941Z","6.1.13-68474fae9902cbbeffc89d5151e33e8542398e15.0":"2020-10-19T15:42:16.641Z","6.1.13-8ee4bb835752f81a760e1820b20f808bb4d0d08a.0":"2020-10-19T15:42:37.768Z","6.1.13-a422c41df86f43c572431abc49fbda481109a912.0":"2020-10-19T15:44:29.752Z","6.1.13-9af5113c5c30b3ae013eed8929073a1ea24993c0.0":"2020-10-21T09:21:48.911Z","6.1.13-abb45c3de976d5b4fc7b5be9712bf6d12960d629.0":"2020-10-21T09:23:00.968Z","6.1.13-26a1ec61bf60695455fde37e16e6473b29a55d46.0":"2020-10-21T09:23:16.825Z","6.1.13":"2020-10-21T09:23:48.496Z","6.1.13-1ddd752fc4a7b584ea3ec31873c19145c3075f62.0":"2020-10-21T09:24:14.641Z","6.1.14-ff6e009719f0ad92876f05e427f6c8176c7af60c.0":"2020-10-21T09:24:23.906Z","6.1.14-817f7e55054ba5e4618481d33a2bfe48811f3613.0":"2020-10-21T09:24:46.845Z","6.1.14":"2020-10-21T09:24:58.303Z","6.1.14-4ed264b446c83fcbbc983e228a0e0cc1bb30687b.0":"2020-10-21T09:25:12.355Z","6.1.15-e00fe5731b080e2783df3d9babea870db9b47196.0":"2020-10-21T09:25:26.957Z","6.1.14-d61a871f4b76db05bb1e8b38d329f492a95ba1ea.0":"2020-10-21T09:25:57.177Z","6.1.15-71a4b9e81d275fe1d91f9d51c6f59da5ae68adff.0":"2020-10-21T09:26:19.373Z","6.1.15-543170ba4afcc9df511762b4e3b7917b73b6c18c.0":"2020-10-21T16:50:13.796Z","6.1.15-a6b441a936c9205a2e1b0be75dea56c45b963fff.0":"2020-10-21T17:13:28.655Z","6.1.15-72225c42b94c49fd2e04449115e6c347176f6987.0":"2020-10-21T17:16:18.277Z","6.1.15-edc47b444a66aa7abb97efbdeaec3ca071827c2d.0":"2020-10-21T17:17:35.577Z","6.1.15":"2020-10-21T17:18:29.022Z","6.1.15-570298205e3191ab40290b87a871e3c7645222a1.0":"2020-10-21T17:18:59.475Z","6.1.16-333b939098d7de50a97f433c0f3bf07979f8eb03.0":"2020-10-21T17:19:23.743Z","6.1.16-c604e7d45a24b31ed7f50c2ceeedf2de899bb2be.0":"2020-10-21T17:19:58.670Z","6.1.16-dad2953f30d84f832b4e077da3efc00456c934f5.0":"2020-10-22T00:39:21.664Z","6.1.16-29acd622ea58a3a871969acda28bf63069205f5a.0":"2020-10-22T00:39:42.738Z","6.1.16-a780990a0330c7f96634bc420d3b64b345816023.0":"2020-10-22T09:18:43.195Z","6.1.16-1160cb4b16b49b6bd0649fd877c5227c750cf666.0":"2020-10-22T09:20:50.398Z","6.1.16-043140b7923a95092ab9ef9f69d9f721fe903eb8.0":"2020-10-22T10:08:15.200Z","6.1.16-0a1a97f3b0d36290e905328694555c640724597e.0":"2020-10-22T11:51:16.156Z","6.1.16-7f06ae37524f990fe0df6864e74fa346597edfcb.0":"2020-10-22T11:55:03.218Z","6.2.0":"2020-10-22T11:55:22.582Z","6.2.1-33eeb772088d819aa5e001b67ce820b5bf11db19.0":"2020-10-22T11:55:44.073Z","6.2.1-cedf5935001b5c6e0bd2a0189852746bed20cd5f.0":"2020-10-22T11:56:54.284Z","6.2.1-ced9ec2b48a811774374c3141219180494c7f042.0":"2020-10-22T18:50:26.476Z","6.2.1-10694e6193189d8c8a82242ec642cbd45b5554ff.0":"2020-10-22T19:21:38.304Z","6.2.1-2a42ace8516c4d2bbc3b3ea36c5ec180971378fd.0":"2020-10-23T02:28:50.510Z","6.2.1-a0357fdc222d5eeccdeb8f19cee2b9ff8b5977e8.0":"2020-10-23T02:29:20.153Z","6.2.1-66586f4a8e60e39b13525a50835a8317b857530f.0":"2020-10-23T02:30:07.572Z","6.2.1-c90616ab46be91c89e975fdef30f63c36b3bd4e6.0":"2020-10-23T02:30:43.565Z","6.2.1":"2020-10-23T02:30:58.834Z","6.2.1-401af40310da0b5f35d506c9f84e8310bc51b991.0":"2020-10-23T02:31:22.730Z","6.2.2-c714eff56eec8cbdebaa2065aa1c76f7bdc1d419.0":"2020-10-23T02:31:45.988Z","6.2.2-ce42854cad6db296c8ce832ab85e041c36652ada.0":"2020-10-23T02:32:30.700Z","6.2.2-9d49f235afefe1f7e3ec8cfea2bedb4b2c2e2b5f.0":"2020-10-23T11:26:47.717Z","6.2.2-95ff803a311380b98f78733a116ee208f0ee4cd2.0":"2020-10-23T11:56:29.134Z","6.2.2-e2f5d32c46d2ece6b923b48e9d32e0e90b1434b2.0":"2020-10-23T16:44:41.892Z","6.2.2-2ac4145bf0906ea0a248d84a9132944ffdc09004.0":"2020-10-23T22:42:30.197Z","6.2.2-a72c5a42f1ed3dd416c84fa53920bfcac512d455.0":"2020-10-23T22:43:28.114Z","6.2.2-6fccb7434a4c900842c2d473e7595aba262dc164.0":"2020-10-23T22:43:47.555Z","6.2.2-9d4f1302cbb38159900c40d6bb9f5e2a8c16f218.0":"2020-10-23T22:44:37.845Z","6.2.2":"2020-10-23T22:44:59.309Z","6.2.2-cdfa0bb2a8de2dac448ded5eaad6b33c05252a9e.0":"2020-10-23T22:45:19.886Z","6.2.3-8cbc6e3ce7485bb5b39abe418f654c7b2870ffdf.0":"2020-10-23T22:45:29.378Z","6.2.3-c6637dfa94af293ceb000e1b0d655da2a0ec8ea8.0":"2020-10-23T22:45:46.440Z","6.2.3-fc5ffe19e72abf86ad598b263afbce7f48659a21.0":"2020-10-23T22:46:12.258Z","6.2.3-4e85e6bab8ab80167be16e62fcf2d6c15c4af51f.0":"2020-10-24T18:01:24.018Z","6.2.3-fa363fbce301c06fadb968576e758a469775cf7c.0":"2020-10-24T18:48:25.171Z","6.2.3-ad00dcbd21b2658d469c36a59d7b8193fb5bb3e0.0":"2020-10-26T04:39:06.719Z","6.2.3-f1244fa21eb781ce047277fb42bbc2370ee6aef4.0":"2020-10-26T04:40:12.232Z","6.2.3":"2020-10-26T04:40:31.357Z","6.2.4-1fb7613757e238e7b37105911a2c0548370b8a2b.0":"2020-10-26T04:41:08.450Z","6.2.4-64c71faaf3b2cb60598fcda63e06a9a9fcf7cf66.0":"2020-10-26T04:41:35.426Z","6.2.4-69de05136f039e331cacd185f5807f60b29ef1ff.0":"2020-10-26T04:41:54.131Z","6.2.4-feee3cca6607d12cfde2bb9401a2ccc57d41cbf1.0":"2020-10-26T04:42:10.005Z","6.2.4-9366d7f6c9b66d002ee866b1014b8f8916cf15c8.0":"2020-10-26T04:42:26.613Z","6.2.4-970a05be45647dd9c604198e888bafb225bbb16c.0":"2020-10-26T20:20:07.027Z","6.2.4-f654455252df0919c114b129a12e1adf72ce063e.0":"2020-10-26T20:21:33.844Z","6.2.4":"2020-10-26T20:22:04.708Z","6.2.5-e2ee08b2ebf41427095a48e9e9b35d93242eda2f.0":"2020-10-26T20:22:30.126Z","6.2.5-e7d84acdcc6d73c5787bcd54802e8437b3c00686.0":"2020-10-26T20:23:50.845Z","6.2.5-ec056d230b44b87a5ccc4eb4bda395b260f76294.0":"2020-10-26T20:24:15.876Z","6.2.5-57397002774aaf1afc58944ece2bccb9f52132de.0":"2020-10-26T20:26:36.662Z","6.2.5-e1c576a6163dbec49cde56626485c56714aaec07.0":"2020-10-27T04:39:23.639Z","6.2.5-79d77a2373b00411937cf7fe4e4e06d7a7307f33.0":"2020-10-27T19:38:37.639Z","6.2.5-2bce2e23f1d7e22a6fb419d468c2aef20ac234b8.0":"2020-10-27T19:40:04.713Z","6.2.5":"2020-10-27T19:40:27.830Z","6.2.6-e2157588d59827ff78832e1ed3a784b92159dc09.0":"2020-10-27T19:41:01.894Z","6.2.6-cc5831f644fb930bbe5421905426e5280e03548e.0":"2020-10-27T19:41:12.660Z","6.2.6-6a12ff15059e596f657d2ef3a6da4a1bde842341.0":"2020-10-27T19:41:51.726Z","6.2.6-e97f606b8645bb09bec6e0099aca2f5751ba69a5.0":"2020-10-27T19:42:16.528Z","6.2.6-12cf2d2d6b1e32d7e058d1fc8ac1ccc9eb489740.0":"2020-10-27T19:42:44.100Z","6.2.6-279b77026d401b72cd0758b1da1691eb0016c2ad.0":"2020-10-27T21:44:47.860Z","6.2.6-ab55938a5eda336ab1bbcb2aad2a65f7a2f179bc.0":"2020-10-27T21:46:16.767Z","6.2.6":"2020-10-27T21:46:37.843Z","6.2.7-0e176167e6cef0e74af3898d373bc864a893bb2f.0":"2020-10-27T21:47:03.782Z","6.2.7-6915d3ebeed0e532e57ef1d3dc23fa01dd5c4784.0":"2020-10-27T21:47:36.806Z","6.2.7-6825f0b08c84f436c858d80b53897fff2d6009b0.0":"2020-10-27T21:48:14.523Z","6.2.7-d897693427f7d02238dc4a7e6c6c390670b523e6.0":"2020-10-27T21:48:45.577Z","6.2.7-99c18ef6cefb2b77d0d39074ceb8c749935f7f13.0":"2020-10-27T21:49:21.440Z","6.2.7-23506457d8c3b10bcc5d47beddc6491d9e9a24fd.0":"2020-10-28T06:40:50.330Z","6.2.7-f644a1f6d20fca4ae607160425c5e33016e2f680.0":"2020-10-29T20:34:22.651Z","6.2.7-4f442a6ff27692d1755a074656491b8a75bfd2dc.0":"2020-10-29T20:34:55.931Z","6.2.7-18ce2b91f8af0c93193eabcd7ffe491860e73ff6.0":"2020-10-29T20:35:34.437Z","6.2.7":"2020-10-29T20:36:02.134Z","6.2.8-211144a5225148c6f8f49d84ea93ee5710f8b268.0":"2020-10-29T20:36:28.427Z","6.2.8-29905a81a12542cea4a0927bc6b5c61984a5faa3.0":"2020-10-29T20:36:59.364Z","6.2.8-ade5f3070c473d4ce3be2705dce761db62829da7.0":"2020-10-29T20:37:38.984Z","6.2.8-80ea3af51e5d0a08555f5cf6e0f049ba997fbb13.0":"2020-10-30T11:57:30.391Z","6.2.8-12a601f2bcdbd90114cecfb4c60ed03427f03d29.0":"2020-10-30T12:02:34.832Z","6.3.0":"2020-10-30T12:02:46.511Z","6.3.1-9f5cfbe5d3ca64e0aa8dda2579f1fa4206603154.0":"2020-10-30T12:03:19.483Z","6.3.1-1a2e5c0003c1668c9623332a33a5bd7e8f71c717.0":"2020-10-30T12:03:58.860Z","6.3.1-3bdffc3ab2370dde28342311a48849687323d66d.0":"2020-10-30T12:04:47.573Z","6.3.1-3600983c48882bec439993733debda87d1404989.0":"2020-10-30T12:07:24.887Z","6.3.1-6c6c9e85003d3dc6989bb3883c749b4831f9527d.0":"2020-10-30T12:07:55.278Z","6.3.1-7feeaced78dee50f86a0ac0729ad0e37cb1cdd17.0":"2020-10-30T23:22:53.133Z","6.3.1-05f100a10b641a9cc63876e04ffbf030338b1950.0":"2020-10-31T13:40:25.074Z","6.3.1-0357ca932a9424f2df96d3f93dfc14bfbe7d7baa.0":"2020-10-31T13:41:38.146Z","6.3.1":"2020-10-31T13:42:12.083Z","6.3.2-500cb346ad27706256e0f926c130fc2d51ec25f0.0":"2020-10-31T13:42:35.105Z","6.3.2-1c814425eff52f25bf7dd15b5e2bc01da1eb8129.0":"2020-10-31T13:42:56.314Z","6.3.2-8baca90bca67be5d159ac300fd87e93c31ab03bc.0":"2020-10-31T13:43:40.574Z","6.3.2-a54bc9d204adf5b2a574f1b07d631d9d551712b7.0":"2020-10-31T13:44:04.510Z","6.3.2-1ed5317efac1d3136bbb6180267f5a4f9cf0a823.0":"2020-10-31T13:45:14.886Z","6.3.2-04aeb8f02dfbd66a3ea3cb12da3afd6831ae1c67.0":"2020-11-01T09:32:40.550Z","6.3.2-5e84afacd0c483fe9b72d7ba9ec7be3dd0524bc5.0":"2020-11-01T09:34:23.367Z","6.3.2":"2020-11-01T09:34:48.361Z","6.3.3-cf1bdce7615676f31f8b4cf351d88b704daf8966.0":"2020-11-01T09:36:00.489Z","6.3.3-e8b59efa4e323f031c244655532f806df1f62a08.0":"2020-11-01T09:37:46.298Z","6.3.3-b14373c0cbffd72c69f4c2bbde53f6a79bdc40f2.0":"2020-11-01T09:39:20.997Z","6.3.3-b54b7c252a5115a6c4ba8f34535ad8dff8b47fc5.0":"2020-11-01T09:40:31.364Z","6.3.3-fb64f392090095fddc29054c64fb10ab40714140.0":"2020-11-01T09:41:20.700Z","6.3.3-08bed17cc9791fb34515fc1c6c82690f842d1606.0":"2020-11-02T13:09:32.737Z","6.3.3-3615e67a505bc6e3cfacc55cf5e85108f521bec5.0":"2020-11-02T13:11:02.660Z","6.3.3":"2020-11-02T13:11:19.292Z","6.3.4-1b126ff1a8bdeb5988777b6a8197a27fd50bdfa0.0":"2020-11-02T13:12:02.312Z","6.3.4-9234fe24f099772b2da4eec3ee304f7e9144c04c.0":"2020-11-02T13:12:40.751Z","6.3.4-ec119ce8916ef9349e6f0870ee01c2dd25d9b7af.0":"2020-11-02T13:13:21.079Z","6.3.4-51cf808664023dc74d9a4a6fe0aa02332969bde7.0":"2020-11-02T13:13:56.243Z","6.3.4-51c776d225ed29299fee23880700508f6af65b14.0":"2020-11-02T13:14:28.746Z","6.3.4-34d4f48d0d64591534b2f1257618a8bda077d938.0":"2020-11-04T07:22:03.411Z","6.3.4-e5bb7ce0f3e3d8585bd96c53b5cf01e33ba4adfa.0":"2020-11-04T07:22:21.071Z","6.3.4":"2020-11-04T07:22:36.730Z","6.3.5-a9f58eda568255a4319c63c42da32ffa2f4378fb.0":"2020-11-04T07:24:14.811Z","6.3.5-3e056ecbf6c975237fbacd11f95cfa1e74cbeb56.0":"2020-11-04T07:24:30.353Z","6.3.5-f115bc699f01b0cb22bde831b75d2a37aa2b1e64.0":"2020-11-04T07:24:54.241Z","6.3.5-cd429b29a38a391a19d4388afb96ba3176f44714.0":"2020-11-04T07:25:49.797Z","6.3.5-ea18a2fdc20d22a8ae1f46a235dc0d38e539ef42.0":"2020-11-04T07:26:11.055Z","6.3.5-4ee427763c137df916dd2d04675f23a27ac7af48.0":"2020-11-07T18:33:23.130Z","6.3.5-04c978cebb00b2e0e8bf96d0039bf5b550352378.0":"2020-11-07T18:35:00.753Z","6.3.5":"2020-11-07T18:35:23.032Z","6.3.6-c87297a68f27633a892229c64837d121d914d105.0":"2020-11-07T18:35:49.542Z","6.3.6-241e61f9345185371ddb24c885c1110df98ba2c9.0":"2020-11-07T18:36:13.993Z","6.3.6-8cde942c72fa0b43b529ea6bbe91387149bf1a4f.0":"2020-11-07T18:36:34.651Z","6.3.6-fe64c858b901719feebbed1c90f12286fd86f731.0":"2020-11-07T18:36:58.198Z","6.3.6-72a149e190d22a8777eaab4535a66f23231c0aee.0":"2020-11-07T18:37:17.461Z","6.3.6-31b9f3f350f265804950621594054756ab5dae74.0":"2020-11-08T15:33:19.707Z","6.3.6-146fddaaa8aa168f522e2c2647e4201827a1a0da.0":"2020-11-08T15:34:51.923Z","6.3.6":"2020-11-08T15:35:12.830Z","6.3.7-cd0335ed48eda2f6078b231432e5858a2596c27f.0":"2020-11-08T15:35:25.885Z","6.3.7-6924600bfdcd003054b6186b1e962e9a576e92e4.0":"2020-11-08T15:35:55.455Z","6.3.7-4563f8303a70c8df1b27ec4ee22a98a152ee9631.0":"2020-11-08T15:36:26.485Z","6.3.7-18edb3c451c43201f1aec22242167a65488580dd.0":"2020-11-08T15:36:36.281Z","6.3.7-62b09472e230df17eb8c2736be8767bf1580f5e9.0":"2020-11-08T15:36:57.084Z","6.3.7-d41465d57729b47ce1719d0669d2a7e73c3662cf.0":"2020-11-09T07:40:43.879Z","6.3.7-c620c99fb46c07274de690df71334a63ddce58e9.0":"2020-11-09T07:41:56.427Z","6.3.7":"2020-11-09T07:42:54.480Z","6.3.8-4ac80094a6cdadb7b39c3d220e51de46aca36797.0":"2020-11-09T07:43:25.029Z","6.3.8-c342209703cb66ca76ab87d32769ffc4515d85e0.0":"2020-11-09T07:44:07.310Z","6.3.8-5254b5c362ee89e5166c82f05a0ac74ae9c0d4e7.0":"2020-11-09T07:44:30.996Z","6.3.8-46d44f0787559a20384e076437b5fa3e6f99953f.0":"2020-11-09T07:53:57.043Z","6.3.8-97b522d2009eed5741bf0cb4caf18f6df8067624.0":"2020-11-09T14:17:31.438Z","6.3.8-6554ae0ed7e14caa68d18e24fd75027c03f1f5e9.0":"2020-11-09T14:19:28.080Z","6.3.8":"2020-11-09T14:21:15.612Z","6.3.8-9a7657e092665b34a1e580e1e59ebc40a0c88362.0":"2020-11-09T14:22:03.077Z","6.3.8-ffd8c67f4d5b7df7b7414377716ce19aa441720b.0":"2020-11-09T14:24:32.576Z","6.3.8-c49c7e38ed2f5007530be2d7d3b04f2733135561.0":"2020-11-09T14:26:36.663Z","6.3.9-6c1bbea72535e76cafe572ef2584e309121f19a3.0":"2020-11-09T14:26:53.041Z","6.3.9-09f4a11f3c44ab3c973e893ef61fc12800393adb.0":"2020-11-09T14:27:17.611Z","6.3.9-f5538622ff3bc214fc68ffb44bc37639ad19561f.0":"2020-11-09T14:27:41.738Z","6.3.9-6b3bf769f6187a2ed5eb6f99134430bd3b056781.0":"2020-11-09T14:28:54.492Z","6.3.9-1f7f554e4f70ec2d5184604c98773a5d372f536b.0":"2020-11-09T19:53:23.546Z","6.3.9-1487a0816b911cb6f0383d3aba8afdd38af3e71c.0":"2020-11-09T19:54:44.616Z","6.3.9":"2020-11-09T19:55:17.567Z","6.3.10-f4e14f150b9f4c9c5858940583968ec4b33b74c6.0":"2020-11-09T19:55:43.960Z","6.3.10-626bf6e10340620b69dbb4bd829bacb48205ebf3.0":"2020-11-09T19:56:05.681Z","6.3.10-18f5b1c627bf8ccc8d77a3bf156a750e4ef005a2.0":"2020-11-09T19:56:39.355Z","6.3.10-e711aa956151005d0947a5525d094f3ec885d05a.0":"2020-11-09T19:57:00.881Z","6.3.10-d1c68826bf3a52d47c24a779054ff7fa31b84828.0":"2020-11-09T19:57:25.863Z","6.3.10-aecea1847bd66ee0333cced71fdc012903f50d24.0":"2020-11-09T19:59:09.049Z","6.3.10-7cb45d37e434bae1189611b84d93121eb9dc7fbe.0":"2020-11-11T03:41:45.250Z","6.3.10-744412ae6407e76df81cb086deaf1fafa6f2c156.0":"2020-11-11T03:43:26.378Z","6.3.10":"2020-11-11T03:43:37.319Z","6.3.11-74565303991823e6faf44a67712efe95b0a50759.0":"2020-11-11T03:44:16.760Z","6.3.11-9090654372cb26f9f7456d6a93018b98b5bcae6d.0":"2020-11-11T03:44:42.656Z","6.3.11-e13afba1531e56f08c5964d8048053a9558b0390.0":"2020-11-11T03:45:21.923Z","6.3.11-71e8de978bcef6af2cda43cb783cfb73305ad97c.0":"2020-11-11T03:45:46.256Z","6.3.11-ecd2d11dcaaab2b1cea2d9a6fe5b5fac9f985c3d.0":"2020-11-11T03:46:58.638Z","6.3.11-cca30d61084fb9354aa3e895e869af2cc6836e73.0":"2020-11-15T20:47:53.110Z","6.3.11-5913a02c36e86f38b802744a0b00f4fa27c84cd7.0":"2020-11-15T20:49:15.620Z","6.3.11":"2020-11-15T20:49:27.659Z","6.3.12-4065c6b5024f48477675b1f6ee92600c7bfa298f.0":"2020-11-15T20:50:14.894Z","6.3.12-9a05e06f4666c5890643c63867dc936d32a3e187.0":"2020-11-15T20:50:45.976Z","6.3.12-dcf8d1f5fe83c9a25454ea0ee62519142c9af945.0":"2020-11-15T20:51:08.983Z","6.3.12-777bdb889ffcff51662e32fc27a3406b2bea886f.0":"2020-11-15T20:53:13.778Z","6.3.12-6f789660f15a02cc21601b932c2f9d36dc1696f2.0":"2020-11-16T07:18:58.850Z","6.3.12-ded8fb077da20ac403e45ae22e243e7037c2dfea.0":"2020-11-16T07:19:50.986Z","6.3.12":"2020-11-16T07:20:24.230Z","6.3.13-95227469a5a3bc05738a2b1c98b666a1f5d49b7a.0":"2020-11-16T07:20:52.770Z","6.3.13-23de3a40132bc8b91e15a0e3724300a19822693e.0":"2020-11-16T07:22:04.360Z","6.3.13-892a915f5356b9d89ff831f1b84beeec55b1901d.0":"2020-11-16T07:55:06.116Z","6.3.13-8eda3491cea12ada6c61bad371f8eff860a6a066.0":"2020-11-17T23:25:15.273Z","6.3.13":"2020-11-17T23:27:08.323Z","6.3.14-4765c619b6082d76bcf084c50827182b764900bd.0":"2020-11-17T23:27:57.769Z","6.3.14-fedbed1b88a0c35d0b7b10a324dea27b6e5c3445.0":"2020-11-17T23:28:35.869Z","6.3.14-8d1ff3474540ab67af9e71c8ca38ed2d5661da7e.0":"2020-11-17T23:30:25.333Z","6.3.14-f1a0b72b562bfc38c7e06118abfe7cdd414055fe.0":"2020-11-17T23:30:44.301Z","6.3.14-6508527a71892c98c980a5b32c558cbb455bf8e1.0":"2020-11-17T23:30:57.900Z","6.3.14-f0899962e685e313c39c216b8393ebe6a6937abb.0":"2020-11-17T23:53:21.848Z","6.3.14-ad6f7a1e83ad6486c27a049889c741fb3bd4c145.0":"2020-11-17T23:54:49.508Z","6.3.14":"2020-11-17T23:55:23.121Z","6.3.15-5b431ba2c69d5a9003749f86732d1809bf42725b.0":"2020-11-17T23:56:19.544Z","6.3.15-3e28c52cc96eaca9027f66912dd1781fea02c096.0":"2020-11-17T23:56:46.284Z","6.3.15-58331d50a692ee890d02b6688135acda4cac20f1.0":"2020-11-17T23:57:06.069Z","6.3.15-6a8c55c2132fd46d68d96d344293c87dee09770a.0":"2020-11-17T23:57:21.292Z","6.3.15-21bb96301b0059d8533b6d506d8714304eda5be5.0":"2020-11-19T21:38:08.363Z","6.3.15-36b3369b6ff39e9b92db8c33e7615e82ed5c797f.0":"2020-11-19T21:39:52.169Z","6.3.15":"2020-11-19T21:40:17.767Z","6.3.16-ad97ccc894b83bc3d33552b9b67f53e0c084cc37.0":"2020-11-19T21:40:44.778Z","6.3.16-fa765036b36b71104a0bee2d3183a8cdd44b94d5.0":"2020-11-19T21:41:33.452Z","6.3.16-e4b1dd9b8c162f842539f6d32dd74fd08d2e8e8a.0":"2020-11-19T21:41:49.251Z","6.3.16-8a833b00e022a92081170ed8e3ec26fb66a80ab5.0":"2020-11-19T21:42:03.095Z","6.3.16-ab1af21c25a2ca154f7bfa16952f0ae52a1940e5.0":"2020-11-19T22:07:50.219Z","6.3.16-2c566bf3dbf7e6bf1cd842994803d8fd647ae4f6.0":"2020-11-20T06:21:15.613Z","6.3.16-78f01c95883ea4d5d0fd72cbd24dccd6d5a65ac9.0":"2020-11-24T05:19:46.529Z","6.3.16-35bf36568dd6d8702cefccbd5167a213ce1fdda7.0":"2020-11-24T05:21:15.073Z","6.3.16":"2020-11-24T05:21:34.011Z","6.3.17-73899a15ace8a1d461f6e1646224da7c19e15d55.0":"2020-11-24T05:22:24.178Z","6.3.17-42194c360110e1b5d9be6cef712debfb3c8f271a.0":"2020-11-24T05:23:40.482Z","6.3.17-799035fd68f41cc3ca86887c4b5599b39c8d5d41.0":"2020-11-24T05:24:07.989Z","6.3.17-9f5cc01c949beebe74d618a725494849691f42e1.0":"2020-11-24T07:09:25.863Z","6.3.17-3c9056a9842836410b0d9496be6b86dd3187f7d9.0":"2020-11-25T07:04:36.897Z","6.3.17-4f4b99252254bc28d3e5763c338b4ce918491cfc.0":"2020-11-25T07:05:51.471Z","6.3.17":"2020-11-25T07:06:17.936Z","6.3.18-5a780f045aeae2859fb090fb7fa1ede751e7204e.0":"2020-11-25T07:06:46.513Z","6.3.18-59f2679245990afe9718c870348aed41094844af.0":"2020-11-25T07:07:06.900Z","6.3.18-1632b4349b8fda5a1e4ef4a119693309f815c409.0":"2020-11-25T07:07:45.357Z","6.3.18-c059d56c50d14f2bf80e84b4acb435f8bb88f30c.0":"2020-11-25T07:08:18.240Z","6.3.18-62ff3a774e49faa509d2cedbf09c97e1cee32267.0":"2020-11-28T00:32:24.027Z","6.3.18-74eb7595ad8eb5349f04c22bccd9e22e90ac244d.0":"2020-11-29T16:44:44.353Z","6.3.18-d8cebeeb4eaa417f2650efb03caa45bddedda4f2.0":"2020-11-29T16:46:01.138Z","6.3.18":"2020-11-29T16:47:04.425Z","6.3.18-54cab0b2115ab78d3299b861119e2944ad6e5b35.0":"2020-11-29T16:47:25.640Z","6.3.18-060126fbbdba1e9c37c8a8958a8fb8d9dbe9085e.0":"2020-11-29T16:48:25.066Z","6.3.19-fa5de9b2715454f6ae1bffcfb260ee4c8024765f.0":"2020-11-29T16:49:14.330Z","6.3.19-e12684ec0f9fc31717d3f5295ca78b036c4f24cb.0":"2020-11-29T16:49:44.205Z","6.3.19-e4bcb63598923cf5e8a163dd979af6f3ad65d2bc.0":"2020-11-29T16:50:15.316Z","6.3.19-81b64392e030b1b90ac8c89fa1e77d132270b9e0.0":"2020-11-29T16:50:42.236Z","6.3.19-c3537c91d19f187e2cf280d8c5532c0acb893a2b.0":"2020-11-30T12:09:12.036Z","6.3.19-00f9e2a5e23422fb260b0b125aadd328c39e22ee.0":"2020-11-30T12:10:28.116Z","6.3.19":"2020-11-30T12:10:54.920Z","6.3.20-f7076ca42cd93d2b0f7dbbb8a434831d4cd64553.0":"2020-11-30T12:11:34.159Z","6.3.20-0cf9e76cf90ea2cb3c69088c5848f3c0b0452f93.0":"2020-11-30T12:12:35.520Z","6.3.20-d83f5b42d67d72221a169f5330564404eee20f88.0":"2020-11-30T12:12:55.285Z","6.3.20-72cae099a9c81c6d413a2a0f11c16c123d9b75c8.0":"2020-11-30T12:13:31.166Z","6.3.20-606c6f21cb322bfc1f0c230ad168fa44e3bfea63.0":"2020-11-30T12:14:48.440Z","6.3.20-a564e5a2f82d6c92eacb936139ec16e6fbd03fd0.0":"2020-11-30T17:04:20.170Z","6.3.20":"2020-11-30T17:06:22.195Z","6.3.20-e290b154aa29dbac841f110e71337240ccbbe895.0":"2020-11-30T17:06:48.875Z","6.3.21-99c0f370eebea1bfb26f0dc49ae461fd2037a34d.0":"2020-11-30T17:08:45.188Z","6.3.21-839d5829d94cdffa0889550b9224e1f1e8e5a495.0":"2020-11-30T17:10:09.716Z","6.3.21-3505fbdb26c5237b7f4ec5cf3774bc034ea6e53b.0":"2020-11-30T17:12:10.312Z","6.3.21-7d449b84935e3b6d4eef0a6013e6c9ddbd17e9fd.0":"2020-11-30T17:13:53.193Z","6.3.21-62255b4f2ec9e362f7116d0e68e09133d183b722.0":"2020-11-30T17:14:12.009Z","6.3.21-bd006a37f63b378b83450898556c71f80c29ff0e.0":"2020-11-30T17:14:31.965Z","6.3.21-b4c8788c62e8290a23ee2b060d7b16a803954a01.0":"2020-12-01T20:24:37.151Z","6.3.21-34d0010985ea0a0c5540e8ccaeb266d46edc352e.0":"2020-12-02T13:45:02.021Z","6.3.21-2b45a790b10593f26695c0550be1987499e6aee1.0":"2020-12-03T09:06:59.147Z","6.3.21-394e0f49e042001e4d0b00017824cbee73fd4b35.0":"2020-12-03T09:08:08.688Z","6.3.21":"2020-12-03T09:08:39.785Z","6.3.22-766e7ca3168d349dbc9fc6b84e8e2599f6f1c494.0":"2020-12-03T09:09:15.852Z","6.3.22-dbf95293af5eca3a9ed52d8428772a8a3f0193ec.0":"2020-12-03T09:09:53.134Z","6.3.22-58057dc9328c6215cef5aa62771ee10b065e8939.0":"2020-12-03T09:10:23.404Z","6.3.22-71fa4732279fcf1aa6714556b041db00c09d3e65.0":"2020-12-03T09:10:34.649Z","6.3.22-4010518fbf0a99c6aeb91e08a26db2435741fbb1.0":"2020-12-03T09:10:47.713Z","6.3.22-42b16961d3a6cb284ba946f5f3ac0ff4ab27710f.0":"2020-12-03T09:12:24.555Z","6.3.22-cb138f5d602702ded42afb62e216b49b5acb7a2f.0":"2020-12-03T21:59:09.223Z","6.3.22-2817613a29954c0f482136211483513892ca68b9.0":"2020-12-03T22:00:35.436Z","6.3.22":"2020-12-03T22:00:57.842Z","6.3.23-34607339a10e6ba666edb2efec90fde9fa852368.0":"2020-12-03T22:01:25.303Z","6.3.23-fd5f17899326ace5dbcb71987dd8a456e0e6b5c1.0":"2020-12-03T22:01:59.968Z","6.3.23-acfc8c2668aa48eb5ad890f251e59c000b20a0c0.0":"2020-12-03T22:02:37.803Z","6.3.23-a6e6e9c1b20d13732ad8d3bdba04a05b5f051ec4.0":"2020-12-03T22:02:51.035Z","6.3.23-87fa86253964706e2b8320377c97efff46bef503.0":"2020-12-03T22:03:06.571Z","6.3.23-dfab9189ce6a6802a8efbc82a65d37f57f8ebc19.0":"2020-12-04T12:55:22.019Z","6.3.23-28bee00f2dc70a37f2badb90739c0333c045da43.0":"2020-12-04T13:00:28.676Z","6.3.23-93e35c129bdb7d779b7d35dd958b995825ba7de9.0":"2020-12-04T13:02:13.650Z","6.4.0":"2020-12-04T13:02:43.265Z","6.4.1-a668a375e04fd1ee2582bf0a38c8c89db1ad6d91.0":"2020-12-04T13:03:07.568Z","6.4.1-2829120f15d29ebfc8c41284ed698e08e875e9cf.0":"2020-12-04T13:05:08.823Z","6.4.1-69d492a03ba9aed89521593c6f93052af39b7a85.0":"2020-12-04T13:05:24.618Z","6.4.1-5a91eb06e3127408a45c5f6375f00ad3a7b17b23.0":"2020-12-04T13:10:30.624Z","6.4.1-ecd9b29159a66c1e2e09ba52b914b96e6ade2f06.0":"2020-12-04T15:45:22.367Z","6.4.1-db3959ae6bc5b81fc1ab08ea6ef0e215b70f50d2.0":"2020-12-04T15:46:47.214Z","6.4.1":"2020-12-04T15:47:00.800Z","6.4.2-a59a497a1f1d8778502d4988ab12091a56d4c3ce.0":"2020-12-04T15:47:56.205Z","6.4.2-3919ba82df6d613962fcfd3f8b3a4cecfd87d344.0":"2020-12-04T15:48:12.839Z","6.4.2-2fea3f4072f007a50aa4a0e79a891fe70c18afd4.0":"2020-12-04T15:48:47.012Z","6.4.2-c1a248c6656ed56b6523b4f03880f0fa3356bd5b.0":"2020-12-04T15:49:00.649Z","6.4.2-f19326af400b8638dc2d6d80b211ac226f256a67.0":"2020-12-04T15:49:15.487Z","6.4.2-3d8a9c754adc4d82754975b49a01e86a30597110.0":"2020-12-05T11:32:40.349Z","6.4.2-190fd18bca80821f2fe175ee4392dd66ab69f3c0.0":"2020-12-05T11:33:42.731Z","6.4.2":"2020-12-05T11:34:00.580Z","6.4.3-ab16c3659ba81754babe5a8e84e7939a69079d5a.0":"2020-12-05T11:34:27.021Z","6.4.3-fb4a3787a44088d3666116582fd9dafa9f0f3439.0":"2020-12-05T11:34:49.545Z","6.4.3-81f16b40d75d75c5ead54f1717405cfefae7acfa.0":"2020-12-05T11:35:38.847Z","6.4.3-1bb96a29efd30e846c3ad3bb54a552f358a9ef44.0":"2020-12-05T11:36:00.434Z","6.4.3-0356e036e163105e16326e34b37f4e1c3cfd15a4.0":"2020-12-05T11:36:24.970Z","6.4.3-6ca52568696d73258585695a2d37fc36dfeeb9a9.0":"2020-12-06T23:47:59.173Z","6.4.3-452ded9da564b8f1ba47dc3b2d282db33582a6d4.0":"2020-12-06T23:49:15.336Z","6.4.3":"2020-12-06T23:49:44.940Z","6.4.4-e833efefa7bdb11e8d620f3e6ccd63b042e1f345.0":"2020-12-06T23:50:07.848Z","6.4.4-bfa241c23d1ac1fbcb421e24bb9bdd17d0b4c8a5.0":"2020-12-06T23:50:19.218Z","6.4.4-cbb25a1be17105af34ecbf0e1957d3b12b73b9cc.0":"2020-12-06T23:50:58.202Z","6.4.4-cd24235c07b8a025562ad75faab0073e0d451e54.0":"2020-12-06T23:51:23.374Z","6.4.4-a206709f05000a0e321770d4746fbeed7360992a.0":"2020-12-06T23:51:34.120Z","6.4.4-b5ae94b0c7da0b4ca667f89f342ff0f0874d57b9.0":"2020-12-06T23:51:51.126Z","6.4.4-cf7f46c30b27d68fa02ed296d186818b94bea1f8.0":"2020-12-07T14:53:28.875Z","6.4.4":"2020-12-07T14:55:18.019Z","6.4.4-02c056509681561a4bb3d045f06b81694f1c142d.0":"2020-12-07T14:55:46.055Z","6.4.5-3272e4ac41e5623558b4aee24e2a796bcaae9c85.0":"2020-12-07T14:56:07.339Z","6.4.5-feab6a4a718e9fcf75814659b84a6d1271ca0d42.0":"2020-12-07T14:56:28.196Z","6.4.5-199a22faedea2b279285f026435310a3fe4157ab.0":"2020-12-07T14:57:00.447Z","6.4.5-0638cec7c4442f751f649ce8e96fb309be040fc8.0":"2020-12-07T14:57:36.267Z","6.4.5-37039847dbc3f91ea2e691f21cf644402fdb7ca8.0":"2020-12-07T14:58:54.141Z","6.4.5-8255902a041ce0d0738e422f4a190fc38fd1e40b.0":"2020-12-07T14:59:50.894Z","6.4.5-831410c14f3316d7375ceadc27edaba4f6c7c591.0":"2020-12-07T15:00:07.133Z","6.4.5-4366d49f5ec7122c1566d00af0417751f929439d.0":"2020-12-08T05:20:08.615Z","6.4.5-a5ac14f58c988be0b6dabbb4746e942a481f5fd2.0":"2020-12-08T08:39:42.213Z","6.4.5":"2020-12-08T08:40:21.135Z","6.4.6-816c30ed870be964aea86196d96d3df5cebf2edb.0":"2020-12-08T08:40:48.235Z","6.4.6-783a6f94708e8d4f99b8c5813ff7f1256834817b.0":"2020-12-08T08:41:50.879Z","6.4.6-1d205036ed753ef4440ceeb086ec5a30c22363e5.0":"2020-12-08T08:43:42.620Z","6.4.6-2f3b07f7d767d844d00cc5fd975f0770d4746674.0":"2020-12-08T08:44:04.475Z","6.4.6-7104010b03274c9a8cdf6773c0cf8997507a71b0.0":"2020-12-08T12:13:42.726Z","6.4.6-af13c55df4604623a469e5d4680ea942fd3e306e.0":"2020-12-08T12:14:43.897Z","6.4.6":"2020-12-08T12:15:02.177Z","6.4.7-808c0a6db614bb3066af323fa3eacdb2d01d6a62.0":"2020-12-08T12:15:44.924Z","6.4.7-f52fbe821588d00a6b88277ee3d7e4ca4a281883.0":"2020-12-08T12:16:50.697Z","6.4.7-7d190bccf4a6dcd63df91ba1a16094503a703038.0":"2020-12-08T12:17:05.622Z","6.4.7-2862077ed738fca8be68e64ebdd9d6b3a8224e74.0":"2020-12-08T13:26:56.895Z","6.4.7-0ac83d6fb4e9eea5a190f2ca25d37d9dddc4217f.0":"2020-12-08T17:13:43.691Z","6.4.7-6e7ab7aa4b32079955e9bd7bea4355c3bad17fb5.0":"2020-12-08T17:15:28.839Z","6.4.8-6fa418d0b3fd6e0cabf97e62a377deb8b901255d.0":"2020-12-08T17:16:05.778Z","6.4.8-476ef1c543826748242574d6d980481eb75230ce.0":"2020-12-08T17:17:33.583Z","6.4.8-fc78d93d82b2a9f1728e14df87ff40e6b47db68a.0":"2020-12-08T20:57:02.924Z","6.4.8-b2f63e6d77724274f1bb13caca3defdd20e77bb4.0":"2020-12-08T20:58:16.757Z","6.4.8":"2020-12-08T20:58:57.107Z","6.4.9-e3529af44ad5f66fbe164f5ed9b5be07f1fcf5bf.0":"2020-12-08T20:59:30.779Z","6.4.9-6669ec85f0da131f09791af0cdd8296140696a2c.0":"2020-12-08T21:00:29.610Z","6.4.9-46a70e79b292fbdb731802071878979e9c36c620.0":"2020-12-08T21:01:01.487Z","6.4.9-d5117c45ada84b11d0c14dbd69ec2b25643050e4.0":"2020-12-09T10:04:33.860Z","6.4.9-bb18674a2f2440a95e8b14a9506b0479902b001e.0":"2020-12-09T10:05:05.173Z","6.4.9-d135d41ca2e0e887a20265d47c44097989306779.0":"2020-12-09T10:05:51.885Z","6.4.9":"2020-12-09T10:06:15.072Z","6.4.10-f3886b7b02cea0beb3955beb03c8d08a5929ca5c.0":"2020-12-09T10:07:05.967Z","6.4.10-7a78d3267bf61f041db5bf0e11dc82571a0ca77a.0":"2020-12-09T10:08:04.972Z","6.4.10-ca8f1ad096f37229c656a41243fc4c43abea0747.0":"2020-12-09T11:20:38.735Z","6.4.10-94ccdb8b27635a6bf4e62f1a2c2b10d158247910.0":"2020-12-09T11:21:59.900Z","6.4.10":"2020-12-09T11:22:14.987Z","6.4.11-c418d6c7a41f388c831b754215de57f6eb53783a.0":"2020-12-09T11:22:45.899Z","6.4.11-a6f29f5c8c702726932aa94a97e554794b7ec5b8.0":"2020-12-10T09:12:40.317Z","6.4.11-fe231c53b200540ed0464b197549082acef3d990.0":"2020-12-10T09:31:08.840Z","6.4.11-dc7796f268c8f93a834d4a1c2d8dd0d53520d57e.0":"2020-12-10T09:32:36.743Z","6.4.12-44ae01183c353a5052fec61e6fa81badb7255dce.0":"2020-12-10T09:33:08.896Z","6.4.12-afb83231ccec7c371329a1ad329e50bb9b85993b.0":"2020-12-10T10:10:17.867Z","6.4.12-7d38174d58108831dcc4caa90022635eb0b6c656.0":"2020-12-10T11:01:04.005Z","6.4.12-34fa7f9796fd3c28a328c88b0ddd4608cd88e99d.0":"2020-12-10T11:02:38.322Z","6.4.12":"2020-12-10T11:03:08.056Z","6.4.13-67416f98548b63fd9240e1f442a984a1997bd3fe.0":"2020-12-10T11:03:36.929Z","6.4.13-0a0cd1f3864d9568f73ff2d4402a094bd55b0f46.0":"2020-12-10T18:52:25.214Z","6.4.13":"2020-12-10T18:54:17.197Z","6.4.14-e41cf4bdc3101d9c5d70bd5c234d127d7e40f647.0":"2020-12-10T18:54:48.909Z","6.4.14-90c948e243b2609baa957331eba4dcf66668dd20.0":"2020-12-10T22:48:35.363Z","6.4.14-f62cfe94155b87d068e1d417220025381c2ff842.0":"2020-12-10T22:49:59.064Z","6.4.14":"2020-12-10T22:50:12.173Z","6.4.15-1f276bb8bcf090b684d37f17b8cbee0accd889ad.0":"2020-12-10T22:50:38.889Z","6.4.15-15728056983386a22956561fdfc7db7771f7ac54.0":"2020-12-11T05:36:57.255Z","6.4.15-75f41eab05f6176f7efeec7a577b1af8f34e21a4.0":"2020-12-11T05:38:24.874Z","6.4.15":"2020-12-11T05:39:39.650Z","6.4.16-835df33b8c4331df2508d0814eafb98871a20ece.0":"2020-12-11T05:40:02.822Z","6.4.16-455ee2c6f766beb4d1fb382b64027fa0bd55e71f.0":"2020-12-11T21:34:44.546Z","6.4.16-3dab4b2052734c90ca5fca9b1752270e892b0967.0":"2020-12-11T21:36:09.045Z","6.4.16":"2020-12-11T21:36:27.590Z","6.4.17-6671194aec7dc188d4824c86cd7dc6548589d8d9.0":"2020-12-11T21:36:59.718Z","6.4.17-2cd9695326eaa59d994f7e89303b0d6ba5805072.0":"2020-12-11T23:40:26.360Z","6.4.17-1a5d2d3ecb359ad2e638c309aade3168d7d534a8.0":"2020-12-11T23:41:42.441Z","6.4.17":"2020-12-11T23:42:08.308Z","6.4.18-f2854239a8651c7ef6a9ea3d00443b3b7d7b4382.0":"2020-12-11T23:43:17.588Z","6.4.18-8dd0f8484522d5f28b4fae21beedb9409be413ab.0":"2020-12-11T23:50:47.074Z","6.4.18-c00535ee38856187086e664985d88f45b776cb77.0":"2020-12-11T23:52:08.650Z","6.4.18":"2020-12-11T23:52:36.454Z","6.4.19-6329a6589dcd18c710f89645f79ef45d1a6ffbec.0":"2020-12-11T23:52:57.804Z","6.4.19-36ed4a4a8266ecf4818e9e0b83604116e40dcb2f.0":"2020-12-12T12:22:28.167Z","6.4.19":"2020-12-12T12:24:24.913Z","6.4.20-ba627162b077a04000602931f4f6c1d54f0b57a9.0":"2020-12-12T12:24:52.856Z","6.4.20-3d67a06a50065b68d98160ec83b1a7f05e65357d.0":"2020-12-12T17:51:40.348Z","6.4.20-11553d7c94bca3bebfdeb4f0c2c443b14797b238.0":"2020-12-12T17:52:59.190Z","6.4.20":"2020-12-12T17:53:20.750Z","6.4.21-81245fcd06c984c01648ed8b0bed699368f33528.0":"2020-12-12T17:53:50.298Z","6.4.21-0505d1afabb5ee521715e989c30cc8a9b3e22193.0":"2020-12-13T09:03:24.638Z","6.4.21-26d6545899bc1278d59b172c65d54e6561e5427c.0":"2020-12-13T09:05:00.597Z","6.4.22-1dbd879f0b9298cdb0515ea659f2db434b803a99.0":"2020-12-14T05:52:03.530Z","6.4.22-212f1dada127ea24ffa3e32ebe046a27a695867f.0":"2020-12-14T05:53:32.889Z","6.4.22":"2020-12-14T05:54:25.368Z","6.4.23-e6de55d67833e1e6e9667fdf3f4d308045f5fe17.0":"2020-12-14T05:54:47.474Z","6.4.23-88f84f0b840887b49c903988fe29ff69aece0875.0":"2020-12-15T05:30:28.231Z","6.4.23-38db68bc6c9e16feed623e12ed7df6f4f221de45.0":"2020-12-15T12:28:55.544Z","6.4.23-fdbaa097a9575f7a339f07bb2b4ecff7a6a58572.0":"2020-12-15T12:31:14.342Z","6.4.23":"2020-12-15T12:32:27.377Z","6.4.23-cd3cf9a15c7b71c7b243cd176e52012e1e3a6aa4.0":"2020-12-15T12:37:10.810Z","6.4.24-397df079ce12b978b68b34288b43959a8dabb533.0":"2020-12-15T12:38:17.961Z","6.4.24-69a943a6453579c1ab8f30885bfba10de9b8d4d6.0":"2020-12-15T12:39:19.403Z","6.4.24-080d7395359c4c53ea0c5d1c683172f9d71b6ae4.0":"2020-12-15T16:05:48.673Z","6.4.24-21509318644c1c76e350db89f7f61dab8ced83e4.0":"2020-12-15T16:51:55.981Z","6.4.24-0ac3b92c0f8145a2efce8eb83719d3c839ebda28.0":"2020-12-15T16:54:47.862Z","6.4.24":"2020-12-15T16:55:14.663Z","6.4.25-0c67495450bf2df445dada5f2d2d5bc35fecd5ab.0":"2020-12-15T16:58:02.900Z","6.4.25-e2cac5dea07713cfd65d7c144590e0a05dfccf7c.0":"2020-12-15T17:00:15.482Z","6.4.25-04ccd866ff5299f65318a8198aab91b181ff2924.0":"2020-12-15T17:01:44.271Z","6.4.25":"2020-12-15T17:03:50.377Z","6.4.25-92815400669eb8a4615c919b80ff3997011361f6.0":"2020-12-15T17:04:06.373Z","6.4.26-aeb1fb0f58029de685f5775179633a3ae44a66e4.0":"2020-12-15T17:05:17.970Z","6.4.26-f5582fdf9490f6e1d615040cf75389b7a219a676.0":"2020-12-15T17:06:26.823Z","6.4.26-f3a96eb5072710fc8ba439336a0c192ca313cf4b.0":"2020-12-16T14:40:16.270Z","6.4.26-bf6800d5f8c5ec80425ede2ae6e149b3d7221475.0":"2020-12-16T14:42:47.117Z","6.4.26":"2020-12-16T14:43:37.708Z","6.4.26-bb1aac872446166c5f1c8ed18723a8e6f457e893.0":"2020-12-16T14:45:55.230Z","6.4.27-4ddca1e7a872fd68099f450d3b1f214da1de9541.0":"2020-12-16T14:47:22.244Z","6.4.27-78414af83ffd62881d29b9aefcea4ff51a2abc69.0":"2020-12-16T14:48:38.612Z","6.4.27-10973d81841fbab85c9357174ff89d9b8e8880bf.0":"2020-12-16T17:32:04.650Z","6.4.27-9da5396143b594fde6168b8023707c01b3cdbf99.0":"2020-12-16T17:33:54.671Z","6.4.27":"2020-12-16T17:34:11.743Z","6.4.28-1b335c5b1360309d7450bc2e109ff52d385db03b.0":"2020-12-16T17:34:41.067Z","6.4.28-f70874a0dceda3c3f1bacb0ca15d4c212d2918e8.0":"2020-12-16T17:35:55.019Z","6.4.28-fbd49a88d980248deb58e69223844a0cf34267f6.0":"2020-12-16T20:41:51.110Z","6.4.28-2e37e381554dbc26ac53be058405f317aeee2e03.0":"2020-12-16T20:43:05.162Z","6.4.28":"2020-12-16T20:43:47.236Z","6.4.29-4ae2b16e55853506e3ce10e5d2feb19ede6e2d68.0":"2020-12-16T20:44:07.548Z","6.4.29-f674009da00130732f2a90c215d5d3995fe8d247.0":"2020-12-16T20:45:31.323Z","6.4.29-e62647cbc0b5bae715d1ddbcd21d7145a51d172d.0":"2020-12-17T12:18:20.204Z","6.4.29-8b22ccc2d19a33e406bef1d49c19dcbc8c0d57ee.0":"2020-12-17T12:19:53.687Z","6.4.30-1e4c564baf5608701e0686ecc8c19cba18b3bd08.0":"2020-12-17T12:21:57.560Z","6.4.30-42a2eb3bee6417dfee0349e15ce1d6a11265ef9f.0":"2020-12-17T12:24:19.664Z","6.4.30-5e384a1310047eecef5c011b5a4085c9b9ffd8f1.0":"2020-12-18T22:08:00.324Z","6.4.30-cf9a6d8501af1038582efbb2951b6f206555b050.0":"2020-12-18T22:09:31.384Z","6.4.30":"2020-12-18T22:09:52.123Z","6.4.31-2220c20dbb85ba6cefb0df79ee31122d6c93d54a.0":"2020-12-18T22:10:35.052Z","6.4.31-c0d0e259caff3d16689dd0abe12a0869426c1408.0":"2020-12-18T22:11:57.311Z","6.4.31-b152a2775a31cedcbd8b6b4960faa8e9d235b55e.0":"2020-12-21T05:39:25.350Z","6.4.31-3a551877cf0eb4e128da44cd2928ba6625954558.0":"2020-12-22T05:37:41.766Z","6.4.31-e512475ca1a2a8d802438c92cb75c869c9a1de79.0":"2020-12-22T07:26:39.502Z","6.4.31-13feadf18ab8ce317bdc22882824808403ee7b7c.0":"2020-12-22T07:28:06.280Z","6.4.31-cf3d76662d44b6b8d2b40c6e5c962fabb872c6f6.0":"2020-12-22T07:28:21.081Z","6.4.32-77597f2705974f47a75d15a91494510b88647e7e.0":"2020-12-22T07:28:54.711Z","6.4.32-9d5b698bbc6a21c1cb47660ebb8a6fd49c6653f9.0":"2020-12-22T07:31:14.192Z","6.4.32-336aa25ef74a3cfb1437915c927f95d6f4a9da39.0":"2020-12-23T20:32:52.867Z","6.4.32-42ddfaf4d270faad39d9117637fb4617e5a00732.0":"2020-12-23T20:34:12.402Z","6.4.32":"2020-12-23T20:34:28.884Z","6.4.33-b53eaf12c40a7c8bd898d1093dd625086d9319ae.0":"2020-12-23T20:34:53.521Z","6.4.33-3121a1ec83262e31d80299d8c5274f484ee85be6.0":"2020-12-23T20:37:06.616Z","6.4.33-141629388a799aac51c2f95311aad52eb37209cb.0":"2020-12-24T05:23:22.262Z","6.4.33-c22ac0c765ddcf5cb65320ad9e95f53b0409712b.0":"2020-12-27T08:29:33.029Z","6.4.33":"2020-12-27T08:31:25.701Z","6.4.33-23cf2efce867a9e3221df67f05dc452742444ae2.0":"2020-12-27T08:31:59.036Z","6.4.34-e0ffefa393ffe1c51bf6b2f03e42b9dfcb2d37ef.0":"2020-12-27T08:33:14.980Z","6.4.34-794fa2995432c6d1fbc3ae783032d6ae2191d250.0":"2020-12-27T08:35:37.578Z","6.4.34-7c1c57143fe656728c38a3812b4aaa7bcb88dc82.0":"2020-12-28T09:47:35.276Z","6.4.34-93c2c3e66e3dbb0c71cde9ee72f53473642f5a97.0":"2020-12-28T09:48:44.961Z","6.4.34":"2020-12-28T09:49:11.269Z","6.4.35-d2689d6d8fea8a1fbab29f1154648016dd4800b4.0":"2020-12-28T09:49:39.556Z","6.4.35-28a43cd6a00156817aae87e0a15f8b3bdf95ccb4.0":"2020-12-28T09:51:26.772Z","6.4.35-68650bf87f18cbe7abb7753433aa572b6570cac5.0":"2020-12-30T21:30:08.765Z","6.4.35":"2020-12-30T21:31:57.358Z","6.4.36-86729c028fea6800a0e32544b521e7d7df796e1b.0":"2020-12-30T21:32:18.568Z","6.4.36-25dffa546edfa9062a5bf916e918d43f9c505bba.0":"2020-12-30T21:34:36.932Z","6.4.36-5fbf2f22260e14c10b35d0cd8e5f05925f23b1e7.0":"2020-12-31T14:03:01.945Z","6.4.36-0e037f0ebadb6314321c790bca98dfc3de2e3b1f.0":"2020-12-31T14:05:06.073Z","6.4.36":"2020-12-31T14:06:17.333Z","6.4.37-5dd2122e379ea5d29d9273eca3136757e8d7e6a7.0":"2020-12-31T14:09:10.098Z","6.4.37-6568e2ec7c8ab7c21ee2d3150d7f83ecaa7b562a.0":"2020-12-31T14:09:35.154Z","6.4.37-8d0cf5fd5ae6e21a72e45186cbc5fff6d45ff69b.0":"2020-12-31T14:11:02.140Z","6.4.37-12f28df622da8f3d3d45d6619a3d93f1b92c686b.0":"2021-01-01T17:52:06.299Z","6.4.37-2e7356d6f7bc4ddc484841c620c27c1a6e3a0ddb.0":"2021-01-01T17:53:05.893Z","6.4.37":"2021-01-01T17:53:24.396Z","6.4.38-5b91f09412029f13843a985f4c1d84e5f2e8b2c1.0":"2021-01-01T17:53:42.298Z","6.4.38-394a660110c8a63803b6a54a3aaef45ee7335253.0":"2021-01-01T17:55:44.178Z","6.4.38-77308c01d54d048025a5a98f875adaa7becae185.0":"2021-01-01T18:07:43.299Z","6.4.38-344c28cf585bde610696f797fec4c2e9b3605a57.0":"2021-01-01T18:08:27.540Z","6.4.38":"2021-01-01T18:08:53.398Z","6.4.39-20fefd4a3a5c8c47004106f9b0268c5b94e7262f.0":"2021-01-01T18:09:22.126Z","6.4.39-59e5adc1924e4abfc20d1dace72784c3015f63e6.0":"2021-01-01T18:10:55.283Z","6.4.39-105ffea981c9f1784b42533f6a0c19b447238402.0":"2021-01-02T03:10:11.367Z","6.4.39":"2021-01-02T03:12:08.457Z","6.4.40-fa2b7fd0ef30296b3f0416df38ed9ac951463170.0":"2021-01-02T03:12:35.193Z","6.4.40-406041063daef157ebac25c433b4b31890dc4da4.0":"2021-01-02T03:14:21.497Z","6.4.40-05dd2f2b585857fbc7bccbba1bcdaecf4d6a4de7.0":"2021-01-04T21:06:15.528Z","6.4.40-4fca56b7f1dc6d051612de79f7a825a3c19b33e6.0":"2021-01-04T21:07:55.933Z","6.4.40":"2021-01-04T21:08:16.388Z","6.4.41-ff0e34ad73d57c651fd213acbfe84371f5c42402.0":"2021-01-04T21:08:45.958Z","6.4.41-77de43fd113638194f9337caa9aa08283d703b81.0":"2021-01-04T21:10:20.547Z","6.4.41-3a3dff5bfd647da648b807d8feb702e61b09fab3.0":"2021-01-04T21:12:44.776Z","6.4.41-34950411b106a76929134cb8d724511e81e00327.0":"2021-01-05T15:29:01.861Z","6.4.41-4cd3aa8a18ff2539365ee48db451d4a694472746.0":"2021-01-05T15:31:15.714Z","6.4.41":"2021-01-05T15:31:46.531Z","6.4.42-06a1c86629fea8d6144a135077fa92c1c0590f8f.0":"2021-01-05T15:32:27.847Z","6.4.42-ef5045b4f871976ffec4aee8119884c982f40639.0":"2021-01-05T15:35:30.680Z","6.4.42-b2cbcd6c9e9694a713ce13ad20dcf021532188da.0":"2021-01-07T09:41:39.105Z","6.4.42-f80af497dd7ab6d407f249cd72a40349582fbeb2.0":"2021-01-07T09:43:13.509Z","6.4.42-d7c2a6d8607c1df0e4a74ff04dc94cea9bafa020.0":"2021-01-07T09:45:46.298Z","6.4.42-8a7fb6b0dcf05b582fccd8ffd38d0c8e15d38e96.0":"2021-01-08T19:39:44.973Z","6.4.42-26c704a2dd8feaa0009b2ed28257cdec8014f33a.0":"2021-01-08T19:41:04.755Z","6.4.42":"2021-01-08T19:41:28.651Z","6.4.43-561b6160cad16726139153feaf89e1923785d2bf.0":"2021-01-08T19:41:51.487Z","6.4.43-0ee159c076e08de2e7bc4d63edd377bf9fbe71b6.0":"2021-01-08T19:43:34.302Z","6.4.43-1e6f7d86d27b3c7b6fa9c7e124b0c798f83eba1c.0":"2021-01-14T15:52:04.973Z","6.4.43-6d44bbc09dcc91d625256e3f102a9893792edd78.0":"2021-01-14T21:43:50.522Z","6.4.43-3e0d38f5e1978ff3ffbc31ac9fe93fa61e136e9c.0":"2021-01-14T21:45:20.971Z","6.4.44-657845f6838b8a7bdcb686954678dd1daae2c089.0":"2021-01-14T21:45:52.323Z","6.4.44-04e806d6044f0ad27b78184fe7986a80cf070f6a.0":"2021-01-14T21:47:48.977Z","6.4.44-02bfa62acd1cca03accd3974a3ee0b27b14c623d.0":"2021-01-15T22:27:07.113Z","6.4.44-2047caead4eb981f2916673469f6fcbcbf30f980.0":"2021-01-15T22:29:01.677Z","6.4.44":"2021-01-15T22:30:04.532Z","6.4.45-6b1294382146b342d37532cc636f2437b9e7a928.0":"2021-01-15T22:31:01.572Z","6.4.45-adc9298a6ff78f54265e523bb3dec639637a00c9.0":"2021-01-15T22:33:27.125Z","6.4.45-e36d6159952eb11005fe0056aa2c5ae6f6e7bbb4.0":"2021-01-15T23:31:52.002Z","6.4.45-8477f858b3fe0442765e4ccc03856a10ee090525.0":"2021-01-15T23:33:30.566Z","6.4.45":"2021-01-15T23:34:38.340Z","6.4.46-4ca54d438da551e1b2b6e7058bf8103be8b32979.0":"2021-01-15T23:35:03.909Z","6.4.46-0328586162dd818088104976fa3853d70c6d9e4e.0":"2021-01-15T23:36:08.634Z","6.4.46-60a91c81bcd6b4fbae462d4850bbfdb72151eee6.0":"2021-01-15T23:38:11.289Z","6.4.46-85e247536e34049289aca80f83efee8561537f9a.0":"2021-01-19T23:33:15.666Z","6.4.46-9b18e2d7becbddef2a7a45370639bc33727df6e2.0":"2021-01-20T00:56:45.121Z","6.4.46-8d5b7e41e2fbf0b64784ae100c0b3c22bd283249.0":"2021-01-20T00:57:01.559Z","6.4.46-862d9917bc05138864a851e705ba1273548a69ec.0":"2021-01-20T11:01:36.086Z","6.4.46-10656ecca7b545ce29feb66bd9f704ea012cec48.0":"2021-01-20T11:06:04.290Z","6.4.46-76205f750fc7d90ad8677120467655c577eb412c.0":"2021-01-20T12:22:03.030Z","6.4.46-190e14da78a48d76741b28a8e7e8cdc19f878850.0":"2021-01-20T20:10:49.840Z","6.4.46-e339f98b022c5fbb0a8cb9dc319d605fdf14a4ce.0":"2021-01-21T05:29:17.408Z","6.4.46-4c017c2189069556cebd1bbb5d03c7cae5b93a43.0":"2021-01-21T12:39:40.077Z","6.4.46-352c4f9ccf05e3faa51688dc6100d46a3660a84d.0":"2021-01-22T18:59:36.960Z","6.4.46-e927f64c34e948c6ddf9923bc050058d6558be84.0":"2021-01-23T08:26:19.209Z","6.4.46-9a6b305ea1f1ff80defdbd1d6953bbe7f878f38b.0":"2021-01-23T14:49:31.286Z","6.4.46-125c2208ba10458d80896dc96cfc7f04b477c8b3.0":"2021-01-26T05:20:33.038Z","6.4.46-b218b7aba80d274125e8f721d34249ac5b27fb4d.0":"2021-01-26T09:36:55.612Z","6.4.46-ce946774ca78f12f5a49fdd681fa3b48e5551ebf.0":"2021-01-27T04:15:48.002Z","6.4.46-f1b99d61a73c0efc5d66f1f51da9c3ab2b939815.0":"2021-01-27T09:46:10.089Z","6.4.46-0503eceb104784e4112d1406a88f24677b0d108f.0":"2021-01-27T13:05:30.472Z","6.4.46-8a7fbc3ead37e642e4a340a54b6b0f3980a0cadc.0":"2021-01-28T00:42:30.096Z","6.4.46-6801f07a1d10e3cf633cf33d76401f08fde3fa85.0":"2021-01-28T20:04:02.433Z","6.4.46-ae9d9a4c2355dec458bb624365531e4af3ae587d.0":"2021-01-29T13:55:40.802Z","6.4.46-f79138b31cd0800ce4b1658a683c93a01f008993.0":"2021-01-30T03:34:37.138Z","6.4.46-7e3801c1f25f0204378bc0845cb72e7ebebf681e.0":"2021-01-30T18:26:25.002Z","6.4.46-2a8aa85e79d996f2f9496bc4819ebf2e2dd37675.0":"2021-01-30T18:51:22.408Z","6.4.46-6e6ac3d2f1459a5e6b6167de2846fbb81385d92e.0":"2021-01-31T05:04:43.269Z","6.4.46-37697ef04fcd3de39d6361174d43080a27239ae4.0":"2021-02-01T10:06:48.819Z","6.4.46-109a444e8c06509087b29e93d76e588c11d50583.0":"2021-02-01T10:10:23.765Z","6.4.46-e6ac675e77012a4779fbd4fe90a3bf9e8226cdcc.0":"2021-02-01T10:12:25.194Z","6.4.46-b8826911cc63f5a934c4f577ecbc8199135caf55.0":"2021-02-01T10:47:13.406Z","6.4.46-0fa2cc5db13749f089e9ac6b99cf86c220be9f8b.0":"2021-02-01T19:27:42.397Z","6.4.46-3a449b66a41bf0439437aff0a327d38fd026450d.0":"2021-02-02T05:17:22.782Z","6.4.46-83c9ff404098fa44119c6fd4fa576b106680d040.0":"2021-02-02T10:08:17.421Z","6.4.46-bd8285b0db5152ac6a9d5bec9e501d9ffa8c9ced.0":"2021-02-02T10:20:55.282Z","6.5.0":"2021-02-02T10:21:46.283Z","6.5.1-b86809cb12e65b5f58f6cf75bfe4f29589fc2d08.0":"2021-02-02T10:23:09.864Z","6.5.1-06bba2b0dae226257116568cab947ac47aa625a2.0":"2021-02-02T10:23:30.633Z","6.5.1-0c89bf2e892716785e32898fe3091128f2751a16.0":"2021-02-02T10:23:47.410Z","6.5.1-b6d8010c887493d6fc3a0532b62bcfb32475d615.0":"2021-02-02T10:24:12.403Z","6.5.1-c851d6a7d1b56fe52caad4b2c1910ca213b848c2.0":"2021-02-02T10:24:38.070Z","6.5.1-0a4ced4a06be1b8606d5d2880ff39893fb26f8b4.0":"2021-02-02T10:25:14.759Z","6.5.1":"2021-02-02T10:26:03.583Z","6.5.2-2b571d5f28b1ff395e3ecca4fd649ae86f6043b6.0":"2021-02-02T10:26:31.215Z","6.5.2-e6d3324f3252edae344565f110f19f5e08e6ddb8.0":"2021-02-02T10:27:41.149Z","6.5.2-4743464d5cb0b1da0e47dba40729239c32d7286c.0":"2021-02-02T10:29:13.123Z","6.5.2":"2021-02-02T10:29:42.761Z","6.5.3-8edc76d721522376eb67f103327c73173e68276f.0":"2021-02-02T10:30:13.447Z","6.5.3-7ec7b23ac9347ed347416c9900a18aa69890590f.0":"2021-02-02T10:30:26.621Z","6.5.3-7f0a2ca27cade620d026238e9d59be401fbdb629.0":"2021-02-02T10:31:38.080Z","6.5.3-e79fdc909468430603f2ab86f5dca331213997ba.0":"2021-02-02T10:31:54.246Z","6.5.3-d33c4ab6c59a0908a2417d6b6aa0421184edd622.0":"2021-02-02T10:33:23.552Z","6.5.3-2a139675cb12c0c62730038c9dfa71d91ba9241b.0":"2021-02-02T10:33:40.914Z","6.5.4-cf8ae5c578e72978252563b10f07e31057489b19.0":"2021-02-02T10:34:04.910Z","6.5.4-abe83613b26c8e7ad9ea326abae5fa0920391752.0":"2021-02-02T10:35:51.703Z","6.5.4-23048b1cc5211657f573970d282de88a0e554d42.0":"2021-02-02T10:44:08.949Z","6.5.4-40623d1541e3b3ec0b2005a0db822a75b5533f01.0":"2021-02-02T10:45:51.039Z","6.6.0":"2021-02-02T10:46:22.184Z","6.6.1-8c710f64cff3d8a9097215c916ab11e10ce1e3ab.0":"2021-02-02T10:46:47.022Z","6.6.1-91bced852a1f48d55d78ec794933178a719252a7.0":"2021-02-02T10:49:37.569Z","6.6.1-98cef84c40419f930cee0ccb7deca19723596158.0":"2021-02-03T22:56:51.448Z","6.6.1-9bbad76fe8cd4f7cbeb781d44b96fa2124c4fb23.0":"2021-02-03T22:58:15.313Z","6.6.1":"2021-02-03T22:58:34.435Z","6.6.2-26bec3a6de83c8c6fcd165b0a5fa774cc7f0f550.0":"2021-02-03T22:58:54.619Z","6.6.2-c054dfaa7facfff68d273108c05053c11e26522c.0":"2021-02-03T23:00:47.974Z","6.6.2-02eb848215677f99817c7775173e157ee347e974.0":"2021-02-03T23:54:18.031Z","6.6.2-3a8006eb13eadd53c6571953a29db151a06d316d.0":"2021-02-03T23:55:34.212Z","6.6.2":"2021-02-03T23:56:04.970Z","6.6.3-624bf4980659f68a2b8af0aa3dd1ef50c2cb3071.0":"2021-02-03T23:56:55.827Z","6.6.3-c86a1e80dbbf3e9c05cdb41596c1a9b3da98c9d5.0":"2021-02-03T23:59:01.553Z","6.6.3-d7071ca3b965c84cb8f57c3bdc26fcb5df2049c5.0":"2021-02-04T10:14:54.253Z","6.6.3-f4d7268be1a38827d9d9539dfaf2ca37229ac9e8.0":"2021-02-04T10:26:10.977Z","6.6.3-8447b573ce204a789f8370c96789c6ca15553a3f.0":"2021-02-04T10:27:29.915Z","6.6.3":"2021-02-04T10:28:07.127Z","6.6.4-ad082464d8ccee7f0bc6e803d08f7c706b8a0b2d.0":"2021-02-04T10:28:33.230Z","6.6.4-41638ed2ba7df2d7417cd847aa7fa066e5193148.0":"2021-02-04T10:29:49.447Z","6.6.4-e157177d7d9511d89a829e37f053a7f202822a7d.0":"2021-02-04T12:01:44.055Z","6.6.4-e10ccb63232cfe8a0d3c789fa55d534b0d61b728.0":"2021-02-04T12:25:59.227Z","6.6.4-67aa3c1bb06e18cb71908c586aabdf7ed6d4210e.0":"2021-02-04T12:31:22.023Z","6.6.4":"2021-02-04T12:33:25.191Z","6.6.4-a1c46da32b082c1e5b6c54f63c8e2c5e49454a35.0":"2021-02-04T12:35:50.730Z","6.6.4-fb0ae478b907d182022afb1c6d2f7a2fddb93ae5.0":"2021-02-04T12:39:14.795Z","6.6.5-52d510e55a54cbe2892f04b7b4a110a9e4ca5175.0":"2021-02-04T12:41:14.412Z","6.6.5-390c19c45760ee8d0dd05c3855c5da384d8a13f6.0":"2021-02-04T12:42:17.401Z","6.6.5-9e6067445cda872559e3ace8892d35053af29482.0":"2021-02-04T12:42:55.962Z","6.6.5-11f5805259a0893b48921fbdf10c12ed54fdffd0.0":"2021-02-08T05:55:10.008Z","6.6.5-e45fa552455d38ba9903bbc38fe7b3af7194ff92.0":"2021-02-08T05:55:38.491Z","6.6.5-8ca0b8a21e0ae82c0f58cb7c82b3e42bff9c9c55.0":"2021-02-08T05:58:12.462Z","6.6.5-4f672ee6164ce316b57fb3484e625cc7326980f7.0":"2021-02-08T08:09:09.359Z","6.6.5-7642b167186541bec987ccf73250f85fddc1c31a.0":"2021-02-09T05:35:22.829Z","6.6.5-15969d3e7759bff55cd16fec2f46f4fbb38872c5.0":"2021-02-09T05:36:00.720Z","6.6.5-43d899159c8a7c42ab7f96de10711c76f68ce43c.0":"2021-02-09T05:37:32.300Z","6.6.5":"2021-02-09T05:37:57.252Z","6.6.6-66a5b3afe18a704aedcb3fe92546e667f82d7767.0":"2021-02-09T05:38:33.815Z","6.6.6-20f324fa008a23199ea086df506c4ee37066c5be.0":"2021-02-09T07:14:54.508Z","6.6.6-400b44fc3060b5be3d7d21369599e7d226c546d2.0":"2021-02-09T07:16:44.423Z","6.6.6":"2021-02-09T07:17:06.221Z","6.6.6-6635a63ef5167c62a5e48758abc103d4de2cbd6a.0":"2021-02-09T07:17:24.981Z","6.6.7-5913ec6db8e249d8efcd0c2bdc7b5dc5583b348c.0":"2021-02-09T07:18:48.183Z","6.6.7-dd9e9228fb5b857e284b4b26eea8667e6284dea2.0":"2021-02-09T07:19:07.443Z","6.6.7":"2021-02-09T07:19:28.523Z","6.6.8-3af6327522908453f0cecfc63225cc8f811b41c2.0":"2021-02-09T07:20:18.823Z","6.6.8-adea9518d9e702b15a7778b4a17dde24fd92235f.0":"2021-02-09T07:21:07.669Z","6.6.8":"2021-02-09T07:21:56.162Z","6.6.9-ce094d05101cd5853c916a07c33214eb49205934.0":"2021-02-09T07:22:58.178Z","6.6.9-64841b271e4cd3caa14794875e95930e1ee240f9.0":"2021-02-09T07:23:26.493Z","6.6.9":"2021-02-09T07:23:41.739Z","6.6.9-9f4d14eef7d0d13fcfa58bdb92c2c5bdb0bf4e4b.0":"2021-02-09T07:24:42.775Z","6.6.10-abfac28000818cc2902168b9afc3c1809727749f.0":"2021-02-09T07:25:11.893Z","6.6.10-c55adc9ec630c5975262472ee6e682efa22d3413.0":"2021-02-09T07:28:00.627Z","6.6.10-e8a6f3fa4b1d842d56a47ee1f70b29045adc8502.0":"2021-02-10T05:35:01.591Z","6.6.10-7350ed9af19944af206cab55b5777f4db3309df7.0":"2021-02-10T05:36:30.722Z","6.6.10-e3d7754db1347d8bc017ee874c63f80b06639a9a.0":"2021-02-10T05:36:54.480Z","6.6.11-a6f64906c4853dff558385e30b8cb799606de84a.0":"2021-02-10T05:37:20.662Z","6.6.11-dc8cdd4e1cea5643ea43130e677a1723c4fc423a.0":"2021-02-10T05:37:58.332Z","6.6.11-3bfa9f4fab286611f1ea5eb62f8e2745d4800127.0":"2021-02-10T05:38:32.167Z","6.6.11-ecbe517d142b344e8fa8ee48b4e656a49384cf22.0":"2021-02-10T05:39:18.215Z","6.6.11":"2021-02-10T05:39:45.104Z","6.6.12-ea6e5a2d9edc9c999efe7588853d6340c3a817fc.0":"2021-02-10T05:40:18.502Z","6.6.12-27b86f2f6bc3d20f0cc9d66dfe16f3e96ed0b339.0":"2021-02-10T07:17:18.852Z","6.6.12-1ce69cc23384beb47170e58efaa5c8fafbd051de.0":"2021-02-11T12:39:30.829Z","6.6.12-08805114ccbfc72f0f4ad76ed93ca4d9cbce6c90.0":"2021-02-12T05:41:52.849Z","6.6.12-9364e81fc6842365aba5c2236d2533ab8fc76528.0":"2021-02-12T05:42:15.186Z","6.6.12-382c044f6f527accd1220d388d5b99c3477d8eaf.0":"2021-02-12T05:43:10.765Z","6.6.12-c572d8d2508e1d884db3a2c679974260ad1b9b6c.0":"2021-02-12T05:43:42.046Z","6.6.12":"2021-02-12T05:44:06.067Z","6.6.13-6ec51569de81668f22aa0e84ba62af1ba4300dce.0":"2021-02-12T05:44:46.238Z","6.6.13-78b31b2264c8bc1e74fe98b430aba2890ed7d7e9.0":"2021-02-12T07:18:26.781Z","6.6.13-9d361c57e10ef28d905988d6b3a5f96664bf0371.0":"2021-02-15T06:02:35.467Z","6.6.13-2ecced3717357cc30ab3215fe2023c1f73b8eb1d.0":"2021-02-15T06:03:22.614Z","6.6.13-d332973f7108068400379cdfb3db475ad2f816e0.0":"2021-02-15T06:04:02.973Z","6.6.13-09652456e4767c4e8884fe32b46f262c05dfcb20.0":"2021-02-15T06:04:43.033Z","6.6.13":"2021-02-15T06:05:08.295Z","6.6.14-48f1f686d0e8e11aca1a6e606c0f6680b8bb3c3a.0":"2021-02-15T06:05:34.433Z","6.6.14-31635df402ddccfc52c736031f00de8f397e6da4.0":"2021-02-15T08:27:43.387Z","6.6.14-5a6cb6ab0f685fd46c9f53eaef53f1262a518b80.0":"2021-02-15T08:30:22.524Z","6.6.14-4d70407fc22c659796ffc6a8d4fca47d7cf38965.0":"2021-02-15T08:32:00.866Z","6.6.14":"2021-02-15T08:32:23.748Z","6.6.15-4fdc9e117c4c3d09c63cde5644bc2dbd0dae559a.0":"2021-02-15T08:32:46.910Z","6.6.15-8c50e83542684a01edb779df01abc62d88804e85.0":"2021-02-15T08:44:52.838Z","6.6.15-8f2d3e0bf09ec63836c81bc9a5092786db05eacb.0":"2021-02-16T05:34:32.658Z","6.6.15-1e161de9698b14a83319485d55797306993352b7.0":"2021-02-16T14:25:05.259Z","6.6.15-cab0287db1a601a6fe6d0ec6372191684fe43695.0":"2021-02-18T05:33:10.290Z","6.6.15-43aa4ee28f3b3ca2a65a8bc12006bf729afe4a2d.0":"2021-02-19T05:33:09.294Z","6.6.15-117e89243d3b016dc545fdedfe1fc345cc52003e.0":"2021-02-19T05:33:55.730Z","6.6.15-14b4a2b884a74dc7e9a62e4c5b810003cfd69416.0":"2021-02-19T05:34:33.797Z","6.6.15":"2021-02-19T05:34:56.581Z","6.6.16-8669fda3d50c21f12753305610b78ccc2db45bb1.0":"2021-02-19T05:35:23.892Z","6.6.16-2280d773792810c0b8db7d5294d13cefa96951ec.0":"2021-02-19T07:19:34.210Z","6.6.16-3ffd7ca12c9c92596fde6977be0c131b1b1a82f7.0":"2021-02-22T06:01:48.842Z","6.6.16-0925cc661eae5dcc5376c7b001ef3d3f8c30adc0.0":"2021-02-22T06:02:31.283Z","6.6.16-138ace719233007ea003f48679650f24091ed34d.0":"2021-02-22T06:04:01.422Z","6.6.16":"2021-02-22T06:04:24.422Z","6.6.17-2b08381dfa05651f0e9fae4e3747a793bee75b2a.0":"2021-02-22T06:04:51.807Z","6.6.17-1381188f9b94f67b53ba963af1a2344426187d0a.0":"2021-02-22T08:30:29.966Z","6.6.17-589654fa14feeb67f8f002610be1b2131d56b724.0":"2021-02-22T08:30:52.377Z","6.6.17-e213f91e686ab5d5d013d6eeb9dce09a2f6999b2.0":"2021-02-23T05:32:06.531Z","6.6.17-5f637e48aa6425b83858a31aa52315c8927c02b5.0":"2021-02-23T05:33:13.756Z","6.6.17-e14301e7a680b5a737d45283bbaa3a984445ef0f.0":"2021-02-23T05:33:36.141Z","6.6.17":"2021-02-23T05:34:39.398Z","6.6.17-b145bad69fbc5b043a474fdb62a303a13e4d25f7.0":"2021-02-23T05:34:52.647Z","6.6.18-7e0c06701cb12838ed16534bc571f1a3ffdc1e60.0":"2021-02-23T05:35:29.955Z","6.6.18-63d432ebda1ed01446eba38268baa32294403be8.0":"2021-02-23T05:36:15.560Z","6.6.18":"2021-02-23T05:36:38.389Z","6.6.19-e6f3cce6f91ba7ffab46b931771433872f41b3c4.0":"2021-02-23T05:37:12.619Z","6.6.19-9560ad9643d5d30fffaa7fab48e4ec2c71e819f0.0":"2021-02-23T07:05:38.054Z","6.6.19-309f29f2782e5c5be9e2e31d405d29187e3ec2e7.0":"2021-02-23T07:06:56.732Z","6.6.19":"2021-02-23T07:07:27.719Z","6.6.20-f482596cda490505b97ef61695bfac6b9c5266ca.0":"2021-02-23T07:08:01.366Z","6.6.20-6c982e9bbdf1c565b7eb005488a4db2e8223459c.0":"2021-02-23T07:25:40.372Z","6.6.20-137f7f51d565ea5058907f806d3d2b930b72dbfa.0":"2021-02-23T07:27:35.313Z","6.6.20-cdfecdf8eb2866fbf9dee602360288f6ed88047a.0":"2021-02-23T07:28:02.065Z","6.6.20-ecc979bd46994540c92d379c96b58b6e4a7a8a4f.0":"2021-02-23T07:29:53.295Z","6.6.20":"2021-02-23T07:30:23.004Z","6.6.21-fb5646d5a66386c32eb8bd2a4e820484449a61f0.0":"2021-02-23T07:31:27.819Z","6.6.21-3a1f00b59fd267f7c7174db1db10950817e11a37.0":"2021-02-23T07:32:56.331Z","6.6.21-856e4b4b1fdd89030b03947c89077cf71948440d.0":"2021-02-23T07:37:53.805Z","6.6.21-5fa8b8cac7f78a51edf3eda73b92d0e00037844c.0":"2021-02-23T13:39:12.574Z","6.6.21-6754ba04dc918f93f8cbf6dc745d3966e91a05ed.0":"2021-02-23T13:40:46.396Z","6.6.21":"2021-02-23T13:41:12.722Z","6.6.22-3934f7052282bdcf13a30f0c508acf75e8b805f3.0":"2021-02-23T13:41:39.972Z","6.6.22-b74835344027fd673c5d3b43c5c5f937e10c45d5.0":"2021-02-23T13:43:05.654Z","6.6.22-f68bb9171effa7cceeda4e017d12a431ca536f2c.0":"2021-02-23T22:55:41.569Z","6.6.22-7c5efbaea145366a27985e3d90714ec05c7fc337.0":"2021-02-24T05:37:00.802Z","6.6.22-2963c705ac55bd2ffdad5dd0c1f37782983dada6.0":"2021-02-24T05:37:56.149Z","6.6.22-c45919c45bf458831537e748438c94780fe991e5.0":"2021-02-24T05:38:48.198Z","6.6.22-11435d4f24be057977fc4d79afe1bbd9497f24fb.0":"2021-02-24T05:39:05.670Z","6.6.22-b039f1dc6a52126a38264a5d240f85556e6dd13d.0":"2021-02-24T05:39:17.870Z","6.6.22":"2021-02-24T05:39:38.788Z","6.6.23-922601c670a203784f732c922bad3b903c35d7fd.0":"2021-02-24T05:40:15.400Z","6.6.23-483fcce0e85329bd9ebe1eafeca7b692b8ca2342.0":"2021-02-24T07:28:07.770Z","6.6.23-78ef49750ab4faa04902fbe505e17b3abd1d7800.0":"2021-02-25T05:35:24.316Z","6.6.23-f599f94e1ddd94ebae600f8a8362078ec2bb70f8.0":"2021-02-25T05:36:52.714Z","6.6.23":"2021-02-25T05:37:15.087Z","6.6.24-c266dbd2492ea03c5cd4ab1dbfafc2e8c24f8d11.0":"2021-02-25T05:37:45.244Z","6.6.24-9b104f57f0a4bb3d01ea7325f94bd4e506c28b2e.0":"2021-02-25T07:26:02.684Z","6.6.24-2e2a8ca3d39bfc553ca51d1178652b6507b123d4.0":"2021-02-25T11:34:20.500Z","6.6.24-2a5ae6e549743d7a57f1105db6aa47e0d423f1dd.0":"2021-02-25T11:35:04.305Z","6.6.24-37e73b5fc146e1e2d37a0dff7684f6e7190cda54.0":"2021-02-25T12:03:08.195Z","6.7.0":"2021-02-25T12:03:25.169Z","6.7.1-b6a87fca37f4a87968dc5f5e06fa3ce509835a64.0":"2021-02-25T12:03:56.566Z","6.7.1-f8cbc6218f6698ded1c66c5a41574536c3afa144.0":"2021-02-25T12:06:12.164Z","6.7.1-17bb36e39cfac300bc1c7b9b947028aa229eec9a.0":"2021-02-26T05:29:06.725Z","6.7.1-60030c698e31133ad27e77335b338f4a7116906e.0":"2021-02-26T05:30:19.996Z","6.7.1":"2021-02-26T05:30:51.223Z","6.7.2-494f7b86f21687edf2cf8c6628c95aad29132a19.0":"2021-02-26T05:31:18.054Z","6.7.2-66bce3bbb27a66baa6382efd52d3480870decb9e.0":"2021-02-26T07:21:28.202Z","6.7.2-704ff4ac0f3908fcb7033367eec87fd76476c889.0":"2021-03-01T06:38:52.040Z","6.7.2-352e80f5fcf1cac527fa70c30b4bb794780f949a.0":"2021-03-01T06:39:57.592Z","6.7.2-f02723829d89c8891a0ecf1d3c3b5f5cebc4553e.0":"2021-03-01T06:40:15.379Z","6.7.3-4169bed34870ad8be46c20f51034b83d56bea636.0":"2021-03-01T06:41:13.275Z","6.7.3-5e4bd77f0bad511fac2bd0870106ac97b33fa9bd.0":"2021-03-01T06:41:36.604Z","6.7.3-77138c21287614b46ecccf3e970c49d47467eb94.0":"2021-03-01T06:42:20.716Z","6.7.3-d21f27d5a1df1a3ac7f9d65af1cf31c66147244e.0":"2021-03-01T06:43:31.877Z","6.7.3-c05ab8f5d55280a8b2337465572b5ee3fc1da605.0":"2021-03-01T06:43:46.636Z","6.7.3":"2021-03-01T06:44:14.345Z","6.7.4-dd881e655d90d9cfbda3aa91261cbbe3ec2603ff.0":"2021-03-01T06:44:41.939Z","6.7.4-4ad7272c8820c5ff5ff87189c0da78470a0de0cd.0":"2021-03-01T09:09:58.560Z","6.7.4-269e507009a79221aef7a35d309c6b3177420c90.0":"2021-03-01T09:11:10.110Z","6.7.4":"2021-03-01T09:15:24.969Z","6.7.5-60f4e7841161befbcfb8c253224dfd729d147f20.0":"2021-03-01T12:49:00.543Z","6.7.5-efa1e1a8079d6ebfd64f56dbc14347e981f37749.0":"2021-03-02T05:15:19.743Z","6.7.5-cafabbf49ef1947aa6d4bd81d81f55fa7aae1343.0":"2021-03-02T05:16:20.194Z","6.7.5":"2021-03-02T05:17:16.278Z","6.7.5-654125e6cca28daeaf614924f19721b86f982161.0":"2021-03-02T05:17:31.862Z","6.7.6-ad6537e89d292a05396b413fb90b01bb652aa183.0":"2021-03-02T05:18:07.095Z","6.7.6-b4b356d84aa32580232569a13bf96f924c8f360d.0":"2021-03-02T07:09:19.649Z","6.7.6-c20012a2630150d65a1a2ba028695698900b328e.0":"2021-03-02T07:09:57.099Z","6.7.6-9d86a7bd5ac69c04a6eb668336ced6ad30e47ec5.0":"2021-03-02T07:10:55.766Z","6.7.6":"2021-03-02T07:11:20.125Z","6.7.7-9c1e5d816477652d52213d3049ff0abd689915e1.0":"2021-03-02T07:12:34.981Z","6.7.7-5f1f1d2ec46e200d6fb2244480461fcad741d541.0":"2021-03-02T07:27:43.631Z","6.7.7-40b4ca98f68025144a576094e224b02c916ac213.0":"2021-03-03T05:21:29.055Z","6.7.7-19671fb1862d54b99acbbf1a1c84f91c80d0e9ea.0":"2021-03-03T05:22:49.125Z","6.7.7-7c65119c090032d98b71b0fbaa5b0245bdd8ad58.0":"2021-03-03T05:24:12.828Z","6.7.7":"2021-03-03T05:24:35.129Z","6.7.8-29a776776aeb783ddf0c6dccf7ff5beb91d3ff0b.0":"2021-03-03T05:24:57.020Z","6.7.8-1fea954755bd286d77d5743b79f9ea87e8e609e0.0":"2021-03-03T07:19:13.366Z","6.7.8-d665020ee198643e3e0690000388532943d144d0.0":"2021-03-04T05:32:55.133Z","6.7.8-4ae3b9784a532d8bb03c52a7702c00da374443f9.0":"2021-03-05T05:34:07.565Z","6.7.8-1ea9d29281a31211f2f1c0179200d2187f8a68a2.0":"2021-03-05T05:34:56.033Z","6.7.8-54cb72c02d97fcb9c18538de7af4ec1734d46e05.0":"2021-03-05T05:36:03.506Z","6.7.8-810f88f80f96e926da323fd5867842c6b6036317.0":"2021-03-05T05:36:35.544Z","6.7.9-bf5f04fa358fbb4031408d6bb82c8821e810050d.0":"2021-03-05T05:37:31.006Z","6.7.9-e8ea682197e0cd6f3d487ba5c049a7cb32464803.0":"2021-03-05T05:37:52.873Z","6.7.9":"2021-03-05T05:39:18.008Z","6.7.10-119c33db2e816123b2bbb1f9c24c146e844234c0.0":"2021-03-05T05:39:50.224Z","6.7.10-be1768acff12e745b3c466492d190a1e2407fe4a.0":"2021-03-05T07:41:15.715Z","6.7.10-eb66255bba92703159257f3c736b7fca9ae3f6ac.0":"2021-03-08T06:02:11.093Z","6.7.10-3aeb12b01d2338b7e39222a412ff5a49a2a6b281.0":"2021-03-08T06:02:45.076Z","6.7.10-c664cfe294013597489edb2357a9dcac14634b54.0":"2021-03-08T06:03:36.952Z","6.7.10-71b1c2392f205a29b72d17d4d757be21adea49f2.0":"2021-03-08T06:04:26.963Z","6.7.10-819885d7715be249f4e74356def725d4ad60dbfd.0":"2021-03-08T06:05:20.207Z","6.7.10-625f007650308a1d97fb921251b777f7d487051c.0":"2021-03-08T06:06:15.445Z","6.7.10-5505deb98dea096c4835fadde8d544abd6393c90.0":"2021-03-08T09:01:55.828Z","6.7.10-7c5f824de8cad3df91ef5f68df9b33054e529218.0":"2021-03-16T10:39:37.559Z","6.7.10-51cb942db5c5877cf1baefd36ba24bc52eac7125.0":"2021-03-23T15:23:40.208Z","6.7.10-a5962490e89cd5b6f25e49ffc51d021a0ee39d83.0":"2021-03-23T15:41:31.579Z","6.7.10-e26e90a2f148f8a063147dde7c00194b6321d8f9.0":"2021-03-23T15:47:50.916Z","6.7.10-3814a3343fed159ec4ae329be1a62881e64d62c6.0":"2021-03-23T15:50:37.253Z","6.7.10-8a301d7321dc873ae28bd634733042b934fd9d78.0":"2021-03-23T17:30:27.384Z","6.7.10-cddc39b083b03be70ba2573de194834812ded34d.0":"2021-03-23T17:48:45.508Z","6.7.10-7cbb8381c69fc1a4f9c6c6cf288f82a2ed2b08fc.0":"2021-03-23T17:51:01.008Z","6.7.10-93cdff9df3fa7dd3cc05522ce2d663c287a5952e.0":"2021-03-23T17:58:55.322Z","6.7.10-566329b5cd891534a7fcbf495bc2c1ea1613bfac.0":"2021-03-23T18:01:27.122Z","6.7.10-35cf37231ae150d3c030a3eec25dc171695d7e4d.0":"2021-03-25T10:09:52.852Z","6.7.10-dc19f3de0797392d600de62e1dc2ca73f775be4e.0":"2021-03-25T10:14:04.291Z","6.7.10-6ff9b89afccff44847fb412719b2b7ae3f78ffc1.0":"2021-03-25T10:15:12.213Z","6.7.10-351f15fbe3eadb76da876b6ce1f80c00ce199b08.0":"2021-03-25T11:13:37.439Z","6.7.10-03bfc4c732bba8d2ca70b8f18442c696f50d7931.0":"2021-03-25T14:20:40.086Z","6.7.10-20f34bd82103556b49949db24b4f1480ca56415c.0":"2021-03-25T16:47:04.847Z","6.7.10-76a0abe844d0c5afaa93ae1eb6436ff2b07a76a1.0":"2021-03-25T17:07:00.233Z","6.7.10-e3c83bf9e52df6282eb0b3804d73f27397bfecf2.0":"2021-03-26T08:03:43.598Z","6.7.10-88a03d9686e2d5ad321890b2ef842961d87ead00.0":"2021-03-26T16:31:28.933Z","6.7.10-3b08140e3c12d9603fc2089e4791ab25d0cb08f9.0":"2021-03-27T10:09:23.161Z","6.7.10-ad93cad4f39db39bb23a666b37cae346f1abdefa.0":"2021-03-30T10:22:00.164Z","6.7.10-3363256f3ae427c766a78347bfa52f03ef63ebe0.0":"2021-04-01T11:09:52.131Z","6.7.10-8f136a1aa3ec22f970cbc6dc931fc11f5060c0f6.0":"2021-04-01T11:17:41.323Z","6.7.10-853d124c89b0c5924e91fadce80150284610ba74.0":"2021-04-01T11:23:54.194Z","6.7.10-d4e7d6a5a5aa13b446831d3dc7d5c51b7507f509.0":"2021-04-01T11:24:56.828Z","6.7.10-400994d0000ca68a3d9552a2d35a1f14ced6f092.0":"2021-04-01T13:01:00.436Z","6.7.10-12d09b85ebd92303cef322f9b9a17977e661ff40.0":"2021-04-02T07:19:59.911Z","6.7.10-963e7b70c191638f33c9925c7b5966152381cdb7.0":"2021-04-02T07:22:50.744Z","6.7.10-a6bc3265829c6357a10b1be9cc56cf4d95826543.0":"2021-04-06T06:06:51.645Z","6.7.10-deca34fa965a4b7bba264a0d50cc21511fe3d0bd.0":"2021-04-06T06:20:10.860Z","6.7.10-849cbc49671a3a75799888f09ab619d8d9d5394e.0":"2021-04-06T07:43:46.057Z","6.7.10-6e71bd2ed905ae4dfcbb496f06d2acdc79b2ea0f.0":"2021-04-07T08:38:39.420Z","6.7.10-df93c9454f49a0ef5151d96464379017b78472df.0":"2021-04-08T08:37:52.748Z","6.7.10-77ba7503795868fa46f97254b08053f2ab0286a1.0":"2021-04-08T08:48:12.299Z","6.7.10-3f1c013a6ce51eb851a0967bced85eb4d7bdadd7.0":"2021-04-08T10:37:12.813Z","6.7.10-360bab9fb7cd0941475a23f8edffe9bd04606237.0":"2021-04-08T13:17:31.063Z","6.7.10":"2021-04-08T13:17:48.617Z","6.7.11-24549db8df232e417f5bb19c1b4caf6d6c5f208b.0":"2021-04-08T13:18:31.557Z","6.7.11-2685c57730446da93804e0bce3bea2c6f297665e.0":"2021-04-09T11:22:12.004Z","6.7.11-e5b468081a890fc4864a5cdc01213894702f20bd.0":"2021-04-09T11:24:33.439Z","6.7.11-62ac5f17383bbb981f4899d43889c51c7ade04fc.0":"2021-04-12T09:41:45.192Z","6.7.11-4fd14d4207d686836f8d51bd6273647ed7c2ca4a.0":"2021-04-12T09:55:09.457Z","6.7.11-f849936889b25896984eea59fc46b1f4532b5f40.0":"2021-04-12T10:42:22.932Z","6.7.11-a9d3243e066513660113520f774570a689ccb3fc.0":"2021-04-14T08:37:47.728Z","6.7.11-f4187381921f79be2c4150b2d2c5feb58059f29b.0":"2021-04-15T15:00:40.160Z","6.7.11-8ecd381c8d1dbe7a51745398bfb0c3610bc003a0.0":"2021-04-19T09:19:57.357Z","6.7.11-adcfb368d425274189e366ffc732d8efffa05fa5.0":"2021-04-19T09:34:23.329Z","6.7.11-39e844c36e9295efa32c60ba22685e650d7eb9c7.0":"2021-04-19T11:45:47.791Z","6.7.11-31c6327f5f616f790c217150fb247749b6170674.0":"2021-04-19T13:22:39.495Z","6.7.11-2505715fe4920113ca11991ac9ce3d310c7e3509.0":"2021-04-20T16:07:58.716Z","6.7.11-c70e238a2a6f20f70b00d75e6a4cacbc594f0b03.0":"2021-04-23T08:24:23.443Z","6.8.0":"2021-04-23T08:25:06.439Z","6.8.1-254128f4ae96c638fa436c8c8c47b98587c2b5ea.0":"2021-04-23T08:25:41.994Z","6.8.1-63bde5281fc39bf092035716c4da7a22680d87e8.0":"2021-04-23T08:46:22.544Z","6.8.1-98903aa5f751adb04e1441bb595ed359b43e2d5f.0":"2021-04-23T08:49:19.238Z","6.8.1-49c830df9f6835d568b229c9eceb0fd711970d3f.0":"2021-04-23T08:53:03.608Z","6.8.1-8478b6242af378a53e5db80d2a8a1a3695eb612e.0":"2021-04-23T08:54:12.096Z","6.8.1-68b460bb568c2658bc9f2e459d30ccdbdddd97d2.0":"2021-04-23T08:56:03.773Z","6.8.1-d06481cae2bb6551ae222e9d7a61e0b8b623d4dd.0":"2021-04-23T09:05:47.590Z","6.8.1-43acdc316134eacfa3e7cd4a604527d6423d544a.0":"2021-04-23T09:10:53.878Z","6.8.1":"2021-04-23T09:11:26.430Z","6.8.2-3f1f72664b006837ed347a9832af62037c76126b.0":"2021-04-23T09:12:46.817Z","6.8.2-8262b8d9464cde8ce029aeae61359ab3f662710e.0":"2021-04-23T09:40:53.237Z","6.8.2-dd283f9e25479555d42d6a9ddca89bdc02f87f7c.0":"2021-04-23T09:58:47.000Z","6.8.2-8ac0e22fc18498c803c68d1c21b7e3e102a9d331.0":"2021-04-23T09:59:24.102Z","6.8.2-c7c3869783ab6b495ce67e9aaf6784f796e99ffa.0":"2021-04-23T10:10:15.900Z","6.8.2-1d16b77b62b93a25246a60a0b82fb4c3811c0b47.0":"2021-04-23T10:31:05.363Z","6.8.2-974d257f4facecfab266f63b71673f84bee93fb8.0":"2021-04-23T10:34:51.716Z","6.8.3-596ebdf362efcbfc74b84411280812c87b6f0698.0":"2021-04-23T10:35:34.247Z","6.8.3-7ff6dd06e6bd921cbf2120c66995216478a74724.0":"2021-04-23T10:37:20.636Z","6.8.3":"2021-04-23T10:37:37.667Z","6.8.4-cfc351f17a3ad248dc8850b7629cedae5f1dda6d.0":"2021-04-23T10:38:13.980Z","6.8.4-5a02b92b601d821e09599a45c883a204eae65d9b.0":"2021-04-26T09:45:12.315Z","6.8.4-521e12dc92785b5412124799e8995a2942443fcd.0":"2021-04-26T11:23:59.571Z","6.8.4-97384e12054d287ea8162a14aa168306b1b4dfba.0":"2021-04-26T11:28:49.332Z","6.8.4-ccb58c9d309724e3ccdda94566b7eaa820207552.0":"2021-04-26T13:48:31.479Z","6.8.4-a908a9de2db0de631843324e6edcaf65a0809ce7.0":"2021-04-29T06:56:22.312Z","6.8.4-e886e5cd091940bef2495e659420e6d5303c8a25.0":"2021-04-30T06:34:21.144Z","6.8.4":"2021-04-30T06:34:39.504Z","6.8.5-35a7986e8e5b9e366abc16deb5c8fafad967d110.0":"2021-04-30T06:35:11.221Z","6.8.5-bef49c9a258a83be0c55bcd938bd6521c99302c2.0":"2021-04-30T06:40:32.439Z","6.8.5-cda168acfebb042d353bc8ca42b41b2ad632e99b.0":"2021-04-30T06:48:34.284Z","6.9.0":"2021-04-30T06:48:59.777Z","6.9.1-9a3ff2923f442e3e79a57f88f0145c947232f23f.0":"2021-04-30T06:49:40.290Z","6.9.1-8fd9382b83c266ee274d374e6a97dd3d91a182d4.0":"2021-05-05T08:56:10.948Z","6.9.1-bdf4ddce5cff1b82d9076bb2d8a2b11915827ad0.0":"2021-05-05T09:01:44.962Z","6.9.1":"2021-05-05T09:02:05.409Z","6.9.2-1f740fec78c2011643f32251ca0bb4b6c60234c3.0":"2021-05-05T09:02:48.248Z","6.9.2-cb511abdd54151c898f525211a859e1cda641694.0":"2021-05-05T09:39:59.053Z","6.9.2-87f947b83afea7f6ca2baee16060ffb7ac5c54dd.0":"2021-05-05T09:42:47.259Z","6.9.2":"2021-05-05T09:43:14.705Z","6.9.3-164bb66255eb58b7be82acc10725dc165d4ba9e1.0":"2021-05-05T09:43:49.225Z","6.9.3-162b41c37ee3f72f60f7c73e3ce72f426a222ef8.0":"2021-05-06T07:47:11.027Z","6.9.3-f71bfa5cb5710388114a258d9c652a64e58ecf83.0":"2021-05-06T11:43:05.351Z","6.9.3":"2021-05-06T11:43:30.677Z","6.9.4-caa6df3d58aa6ef7d5ba999a856a8146999d713b.0":"2021-05-06T11:44:04.878Z","6.9.4-ede1f5363f6214e9e029491604cf5d981465b171.0":"2021-05-07T12:37:46.490Z","6.9.4-881ae78dce1e6823a6fe8565b06c3cf9377806d7.0":"2021-05-11T07:41:48.328Z","6.9.4-5bea2a4c8a7490fc4faa873c7073aaa5de681130.0":"2021-05-11T07:46:26.531Z","6.10.0":"2021-05-11T07:46:42.460Z","6.10.1-c9487d4148a3062aedeca1bdcffb4c39d717154e.0":"2021-05-11T07:47:20.045Z","6.10.1-336557f65fe01a40d867dcea7769f347479653f5.0":"2021-05-14T12:07:53.848Z","6.10.1-61bcd35dd5bc388c89e554a823c09ccc8419a6ec.0":"2021-05-17T09:07:06.405Z","6.10.1-39d52a2af2efd21fc1603bda2f6a2f3f73fde763.0":"2021-05-17T09:38:03.212Z","6.10.1-7aedc3984902f652ebd03a0004cc8cc21ddb4149.0":"2021-05-17T13:51:59.627Z","6.10.1-959c5b4f9b6d894e5d87ddc0f0c8c0d714e005f4.0":"2021-05-18T06:44:00.639Z","6.10.1-ad76fff782315d19d91b027954f3b7dbbdddaae1.0":"2021-05-18T09:30:29.916Z","6.10.1-757d5602fa6821266cc3cf0adc05741e895c72a8.0":"2021-05-18T10:01:20.362Z","6.11.0":"2021-05-18T11:40:21.491Z","6.11.1-b51c23e2f8b57974f5d8c842e48e0e48c65b58dc.0":"2021-05-18T12:07:46.160Z","6.11.1-28212d94d9091fcbb6ef2545426f57ec3bb97548.0":"2021-05-27T09:34:44.847Z","6.11.1-6e3d9821806d4623951549745d857a8cfcdb153e.0":"2021-05-27T09:37:19.894Z","6.11.1-2a3cf192eadbf7a72a042ad2d2fdb14948dcb91f.0":"2021-05-27T09:44:19.495Z","6.11.1":"2021-05-27T09:54:24.499Z","6.11.2":"2021-05-27T10:01:20.865Z","6.11.3":"2021-05-27T10:39:53.836Z","6.11.4":"2021-05-27T10:47:38.508Z","6.11.5":"2021-05-27T10:51:04.549Z","6.11.6":"2021-05-27T10:54:02.890Z","6.11.7":"2021-05-27T10:56:46.338Z","6.11.8":"2021-05-27T11:00:21.252Z","6.11.9":"2021-05-27T11:30:57.546Z","6.12.0":"2021-05-27T12:02:51.474Z","6.12.1":"2021-05-27T12:58:20.285Z","6.13.0":"2021-05-27T14:02:26.063Z","6.13.1":"2021-05-27T14:38:38.403Z","6.13.2":"2021-05-27T14:42:10.178Z","6.13.3":"2021-05-27T14:45:43.544Z","6.13.4":"2021-05-27T14:48:42.755Z","6.13.5":"2021-05-27T17:16:55.225Z","6.13.6":"2021-05-27T17:33:31.137Z","6.14.0":"2021-05-27T18:07:58.275Z","6.15.0":"2021-05-27T18:24:36.274Z","6.16.0":"2021-05-27T19:06:34.568Z","6.16.1":"2021-05-28T05:14:13.781Z","6.16.2":"2021-05-28T06:03:41.401Z","6.16.3":"2021-05-28T09:11:04.075Z","6.16.4":"2021-05-31T05:47:47.860Z","6.16.5":"2021-05-31T05:49:00.117Z","6.16.6":"2021-06-03T05:33:51.541Z","6.16.7":"2021-06-03T05:36:43.738Z","6.16.8":"2021-06-03T07:43:05.530Z","6.16.9":"2021-06-04T05:37:12.985Z","6.16.10":"2021-06-07T05:50:40.985Z","6.16.11":"2021-06-07T05:52:05.610Z","6.16.12":"2021-06-07T08:17:04.350Z","6.16.13":"2021-06-08T05:13:11.835Z","6.17.0":"2021-06-10T12:26:25.059Z","6.18.0":"2021-06-10T19:33:10.752Z","6.19.0":"2021-06-10T20:43:38.475Z","6.19.1":"2021-06-11T05:18:27.690Z","6.19.2":"2021-06-11T06:18:39.296Z","6.19.3":"2021-06-14T06:09:25.498Z","6.19.4":"2021-06-14T10:40:49.861Z"},"maintainers":[{"email":"julien@ridedott.com","name":"juliendott"},{"email":"subscriptions@ridedott.com","name":"ridedott-bot"}],"description":"A collection of Firestore utilities.","homepage":"https://github.com/ridedott/firestore-extensions#readme","repository":{"type":"git","url":"git+ssh://git@github.com/ridedott/firestore-extensions.git"},"bugs":{"url":"https://github.com/ridedott/firestore-extensions/issues"},"license":"MIT","readme":"# firestore-extensions\n\n[![Coverage Status](https://coveralls.io/repos/github/ridedott/firestore-extensions/badge.svg?branch=master&t=6tldvN)](https://coveralls.io/github/ridedott/firestore-extensions?branch=master)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![GitHub Actions Status](https://github.com/ridedott/firestore-extensions/workflows/Continuous%20Delivery/badge.svg?branch=master)](https://github.com/ridedott/firestore-extensions/actions)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nA collection of Firestore utilities.\n\n## Quick start\n\n### Installation\n\n```\nnpm install @ridedott/firestore-extensions\n```\n\n### Usage\n\n#### Firestore ID to UUID converter\n\nAn extension provides methods to convert Firestore IDs to UUID v4 and back.\n\n<!-- cspell: disable -->\n\n```javascript\nconst { idToUuid, uuidToId } = require('@ridedott/firestore-extensions');\nconst uuid = idToUuid('74NS2s2OIUH5KZRLFto4'); // ef8352da-cd8e-4214-87e4-a6512c5b68e0\nconst firestoreId = uuidToId('ef8352da-cd8e-4214-87e4-a6512c5b68e0'); // 74NS2s2OIUH5KZRLFto4\n```\n\n<!-- cspell: enable -->\n\n#### Subscriptions\n\nAn extension that maintains an in memory cache of a Firestore collection's data\nwith a backing subscription ensuring updates as they occur in the database.\n\nSupports pausing and resuming subscriptions, which can optimize database usage.\nThese operations are handled automatically, based on attached event listeners\nand pending promises. If there are no attached event listeners and no pending\npromises, the subscription is paused.\n\nCollections expose methods to learn about the current state and better optimize\nusage, such as `isActive` and `statistics`.\n\n##### Listen to data changes\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nmyCollectionSubscription.on('documentAdded', (document): void => {\n  // Added document data is available here.\n});\n```\n\n##### Wait for data synchronization\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\n// Contains current documents.\nmyCollectionSubscription.data();\n```\n\n##### Use filters\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      where: {\n        fieldFilter: {\n          field: { fieldPath: 'my-field-path' },\n          op: 'EQUAL',\n          value: { booleanValue: true },\n        },\n      },\n    },\n    },\n  },\n  (document) => document,\n);\n```\n\n##### Use projections (field masks)\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  {\n    structuredQuery: {\n      from: [{ collectionId: 'my-collection' }],\n      select: {\n        fields: [{ fieldPath: 'flat' }, { fieldPath: 'nested.field' }],\n      },\n    },\n  },\n  (document) => document,\n);\n```\n\n##### Access statistics\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nconst statistics = myCollectionSubscription.statistics();\n```\n\n##### Access usage metrics\n\nFirestore usage metrics are collected per subscription. Metrics are reset after\neach call to the `metrics()` method. Returned object has to be logged to be used\nas a source for log-based metrics.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (document) => document,\n);\n\nawait myCollectionSubscription.synchronize();\n\nconst metrics = myCollectionSubscription.metrics();\n\nlogInfo(`Subscription synchronized.`, {\n  metrics: {\n    myCollectionSubscription: myCollectionSubscription.metrics(),\n  },\n});\n```\n\n##### Canonical representation\n\nFor best performance, subscriptions default to use the native (API)\nrepresentation of documents. This is a recommended way to interact with the\nlibrary.\n\nFor convenience purposes, especially when migrating existing code, conversion\nhelpers are provided.\n\n```typescript\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\n\nconst myCollectionSubscription = repository.makeCollectionSubscription(\n  { structuredQuery: { from: [{ collectionId: 'my-collection' }] } },\n  (native: subscriptions.types.ToNativeDocument<MyType>): MyType =>\n    subscriptions.converters.toCanonical<MyType>({\n      mapValue: { fields: native.fields },\n      valueType: 'mapValue',\n    }),\n);\n```\n\n##### Migrating from Firestore SDK\n\nIt is possible to convert Firestore SDK references to native query format with\nthe use of private APIs. This is not recommended, however it can be useful to\nrun locally when migrating.\n\n```typescript\nimport { Firestore } from '@google-cloud/firestore';\nimport { google } from '@google-cloud/firestore/types/protos/firestore_v1_proto_api';\nimport { subscriptions } from '@ridedott/firestore-extensions';\n\nconst firestore = new Firestore();\nconst reference = (\n  firestore.collection('my-collection') as unknown as {\n    toProto: () => google.firestore.v1.IRunQueryRequest;\n  }\n).toProto();\n\n// Log the structured query.\nconsole.log(reference.structuredQuery);\n\n// Use directly (not recommended in production environments).\nconst repository = new subscriptions.Repository({ projectId: 'my-project' });\nconst subscription = repository.makeCollectionSubscription(\n  reference,\n  (document) => document,\n);\n```\n\n## Getting started\n\nThese instructions will get you a copy of the project up and running on your\nlocal machine for development and testing purposes. See usage notes on how to\nconsume this package in your project.\n\n### Prerequisites\n\nMinimal requirements to set up the project:\n\n- [Node.js](https://nodejs.org/en) v16, installation instructions can be found\n  on the official website, a recommended installation option is to use\n  [Node Version Manager](https://github.com/creationix/nvm#readme). It can be\n  installed in a\n  [few commands](https://nodejs.org/en/download/package-manager/#nvm).\n- A package manager [npm](https://www.npmjs.com). All instructions in the\n  documentation will follow the npm syntax.\n- Optionally a [Git](https://git-scm.com) client.\n\n### Installing\n\nStart by cloning the repository:\n\n```bash\ngit clone git@github.com:ridedott/firestore-extensions.git\n```\n\nIn case you don't have a git client, you can get the latest version directly by\nusing\n[this link](https://github.com/ridedott/firestore-extensions/archive/master.zip)\nand extracting the downloaded archive.\n\nGo the the right directory and install dependencies:\n\n```bash\ncd ./firestore-extensions\nnpm install\n```\n\nThat's it! You can now go to the next step.\n\n## Tests\n\n### Formatting\n\nThis project uses [Prettier](https://prettier.io) to automate formatting. All\nsupported files are being reformatted in a pre-commit hook. You can also use one\nof the two scripts to validate and optionally fix all of the files:\n\n```bash\nnpm run format\nnpm run format:fix\n```\n\n### Linting\n\nThis project uses [ESLint](https://eslint.org) to enable static analysis.\nTypeScript files are linted using a [custom configuration](./.eslintrc). You can\nuse one of the following scripts to validate and optionally fix all of the\nfiles:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\n### Coverage\n\n[Coveralls.io](https://coveralls.io)\n\n## Publishing\n\nPublishing is handled in an automated way and must not be performed manually.\n\nEach commit to the master branch is automatically deployed to the NPM registry\nwith a version specified in `package.json`. All other commits are published as\npre-releases.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Built with\n\n### Runtime libraries\n\n### Automation\n\n- [GitHub Actions](https://github.com/features/actions)\n- [Dependabot](https://dependabot.com/)\n\n### Source\n\n- [TypeScript](https://www.typescriptlang.org)\n\n### Delivery\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](http://semver.org) v2.\n","readmeFilename":"README.md"}